diff options
author | Toshi Kikuchi <toshik@google.com> | 2021-02-11 14:37:37 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-02-11 14:39:41 -0800 |
commit | 2129dfff61526879ca6a681e7a498d1e0d9ace34 (patch) | |
tree | 9418ae4b091fb42e02ddf04a77f8922eb7e0ea90 /test/iptables/iptables.go | |
parent | c833eed80a4ceaf9da852ef361dd5f4864eb647d (diff) |
iptables test: Implement testCase interface on pointers
Implementing interfaces on value types causes the interface to be
implemented by both the value type and the pointer type of the
implementer. This complicates type assertion as it requires the
assertion to check for both the pointer type and the value type.
PiperOrigin-RevId: 357061063
Diffstat (limited to 'test/iptables/iptables.go')
-rw-r--r-- | test/iptables/iptables.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/iptables/iptables.go b/test/iptables/iptables.go index c2a03f54c..970587a02 100644 --- a/test/iptables/iptables.go +++ b/test/iptables/iptables.go @@ -64,12 +64,12 @@ type TestCase interface { type baseCase struct{} // ContainerSufficient implements TestCase.ContainerSufficient. -func (baseCase) ContainerSufficient() bool { +func (*baseCase) ContainerSufficient() bool { return false } // LocalSufficient implements TestCase.LocalSufficient. -func (baseCase) LocalSufficient() bool { +func (*baseCase) LocalSufficient() bool { return false } @@ -78,12 +78,12 @@ func (baseCase) LocalSufficient() bool { type localCase struct{} // ContainerSufficient implements TestCase.ContainerSufficient. -func (localCase) ContainerSufficient() bool { +func (*localCase) ContainerSufficient() bool { return false } // LocalSufficient implements TestCase.LocalSufficient. -func (localCase) LocalSufficient() bool { +func (*localCase) LocalSufficient() bool { return true } @@ -92,12 +92,12 @@ func (localCase) LocalSufficient() bool { type containerCase struct{} // ContainerSufficient implements TestCase.ContainerSufficient. -func (containerCase) ContainerSufficient() bool { +func (*containerCase) ContainerSufficient() bool { return true } // LocalSufficient implements TestCase.LocalSufficient. -func (containerCase) LocalSufficient() bool { +func (*containerCase) LocalSufficient() bool { return false } |