Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-17 Thread Jan Mercl
On Wed, Jul 17, 2019 at 8:07 AM Michael Jones  wrote:
>
> I'm a reader here, so @all includes me. In regards to Oracle, I was delighted 
> when they released VirtualBox under GPL and remain delighted that they pay 
> Oracle employees to enhance it and share their work.

I'm a thankful user of Oracles's VBox.

Now, WDYT about Oracle pushing copyrighting APIs through the ever
higher court levels? Is evilness of a company computed by summing its
good and bad moves? It's a yes from me and my scorecard for Oracle
says -Inf+1.

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-UD2oGZ3QU4PgXLmevyQ2jvvmJnw4nqV0jRc92riNNpXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] How to build gollvm on arm platform

2019-07-17 Thread eric fang
Hi Than,

Thanks for your help, "check-gollvm" is exactly what I'm looking for. But 
on x86-64, there are two test failures, as the log is very long, we just 
put some key info here.
[152/189] Checking Go package go/internal/gccgoimporter
FAILED: tools/gollvm/libgo/CMakeFiles/check_libgo_go_internal_gccgoimporter
--- FAIL: TestObjImporter (0.08s)
importer_test.go:134: could not find version number in gollvm version 1 
(experimental) [LLVM version 9]
FAIL
[189/189] Checking cmd/go tool
FAILED: tools/gollvm/gotools/CMakeFiles/check_go_tool
(see the attached log file)

I still don't know how to run the benchmark tests in the standard library 
and "go1" benchmarks, can you give me more details, thanks.
I didn't find a cmake target for benchmark tests, and I tried the following 
commands but not work:
$ go version
go version go1.12.2 gollvm LLVM 9.0.0svn linux/amd64
$ cd gollvm-workarea/llvm/tools/gollvm/gofrontend/libgo/go/bytes
$ go test -bench . 
bytes.go:10:2: use of internal package internal/bytealg not allowed

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/4adbc960-7281-4dd1-bc0b-6e9b69d4203c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


cmd_go-testlog
Description: Binary data


[go-nuts] "Go to" one line before the declaration

2019-07-17 Thread jessie . gocotano
Can somebody explain this code?
How is the cpu doing? better than for{} and select {} in CPU usage?

package main

func main() {
start:
goto start
}


https://play.golang.org/p/BZ-yfDFLgV8

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/17e87e55-5429-459d-8d68-66261c7d67dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] "Go to" one line before the declaration

2019-07-17 Thread Jan Mercl
On Wed, Jul 17, 2019 at 11:24 AM  wrote:
>
> Can somebody explain this code?
> How is the cpu doing? better than for{} ...

Who claims it's doing better than `for {}`? IDK, I haven't tested, but
I guess it should perform the same bad way.

> ... and select {} in CPU usage?

Now that's a different story. Using `select {}` should burn 0% CPU in
the goroutine that executed the statement.

PS: Please post source code as black text on white, and, if possible,
as plain text only.

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-WQ6tuo01fDNdEm2T0ba_5i7ttqE4VX%2BhgoONrZRo07uA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] "Go to" one line before the declaration

2019-07-17 Thread fgergo
The question is rather vague, though after making a few assumption
here are some hopefully useful pointers:

You can compare the different generated code snippets if you use -S
during compilation:
go tool compile -S mytestfile.go

A Quick Guide to Go's Assembler: https://golang.org/doc/asm
The go compilers implement this specification: https://golang.org/ref/spec

