Skip to content

Commit

Permalink
Linter updated to 1.17.1
Browse files Browse the repository at this point in the history
1. Linter updated to 1.17.1
2. Updated vendored modules
3. Small fixes by demands of linter

Don't forget to run `make install-linters` after pull
  • Loading branch information
ayuryshev committed Jun 24, 2019
1 parent fe279ec commit c6d49c3
Show file tree
Hide file tree
Showing 155 changed files with 16,578 additions and 2,598 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ test: ## Run tests


install-linters: ## Install linters
- VERSION=1.13.2 ./ci_scripts/install-golangci-lint.sh
- VERSION=1.17.1 ./ci_scripts/install-golangci-lint.sh
# GO111MODULE=off go get -u github.com/FiloSottile/vendorcheck
# For some reason this install method is not recommended, see https://github.com/golangci/golangci-lint#install
# However, they suggest `curl ... | bash` which we should not do
Expand Down
2 changes: 1 addition & 1 deletion cmd/apps/therealproxy/therealproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func main() {
var passcode = flag.String("passcode", "", "Authorise user against this passcode")
var passcode = flag.String("passcode", "", "Authorize user against this passcode")
flag.Parse()

config := &app.Config{AppName: "socksproxy", AppVersion: "1.0", ProtocolVersion: "0.0.1"}
Expand Down
2 changes: 1 addition & 1 deletion cmd/skywire-node/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var rootCmd = &cobra.Command{

node, err := node.NewNode(conf)
if err != nil {
logger.Fatal("Failed to initialise node: ", err)
logger.Fatal("Failed to initialize node: ", err)
}

go func() {
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ require (
github.com/spf13/cobra v0.0.5
github.com/stretchr/testify v1.3.0
go.etcd.io/bbolt v1.3.3
golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443
golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4
golang.org/x/net v0.0.0-20190620200207-3b0461eec859
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 // indirect
golang.org/x/text v0.3.2 // indirect
)
14 changes: 10 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443 h1:IcSOAf4PyMp3U3XbIEj1/xJ2BjNN2jWv7JoyOsMxXUU=
golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 h1:ydJNl0ENAG67pFbB+9tfhiL2pYqLhfoaZFw/cjLhY4A=
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b h1:lkjdUzSyJ5P1+eal9fxXX9Xg2BTfswsonKUse48C0uE=
golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -116,8 +116,14 @@ golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
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=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
4 changes: 2 additions & 2 deletions internal/therealssh/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const (
ResponseConfirm
)

var responseUnauthorised = append([]byte{ResponseFail}, []byte("unauthorised")...)
var responseUnauthorised = append([]byte{ResponseFail}, []byte("unauthorized")...)

// Server handles remote PTY data exchange.
type Server struct {
Expand Down Expand Up @@ -118,7 +118,7 @@ func (s *Server) HandleData(remotePK cipher.PubKey, localID uint32, data []byte)
}

if s.auth.Authorize(remotePK) != nil || channel.RemoteAddr.PubKey != remotePK {
return errors.New("unauthorised")
return errors.New("unauthorized")
}

if channel.session == nil {
Expand Down
6 changes: 3 additions & 3 deletions internal/therealssh/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestServerOpenChannel(t *testing.T) {
require.NoError(t, <-errCh)
assert.Equal(t, byte(CmdChannelOpenResponse), buf[0])
assert.Equal(t, byte(ResponseFail), buf[5])
assert.Equal(t, []byte("unauthorised"), buf[6:])
assert.Equal(t, []byte("unauthorized"), buf[6:])

go func() {
errCh <- s.OpenChannel(&app.Addr{PubKey: pk, Port: Port}, 4, in)
Expand Down Expand Up @@ -67,7 +67,7 @@ func TestServerHandleRequest(t *testing.T) {
require.NoError(t, <-errCh)
assert.Equal(t, byte(CmdChannelResponse), buf[0])
assert.Equal(t, byte(ResponseFail), buf[5])
assert.Equal(t, []byte("unauthorised"), buf[6:])
assert.Equal(t, []byte("unauthorized"), buf[6:])

dataCh := make(chan []byte)
go func() {
Expand All @@ -91,7 +91,7 @@ func TestServerHandleData(t *testing.T) {

err = s.HandleData(cipher.PubKey{}, 0, []byte("foo"))
require.Error(t, err)
assert.Equal(t, "unauthorised", err.Error())
assert.Equal(t, "unauthorized", err.Error())

err = s.HandleData(pk, 0, []byte("foo"))
require.Error(t, err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/dmsg/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ func TestNewClient(t *testing.T) {
aPK, aSK := cipher.GenerateKeyPair()
bPK, bSK := cipher.GenerateKeyPair()
sPK, sSK := cipher.GenerateKeyPair()
sAddr := ":8081"
sAddr := "127.0.0.1:8081"

const tpCount = 10
const msgCount = 100
Expand Down
2 changes: 1 addition & 1 deletion pkg/messaging/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func (msgFactory *MsgFactory) onClose(l *Link, remote bool) {
case <-msgFactory.doneCh:
default:
msgFactory.Logger.Infof("Disconnected from the server %s. Trying to re-connect...", remotePK)
for attemp := 0; attemp < msgFactory.retries; attemp++ {
for attempt := 0; attempt < msgFactory.retries; attempt++ {
if _, err := msgFactory.link(remotePK, chanLink.addr); err == nil {
msgFactory.Logger.Infof("Re-connected to the server %s", remotePK)
return
Expand Down
2 changes: 1 addition & 1 deletion pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func (node *Node) SpawnApp(config *AppConfig, startCh chan<- struct{}) error {
config.Args,
)
if err != nil {
return fmt.Errorf("failed to initialise App server: %s", err)
return fmt.Errorf("failed to initialize App server: %s", err)
}

bind := &appBind{conn, -1}
Expand Down
4 changes: 2 additions & 2 deletions pkg/transport/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (tm *Manager) Close() error {
func (tm *Manager) dialTransport(ctx context.Context, factory Factory, remote cipher.PubKey, public bool) (Transport, *Entry, error) {

if tm.isClosing() {
return nil, nil, errors.New("transport.Manager is closing. Skipping dialling transport")
return nil, nil, errors.New("transport.Manager is closing. Skipping dialing transport")
}

tr, err := factory.Dial(ctx, remote)
Expand Down Expand Up @@ -392,7 +392,7 @@ func (tm *Manager) manageTransport(ctx context.Context, mTr *ManagedTransport, f
if err != nil {
tm.Logger.Infof("Failed to re-dial Transport %s: %s", mTr.ID, err)
if err := tm.DeleteTransport(mTr.ID); err != nil {
tm.Logger.Warnf("Failed to delete re-dialled transport: %s", err)
tm.Logger.Warnf("Failed to delete redialed transport: %s", err)
}
} else {
tm.Logger.Infof("Updating transport %s", mTr.ID)
Expand Down
17 changes: 17 additions & 0 deletions vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions vendor/golang.org/x/sys/cpu/cpu_aix_ppc64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions vendor/golang.org/x/sys/unix/asm_linux_riscv64.s

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c6d49c3

Please sign in to comment.