Skip to content

golint: Fix issues in pkg/nat#14804

Merged
jessfraz merged 1 commit intomoby:masterfrom
dave-tucker:golint_nat
Jul 22, 2015
Merged

golint: Fix issues in pkg/nat#14804
jessfraz merged 1 commit intomoby:masterfrom
dave-tucker:golint_nat

Conversation

@dave-tucker
Copy link
Contributor

Updates #14756

Signed-off-by: Dave Tucker dt@docker.com

@dave-tucker
Copy link
Contributor Author

Ok so I have a feeling that the issues in CI are related to the simply changing HostIp to HostIP in the PortBinding struct.
As we are using the names verbatim when marshalling to JSON, a simple case change will cause a whole world of pain 😢
I've added a tag to the struct to preserve the old-style JSON, but we should probably use something more JSONy like host-ip and/or add tags to all the external facing structs but that is way outside the scope of this patch...

pkg/nat/nat.go Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Format? What do they mean? How should it be used?

@dave-tucker dave-tucker force-pushed the golint_nat branch 2 times, most recently from aa9e90a to 2ec2524 Compare July 21, 2015 23:14
@dave-tucker
Copy link
Contributor Author

Updated based on @stevvooe's review

@stevvooe
Copy link
Contributor

@dave-tucker I would consider code that relies on untagged json structs for serialization to be broken. What tests are broken?

@dave-tucker
Copy link
Contributor Author

@stevvooe failure was in the integration tests
for example, this one in docker-py... https://github.com/docker/docker-py/blob/8a87001d09852058f08a807ab6e8491d57ca1e88/tests/integration_test.py#L605

My hackaround feels wrong on many levels but I'm not really sure what to do here 😕

@stevvooe
Copy link
Contributor

@dave-tucker I see. This is very unfortunate that we let an internal struct escape into API. Your fix is acceptable.

LGTM

Updates moby#14756

Signed-off-by: Dave Tucker <dt@docker.com>
@jessfraz
Copy link
Contributor

LGTM

jessfraz pushed a commit that referenced this pull request Jul 22, 2015
golint: Fix issues in pkg/nat
@jessfraz jessfraz merged commit ff011ed into moby:master Jul 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants