Re: [go-nuts] JSON with repeating section and Slice in struct

2016-10-30 Thread Henrik Johansson
You also have to name the fields using struct tags to match the actual json field names. On Sun, Oct 30, 2016, 12:28 Pietro Gagliardi wrote: > You need to export the fields of tData in order for encoding/json to see > them. > > On Oct 30, 2016, at 6:01 AM, MaReK Olšavský

[go-nuts] JSON with repeating section and Slice in struct

2016-10-30 Thread MaReK Olšavský
Hello, maybe i'm bad understand to json.Unmarshal and slices. I've data in json: vals :=

[go-nuts] Re: Unexpected lack of parallel speedup

2016-10-30 Thread John Morrice
Your code is a little buggy/funky and I think this is why you are having problems. The major problem is that you are not dispatching work across your goroutines properly. Every one of your "processFromChannel" goroutines competes to read from one "chan string", each using a for-range loop.

[go-nuts] Re: Unexpected lack of parallel speedup

2016-10-30 Thread John Morrice
Tidy solution, removing the songch, doh https://play.golang.org/p/2VppDS0U27 On Saturday, October 29, 2016 at 8:42:02 PM UTC+1, Florian Weimer wrote: > > I'm trying to parse OpenPGP key server dumps. Throughput is not too > bad so far, but I'd like to speed things up by introducing >

Re: [go-nuts] JSON with repeating section and Slice in struct

2016-10-30 Thread Pietro Gagliardi
You need to export the fields of tData in order for encoding/json to see them. > On Oct 30, 2016, at 6:01 AM, MaReK Olšavský wrote: > > Hello, > maybe i'm bad understand to json.Unmarshal and slices. > I've data in json: > vals := >

[go-nuts] Re: Unexpected lack of parallel speedup

2016-10-30 Thread John Morrice
Thought I'd be kind and illustrate your bug vs my solution with code. I use WaitGroups in both examples to keep things clearer. Your bug: https://play.golang.org/p/yoNPmbXnlW I.e. Ringo wrote Yellow Submarine Ringo wrote I am the Walrus Ringo wrote Eleanor Rigby Ringo wrote Come Together My

Re: [go-nuts] JSON with repeating section and Slice in struct

2016-10-30 Thread Shawn Milochik
Try this. It's great. https://mholt.github.io/json-to-go/ -- 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

[go-nuts] last day of october AddDate(0,1,0), got fist day of december, not last of november

2016-10-30 Thread Mican Zhang
as mentioned at subject, i try get last day of next month by AddDate from last of current month, but, i got unacceptable result, does anyone know this issue? package main import "fmt" import "time" func main() { now := time.Now() fdom := now.AddDate(0, 1, 0)

Re: [go-nuts] last day of october AddDate(0,1,0), got fist day of december, not last of november

2016-10-30 Thread Ian Lance Taylor
On Sun, Oct 30, 2016 at 8:39 PM, Mican Zhang wrote: > as mentioned at subject, i try get last day of next month by AddDate from > last of current month, but, i got unacceptable result, does anyone know this > issue? > > > package main > > import "fmt" > import "time" >

Re: [go-nuts] last day of october AddDate(0,1,0), got fist day of december, not last of november

2016-10-30 Thread Dan Kortschak
Yes, that is described (exactly) in the documentation for AddDate: ``` AddDate normalizes its result in the same way that Date does, so, for example, adding one month to October 31 yields December 1, the normalized form for November 31. ``` On Sun, 2016-10-30 at 20:39 -0700, Mican Zhang wrote: >

[go-nuts] Re: Building Go 1.7.3 from source on windows

2016-10-30 Thread Dave Cheney
> MYSQL not recognized as internal/external command ^ all.bat should never output that. I think you have something that pretends to be cmd.exe, or possibly something that pretends to be gcc.exe in your path. > Is there any way to verify my build is complete and it works correctly? If you

[go-nuts] Building Go 1.7.3 from source on windows

2016-10-30 Thread Henry
Hi, I am trying to build go 1.7.3 from source on windows. When running all.bat, other than the "MYSQL not recognized as internal/external command" message, the build appears to go just fine. However, I don't see "All Tests Passed" at the end of the build process. The last message was

Re: [go-nuts] Re: Working with "characters" in strings

2016-10-30 Thread so . query
thanks rob! On Saturday, October 29, 2016 at 1:24:02 PM UTC-7, Rob 'Commander' Pike wrote: > > Please read blog.golang.org/strings. > > -rob > > > On Sat, Oct 29, 2016 at 12:08 PM, wrote: > >> thanks! whats the "a:b" in this instance? did you mean s[i:i+1]? wouldn't >>

[go-nuts] help with termbox-go

2016-10-30 Thread Robert Solomon
Hi. I am learning go, and have no trouble w/ the CLI interface on either Ubuntu 16.04-64 bit or win10-64 bit. However, I am trying to learn termbox-go. My simple hello world works on Ubuntu but does not on win10. First time I tried this on win10, I got a runtime error about a deadlock situation.

Re: [go-nuts] Re: CGO: How to link static library across dependent packages?

2016-10-30 Thread Ian Lance Taylor
On Sat, Oct 29, 2016 at 10:22 AM, wrote: > Can you please provide more info? If i use the below command to compile my > project, the linker error still pops up. > > Just to recap, > > My packages A and B statically link a common library LIBA. Also, Package B > imports A.

[go-nuts] Re: Unexpected lack of parallel speedup

2016-10-30 Thread Florian Weimer
* John Morrice: > Thought I'd be kind and illustrate your bug vs my solution with code. I > use WaitGroups in both examples to keep things clearer. > > Your bug: > https://play.golang.org/p/yoNPmbXnlW > > I.e. > > Ringo wrote Yellow Submarine > Ringo wrote I am the Walrus > Ringo wrote Eleanor

Re: [go-nuts] Re: CGO: How to link static library across dependent packages?

2016-10-30 Thread Sriram
Sure will do that.. Thanks Ian On Oct 30, 2016 9:37 PM, "Ian Lance Taylor" wrote: > On Sat, Oct 29, 2016 at 10:22 AM, wrote: > > Can you please provide more info? If i use the below command to compile > my > > project, the linker error still pops up. > >