File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed
Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 11.PHONY : build
22build :
3- rm -rf ./out
43 mkdir -p ./out
54 go build -ldflags=" -w -s" -o ./out/pbcli ./cmd/pbcli
65
@@ -12,13 +11,10 @@ test:
1211 fi
1312 go vet ./...
1413 gocyclo -over 10 $(shell find . -iname '* .go' -type f)
14+ staticcheck ./...
1515 go test -v -cover ./...
16- stdout=$$(golint ./... 2>&1 ) ; \
17- if [ " $$ stdout" ]; then \
18- exit 1; \
19- fi
2016
2117.PHONY : setup
2218setup :
2319 go get -u github.com/fzipp/gocyclo/cmd/gocyclo
24- go get -u golang.org/x/lint/golint
20+ go get -u honnef.co/go/tools/cmd/staticcheck
Original file line number Diff line number Diff line change 44
55require (
66 github.com/jessevdk/go-flags v1.4.0
7- golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
7+ golang.org/x/term v0.0.0-20210503060354-a79de5458b56
88)
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
77golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a /go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY =
88golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4 =
99golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 /go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs =
10+ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw =
11+ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 /go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs =
1012golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM =
1113golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 /go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw =
14+ golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w =
15+ golang.org/x/term v0.0.0-20210503060354-a79de5458b56 /go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY =
1216golang.org/x/text v0.3.0 /go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ =
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ import (
66 "log"
77 "syscall"
88
9- "golang.org/x/crypto/ssh/terminal "
9+ "golang.org/x/term "
1010)
1111
1212// GetPassword reads a password from the terminal.
1313func GetPassword (prompt string ) string {
1414 fmt .Print (prompt )
15- passwordBytes , err := terminal .ReadPassword (int (syscall .Stdin ))
15+ passwordBytes , err := term .ReadPassword (int (syscall .Stdin ))
1616 fmt .Print ("\n " )
1717
1818 if err != nil {
@@ -28,7 +28,7 @@ func GetPassword(prompt string) string {
2828 return password
2929}
3030
31- // PrintJSON pretty-prints JSON to the terminal .
31+ // PrintJSON pretty-prints JSON to the term .
3232func PrintJSON (obj interface {}) {
3333 pretty , err := json .MarshalIndent (obj , "" , "\t " )
3434
You can’t perform that action at this time.
0 commit comments