Help us understand the problem. What is going on with this article?

go1.13でgolangci-lint使った時にエラーが多発する時の対処法

TL;DR

GO111MODULE=off go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
or
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.1  

v1.13.1は1020/1/22時点の最新versionです
V1.18未満のversionを使っていると発生する問題だと思います

エラー内容1

goのバージョンを1.13にした後に、golangci-lintを使用した時に以下のようなエラーが多発しました。

internal/domain/hogehoge.go:1: /usr/local/Cellar/go/1.13.3/libexec/src/path/filepath/match.go:215:15: DecodeRuneInString not declared by package utf8 (typecheck)
internal/adaptor/hogege/gehoho.go:1: /Users/xxxxxx/go/pkg/mod/github.com/golang/protobuf@v1.3.2/proto/text_parser.go:255:15: DecodeRuneInString not declared by package utf8 (typecheck)

 原因

直接的な原因は調べていないので分かりませんが、Go1.12以前のgolangci-lintを使ってGo1.13以降のコードに対してlintを行うとtypeの違いから、上のエラーが出るようです。
解決するにはgo1.13でビルドされたgolangci-lintを使用することで回避できます

参考:
https://github.com/golangci/golangci-lint/issues/658#issuecomment-528126696

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした