github.com/goplus/gop@v1.2.6/printer/_testdata/13-Exists-comprehension/exists.gop (about) 1 type student struct { 2 name string 3 score int 4 } 5 6 a := [student{"du", 84}, student{"wang", 70}, student{"ken", 100}] 7 8 hasFullMark := {for x <- a if x.score == 100} 9 println("is any student full mark:", hasFullMark) 10 11 hasFailed := {for x <- a if x.score < 60} 12 println("is any student failed:", hasFailed)