Skip to content

Commit

Permalink
Merge pull request #182 from nao1215/nao1215-patch-4
Browse files Browse the repository at this point in the history
Add go 1.24
  • Loading branch information
nao1215 authored Feb 13, 2025
2 parents a938d8f + eac6855 commit 0832369
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- "macos-latest"
go:
- "1"
- "1.24"
- "1.23"
- "1.22"
- "1.21"
Expand Down
2 changes: 1 addition & 1 deletion cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func TestExecute_Version(t *testing.T) {
{
name: "success",
args: []string{"gup", "version"},
stdout: []string{"gup version (under Apache License version 2.0)", ""},
stdout: []string{"gup version (devel) (under Apache License version 2.0)", ""},
},
}
for _, tt := range tests {
Expand Down
6 changes: 4 additions & 2 deletions internal/cmdinfo/cmdinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ const Name = "gup"
// GetVersion return gup command version.
// Version global variable is set by ldflags.
func GetVersion() string {
version := "unknown"
version := "(devel)"
if Version != "" {
version = Version
} else if buildInfo, ok := debug.ReadBuildInfo(); ok {
version = buildInfo.Main.Version
if buildInfo.Main.Version != "" {
version = buildInfo.Main.Version
}
}
return fmt.Sprintf("%s version %s (under Apache License version 2.0)", Name, version)
}
4 changes: 2 additions & 2 deletions internal/goutil/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func ExampleGoBin() {
// Output: Example GoBin: OK
}

func ExampleInstall() {
func ExampleInstallLatest() {
// Install installs an executable from a Go package.
err := goutil.InstallLatest("example.com/unknown_user/unknown_package")

Expand All @@ -160,7 +160,7 @@ func ExampleInstall() {
// Output: Example Install: OK
}

func ExampleIsAlreadyUpToDate() {
func ExamplePackage_IsAlreadyUpToDate() {
// Create Version object with Current and Latest package and Go versions
ver := goutil.Version{
Current: "v1.9.0",
Expand Down

0 comments on commit 0832369

Please sign in to comment.