Re: [go-nuts] Re: appengine golang logs

2017-11-04 Thread Sankar P
There is no log.SetWriter in either the builtin log package or the appengine log package. There is a log.SetOutput which I mentioned in my original mail, but I am not able to understand how to connect it to the appengine logs. 2017-11-04 11:44 GMT+05:30 Tamás Gulácsi : > Use log.SetWriter to dive

Re: [go-nuts] Re: appengine golang logs

2017-11-04 Thread Gulácsi Tamás
Sth. along https://play.golang.org/p/BwlbkxMLdw ? Sankar P ezt írta (időpont: 2017. nov. 4., Szo, 8:10): > There is no log.SetWriter in either the builtin log package or the > appengine log package. There is a log.SetOutput which I mentioned in my > original mail, but I am not able to understand

Re: [go-nuts] Re: appengine golang logs

2017-11-04 Thread Sankar P
Tried something similar already. context.Background() does not work with the appengine log package and panics at runtime. Passing nil also did not work. Probably initialising the AELogAdapter with a ctx from appengine request, in the _ah start handler is the only way. Thanks for the idea. I, for

Re: [go-nuts] Re: appengine golang logs

2017-11-04 Thread David Arroyo
Sankar, Have you tried using the Flexible environment? Flex provides a more "conventional" environment for your programs. There are some tradeoffs compared with App Engine Standard, but it should be easier to stay portable. David [1]: https://cloud.google.com/appengine/docs/flexible/go/writing-a

Re: [go-nuts] Re: appengine golang logs

2017-11-04 Thread Sankar P
Thanks. I did not know this. I assumed that the only difference between flexible and standard was the pricing, I was wrong. Thanks for the link. 2017-11-04 13:06 GMT+05:30 David Arroyo : > Sankar, > > Have you tried using the Flexible environment? Flex provides a more > "conventional" environment

[go-nuts] Re: concurrency programing about go

2017-11-04 Thread 2891132love
Thank you very much.Sorry I still have some question:what's the function of wg? what does the sentense "wg.Add(2) " mean?? I found that if I change 2 into 1,the result is differnet. 在 2017年11月3日星期五 UTC+8上午4:45:47,snmed写道: > > Hi > > Here is the code: > > Version 1: > package main > > import ( >

Re: [go-nuts] Re: concurrency programing about go

2017-11-04 Thread Henrik Johansson
I find continuously adding and calling done on a waitgroup a bit odd. The waiting goroutine can continue as soon as the count is zero so there is a race between adds and dones. On Sat, 4 Nov 2017, 10:01 , <2891132l...@gmail.com> wrote: > Thank you very much.Sorry I still have some question:what'

[go-nuts] Rationale in docs on why you need to use the result of append()

2017-11-04 Thread Ben Hoyt
Hi folks, It seems to me that the reasons given for why you need to use the return value of append() are confusing and not quite right. For example, at https://blog.golang.org/slices#TOC_9. Rob Pike says: "In this case it's especially important to return the slice, since when it reallocates th

Re: [go-nuts] Rationale in docs on why you need to use the result of append()

2017-11-04 Thread Jan Mercl
On Sat, Nov 4, 2017 at 1:53 PM Ben Hoyt wrote: > It seems to me that the reasons given for why you need to use the return value of append() are confusing and not quite right. For example, at https://blog.golang.org/slices#TOC_9. Rob Pike says: > > "In this case it's especially important to return

[go-nuts] Re: How is go better than rust?

2017-11-04 Thread farsheed . ashouri
Hey guys, cool down. This is a simple question with a simple answer. *Go is not better than rust*, It's* simpler and easier to learn*. Just it. On Friday, December 12, 2014 at 5:32:44 AM UTC+3:30, Theemathas Chirananthavat wrote: > > As rust 1.0 is almost here, I can point out quite a few th

[go-nuts] Re: Announcing: Skylark in Go

2017-11-04 Thread Keith Brown
Cool tool. Are there any native golang tools simar to this which work on Windows/Linux/OSX? On Thursday, November 2, 2017 at 9:42:27 PM UTC-4, Ben Hoyt wrote: > > That looks really neat. I will dive into the code! > > I'm very curious how the performance of Skylark in Go compares to Skylark >

[go-nuts] goroutines with better exceptions

2017-11-04 Thread Keith Brown
Hi All Using goroutines to do some load testing on a webserver. I have some code like this, https://play.golang.org/p/e2_ecJN0l4 It works but when the server get overloaded it returns an RSP. I would like to gracefully catch that and put an appropriate status code such as 500. The exact error

RE: [go-nuts] Re: concurrency programing about go

2017-11-04 Thread John Souvestre
If you were to do that, yes. I guess it come to: How do you define “done” in your program? Waitgroup defines it as when all the goroutines which it counted are closed. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On

[go-nuts] Re: How is go better than rust?

2017-11-04 Thread Dave Cheney
Farsheed, you have replied to a thread, and a contentious one at that, that has been dormant for three years. This is poor netiquette, and has potentially reopened an unproductive debate. Please do not do this in the future. Thank you Dave -- You received this message because you are subscrib

[go-nuts] goroutines with better exceptions

2017-11-04 Thread Tamás Gulácsi
If err!=nil, response is nil, too - so don't continue! -- 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. For more options,

Re: [go-nuts] Rationale in docs on why you need to use the result of append()

2017-11-04 Thread Ben Hoyt
Hmmm, but in that first link you're updating the slice manually after the append() -- that's exactly my point. The append() call can't touch the caller's slice value (ptr, len, cap) because it's passed by value. So in the code you wrote: s := make([]int, 0, 10) for i := 0; i < 10; i++ { _ = append

[go-nuts] function variable scope

2017-11-04 Thread caffeinejolt
Hi, Newbie here. I am trying to understand the scope of variables in go - I ran across an interesting situation and want to learn what is going on. Why do these two functions yield different results: https://play.golang.org/p/SyyWOY3fXz My understanding was that declaring myint either way in

Re: [go-nuts] function variable scope

2017-11-04 Thread Jesse McNelis
On Sun, Nov 5, 2017 at 3:47 AM, wrote: > Hi, > > Newbie here. I am trying to understand the scope of variables in go - I ran > across an interesting situation and want to learn what is going on. Why do > these two functions yield different results: > https://play.golang.org/p/SyyWOY3fXz > > My