From a1049a162297be5ca05024fff210b5f961d8a718 Mon Sep 17 00:00:00 2001 From: Ivan Porto Carrero Date: Thu, 16 Mar 2023 16:11:45 -0700 Subject: [PATCH] update golangci lint info --- .golangci.yml | 59 +++++++++++++++++++++++++++++---------------------- ulid.go | 11 +++++++--- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index d36b256..be4899c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -14,31 +14,40 @@ linters-settings: min-occurrences: 4 linters: - enable-all: true - disable: - - maligned - - lll - - gochecknoinits - - gochecknoglobals - - godox - - gocognit - - whitespace - - wsl - - funlen - - wrapcheck - - testpackage - - nlreturn - - gofumpt - - goerr113 - - gci - - gomnd - - godot - - exhaustivestruct - - paralleltest - - varnamelen - - ireturn - - exhaustruct - #- thelper + enable: + - revive + - goimports + - gosec + - unparam + - unconvert + - predeclared + - prealloc + - misspell + + # disable: + # - maligned + # - lll + # - gochecknoinits + # - gochecknoglobals + # - godox + # - gocognit + # - whitespace + # - wsl + # - funlen + # - wrapcheck + # - testpackage + # - nlreturn + # - gofumpt + # - goerr113 + # - gci + # - gomnd + # - godot + # - exhaustivestruct + # - paralleltest + # - varnamelen + # - ireturn + # - exhaustruct + # #- thelper issues: exclude-rules: diff --git a/ulid.go b/ulid.go index 4bd2ccd..e71aff7 100644 --- a/ulid.go +++ b/ulid.go @@ -15,9 +15,12 @@ import ( // ULID represents a ulid string format // ref: -// https://github.com/ulid/spec +// +// https://github.com/ulid/spec +// // impl: -// https://github.com/oklog/ulid +// +// https://github.com/oklog/ulid // // swagger:strfmt ulid type ULID struct { @@ -89,7 +92,9 @@ func NewULIDZero() ULID { } // NewULID generates new unique ULID value and a error if any -func NewULID() (u ULID, err error) { +func NewULID() (ULID, error) { + var u ULID + obj := ulidEntropyPool.Get() entropy, ok := obj.(io.Reader) if !ok {