Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add go1.12 versioning support #172

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ $ apt-get install -y migrate
$ go get -tags 'postgres' -u github.com/golang-migrate/migrate/cmd/migrate
```

##### Versioned with Go Modules (go1.12)
```
$ GO111MODULE=on go get -tags 'postgres' -u github.com/golang-migrate/migrate/cmd/migrate@v4.2.4
```

##### Versioned

```
Expand Down
11 changes: 11 additions & 0 deletions cmd/migrate/mod_version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// +build go1.12

package main

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing import "runtime/debug"

func init() {
if info, available := debug.ReadBuildInfo(); available {
if Version == "dev" {
Version = info.Main.Version
}
}
}