Source file tour/generics/list.go

     1  //go:build OMIT
     2  
     3  package main
     4  
     5  // List represents a singly-linked list that holds
     6  // values of any type.
     7  type List[T any] struct {
     8  	next *List[T]
     9  	val  T
    10  }
    11  
    12  func main() {
    13  }
    14  

View as plain text