mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
reflect: for struct tags, reject control chars (including tabs) in keys,
and empty keys. Also reject malformed (quoted) values. See also https://go-review.googlesource.com/3952 Change-Id: Ice6de33b09f9904b28e410a680a90aa6c8c76fed Reviewed-on: https://go-review.googlesource.com/3953 Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
9209d893c8
commit
6ea3adc3ba
2 changed files with 17 additions and 7 deletions
|
|
@ -2735,6 +2735,8 @@ var tagGetTests = []struct {
|
|||
{`protobuf:"PB(1,2)"`, `rotobuf`, ``},
|
||||
{`protobuf:"PB(1,2)" json:"name"`, `json`, `name`},
|
||||
{`protobuf:"PB(1,2)" json:"name"`, `protobuf`, `PB(1,2)`},
|
||||
{`k0:"values contain spaces" k1:"and\ttabs"`, "k0", "values contain spaces"},
|
||||
{`k0:"values contain spaces" k1:"and\ttabs"`, "k1", "and\ttabs"},
|
||||
}
|
||||
|
||||
func TestTagGet(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue