Note that golint will tell you that the document for FrontPageView () should start with
And yes, it’s good practice to include a (short) commentary on all exported methods, functions, as also described in the Go Code Review Comments .
Comments documenting ads should be complete sentences , even if this seems a bit redundant .
This approach allows them to be formatted well when extracted into godoc documentation.
Comments should begin with the name of the thing being described and end over the period:
I understand that effective clean code means saving simple functions with a name that describes a function one role;
Then the document may include edge cases (even if they are not in your case).
In any case, adding a short document will not make it “less clean”.
as they become more complex, you break them down into several equally simple functions.
I use gocyclo for this: the cyclomatic complexity is above 10, and I split the function.
In addition, changes require an update to godoc as well as a name
This is the idea: synchronizing a document (and golint helps)
source share