golang:exported function Script should have comment or be unexported

When you define the package to be used outside, if you do not follow certain norms, it will appear annoying green stripe pattern, but also a warning:

While not affect the operation, but also annoying, so how to solve this problem?

Add as a structure or a variable or method comment, and the name must start with a structure or a variable or method, plus a space, plus description

So that no annoying green stripe pattern, and also need to pay attention to the need to specify the name when declaring the structure, namely q * Queue, can not use this to refer to q or self, or there will be a warning:

Guess you like

Origin www.cnblogs.com/xiximayou/p/12005705.html