From 23698d93c0f5a8e76810347c7a8c2c046b1be75f Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Thu, 28 Nov 2019 16:18:01 +0530 Subject: [PATCH 1/6] Use the stable v2 from github.com/urfave/cli/v2 instead of unsupproted gopkg.in --- cli.go | 2 +- go.mod | 2 +- go.sum | 10 ++++++++++ package.go | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/cli.go b/cli.go index ec237db..ee03598 100644 --- a/cli.go +++ b/cli.go @@ -9,7 +9,7 @@ import ( "strings" "github.com/sirupsen/logrus" - "gopkg.in/urfave/cli.v2" + "github.com/urfave/cli/v2" ) func NewCLI() *cli.App { diff --git a/go.mod b/go.mod index aa670ef..cdd46b5 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index d2d6ed4..65eeda3 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/package.go b/package.go index 3dad22d..0211b48 100644 --- a/package.go +++ b/package.go @@ -6,7 +6,7 @@ import ( "os/user" "path/filepath" - "gopkg.in/urfave/cli.v2" + "github.com/urfave/cli/v2" ) var ( From d82c5c491f2fd4322aefe68762e5e2a4d531a10a Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Thu, 28 Nov 2019 16:30:20 +0530 Subject: [PATCH 2/6] fix travis build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b196c84..a6886e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ addons: 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 From 5ce09dd7d0d40693010475cd0fc675bbcdc12710 Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Thu, 28 Nov 2019 16:30:33 +0530 Subject: [PATCH 3/6] update author --- cli.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli.go b/cli.go index ee03598..0486338 100644 --- a/cli.go +++ b/cli.go @@ -22,6 +22,10 @@ func NewCLI() *cli.App { Name: "Dan Buch", Email: "dan@meatballhat.com", }, + { + Name: "Ajitem Sahasrabuddhe", + Email: "ajitem.s@outlook.com", + }, }, Flags: []cli.Flag{ &cli.StringSliceFlag{ From c5a18b1796e45ff30b26c16349073997eef198aa Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Thu, 28 Nov 2019 17:07:24 +0530 Subject: [PATCH 4/6] update travis build --- .travis.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a6886e9..0673d8c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,24 @@ 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 From ea697fda1d7383f6c6edf3604503a8eae43c4eee Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Thu, 28 Nov 2019 17:18:54 +0530 Subject: [PATCH 5/6] fix import --- cmd/gfmrun/main_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gfmrun/main_test.go b/cmd/gfmrun/main_test.go index a8c5ab7..eca5845 100644 --- a/cmd/gfmrun/main_test.go +++ b/cmd/gfmrun/main_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "gopkg.in/urfave/cli.v2" + "github.com/urfave/cli/v2" ) func TestMain(m *testing.M) { From 81389c2ce6d69655e0837e626d5d26a07fc78c15 Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Thu, 28 Nov 2019 17:27:15 +0530 Subject: [PATCH 6/6] linter fixes --- runnable.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runnable.go b/runnable.go index 52ffc4a..f78be0a 100644 --- a/runnable.go +++ b/runnable.go @@ -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 }