fix: lint - p.Start is deprecated (#18)
continuous-integration/drone/push Build is passing Details

Reviewed-on: #18
This commit is contained in:
Dawid Wysokiński 2022-12-11 17:59:46 +00:00
parent 3b778a7883
commit bea90fb621
3 changed files with 57 additions and 8 deletions

View File

@ -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 "

View File

@ -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)
}

View File

@ -54,7 +54,7 @@ func newApp() (*cli.App, error) {
}
p := tea.NewProgram(internal.NewUI(entries), tea.WithAltScreen())
if err := p.Start(); err != nil {
if _, err := p.Run(); err != nil {
return fmt.Errorf("p.Start: %w", err)
}