Re: [go-nuts] Re: cannot find package "text/template"

2019-06-13 Thread Wagner Riffel
Hi Tenney, clearly something went wrong with /src directory, you reported your compiler to be go1.12, so it'd be a better idea to download the go tree from go1.12 release branch instead of tip, https://github.com/golang/go/tree/release-branch.go1.12 -- You received this message because you are

[go-nuts] Re: cannot find package "text/template"

2019-06-13 Thread ThisEndUp
Not sure what caused the problem to pop up from one day to the next, but I repaired it by downloading *go-master.zip* from github and extracting the directory *text* into *$GOROOT/src* . It now works both as a module and within* $GOPATH/src*. On Thursday, June

Re: [go-nuts] Re: weak references

2019-06-13 Thread Robert Engels
But if nothing else has a reference to the anonymous listener that was added it will be immediately collected - and since it is created at the invocation point usually - it's a problem.here is the pseudo code:s = Server() // Server uses weak listener references...s.addListener(new Listener())the

Re: [go-nuts] Re: weak references

2019-06-13 Thread Ricardo Alves
Thank you for your response again. In the case where anonymous classes are used, the anonymous class would add it self as listeners as you said, but what happens is that the service where the listener will be added will have a weak reference to the this listener. This means that the listener

Re: [go-nuts] Re: weak references

2019-06-13 Thread Ricardo Alves
Yes, I understand. But if I have a productive language that doesn't need me to call it better. In C/C++ it's also easy, whoever calls new should call delete, but trust me, I've had my troubles finding memory leaks in other people's code. With a large enterprise application made in Go and

Re: [go-nuts] Re: weak references

2019-06-13 Thread Robert Engels
But using weak references for listeners is fraught with problems. The most common being that listeners are often anonymous inner classes (in something like Java) or at the point instantiated (closure), so if a direct reference is not held, the listener is would be immediately removed. Holding the

Re: [go-nuts] Re: weak references

2019-06-13 Thread Robert Engels
That doesn't sound right. Whatever calls 'addListener', should be calling 'removeListener' - nothing needs to be detected.-Original Message- From: tgptial...@gmail.com Sent: Jun 13, 2019 11:36 AM To: golang-nuts Subject: Re: [go-nuts] Re: weak references Yes, that is the "workaround". I

Re: [go-nuts] Re: weak references

2019-06-13 Thread tgptialves
Yes, that is the "workaround". I mean, the lack of WeakReference makes Go (when implementing this pattern) at the same level as C/C++, since I have to know when I need to "delete" the resource in order to unsubscribe the event. I will have a look at SetFinalizer though, I haven't heard of it

Re: [go-nuts] Re: weak references

2019-06-13 Thread Robert Engels
Isn't the "Go Way" for something like this to have the listeners explicitly unregister themselves ?It does make certain event listener patterns more difficult, but I don't think it requires WeakRefs to implement.-Original Message- From: tgptial...@gmail.com Sent: Jun 13, 2019 5:39 AM To:

Re: [go-nuts] Re: weak references

2019-06-13 Thread Ian Lance Taylor
On Thu, Jun 13, 2019 at 8:52 AM wrote: > > I find WeakReferences when implementing observer pattern: A service generate > events and signal listeners that the event was triggered. This usually > requires the service to have a list to all of the listeners. Now, without > weak refernece it means

Re: [go-nuts] Re: weak references

2019-06-13 Thread tgptialves
I find WeakReferences when implementing observer pattern: A service generate events and signal listeners that the event was triggered. This usually requires the service to have a list to all of the listeners. Now, without weak refernece it means that any temporary listener will not be garbage

Re: [go-nuts] Re: Go will shine on huge web projects, but how about simple ones?

2019-06-13 Thread Jan Mercl
On Thu, Jun 13, 2019 at 4:47 PM Tong Sun wrote: If you want or need to discuss personal feelings, please do it off-list. Thank you. -- 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

Re: [go-nuts] Re: Go will shine on huge web projects, but how about simple ones?

2019-06-13 Thread Tong Sun
Hi Damian & all. I think I need to set the record straight, as most of the technical discussions has been taken place elsewhere, so I feel that I was treated unfairly because of that. If you only see one site of the story, then it is very easy to do that, I get it and understand it however. So

Re: [go-nuts] Re: Project Layout Question

2019-06-13 Thread Randall O'Reilly
In case it helps anyone else with this problem, there is an issue with the standard layout, and any project where all the code is in various subdirectories but there is no .go code at the top level: godoc.org won’t find it! https://github.com/golang-standards/project-layout/issues/19

Re: [go-nuts] Re: Project Layout Question

2019-06-13 Thread Boris Mühmer
Thanks for Your suggestions so far. I will have to do further tests to see what suits our team best. Regards, Boris Am Di., 11. Juni 2019 um 23:47 Uhr schrieb David Riley : > On Jun 11, 2019, at 13:38, Ronny Bangsund > wrote: > > > > On Tuesday, June 11, 2019 at 2:47:44 PM UTC+2, Boris Mühmer

Re: [go-nuts] Re: Go Language Survey

2019-06-13 Thread Michael Jones
The "src" subdirectory of go does balance, but building every ".go" file in ./go does lose the balance. I sensed your discomfort so I've changed my plans a little to take as day to make a flexible command line tool out of my go-test so that with it's verbose mode you'll know which files have