permissions := 0644 // or whatever you need
byteArray := []byte("to be written to a file\n")
err := ioutil.WriteFile("file.txt", byteArray, permissions)
if err != nil {
// handle error
}
./main.go:192:26: cannot use permissions (type int) as type os.FileMode in argument to ioutil.WriteFile