[go-nuts] multiple vendored x/net causing trouble (x/net/trace panic)

2018-05-07 Thread Alex Buchanan
This panic has caused me trouble many times over the last year: panic: http: multiple registrations for /debug/requests goroutine 1 [running]: net/http.(*ServeMux).Handle(0x5c47ba0, 0x511cbc5, 0xf, 0x5223160, 0x515f730) /usr/local/go/src/net/http/server.go:2353 +0x239

Re: [go-nuts] httplex missing

2018-05-07 Thread Josh Harshman
Ahh okay thanks :) On Monday, May 7, 2018 at 3:35:54 PM UTC-7, Sebastien Binet wrote: > > It has been moved/merged into httpguts. > > sent from my droid > > On Tue, May 8, 2018, 00:33 Josh Harshman > wrote: > >> Came across this issue today while adding packages into

Re: [go-nuts] httplex missing

2018-05-07 Thread Sebastien Binet
It has been moved/merged into httpguts. sent from my droid On Tue, May 8, 2018, 00:33 Josh Harshman wrote: > Came across this issue today while adding packages into govendor. > > ➜ platform-ci git:(develop) ✗ go get golang.org/x/net/lex/httplex >

[go-nuts] httplex missing

2018-05-07 Thread Josh Harshman
Came across this issue today while adding packages into govendor. ➜ platform-ci git:(develop) ✗ go get golang.org/x/net/lex/httplex (ops/platform-vault) package golang.org/x/net/lex/httplex: cannot find package

[go-nuts] Re: [go/types] Implements doesn't work for types from different packages when the interface signature has types from the package where the interface lies.

