github.com/Rookout/GoSDK@v0.1.48/pkg/services/assembler/internal/unsafeheader/unsafeheader.go (about)

     1  // Copyright 2020 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.assembler file.
     4  
     5  // Package unsafeheader contains header declarations for the Go runtime's slice
     6  // and string implementations.
     7  //
     8  // This package allows packages that cannot import "reflect" to use types that
     9  // are tested to be equivalent to reflect.SliceHeader and reflect.StringHeader.
    10  package unsafeheader
    11  
    12  import (
    13  	"unsafe"
    14  )
    15  
    16  
    17  
    18  
    19  
    20  
    21  
    22  type Slice struct {
    23  	Data unsafe.Pointer
    24  	Len  int
    25  	Cap  int
    26  }
    27  
    28  
    29  
    30  
    31  
    32  
    33  
    34  type String struct {
    35  	Data unsafe.Pointer
    36  	Len  int
    37  }