File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,9 @@ type Type interface {
72
72
73
73
// NumMethod returns the number of methods accessible using Method.
74
74
//
75
- // Note that NumMethod counts unexported methods only for interface types.
75
+ // For a non-interface type, it returns the number of exported methods.
76
+ //
77
+ // For an interface type, it returns the number of exported and unexported methods.
76
78
NumMethod () int
77
79
78
80
// Name returns the type's name within its package for a defined type.
Original file line number Diff line number Diff line change @@ -1868,7 +1868,11 @@ func (v Value) Method(i int) Value {
1868
1868
return Value {v .typ , v .ptr , fl }
1869
1869
}
1870
1870
1871
- // NumMethod returns the number of exported methods in the value's method set.
1871
+ // NumMethod returns the number of methods in the value's method set.
1872
+ //
1873
+ // For a non-interface type, it returns the number of exported methods.
1874
+ //
1875
+ // For an interface type, it returns the number of exported and unexported methods.
1872
1876
func (v Value ) NumMethod () int {
1873
1877
if v .typ == nil {
1874
1878
panic (& ValueError {"reflect.Value.NumMethod" , Invalid })
You can’t perform that action at this time.
0 commit comments