Skip to content

Conversation

@tefkah
Copy link
Contributor

@tefkah tefkah commented Sep 17, 2025

Problem

readium -v or readium version would output

readium version unknown (go-toolkit v0.11.0)

Now

After doing make build && ./readium -v, I get

readium version v0.4.1-0.20250917105946-b88dc06efc6b+dirty (go-toolkit v0.11.0)

Note that go run cmd/main.go -v will still show readium version unknown (go-toolkit v0.11.0), likely bc of the info.Main.Path being "" when running it that way

I don't know much about go, so this might be an incorrect way to fix this behavior, but it works!

@chocolatkey
Copy link
Member

@tefkah thanks for the fix. This is likely happening because the version.Version variable is set during the init function which is run during the program startup, but after the value of rootCmd.Version is assigned, so it doesn't get the actual value. Because you removed the assignment to the Execute function, it runs after init so it works properly

@chocolatkey chocolatkey self-requested a review September 18, 2025 21:17
@chocolatkey chocolatkey merged commit 968be38 into readium:develop Sep 18, 2025
4 checks passed
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.

2 participants