Source file src/go/types/slice.go

     1  // Code generated by "go test -run=Generate -write=all"; DO NOT EDIT.
     2  // Source: ../../cmd/compile/internal/types2/slice.go
     3  
     4  // Copyright 2011 The Go Authors. All rights reserved.
     5  // Use of this source code is governed by a BSD-style
     6  // license that can be found in the LICENSE file.
     7  
     8  package types
     9  
    10  // A Slice represents a slice type.
    11  type Slice struct {
    12  	elem Type
    13  }
    14  
    15  // NewSlice returns a new slice type for the given element type.
    16  func NewSlice(elem Type) *Slice { return &Slice{elem: elem} }
    17  
    18  // Elem returns the element type of slice s.
    19  func (s *Slice) Elem() Type { return s.elem }
    20  
    21  func (s *Slice) Underlying() Type { return s }
    22  func (s *Slice) String() string   { return TypeString(s, nil) }
    23  

View as plain text