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

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

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 > } > }() > } >

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

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

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",

[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

[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

[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

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

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.

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

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

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

[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

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

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

[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

[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 (

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.

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

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,

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

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

[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

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:

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

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

2019-07-17 Thread 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