[go-nuts] How can I write/read a file by taking the advantage of linux writev/readv in golang?

2017-08-16 Thread yihao yang
Hi, I want to take advantage of writev when writing a file. But I didn't find the interface that accepts a [][]byte parameter. What can I do? Thanks, Yihao -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] Re: How to judge error in golang?

2017-08-02 Thread yihao yang
What is the philosophy in golang error? I also saw a lot of packages have their own Error override error interface. Why there is no shared Error structure with a shareable error code? 在 2017年8月2日星期三 UTC-7上午11:36:11,yihao yang写道: > > Hi, > > I found it is very difficult to judge

[go-nuts] How to judge error in golang?

2017-08-02 Thread yihao yang
Hi, I found it is very difficult to judge an error in golang. For example, if I want to judge a specific error returned by a function, but sometimes the error is just newed by errors.New(xxx). In those situations, should I just compare the error string to know what's the exact error? Is that a

[go-nuts] Need to call Process.Wait() before testing if the child process is exited

2017-08-01 Thread yihao yang
err := syscall.Kill(int(dmInfo.Pid), syscall.Signal(0)) if err == syscall.ESRCH { Warning("Daemon stopped for unknown reason. BinaryId:", binaryId) } else { if err != nil { Info("Daemon got error when signal-ed by 0. err:(", err.Erro

[go-nuts] How to break a long code into lines in Golang?

2017-07-25 Thread yihao yang
Hi, I have some problems on break long code into lines when developing in golang. Could you please help me on how to break a long code as following? time.Sleep(time.Duration(*Int64Flag_xxIntervalMS) * time. Millisecond - time.Now().Sub(timeStart)) Thanks, Yihao -- You received this