commit | 33c392f72d16163eb0795b3d61b2196ac21e1799 | [log] [tgz] |
---|---|---|
author | Rob Pike <r@golang.org> | Sun Oct 24 14:11:07 2021 +1100 |
committer | Rob Pike <r@golang.org> | Fri Oct 29 02:11:42 2021 +0000 |
tree | 2121c6ed2c08c00b93f3eec8f27d950dae6c1091 | |
parent | af05d8be3d9dd566b2ce3ff5344258314f128ff6 [diff] |
reflect: add FieldByIndexErr This new function, although different in signature from other reflect functions, allows the caller to avoid the panic caused by nil embedded fields in calls to FieldByIndex. Fixes #48218 Change-Id: I447f135bb789148c27ae3f2f23dcf43094f4c1de Reviewed-on: https://go-review.googlesource.com/c/go/+/357962 Trust: Rob Pike <r@golang.org> Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://golang.org/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.