1 // Copyright 2014 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.
5 // This file contains tests for the copylock checker's
6 // range statement analysis.
27 for _
, mu
= range s
{ // ERROR "range var mu copies lock: sync.Mutex"
29 for _
, m
:= range s
{ // ERROR "range var m copies lock: sync.Mutex"
31 for i
, mu
= range s
{ // ERROR "range var mu copies lock: sync.Mutex"
33 for i
, m
:= range s
{ // ERROR "range var m copies lock: sync.Mutex"
37 for _
, m
:= range a
{ // ERROR "range var m copies lock: sync.Mutex"
40 var m
map[sync
.Mutex
]sync
.Mutex
41 for k
:= range m
{ // ERROR "range var k copies lock: sync.Mutex"
43 for mu
, _
= range m
{ // ERROR "range var mu copies lock: sync.Mutex"
45 for k
, _
:= range m
{ // ERROR "range var k copies lock: sync.Mutex"
47 for _
, mu
= range m
{ // ERROR "range var mu copies lock: sync.Mutex"
49 for _
, v
:= range m
{ // ERROR "range var v copies lock: sync.Mutex"
55 for mu
= range c
{ // ERROR "range var mu copies lock: sync.Mutex"
57 for v
:= range c
{ // ERROR "range var v copies lock: sync.Mutex"
60 // Test non-idents in range variables
65 for t
.i
, t
.mu
= range s
{ // ERROR "range var t.mu copies lock: sync.Mutex"