• cannot convert nil to type
    nil只能赋值给指针、channel、func、interface、map或slice类型的变量,将nil赋值给其他类型的变量会引发panic。

在Golang中,如果将structObj==nil,不出意外的会得到一个编译错误cannot convert nil to type Person。

  • conversion from int64 to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
    https://blog.csdn.net/zkt286468541/article/details/126016095
    加rune
    s := string(rune(b))

  • call to (*T).Fatal from a non-test goroutine

  • panic: runtime error: invalid memory address or nil pointer dereference
    空指针,一般是实例没有赋值就引用


0 条评论

发表回复

您的电子邮箱地址不会被公开。