summaryrefslogtreecommitdiff
path: root/spew/common_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'spew/common_test.go')
-rw-r--r--spew/common_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/spew/common_test.go b/spew/common_test.go
index f0119e6..4b786e6 100644
--- a/spew/common_test.go
+++ b/spew/common_test.go
@@ -20,6 +20,15 @@ import (
"fmt"
)
+// custom type to test Stinger interface on non-pointer receiver.
+type stringer string
+
+// String implements the Stringer interface for testing invocation of custom
+// stringers on types with non-pointer receivers.
+func (s stringer) String() string {
+ return "stringer " + string(s)
+}
+
// custom type to test Stinger interface on pointer receiver.
type pstringer string