blob: 4860422ad87b5235059b3da161f1b4df2529bbb1 [file] [log] [blame]
Russ Cox57eb06f2012-02-16 23:51:04 -05001// errorcheck
Russ Coxcb584702011-01-31 18:52:16 -05002
3// Copyright 2010 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7package main
8
9var c chan int
10var v int
11
12func main() {
Russ Cox17e55392013-09-06 16:15:30 -040013 if c <- v { // ERROR "used as value"
Russ Coxcb584702011-01-31 18:52:16 -050014 }
15}
16
Russ Cox17e55392013-09-06 16:15:30 -040017var _ = c <- v // ERROR "used as value"