Skip to content

Commit 97a20c0

Browse files
authored
fix(CICD): skip some linters in test file and fix some typos (gin-contrib#14)
Signed-off-by: Bin Liang <[email protected]>
1 parent 23245be commit 97a20c0

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

.golangci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,17 @@ linters:
3939
- whitespace
4040
- gofumpt
4141

42+
issues:
43+
exclude-rules:
44+
- path: authenticator_test.go
45+
linters:
46+
- bodyclose
47+
- unparam
48+
- path: parser_test.go
49+
linters:
50+
- lll
51+
- path: signatureheader_test.go
52+
linters:
53+
- lll
4254
run:
4355
timeout: 3m

crypto/hmacsha256.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import (
88
const algoHmacSha256 = "hmac-sha256"
99

1010
// HmacSha256 signing algorithm using hmac and sha256
11-
type HmacSha256 struct {
12-
}
11+
type HmacSha256 struct{}
1312

1413
// Sign return signing of input msg with secret string
1514
func (h *HmacSha256) Sign(msg string, secret string) ([]byte, error) {
@@ -20,7 +19,7 @@ func (h *HmacSha256) Sign(msg string, secret string) ([]byte, error) {
2019
return mac.Sum(nil), nil
2120
}
2221

23-
// Name return name of algorithim
22+
// Name return name of algorithm
2423
func (h *HmacSha256) Name() string {
2524
return algoHmacSha256
2625
}

errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var (
2222
ErrDateNotFound = newPublicError("There is no Date on Headers")
2323
// ErrIncorrectAlgorithm error when Algorithm in header does not match with secret key
2424
ErrIncorrectAlgorithm = newPublicError("Algorithm does not match")
25-
// ErrHeaderNotEnough error when requiremts header do not appear on heder field
25+
// ErrHeaderNotEnough error when requirements header do not appear on header field
2626
ErrHeaderNotEnough = newPublicError("Header field is not match requirement")
2727
// ErrNoSignature error when no Signature not found in header
2828
ErrNoSignature = newPublicError("No Signature header found in request")

signatureheader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type SignatureHeader struct {
2323
algorithm string
2424
}
2525

26-
// NewSignatureHeader new instace of SignatureHeader
26+
// NewSignatureHeader new instance of SignatureHeader
2727
func NewSignatureHeader(r *http.Request) (*SignatureHeader, error) {
2828
return parseHTTPRequest(r)
2929
}

validator/datevalidate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ func newPublicError(msg string) *gin.Error {
1818
}
1919
}
2020

21-
// ErrDateNotInRange error when date not in aceptable range
22-
var ErrDateNotInRange = newPublicError("Date submit is not in aceptable range")
21+
// ErrDateNotInRange error when date not in acceptable range
22+
var ErrDateNotInRange = newPublicError("Date submit is not in acceptable range")
2323

2424
// DateValidator checking validate by time range
2525
type DateValidator struct {

0 commit comments

Comments
 (0)