Skip to content

Commit fd18fa5

Browse files
committed
chore: update tests
1 parent 8f82c8d commit fd18fa5

5 files changed

+38
-3
lines changed

pkg/golinters/embeddedstructfieldcheck/testdata/embeddedstructfieldcheck_comments.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Eembeddedstructfieldcheck
2-
package simple
2+
package testdata
33

44
import "time"
55

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//golangcitest:args -Eembeddedstructfieldcheck
2+
//golangcitest:config_path testdata/embeddedstructfieldcheck_mutex.yml
3+
package testdata
4+
5+
import "sync"
6+
7+
type MutextEmbedded struct {
8+
sync.Mutex // want `sync.Mutex should not be embedded`
9+
}
10+
11+
type MutextNotEmbedded struct {
12+
mu sync.Mutex
13+
}
14+
15+
type PointerMutextEmbedded struct {
16+
*sync.Mutex // want `sync.Mutex should not be embedded`
17+
}
18+
19+
type RWMutextEmbedded struct {
20+
sync.RWMutex // want `sync.RWMutex should not be embedded`
21+
}
22+
23+
type RWMutextNotEmbedded struct {
24+
mu sync.RWMutex
25+
}
26+
27+
type PointerRWMutextEmbedded struct {
28+
*sync.RWMutex // want `sync.RWMutex should not be embedded`
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: "2"
2+
3+
linters:
4+
settings:
5+
embeddedstructfieldcheck:
6+
forbid-mutex: true

pkg/golinters/embeddedstructfieldcheck/testdata/embeddedstructfieldcheck_simple.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Eembeddedstructfieldcheck
2-
package simple
2+
package testdata
33

44
import (
55
"context"

pkg/golinters/embeddedstructfieldcheck/testdata/embeddedstructfieldcheck_special_cases.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Eembeddedstructfieldcheck
2-
package simple
2+
package testdata
33

44
import "time"
55

0 commit comments

Comments
 (0)