[go-nuts] When a factory function returns objects by value, a custom finalizer will get called, right?

2018-10-05 Thread flockemark44
Hi! :-) I'm still a newbie. I've got a factory function for objects, and the newly created object is given out by a return statement. But it seems the original object gets copied (no "move semantics") and gets garbage collected. Anyway, in my program, my custom finalizer (set with runtime.Set

[go-nuts] What's the difference between local variables and fields when it comes to ignoring errors?

2018-10-02 Thread flockemark44
Hi! :-) I'd like to understand the reasoning in Go better. This code is allowed: newlocalvar, _ := strconv.Atoi(somestring) And this code is forbidden: somestruct.field, _ = strconv.Atoi(somestring) At least it does not compile, and so far I have learned that the reason is you should not ignor