Skip to content

Releases: mpyw/feature

v0.4.3

Choose a tag to compare

@mpyw mpyw released this 15 Sep 16:36
82553ab

What's Changed

  • Pin declscope at 0.4.0 by @mpyw in #17

Full Changelog: v0.4.2...v0.4.3

v0.4.2

Choose a tag to compare

@mpyw mpyw released this 15 Sep 12:49
ef8a07a

What's Changed

  • Add the declscope adoption skill by @mpyw in #13
  • Update the declscope adoption skill to 0.3.3 by @mpyw in #16
  • Bump jdx/mise-action from 2 to 4 by @dependabot[bot] in #15

Full Changelog: v0.4.1...v0.4.2

v0.4.1

Choose a tag to compare

@mpyw mpyw released this 15 Sep 06:20
26aef6d

What's Changed

  • [Claude] Add Go 1.25 to CI test matrix by @mpyw in #4
  • [Claude] Remove unnecessary release workflow by @mpyw in #5
  • [Claude] Add Dependabot configuration by @mpyw in #6
  • Bump actions/checkout from 6 to 7 by @dependabot[bot] in #7
  • Bump golangci/golangci-lint-action from 7 to 9 by @dependabot[bot] in #8
  • Bump codecov/codecov-action from 5 to 7 by @dependabot[bot] in #9
  • Bump actions/setup-go from 6 to 7 by @dependabot[bot] in #11
  • Adopt declscope by @mpyw in #12

New Contributors

Full Changelog: v0.4.0...v0.4.1

v0.4.0

Choose a tag to compare

@mpyw mpyw released this 14 Dec 06:20
13a0bcf

Installation

go get github.com/mpyw/feature@v0.4.0

What's Changed

  • Reimplement GoString for keys with functional option format by @mpyw in #3

Summary

  • Remove GoString from Inspection and BoolInspection
  • Reimplement GoString for key[V] and boolKey to output valid Go expressions with functional option format
    • feature.New[string](feature.WithName("key-name"))
    • feature.NewBool(feature.WithName("flag-name"))
  • Update README with background on Go official proposal (golang/go#49189) and design decisions (Sealed Interface pattern, empty struct optimization avoidance)

Full Changelog: v0.3.0...v0.4.0

v0.3.0

Choose a tag to compare

@mpyw mpyw released this 12 Dec 06:18
375ee78

Installation

go get github.com/mpyw/feature@v0.3.0

What's Changed

  • Add Inspection pattern for ergonomic value retrieval by @mpyw in #2

Summary

This PR introduces a new Inspection pattern that separates context value retrieval from display logic, providing a more ergonomic and flexible API for working with feature flag values.

Key Changes

  • New Inspection[V] struct: Captures the key, value, and whether it was set in a single call to Inspect(ctx). All helper methods (Get, TryGet, GetOrDefault, MustGet, IsSet, IsNotSet) are now available on the inspection result without needing to pass context again.

  • New BoolInspection struct: A specialized wrapper for boolean feature flags with Enabled(), Disabled(), and ExplicitlyDisabled() convenience methods.

  • fmt.Stringer and fmt.GoStringer support: Both Key and Inspection types now implement these interfaces with package-qualified output for better debugging.

  • Breaking change: Removed DebugValue/DebugString methods (replaced by Inspection.String()).

Example Usage

var MaxRetries = feature.NewNamed[int]("max-retries")

// Inspect returns both the value and whether it was set
inspection := MaxRetries.Inspect(ctx)
fmt.Println(inspection)         // "max-retries: 5" or "max-retries: <not set>"
fmt.Println(inspection.IsSet()) // true or false

// All helper methods available without context
value := inspection.GetOrDefault(3)

File Changes

File Description
feature.go Added Inspect() method to Key[V], InspectBool() to BoolKey, fmt.GoStringer interface, refactored existing methods to use Inspection internally
inspection.go New file containing Inspection[V] and BoolInspection structs with all helper methods
feature_test.go Updated tests, removed obsolete DebugValue tests
inspection_test.go New comprehensive tests for Inspection functionality

Full Changelog: v0.2.0...v0.3.0

v0.2.0

Choose a tag to compare

@mpyw mpyw released this 12 Dec 00:56
f138f17

Installation

go get github.com/mpyw/feature@v0.2.0

What's Changed

  • Remove and enhance anonymous key debugging by @mpyw in #1

Breaking Changes

Removed Reason
option Redundant (named keys are sufficient, anonymous keys now auto-include debug info)
type No longer needed after removal

Enhancements

Automatic Debug Info for Anonymous Keys

Keys created without a name now automatically include their definition location (file path and line number).

This allows you to quickly identify where a key was defined, even if you forgot to name it.

Changes

  • Use to capture call site information
  • Add for accurate stack depth tracking
  • Update doc comments and README with new format documentation
  • Extract anonymous key tests to (ensures stable line numbers)

Full Changelog: v0.1.0...v0.2.0

v0.1.0

Choose a tag to compare

@mpyw mpyw released this 11 Dec 18:07
b1c56c1

Installation

go get github.com/mpyw/feature@v0.1.0

What's Changed

Initial Commit

Full Changelog: https://github.com/mpyw/feature/commits/v0.1.0