github.com/bir3/gocompiler@v0.9.2202/src/go/types/pointer.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 Pointer represents a pointer type. 10 type Pointer struct { 11 base Type // element type 12 } 13 14 // NewPointer returns a new pointer type for the given element (base) type. 15 func NewPointer(elem Type) *Pointer { return &Pointer{base: elem} } 16 17 // Elem returns the element type for the given pointer p. 18 func (p *Pointer) Elem() Type { return p.base } 19 20 func (p *Pointer) Underlying() Type { return p } 21 func (p *Pointer) String() string { return TypeString(p, nil) }