@kyanny's blog

My thoughts, my life. Views/opinions are my own.

Go: golint を CI で使うときは -set_exit_status オプションをつける

つけないと lint エラーが検知されても exit status が 0 になり、 CI が pass してしまう。

$ golint -h
Usage of golint:
    golint [flags] # runs on package in current directory
    golint [flags] [packages]
    golint [flags] [directories] # where a '/...' suffix includes all sub-directories
    golint [flags] [files] # all must belong to a single package
  -min_confidence float
        minimum confidence of a problem to print it (default 0.8)
        set exit status to 1 if any issues are found

GitHub - golang/lint: [mirror] This is a linter for Go source code.