func isPrimeNumber(possiblePrime int) bool {
for underPrime := 2; underPrime < possiblePrime; underPrime++ {
if possiblePrime%underPrime == 0 {
return false
}
}
return true
}
func findPrimeNumbers(channel chan int) {
for i := 2; ; /* infinite loop */ i++ {
// your code goes here
if isPrimeNumber(i){
chan <- i <========error on this line
}
assert(i < 100) // i is afraid of heights
}
}
我对此有错误,但无法弄清楚,需要帮助。谢谢
语法错误:意外的分号或换行符,期待 { FAIL
相关分类