Re: [go-nuts] Re: Hi, someone may help me converting this python code to GO

2016-07-10 Thread EdgarAlejandro Vintimilla
you're right, thanks I still have to improve this code and keep learning GO On Sunday, July 10, 2016 at 11:38:33 PM UTC-5, kortschak wrote: > > It's worth returning the error from strconv.ParseUint in the general > case. > > On Sun, 2016-07-10 at 21:02 -0700, eav...@gmail.com wrote: > > Than

Re: [go-nuts] Re: Hi, someone may help me converting this python code to GO

2016-07-10 Thread Dan Kortschak
It's worth returning the error from strconv.ParseUint in the general case. On Sun, 2016-07-10 at 21:02 -0700, eavi...@gmail.com wrote: > Thanks every one > > finally did it > > https://play.golang.org/p/20KzDE_u2a > -- You received this message because you are subscribed to the Google Group

Re: [go-nuts] Re: Hi, someone may help me converting this python code to GO

2016-07-10 Thread Dan Kortschak
On Sun, 2016-07-10 at 15:34 -0700, eavi...@gmail.com wrote: > 1) it not return exactly what return the code in python The code I have on the playground gives the same return as your python code. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. T

Re: [go-nuts] Re: Hi, someone may help me converting this python code to GO

2016-07-10 Thread Dan Kortschak
You are doing way too much work. Use the features of the language. When you say `fcs, _ := strconv.ParseUint("", base, size)`, why not just `fcs := uint16(0x)`. Make your integer types in Crc16 uint16 since that is what you are working with. On Sun, 2016-07-10 at 15:34 -0700, eavi...@gmai

Re: [go-nuts] Re: Hi, someone may help me converting this python code to GO

2016-07-10 Thread Michael Jones
Here is a direct solution for #2: strChecksum := fmt.Sprintf("0%0*xx", lengthOfHexCRC, GetCrc16(requestData))     fmt.Println(strChecksum) or     return strChecksum For #1, I am not sure what the problem is since I don’t know what you really want. I will say that

Re: [go-nuts] Re: Hi, someone may help me converting this python code to GO

2016-07-10 Thread Dan Kortschak
Not here. On Sun, 2016-07-10 at 10:04 +0100, Michael Jones wrote: > I get “030a1x” as the result of my Go port. Is that what you expected? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

Re: [go-nuts] Re: Hi, someone may help me converting this python code to GO

2016-07-10 Thread Michael Jones
I get “030a1x” as the result of my Go port. Is that what you expected? —— Michael Jones michael.jo...@gmail.com On Sun, Jul 10, 2016 at 6:10 AM, Kevin Powick wrote: Glad to see you put some effort into it yourself. -- You received this message because you are subscribed to the Google Groups "go