[go-nuts] I get a "Invalid cast. " error when debuging
I using gdb for debugging, and set a variable new value , then failed. look this screen: (gdb) whatis tokenId type = struct string (gdb) set tokenId="ab" Invalid cast. (gdb) GO in gdb is not supported a memory value change? -- 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.
Re: [go-nuts] Re: Is there a bug in path.Dir?
OK, i get it 在 2016年6月21日星期二 UTC+8上午9:46:09,Ian Lance Taylor写道: > > On Mon, Jun 20, 2016 at 5:59 PM, <18126...@163.com > wrote: > > Package "filepath" works well, but the "path" package is not recommended > ? > > The path package is for slash-separated packages such as appear in URLs. > > The path/filepath package is for paths in the file system. > > Ian > > > > 在 2016年6月20日星期一 UTC+8下午1:40:55,徐新华写道: > >> > >> Package path implements utility routines for manipulating > >> slash-separated(/) paths. > >> > >> So, you should use "path/filepath" > > > > -- > > 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...@googlegroups.com . > > For more options, visit https://groups.google.com/d/optout. > -- 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.
[go-nuts] Re: Is there a bug in path.Dir?
Package "filepath" works well, but the "path" package is not recommended ? 在 2016年6月20日星期一 UTC+8下午1:40:55,徐新华写道: > > Package path implements utility routines for manipulating > slash-separated(/) paths. > > So, you should use "path/filepath" > -- 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.
[go-nuts] Is there a bug in path.Dir?
In windows platform, path.Dir and path.Base can't get the correct result. The test code is like this: func main() { filename := "F:\\Test\\conf\\rkc1" i := strings.LastIndex(filename, string(filepath.Separator)) fmt.Println("dir1:", string(filename[:i+1])) fmt.Println("base1:", string(filename[i+1:])) fmt.Println("dir2:", path.Dir(filename)) fmt.Println("base2:", path.Base(filename)) } result is : dir1: F:\Test\conf\ base1: rkc1 dir2: . base2: F:\Test\conf\rkc1 The dir2 and base2 is not correct , look into the path.Dir, the code is hard code with "/", but not filepath.Separator. Can it be considered as a bug in golang lib? -- 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.