使用 Go 定义错误码

帅气猫咪 ·
generate with tool "stringer" ``` type ErrorCode int //go:generate stringer -type ErrorCode -linecomment -output code_string.go const ( Unkwnow ErrorCode = iota //未知错误 ) ``` excute in console: ``` go generate ```
#1