Re: [go-nuts] Run a method with nil pointer

2018-09-03 Thread andrey mirtchovski
Plenty of previous discussions on the subject. Here's an example from 2012: https://groups.google.com/d/msg/golang-nuts/wcrZ3P1zeAk/KaR68a8rROEJ I don't think reasoning has changed. On Mon, Sep 3, 2018 at 10:38 PM Dat Huynh wrote: > > Just a question. > > Why does Go allow to call a method with

[go-nuts] Run a method with nil pointer

2018-09-03 Thread Dat Huynh
Just a question. Why does Go allow to call a method with a nil pointer? https://play.golang.org/p/xPehesnfK9b Thanks, Dat. -- 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 a

[go-nuts] Re: UI in golang

2018-09-03 Thread Alex
Doing native UI in Go isn't something I would recommend a total newbie to programming to do as most if not all the tutorials you would find would be written for C/C++. So then you would have to figure out how to translate that to the Go bindings or maybe even have to write parts of the program i

[go-nuts] Re: UI in golang

2018-09-03 Thread Rich
I've never worked with it but it looks like GTK might be a good choice. It's cross platform and says there is a version for Go. https://www.gtk.org/language-bindings.php On Monday, September 3, 2018 at 12:49:12 PM UTC-4, Diego Rocha wrote: > > What UI framework are you using in production? I'

Re: [go-nuts] Link: Getting specific about generics

