Last active
September 26, 2019 00:48
-
-
Save AnuchitO/e755c956fddca7d21ca8c326be85e8c6 to your computer and use it in GitHub Desktop.
Revisions
-
AnuchitO revised this gist
Sep 26, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,5 +5,5 @@ err := fmt.Errorf("create new error: %v", errOriginal) fmt.Printf("error value: %T\n", err) // สร้าง error ใหม่ ยังเก็บ(ห่อ) type เดิมไว้ข้างใน err = fmt.Errorf("wrapped error: %w", errOriginal) fmt.Printf("error value: %T\n", err) -
AnuchitO revised this gist
Sep 25, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ errOriginal := &os.PathError{Op: "read", Path: "/a/b", Err: errors.New("read error")} // ไม่ได้ห่อ แค่สร้าง error ใหม่จาก error เดิม err := fmt.Errorf("create new error: %v", errOriginal) fmt.Printf("error value: %T\n", err) // สร้าง error ใหม่ ยังเก็บ(ห่อ) type เดิมไว้ข้างใน err := fmt.Errorf("wrapped error: %w", errOriginal) fmt.Printf("error value: %T\n", err) -
AnuchitO revised this gist
Sep 24, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ errOriginal := &os.PathError{Op: "read", Path: "/a/b", Err: errors.New("read error")} // ไม่ได้ห่อแค่สร้าง error ใหม่จาก error เดิม err := fmt.Errorf("create new error: %v", errOriginal) -
AnuchitO created this gist
Sep 24, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ errOriginal := &os.PathError{Op: "read"} // ไม่ได้ห่อแค่สร้าง error ใหม่จาก error เดิม err := fmt.Errorf("create new error: %v", errOriginal) fmt.Printf("error value: %T\n", err) // ห่อ error ใหม่ ยังเก็บ type เดิมไว้ข้างใน err := fmt.Errorf("wrapped error: %w", errOriginal) fmt.Printf("error value: %T\n", err)