go - Convert back byte array into file using golang -


is there way write byte array file? have file name , file extension(like temp.xml).

sounds want ioutil.writefile function standard library?

https://golang.org/pkg/io/ioutil/#writefile

it this:

permissions := 0644 # or whatever need bytearray := []byte("to written file\n") err := ioutil.writefile("file.txt", bytearray, permissions) if err != nil { ... } 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -