[go-nuts] Delve: Any way to get the "listing" of code when using "dlv attach " ?

2017-02-13 Thread Lax Clarke
Hi, Is there any way to get the listing of code (i.e., "list" ) after doing dlv attach ? That is, I want to build my golang binary such that attaching to it later gives me the line by line listing. Thanks -- You received this message because you are subscribed to the Google Groups "golang-nu

[go-nuts] encode struct as JSON, and use it in http.NewRequest ( io.Writer vs. io.Reader issue )H

2016-10-01 Thread Lax Clarke
Hi, I want to marshall a struct as JSON and use it in an http.NewRequest. The problem is, encoding/json package provides NewEncoder, but that works on an io.Writer (see: https://golang.org/pkg/encoding/json/#NewEncoder) While, http.NewRequest accepts an io.Reader as the body of request. (see: ht

[go-nuts] Re: How to pass arbitrary typed (int, string, etc) slices to a golang function?

2016-09-24 Thread Lax Clarke
On Friday, September 23, 2016 at 12:30:36 AM UTC-4, Dave Cheney wrote: > > There are two ways, one is to use reflection, the other would be to use > unsafe to convert the slice value into another structure then extract the > length field. > > Assuming that you could write a Len function as you

[go-nuts] How to pass arbitrary typed (int, string, etc) slices to a golang function?

2016-09-22 Thread Lax Clarke
How would someone create a function like len ? func Len(s []interface{}) would not work because compiler complains of type mismatch if you call it with an integer slice (for example) Thanks -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To