Skip to content

Instantly share code, notes, and snippets.

@esys
Created August 19, 2020 20:06
Show Gist options
  • Save esys/dadd341bc13b0d1e031f8f332dcb641a to your computer and use it in GitHub Desktop.
Save esys/dadd341bc13b0d1e031f8f332dcb641a to your computer and use it in GitHub Desktop.
type Node struct {
Data int
Left *Node
Right *Node
}
func NewNode(data int) *Node {
return &Node{data, nil, nil}
}
func (n *Node) Process() {
time.Sleep(2 * time.Second) // doing some time consuming things
fmt.Print(n.Data, " ")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment