Created
May 20, 2016 08:26
-
-
Save johnsonz/f45a56373219821e672f353773e0cd9c to your computer and use it in GitHub Desktop.
go使用ioutil读取文件
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
func ReadFile(path string) []byte { | |
fmt.Println("path=", path) | |
content, err := ioutil.ReadFile(path) | |
if err != nil { | |
glog.Errorf("read file err: %v", err) | |
} | |
return content | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment