浏览代码

update README

Tao Wen 9 年之前
父节点
当前提交
8ef8e04fbc
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      README.md

+ 4 - 4
README.md

@@ -14,17 +14,17 @@ type StructOfTag struct {
 }
 }
 
 
 func Test_reflect_struct_tag_field(t *testing.T) {
 func Test_reflect_struct_tag_field(t *testing.T) {
-	jsoniter.Unmarshal(`{"field-1": "hello", "field2": "", "field3": "100"}`, &struct_)
+	err := jsoniter.Unmarshal(`{"field-1": "hello", "field2": "", "field3": "100"}`, &struct_)
 	if struct_.field1 != "hello" {
 	if struct_.field1 != "hello" {
-		fmt.Println(iter.Error)
+		fmt.Println(err)
 		t.Fatal(struct_.field1)
 		t.Fatal(struct_.field1)
 	}
 	}
 	if struct_.field2 != "world" {
 	if struct_.field2 != "world" {
-		fmt.Println(iter.Error)
+		fmt.Println(err)
 		t.Fatal(struct_.field2)
 		t.Fatal(struct_.field2)
 	}
 	}
 	if struct_.field3 != 100 {
 	if struct_.field3 != 100 {
-		fmt.Println(iter.Error)
+		fmt.Println(err)
 		t.Fatal(struct_.field3)
 		t.Fatal(struct_.field3)
 	}
 	}
 }
 }