mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 03:53:42 +00:00
reflect: add StructField.IsExported method
This field was introduced in Go 1.17 and is used by the encoding/json package (starting with Go 1.17).
This commit is contained in:
committed by
Ron Evans
parent
ad73986070
commit
d45497691f
@@ -706,6 +706,11 @@ type StructField struct {
|
||||
Offset uintptr
|
||||
}
|
||||
|
||||
// IsExported reports whether the field is exported.
|
||||
func (f StructField) IsExported() bool {
|
||||
return f.PkgPath == ""
|
||||
}
|
||||
|
||||
// rawStructField is the same as StructField but with the Type member replaced
|
||||
// with rawType. For internal use only. Avoiding this conversion to the Type
|
||||
// interface improves code size in many cases.
|
||||
|
||||
Reference in New Issue
Block a user