Golang - Writing data to file

package main

import (
"bufio"
"fmt"
"os"
)

func main() {

fileHandle, _ := os.Create("output.txt")
writer := bufio.NewWriter(fileHandle)
defer fileHandle.Close()

fmt.Fprintln(writer, "String I want to write")
writer.Flush()
}

Comments system

[blogger][disqus][facebook]
Powered by Blogger.