Skip to content

Update GetFlag to a generic method (requires go1.27) - #20

Merged
mfridman merged 4 commits into
mainfrom
feat/go1.27-generic-methods
Aug 21, 2026
Merged

Update GetFlag to a generic method (requires go1.27)#20
mfridman merged 4 commits into
mainfrom
feat/go1.27-generic-methods

Conversation

@mfridman

@mfridman mfridman commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Fix #6

This PR does what it says on the tin. It's a breaking change and requires go1.27. But I really think this is the better long-term approach.

- func GetFlag[T any](s *State, name string) T {
+ func (s *State) GetFlag[T any](name string) T {

@mfridman
mfridman merged commit 9bbb306 into main Aug 21, 2026
2 checks passed
@mfridman
mfridman deleted the feat/go1.27-generic-methods branch August 21, 2026 08:38
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.

Moving GetFlag inside State?

1 participant