Go 1.13がリリースされ、Go 1.12 時代から Go Modulesを利用していたプロジェクトでは、go.modファイルのGoバージョンを変更したいですね。
go.modファイルはgo mod edit
で変更を加えることができます。go help
で使用方法を見ると、editing flagsというflagを指定することでどのように変更を加えたいかを指定します。
$ go help mod edit
usage: go mod edit [editing flags] [go.mod]
Edit provides a command-line interface for editing go.mod,
for use primarily by tools or scripts. It reads only go.mod;
it does not look up information about the modules involved.
By default, edit reads and writes the go.mod file of the main module,
but a different target file can be specified after the editing flags.
今回は、Goのバージョンを1.12から1.13へ変更したいので、次のediting flagsがその用途に該当します。
The -go=version flag sets the expected Go language version.
この説明の通り、所定プロジェクトのgo.modファイルが有るディレクトリにて、
go mod edit -go=1.13
とすることで、go.modファイルのGoバージョンが1.13に変更されます。
以上で、さくっとgo.modのGoバージョンを変更することができます。go help
で書かれている説明は非常にわかりやすいので、こまったらgo help
してみるといいでしょう。