go-directive-and-version-specification

 go-directive-and-version-specification

The Go gopher was designed by Renée French.

https://gotalk.connpass.com/event/410416/

Kotaro Otaka

November 25, 2026

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

111 slides
  1. #goconnect go.mod files The go.mod file is line-oriented. Each line

    holds a single directive, made up of a keyword followed by arguments. https://go.dev/ref/mod#go-mod-file より抜粋
  2. #goconnect Release Policy Each major Go release is supported until

    there are two newer major releases. For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was supported until the Go 1.8 release. https://go.dev/doc/devel/release#policy より抜粋
  3. #goconnect Release Policy We fix critical problems, including critical security

    problems, in supported releases as needed by issuing minor revisions (for example, Go 1.6.1, Go 1.6.2, and so on). https://go.dev/doc/devel/release#policy より抜粋
  4. #goconnect go directive A go directive indicates that a module

    was written assuming the semantics of a given version of Go. The version must be a valid Go version, such as 1.14, 1.21rc1, or 1.23.0. https://go.dev/ref/mod#go-mod-file-go より抜粋
  5. #goconnect go directive The go directive sets the minimum version

    of Go required to use this module. ~省略~ Go toolchains refuse to use modules declaring newer Go versions. https://go.dev/ref/mod#go-mod-file-go より抜粋
  6. #goconnect go directive go directive は、そのモジュールを使用す るために必要な Go の最小バージョンを指定 します。~省略~

    つまり、より新しい Go バージョンが指定されているモジュール は、Go ツールチェーンによって使用が拒否 されます。
  7. #goconnect A. 1.(N-1).0 以下 B. 1.N.X / 1.(N-1).X C. 1.N

    / 1.(N-1) ※ N ... 最新バージョン
  8. #goconnect Go Toolchains Starting in Go 1.21, the Go distribution

    consists of a go command and a bundled Go toolchain, which is the standard library as well as the compiler, assembler, and other tools. https://go.dev/doc/toolchain#intro より抜粋
  9. #goconnect toolchain directive A toolchain directive declares a suggested Go

    toolchain to use with a module. https://go.dev/ref/mod#go-mod-file-toolchain より抜粋
  10. #goconnect go directive go directive は、そのモジュールを使用す るために必要な Go の最小バージョンを指定 します。~省略~

    つまり、より新しい Go バージョンが指定されているモジュール は、Go ツールチェーンによって使用が拒否 されます。
  11. #goconnect The GOTOOLCHAIN setting The go command selects the Go

    toolchain to use based on the GOTOOLCHAIN setting. https://go.dev/doc/toolchain#GOTOOLCHAIN より抜粋
  12. #goconnect Go toolchain selection auto local path <name> (ex: go1.21.0)

    <name>+auto <name>+path https://go.dev/doc/toolchain#select
  13. #goconnect go.mod × Dockerfile の組み合わせ パッチ × パッチ パッチ ×

    マイナー マイナー × パッチ マイナー × マイナー
  14. #goconnect Kotaro Otaka おーたかこーたろー / @otakakot 2020.04 Web Engineer 新卒入社

    2021.04 Hello Golang! 2022.11 Web Engineer @株式会社ビットキー 2026.03 Go Connect Supporter Gopher6年生

More Decks by Kotaro Otaka

Other Decks in Programming