diff --git a/.golangci.yml b/.golangci.yml index 6104fd7..8d8baaf 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,20 +5,15 @@ linters: enable-all: true disable: # deprecated - - maligned - - scopelint - - interfacer - - golint - - exhaustivestruct - - nosnakecase - - structcheck - - deadcode - - varcheck - - ifshort + - gomnd + - execinquery # unused - nlreturn - exhaustruct - depguard + # requires go 1.22 + - copyloopvar + - intrange output: sort-results: true diff --git a/go.mod b/go.mod index dbd1cba..811bc10 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module golift.io/xtractr -go 1.19 +go 1.21 require ( github.com/andybalholm/brotli v1.1.0 @@ -24,6 +24,6 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/ulikunitz/xz v0.5.12 // indirect go4.org v0.0.0-20230225012048-214862532bf5 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/text v0.16.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index a217a9d..e52fd80 100644 --- a/go.sum +++ b/go.sum @@ -218,6 +218,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/start.go b/start.go index 3eddac2..296293c 100644 --- a/start.go +++ b/start.go @@ -1,7 +1,7 @@ package xtractr import ( - "fmt" + "errors" "os" ) @@ -50,14 +50,14 @@ type Xtractr struct { // Custom errors returned by this module. var ( - ErrQueueStopped = fmt.Errorf("extractor queue stopped, cannot extract") - ErrNoCompressedFiles = fmt.Errorf("no compressed files found") - ErrUnknownArchiveType = fmt.Errorf("unknown archive file type") - ErrInvalidPath = fmt.Errorf("archived file contains invalid path") - ErrInvalidHead = fmt.Errorf("archived file contains invalid header file") - ErrQueueRunning = fmt.Errorf("extractor queue running, cannot start") - ErrNoConfig = fmt.Errorf("call NewQueue() to initialize a queue") - ErrNoLogger = fmt.Errorf("xtractr.Config.Logger must be non-nil") + ErrQueueStopped = errors.New("extractor queue stopped, cannot extract") + ErrNoCompressedFiles = errors.New("no compressed files found") + ErrUnknownArchiveType = errors.New("unknown archive file type") + ErrInvalidPath = errors.New("archived file contains invalid path") + ErrInvalidHead = errors.New("archived file contains invalid header file") + ErrQueueRunning = errors.New("extractor queue running, cannot start") + ErrNoConfig = errors.New("call NewQueue() to initialize a queue") + ErrNoLogger = errors.New("xtractr.Config.Logger must be non-nil") ) // NewQueue returns a new Xtractr Queue you can send Xtract jobs into.