Improvements
Improve runtime/debug Go 1.18 incompatibility via stable go.mod file parsing — #129 ⇄ #130 (⊶ df29129)
↠ As of Go 1.18 the debug.ReadBuildInfo function does not work for Mage executables anymore because the way how module information is stored changed. Therefore the fields of the returned debug.Module type only has zero values, including the module path. The debug.Module.Version field has a default value ((devel)) which is not Semver compatible and causes the parsing to fail. The change in Go 1.18 also came with the new debug/buildinfo package which allows to read the information from compiled binaries while the runtime/debug.ReadBuildInfo function returns information from within the running binary. Both are not suitable anymore which is also described in the Go 1.18 version command release notes:
The underlying data format of the embedded build information can change with new
goreleases, so an older version ofgomay not handle the build information produced with a newer version ofgo. To read the version information from a binary built withgo1.18, use thegoversion command and thedebug/buildinfopackage fromgo1.18+.
To get the required module information that was previously provided by the runtime/debug package the official golang.org/x/mod/modfile package is now used instead that provides the implementation for a parser and formatter for go.mod files 1. This allows to safely get the module path without the need to depend on runtime/dynamic logic that might change in future Go versions.
Note that this change also increased the minimum Go version from 1.17 to 1.19!
Bug Fixes
Update to tmpl-go template repository version 0.11.0 and 0.12.0 — #112, #127 ⇄ #113, #128 (⊶ a4e2a38, c4fe6cf)
↠ Updated to tmpl-go version 0.11.0 and 0.12.0 which…
- fixed
golangci-lintrunning errors due torevives unknowntime-equalrule. - disabled the
revivelinter rulepackage-comments. - updated to the
tmpltemplate repository version0.11.0.
See the full tmpl-go version 0.11.0 and 0.12.0 and changelogs for all details.
The full changelog is available in the repository
Copyright © 2019-present Sven Greb