Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove shared global state from goflags to make it reusable #154

Open
Ice3man543 opened this issue Nov 10, 2023 · 0 comments
Open

Remove shared global state from goflags to make it reusable #154

Ice3man543 opened this issue Nov 10, 2023 · 0 comments

Comments

@Ice3man543
Copy link
Member

A lot of shared state is kept in the library which makes calling it multiple times from servers unusable.

We should remove global state and make library reusable.

An example causing panic when called multiple times -

var (
	optionMap           map[*StringSlice]Options
	optionDefaultValues map[*StringSlice][]string
)

func init() {
	optionMap = make(map[*StringSlice]Options)
	optionDefaultValues = make(map[*StringSlice][]string)
}
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

No branches or pull requests

1 participant