Skip to content

refactor(errors): name keep-state errors after dynamic state - #112

Merged
3Hren merged 2 commits into
mainfrom
refactor/keep-state-error-names
Sep 16, 2026
Merged

3Hren merged 2 commits into
mainfrom
refactor/keep-state-error-names

Conversation

@3Hren

@3Hren 3Hren commented Sep 16, 2026

Copy link
Copy Markdown
Member

ErrStateOptionInGroup and ErrDuplicateStateOption said State for the dynamic state keep-state creates, right next to ErrState and the State interface, where the word means a callback. They become ErrDynamicStateInGroup and ErrDuplicateDynamicState, with the messages following ("dynamic state option in OR block", "more than one dynamic state option").

The name follows ipfw(8), which speaks of dynamic rules and states, and FreeBSD, whose ipfw2.c holds keep-state, record-state, limit and set-limit to the same two rules ("only one of keep-state, record-state, limit and set-limit is allowed"). Today only keep-state is checked, and the names stay right when the others arrive.

Found by the pre-release API audit for v0.2.0.

Compatibility

Neither name was released in v0.1.0. The order and the numeric values of the constants are unchanged.

Validation

make test and make lint pass.

ErrStateOptionInGroup and ErrDuplicateStateOption said State for the
dynamic state keep-state creates, next to ErrState and the State
interface, which mean a callback. They become ErrDynamicStateInGroup and
ErrDuplicateDynamicState, the ipfw(8) term, which also covers
record-state, limit and set-limit, the options FreeBSD holds to the same
rules. The messages follow.

Neither name was released in v0.1.0.
…rror-names

# Conflicts:
#	errors.go
#	errors_test.go
@3Hren
3Hren merged commit ea373ae into main Sep 16, 2026
1 check passed
@3Hren
3Hren deleted the refactor/keep-state-error-names branch September 16, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant