Skip to content

Commit

Permalink
Merge pull request #39 from harakeishi/change/use-curver
Browse files Browse the repository at this point in the history
curverを使用します
  • Loading branch information
harakeishi authored Feb 26, 2022
2 parents a989570 + 1cfd233 commit b8f53ab
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ builds:
- windows
- darwin
ldflags:
- -s -w -X github.com/harakeishi/whris/cmd.ver={{.Version}}
- -s -w -X github.com/harakeishi/curver.Version={{.Version}}
archives:
- replacements:
darwin: Darwin
Expand Down
14 changes: 2 additions & 12 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ package cmd
import (
"fmt"
"os"
"runtime/debug"
"strings"

curver "github.com/harakeishi/curver"
whris "github.com/harakeishi/whris/whris"
"github.com/spf13/cobra"
)

var ver = "dev"
var rootCmd = &cobra.Command{
Use: "whris",
Short: "`whris` is Displays management information for IPs associated with the domain.",
Expand All @@ -22,15 +20,7 @@ var rootCmd = &cobra.Command{
os.Exit(1)
}
if version {
if !strings.Contains(ver, "dev") {
fmt.Println(ver)
return nil
}
if buildInfo, ok := debug.ReadBuildInfo(); ok {
fmt.Println(buildInfo.Main.Version)
return nil
}
fmt.Println("unknown")
curver.EchoVersion()
return nil
}
domain := args[0]
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/harakeishi/whris
go 1.13

require (
github.com/harakeishi/curver v0.1.0
github.com/likexian/whois v1.12.4
github.com/spf13/cobra v1.3.0
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/harakeishi/curver v0.1.0 h1:jTmR1q9oDQTWxX59FMnk8uXedgNWRDNdiKYS01dqBZw=
github.com/harakeishi/curver v0.1.0/go.mod h1:G8ZUue/D5LVD1MFMv8bcsrn1SdwL/LbnqC+BFoFuVJw=
github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M=
github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
Expand Down

0 comments on commit b8f53ab

Please sign in to comment.