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

add GetInt helper function to dynamic config #14

Closed
wants to merge 1 commit into from

Conversation

jkw-statsig
Copy link
Contributor

No description provided.

@@ -98,6 +98,19 @@ func (d *configBase) GetNumber(key string, fallback float64) float64 {
return fallback
}

// Gets the int64 value at the given key in the DynamicConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I think all these comments are out of date now that there is layer, and these utils exist on both types. Mind fixing that up?

func (d *configBase) GetInt(key string, fallback int64) int64 {
if v, ok := d.Value[key]; ok {
switch val := v.(type) {
case int64:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we cast other numeric types to int64? What does json give us? @daniel-statsig noticed in other SDKs that json parsing gives you only a certain set of types - does json parsing in go give an int64?

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.

3 participants