Created
July 2, 2018 12:27
-
-
Save ksakae1216/5d34abe64c6a932296cbfe435c7b52f0 to your computer and use it in GitHub Desktop.
This file contains 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 characters
package funcpkg | |
import ( | |
"fmt" | |
"os" | |
) | |
// ErrHundleFunc エラー処理のサンプルです | |
func ErrHundleFunc() { | |
// 標準関数はほとんどが2つ目の戻り値にエラー情報を返します。 | |
file, err := os.Open("dummy.txt") | |
if err != nil { | |
fmt.Println("ファイルOPENエラー -> ", err) | |
} else { | |
fmt.Println("ファイルOPEN -> ", file) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment