Skip to content

0.8.0

Latest
Compare
Choose a tag to compare
@svengreb svengreb released this 15 Nov 22:59
· 2 commits to main since this release
v0.8.0

Release Date: 2022-11-15 Project Board Milestone

Show all commits

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 go releases, so an older version of go may not handle the build information produced with a newer version of go. To read the version information from a binary built with go 1.18, use the go version command and the debug/buildinfo package from go 1.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…

  1. fixed golangci-lint running errors due to revives unknown time-equal rule.
  2. disabled the revive linter rule package-comments.
  3. updated to the tmpl template repository version 0.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

  1. https://go.dev/ref/mod#go-mod-file