cilium / ebpf

ebpf-go is a pure-Go library to read, modify and load eBPF programs and attach them to various hooks in the Linux kernel.

Home Page:https://ebpf-go.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unusual `go` directive in `go.mod`

mx-psi opened this issue · comments

The top-level go.mod uses 1.21.0 as its go directive

ebpf/go.mod

Lines 1 to 3 in 32b95e4

module github.com/cilium/ebpf
go 1.21.0

This is an unusual choice that forces every Go module dependent on cillium/ebpf to also specify the bugfix version on its go directive.

As far as I can tell, there is no evidence that using the bugfix version is recommended or encouraged by the Go authors or Go compiler contributors:

  • The go.mod file reference has go 1.14 as an example, no examples with the bugfix version, and indicates that the go directive specifies semantics (which should not change in bugfix versions)
  • The comment here b3432fb#commitcomment-138898478 points to golang/go/issues/62278, which doesn't seem to explicitly advocate for adding .0 in all cases, only as a workaround to a specific issue

What is the rationale for specifying the bugfix version?