[go-nuts] Fixing the version of protoc-gen-go

2018-03-23 Thread Timothy Raymond
I've been running protoc and protoc-gen-go in a container (and fixing versions by checking out commits) to try to address this problem for my projects. I'd love to hear what others have done though. -- You received this message because you are subscribed to the Google Groups "golang-nuts" grou

Re: [go-nuts] implementation for GetsockoptLinger() and GetsockoptTimeval()

2018-03-23 Thread Ian Lance Taylor
On Fri, Mar 23, 2018 at 3:43 PM, yuxuanli via golang-nuts wrote: > > I am using the x/sys/unix package to get the socket options of a fd. While > there are SetsockoptLinger() and SetsockoptTimeval() for setting the Linger > and Timeout options, there is no corresponding getter for them. I wonder i

[go-nuts] implementation for GetsockoptLinger() and GetsockoptTimeval()

2018-03-23 Thread yuxuanli via golang-nuts
Hi, I am using the x/sys/unix package to get the socket options of a fd. While there are SetsockoptLinger() and SetsockoptTimeval() for setting the Linger and Timeout options, there is no corresponding getter for them. I wonder if there's another prefera

Re: [go-nuts] Copy a slice to new memory adresses

2018-03-23 Thread Alex Efros
Hi! On Fri, Mar 23, 2018 at 12:10:55PM -0700, Alex Dvoretskiy wrote: > For example, I have a multidimensional slice, which I want to modify, but > keep an original slice untouched. > > Do I need to do this all the time or there is another convenient way to do > this?: > > https://play.golang.o

[go-nuts] Copy a slice to new memory adresses

2018-03-23 Thread Alex Dvoretskiy
Hello Golang nuts, For example, I have a multidimensional slice, which I want to modify, but keep an original slice untouched. Do I need to do this all the time or there is another convenient way to do this?: https://play.golang.org/p/YDn6ii52oOt Thanks Alex -- You received this message be

[go-nuts] Fixing the version of protoc-gen-go

2018-03-23 Thread amit . chandak
Hi, I am using dep for version management. I need to have the following protoc plugin. go get -u github.com/golang/protobuf/protoc-gen-go go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger The way i

[go-nuts] Is there any way to define a struct member to hold a generic type channel?

2018-03-23 Thread matthewjuran
An empty interface var can hold any type, so you could have a chan interface{} then use an interface type assertion when you read a value. Matt -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving em

[go-nuts] Re: Is there any way to define a struct member to hold a generic type channel?

2018-03-23 Thread prades . marq
No, go does not have generics. chan int is not the same type as chan string for instance and you cannot declare a type that hold all types of channel unless you resort to "interface {}" AND runtime reflection. Le jeudi 22 mars 2018 16:25:39 UTC-10, 刘焱 a écrit : > > I'm trying to define a Refere

[go-nuts] Is there any way to define a struct member to hold a generic type channel?

2018-03-23 Thread liuyain
I'm trying to define a Reference Counted Channel struct, like below: type RefCountedChannel { Channel chan Type RefCount int mux sync.Mutex } I have to define different struts to hold different channel types. But I don't care the type of Channel, I just close is when RefCount become

[go-nuts] Re: Go 1.10: how should I pass linker flags scoped to a single vendored package?

2018-03-23 Thread shah via golang-nuts
Luke got it right; as it turns out, this is the same bug as https://github.com/golang/go/issues/24456 . On Wednesday, March 21, 2018 at 12:58:37 PM UTC-7, lre

[go-nuts] godoc.org graph default view shows huge graph even for smalli packages

2018-03-23 Thread fgergo
Hi, iirc earlier (years ago?) when on godoc.org I clicked "Package main imports N packages (graph)" only non-standard dependencies were shown. Now all dependencies are shown for the currently shown package graph. When I click "Hide" on the graph page even then standard packges are shown. Do I reme

[go-nuts] [ANN] A golang source code query language

2018-03-23 Thread Forud A
Hello, GoQL is a hubby project of mine, for extracting global var/func/const/type from go source code using simple sql. the project is in early stage and any contribution/advice is welcome! A Clumsy :) Demo (asscinema) https://asciinema.org/a/170483 https:

Re: [go-nuts] Known unknown escape sequence in Go

2018-03-23 Thread Lutz Horn
> I'm trying with simple Perl character class regular expression, which > should be supported by Go (link) [...] > and I found that `*\w*` or `*\S*` Perl character class are not supported. You must escape the backslash as '\\w' etc: https://play.golang.org/p/EEudvWCX_i6 Lutz -- You received