gitee.com/wgliang/goreporter@v0.0.0-20180902115603-df1b20f7c5d0/linters/simplecode/testdata/single-case-select.go (about)

     1  package pkg
     2  
     3  func fn() {
     4  	var ch chan int
     5  	select { // MATCH /should use a simple channel send/
     6  	case <-ch:
     7  	}
     8  outer:
     9  	for { // MATCH /should use for range/
    10  		select {
    11  		case <-ch:
    12  			break outer
    13  		}
    14  	}
    15  
    16  	for { // MATCH /should use for range/
    17  		select {
    18  		case x := <-ch:
    19  			_ = x
    20  		}
    21  	}
    22  
    23  	for {
    24  		select { // MATCH /should use a simple channel send/
    25  		case ch <- 0:
    26  		}
    27  	}
    28  }