[go-nuts] Re: go2go (generics) and function binding

2020-05-31 Thread Ian Lance Taylor
On Sat, May 30, 2020 at 2:32 AM Sebastien Binet wrote: > > the thing I am trying to solve is, basically, a generic way to: > - pass a function with any number of parameters and a single return value > - "bind" that function to a slice of pointers to values (that will point to, > e.g., values extr

[go-nuts] Re: How to make the first character in a string lowercase?

2020-05-31 Thread peterGo
Your code only works when the first character is ASCII. For example, it does not work for the Greek alphabet, it does not work for an empty string. https://play.golang.org/p/FQgnWfZqnrO Peter On Sunday, May 31, 2020 at 5:57:07 PM UTC-4, jyoti...@gmail.com wrote: > > I came up with this: > > pac

[go-nuts] Re: How to make the first character in a string lowercase?

2020-05-31 Thread jyotinadda
I came up with this: package main import ( "fmt" "strings" ) func main() { fmt.Println(MakeFirstLowerCase("LikeThis")) } func MakeFirstLowerCase(s string) string { s=strings.ToLower(string(s[0]))+s[1:] return s } On Saturday, November 24, 2012 at 4:21:23 PM UTC+5:30, Nikolai wrote: > > Hi

[go-nuts] Re: Im battling to understand pointers to strings in a function - Please help

2020-05-31 Thread derek kenney
I cleaned up the code a bit so that your function calls are working. The results are still not coming our correctly. Take another pass at the logic for inx(), and you should be able to get your solution working. Use slices instead of fixed length arrays. Also, you don't need to use reference po

Re: [go-nuts] Re: C to Go calls taking a long time - is this cgo overhead or my mistake?

2020-05-31 Thread Tom Larsen
The threads are started by C. The C application starts by calling into Go/cgo to fill some structs with function pointers, which get returned back to C. C then calls those function pointers as it needs to. On Saturday, May 30, 2020 at 10:24:23 PM UTC-4, Ian Lance Taylor wrote: > > On Sat, May

[go-nuts] Re: Im battling to understand pointers to strings in a function - Please help

2020-05-31 Thread Silver 7331
Thanks all for your help. I got it to work like this: package main import "fmt" var ( iWork int sWork string ) func main() { theStr := "ASDSFHHTBBKLKKJHHDFGHJKHHHJHHKJKJJKJKsdkejffkjf43889934ythbnv3ouy4ti3ykfjjvwkjhfwiuiu4ui4uiyruuhfufuiwefhfwekllfe34t3gphrepgqhg38po3hgvnfh38t98ohgerqoi084r