update linter to v1.16 (#1741)
* update to v1.16 * use full version number * fix linter issues * fix comment * nicer comment * restart travis * restart travis
This commit is contained in:
parent
bdce253c97
commit
0eee46524d
@ -48,7 +48,7 @@ matrix:
|
|||||||
### run linters ###
|
### run linters ###
|
||||||
- env: MODE=lint
|
- env: MODE=lint
|
||||||
install:
|
install:
|
||||||
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b ${GOPATH}/bin v1.13
|
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b ${GOPATH}/bin v1.16.0
|
||||||
# install protoc
|
# install protoc
|
||||||
- curl -L https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip -o /tmp/protoc.zip
|
- curl -L https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip -o /tmp/protoc.zip
|
||||||
- unzip /tmp/protoc.zip -d "$HOME"/protoc
|
- unzip /tmp/protoc.zip -d "$HOME"/protoc
|
||||||
|
2
Makefile
2
Makefile
@ -45,7 +45,7 @@ build-dev-deps: ## Install dependencies for builds
|
|||||||
go get github.com/mattn/goveralls
|
go get github.com/mattn/goveralls
|
||||||
go get golang.org/x/tools/cover
|
go get golang.org/x/tools/cover
|
||||||
go get github.com/modocache/gover
|
go get github.com/modocache/gover
|
||||||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b ${GOPATH}/bin v1.10.2
|
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b ${GOPATH}/bin v1.16.0
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: check-copyrights ## Analyze and find programs in source code
|
lint: check-copyrights ## Analyze and find programs in source code
|
||||||
|
@ -113,10 +113,6 @@ func QuerySchema(db dbschema.Queryer) (*dbschema.Schema, error) {
|
|||||||
default:
|
default:
|
||||||
return fmt.Errorf("unhandled constraint type %q", constraintType)
|
return fmt.Errorf("unhandled constraint type %q", constraintType)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return rows.Err()
|
return rows.Err()
|
||||||
}()
|
}()
|
||||||
|
@ -302,12 +302,9 @@ func (authDB *AuthorizationDB) UserIDs() (userIDs []string, err error) {
|
|||||||
err = authDB.DB.Iterate(storage.IterateOptions{
|
err = authDB.DB.Iterate(storage.IterateOptions{
|
||||||
Recurse: true,
|
Recurse: true,
|
||||||
}, func(iterator storage.Iterator) error {
|
}, func(iterator storage.Iterator) error {
|
||||||
listItem := new(storage.ListItem)
|
var listItem storage.ListItem
|
||||||
for more := true; more; {
|
for iterator.Next(&listItem) {
|
||||||
more = iterator.Next(listItem)
|
userIDs = append(userIDs, listItem.Key.String())
|
||||||
if listItem != nil {
|
|
||||||
userIDs = append(userIDs, listItem.Key.String())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
@ -320,19 +317,13 @@ func (authDB *AuthorizationDB) List() (auths Authorizations, err error) {
|
|||||||
Recurse: true,
|
Recurse: true,
|
||||||
}, func(iterator storage.Iterator) error {
|
}, func(iterator storage.Iterator) error {
|
||||||
var listErrs errs.Group
|
var listErrs errs.Group
|
||||||
listItem := new(storage.ListItem)
|
var listItem storage.ListItem
|
||||||
for more := true; more; {
|
for iterator.Next(&listItem) {
|
||||||
more = iterator.Next(listItem)
|
var nextAuths Authorizations
|
||||||
if listItem != nil {
|
if err := nextAuths.Unmarshal(listItem.Value); err != nil {
|
||||||
var nextAuths Authorizations
|
listErrs.Add(err)
|
||||||
if err := nextAuths.Unmarshal(listItem.Value); err != nil {
|
|
||||||
listErrs.Add(err)
|
|
||||||
}
|
|
||||||
auths = append(auths, nextAuths...)
|
|
||||||
}
|
|
||||||
if !more {
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
auths = append(auths, nextAuths...)
|
||||||
}
|
}
|
||||||
return listErrs.Err()
|
return listErrs.Err()
|
||||||
})
|
})
|
||||||
|
@ -32,9 +32,6 @@ func (b *certDB) SavePublicKey(ctx context.Context, nodeID storj.NodeID, publicK
|
|||||||
return Error.Wrap(errs.Combine(err, tx.Rollback()))
|
return Error.Wrap(errs.Combine(err, tx.Rollback()))
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return Error.Wrap(errs.Combine(err, tx.Rollback()))
|
|
||||||
}
|
|
||||||
_, err = tx.Create_CertRecord(ctx,
|
_, err = tx.Create_CertRecord(ctx,
|
||||||
dbx.CertRecord_Publickey(pubbytes),
|
dbx.CertRecord_Publickey(pubbytes),
|
||||||
dbx.CertRecord_Id(nodeID.Bytes()),
|
dbx.CertRecord_Id(nodeID.Bytes()),
|
||||||
|
@ -94,8 +94,8 @@ type IterateOptions struct {
|
|||||||
|
|
||||||
// Iterator iterates over a sequence of ListItems
|
// Iterator iterates over a sequence of ListItems
|
||||||
type Iterator interface {
|
type Iterator interface {
|
||||||
// Next prepares the next list item
|
// Next prepares the next list item.
|
||||||
// returns false when you reach final item
|
// It returns true on success, or false if there is no next result row or an error happened while preparing it.
|
||||||
Next(item *ListItem) bool
|
Next(item *ListItem) bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user