Go读取本地文件

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
b, err := ioutil.ReadFile("xxx/path")
if err != nil {
panic(err)
}
str := string(b)
b, err := ioutil.ReadFile("xxx/path") if err != nil { panic(err) } str := string(b)
b, err := ioutil.ReadFile("xxx/path")	
if err != nil {
  panic(err)
}
str := string(b)

 

Leave a Reply

Your email address will not be published. Required fields are marked *