Re: [go-nuts] [ERROR] invalid argument when executing bufio.NewWriter.Flush()

2017-06-03 Thread Harry
Thanks Jan! You are great! On Saturday, 3 June 2017 13:00:51 UTC+2, Jan Mercl wrote: > > On Sat, Jun 3, 2017 at 12:42 PM Harry > wrote: > > > How can I handle to write something out using bufio.NewWriter? > > Just fine. The problem is you haven't created any file to write

Re: [go-nuts] [ERROR] invalid argument when executing bufio.NewWriter.Flush()

2017-06-03 Thread Jan Mercl
On Sat, Jun 3, 2017 at 12:42 PM Harry wrote: > How can I handle to write something out using bufio.NewWriter? Just fine. The problem is you haven't created any file to write to in the first place, which checking the error could have told you. -- -j -- You received this

[go-nuts] [ERROR] invalid argument when executing bufio.NewWriter.Flush()

2017-06-03 Thread Harry
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)