diff --git a/go/analysis/passes/copylock/copylock_test.go b/go/analysis/passes/copylock/copylock_test.go index 7667f35b4..ae249b1ac 100644 --- a/go/analysis/passes/copylock/copylock_test.go +++ b/go/analysis/passes/copylock/copylock_test.go @@ -16,11 +16,7 @@ import ( func Test(t *testing.T) { testdata := analysistest.TestData() - // TODO(mknyszek): Add "unfortunate" package once CL 627777 lands. That CL changes - // the internals of the sync package structures to carry an explicit noCopy to prevent - // problems from changes to the implementations of those structures, such as these - // tests failing, or a bad user experience. - analysistest.Run(t, testdata, copylock.Analyzer, "a", "typeparams", "issue67787") + analysistest.Run(t, testdata, copylock.Analyzer, "a", "typeparams", "issue67787", "unfortunate") } func TestVersions22(t *testing.T) { diff --git a/go/analysis/passes/copylock/testdata/src/unfortunate/local_go123.go b/go/analysis/passes/copylock/testdata/src/unfortunate/local_go123.go index 1aa3abc78..c6bc0256b 100644 --- a/go/analysis/passes/copylock/testdata/src/unfortunate/local_go123.go +++ b/go/analysis/passes/copylock/testdata/src/unfortunate/local_go123.go @@ -15,7 +15,7 @@ import "sync" // sync.Mutex gets called out, but without any reference to the sync.Once. type LocalOnce sync.Once -func (LocalOnce) Bad() {} // want `Bad passes lock by value: a.LocalOnce contains sync.\b.*` +func (LocalOnce) Bad() {} // want `Bad passes lock by value: unfortunate.LocalOnce contains sync.\b.*` // False negative: // LocalMutex doesn't have a Lock method. diff --git a/go/analysis/passes/copylock/testdata/src/unfortunate/local_go124.go b/go/analysis/passes/copylock/testdata/src/unfortunate/local_go124.go index 505b105a9..5f45402f7 100644 --- a/go/analysis/passes/copylock/testdata/src/unfortunate/local_go124.go +++ b/go/analysis/passes/copylock/testdata/src/unfortunate/local_go124.go @@ -12,8 +12,8 @@ import "sync" type LocalOnce sync.Once -func (LocalOnce) Bad() {} // want "Bad passes lock by value: a.LocalOnce contains sync.noCopy" +func (LocalOnce) Bad() {} // want "Bad passes lock by value: unfortunate.LocalOnce contains sync.noCopy" type LocalMutex sync.Mutex -func (LocalMutex) Bad() {} // want "Bad passes lock by value: a.LocalMutex contains sync.noCopy" +func (LocalMutex) Bad() {} // want "Bad passes lock by value: unfortunate.LocalMutex contains sync.noCopy"