From 5e426a269aa1632f270fcf53269c711266cd033b Mon Sep 17 00:00:00 2001 From: Mrinal Wadhwa Date: Sat, 10 Nov 2018 15:45:49 -0800 Subject: [PATCH] docs: improve examples --- example_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/example_test.go b/example_test.go index aae7a69..b041752 100644 --- a/example_test.go +++ b/example_test.go @@ -12,8 +12,8 @@ func ExampleParse() { if err != nil { log.Fatal(err) } - fmt.Printf("%#v", d) - // Output: &did.DID{Method:"example", ID:"q7ckgxeq1lxmra0r", IDStrings:[]string{"q7ckgxeq1lxmra0r"}, Path:"", PathSegments:[]string(nil), Fragment:""} + fmt.Printf("Method - %s, ID - %s", d.Method, d.ID) + // Output: Method - example, ID - q7ckgxeq1lxmra0r } func ExampleParse_withPath() { @@ -21,8 +21,8 @@ func ExampleParse_withPath() { if err != nil { log.Fatal(err) } - fmt.Printf("%#v", d) - // Output: &did.DID{Method:"example", ID:"q7ckgxeq1lxmra0r", IDStrings:[]string{"q7ckgxeq1lxmra0r"}, Path:"a/b", PathSegments:[]string{"a", "b"}, Fragment:""} + fmt.Printf("Method - %s, ID - %s, Path - %s", d.Method, d.ID, d.Path) + // Output: Method - example, ID - q7ckgxeq1lxmra0r, Path - a/b } func ExampleParse_withFragment() { @@ -30,8 +30,8 @@ func ExampleParse_withFragment() { if err != nil { log.Fatal(err) } - fmt.Printf("%#v", d) - // Output: &did.DID{Method:"example", ID:"q7ckgxeq1lxmra0r", IDStrings:[]string{"q7ckgxeq1lxmra0r"}, Path:"", PathSegments:[]string(nil), Fragment:"keys-1"} + fmt.Printf("Method - %s, ID - %s, Fragment - %s", d.Method, d.ID, d.Fragment) + // Output: Method - example, ID - q7ckgxeq1lxmra0r, Fragment - keys-1 } func ExampleDID_String() {