(Similary to Jan, for code please use only links to play.golang.org,
that's enough.)

hth


On 7/17/19, jessie.gocot...@rococoglobaltech.com
 wrote:
> Can somebody explain this code?
> How is the cpu doing? better than for{} and select {} in CPU usage?
>
> package main
>
> func main() {
> start:
> goto start
> }
>
>
> https://play.golang.org/p/BZ-yfDFLgV8
>
> --
> 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 visit
> https://groups.google.com/d/msgid/golang-nuts/17e87e55-5429-459d-8d68-66261c7d67dc%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2BctqrpyirggYY%3DM05F%2B0MJVbpXt%3DRtTOJsrvMa8B61%2BHqaphg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-17 Thread Wojciech S. Czarnecki
On Tue, 16 Jul 2019 23:06:41 -0700
Michael Jones  wrote:

> In regards to Oracle, I was delighted when they released   under GPL
> and remain delighted that they pay Oracle employees to enhance it
> and share their work.

Excuse me?!

1. VirtualBox was opensourced under GPL by its real creators, the Innotek GmbH.

2. Even before that, VirtualBox was available under so called PUEL license first
to developers then also to SMEs -- i.e. to everyone that made install by him or 
herself.
 
3. VirtualBox was acquired by the Sun Corporation in 2008 and Sun had put
quite a  money to make VBox creation/administration GUI tools, including
working metal->virtual converters.

4. Then Oracle bought Sun.

Many small users expected that PUEL licensing -- as a part of Innotek 
acquisition
deal -- will stay. It stood for the short period Oracle lawyers needed to null 
PUEL
obligations Oracle inherited from Sun. Since then (v5.1 iirc) Virtualbox can
be used for free only by pupils and hobbyists. (You're out of PUEL right at
the first $1 earned on IT-related work, whether Virtualbox was involved or not).


> The name 'Oracle' on that page does not discomfort me

Me it disgusts a lot.


P.S. This is really OT for the go-nuts list, but the Oracle's "alternative 
facts"
that are spread in many media outlets need correction. I do not blame
Michael Jones for falling a prey to that - he's within a legion.

Hope this helps,

-- 
Wojciech S. Czarnecki
 << ^oo^ >> OHIR-RIPE

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/20190717114553.5c6793b7%40zuzia.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-17 Thread Michal Strba
Guys, why not keep the discussion to the point. Oracle is quite irrelevant
here. The issue is the perception of Go among programmers.

On Wed, Jul 17, 2019, 11:46 Wojciech S. Czarnecki  wrote:

> On Tue, 16 Jul 2019 23:06:41 -0700
> Michael Jones  wrote:
>
> > In regards to Oracle, I was delighted when they released   under GPL
> > and remain delighted that they pay Oracle employees to enhance it
> > and share their work.
>
> Excuse me?!
>
> 1. VirtualBox was opensourced under GPL by its real creators, the Innotek
> GmbH.
>
> 2. Even before that, VirtualBox was available under so called PUEL license
> first
> to developers then also to SMEs -- i.e. to everyone that made install by
> him or herself.
>
> 3. VirtualBox was acquired by the Sun Corporation in 2008 and Sun had put
> quite a  money to make VBox creation/administration GUI tools, including
> working metal->virtual converters.
>
> 4. Then Oracle bought Sun.
>
> Many small users expected that PUEL licensing -- as a part of Innotek
> acquisition
> deal -- will stay. It stood for the short period Oracle lawyers needed to
> null PUEL
> obligations Oracle inherited from Sun. Since then (v5.1 iirc) Virtualbox
> can
> be used for free only by pupils and hobbyists. (You're out of PUEL right at
> the first $1 earned on IT-related work, whether Virtualbox was involved or
> not).
>
>
> > The name 'Oracle' on that page does not discomfort me
>
> Me it disgusts a lot.
>
>
> P.S. This is really OT for the go-nuts list, but the Oracle's "alternative
> facts"
> that are spread in many media outlets need correction. I do not blame
> Michael Jones for falling a prey to that - he's within a legion.
>
> Hope this helps,
>
> --
> Wojciech S. Czarnecki
>  << ^oo^ >> OHIR-RIPE
>
> --
> 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 visit
> https://groups.google.com/d/msgid/golang-nuts/20190717114553.5c6793b7%40zuzia
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CAO6k0ute6_0_%2B5ikDS%2B3X1jdCO4K5mU_5qRo9yq%3DxtDFDH264Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-17 Thread Lucio
Go is Great (I've been waiting a long time for an opportunity to say that 
:-) )

I use Go almost exclusively and do not cherish the thought of using 
something else, although I could in a pinch.

I also stopped at Go1.10 for practical reasons. But at my age that is not 
really that serious.

Still. I probably will not move, gradually or abruptly, to Go2: by the time 
that beast has taken shape, I will hopefully no longer need to make sure my 
code does not bit-rot. And my dream is not a bigger Go, it is a better Go, 
which I believe cannot be backwards compatible. What I'm saying is that 
Go1.10 is good enough and not going to be tugged out from under my feet by 
Google or anyone else.

Google have done me a huge favour thus far. Like (or unlike) Jan Mercl, I 
grant Google some credits for Go against many demerits for Google :-). All 
in all, I'm the winner, I don't care that Google is taking part in a 
competition I could not dream of joining.

Lucio.

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/d98d74b8-a70d-4878-a196-dd024f6ea234%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Panic not recovered inside my panic recover function

2019-07-17 Thread ZPL
Hi, group. 

Recently I found an issue in our product, panic can't be recoved in some 
situation, I spend some time on it.  

Please find following simple Test function, I don't understand why logPanic 
function cant' catch the panic, but call recover directly can do that.


package main

import (
"fmt"
"sync"
"testing"
)

var (
groups = &sync.WaitGroup{}
)

func logPanic() {
if err := recover(); err != nil {
fmt.Println("got panic")
return
}
}

func DoTask() {
DoTask1Panic()
groups.Wait()
}

func DoTask1Panic() {
groups.Add(1)

go func() {
defer func() {
* // logPanic can't recover from panic here*
logPanic()
// But can recover from here
// if err := recover(); err != nil {
//  fmt.Println(err)
// }
groups.Done()
}()
panic("panic")
}()
}

func TestPanic(t *testing.T) {
DoTask()
fmt.Println("Done")
}

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/6b9eb342-a722-4af0-a12b-dcf65a0d2312%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Panic not recovered inside my panic recover function

2019-07-17 Thread Tamás Gulácsi
The "recover()" call must be in the deferred part.

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/4902ea36-1982-4557-b537-d27020d5cbb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] How to build gollvm on arm platform

2019-07-17 Thread 'Than McIntosh' via golang-nuts
Hi,

