Skip to content

Conversation

@jamesog
Copy link
Contributor

@jamesog jamesog commented Jul 8, 2025

Commit 9873f9f (v4.7.4) removed the version package in favour of using GoReleaser to set the version, which it only sets in main and is not passed down to other packages.

This means that if any other package, notably two providers which use the version for setting a User-Agent, wants access to the version, they no longer have it.

This change reintroduces the version package, setting GoReleaser to set the version here, and refactors all uses of the version to use the package.

Note that if you run go run main.go version the version output by Go for the main module is "(devel)". Using build/build.go gives the commit hash.

Fixes #3651

Commit 9873f9f (v4.7.4) removed the
version package in favour of using GoReleaser to set the version, which
it only sets in main and is not passed down to other packages.

This means that if any other package, notably two providers which use
the version for setting a User-Agent, wants access to the version, they
no longer have it.

This change reintroduces the version package, setting GoReleaser to set
the version here, and refactors all uses of the version to use the
package.

Note that if you run `go run main.go version` the version output by Go
for the main module is "(devel)". Using build/build.go gives the commit
hash.
@tlimoncelli tlimoncelli changed the title BUILD: Add version package BUG: User-Agent should include DNSControl version Jul 9, 2025
@tlimoncelli tlimoncelli merged commit cd8892f into StackExchange:main Jul 9, 2025
@tlimoncelli
Copy link
Collaborator

After I merged this I realized that "go run main.go version" outputs a blank line. Can you double-check and submit a PR if that's a bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression in version string set at compile time

2 participants