github.com/euank/go@v0.0.0-20160829210321-495514729181/test/syntax/chan1.go (about)

     1  // errorcheck -newparser=0
     2  
     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  
     7  // TODO(mdempsky): Update for new parser or delete.
     8  // Like go/parser, the new parser doesn't specially recognize
     9  // send statements misused in an expression context.
    10  
    11  package main
    12  
    13  var c chan int
    14  var v int
    15  
    16  func main() {
    17  	if c <- v { // ERROR "used as value"
    18  	}
    19  }
    20  
    21  var _ = c <- v // ERROR "used as value"