`go version -m` prints "Go version and module versions used to build a specific executable" Example from the Go docs https://go.dev/ref/mod#go-version-m > The -m flag causes go version to print each executable’s embedded module version information, when available. For each executable, go version -m prints a table with tab-separated columns like the one below. > > $ go version -m ~/go/bin/goimports > /home/jrgopher/go/bin/goimports: go1.14.3 > path golang.org/x/tools/cmd/goimports > mod golang.org/x/tools v0.0.0-20200518203908-8018eb2c26ba h1:0Lcy64USfQQL6GAJma8BdHCgeofcchQj+Z7j0SXYAzU= > dep golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= > dep golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= However this information seems to be missing in Fedora go binaries: $ go version -m /usr/bin/caddy caddy: go1.19 path github.com/caddyserver/caddy/cmd/caddy build -compiler=gc build -ldflags=" -X github.com/caddyserver/caddy/version=2.5.2 -B 0x5ed1393cc60665b6fd18eda730da04e78c91ee51 -compressdwarf=false -linkmode=external -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/caddy-2.5.2/.package_note-caddy-2.5.2-1.fc37.x86_64.ld '" build -tags=rpm_crashtraceback build CGO_ENABLED=1 build CGO_CFLAGS= build CGO_CPPFLAGS= build CGO_CXXFLAGS= build CGO_LDFLAGS= build GOARCH=amd64 build GOOS=linux build GOAMD64=v1 Presumably the module version information is stripped by some build flag. Could it be added back? Or would it add too much to binary size?
via https://lists.fedoraproject.org/archives/list/golang@lists.fedoraproject.org/thread/PSN3YOKO2YTFPJCHTQG7GDJQ7JK2KWB4/
This is probably because we build in GOPATH mode and don't use Go Modules.
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle. Changing version to 38.