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
prefer list format for extra_hosts to preserve backward compatibility #326
Conversation
types/types.go
Outdated
// is specified as a struct tag. Explicitly empty commands (i.e. `[]` or `”`) | ||
// will serialize to an empty array (`[]`). | ||
// | ||
// When marshaled to JSON, the `omitempty` struct must NOT be specified. | ||
// If the command field is nil, it will be serialized as `null`. | ||
// Explicitly empty commands (i.e. `[]` or `''`) will serialize to an empty | ||
// Explicitly empty commands (i.e. `[]` or `”`) will serialize to an empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A wild smart quote has appeared! s/”/''/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤨 Wonder where this came from. Don't even know how to type this character. I assume my IDE tried to be clever ?
@@ -539,6 +539,14 @@ func (h HostsList) AsList() []string { | |||
return l |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a sort.Strings
to ensure stable output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice suggestion!
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
While map format is supported by Docker Compose v1, and proposed to be officially documented (compose-spec/compose-spec#285), still most users rely on the list format and we should prefer this one to enforce backward compatibility.
close docker/compose#10038