I am trying to implement linked list of struct in Go using list package available. This is the sample code below -
package main
import (
"container/list"
"fmt"
)
type A struct{
B int
}
func main() {
l := list.New()
for i:=0;i<5;i++ {
c := A{i}
l.PushFront(c)
}
for e := l.Front(); e != nil; e = e.Next() {
fmt.Println(e.Value)
}
}
Output I get is in form {0}
and same for other iterations. How can I access the field to get the integer value ?