Go 1.18 will embed source version information into binaries

#89 · 🔥 207 · 💬 91 · 2 years ago · utcc.utoronto.ca · nnx · 📷
Since Go 1.13, Go has embedded information about the modules used to build a program into its binary, and has reported them if you used 'go version -m ...'. The go command now embeds version control information in binaries including the currently checked-out revision and a flag indicating whether edited or untracked files are present. The go command embeds information about the build including build and tool tags, compiler, assembler, and linker flags, whether cgo was enabled, and if it was, the values of the cgo environment variables. People who distribute binaries widely and build them doing funny things may now have more of those funny things be somewhat visible, though. Regabiargs build CGO ENABLED true build CGO CPPFLAGS build CGO CFLAGS build CGO CXXFLAGS build CGO LDFLAGS build gitrevision 4f8a1b5f197fc69bc1252b32b5a8ed670ff557b6 build gituncommitted false. I wouldn't be surprised if some of the current build tags go away in the released version of Go 1.18, as some experiments are promoted out of that state. The current Go 1.18 build tags reported above appear to be this baseline state on amd64.
Go 1.18 will embed source version information into binaries



Send Feedback | WebAssembly Version (beta)