Re: [go-nuts] Beginner question about interface

2018-04-27 Thread k1attila1
I want to search in all library (which have source code) Maybe i don't understand the concept of Golang (I have delphi,c++,c background) for exmaple : I see this. This function need an interface type : r func NewScanner(r io .Reader

Re: [go-nuts] Beginner question about interface

2018-04-27 Thread Jan Mercl
The answer depends on the scope you want to search. Which scope you want to search? Also, please share what purpose does that information serve. I cannot imagine a one. On Sat, Apr 28, 2018, 07:06 wrote: > Hi > > How can i get a list of types which implement a particular interface ? ( > for exm

[go-nuts] Beginner question about interface

2018-04-27 Thread k1attila1
Hi How can i get a list of types which implement a particular interface ? ( for exmaple io.Reader) Thank you in advance Attila -- 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, s

Re: [go-nuts] Calling sync.WaitGroup.Add() while a sync.WaitGroup.Wait() is waiting

2018-04-27 Thread Jon Bodner
Thanks, everyone, for your answers! I think I understand what sync.WaitGroup is doing now. Jon On Friday, April 27, 2018 at 7:29:50 AM UTC-4, rog wrote: > > On 26 April 2018 at 16:29, Jon Bodner > > wrote: > > Hello, > > > > We were having a discussion at work about passing around references

Re: [go-nuts] [ANN] oksvg and rasterx; SVG 2.0 path compliant renderer and rasterizer

2018-04-27 Thread Steven Wiley
Hey everyone, I looked into using just the rasterizer package from the "golang.org/x/image/vector" package and tested it vs the rasterizer derived from the freetype package. I will call these the GV and FT rasterizers. One thing with the GV is that it only does non-zero-winding-rule, while the

[go-nuts] Re: [ANN] gomacro v2.6 - interactive Go interpreter, now with debugger

2018-04-27 Thread Max
Hello Louky, thanks for the question :) Support for out-of-order code is one of the last missing features, and I am am pretty confident it can be added with reasonable effort, given the large amount of static type analysis that gomacro already performs. In my opinion, the hardest obstacle to fu

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

2018-04-27 Thread Michael Jones
Yuval, There are fundamental issues here. 1. That equation (de Moivre, Binet) is from the algebra of ideal numbers. Numbers of infinite precision. Not the realm of computer arithmetic. It works fine with double precision (go: float64, c/c++: double) up to F(75) but must fail for F(76) due to the

[go-nuts] Re: [ANN] gomacro v2.6 - interactive Go interpreter, now with debugger

2018-04-27 Thread Louki Sumirniy
How does it perform compared to pre-compilation? I would think it is such a thin margin it's barely worth doing? Also, order-dependency is a pretty big problem considering how little Go code will be written in this kind of order, since it doesn't have to be. I would think therefore that to fix

[go-nuts] [ANN] gomacro v2.6 - interactive Go interpreter, now with debugger

2018-04-27 Thread Max
website: https://github.com/cosmos72/gomacro install: go get github.com/cosmos72/gomacro At version 2.6, gomacro has almost complete Go language support, including import of third-party libraries (easy on Linux, requires a recompiling on other platforms), declaring new interface types and implem

[go-nuts] Compiling Godoc

2018-04-27 Thread Malhar Vora
Hello, I have done some change in example_test file of some standard library package. I want to test my changes. Any guidance for how to do it ? Another question is there are some examples which are Runnable and others are not. How is it decided that some example shown in Godoc is Runnable or

[go-nuts] Re: Using variadic function / context in an interface?

2018-04-27 Thread Manlio Perillo
Il giorno giovedì 26 aprile 2018 18:55:07 UTC+2, Nimrod Shneor ha scritto: > > Hey everyone, > I've encountered a design issue - > I have an the following interface - > > type Runner interface { > Run(x X,y Y) > } > > I want to add to it an Init(...) method which will initialize the internal >

[go-nuts] Re: On Accepting Interfaces and Structs

2018-04-27 Thread Kaveh Shahbazian
Assume the state is the config struct and each implementation is reading it from s different file type (yaml, toml, hlc, json, etc). On Friday, April 27, 2018 at 4:45:33 AM UTC+4:30, Jake Montgomery wrote: > > The example gives me a better understanding of what you are doing, though > still not

Re: [go-nuts] Using variadic function / context in an interface?

2018-04-27 Thread nimrodshn
Hey rog, Thanks for the reply! What happens now - I have an Init method for each struct implementing Runner, the Init method is not in the interface and I have to do type assertion every time I call to Init - That is for each class implementing the Runner interface. It's a bit ugly in my POV Bu

[go-nuts] Re: Using variadic function / context in an interface?

2018-04-27 Thread nimrodshn
I mean, it doesn't have to be I just find that it is more cleaner... What happens now - Init is not in the interface and I have to do type assertion every time I call to Init - That is for each class implementing the Runner interface. It's a bit ugly in my POV But I can live with it.. On Thurs

Re: [go-nuts] Using variadic function / context in an interface?

2018-04-27 Thread roger peppe
On 26 April 2018 at 06:13, wrote: > Hey everyone, > I've encountered a design issue - > I have an the following interface - > > type Runner interface { > Run(x X,y Y) > } > > I want to add to it an Init(...) method which will initialize the internal > fields of the Runner before performing `Run

[go-nuts] Re: Using variadic function / context in an interface?

2018-04-27 Thread matthewjuran
Each call to Run could check if the struct has been initialized and initialize it if not. An approach is a function field could be swapped out after initialization. Matt On Thursday, April 26, 2018 at 11:55:07 AM UTC-5, Nimrod Shneor wrote: > > Hey everyone, > I've encountered a design issue -

[go-nuts] RE: Reverse Proxy is not Serving for another port.

2018-04-27 Thread hari prasad
I have a reverse proxy in golang which Listens on two different ports and redirect to respective servers. the server is hosted in aws. One is by default listening on 80 and another one is listening on port: 90 port :80 proxy -> Redirects to -> 9000 port :90 proxy -> Redirects to --> 9095

Re: [go-nuts] Calling sync.WaitGroup.Add() while a sync.WaitGroup.Wait() is waiting

2018-04-27 Thread roger peppe
On 26 April 2018 at 16:29, Jon Bodner wrote: > Hello, > > We were having a discussion at work about passing around references to > sync.WaitGroup. I said it was a bad idea, because if a goroutine launched a > goroutine of its own and called sync.WaitGroup.Add() after a goroutine > called sync.Wait

Re: [go-nuts] How does time reported by go test relate to the wall clock time?

2018-04-27 Thread Dave Cheney
Try upgrading to go 1.10. You’ll get build and test caching for free and you’ll see a small variance between the timings you reported. -- 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