環境
macOS Tahoe 26.6.2
Homebrew >=4.3.0 (shallow or no git repository)
go version go1.27.0 darwin/arm64
やったこと
自分は分けているのでbrew出来るユーザで
brew install golangci-lint
普段遣いのユーザに戻って
cd $HOME/[ソースを格納しているディレクトリー]/app
golangci-lint run
[ソースを格納しているディレクトリー]/app/CorsManager.go:27
Error return value of `file.Close` is not checked (errcheck)
defer file.Close()
[ソースを格納しているディレクトリー]/app/CorsManager.go:34
Error return value of `json.Unmarshal` is not checked (errcheck)
json.Unmarshal(jsonData, &conf)
[ソースを格納しているディレクトリー]/app/main.go:24
Error return value of `router.Run` is not checked (errcheck)
router.Run(":xxxx")
[ソースを格納しているディレクトリー]/app/CorsManager.go:28
inline: cannot inline call to ioutil.ReadAll (declared using go1.27.0) into a file using go1.26.4 (govet)
jsonData, err := ioutil.ReadAll(file)
[ソースを格納しているディレクトリー]/app/CorsManager.go:
io/ioutil has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
警告を出してくれたので修正しました。以上です。