Skip to content

Commit 3b52147

Browse files
committed
reflect: implement Method.IsExported
1 parent 76f0ba3 commit 3b52147

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/reflect/type.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ type Method struct {
127127
Index int // index for Type.Method
128128
}
129129

130+
// IsExported reports whether the method is exported.
131+
func (m Method) IsExported() bool {
132+
return m.PkgPath == ""
133+
}
134+
130135
// The following Type type has been copied almost entirely from
131136
// https://github.com/golang/go/blob/go1.15/src/reflect/type.go#L27-L212.
132137
// Some methods have been commented out as they haven't yet been implemented.

0 commit comments

Comments
 (0)