Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
linters-settings:
govet:
check-shadowing: true
golint:
min-confidence: 0
gocyclo:
min-complexity: 45
maligned:
suggest-new: true
dupl:
threshold: 200
goconst:
Expand All @@ -16,7 +10,6 @@ linters-settings:
linters:
enable-all: true
disable:
- maligned
- unparam
- lll
- gochecknoinits
Expand All @@ -29,17 +22,13 @@ linters:
- wrapcheck
- testpackage
- nlreturn
- gomnd
- exhaustivestruct
- goerr113
- errorlint
- nestif
- godot
- gofumpt
- paralleltest
- tparallel
- thelper
- ifshort
- exhaustruct
- varnamelen
- gci
Expand All @@ -52,10 +41,15 @@ linters:
- forcetypeassert
- cyclop
# deprecated linters
- deadcode
- interfacer
- scopelint
- varcheck
- structcheck
- golint
- nosnakecase
#- deadcode
#- interfacer
#- scopelint
#- varcheck
#- structcheck
#- golint
#- nosnakecase
#- maligned
#- goerr113
#- ifshort
#- gomnd
#- exhaustivestruct
4 changes: 3 additions & 1 deletion reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const (
fragmentRune = `#`
)

var ErrChildURL = errors.New("child url is nil")

// New creates a new reference for the given string
func New(jsonReferenceString string) (Ref, error) {

Expand Down Expand Up @@ -144,7 +146,7 @@ func (r *Ref) Inherits(child Ref) (*Ref, error) {
childURL := child.GetURL()
parentURL := r.GetURL()
if childURL == nil {
return nil, errors.New("child url is nil")
return nil, ErrChildURL
}
if parentURL == nil {
return &child, nil
Expand Down
Loading