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