Skip to content

Commit 9116507

Browse files
authored
Merge pull request #338 from YangSen-qn/dev
Fix version error
2 parents 47397a3 + cc330b8 commit 9116507

File tree

7 files changed

+13
-8
lines changed

7 files changed

+13
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ DARWIN=qshell-$(VERSION)-darwin-x64
66
LINUX86=qshell-$(VERSION)-linux-x86
77
LINUX64=qshell-$(VERSION)-linux-x64
88
LINUXARM=qshell-$(VERSION)-linux-arm
9-
LDFLAGS='-X 'github.com/qiniu/qshell/iqshell/common/version.Version=$(VERSION)' -extldflags '-static''
9+
LDFLAGS='-X 'github.com/qiniu/qshell/v2/iqshell/common/version.version=$(VERSION)' -extldflags '-static''
1010
GO=GO111MODULE=on go
1111

1212
all: linux windows arm darwin

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var rootCmdBuilder = func(cfg *iqshell.Config) *cobra.Command {
4444
cmd := &cobra.Command{
4545
Use: "qshell",
4646
Short: "Qiniu commandline tool for managing your bucket and CDN",
47-
Version: version.Version,
47+
Version: version.Version(),
4848
BashCompletionFunction: bash_completion_func,
4949
}
5050
cmd.PersistentFlags().BoolVarP(&cfg.StdoutColorful, "colorful", "", false, "console colorful mode")

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require (
77
github.com/mitchellh/go-homedir v1.1.0
88
github.com/qiniu/go-sdk/v7 v7.10.1
99
github.com/schollz/progressbar/v3 v3.8.6
10+
github.com/spf13/cast v1.3.1
1011
github.com/spf13/cobra v1.1.3
1112
github.com/spf13/viper v1.7.1
1213
github.com/stretchr/testify v1.7.0
@@ -32,7 +33,6 @@ require (
3233
github.com/satori/go.uuid v1.2.0 // indirect
3334
github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 // indirect
3435
github.com/spf13/afero v1.5.1 // indirect
35-
github.com/spf13/cast v1.3.1 // indirect
3636
github.com/spf13/jwalterweatherman v1.1.0 // indirect
3737
github.com/spf13/pflag v1.0.5 // indirect
3838
github.com/subosito/gotenv v1.2.0 // indirect
@@ -43,7 +43,7 @@ require (
4343
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
4444
gopkg.in/ini.v1 v1.62.0 // indirect
4545
gopkg.in/yaml.v2 v2.4.0 // indirect
46-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
46+
gopkg.in/yaml.v3 v3.0.0 // indirect
4747
)
4848

4949
go 1.17

go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,9 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
472472
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
473473
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
474474
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
475-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
476475
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
476+
gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
477+
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
477478
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
478479
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
479480
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

iqshell/common/utils/user_agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ import (
88

99
// 生成客户端代理名称
1010
func UserAgent() string {
11-
return fmt.Sprintf("QShell/%s (%s; %s; %s)", version.Version, runtime.GOOS, runtime.GOARCH, runtime.Version())
11+
return fmt.Sprintf("QShell/%s (%s; %s; %s)", version.Version(), runtime.GOOS, runtime.GOARCH, runtime.Version())
1212
}

iqshell/common/version/operations/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ func Version(cfg *iqshell.Config, info VersionInfo) {
2121
return
2222
}
2323

24-
log.Alert(version.Version)
24+
log.Alert(version.Version())
2525
}

iqshell/common/version/version.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
package version
22

3-
var Version = "UNSTABLE"
3+
var version = "UNSTABLE"
4+
5+
func Version() string {
6+
return version
7+
}

0 commit comments

Comments
 (0)