Skip to content

Commit

Permalink
revert test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Apr 30, 2023
1 parent a894df2 commit 4a63903
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
3 changes: 0 additions & 3 deletions test/testdata/configs/gocritic.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
run:
go: 1.14
linters-settings:
gocritic:
enabled-checks:
- rangeValCopy
- flagDeref
- wrapperFunc
- ruleguard
- syncMapLoadAndDelete # ignored because sync#Map.LoadAndDelete added in Go 1.15
settings:
rangeValCopy:
sizeThreshold: 2
Expand Down
11 changes: 0 additions & 11 deletions test/testdata/gocritic.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"flag"
"log"
"strings"
"sync"
)

var _ = *flag.Bool("global1", false, "") // want `flagDeref: immediate deref in \*flag.Bool\(.global1., false, ..\) is most likely an error; consider using flag\.BoolVar`
Expand Down Expand Up @@ -47,13 +46,3 @@ func gocriticDup(x bool) {
func gocriticRuleWrapperFunc() {
strings.Replace("abcabc", "a", "d", -1) // want "ruleguard: this Replace call can be simplified.*"
}

func gocriticSink(args ...any) {}

func gocriticIgnoreSyncMapLoadAndDelete(cond bool, m, m2 *sync.Map) {
actual, ok := m.Load("key")
if ok {
m.Delete("key")
gocriticSink(actual)
}
}

0 comments on commit 4a63903

Please sign in to comment.