Skip to content

add GetInt helper function to dynamic config#14

Closed
jkw-statsig wants to merge 1 commit intomainfrom
add-getInt-helper
Closed

add GetInt helper function to dynamic config#14
jkw-statsig wants to merge 1 commit intomainfrom
add-getInt-helper

Conversation

@jkw-statsig
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread types.go
return fallback
}

// Gets the int64 value at the given key in the DynamicConfig
Copy link
Copy Markdown
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?

Comment thread types.go
func (d *configBase) GetInt(key string, fallback int64) int64 {
if v, ok := d.Value[key]; ok {
switch val := v.(type) {
case int64:
Copy link
Copy Markdown
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