[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

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. >

[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

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.

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

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

[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] 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

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