mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
reflect: add example for StructTag
Fix a few minor vet quibbles while I'm here. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/13235059
This commit is contained in:
parent
60513bf2f4
commit
e07b5baf4f
2 changed files with 17 additions and 3 deletions
|
|
@ -948,7 +948,7 @@ func TestMap(t *testing.T) {
|
|||
|
||||
newm := newmap.Interface().(map[string]int)
|
||||
if len(newm) != len(m) {
|
||||
t.Errorf("length after copy: newm=%d, m=%d", newm, m)
|
||||
t.Errorf("length after copy: newm=%d, m=%d", len(newm), len(m))
|
||||
}
|
||||
|
||||
for k, v := range newm {
|
||||
|
|
@ -3478,7 +3478,7 @@ func TestAllocsInterfaceBig(t *testing.T) {
|
|||
}
|
||||
v := ValueOf(S{})
|
||||
if allocs := testing.AllocsPerRun(100, func() { v.Interface() }); allocs > 0 {
|
||||
t.Errorf("allocs:", allocs)
|
||||
t.Error("allocs:", allocs)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3495,7 +3495,7 @@ func TestAllocsInterfaceSmall(t *testing.T) {
|
|||
}
|
||||
v := ValueOf(int64(0))
|
||||
if allocs := testing.AllocsPerRun(100, func() { v.Interface() }); allocs > 0 {
|
||||
t.Errorf("allocs:", allocs)
|
||||
t.Error("allocs:", allocs)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue