Browse Source

Fix documentation example showing use of ReadStruct

Logic flow was inverted. Example was printing the result when an
error was occurring and using panic when no error.
Kevin Etienne 8 years ago
parent
commit
6adc582934
1 changed files with 2 additions and 2 deletions
  1. 2 2
      example_read_test.go

+ 2 - 2
example_read_test.go

@@ -29,8 +29,8 @@ func ExampleRow_ReadStruct() {
 	readStruct := &structTest{}
 	err := row.ReadStruct(readStruct)
 	if err != nil {
-		fmt.Println(readStruct)
-	} else {
 		panic(err)
+	} else {
+		fmt.Println(readStruct)
 	}
 }