mirror of https://github.com/golang/go.git
Currently, mhdr/methods is emitted with the same len/cap. There's no way to distinguish between exported and non-exported methods statically. This CL splits mhdr/methods into two parts, use "len" for number of exported methods, and "cap" for all methods. This fixes the bug in issue #22075, which intends to return the number of exported methods but currently return all methods. Note that with this encoding, we still can access either all/exported-only/non-exported-only methods: mhdr[:cap(mhdr)] // all methods mhdr // exported methods mhdr[len(mhdr):cap(mhdr)] // non-exported methods Thank to Matthew Dempsky (@mdempsky) for suggesting this encoding. Fixes #22075 Change-Id: If662adb03ccff27407d55a5578a0ed05a15e7cdd Reviewed-on: https://go-review.googlesource.com/c/go/+/259237 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> |
||
|---|---|---|
| .. | ||
| all_test.go | ||
| asm_386.s | ||
| asm_amd64.s | ||
| asm_arm.s | ||
| asm_arm64.s | ||
| asm_mips64x.s | ||
| asm_mipsx.s | ||
| asm_ppc64x.s | ||
| asm_riscv64.s | ||
| asm_s390x.s | ||
| asm_wasm.s | ||
| deepequal.go | ||
| example_test.go | ||
| export_test.go | ||
| makefunc.go | ||
| set_test.go | ||
| swapper.go | ||
| tostring_test.go | ||
| type.go | ||
| value.go | ||