These are both known failures at the moment --

The gccgo importer test was is sensitive to the version of gccgo being used
(it runs gccgo on Go source code, and needs to test the gccgo version to
see whether it is sufficiently new to support constructs like aliases). The
test doesn't yet support checking for gollvm versions, partly because we
don't really have a gollvm version scheme yet.

The cmd/go test failure is a timeout -- this test runs for a long time and
tends to time out occasionally (particularly with debug builds).

Than



The cmd/go test is timing out -- this is a test that runs for a loing

On Wed, Jul 17, 2019 at 4:24 AM eric fang  wrote:

> Hi Than,
>
> Thanks for your help, "check-gollvm" is exactly what I'm looking for. But
> on x86-64, there are two test failures, as the log is very long, we just
> put some key info here.
> [152/189] Checking Go package go/internal/gccgoimporter
> 
> FAILED: tools/gollvm/libgo/CMakeFiles/check_libgo_go_internal_gccgoimporter
> --- FAIL: TestObjImporter (0.08s)
> importer_test.go:134: could not find version number in gollvm version
> 1 (experimental) [LLVM version 9]
> FAIL
> [189/189] Checking cmd/go tool
> FAILED: tools/gollvm/gotools/CMakeFiles/check_go_tool
> (see the attached log file)
>
> I still don't know how to run the benchmark tests in the standard library
> and "go1" benchmarks, can you give me more details, thanks.
> I didn't find a cmake target for benchmark tests, and I tried the
> following commands but not work:
> $ go version
> go version go1.12.2 gollvm LLVM 9.0.0svn linux/amd64
> $ cd gollvm-workarea/llvm/tools/gollvm/gofrontend/libgo/go/bytes
> $ go test -bench .
> bytes.go:10:2: use of internal package internal/bytealg not allowed
>
> --
> 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 visit
> https://groups.google.com/d/msgid/golang-nuts/4adbc960-7281-4dd1-bc0b-6e9b69d4203c%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2BUr55EroEFV2ygEJ-C8VSpaoKnC7dEuTNAgWAbFd6NZpaiPbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Panic not recovered inside my panic recover function

2019-07-17 Thread Ian Lance Taylor
On Wed, Jul 17, 2019 at 5:11 AM Tamás Gulácsi  wrote:
>
> The "recover()" call must be in the deferred part.

Yes, as the spec says, recover must be called directly by a deferred function.

When sending code to this list, please use a link to the Go playground
or use plain text.  The highlighted text with a black background is
unreadable.  Thanks.

Ian

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXUWYdq%3DzSSw4V_HvNzrNpnrt1awEZbRFca0f6qHoBdsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] sqlite x ql

2019-07-17 Thread Luis Furquim
Dear Gophers,

Has anyone any information about performance comparison between Sqlite and
Ql (github.com/cznic/ql or modernc.org/ql)? Any bit of information would be
appreciated!

Thank you in advance

-- 
Luis Otavio de Colla Furquim

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CACyQ4W65LEnypSKhefrXmgjwQJ-yukFGQcXS05fUZmapPTAZPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] sqlite x ql

2019-07-17 Thread Jan Mercl
On Wed, Jul 17, 2019 at 4:34 PM Luis Furquim  wrote:

> Has anyone any information about performance comparison between Sqlite and Ql 
> (github.com/cznic/ql or modernc.org/ql)? Any bit of information would be 
> appreciated!

QL is slower. Sometimes dramatically slower. QL's query
planner/optimizer is very rudimentary. However, for some usage
scenarios the performance might be acceptable. I strongly suggest to
use the V2 backend wherever possible.

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-W6r9TztYvn5_cBWa8BcDP2ARAP_4O4e688ORf8SG7Rgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] sqlite x ql

2019-07-17 Thread Luis Furquim
Ok! Thank you for your feedback!

On Wed, Jul 17, 2019 at 11:39 AM Jan Mercl <0xj...@gmail.com> wrote:

> On Wed, Jul 17, 2019 at 4:34 PM Luis Furquim 
> wrote:
>
> > Has anyone any information about performance comparison between Sqlite
> and Ql (github.com/cznic/ql or modernc.org/ql)? Any bit of information
> would be appreciated!
>
> QL is slower. Sometimes dramatically slower. QL's query
> planner/optimizer is very rudimentary. However, for some usage
> scenarios the performance might be acceptable. I strongly suggest to
> use the V2 backend wherever possible.
>


-- 
Luis Otavio de Colla Furquim

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CACyQ4W6MkvMud0AYtda6F8KNyJNrOPNvg5-HEbDwRYQ0ektTAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-17 Thread Space A.
Others already replied about Oracle, and I don't want to go OT here, just a
small remark: you a wrong saying that VS Code is free. You are not paying
bills directly, that's correct. But it is not quite true that you are not
paying at all. It's just a different business model, first of all letting
Microsoft have close connection to wide dev audience and push and advertise
for own technologies, such as azure.
And if next time you start imagine that something made by corp is free,
just think for a while who at the end of the day pays for the party. And
where these money taken from.


