Source file src/runtime/typekind.go

     1  // Copyright 2014 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 runtime
     6  
     7  const (
     8  	kindBool = 1 + iota
     9  	kindInt
    10  	kindInt8
    11  	kindInt16
    12  	kindInt32
    13  	kindInt64
    14  	kindUint
    15  	kindUint8
    16  	kindUint16
    17  	kindUint32
    18  	kindUint64
    19  	kindUintptr
    20  	kindFloat32
    21  	kindFloat64
    22  	kindComplex64
    23  	kindComplex128
    24  	kindArray
    25  	kindChan
    26  	kindFunc
    27  	kindInterface
    28  	kindMap
    29  	kindPtr
    30  	kindSlice
    31  	kindString
    32  	kindStruct
    33  	kindUnsafePointer
    34  
    35  	kindDirectIface = 1 << 5
    36  	kindGCProg      = 1 << 6
    37  	kindMask        = (1 << 5) - 1
    38  )
    39  
    40  // isDirectIface reports whether t is stored directly in an interface value.
    41  func isDirectIface(t *_type) bool {
    42  	return t.Kind_&kindDirectIface != 0
    43  }
    44  

View as plain text