Skip to content

fix golint errors/warnings of pkg api/#14844

Merged
tiborvass merged 1 commit intomoby:masterfrom
WeiZhang555:golint-api
Jul 30, 2015
Merged

fix golint errors/warnings of pkg api/#14844
tiborvass merged 1 commit intomoby:masterfrom
WeiZhang555:golint-api

Conversation

@WeiZhang555
Copy link
Contributor

Addresses #14756

Signed-off-by: Zhang Wei zhangwei555@huawei.com

@WeiZhang555
Copy link
Contributor Author

janky fails, seems not my problem...

api/common.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.

This actually wasn't golint warnings. I think it's enough to write in type docstring, that that type implements sort.Interface

@WeiZhang555
Copy link
Contributor Author

@LK4D4 updated, thank you for helping reviewing :)

api/common.go Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Not sure you need to write about the implementation and _O(n_log(n))* stuff. The idea would be to tell what byPrivatePort does, something like : "byPrivatePort is temporary type used to sort types.Port by PrivatePort"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm trying to explain why byPrivatePort would have methods Len()Swap() and Less()
It's OK for me to remove the O(nlog(n)) stuff since it's not that necessary.
Updated.

Copy link
Member

Choose a reason for hiding this comment

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

It has these methods to implements sort.Interface 😉 .

@WeiZhang555
Copy link
Contributor Author

@vdemeester Updated. 🚀

@vdemeester
Copy link
Member

@WeiZhang555 could you add the package api to hack/make/validate-lint.

@WeiZhang555
Copy link
Contributor Author

@vdemeester Updated.

@WeiZhang555
Copy link
Contributor Author

Conflict and rebased

@WeiZhang555
Copy link
Contributor Author

@vdemeester What's this problem?

----------------------------------------------------------------------
FAIL: docker_cli_build_test.go:4716: DockerSuite.TestBuildVolumesRetainContents

docker_cli_build_test.go:4740:
    c.Fatalf("expected file contents for /foo/file to be %q but received %q", expected, out)
... Error: expected file contents for /foo/file to be "some text" but received "2015/07/28 03:55:20 error generating version 4 uuid, retrying: open /dev/urandom: operation not permitted\nsome text"

----------------------------------------------------------------------

@LK4D4
Copy link
Contributor

LK4D4 commented Jul 28, 2015

@WeiZhang555 Known problem :/ We have no enough entropy.

@LK4D4
Copy link
Contributor

LK4D4 commented Jul 28, 2015

LGTM

1 similar comment
@RichardScothern
Copy link
Contributor

LGTM

@WeiZhang555
Copy link
Contributor Author

@LK4D4 Got it. :)

@tiborvass
Copy link
Contributor

super sorry @WeiZhang555 but needs another rebase

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
@WeiZhang555
Copy link
Contributor Author

@tiborvass never mind, rebase done. :)

@tiborvass
Copy link
Contributor

LGTM

tiborvass added a commit that referenced this pull request Jul 30, 2015
fix golint errors/warnings of pkg api/
@tiborvass tiborvass merged commit 2f1a7c9 into moby:master Jul 30, 2015
@WeiZhang555 WeiZhang555 deleted the golint-api branch July 31, 2015 02:24
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.

7 participants