Skip to content

Commit

Permalink
Merge pull request #26 from urfave/use-stable-v2
Browse files Browse the repository at this point in the history
Change import to github.com/urfave/cli/v2 from gopkg
  • Loading branch information
asahasrabuddhe authored Nov 28, 2019
2 parents 0d053d1 + 81389c2 commit 49a190d
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 9 deletions.
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
language: go
dist: trusty
sudo: false
dist: bionic
osx_image: xcode11.2
go:
- 1.11.x
- 1.12.x
- 1.13.x

os:
- linux
- osx

env:
GO111MODULE=on GOPROXY=https://proxy.golang.org

addons:
apt:
packages:
- zsh

before_script:
- go get github.com/sirupsen/logrus
- go get github.com/stretchr/testify
- go get gopkg.in/urfave/cli.v2
- go get github.com/urfave/cli/v2
- go get gopkg.in/yaml.v2
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin latest

Expand Down
6 changes: 5 additions & 1 deletion cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/sirupsen/logrus"
"gopkg.in/urfave/cli.v2"
"github.com/urfave/cli/v2"
)

func NewCLI() *cli.App {
Expand All @@ -22,6 +22,10 @@ func NewCLI() *cli.App {
Name: "Dan Buch",
Email: "[email protected]",
},
{
Name: "Ajitem Sahasrabuddhe",
Email: "[email protected]",
},
},
Flags: []cli.Flag{
&cli.StringSliceFlag{
Expand Down
2 changes: 1 addition & 1 deletion cmd/gfmrun/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"testing"

"gopkg.in/urfave/cli.v2"
"github.com/urfave/cli/v2"
)

func TestMain(m *testing.M) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ go 1.11
require (
github.com/sirupsen/logrus v1.4.2
github.com/stretchr/testify v1.2.2
gopkg.in/urfave/cli.v2 v2.0.0-20190806201727-b62605953717
github.com/urfave/cli/v2 v2.0.0
gopkg.in/yaml.v2 v2.2.2
)
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo=
github.com/urfave/cli/v2 v2.0.0 h1:+HU9SCbu8GnEUFtIBfuUNXN39ofWViIEJIp6SURMpCg=
github.com/urfave/cli/v2 v2.0.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
2 changes: 1 addition & 1 deletion package.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os/user"
"path/filepath"

"gopkg.in/urfave/cli.v2"
"github.com/urfave/cli/v2"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions runnable.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ func (rn *Runnable) IsValidOS() bool {
return true
}

switch v.(type) {
switch val := v.(type) {
case string:
return runtime.GOOS == v.(string)
return runtime.GOOS == val
case []interface{}:
for _, s := range v.([]interface{}) {
for _, s := range val {
if runtime.GOOS == s.(string) {
return true
}
Expand Down

0 comments on commit 49a190d

Please sign in to comment.