GO语言学习笔记01 cannot use '\u0000' (type rune) as type string in assignment,

  1. package main
    import(
    “fmt”
    )
    var (
    a = 123
    b = “xyz”
    c = false
    )
    func pri() {
    a,b,d:=1,‘ppp’,true
    fmt.Println(a,b,c,d)
    }

pri函数报错cannot use ‘\u0000’ (type rune) as type string in assignment,
因为此处定义的d单引号,变量类型为rune,因此报错

你可能感兴趣的:(GO语言学习笔记01 cannot use '\u0000' (type rune) as type string in assignment,)