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() ret
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() get a path separated
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 package.
Ian
--
You
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 package is for slash s