github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/compile/internal/types2/pointer.go (about)

     1  // Copyright 2011 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package types2
     6  
     7  // A Pointer represents a pointer type.
     8  type Pointer struct {
     9  	base Type
    10  }
    11  
    12  // NewPointer returns a new pointer type for the given element (base) type.
    13  func NewPointer(elem Type) *Pointer
    14  
    15  // Elem returns the element type for the given pointer p.
    16  func (p *Pointer) Elem() Type
    17  
    18  func (p *Pointer) Underlying() Type
    19  func (p *Pointer) String() string