0x00 issues
exported function xxx should have comment or be unexported。
0x01 solve
https://golang.org/s/style you mentioned on this page
Comment SentencesSee https://golang.org/doc/effective_go.html#commentary. Comments documenting declarations should be full sentences, even if that seems a little redundant. This approach makes them format well when extracted into godoc documentation. Comments should begin with the name of the thing being described and end in a period:
Note record the statement should be complete sentences, even if it looks a bit redundant. This approach makes them a good format when extracted godoc document. Comments should begin with the name of the item, and ending with a period:
// Request represents a request to run a command. type Request struct { ... // Encode writes the JSON encoding of req to w. func Encode(w io.Writer, req *Request) { ...
It is true, golint will throw this warning stating that the code you write does not meet specifications.
In line with modifications to the specification:
In the method call, you can see annotations: