I'm trying to export a constant from a go like this:
package log
const (
FATAL = iota // fatal errors
ERROR = iota // errors might happend
DEBUG = iota // debug mode
) // const for logging levels
But I'm getting golint error :
exported const FATAL should have comment (or a comment on this block) or be unexported (golint)
And it's right I'm getting later error in getting access to log.FATAL etc.
Also you can provide a comment for a set of constants:
// Log level
const (
Debug = iota
Trace
Info
Warn
Error
Panic
Fatal
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With