packagemainimport("container/list""fmt")funcinsertListElements(nint)*list.List{// add elements in list from 1 to nlst:=list.New()fori:=1;i<=n;i++{lst.PushBack(i)// insertion here}returnlst}funcmain(){n:=5myList:=insertListElements(n)fore:=myList.Front();e!=nil;e=e.Next(){fmt.Println(e.Value)}}