Skip to content

Commit

Permalink
Merge pull request #52 from maxmind/maxmind/ikolesn/update-go-mod-wit…
Browse files Browse the repository at this point in the history
…h-release-v2

Update to comply with major release version 2
  • Loading branch information
klp2 authored Jul 13, 2023
2 parents 08bfd84 + 1c5bdd8 commit 085c7a0
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ builds:
- darwin
- linux
- windows
- ldflags:
- '-X main.version={{.Version}}'
archives:
-
wrap_in_directory: true
Expand Down
2 changes: 2 additions & 0 deletions README.dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
* Tag the release: `git tag -a v1.2.3 -m 'Tag v1.2.3'`.
* Push the tag: `git push origin v1.2.3`.
* Run `goreleaser`

NOTE: if a major version release is happening, it's necessary to update the `go.mod` file, as well as the import of internal packages according to the new major version (see more on [releasing modules v2 or higher](https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher))
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ archive. Inside is the `mm-geofeed-verifier` binary.
You need the Go compiler (Go 1.12+). You can get it at the [Go
website](https://golang.org).

The easiest way is via `go get`:
The easiest way is via `go install`:

$ go get -u github.com/maxmind/mm-geofeed-verifier
$ go install github.com/maxmind/mm-geofeed-verifier/v2@latest

The program will be installed to `$GOPATH/bin/mm-geofeed-verifier`.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/maxmind/mm-geofeed-verifier
module github.com/maxmind/mm-geofeed-verifier/v2

go 1.18

Expand Down
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import (
"sort"
"strings"

"github.com/maxmind/mm-geofeed-verifier/verify"
"github.com/maxmind/mm-geofeed-verifier/v2/verify"
)

const version = "2.2.1"
// This value is set by build scripts. Changing the name of
// the variable should be considered a breaking change.
var version = "unknown"

type config struct {
gf string
Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/maxmind/mm-geofeed-verifier/verify"
"github.com/maxmind/mm-geofeed-verifier/v2/verify"
)

type parseFlagsCorrectTest struct {
Expand Down
12 changes: 12 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//go:build go1.12
// +build go1.12

package main

import "runtime/debug"

func init() {
if info, ok := debug.ReadBuildInfo(); ok && info.Main.Version != "(devel)" {
version = info.Main.Version
}
}

0 comments on commit 085c7a0

Please sign in to comment.