diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
commit | 3e45412327a2654a77944249962b3652e6142299 (patch) | |
tree | bc3bf69452afa055423cbe0c5cfa8ca357df6ccf /test/assign.go | |
parent | c533680039762cacbc37db8dc7eed074c3e497be (diff) | |
download | golang-upstream/2011.01.12.tar.gz |
Imported Upstream version 2011.01.12upstream/2011.01.12
Diffstat (limited to 'test/assign.go')
-rw-r--r-- | test/assign.go | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/test/assign.go b/test/assign.go index fea7c2828..59471388c 100644 --- a/test/assign.go +++ b/test/assign.go @@ -9,45 +9,45 @@ package main import "sync" type T struct { - int; - sync.Mutex; + int + sync.Mutex } func main() { { - var x, y sync.Mutex; - x = y; // ERROR "assignment.*Mutex" - _ = x; + var x, y sync.Mutex + x = y // ERROR "assignment.*Mutex" + _ = x } { - var x, y T; - x = y; // ERROR "assignment.*Mutex" - _ = x; + var x, y T + x = y // ERROR "assignment.*Mutex" + _ = x } { - var x, y [2]sync.Mutex; - x = y; // ERROR "assignment.*Mutex" - _ = x; + var x, y [2]sync.Mutex + x = y // ERROR "assignment.*Mutex" + _ = x } { - var x, y [2]T; - x = y; // ERROR "assignment.*Mutex" - _ = x; + var x, y [2]T + x = y // ERROR "assignment.*Mutex" + _ = x } { - x := sync.Mutex{0, 0}; // ERROR "assignment.*Mutex" - _ = x; + x := sync.Mutex{0, 0} // ERROR "assignment.*Mutex" + _ = x } { - x := sync.Mutex{key: 0}; // ERROR "(unknown|assignment).*Mutex" - _ = x; + x := sync.Mutex{key: 0} // ERROR "(unknown|assignment).*Mutex" + _ = x } { - x := &sync.Mutex{}; // ok - var y sync.Mutex; // ok - y = *x; // ERROR "assignment.*Mutex" - *x = y; // ERROR "assignment.*Mutex" - _ = x; - _ = y; + x := &sync.Mutex{} // ok + var y sync.Mutex // ok + y = *x // ERROR "assignment.*Mutex" + *x = y // ERROR "assignment.*Mutex" + _ = x + _ = y } } |