fix: lint - p.Start is deprecated #18
|
@ -1,13 +1,12 @@
|
|||
run:
|
||||
tests: true
|
||||
timeout: 5m
|
||||
|
||||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
- bodyclose
|
||||
- deadcode
|
||||
- depguard
|
||||
- dupl
|
||||
- errcheck
|
||||
- gocritic
|
||||
- gofmt
|
||||
|
@ -19,19 +18,68 @@ linters:
|
|||
- nakedret
|
||||
- prealloc
|
||||
- staticcheck
|
||||
- structcheck
|
||||
- typecheck
|
||||
- unconvert
|
||||
- unused
|
||||
- varcheck
|
||||
- lll
|
||||
- nestif
|
||||
- thelper
|
||||
- nonamedreturns
|
||||
- gocyclo
|
||||
- tenv
|
||||
- testpackage
|
||||
- noctx
|
||||
- tparallel
|
||||
- usestdlibvars
|
||||
- unconvert
|
||||
- makezero
|
||||
- grouper
|
||||
- errname
|
||||
- exhaustive
|
||||
- tagliatelle
|
||||
|
||||
linters-settings:
|
||||
lll:
|
||||
line-length: 150
|
||||
gocyclo:
|
||||
min-complexity: 10
|
||||
govet:
|
||||
enable:
|
||||
- asmdecl
|
||||
- assign
|
||||
- atomic
|
||||
- atomicalign
|
||||
- bools
|
||||
- buildtag
|
||||
- cgocall
|
||||
- composites
|
||||
- copylocks
|
||||
- deepequalerrors
|
||||
- errorsas
|
||||
- findcall
|
||||
- framepointer
|
||||
- httpresponse
|
||||
- ifaceassert
|
||||
- loopclosure
|
||||
- lostcancel
|
||||
- nilfunc
|
||||
- nilness
|
||||
- printf
|
||||
- reflectvaluecompare
|
||||
- shadow
|
||||
- shift
|
||||
- sigchanyzer
|
||||
- sortslice
|
||||
- stdmethods
|
||||
- stringintconv
|
||||
- structtag
|
||||
- testinggoroutine
|
||||
- tests
|
||||
- unmarshal
|
||||
- unreachable
|
||||
- unsafeptr
|
||||
- unusedresult
|
||||
- unusedwrite
|
||||
|
||||
issues:
|
||||
exclude-rules:
|
||||
|
@ -39,6 +87,7 @@ issues:
|
|||
- path: _test\.go
|
||||
linters:
|
||||
- dupl
|
||||
- gocyclo
|
||||
- linters:
|
||||
- lll
|
||||
source: "^//go:generate "
|
||||
|
|
|
@ -34,11 +34,11 @@ func Encrypt(plaintext, password []byte) ([]byte, error) {
|
|||
|
||||
binary.BigEndian.PutUint32(iter, uint32(iterations))
|
||||
|
||||
if _, err := rand.Read(iv); err != nil {
|
||||
if _, err = rand.Read(iv); err != nil {
|
||||
return nil, fmt.Errorf("rand.Read(iv): %w", err)
|
||||
}
|
||||
|
||||
if _, err := rand.Read(salt); err != nil {
|
||||
if _, err = rand.Read(salt); err != nil {
|
||||
return nil, fmt.Errorf("rand.Read(salt): %w", err)
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ func DecryptAsEntries(text, password []byte) ([]Entry, error) {
|
|||
}
|
||||
|
||||
var entries []Entry
|
||||
if err := json.Unmarshal(result, &entries); err != nil {
|
||||
if err = json.Unmarshal(result, &entries); err != nil {
|
||||
return nil, fmt.Errorf("json.Unmarshal: %w", err)
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue