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

2018-05-06 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 type

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

2018-05-06 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 s

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

2018-05-06 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 wo

[go-nuts] cross-compile mac to linux

2018-05-06 Thread Steven Roth
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? The program I'm building is pure Go except for an unavoidable dependency on libsqlite3. Thanks in advance, Steve -- You receive

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

2018-05-06 Thread Juliusz Chroboczek
> Callbacks are rarely used in Go's ecosystem. https://golang.org/pkg/sort/#Slice https://golang.org/pkg/sync/#Map.Range -- 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 em

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

2018-05-06 Thread Steven Wiley
It sure does look like you put a great deal of effort into this project. Here are a couple of impressions after trying the demos and skimming through part of the source code. First, I had to pull down a lot of other packages in order to get things to build. Did you happen to write up a dependen

[go-nuts] [ANN] go-resty v1.5 released - Simple HTTP and REST client library

2018-05-06 Thread Jeevanandam M.
Production Version : gopkg.in/resty.v1 Edge Version : github.com/go-resty/resty godoc : https://godoc.org/github.com/go-resty/resty *Changelog:* *Enhancements:* - Added fallback gzip response handling #142 @jeevatkm - Added support for Bazel build PR #141 @paradoxengine - Te

Re: [go-nuts] float accuracy when calculating Fibonacci numbers

2018-05-06 Thread Yuval Lifshitz
seems like math accuracy issues are known, or even, by design. see: https://github.com/golang/go/issues/9546 https://github.com/golang/go/issues/9545 On Sunday, 6 May 2018 00:05:13 UTC+3, Paul Hankin wrote: > > On Friday, 27 April 2018 23:57:42 UTC+2, Michael Jones wrote: >> >> Yuval, >> >> There

[go-nuts] Re: How to fake os.Stdout in golang for testing?

2018-05-06 Thread Manlio Perillo
Il giorno domenica 6 maggio 2018 06:35:08 UTC+2, Mirko Friedenhagen ha scritto: > > Hello, > > I am trying out golang and like it's concepts (coming from Python and Java > mostly, not having Exceptions felt a bit strange at the start, though :-)). > > * Now I try to write tests for > https://git

Re: [go-nuts] How to fake os.Stdout in golang for testing?

2018-05-06 Thread alex . rou . sg
The output of text printed with the log as created in my example and fmt are exactly the same. The only change you would have to make is have a global log var and then do a simple search and replace all fmt.Printf to logVar.Printf. So the only argument you gave for not changing would be not wan

Re: [go-nuts] How to fake os.Stdout in golang for testing?

2018-05-06 Thread mfriedenhagen
On Sunday, May 6, 2018 at 8:21:14 AM UTC+2, alex@gmail.com wrote: > > Or use log instead of fmt > > var stdout = log.New(os.Stdout, "", 0) > > Then you can easily redirect it to any io.Writter like > > buf := &strings.Builder{} > stdout = log.New(buf, "", 0) > Hello Alex, good point, howeve

Re: [go-nuts] How to fake os.Stdout in golang for testing?

2018-05-06 Thread mfriedenhagen
On Sunday, May 6, 2018 at 7:32:47 AM UTC+2, Lars Seipel wrote: > > On Sat, May 05, 2018 at 08:55:17AM -0700, mfried...@gmail.com > wrote: > > * Now in golang `os.Stdout` is an `*os.File` which is mostly a wrapper > for > > an OS specific file. > > You can always use os.Pipe to get an actual f

Re: [go-nuts] Re: fallthrough for select

2018-05-06 Thread Jan Mercl
On Sun, May 6, 2018 at 6:34 AM wrote: > ... I feel like any kind of switch-like statements should be able to fallthrough. switch x := f.(type) { case *Foo: ... falthrough case *Bar: x.Baz() // <- What type is 'x' here?