| 1 | // Copyright 2024 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | //go:build go1.24 |
| 6 | |
| 7 | package unfortunate |
| 8 | |
| 9 | import "sync" |
| 10 | |
| 11 | // Cases where the interior sync.noCopy shows through. |
| 12 | |
| 13 | type LocalOnce sync.Once |
| 14 | |
| 15 | func (LocalOnce) Bad() {} // want "Bad passes lock by value: unfortunate.LocalOnce contains sync.noCopy" |
| 16 | |
| 17 | type LocalMutex sync.Mutex |
| 18 | |
| 19 | func (LocalMutex) Bad() {} // want "Bad passes lock by value: unfortunate.LocalMutex contains sync.noCopy" |