github.com/goplus/reflectx@v1.2.2/structfield_go119.go (about)

     1  //go:build go1.19
     2  // +build go1.19
     3  
     4  package reflectx
     5  
     6  // Struct field
     7  type structField struct {
     8  	name    name    // name is always non-empty
     9  	typ     *rtype  // type of field
    10  	_offset uintptr // byte offset of field
    11  }
    12  
    13  func (f *structField) offset() uintptr {
    14  	return f._offset
    15  }
    16  
    17  func (f *structField) embedded() bool {
    18  	return f.name.embedded()
    19  }
    20  
    21  func setEmbedded(f *structField) {
    22  	f.name.setEmbedded()
    23  }