Skip to content

Commit

Permalink
Switch go dep to go mod. Replace github.com/codegangsta/cli with gith…
Browse files Browse the repository at this point in the history
…ub.com/urfave/cli v1.22.4.
  • Loading branch information
liqiang-fit2cloud committed Jun 29, 2020
1 parent aea5041 commit 1db4d60
Show file tree
Hide file tree
Showing 132 changed files with 53 additions and 17,974 deletions.
54 changes: 0 additions & 54 deletions gotty/Godeps/Godeps.json

This file was deleted.

5 changes: 0 additions & 5 deletions gotty/Godeps/Readme

This file was deleted.

97 changes: 0 additions & 97 deletions gotty/Gopkg.lock

This file was deleted.

46 changes: 0 additions & 46 deletions gotty/Gopkg.toml

This file was deleted.

15 changes: 15 additions & 0 deletions gotty/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module github.com/KubeOperator/webkubectl/gotty

go 1.12

require (
github.com/NYTimes/gziphandler v1.1.1
github.com/elazarl/go-bindata-assetfs v1.0.0
github.com/fatih/structs v1.1.0
github.com/gorilla/websocket v1.4.2
github.com/kr/pty v1.1.8
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/errors v0.9.1
github.com/urfave/cli v1.22.4
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect
)
36 changes: 36 additions & 0 deletions gotty/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
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/creack/pty v1.1.7 h1:6pwm8kMQKCmgUg0ZHTm5+/YvRK0s3THD/28+T6/kk4A=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/kr/pty v1.1.8 h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA=
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
10 changes: 1 addition & 9 deletions gotty/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import (
"strings"
"syscall"

"github.com/codegangsta/cli"
"github.com/urfave/cli"

"github.com/KubeOperator/webkubectl/gotty/backend/localcommand"
"github.com/KubeOperator/webkubectl/gotty/pkg/homedir"
"github.com/KubeOperator/webkubectl/gotty/server"
"github.com/KubeOperator/webkubectl/gotty/utils"
)
Expand Down Expand Up @@ -56,13 +55,6 @@ func main() {
exit(fmt.Errorf(msg), 1)
}

configFile := c.String("config")
_, err := os.Stat(homedir.Expand(configFile))
if configFile != "~/.gotty" || !os.IsNotExist(err) {
if err := utils.ApplyConfigFile(configFile, appOptions, backendOptions); err != nil {
exit(err, 2)
}
}

utils.ApplyFlags(cliFlags, flagMappings, c, appOptions, backendOptions)

Expand Down
30 changes: 1 addition & 29 deletions gotty/utils/flags.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
package utils

import (
"io/ioutil"
"log"
"os"
"reflect"
"strings"

"github.com/codegangsta/cli"
"github.com/urfave/cli"
"github.com/fatih/structs"
"github.com/yudai/hcl"

"github.com/KubeOperator/webkubectl/gotty/pkg/homedir"
)

func GenerateFlags(options ...interface{}) (flags []cli.Flag, mappings map[string]string, err error) {
Expand Down Expand Up @@ -100,25 +94,3 @@ func ApplyFlags(
field.Set(val)
}
}

func ApplyConfigFile(filePath string, options ...interface{}) error {
filePath = homedir.Expand(filePath)
if _, err := os.Stat(filePath); os.IsNotExist(err) {
return err
}

fileString := []byte{}
log.Printf("Loading config file at: %s", filePath)
fileString, err := ioutil.ReadFile(filePath)
if err != nil {
return err
}

for _, object := range options {
if err := hcl.Decode(object, string(fileString)); err != nil {
return err
}
}

return nil
}
1 change: 0 additions & 1 deletion gotty/vendor/github.com/NYTimes/gziphandler/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions gotty/vendor/github.com/NYTimes/gziphandler/.travis.yml

This file was deleted.

Loading

0 comments on commit 1db4d60

Please sign in to comment.