2018-05-07 Thread Denis Cheremisov
This library are not supposed to be used that way. Importer should be used directly: package main import ( "fmt" "go/importer" "go/types" ) var imprt = importer.For("source", nil) func main() { p1, err := imprt.Import("awesome/pkg1") if err != nil { panic(err) } p2,

Re: [go-nuts] go tool trace: --> filtering/modifying

2018-05-07 Thread Hyang-Ah Hana Kim
Have you tried the new annotation api in the tip? tip.golang.org/pkg/runtime/trace? Please see if annotating in the source code with Region or Task would work for your case. On Wed, May 2, 2018 at 8:59 AM, wrote: > High level goal: > >- I have an application with

Re: [go-nuts] Re: go 1 on Ubuntu 18.04

2018-05-07 Thread Dave Cheney
Top tip: you never need to set GOROOT. Please don’t set GOROOT, it’ll just cause confusing errors for you in the future. -- 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

Re: [go-nuts] Re: go 1 on Ubuntu 18.04

2018-05-07 Thread Shawn Milochik
On Mon, May 7, 2018 at 3:32 PM, Ankit Gupta wrote: > > Updating Go is simply a matter of removing old Go installation directory > and replace it with new one. For your particular use case - > > A better solution (in my opinion) is to decompress the new Go tarball to a new

[go-nuts] Re: go 1 on Ubuntu 18.04

2018-05-07 Thread Ankit Gupta
Updating Go is simply a matter of removing old Go installation directory and replace it with new one. For your particular use case - Remove the go folder under /usr/lib (the /usr/bin/go just holds the binary). Install the new go version to /usr/local as mentioned on golang installation

Re: [go-nuts] Re: I don't know about callbacks in Golang

2018-05-07 Thread matthewjuran
The first approach with a func argument to a func can be synchronous (which is what I was thinking at the time) or it could be asynchronous by using the go keyword on the callback. Matt On Monday, May 7, 2018 at 11:48:20 AM UTC-5, florent giraud wrote: > > ok matthew so what you propose is

[go-nuts] Behavior of DotReader

2018-05-07 Thread julianweise
Hey guys, I am not quite sure whether the following behavior is intended or not. Therefore, I am seeking for your advice. Using DotReader's Read() function from the textproto package requires me to provide an predefined buffer to fill in processed data (as usual for Read() functions). Let's

Re: [go-nuts] Re: I don't know about callbacks in Golang

2018-05-07 Thread florent giraud
ok matthew so what you propose is sync method callback right ? 2018-05-07 17:24 GMT+02:00 : > Corrected mistake: > > func SignalsCallback(arg1 int, arg2 string, callback chan<- struct{}) > > SignalsCallback will only write to callback, not read. > > Matt > > On Monday,

Re: [go-nuts] [ANN] GoKi Trees and GoGi GUI

2018-05-07 Thread Steven Wiley
You are probably right about go get. I was pulling the repos into my workspace so I could check out the code more easily. That, plus just informing the user as to what is involved, is why you might want to list dependencies. Gradients are coming soon to oksvg. On Monday, May 7, 2018 at

[go-nuts] Re: I don't know about callbacks in Golang

2018-05-07 Thread matthewjuran
Corrected mistake: func SignalsCallback(arg1 int, arg2 string, callback chan<- struct{}) SignalsCallback will only write to callback, not read. Matt On Monday, May 7, 2018 at 10:08:27 AM UTC-5, matthe...@gmail.com wrote: > > Callbacks in Go can be done with a func argument to a func, or a

Re: [go-nuts] cross-compile mac to linux

2018-05-07 Thread alex . rou . sg
There's a tool for that, and yeah it uses docker. https://github.com/karalabe/xgo On Monday, 7 May 2018 22:32:00 UTC+8, mbanzon wrote: > > It was specifically stated that the code was CGO - this approach won’t > work unless there is a C compiler that is crosscompile enabled installed > already

[go-nuts] Re: I don't know about callbacks in Golang

2018-05-07 Thread matthewjuran
Callbacks in Go can be done with a func argument to a func, or a similar effect can be made with channels by triggering a callback action by waiting on a blocking channel in the application. This Wikipedia article describes the pattern:

Re: [go-nuts] cross-compile mac to linux

2018-05-07 Thread Michael Banzon
It was specifically stated that the code was CGO - this approach won’t work unless there is a C compiler that is crosscompile enabled installed already - I’m guessing the question is how to do that. In my experience the (by far) easiest way to do this is to set up a (Docker) container or a VM

Re: [go-nuts] Re: I don't know about callbacks in Golang

2018-05-07 Thread florent giraud
Hello louki. Can you give us a little example about what you mean. I don't really understand this sentence for me "don't share state to communicate, communicate to share state." Thanks a lot for all your answears 2018-05-07 9:03 GMT+02:00 Louki Sumirniy : > To

Re: [go-nuts] cross-compile mac to linux

2018-05-07 Thread Rohit Jain
*GOOS=linux GOARCH=amd64 go build* Try this? On Mon, May 7, 2018 at 8:56 AM, Steven Roth wrote: > Can anyone point me to a recipe or guidance on how to set up a > cross-compilation environment on a Mac that will allow me to build > CGO-enabled Go code to run on Ubuntu?

Re: [go-nuts] [ANN] GoKi Trees and GoGi GUI

2018-05-07 Thread matthewjuran
> > I’m pretty sure you can just type "go get …” and it finds all the > dependencies automatically, and they are likely to change over time, so I’m > not sure it is conventional to list them? You may want to vendor them (https://golang.org/cmd/go/#hdr-Vendor_Directories) so if they ever go

[go-nuts] Re: fallthrough for select

2018-05-07 Thread matthewjuran
The proposal I opened for this was declined recently: https://github.com/golang/go/issues/23196 Matt On Saturday, May 5, 2018 at 11:35:08 PM UTC-5, Simon Chevrier wrote: > > Hi, I know this is kind of old and I'm not sure anyone will answer, but > even after the previous discussion I feel like

Re: [go-nuts] I don't know about callbacks in Golang

2018-05-07 Thread Jan Mercl
On Sat, May 5, 2018 at 2:52 AM Eduardo Moseis Fuentes wrote: > HI everyone I´m Eduardo from Guatemala and I'm beginer. I'm interesting in all scope golang in fact I was download a little book about it, but I need learn more about callbacks because the book don´t has > enough

Re: [go-nuts] Re: I don't know about callbacks in Golang

2018-05-07 Thread Linker
Callback let user to handle context Coroutine let runtime to handle context On Mon, May 7, 2018 at 3:03 PM, Louki Sumirniy < louki.sumirniy.stal...@gmail.com> wrote: > To use callbacks in Go you must follow Functional Programming rules about > shared data. In simple terms, you cannot

[go-nuts] Re: I don't know about callbacks in Golang

2018-05-07 Thread Louki Sumirniy
To use callbacks in Go you must follow Functional Programming rules about shared data. In simple terms, you cannot share data. You can pass pointers to shared data structures, and likely will have to but as soon as you start using also goroutines you will end up with race conditions. To solve

Re: [go-nuts] [ANN] GoKi Trees and GoGi GUI

2018-05-07 Thread Randall O'Reilly
On May 5, 2018, at 8:38 AM, matthewju...@gmail.com wrote: > In a generic container I would expect to see items typed as interface{} and > the behavior defined on a slice of interface{} or struct with private slice > of interface{} field. > > From the godoc it looks like type Node implements

[go-nuts] Re: I don't know about callbacks in Golang

2018-05-07 Thread Sokolov Yura
There is semantic difference between callback passed for continuation of asynchronous action, and closure/function passed as algorithm parameter. sort.Slice and sync.Map.Range both accepts function/closure as algorithm parameter, not as callback. -- You received this message because you are

Re: [go-nuts] [ANN] GoKi Trees and GoGi GUI

2018-05-07 Thread Randall O'Reilly
Steve — thanks for your impressions. I’ll definitely contact you directly when I get around to trying to integrate rasterx — I haven’t even had a chance to look at it all, but a first question is when you expect it to be stable and reasonably feature-complete? e.g., one of the main things I