...

Source file src/go/types/pointer.go

Documentation: go/types

     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 types
     6  
     7  // A Pointer represents a pointer type.
     8  type Pointer struct {
     9  	base Type // element type
    10  }
    11  
    12  // NewPointer returns a new pointer type for the given element (base) type.
    13  func NewPointer(elem Type) *Pointer { return &Pointer{base: elem} }
    14  
    15  // Elem returns the element type for the given pointer p.
    16  func (p *Pointer) Elem() Type { return p.base }
    17  
    18  func (t *Pointer) Underlying() Type { return t }
    19  func (t *Pointer) String() string   { return TypeString(t, nil) }
    20  

View as plain text