ср, 17 июл. 2019 г. в 09:07, Michael Jones :

> I'm a reader here, so @all includes me. In regards to Oracle, I was
> delighted when they released VirtualBox under GPL and remain delighted that
> they pay Oracle employees to enhance it and share their work. When they
> write (https://www.virtualbox.org)...
>
> *"VirtualBox is being actively developed with frequent releases and has an
> ever growing list of features, supported guest operating systems and
> platforms it runs on. VirtualBox is a community effort backed by a
> dedicated company: everyone is encouraged to contribute while Oracle
> ensures the product always meets professional quality criteria."*
>
>
> ...I find that a logical explanation and a mutually beneficial outcome.
> The name 'Oracle' on that page does not discomfort me, nor does it upset me
> that the remarkable and free VS-Code admits to Microsoft's parentage--I
> thank them for that. I feel the same way about Google staffing Go with my
> computer science heroes (Ken Thompson et al!), building a wonderful
> language, application-level operating system, rigorous spec, two compilers,
> and open sourcing every bit of it. I am grateful, respectful, and
> absolutely stunned at your vitriol in response to gifts that none of us
> earned. It feels base and unseemly to me. Maybe you could reconsider your
> posture.
>
> Michael Jones
> Ever grateful for manna from heaven
>
> On Tue, Jul 16, 2019 at 9:05 PM Anca Emanuel 
> wrote:
>
>> @all, what do you think of Oracle ?
>> That is not an company, that is an monster.
>>
>> On Monday, July 15, 2019 at 6:40:19 PM UTC+3, Michal Strba wrote:
>>>
>>> As you all know, the new, redesigned Go website has a Google logo in the
>>> bottom right corner.
>>> Someone opened an issue about this, worrying that with the logo, nobody
>>> will see Go as a community project:
>>> https://github.com/golang/go/issues/33021
>>>
>>> The issue was promptly closed and locked by a Go team member, which I
>>> must admit, is kind of an unfair move.
>>> If you read this thread on r/programming, it seems like the worries are
>>> quite justified:
>>> https://www.reddit.com/r/programming/comments/ccidly/golang_issue_ticket_remove_the_google_logo/
>>>
>>> I personally am fine with the logo.
>>>
>>> What do you think? For example, Rust has no Mozilla logo on its page
>>> despite being largely funded by it.
>>>
>> --
>> 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 visit
>> https://groups.google.com/d/msgid/golang-nuts/708a60a4-0ad2-41f6-a997-8fa6c5f83e53%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
>
> *Michael T. jonesmichael.jo...@gmail.com *
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/9gKxXmDT34k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CALoEmQxy2aSEQGQuUyQNUwDfc4rNYR1_YYYmw7tP2Mih8EuAzA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CADKwOTcjW_0nJFr1svitpb1%3DiAYwD%2B8oDZ7fXO-H%2B%3DQ0MKN-tw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-17 Thread Robert Engels
NOTHING in life is free. Basic science and economics. 

> On Jul 17, 2019, at 11:08 AM, Space A.  wrote:
> 
> Others already replied about Oracle, and I don't want to go OT here, just a 
> small remark: you a wrong saying that VS Code is free. You are not paying 
> bills directly, that's correct. But it is not quite true that you are not 
> paying at all. It's just a different business model, first of all letting 
> Microsoft have close connection to wide dev audience and push and advertise 
> for own technologies, such as azure. 
> And if next time you start imagine that something made by corp is free, just 
> think for a while who at the end of the day pays for the party. And where 
> these money taken from.
> 
> 
> ср, 17 июл. 2019 г. в 09:07, Michael Jones :
>> I'm a reader here, so @all includes me. In regards to Oracle, I was 
>> delighted when they released VirtualBox under GPL and remain delighted that 
>> they pay Oracle employees to enhance it and share their work. When they 
>> write (https://www.virtualbox.org)...
>> 
>> "VirtualBox is being actively developed with frequent releases and has an 
>> ever growing list of features, supported guest operating systems and 
>> platforms it runs on. VirtualBox is a community effort backed by a dedicated 
>> company: everyone is encouraged to contribute while Oracle ensures the 
>> product always meets professional quality criteria."
>> 
>> ...I find that a logical explanation and a mutually beneficial outcome. The 
>> name 'Oracle' on that page does not discomfort me, nor does it upset me that 
>> the remarkable and free VS-Code admits to Microsoft's parentage--I thank 
>> them for that. I feel the same way about Google staffing Go with my computer 
>> science heroes (Ken Thompson et al!), building a wonderful language, 
>> application-level operating system, rigorous spec, two compilers, and open 
>> sourcing every bit of it. I am grateful, respectful, and absolutely stunned 
>> at your vitriol in response to gifts that none of us earned. It feels base 
>> and unseemly to me. Maybe you could reconsider your posture. 
>> 
>> Michael Jones
>> Ever grateful for manna from heaven
>> 
>>> On Tue, Jul 16, 2019 at 9:05 PM Anca Emanuel  wrote:
>>> @all, what do you think of Oracle ?
>>> That is not an company, that is an monster.
>>> 
 On Monday, July 15, 2019 at 6:40:19 PM UTC+3, Michal Strba wrote:
 As you all know, the new, redesigned Go website has a Google logo in the 
 bottom right corner.
 Someone opened an issue about this, worrying that with the logo, nobody 
 will see Go as a community project: 
 https://github.com/golang/go/issues/33021
 
 The issue was promptly closed and locked by a Go team member, which I must 
 admit, is kind of an unfair move.
 If you read this thread on r/programming, it seems like the worries are 
 quite justified: 
 https://www.reddit.com/r/programming/comments/ccidly/golang_issue_ticket_remove_the_google_logo/
 
 I personally am fine with the logo.
 
 What do you think? For example, Rust has no Mozilla logo on its page 
 despite being largely funded by it.
>>> 
>>> -- 
>>> 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 visit 
>>> https://groups.google.com/d/msgid/golang-nuts/708a60a4-0ad2-41f6-a997-8fa6c5f83e53%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>> 
>> 
>> -- 
>> Michael T. Jones
>> michael.jo...@gmail.com
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "golang-nuts" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/golang-nuts/9gKxXmDT34k/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> golang-nuts+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/CALoEmQxy2aSEQGQuUyQNUwDfc4rNYR1_YYYmw7tP2Mih8EuAzA%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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 visit 
> https://groups.google.com/d/msgid/golang-nuts/CADKwOTcjW_0nJFr1svitpb1%3DiAYwD%2B8oDZ7fXO-H%2B%3DQ0MKN-tw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 t

Re: [go-nuts] Build kubernetes with gollvm

2019-07-17 Thread 'Than McIntosh' via golang-nuts
Hi again,

Regarding building  https://github.com/etcd-io/etcd.git with gollvm -- I
have a fix for the compiler problem you ran into, but in my testing I've
run into other problems that are not amenable to compiler fixes.
Specifically, it looks as though some of the dependent packages for etcd
are not compatible with gccgo/gollvm:

/tmp/go/pkg/mod/github.com/modern-go/reflect2@v1.0.1/type_map.go:42: error:
undefined reference to 'reflect.typelinks'
/tmp/go/pkg/mod/github.com/modern-go/reflect2@v1.0.1/type_map.go:74: error:
undefined reference to 'reflect.typelinks'
/tmp/go/pkg/mod/github.com/modern-go/reflect2@v1.0.1/type_map.go:78: error:
undefined reference to 'reflect.resolveTypeOff'
/tmp/go/pkg/mod/
golang.org/x/sys@v0.0.0-20180909124046-d0be0721c37e/unix/gccgo.go:50:
error: undefined reference to 'gccgoRealSyscallNoError'
/tmp/go/pkg/mod/
golang.org/x/sys@v0.0.0-20180909124046-d0be0721c37e/unix/gccgo.go:23:
error: undefined reference to 'gccgoRealSyscallNoError'
/tmp/go/pkg/mod/
golang.org/x/sys@v0.0.0-20180909124046-d0be0721c37e/unix/gccgo.go:30:
error: undefined reference to 'gccgoRealSyscall'
/tmp/go/pkg/mod/
golang.org/x/sys@v0.0.0-20180909124046-d0be0721c37e/unix/gccgo.go:37:
error: undefined reference to 'gccgoRealSyscall'
/tmp/go/pkg/mod/
golang.org/x/sys@v0.0.0-20180909124046-d0be0721c37e/unix/gccgo.go:44:
error: undefined reference to 'gccgoRealSyscall'
/tmp/go/pkg/mod/
golang.org/x/sys@v0.0.0-20180909124046-d0be0721c37e/unix/gccgo.go:55:
error: undefined reference to 'gccgoRealSyscall'
error: ld returned 1 exit status

The vendored copy of golang.org/x.sys seems to be targeting gccgo symbols
that no longer exist (e.g. "gccgoRealSyscall"), and the
"modern-go/reflect2" package is using unsafe to reach into the reflect
package to access symbols that are only present in the main Gc version of
the runtime...  without work done to fix these issues the application is
not going to be buildable with gollvm.

Thanks, Than


On Wed, Jul 10, 2019 at 8:38 AM Yuan Ting  wrote:

> Thank you, I will continue to pay attention to it. Hope those bugs can be
> solved :)
>
> Thank you again for your patience.
>
> On Wednesday, July 10, 2019 at 7:56:03 PM UTC+8, Than McIntosh wrote:
>>
>> OK, thanks for checking on that.
>>
>> Sounds like this is a new problem (not too surprising, since this is an
>> area of the compiler that is undergoing a lot of changes in recent weeks;
>> tip is a bit unstable).
>>
>> I have my hands full with a couple of other bugs that I am juggling right
>> now; filed issue https://github.com/golang/go/issues/33020 to track.
>>
>> Cheers, Than
>>
>> On Tue, Jul 9, 2019 at 8:04 PM Yuan Ting  wrote:
>>
>>> My gollvm version is
>>> commit 29005f52b3501c489cb1653506cd479d5a178e98 (HEAD -> master,
>>> origin/master, origin/HEAD)
>>> Author: Cherry Zhang <...>
>>> Date:   Sat Jun 29 00:25:46 2019 -0400
>>>
>>> bridge: support builtin memset
>>>
>>> Change-Id: I7321f57e0d58c0ff5c3a19f7cbf5721fabbf1263
>>> Reviewed-on: https://go-review.googlesource.com/c/gollvm/+/184439
>>> Reviewed-by: Than McIntosh <...>
>>>
>>>
>>> gofrontend version is
>>>
>>> commit 7a8e10be0ddb8909ce25a264d03b24cee4df60cc (HEAD -> master,
>>> origin/master, origin/HEAD)
>>> Author: Cherry Zhang <...>
>>> Date:   Wed Jul 3 15:55:19 2019 -0400
>>>
>>> compiler: optimize 0,1,2-case select statement
>>>
>>> For a select statement with zero-, one-, or two-case with a
>>> default case, we can generate simpler code instead of calling the
>>> generic selectgo. A zero-case select is just blocking the
>>> execution. A one-case select is mostly just executing the case. A
>>> two-case select with a default case is a non-blocking send or
>>> receive. We add these special cases for lowering a select
>>> statement.
>>>
>>> Change-Id: I519d246a4a5ba6871bb303160bba1ec1e3074bd0
>>> Reviewed-on:
>>> https://go-review.googlesource.com/c/gofrontend/+/184998
>>> Reviewed-by: Ian Lance Taylor <...>
>>>
>>>
>>> I retry to pull gollvm from https://go.googlesource.com/gollvm but it
>>> tells me I'm already up to date.
>>>
>>> Thanks.
>>>
>>> On Tuesday, July 9, 2019 at 10:03:11 PM UTC+8, Than McIntosh wrote:

 That stack trace looks a lot like

 https://github.com/golang/go/issues/32778

 which was fixed last week. What vintage is your gollvm?

 Thanks, Than


 On Tue, Jul 9, 2019 at 9:54 AM Yuan Ting  wrote:

> In addition, I also failed to build etcd.
>
> $ git clone https://github.com/etcd-io/etcd.git
> $ cd etcd/ && ./build
> go build: when using gccgo toolchain, please pass linker flags using
> -gccgoflags, not -ldflags
> # go.etcd.io/etcd/etcdserver/api/rafthttp
>  #0 0x55ecc4cfa34a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
> (/home/yt/LLVMsvn/install/bin/llvm-goc+0xa6c34a)
>  #1 0x55ecc4cf8124 llvm::sys::RunSignalHandlers()
> (/home/yt/LLVMsvn/install/bin/llvm-goc+0xa6a124)
> 

[go-nuts] [ANN] go-resty v2.0.0 released - Simple HTTP and REST client library

2019-07-17 Thread Jeevanandam M.
Hello All -

I'm pleased to announce release of Resty v2 (
https://github.com/go-resty/resty).

Stable Version : github.com/go-resty/resty/v2
Release Notes : https://github.com/go-resty/resty/releases/tag/v2.0.0

Cheers,
Jeeva

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/caa384b1-2741-44a6-9851-09dc08f4796b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Do Any Editors Support Customisable Code collapsing?

2019-07-17 Thread kez . olesen
Context:
1. Golang can be very verbose, for example checking if err != nil after a 
function call takes 3 lines:
if err != nil {
   return nil, fmt.Errorf("some context: %v", err)
}


2. Editors like VSCode can already collapse blocks of statements, where the 
above would be displayed as:
if err != nil {...


My question:
Are there any editors that support some kind of customisable collapsing 
behaviour? Where the above code could be collapsed to something like:
...check...fmt.Errorf("some context: %v", err)...

Has anyone tried to implement this kind of behaviour? Is it difficult to 
achieve?



-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/e15556dd-b957-4d79-9ca4-8b6ed8eb6e6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] mutexes, etc

2019-07-17 Thread joe mcguckin
When do you need to use mutexes? Which begs the question: When can multiple 
coroutines trample on  memory or a variable?
Doesn't each instance of a go routine get it's own stack (so, it's own 
local copy of local vars). It would seem that the only
entities that it's possible to access from multiple goroutines are things 
allocated from the heap, as you mould have identical pointer 
values in multiple go threads - yes?  

Like they say, Inquiring minds want to know...

Thanks,

Joe

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/a1fdcdb2-3276-4b67-88be-5414c12ccac5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Excel XLSX to read/write without losing of formatting

2019-07-17 Thread plandem
Major update to library again:
- added full support of conditional formatting
- added support of comments

Also I created guide for most features:
https://plandem.github.io/xlsx2go/

On Sunday, August 27, 2017 at 2:34:51 AM UTC-4, Andrey Gayvoronsky wrote:
>
> Hi guys, I know that there are few libs already here, but sadly I could 
> not get any that would respects existing styles.
>
> So here is new attempt to get decent lib to work with xlsx:
>
> https://github.com/plandem/xlsx
>
> Would like to hear your thoughts
>

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/0d4f67af-f022-41c6-b245-a9ce10f35d36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Do Any Editors Support Customisable Code collapsing?

2019-07-17 Thread Michael Jones
There is a special “collapse if err !=  nil blocks plugin for VS code.

On Wed, Jul 17, 2019 at 5:37 PM  wrote:

> Context:
> 1. Golang can be very verbose, for example checking if err != nil after a
> function call takes 3 lines:
> if err != nil {
>return nil, fmt.Errorf("some context: %v", err)
> }
>
>
> 2. Editors like VSCode can already collapse blocks of statements, where
> the above would be displayed as:
> if err != nil {...
>
>
> My question:
> Are there any editors that support some kind of customisable collapsing
> behaviour? Where the above code could be collapsed to something like:
> ...check...fmt.Errorf("some context: %v", err)...
>
> Has anyone tried to implement this kind of behaviour? Is it difficult to
> achieve?
>
>
>
> --
> 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 visit
> https://groups.google.com/d/msgid/golang-nuts/e15556dd-b957-4d79-9ca4-8b6ed8eb6e6c%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 

*Michael T. jonesmichael.jo...@gmail.com *

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CALoEmQxUZdTTfZSPsvC3EgBSXhEC9-ivUY_5CK5OHPTMd03Avg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] mutexes, etc

2019-07-17 Thread Michael Jones
Go has an unusual (clever!) property that anything whose address “escapes”
from your routine will magically be allocated on the heap _no matter if it
looks like heap or local allocation. Conversely, even explicit heap
allocations that don’t escape will/may be local (will up to 10 MiB).

Is data local or not. If yes, then it is safe and is as if a single thread
program no matter how many CPUs or goroutines. This is a go glory. But if
anything else can see it...then caution and precaution are necessary.

On Wed, Jul 17, 2019 at 5:52 PM joe mcguckin 
wrote:

> When do you need to use mutexes? Which begs the question: When can
> multiple coroutines trample on  memory or a variable?
> Doesn't each instance of a go routine get it's own stack (so, it's own
> local copy of local vars). It would seem that the only
> entities that it's possible to access from multiple goroutines are things
> allocated from the heap, as you mould have identical pointer
> values in multiple go threads - yes?
>
> Like they say, Inquiring minds want to know...
>
> Thanks,
>
> Joe
>
> --
> 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 visit
> https://groups.google.com/d/msgid/golang-nuts/a1fdcdb2-3276-4b67-88be-5414c12ccac5%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 

*Michael T. jonesmichael.jo...@gmail.com *

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CALoEmQwS3MdJF0GF_g84iaVgPD4neAXP2M7D60aAPM7f9OhnUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Panic not recovered inside my panic recover function

2019-07-17 Thread ZP L
Sorry for the bad formatting.

> recover must be called directly by a deferred function
func logPanic() {
  defer func() {
 if err := recover(); err != nil {
   fmt.Println("got panic")
   return
  }
}()
}
This still not working.



>From https://blog.golang.org/defer-panic-and-recover,

*Recover* is a built-in function that regains control of a panicking
goroutine. Recover is only useful inside deferred functions. During normal
execution, a call to recover will return nil and have no other effect. *If
the current goroutine is panicking, a call to recover will capture the
value given to panic and resume normal execution.*
I think I didn't break any rules.


Ian Lance Taylor  于2019年7月17日周三 下午9:59写道:

> On Wed, Jul 17, 2019 at 5:11 AM Tamás Gulácsi 
> wrote:
> >
> > The "recover()" call must be in the deferred part.
>
> Yes, as the spec says, recover must be called directly by a deferred
> function.
>
> When sending code to this list, please use a link to the Go playground
> or use plain text.  The highlighted text with a black background is
> unreadable.  Thanks.
>
> Ian
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/Ok40EBXxQ2Q/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXUWYdq%3DzSSw4V_HvNzrNpnrt1awEZbRFca0f6qHoBdsQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
--刘志平

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CAJ9rxt2Qwf69MotxjZRtpTFozY6D%3DgHShNGndFxeOZO_JHhipQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Panic not recovered inside my panic recover function

2019-07-17 Thread Ian Lance Taylor
On Wed, Jul 17, 2019 at 9:51 PM ZP L  wrote:
>
> Sorry for the bad formatting.
>
> > recover must be called directly by a deferred function
> func logPanic() {
>   defer func() {
>  if err := recover(); err != nil {
>fmt.Println("got panic")
>return
>   }
> }()
> }
> This still not working.
>
>
>
> From https://blog.golang.org/defer-panic-and-recover,
>
> Recover is a built-in function that regains control of a panicking goroutine. 
> Recover is only useful inside deferred functions. During normal execution, a 
> call to recover will return nil and have no other effect. If the current 
> goroutine is panicking, a call to recover will capture the value given to 
> panic and resume normal execution.
>
> I think I didn't break any rules.

If function F defers a function that calls recover, the recover
function will only catch a panic in the function F itself or in
functions that F calls.  In the example above, the recover would catch
a panic in logPanic or in a function called by logPanic.  But there is
no such panic, so recover always returns nil.

The reason that recover works this way is that a deferred function can
call another function that uses panic and recover.  The different
calls to recover need to not interfere with each other.

Ian

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcV5b6B3dJuZrcmvEkfhYKktzZWu1REMvyXWk7tpMfRpzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Panic not recovered inside my panic recover function

2019-07-17 Thread Dan Kortschak
The defer is not being run directly as a result of the panic.

>From the spec:

> The recover function allows a program to manage behavior of a
> panicking goroutine. Suppose a function G defers a function D that
> calls recover and a panic occurs in a function on the same goroutine
> in which G is executing. When the running of deferred functions
> reaches D, the return value of D's call to recover will be the value
> passed to the call of panic. If D returns normally, without starting
> a new panic, the panicking sequence stops.



On Thu, 2019-07-18 at 12:51 +0800, ZP L wrote:
> Sorry for the bad formatting.
> 
> > recover must be called directly by a deferred function
> 
> func logPanic() {
>   defer func() {
>  if err := recover(); err != nil {
>fmt.Println("got panic")
>return
>   }
> }()
> }
> This still not working.
> 
> 
> 
> From https://blog.golang.org/defer-panic-and-recover,
> 
> *Recover* is a built-in function that regains control of a panicking
> goroutine. Recover is only useful inside deferred functions. During
> normal
> execution, a call to recover will return nil and have no other
> effect. *If
> the current goroutine is panicking, a call to recover will capture
> the
> value given to panic and resume normal execution.*
> I think I didn't break any rules.
> 
> 
> Ian Lance Taylor  于2019年7月17日周三 下午9:59写道:
> 
> > On Wed, Jul 17, 2019 at 5:11 AM Tamás Gulácsi  > >
> > wrote:
> > > 
> > > The "recover()" call must be in the deferred part.
> > 
> > Yes, as the spec says, recover must be called directly by a
> > deferred
> > function.
> > 
> > When sending code to this list, please use a link to the Go
> > playground
> > or use plain text.  The highlighted text with a black background is
> > unreadable.  Thanks.
> > 
> > Ian
> > 
> > --
> > You received this message because you are subscribed to a topic in
> > the
> > Google Groups "golang-nuts" group.
> > To unsubscribe from this topic, visit
> > 
https://groups.google.com/d/topic/golang-nuts/Ok40EBXxQ2Q/unsubscribe
> > .
> > To unsubscribe from this group and all its topics, send an email to
> > golang-nuts+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> > 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXUWYdq%3DzSSw4V_HvNzrNpnrt1awEZbRFca0f6qHoBdsQ%40mail.gmail.com
> > .
> > For more options, visit https://groups.google.com/d/optout.
> > 
> 
> 
> -- 
> --刘志平
> 

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/5f7558fc749fc840a273bc34ecd5a3ece808eeb3.camel%40kortschak.io.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Panic not recovered inside my panic recover function

2019-07-17 Thread Dan Kortschak
You could try it this way if you really need a separate function.

https://play.golang.org/p/V-ysjWbZ2X5

On Thu, 2019-07-18 at 12:51 +0800, ZP L wrote:
> Sorry for the bad formatting.
> 
> > recover must be called directly by a deferred function
> 
> func logPanic() {
>   defer func() {
>  if err := recover(); err != nil {
>fmt.Println("got panic")
>return
>   }
> }()
> }
> This still not working.
> 
> 
> 
> From https://blog.golang.org/defer-panic-and-recover,
> 
> *Recover* is a built-in function that regains control of a panicking
> goroutine. Recover is only useful inside deferred functions. During
> normal
> execution, a call to recover will return nil and have no other
> effect. *If
> the current goroutine is panicking, a call to recover will capture
> the
> value given to panic and resume normal execution.*
> I think I didn't break any rules.
> 
> 
> Ian Lance Taylor  于2019年7月17日周三 下午9:59写道:
> 
> > On Wed, Jul 17, 2019 at 5:11 AM Tamás Gulácsi  > >
> > wrote:
> > > 
> > > The "recover()" call must be in the deferred part.
> > 
> > Yes, as the spec says, recover must be called directly by a
> > deferred
> > function.
> > 
> > When sending code to this list, please use a link to the Go
> > playground
> > or use plain text.  The highlighted text with a black background is
> > unreadable.  Thanks.
> > 
> > Ian
> > 
> > --
> > You received this message because you are subscribed to a topic in
> > the
> > Google Groups "golang-nuts" group.
> > To unsubscribe from this topic, visit
> > 
https://groups.google.com/d/topic/golang-nuts/Ok40EBXxQ2Q/unsubscribe
> > .
> > To unsubscribe from this group and all its topics, send an email to
> > golang-nuts+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> > 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXUWYdq%3DzSSw4V_HvNzrNpnrt1awEZbRFca0f6qHoBdsQ%40mail.gmail.com
> > .
> > For more options, visit https://groups.google.com/d/optout.
> > 
> 
> 
> -- 
> --刘志平
> 

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/c93def05cdb72cb9351eecd39087969dc9429f97.camel%40kortschak.io.
For more options, visit https://groups.google.com/d/optout.