]> Cypherpunks repositories - gostls13.git/commit
reflect: add Method.IsExported and StructField.IsExported methods
authorJoe Tsai <joetsai@digital-static.net>
Thu, 15 Oct 2020 01:41:16 +0000 (18:41 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Thu, 25 Feb 2021 21:21:51 +0000 (21:21 +0000)
commitb83d073e9eb4cbd0cd5ca530f576668c49f6d0f1
treef706562328a6ff09eec8117618bc5edb100b2466
parent7fcf9893f71c75f6b2fd53bea326d5061f705208
reflect: add Method.IsExported and StructField.IsExported methods

The IsExported method is a more intuitive helper for checking whether
the method or field is exported than checking whether PkgPath is empty.

In the same CL, modify the standard library to make use of this helper.

Fixes #41563

Change-Id: Iaacfb3b74449501f98e2707aa32095a32bd3c3c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/266197
Trust: Joe Tsai <joetsai@digital-static.net>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/encoding/asn1/asn1.go
src/encoding/asn1/marshal.go
src/encoding/json/encode.go
src/encoding/xml/typeinfo.go
src/net/rpc/server.go
src/reflect/all_test.go
src/reflect/type.go
src/text/template/exec.go