Skip to content

Instantly share code, notes, and snippets.

@amitk
Created May 13, 2020 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitk/807bae11617ebc1e75c36693c928e072 to your computer and use it in GitHub Desktop.
Save amitk/807bae11617ebc1e75c36693c928e072 to your computer and use it in GitHub Desktop.
A simple linked list in go
package main
import (
"fmt"
)
type Node struct {
data int
next *Node
}
func main() {
var head Node
var tail Node
head.data = 10;
tail.data = 20;
head.next = &tail;
fmt.Println("head Node: ", head, "\nTail Node: ", tail);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment