Skip to content

Conversation

@jerome-quere
Copy link
Contributor

No description provided.

}

// Make sure index is a positive integer.
// We check if argNameWords[0] is an positive integer to handle cases like keys.0.value=12
Copy link
Contributor

Choose a reason for hiding this comment

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

a positive*

StringsPtr: []*string{},
},
expected: []string{
"strings=none",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to support this for non-pointer slices? This is equivalent to not writing the argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not extactly the same
absent => []string(nil)
=none => []string{}

Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK we don't have any use case for this as we always handle []string(nil) == []string{} in our APIs

// If type is a slice:
// We check if argNameWords[0] is an number to handle cases like keys.0.value=12

// We handle special case where array=none creates an empty slice.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: When array=none, creates an empty slice.

Copy link
Contributor

@kindermoumoute kindermoumoute left a comment

Choose a reason for hiding this comment

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

LGTM

@jerome-quere jerome-quere merged commit ecca88a into scaleway:v2 Feb 13, 2020
@kindermoumoute kindermoumoute added this to the v2.0.0-alpha.1 milestone Feb 14, 2020
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