Re: [go-nuts] os.Getwd() returns path separated with "\" in windows troubles me

2016-09-24 Thread Ally Dale
I think I know what the mistake is, thanks a lot. 在 2016年9月24日星期六 UTC+8上午1:33:58,Ian Lance Taylor写道: > > On Fri, Sep 23, 2016 at 8:54 AM, Ally Dale > wrote: > > Golang std library such as path.Split() all suppose path is separated > with > > "/". > > Note that the path

Re: [go-nuts] os.Getwd() returns path separated with "\" in windows troubles me

2016-09-23 Thread Ian Lance Taylor
On Fri, Sep 23, 2016 at 8:54 AM, Ally Dale wrote: > Golang std library such as path.Split() all suppose path is separated with > "/". Note that the path package is for slash separated strings, like URLs. If you are dealing with files, you should be using the path/filepath

[go-nuts] os.Getwd() returns path separated with "\" in windows troubles me

2016-09-23 Thread Ally Dale
Golang std library such as path.Split() all suppose path is separated with "/". But os.Getwd() get a path separated with "\" such as "D:\temp" in windows. That does troubled gophers to deal with os.Getwd() return path by golang std library. So could go authers fix this case to let os.Getwd()

Re: [go-nuts] os.Getwd() returns path separated with "\" in windows troubles me

2016-09-23 Thread andrey mirtchovski
you shouldn't have to care whether it's "/" or "\". use os.PathSeparator to ensure that your code is correct on all systems. On Fri, Sep 23, 2016 at 9:54 AM, Ally Dale wrote: > Golang std library such as path.Split() all suppose path is separated with > "/". > But os.Getwd()