Re: [go-nuts] encoding/json mistakenly transfer int64 format to string

2022-04-14 Thread Brian Candler
"txtar " is the magic. In the playground, there's a dropdown on the right - it says "Hello, World!" by default. From here, you can select the example called "Multiple Files". On Thursday, 14 April 2022 at 17:50:14 UTC+1 michael...@gmail.com wrote:

Re: [go-nuts] encoding/json mistakenly transfer int64 format to string

2022-04-14 Thread Michael Ellis
@Brian That example is a superbly concise explanation go mod. Thanks! And I had no idea you could specify filenames and modules in the Playground. That's really useful! On Wednesday, April 13, 2022 at 3:11:54 AM UTC-4 Brian Candler wrote: > > I am a little bewildered by the new mod configurat

Re: [go-nuts] encoding/json mistakenly transfer int64 format to string

2022-04-13 Thread Brian Candler
> I am a little bewildered by the new mod configuration. It's as simple as this: go mod init blah go mod tidy You can put anything(*) for "blah". Literally "blah" will work. It's just whatever name you want to give your module. However if you plan to publish your module on github then using "

Re: [go-nuts] encoding/json mistakenly transfer int64 format to string

2022-04-12 Thread Zhaoxun Yan
Thank you Steven. I am a little bewildered by the new mod configuration. Will it compile If I download the source file from the new github source to src directory without further setting up a mod in the old fashioned way? I am using go1.15. And today I ran a test logging all the sendings to Redis

Re: [go-nuts] encoding/json mistakenly transfer int64 format to string

2022-04-12 Thread Steven Hartland
First off, the package you're using for redis isn't maintained; you should switch to github.com/gomodule/redigo/redis instead, which will allow you to remove the c == nil check as that doesn't happen. In your example you're ignoring error from json.Marshal which could be hiding a problem, so I wou

[go-nuts] encoding/json mistakenly transfer int64 format to string

2022-04-11 Thread Zhaoxun Yan
The scenario is upon receiving an incoming financial quotation, save it as a string of json into a Redis service. Sorry but I cannot provide the whole code of quotation receiving here, which is very complex with cgo. But the code below will help you get a glimpse on what should be going on: imp