rubenv / sql-migrate

SQL schema migration tool for Go.
MIT License
3.18k stars 270 forks source link

add version file for cli #218

Closed t-oki closed 2 years ago

t-oki commented 2 years ago

The version of the CLI tool is always 1.0.0 even if you install as go install github.com/rubenv/sql-migrate/...@v1.1.1 and it's quite confusing. This PR will sync the version of the CLI tool with the git tag.

rubenv commented 2 years ago

That's a file we manually have to maintain?

Can't we use buildinfo for that? https://pkg.go.dev/debug/buildinfo

rubenv commented 2 years ago

Though keep in mind that I don't want to drop pre-1.18 support yet.

t-oki commented 2 years ago

@rubenv Thanks, I used runtime/debug that have support for older go versions. And I thought it would be better to show version 'dev' when runtime/debug failed to get the version than showing the wrong version

rubenv commented 2 years ago

Cool, thanks!