From 729c98acca0a86343a852f78cf233aa3aa89866d Mon Sep 17 00:00:00 2001 From: Siqing Zheng Date: Wed, 21 Aug 2024 16:36:04 -0700 Subject: [PATCH] comment --- example_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/example_test.go b/example_test.go index 0bd6c23..241f0d0 100644 --- a/example_test.go +++ b/example_test.go @@ -56,7 +56,7 @@ func makeIntDoublerWithError(t reflect.Type) (func(v reflect.Value), error) { if f.Type.Kind() == reflect.String { return errors.Errorf("error on string, and stop walk") } - return nil // default nil recursive down + return nil // return nil will recurse on a field that is struct }) return func(v reflect.Value) { v = v.Elem() @@ -109,7 +109,8 @@ func Example() { fmt.Printf("%v\n", v.Interface()) fmt.Printf("%v", err) - // Output: &{6 {4 12} string {10}} + // Output: + // &{6 {4 12} string {10}} // &{12 {4 12} string {10}} // } @@ -132,6 +133,7 @@ func ExampleError() { fmt.Printf("%v\n", v.Interface()) fmt.Printf("%v", err) - // Output: &{6 {4 12} string {5}} + // Output: + // &{6 {4 12} string {5}} // error on string, and stop walk }