Go中的空值

How do you express a "null" value in Go?

type Node struct { 
    next *Node
    data interface{}
}

And I want to say

return &Node{ data: NULL, next: NULL }

The equivalent of NULL is nil, as you already discovered. Note, though, that you don't generally need to initialize things to nil or zero in Go, because by default all variables (including dynamically allocated ones) are set to “zero values” according to type (numbers zero, references nil). So in your example saying new(Node) would result in a Node with both fields nil.

I just found out is nil

nil is the NULL in golang. .

I think Understanding Nil is an excellent and comprehensive intro of nil in Go. You can also watch the presentation video here.