[go-nuts] Re: ping binding to interface

2018-12-11 Thread Christian Joergensen
Check out: - https://godoc.org/golang.org/x/net/icmp - https://godoc.org/golang.org/x/net/ipv4 - https://godoc.org/golang.org/x/net/ipv6 Cheers, Christian On Tuesday, December 11, 2018 at 9:02:02 AM UTC+1, Naveen Neelakanta wrote: > > Hi All, > > I have an application in golang, which require

[go-nuts] Re: json: cannot unmarshal array into Go struct field data.Members of type main.Members

2018-10-09 Thread Christian Joergensen
data.Members needs to be a slice. You also need to export slug (capitalize it) if you want to decode data into it. Try: type Member struct { Slug string `json:"slug"` } type data struct { Members []Member `json:"members"` } Cheers, Christian -- You received this message because you are sub

[go-nuts] Re: X509 pem RSA example?

2018-02-01 Thread Christian Joergensen
The public key is contained in the private key. Which can be decoded using encoding/pem and crypto/x509. Here's an example: https://gist.github.com/chrj/1d25c18882b33e78d5882fb1fd8bf693 Cheers, Christian -- You received this message because you are subscribed to the Google Groups "golang-nut

[go-nuts] Re: forwarding http request and response

2017-12-21 Thread Christian Joergensen
Hello Lee, What you're describing sounds like the works of a reverse proxy. Take a look at: https://godoc.org/net/http/httputil#ReverseProxy If you're interested in how it's accomplished, take a look at the source. It's pretty readable. Cheers, Christian On Thursday, December 21, 2017 at 4:5

[go-nuts] Re: Best way to launch/monitor several go process in production

2017-09-04 Thread Christian Joergensen
On Sunday, September 3, 2017 at 11:35:30 PM UTC+2, emarti...@gmail.com wrote: > > I am looking for the 'best' way to launch and monitor several go > processes. Doing it with just 1 is easy enough, using monit or systemctl > should do the trick, however since our app takes a while to start, we wa

[go-nuts] Re: database/sql - prepared select statements only work on first invocation

2017-08-28 Thread Christian Joergensen
On Monday, August 28, 2017 at 3:52:54 PM UTC+2, Ain wrote: > > Does anyone use prepared select statements sucessfully? With which > DB/driver? > I'm sure that if my code is silly someone would have pointed it out so I'm > wondering am I the only one trying to use prepared select statements... >

Re: [go-nuts] Built-in log Package

2017-08-17 Thread Christian Joergensen
On Thursday, August 17, 2017 at 11:40:08 AM UTC+2, dc0d wrote: > > That's a nice package with good design (and I've used it for a while). But > I loose the info about where the error is happening. > What do you mean by where the error is happening? Have you checked out http://godoc.org/github.

Re: [go-nuts] Re: HTTP/2 multiplexing

2017-08-03 Thread Christian Joergensen
On Thursday, August 3, 2017 at 11:07:50 AM UTC+2, pala.d...@gmail.com wrote: > > Example code with DuckDuckGo as default target: > > https://play.golang.org/p/_iI5-MDJ5t > This looks like a thundering herd race on connection setup. So there is no connection to reuse as none of them has been setup

[go-nuts] Re: Reading Json file from s3 and want to keep all values in-memory structure.

2017-03-28 Thread Christian Joergensen
On Tuesday, March 28, 2017 at 12:23:02 PM UTC+2, Christian Joergensen wrote: > > Take a look at his function: > https://godoc.org/github.com/aws/aws-sdk-go/service/s3#GetObjectOutput > Correction; I meant this function: https://godoc.org/github.com/aws/aws-sdk-go/service/s3#S3.GetOb

[go-nuts] Re: Reading Json file from s3 and want to keep all values in-memory structure.

2017-03-28 Thread Christian Joergensen
On Monday, March 27, 2017 at 9:17:05 PM UTC+2, hunt wrote: > > Just wanted to know how can i achieve this. > What did you try? Take a look at his function: https://godoc.org/github.com/aws/aws-sdk-go/service/s3#GetObjectOutput The Body attribute of the resulting GetObjectOutput struct can be pa

[go-nuts] Re: After conn.Close, connections is still alive

2017-03-07 Thread Christian Joergensen
On Tuesday, March 7, 2017 at 2:32:50 PM UTC+1, 倪彦春 wrote: > > I don't understand why the connection at clinet side is not closed after > `c.Close()` ? > When do you expect c.Close() to be called? Is it called then? Cheers, Christian -- You received this message because you are subscribed to

[go-nuts] Re: h2_bundle.go:3354: http2: server: error reading preface from client xx.xxx.xxx.128:43429: remote error: tls: revoked certificate

2017-03-03 Thread Christian Joergensen
On Friday, March 3, 2017 at 2:30:52 PM UTC+1, KLR wrote: > > The latest Firefox (51) produces this, FF 47 and Chrome work fine. > Start.com certificate. > > export GODEBUG=http2client=0 > export GODEBUG=http2server=0 > > eliminates the 'reading preface' error but the Código de error: > SEC_ERR

[go-nuts] Re: [ANN] chasquid: An SMTP (email) server written in Go

2017-03-03 Thread Christian Joergensen
Nice work! Have you considered "un-internalizing" some of your packages that could be useful outside your project? The spf and systemd packages looks pretty useful. Cheers, Christian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubsc

[go-nuts] Re: Serve large files

2017-02-28 Thread Christian Joergensen
Hello, I'd recommend you take a look at: https://godoc.org/net/http#ServeFile This also gives you support for range requests and other goodies. Cheers, Christian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group a

[go-nuts] Re: How could the body for a func be "provided by runtime"?

2017-02-09 Thread Christian Joergensen
On Thursday, February 9, 2017 at 1:15:00 PM UTC+1, Sina Siadat wrote: > > But can't find how the compiler connects the two. > It's using the //go:linkname compiler directive: https://github.com/golang/go/blob/master/src/runtime/panic.go#L583 https://golang.org/cmd/compile/ Cheers, Christian

Re: [go-nuts] enforce go source pretty printing

2017-01-07 Thread Christian Joergensen
On Friday, January 6, 2017 at 9:14:08 PM UTC+1, mhh...@gmail.com wrote: > > yeah, but this output of go/format.Print really hurts me bad, > Does everything really have to go directly in the initialization of your map? How about just going with something like this: https://play.golang.org/p/vqmzM

[go-nuts] Re: Not able to pass Bearer token in headers of a GET request in Golang

2016-10-31 Thread Christian Joergensen
Hi, Have you tried inspecting the network traffic? Does the request contain the extra header? What's urlfetch? Cheers, On Monday, October 31, 2016 at 1:35:00 PM UTC+1, Tahir Rauf wrote: > > I am using oauth2 to access a third party API. I can get the access token > alright, but when I try to

[go-nuts] Re: Namespacing hack using method on empty type

2016-08-05 Thread Christian Joergensen
Hi, For starters, packages can't implement interfaces. Cheers, On Friday, August 5, 2016 at 6:19:31 AM UTC+2, Christoph Berger wrote: > > Are there any advantages over using real packages? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To uns