编辑代码

package main
import "fmt"

func check(name string) bool{
    switch name{
        case "devin":
            return true
    }
    return false
}

func foo() (s []float64){
    defer fmt.Println(len(s))
    s = append(s, 1)
    return 
}

func main () {
    foo()

    //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。
    if check("devin"){
        fmt.Println("true")
    }else{
        fmt.Println("false")        
    }
}