Hi guys,

How can I handle to write something out using bufio.NewWriter?

My code is like below,

var writer *bufio.Writer
var err error
file, _ := os.OpenFile(*fileName, os.O_WRONLY | os.O_APPEND, 0644)
defer file.Close()

writer = bufio.NewWriter(file)

writer.WriteString(strings.Join("something\n")

err = writer.Flush()
if err != nil {
//invalid argument
log.Fatal(err)
}


What is wrong?


Thanks guys!!

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to