Skip to content

Commit 0baba8d

Browse files
committed
Relint
* updated linter config * fixed linting issues Signed-off-by: Frederic BIDON <[email protected]>
1 parent a534efd commit 0baba8d

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

.golangci.yml

+12-18
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
linters-settings:
2-
govet:
3-
check-shadowing: true
4-
golint:
5-
min-confidence: 0
62
gocyclo:
73
min-complexity: 45
8-
maligned:
9-
suggest-new: true
104
dupl:
115
threshold: 200
126
goconst:
@@ -16,7 +10,6 @@ linters-settings:
1610
linters:
1711
enable-all: true
1812
disable:
19-
- maligned
2013
- unparam
2114
- lll
2215
- gochecknoinits
@@ -29,17 +22,13 @@ linters:
2922
- wrapcheck
3023
- testpackage
3124
- nlreturn
32-
- gomnd
33-
- exhaustivestruct
34-
- goerr113
3525
- errorlint
3626
- nestif
3727
- godot
3828
- gofumpt
3929
- paralleltest
4030
- tparallel
4131
- thelper
42-
- ifshort
4332
- exhaustruct
4433
- varnamelen
4534
- gci
@@ -52,10 +41,15 @@ linters:
5241
- forcetypeassert
5342
- cyclop
5443
# deprecated linters
55-
- deadcode
56-
- interfacer
57-
- scopelint
58-
- varcheck
59-
- structcheck
60-
- golint
61-
- nosnakecase
44+
#- deadcode
45+
#- interfacer
46+
#- scopelint
47+
#- varcheck
48+
#- structcheck
49+
#- golint
50+
#- nosnakecase
51+
#- maligned
52+
#- goerr113
53+
#- ifshort
54+
#- gomnd
55+
#- exhaustivestruct

reference.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ const (
3838
fragmentRune = `#`
3939
)
4040

41+
var ErrChildURL = errors.New("child url is nil")
42+
4143
// New creates a new reference for the given string
4244
func New(jsonReferenceString string) (Ref, error) {
4345

@@ -144,7 +146,7 @@ func (r *Ref) Inherits(child Ref) (*Ref, error) {
144146
childURL := child.GetURL()
145147
parentURL := r.GetURL()
146148
if childURL == nil {
147-
return nil, errors.New("child url is nil")
149+
return nil, ErrChildURL
148150
}
149151
if parentURL == nil {
150152
return &child, nil

0 commit comments

Comments
 (0)