Skip to content

Commit

Permalink
Rename project; fix tests; remove legacy file (#13)
Browse files Browse the repository at this point in the history
* Rename project; fix tests; remove legacy file

* v2
  • Loading branch information
earthboundkid authored Nov 11, 2024
1 parent 186e057 commit 83eb80b
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: carlmjohnson
github: earthboundkid
23 changes: 8 additions & 15 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.18
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: go mod download

- name: Test
run: cd test && go test -v ./...
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "stable"
- name: Download modules
run: go mod download
- name: Test
run: cd test && go test -v ./...
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# versioninfo [![GoDoc](https://godoc.org/github.com/carlmjohnson/versioninfo?status.svg)](https://godoc.org/github.com/carlmjohnson/versioninfo) [![Go Report Card](https://goreportcard.com/badge/github.com/carlmjohnson/versioninfo)](https://goreportcard.com/report/github.com/carlmjohnson/versioninfo)
# versioninfo [![GoDoc](https://godoc.org/github.com/earthboundkid/versioninfo?status.svg)](https://godoc.org/github.com/earthboundkid/versioninfo/v2) [![Go Report Card](https://goreportcard.com/badge/github.com/earthboundkid/versioninfo/v2)](https://goreportcard.com/report/github.com/earthboundkid/versioninfo/v2)

Importable package that parses `debug.ReadBuildInfo()` for inclusion in your Go application.

Expand All @@ -12,7 +12,7 @@ package main
import (
"fmt"

"github.com/carlmjohnson/versioninfo"
"github.com/earthboundkid/versioninfo/v2"
)

func main() {
Expand All @@ -31,7 +31,7 @@ package main
import (
"fmt"

"github.com/carlmjohnson/versioninfo"
"github.com/earthboundkid/versioninfo/v2"
)

func main() {
Expand All @@ -48,7 +48,7 @@ import (
"flag"
"fmt"

"github.com/carlmjohnson/versioninfo"
"github.com/earthboundkid/versioninfo/v2"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/carlmjohnson/versioninfo
module github.com/earthboundkid/versioninfo/v2

go 1.16
go 1.18
5 changes: 3 additions & 2 deletions modern.go → init.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build go1.18

package versioninfo

import (
Expand All @@ -12,6 +10,9 @@ func init() {
if !ok {
return
}
if info.Main.Version != "" {
Version = info.Main.Version
}
for _, kv := range info.Settings {
if kv.Value == "" {
continue
Expand Down
15 changes: 0 additions & 15 deletions legacy.go

This file was deleted.

12 changes: 7 additions & 5 deletions test/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module github.com/carlmjohnson/versioninfo/test
module github.com/earthboundkid/versioninfo/v2/test

go 1.18
go 1.22

require github.com/rogpeppe/go-internal v1.8.1
toolchain go1.23.2

require github.com/rogpeppe/go-internal v1.13.1

require (
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e // indirect
gopkg.in/errgo.v2 v2.1.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/tools v0.22.0 // indirect
)
19 changes: 6 additions & 13 deletions test/go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg=
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
4 changes: 2 additions & 2 deletions test/revision_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ func Test(t *testing.T) {
gomod := `
module main
require github.com/carlmjohnson/versioninfo v0.0.0
require github.com/earthboundkid/versioninfo/v2 v2.0.0
replace github.com/carlmjohnson/versioninfo => WORKDIR/..
replace github.com/earthboundkid/versioninfo/v2 => WORKDIR/..
`
wd, _ := os.Getwd()
gomod = strings.Replace(gomod, "WORKDIR", wd, 1)
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/flag.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import (
"flag"
"fmt"

"github.com/carlmjohnson/versioninfo"
"github.com/earthboundkid/versioninfo/v2"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/versioninfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ package main
import (
"fmt"

"github.com/carlmjohnson/versioninfo"
"github.com/earthboundkid/versioninfo/v2"
)

func main() {
Expand Down

0 comments on commit 83eb80b

Please sign in to comment.