type Point struct { x, y int } func main() { point := Point{x: 20, y: 50} if point == nil { fmt.Println("point is nil") } } こんな感じにpoint == nilと比較するとエラーなります。 cannot convert nil to type Point 要は値とnilを比較するのがダメ…
引用をストックしました
引用するにはまずログインしてください
引用をストックできませんでした。再度お試しください
限定公開記事のため引用できません。