[go-nuts] Avro schema generator for a DB record

2018-02-14 Thread suraj birla
I need to create a avro schema based on the data received from a table. Number of columns will be dynamic.is there a library available which I can used to generate schema -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] can someone create an example for me of a webpage that can run a bash command ?

2018-02-14 Thread Jonathan Yu
Hi Dave, I think what you want is to combine net/http (for the server part) with os/exec (to invoke bash, though with your example you don't need a shell and could execute the `ls` command directly). You'd need one or two handlers; maybe browse this to understand more:

[go-nuts] can someone create an example for me of a webpage that can run a bash command ?

2018-02-14 Thread David Brendlinger
can someone create an example for me of a webpage that can run a bash command ? I would like a index.html that has a button on it. you hit the button and it would do a ls /tmp >> myfile I am a newby :) Thank you in advance Dave -- You received this message because you are

[go-nuts] Possible to stream database/sql rows to text/template?

2018-02-14 Thread Tamás Gulácsi
"{{range pipeline}} T1 {{end}} The value of the pipeline must be an array, slice, map, or channel." So you can use a channel with slices. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

[go-nuts] Possible to stream database/sql rows to text/template?

2018-02-14 Thread Matt R.
I'm interested in streaming results from a *database/sql* query to a template rendered with *html/template*. More specifically, for performance reasons, I'm interested in streaming an array of results from the database straight to text/template without allocating a slice beforehand. My idea is

Re: [go-nuts] gccgo produces much slower code than gc

2018-02-14 Thread Ian Lance Taylor
On Wed, Feb 14, 2018 at 12:00 PM, Tamir Duberstein wrote: > Running the benchmarks in github.com/cockroachdb/cockroach/pkg/roachpb: > >> PATH=$HOME/local/go1.10/bin:$PATH >> go test -i ./pkg/roachpb && go test -run - -bench . ./pkg/roachpb -count 5 >> -benchmem > gc.txt >> >>

[go-nuts] Tweaking sync.Pool for mostly-empty pools

2018-02-14 Thread Carlo Alberto Ferraris
In an attempt to reduce the time pprof says is spent in sync.Pool (internal workloads, sorry) I modified Get and getSlow to skip locking the per-P shared pools if the pools are likely to be empty. This yields promising results, but I'm not sure the approach is sound since the check I do is

Re: [go-nuts] Re: Gobot Beaglebone Black GPIO question...

2018-02-14 Thread Ron Evans
Hi, everyone The issue turned out to simply be a matter of a misnamed pin, combined with some changes to how you configure the BeagleBone. The Beaglebone's Debian OS is now much simpler to setup, so some of our directions needed to be removed, as they were also interferring with the newer

[go-nuts] gccgo produces much slower code than gc

2018-02-14 Thread Tamir Duberstein
Running the benchmarks in github.com/cockroachdb/cockroach/pkg/roachpb: PATH=$HOME/local/go1.10/bin:$PATH > go test -i ./pkg/roachpb && go test -run - -bench . ./pkg/roachpb -count 5 > -benchmem > gc.txt > > PATH=$GCCROOT/gcc/bin:$PATH > go test -i ./pkg/roachpb && go test -run - -bench .

Re: [go-nuts] Resources to learn Go as a first programming language?

2018-02-14 Thread Wojciech S. Czarnecki
On Wed, 14 Feb 2018 04:22:38 -0800 (PST) Espinho wrote: > Can someone point me out some good resources for learning Go + Free book: https://miek.nl/files/go/Learning-Go-latest.pdf + Free book: http://openmymind.net/The-Little-Go-Book Both books while not new are meant as

[go-nuts] Re: Resources to learn Go as a first programming language?

2018-02-14 Thread Espinho
Thank you. quarta-feira, 14 de Fevereiro de 2018 às 13:40:47 UTC, Espinho escreveu: > > Can someone point me out some good resources for learning Go as first > programming language? All the resources I saw until now assume some > "programming background". I already did some online javascript

Re: [go-nuts] memory leak, heap size doesn't match process res size

2018-02-14 Thread Kane Kim
I've measured resident size multiple times, with top, /proc/pid/smem, pmap. There is a huge allocated region towards the end of virtual memory: 7fba77bb-7fbc3bf37000 rw-p 00:00 0 Size:7409180 kB Rss: 7408840 kB Pss: 7408840 kB Shared_Clean:

[go-nuts] Re: Resources to learn Go as a first programming language?