2018-09-03 Thread Ian Lance Taylor
On Sun, Sep 2, 2018 at 1:08 AM, 'Charlton Trezevant' via golang-nuts wrote: > > Link: [Getting specific about generics, by Emily > Maier](https://emilymaier.net/words/getting-specific-about-generics/) > > The interface-based alternative to contracts seems like such a natural fit- > It’s simple, st

Re: [go-nuts] Panic getting swallowed by defer in Go 1.11

2018-09-03 Thread amanda
NB I’m unable to reproduce this bug without the pointer indirection. On Tuesday, September 4, 2018 at 3:38:35 AM UTC+10, Sam Whited wrote: > > On Mon, Sep 3, 2018, at 04:10, ama...@naucera.net wrote: > > type S []int > > > > func (s *S) Last() int { > > return (*s)[len(*s) - 1] > > } >

Re: [go-nuts] Panic getting swallowed by defer in Go 1.11

2018-09-03 Thread amanda
NB I']m On Tuesday, September 4, 2018 at 3:38:35 AM UTC+10, Sam Whited wrote: > > On Mon, Sep 3, 2018, at 04:10, ama...@naucera.net wrote: > > type S []int > > > > func (s *S) Last() int { > > return (*s)[len(*s) - 1] > > } > > On an unrelated matter, the extra indirection is (probably)

Re: [go-nuts] Panic getting swallowed by defer in Go 1.11

2018-09-03 Thread amanda
Thanks, that looks like what I’m seeing (I’m able to coax it to produce a pointer which segfaults the runtime). On Tuesday, September 4, 2018 at 3:34:43 AM UTC+10, Paul Jolly wrote: > > I suspect that you've just run into some variation on > https://github.com/golang/go/issues/27378 > > Giovan

Re: [go-nuts] Questions about calling Go/WASM from JS and overhead

2018-09-03 Thread Paul Jolly
> > *Question 1*: are calls from JS into Go/WASM expected to be asynchronous? > If so, is the callback passing approach the best way to get return values > back to the JS code? > Please see https://github.com/golang/go/issues/26045. Yes they are currently async, but they will become sync -- You

[go-nuts] Questions about calling Go/WASM from JS and overhead

2018-09-03 Thread torinsandall
Hello! I've been running some experiments with WASM support in Go 1.11. One of the experiments involves compiling a Go library into WASM and then calling it from JS. The post below mentions how to expose Go functions to JS, however, my experiments have shown that calls from JS into Go/WASM are

Re: [go-nuts] Panic getting swallowed by defer in Go 1.11

2018-09-03 Thread Sam Whited
On Mon, Sep 3, 2018, at 04:10, ama...@naucera.net wrote: > type S []int > > func (s *S) Last() int { > return (*s)[len(*s) - 1] > } On an unrelated matter, the extra indirection is (probably) not what you want here, slices are already a pointer type. For more information see https://blog.go

Re: [go-nuts] Panic getting swallowed by defer in Go 1.11

2018-09-03 Thread Paul Jolly
I suspect that you've just run into some variation on https://github.com/golang/go/issues/27378 Giovanni/Daniel/others better placed might be able to confirm more precisely however. On Mon, 3 Sep 2018 at 17:49, wrote: > > Hi all, > > Since Go 1.11, the following test seems to pass when I would

[go-nuts] Re: named go routines?

2018-09-03 Thread tang . rosechild
you may give a context to the goroutine? 在 2018年9月3日星期一 UTC+8下午2:03:24,Robert Engels写道: > > Hi, I recently started developing more complex concurrent Go applications. > > Using the debugger is very difficult - since when looking for a particular > routine, the list only shows the top level method

[go-nuts] Final Call for Papers: Microservices, DevOps, and Service-Oriented Architecture of the 34th ACM/SIGAPP Symposium On Applied Computing

2018-09-03 Thread saverio . giallorenzo
MiDOS track at SAC 2019 Call for Papers Microservices, DevOps, and Service-Oriented Architecture of the 34th ACM/SIGAPP Symposium

[go-nuts] Taking possible EOF as input

2018-09-03 Thread Hunter Breathat
Hey, so I'm currently trying to create a custom shell. I am currently trying to implement the EOF exit (^D). Currently, I am able to use exit as input and a variety of other commands, platform-specific; anything, not windows related (WIP), but I am having an issue with the EOF causing an infinit

[go-nuts] UI in golang

2018-09-03 Thread Diego Rocha
What UI framework are you using in production? I'm trying to do a simple text editor, but actually I don't know what framework I should use. (I'm new to the language and to the world of programming) thanks. -- You received this message because you are subscribed to the Google Groups "golang-nuts

[go-nuts] Panic getting swallowed by defer in Go 1.11

2018-09-03 Thread amanda
Hi all, Since Go 1.11, the following test seems to pass when I would expect it to panic with index out of range: package weirdness import "testing" type S []int func (s *S) Last() int { return (*s)[len(*s) - 1] } func TestWeirdness(t *testing.T) { var s S defer func() {}()

[go-nuts] Mage v1.2.4 is the latest release

2018-09-03 Thread Nate Finch
Mage (https://github.com/magefile/mage) had not been using semantic versioning, and this caused problems with go modules. To support go modules, I have ripped out the v2.x tags, and keps mage on v1. This is semantically correct, since mage has always been backwards compatible. It also makes

Re: [go-nuts] Re: How to setup your development environment using Go modules

2018-09-03 Thread Dan Kortschak
And here we have the problem. Low probability of error events do not scale. On Fri, 2018-08-31 at 19:30 -0700, Jim wrote: > Changes from the master/development go.mod will need to be carefully > merged  > into release go.mod. -- You received this message because you are subscribed to the Google

Re: [go-nuts] Listen by multiple goroutines via channels

2018-09-03 Thread Shulhan
On Mon, 3 Sep 2018 06:22:27 + Anik Hasibul wrote: > Can you please provide an example? I am new to golang. > Create N client receivers with channel and save the list of client channel as list, for x := 0; x < 5; x++ { cl := make(chan int, 1) chanClients

[go-nuts] Re: UnmarshalTypeError does not provide Field name anynmore

2018-09-03 Thread Stephane Moreau
The code used in the playground was unfortunately not the proper one here is a link to the new code https://play.golang.org/p/kbRsWxsQwE0 since current version of playground (as of 2018-09-03) is still 1.10.3 the playground does not show the issue I've logged an issue there to track the resolut

[go-nuts] Re: named go routines?

2018-09-03 Thread Kaveh Shahbazian
Go's concurrency is based on CSP (communication sequence process), not Actor Model. Hence you can have channels and manage all the communications through channels. For this, there is no need for named actors - unlike the actor model, where all communications are managed via mailboxes. These are