Skip to content

Commit 1cb97fd

Browse files
authored
refactor: fix typos in comments and struct names (#1304)
1 parent 8221f85 commit 1cb97fd

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

cli/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func fail(err string) {
3838

3939
// RunRevive runs the CLI for revive.
4040
func RunRevive(extraRules ...revivelib.ExtraRule) {
41-
// move parsing flags outside of init() otherwise tests dont works properly
41+
// move parsing flags outside of init() otherwise tests don't works properly
4242
// more info: https://github.com/golang/go/issues/46869#issuecomment-865695953
4343
initConfig()
4444

lint/filefilter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (ff *FileFilter) prepareRegexp() error {
117117
return nil
118118
}
119119

120-
// it's whole file mask, just escape dots and normilze separators
120+
// it's whole file mask, just escape dots and normalize separators
121121
fillRx := src
122122
fillRx = strings.ReplaceAll(fillRx, "\\", "/")
123123
fillRx = strings.ReplaceAll(fillRx, ".", `\.`)

rule/optimize_operands_order.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func (*OptimizeOperandsOrderRule) Apply(file *lint.File, _ lint.Arguments) []lin
1818
onFailure := func(failure lint.Failure) {
1919
failures = append(failures, failure)
2020
}
21-
w := lintOptimizeOperandsOrderlExpr{
21+
w := lintOptimizeOperandsOrderExpr{
2222
onFailure: onFailure,
2323
}
2424
ast.Walk(w, file.AST)
@@ -30,13 +30,13 @@ func (*OptimizeOperandsOrderRule) Name() string {
3030
return "optimize-operands-order"
3131
}
3232

33-
type lintOptimizeOperandsOrderlExpr struct {
33+
type lintOptimizeOperandsOrderExpr struct {
3434
onFailure func(failure lint.Failure)
3535
}
3636

3737
// Visit checks boolean AND and OR expressions to determine
3838
// if swapping their operands may result in an execution speedup.
39-
func (w lintOptimizeOperandsOrderlExpr) Visit(node ast.Node) ast.Visitor {
39+
func (w lintOptimizeOperandsOrderExpr) Visit(node ast.Node) ast.Visitor {
4040
binExpr, ok := node.(*ast.BinaryExpr)
4141
if !ok {
4242
return w

testdata/go1.24/struct_tag.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package fixtures
22

33
type decodeAndValidateRequest struct {
4-
// BEAWRE : the flag of URLParam should match the const string URLParam
4+
// BEWARE : the flag of URLParam should match the const string URLParam
55
URLParam string `json:"-" path:"url_param" validate:"numeric"`
66
Text string `json:"text" validate:"max=10"`
77
DefaultInt int `json:"defaultInt" default:"10.0"` // MATCH /type mismatch between field type and default value type in default tag/

testdata/struct_tag.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package fixtures
33
import "time"
44

55
type decodeAndValidateRequest struct {
6-
// BEAWRE : the flag of URLParam should match the const string URLParam
6+
// BEWARE : the flag of URLParam should match the const string URLParam
77
URLParam string `json:"-" path:"url_param" validate:"numeric"`
88
Text string `json:"text" validate:"max=10"`
99
DefaultInt int `json:"defaultInt" default:"10.0"` // MATCH /type mismatch between field type and default value type in default tag/

0 commit comments

Comments
 (0)