2018-02-14 Thread matthewjuran
Well, what do you want to know? I’m not aware of good online resources for people new to programming, but maybe we can help. Matt On Wednesday, February 14, 2018 at 7:40:47 AM UTC-6, Espinho wrote: > > Can someone point me out some good resources for learning Go as first > programming

Re: [go-nuts] How can I fetch the default locale (server locale not from the request) in Golang

2018-02-14 Thread Ian Lance Taylor
On Tue, Feb 13, 2018 at 11:19 PM, wrote: > > I'm a newbee to Golang and am trying to fetch the default server locale. > Can you help me how I can fetch the default server locale in golang? > > In other words, I'm looking for the Java equivalent code in golang

[go-nuts] Re: How can I fetch the default locale (server locale not from the request) in Golang

2018-02-14 Thread matthewjuran
Serving to a locale may be helped with this blog: https://blog.golang.org/matchlang This library looks like it has implementations for finding the OS locale: https://github.com/cloudfoundry-attic/jibber_jabber Matt On Wednesday, February 14, 2018 at 7:40:47 AM UTC-6, prabhakara...@gmail.com

Re: [go-nuts] Re: ioutil.ReadAll()

2018-02-14 Thread matthewjuran
The source for ioutil.ReadAll() shows that it can return a bytes.ErrTooLarge or an error from the io.Reader. So what you're saying is that unless the response contain chunked data, > ioutil.ReadAll() will never fail? I thought typically the http response isn’t buffered into memory first, so

[go-nuts] Resources to learn Go as a first programming language?

2018-02-14 Thread Espinho
Can someone point me out some good resources for learning Go as first programming language? All the resources I saw until now assume some "programming background". I already did some online javascript tutorials, so I know the very basics (variables, arrays, etc). I would much rather prefer

[go-nuts] How can I fetch the default locale (server locale not from the request) in Golang

2018-02-14 Thread prabhakaran . anish1986
Hello All, I'm a newbee to Golang and am trying to fetch the default server locale. Can you help me how I can fetch the default server locale in golang? In other words, I'm looking for the Java equivalent code in golang i.e ' Locale.getDefault()' Thanks Anish -- You received this message

Re: [go-nuts] memory leak, heap size doesn't match process res size

2018-02-14 Thread Peter Waller
First, a sanity check: How are you measuring the resident set? Are you certain the memstats data you presented are from the same run (and after) you hit 10G resident? What you have described doesn't immediately fit in my mental model. Could you be measuring the VM size rather than the resident

Re: [go-nuts] Re: ioutil.ReadAll()

2018-02-14 Thread 'Axel Wagner' via golang-nuts
Why are the things mentioned so far not sufficient? ReadAll returns a non-nil error, if the reader you are passing to it returns a non-nil, non-EOF error. In this case, you are passing Response.Body , which does not make any guarantees regarding the errors

Re: [go-nuts] ioutil.ReadAll()

2018-02-14 Thread Jakob Borg
On 14 Feb 2018, at 10:50, mrx > wrote: resp, err := http.Get("http://example.com/;) if err != nil { // handle error } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) That err returned from ReadAll. I cannot see how that

Re: [go-nuts] Re: ioutil.ReadAll()

2018-02-14 Thread mrx
On Wed, Feb 14, 2018 at 10:30 AM, Axel Wagner wrote: > > On Wed, Feb 14, 2018 at 10:01 AM mrx wrote: > >> >> On Tue, Feb 13, 2018 at 5:26 PM, Axel Wagner < >> axel.wagner...@googlemail.com> wrote: >> >>> Not very, but it does depend on the

Re: [go-nuts] Re: ioutil.ReadAll()

2018-02-14 Thread 'Axel Wagner' via golang-nuts
On Wed, Feb 14, 2018 at 10:01 AM mrx wrote: > > On Tue, Feb 13, 2018 at 5:26 PM, Axel Wagner < > axel.wagner...@googlemail.com> wrote: > >> Not very, but it does depend on the details. For example, you might >> provide your own http.Transport for the client to use, or even

Re: [go-nuts] Re: ioutil.ReadAll()

2018-02-14 Thread mrx
On Tue, Feb 13, 2018 at 5:26 PM, Axel Wagner wrote: > Not very, but it does depend on the details. For example, you might > provide your own http.Transport for the client to use, or even your own > net.Conn. > Using ioutils.ReadAll() on a HTTP request means to me