Re: [go-nuts] Building golang libraries

2017-09-29 Thread desaiabhijit
yes Ian Thanks for the help Can you please provide me for Ubuntu Thanks, Abhi On Friday, September 29, 2017 at 7:17:21 PM UTC+5:30, Ian Lance Taylor wrote: > > On Thu, Sep 28, 2017 at 10:02 PM, > wrote: > > > > Can you please provide command line to build

Re: [go-nuts] XML unmarshaller cannot handle space padded numbers

2017-09-29 Thread Sam Whited
On Fri, Sep 29, 2017, at 10:00, Per Persson wrote: > I made a commit > > > that I was about to make into a pull request, but then I saw the > contribution information and now I'm not sure where to propose the >

Re: [go-nuts] os/exec stdout bytes.Buffer and timeout behavior?

2017-09-29 Thread Ian Lance Taylor
On Fri, Sep 29, 2017 at 1:33 PM, Alex Buchanan wrote: > > Ok, that's a great explanation, thanks. Do you have a recommendation for how > to exit early? Would StdoutPipe() help? I tried setting Setpgid to true, but > probably os/exec doesn't pay attention to process groups. >

Re: [go-nuts] os/exec stdout bytes.Buffer and timeout behavior?

2017-09-29 Thread Alex Buchanan
Ok, that's a great explanation, thanks. Do you have a recommendation for how to exit early? Would StdoutPipe() help? I tried setting Setpgid to true, but probably os/exec doesn't pay attention to process groups. Alternatively, I can configure my shell scripts to close stdout/err on exit? Not

[go-nuts] Aborting tests early if any fail + getting streaming output

2017-09-29 Thread Traun Leyden
Is it possible to abort running a test suite if one of the tests fails? In my case I'm running the test against multiple packages: go test github.com/path/... and if one test fails, it seems to continue on running the rest of the tests. (if this is not the expected behavior, I can provide

Re: [go-nuts] os/exec stdout bytes.Buffer and timeout behavior?

2017-09-29 Thread Ian Lance Taylor
On Fri, Sep 29, 2017 at 12:33 PM, Alex Buchanan wrote: > > package main > > import ( > "bytes" > "context" > "log" > "os/exec" > "time" > ) > > func main() { > var stdout bytes.Buffer > > ctx, cancel := context.WithTimeout(context.Background(), time.Second)

[go-nuts] os/exec stdout bytes.Buffer and timeout behavior?

2017-09-29 Thread Alex Buchanan
package main import ( "bytes" "context" "log" "os/exec" "time" ) func main() { var stdout bytes.Buffer ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() cmd := exec.CommandContext(ctx, "/bin/sh", "-c", "sleep 10; echo foo") cmd.Stdout =

Re: [go-nuts] godoc only indexes packages in GOROOT?

2017-09-29 Thread Farid Zakaria
It will serve the documentation but not searchable (index) At the moment I'm solving it thusly: cat make_index.sh godoc -goroot=/home/fmzakari/go -index -index_files=godoc_internal_index.db -write_index godoc -index -index_files=godoc_system_index.db -write_index Then I load both of those

Re: [go-nuts] godoc only indexes packages in GOROOT?

2017-09-29 Thread Ayan George
farid.m.zaka...@gmail.com wrote: > Is there a reason why GODOC only indexes packages it finds in $GOROOT ? I > would like to create indices of my personal packages + the standard library. > I think it does. It looks in my ${GOPATH} and gives me what docs it can for my poorly commented code.

RE: [go-nuts] Redirect bug

2017-09-29 Thread Rodrigo Bahiense
If you are testing this in a browser it might be caching the redirect. Test the handler individually: https://godoc.org/net/http/httptest#example-ResponseRecorder -- Rodrigo Bahiense From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of

[go-nuts] godoc only indexes packages in GOROOT?

2017-09-29 Thread farid . m . zakaria
Is there a reason why GODOC only indexes packages it finds in $GOROOT ? I would like to create indices of my personal packages + the standard library. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] XML unmarshaller cannot handle space padded numbers

2017-09-29 Thread Per Persson
I have some XML files with space padded numbers in some attributes (e.g. `NumberOfPoints=" 266703"`) and the unmarshaller can't handle the spaces. Booleans are trimmed before parsed , so why not numbers? I made a commit

[go-nuts] Redirect bug

2017-09-29 Thread josue . performarkt
Hello to you all Today i've been working in go server project one of the http handlers has a redirect at the end, i.e. www.google.com but when i remove from the code this redirect, it keeps redirecting to the same url. // handler in the begin func handlerSetCookie(w http.ResponseWriter, r

[go-nuts] Re: Variable JSON format parsing, any best practice?

2017-09-29 Thread Yaroslav Molochko
That is exactly what I was looking for! Thank you very much! -- 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] Re: Graphing libraries in golang

