summaryrefslogtreecommitdiffhomepage
path: root/test/packetimpact/testbench/layers.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-04-08 23:28:52 -0700
committergVisor bot <gvisor-bot@google.com>2020-04-08 23:30:09 -0700
commit21e438d257861eadc1dafcee914e4a51cffd3852 (patch)
tree7f26c0ae9ce193c952cbb1ea27c9ed9b709380ab /test/packetimpact/testbench/layers.go
parenta10389e783aab5f530641394ef44c8a1dede9372 (diff)
Dereference pointers in Layer's Stringer impl
Dereference any fields which are pointers before string formatting so that the value pointed to ends up in the string representation. Tested: Added TestLayerStringFormat to //third_party/gvisor/test/packetimpact/testbench:testbench_test PiperOrigin-RevId: 305627821
Diffstat (limited to 'test/packetimpact/testbench/layers.go')
-rw-r--r--test/packetimpact/testbench/layers.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/packetimpact/testbench/layers.go b/test/packetimpact/testbench/layers.go
index 4d6625941..093a46e23 100644
--- a/test/packetimpact/testbench/layers.go
+++ b/test/packetimpact/testbench/layers.go
@@ -118,7 +118,7 @@ func stringLayer(l Layer) string {
if v.IsNil() {
continue
}
- ret = append(ret, fmt.Sprintf("%s:%v", t.Name, v))
+ ret = append(ret, fmt.Sprintf("%s:%v", t.Name, reflect.Indirect(v)))
}
return fmt.Sprintf("&%s{%s}", t, strings.Join(ret, " "))
}