[go-nuts] Re: How can stop a Read of net.Conn without closing it

2019-06-04 Thread Inada Naoki
conn.SetReadDeadline(time.Now()) -- 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 email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visi

Re: [go-nuts] Re: Pattern Syntax in Golang

2019-06-04 Thread Nadim Kobeissi
Hello and thank you for your comments. > The keyword match would definitely conflict with variables names. This doesn't seem like a huge issue to me but certainly I'd be happy with expanding switch instead if it allows us to do the same sort of thing. > To me this looks like a Pythonism where sev

[go-nuts] ANN: Harvester, an easy to use dynamic configuration package

2019-06-04 Thread Sotirios Mantziaris
Hi, i would like to announce a new package that can be used to dynamically reconfigure your application without having the need to restart it. https://github.com/beatlabs/harvester Feedback is highly appreciated. -- You received this message because you are subscribed to the Google Groups "g

[go-nuts] Re: Pattern Syntax in Golang

2019-06-04 Thread Nicholas Eden
I am not a fan of the match syntax you're proposing. It seems like a modified switch which does an assignment and doesn't have 'case' in the statements. The keyword match would definitely conflict with variables names. To me this looks like a Pythonism where several lines worth of logic get s

Re: [go-nuts] Pattern Syntax in Golang

2019-06-04 Thread Nadim Kobeissi
Two more examples to show off some more cool ways match could be useful. Here, I just demonstrate how we can have logic inside matches thanks to anonymous functions: result = match getDayAndDate() { "tuesday", _: "wow looks like it's tuesday", _, 5: (func() string { if isItWednesd

[go-nuts] Pattern Syntax in Golang

2019-06-04 Thread Nadim Kobeissi
Hello everyone, This is my first post to this list so please excuse me if I'm not following all of the proper traditions for this community (posting this in the wrong place, etc.) I like Golang a lot and I think that it's a gift to people who love computer programming. I have written three sof

Re: [go-nuts] How can stop a Read of net.Conn without closing it

2019-06-04 Thread Ian Lance Taylor
On Tue, Jun 4, 2019 at 9:56 AM 杜沁园 wrote: > > When there is no data in tcp connection, net.Conn.Read will block. > > Then I want to cancel the net.Conn.Read from another goroutine, But I do > not want to close the connection, Because I will reuse it latter. How to > write the code??? > >

[go-nuts] ANN: Harvester, a easy to sue dynamic configuration package

2019-06-04 Thread Sotirios Mantziaris
Hi, i would like to announce a new package that can be used to dynamically reconfigure your application without having the need to restart it. Features: - Handling static config like seed values, env vars - Handling dynamic changing values with Consul support - Extensible via interfaces https:

Re: [go-nuts] Go 2 generics counterproposal: giving up restricting types

2019-06-04 Thread dpavlenkovatsrtrl
On Tuesday, June 4, 2019 at 3:51:43 AM UTC-4, Michal Strba wrote: > > > It at least > feels more like go, syntax-wise, than most, except for the num part, > which seems like an afterthought. > > It is an afterthought. It wasn't in the original proposal and was invented > as a way to enable func

[go-nuts] How can stop a Read of net.Conn without closing it

2019-06-04 Thread 杜沁园
When there is no data in tcp connection, net.Conn.Read will block. Then I want to cancel the net.Conn.Read from another goroutine, But I do not want to close the connection, Because I will reuse it latter. How to write the code??? For example: func (p *proxy) toClient(ctx context.C

Re: [go-nuts] Re: Go 1.8 port to FreeBSD/PowerPC64

2019-06-04 Thread Curtis Hamilton
I don’t believe that’s related to the issue. I’m able to build the bootstrap, but having an issue getting it to recognize the environment. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

Re: [go-nuts] How can I debug high garbage collection rate cause high CPU usage issue in golang

2019-06-04 Thread Michael Jones
Perhaps this is obvious, but suddenly heavy garbage *collection* operations suggest heavy garbage *creation* operations; that new code or structure is allocating and discarding more than the old. You've gone from single to multiple caches, so my thoughts go to: is data cached redundantly? (is the n

Re: [go-nuts] How can I debug high garbage collection rate cause high CPU usage issue in golang

2019-06-04 Thread Robert Engels
You really can't.You control CPU usage by the GC by allocation rate, the number of live objects, and the collection rate. If you slow the collector (lower CPU), you will have higher memory usage because the GC won't have time to collect the garbage.In general, the only things you are in control of

[go-nuts] How can I debug high garbage collection rate cause high CPU usage issue in golang

2019-06-04 Thread Joseph Wang
Hello everyone I just have a question about my golang code debugging. It's not specific code question. But I never met this issue before. The problem is like this. I replaced our back-end system's cache from single node cache to groupcache that is a kind mem cache. Then I met high memory usag

Re: [go-nuts] Avoid global variables in Http handlers

2019-06-04 Thread Tong Sun
Oh, yeah, that works. Thanks Aldrin. The reason that I'm asking is that the "solution" that I found on the web isn't working for me: Here is a BETTER example (not using global variables): type specificHandler struct { Thing string} func (h *specificHandler) ServeHTTP(w http.ResponseWriter

Re: [go-nuts] Re: Interesting public commentary on Go...

2019-06-04 Thread Luis Furquim
+1 Thanks for the lesson! Em sexta-feira, 31 de maio de 2019 13:44:55 UTC-3, Devon H. O'Dell escreveu: > > Maybe this story about suggesting the murder of a colleague is supposed to > be a tongue-in-cheek joke, but I want to push back heavily against it. And > I’m sorry that this is devolving si

Re: [go-nuts] Go 2 generics counterproposal: giving up restricting types

2019-06-04 Thread Michal Strba
> It at least feels more like go, syntax-wise, than most, except for the num part, which seems like an afterthought. It is an afterthought. It wasn't in the original proposal and was invented as a way to enable functions like Min, Max, and so on. But I realized that it actually enables many cool t

Re: [go-nuts] Re: Go 1.8 port to FreeBSD/PowerPC64

2019-06-04 Thread Steven Hartland
Newer versions of go require an older version of go (1.4) to bootstrap, that may be related to your issue? On 04/06/2019 04:21, Curtis Hamilton wrote: Currently. the FreeBSD port only supports "i386 amd64 armv6 armv7" and does not support powerpc64 (ppc64). I'm starting with an older version