2017-09-29 Thread ajstarks
SVGo is library for SVG generation, but others (some cited in this thread), have used it as a basis for building graphics and visualizations. See: [1] for examples (including how to interface to data, there's even a barchart [2] example :) [1]

[go-nuts] Re: Variable JSON format parsing, any best practice?

2017-09-29 Thread Amnon Baron Cohen
No silver bullet. But you can try defining value as json.RawMessage in order to delay the parsing till you know what you have got. See http://eagain.net/articles/go-dynamic-json/ On Friday, 29 September 2017 00:41:53 UTC+1, Yaroslav Molochko wrote: > > I have following json messages: > >

[go-nuts] Re: Building golang libraries

2017-09-29 Thread gary . willoughby
You could try plugins: https://golang.org/pkg/plugin/ On Friday, 29 September 2017 05:21:54 UTC+1, Abhijit Desai wrote: > > Want to create libraries ( static or dynamic ) so that that I don't want > to compile every time when I build my executable > > "github.com/everjit/Ion" <--- should not

Re: [go-nuts] Nested struct initialisation

2017-09-29 Thread arod . louis
Thank you! This is exactly what I was looking for. Le vendredi 29 septembre 2017 15:57:28 UTC+2, Ian Lance Taylor a écrit : > > On Fri, Sep 29, 2017 at 6:55 AM, > wrote: > > > > Do you know why the compiler does not infer nested struct type? Was > there > > any

Re: [go-nuts] Nested struct initialisation

2017-09-29 Thread Ian Lance Taylor
On Fri, Sep 29, 2017 at 6:55 AM, wrote: > > Do you know why the compiler does not infer nested struct type? Was there > any discussion about that? > > I find myself enjoying nested struct a lot when programming in Go. But, the > initialisation is so cumbersome that I always

[go-nuts] Nested struct initialisation

2017-09-29 Thread arod . louis
Hello gophers, Do you know why the compiler does not infer nested struct type? Was there any discussion about that? I find myself enjoying nested struct a lot when programming in Go. But, the initialisation is so cumbersome that I always end up removing the nested struct and giving a longer

Re: [go-nuts] internal/poll.runtime_pollWait problem on RHEL with 3.10.0-327.el7.x86_64

2017-09-29 Thread Ian Lance Taylor
On Thu, Sep 28, 2017 at 10:12 PM, Dan Kortschak wrote: > > I have just tried replicating the issue today and this time, one > machine passes everything, while the other does not. I am beginning to > suspect that file system loads may be a possible cause (the head

Re: [go-nuts] Building golang libraries

2017-09-29 Thread Ian Lance Taylor
On Thu, Sep 28, 2017 at 10:02 PM, wrote: > > Can you please provide command line to build executable using library > > go build -linkshared main.go > > -linkshared not supported on darwin/amd64 > > > doesn't work You asked about creating either a static or dynamic

Re: [go-nuts] Parsing a CSV column with partially double-quotes in it

2017-09-29 Thread Lantos István
Ian Davis! Thank you, this is worked! 2017-09-29 9:29 GMT+02:00 Ian Davis : > Try setting r.LazyQuotes=true > > > On Thu, 28 Sep 2017, at 09:56 PM, Lantos István wrote: > > > I want to parse the following CSV structure. The column separators are > tabs: > > *package main* > >

[go-nuts] Graphing libraries in golang

2017-09-29 Thread Daniel Whitenack
Hi Vikram, Great questions. In general for data related things, this is a great place to start looking for resources: https://github.com/gopherdata/resources/blob/master/tooling/README.md. that is a curated list that is kept up to date. I use https://github.com/gonum/plot quite a bit and

Re: [go-nuts] Re: Graphing libraries in golang

2017-09-29 Thread Sebastien Binet
On Fri, Sep 29, 2017 at 10:33 AM, Vikram Rawat wrote: > thanks a lot for your reply sebestian. > > > You certainly are a good man and I have high hopes for your library too... > > But before coming to Mailing list I check almost all of them and I didn't > find anyone

[go-nuts] Re: Graphing libraries in golang

2017-09-29 Thread Vikram Rawat
> > thanks a lot for your reply sebestian. You certainly are a good man and I have high hopes for your library too... But before coming to Mailing list I check almost all of them and I didn't find anyone useful. The https://github.com/aclements/go-gg package is not useful at all. Because

Re: [go-nuts] Parsing a CSV column with partially double-quotes in it

2017-09-29 Thread Ian Davis
Try setting r.LazyQuotes=true On Thu, 28 Sep 2017, at 09:56 PM, Lantos István wrote: > > I want to parse the following CSV structure. The column separators > are tabs:> > *package main* > > *import (* > *"encoding/csv"* > *"fmt"* > *"log"* > *"strings"* > *)* > > *func main()

Re: [go-nuts] Re: Graphing libraries in golang

2017-09-29 Thread Sebastien Binet
Vikram, On Sep 29, 2017 8:49 AM, "Vikram Rawat" wrote: Thanks for your reply. Library seems promising. but when I run it , this errors out cannot find package "bitbucket.org/zombiezen/gopdf/pdf" in any of: C:\Go\src\bitbucket.org\zombiezen\gopdf\pdf (from $GOROOT)

Re: [go-nuts] Re: Graphing libraries in golang

2017-09-29 Thread Dan Kortschak
To get bitbucket.org/zombiezen/gopdf/... to install, you will need to install mercurial. On Thu, 2017-09-28 at 23:49 -0700, Vikram Rawat wrote: > Thanks for your reply. Library seems promising. but when I run it , > this  > errors out > > > > cannot find package

[go-nuts] Re: Graphing libraries in golang

2017-09-29 Thread Vikram Rawat
Thanks for your reply. Library seems promising. but when I run it , this errors out cannot find package "bitbucket.org/zombiezen/gopdf/pdf" in any of: C:\Go\src\bitbucket.org\zombiezen\gopdf\pdf (from $GOROOT) C:\Projects\Go\src\bitbucket.org\zombiezen\gopdf\pdf (from $GOPATH) when I try go

[go-nuts] Re: Parsing a CSV column with partially double-quotes in it

2017-09-29 Thread pierre . curto
Because this is invalid csv. Should be: This\t"""is"" no"\tfun If you still need to parse it, then write your own parser that handles it, for instance using a bufio.Reader. Le jeudi 28 septembre 2017 22:56:27 UTC+2, Lantos István a écrit : > > > I want to parse the following CSV structure. The

Re: [go-nuts] Graphing libraries in golang

2017-09-29 Thread Sebastien Binet
On Wed, Sep 27, 2017 at 5:05 PM, Vikram Rawat wrote: > I come from an R background and I am not able to find one single decent > not too fancy but a decent graphing library that's good enough to work. > > Can you please suggest any library that is good enough for