[go-nuts] How to generate generic code with generate?

2017-01-22 Thread hui zhang
Since go did not support generic yet , Generate give us a alternative choice . However, although I read the official document. I still don't know how to use go generate to generate code. Could anyone show us an example ? Let's take std::min in c++ us an example. min(x,y) // type could b

Re: [go-nuts] Foregrounding, process management, os/exec.Cmd

2017-01-22 Thread Ian Lance Taylor
On Sat, Jan 21, 2017 at 4:07 PM, James Aguilar wrote: > If you don't know or care about pagers and process management, you can stop > reading now. > > Background: I have a program that compile my code each time I modify it. It > produces logs continuously on a terminal. > > I'm trying to write a g

[go-nuts] cross-compilation for go-gl applications

2017-01-22 Thread Mads Horndrup
Hi guys, I hope I'm posting this in the appropiate forum. It's difficult to find this kind of go-gl documentation. I'm new to golang, but I'm experienced with OpenGL, usually through java wrappers. I'm using go-gl to access OpenGL through Go. I'm on a windows 10, 64-bit For go-gl applications,

Re: [go-nuts] [ANN] Gleam now supports distributed pure Go Map Reduce

2017-01-22 Thread Pablo Rozas Larraondo
Thanks Chris! I'll go through the documentation to understand this new approach. Pablo On Mon, Jan 23, 2017 at 12:19 PM, Chris Lu wrote: > Thanks! This page has a little more details. > > https://github.com/chrislusf/gleam/wiki/Write-Mapper-Reducer-in-Go > > LuaJIT is fast. But Go code is more

Re: [go-nuts] [ANN] Gleam now supports distributed pure Go Map Reduce

2017-01-22 Thread Chris Lu
Thanks! This page has a little more details. https://github.com/chrislusf/gleam/wiki/Write-Mapper-Reducer-in-Go LuaJIT is fast. But Go code is more manageable and can have more complicated logic with libraries. Sacrificing the readability with extra type casting from interface{} seems a small cos

Re: [go-nuts] Re: Trying to use a Struct with a variable named "type" for JSON

2017-01-22 Thread Matt Harden
Note that you can't use lowercase struct field names with encoding/json anyway, because fields must be exported for encoding/json to see them, and fields are exported by starting them with an uppercase letter. So if you want the JSON field names to be lower case, you have to use struct tags. I thin

[go-nuts] Re: Trying to use a Struct with a variable named "type" for JSON

2017-01-22 Thread Tamás Gulácsi
TL;DR; use struct tags to specify marshal/unmarsal names. type LoginRequest struct { User string `json:"username"` Passw string `json:"password"` } ... SetBody(struct { Type string `json:"type"` LoginRequest }{ Type: "LoginRequest", LoginRequest:{User:"my_admin", Passw:"testing123"}})

[go-nuts] Trying to use a Struct with a variable named "type" for JSON

2017-01-22 Thread popewv
Below is a snippet of my code. I need to pass a json body that has a field name "type" in it. I can create the body as a string, but I was trying to leverage structs. Obviously, trying to create a variable named 'type' in the struct throws errors. As "type" as a field name is common in json, I

Re: [go-nuts] Problems drawing on frames of an animated gif

2017-01-22 Thread kalekold via golang-nuts
Hmm.. the source gif I'm using must be compressed. Doesn't Go handle compressed gifs in the same way? When you say 'I may get unexpected results' is that because the current gif package doesn't support compression? On Sunday, 22 January 2017 02:47:13 UTC, andrey mirtchovski wrote: > > just as a

Re: [go-nuts] Trace encoding - traceEv(String/Stack) deferred output always sent at tail of trace file leaving it incomplete until stopped.

2017-01-22 Thread chrisstocktonaz
Hello, On Tuesday, January 3, 2017 at 11:19:12 PM UTC-7, Tarmigan wrote: > > Hi Chris, > > I think that the parsing of the runtime trace information like you are > describing is very interesting. I have been thinking about a similar > continuous tracing and automatic anomaly detection for my a

Re: [go-nuts] Trace encoding - traceEv(String/Stack) deferred output always sent at tail of trace file leaving it incomplete until stopped.

2017-01-22 Thread chrisstocktonaz
Hello, thanks for the response, excuse the late reply here got a bit busy over the holidays. On Wednesday, January 4, 2017 at 2:22:36 AM UTC-7, Dmitry Vyukov wrote: > > Streaming stacks and strings sounds fine to me. I don't see any > potential issues here. > Awesome, I think this alone would

[go-nuts] 2016 Go User Survey results

2017-01-22 Thread Matt Joiner
The go user survey closed on 22/12/16, but the results have not been posted. Where are they? -- 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, s