forked from goodbadreviewer/immcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimmcheck_race.go
More file actions
31 lines (25 loc) · 1.21 KB
/
immcheck_race.go
File metadata and controls
31 lines (25 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//go:build race || immcheck
// +build race immcheck
package immcheck
// ImmcheckRaceEnabled can be used in test to verify if mutability should be detected or not.
const ImmcheckRaceEnabled = true
// RaceEnsureImmutability same as immcheck.EnsureImmutability
// but works only under `race` or `immcheck` build flags.
func RaceEnsureImmutability(v interface{}) func() {
return ensureImmutability(v, Options{})
}
// RaceEnsureImmutabilityWithOptions same as immcheck.EnsureImmutabilityWithOptions
// but works only under `race` or `immcheck` build flags.
func RaceEnsureImmutabilityWithOptions(v interface{}, options Options) func() {
return ensureImmutability(v, options)
}
// RaceCheckImmutabilityOnFinalization same as immcheck.CheckImmutabilityOnFinalization
// but works only under `race` or `immcheck` build flags.
func RaceCheckImmutabilityOnFinalization(v interface{}) {
checkImmutabilityOnFinalization(v, Options{})
}
// RaceCheckImmutabilityOnFinalizationWithOptions same as immcheck.CheckImmutabilityOnFinalizationWithOptions
//// but works only under `race` or `immcheck` build flags.
func RaceCheckImmutabilityOnFinalizationWithOptions(v interface{}, options Options) {
checkImmutabilityOnFinalization(v, options)
}