Re: [go-nuts] Memory Limits in Go

2017-01-28 Thread Matthew Zimmerman
I love this. I write some data analysis code and for ease of development and speed I keep the tables I build in memory. Generating those tables takes lots of memory and CPU, so I disabled the GC and manually run GC when the runtime memory stats start to get close to the system limit. Seems to be w

[go-nuts] Re: building go1.7.5 ... api check failed

2017-01-28 Thread Dave Cheney
You must not set GOROOT when building from source. It is not necessary and will lead to confusing error messages if you at GOROOT -- 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, s

[go-nuts] Re: building go1.7.5 ... api check failed

2017-01-28 Thread gocss
yes; after the failed api check I issued 4 commands: "go env" "env | grep GO" "which go" "go -version" output of those follow: admin1@tp13:/csspc/etc$ go env GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/mnt/data1/admin1/gocode" GORACE="" GOROOT="/

[go-nuts] Re: building go1.7.5 ... api check failed

2017-01-28 Thread Dave Cheney
Do you have GOROOT set? This error can occur when GOROOT is set incorrectly. On Sunday, 29 January 2017 03:06:18 UTC+11, gocss wrote: > > building in xubuntu 16.04 LTS > > # API check > stat /csspc/etc/go/src/cmd/api/run.go: no such file or directory > 2017/01/28 10:51:46 Failed: exit status 1

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread 'Axel Wagner' via golang-nuts
There are a bunch of examples of where they are *useful* (some in this thread). It's just, that you can not *rely* on them for correctness. If you are setting a finalizer, because something needs to happen before some value gets GCed/falls out of scope, you are doing it wrong, don't do it. If you a

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread Justin Israel
On Sun, Jan 29, 2017, 10:35 AM John Souvestre wrote: > > If you find a piece of code that uses a finaliser for the correct > operation of that program, that code is broken. > > Does that include using a finalizer with CGO code? From what I read, that > seems to be where they are most often used

RE: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread John Souvestre
> If you find a piece of code that uses a finaliser for the correct operation > of that program, that code is broken. Does that include using a finalizer with CGO code? From what I read, that seems to be where they are most often used. > https://groups.google.com/forum/#!topic/golang-dev/DM

RE: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread John Souvestre
> If finalizers were indeed totally useless, it would obviously be totally useless to implement support for them. If someone described a few cases where finalizers were useful perhaps it would help understand them. John John Souvestre - New Orleans LA -- You received this message becaus

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread Dave Cheney
If you find a piece of code that uses a finaliser for the correct operation of that program, that code is broken. -- 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

Re: [go-nuts] Short vs. long variable declarations

2017-01-28 Thread Marvin Renich
* Will Faught [170127 21:58]: > Variable shadowing is rarely, if ever, a problem for me too; but what about > for newcomers? > > I think my copy/paste point stands, though; everyone has those problems, at > least occasionally. I agree with you. See my earlier post for my reasoning: https://gro

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
On Sunday, January 29, 2017 at 1:04:35 AM UTC+8, Axel Wagner wrote: > > On Sat, Jan 28, 2017 at 4:05 PM, T L > > wrote: > >> >> >> On Saturday, January 28, 2017 at 10:46:50 PM UTC+8, Dave Cheney wrote: >>> >>> >>> >>> On Sunday, 29 January 2017 01:42:08 UTC+11, T L wrote: On

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread 'Axel Wagner' via golang-nuts
On Sat, Jan 28, 2017 at 4:05 PM, T L wrote: > > > On Saturday, January 28, 2017 at 10:46:50 PM UTC+8, Dave Cheney wrote: >> >> >> >> On Sunday, 29 January 2017 01:42:08 UTC+11, T L wrote: >>> >>> >>> >>> On Saturday, January 28, 2017 at 10:33:08 PM UTC+8, Dave Cheney wrote: On

[go-nuts] building go1.7.5 ... api check failed

2017-01-28 Thread gocss
building in xubuntu 16.04 LTS # API check stat /csspc/etc/go/src/cmd/api/run.go: no such file or directory 2017/01/28 10:51:46 Failed: exit status 1 2017/01/28 10:51:46 FAILED doing an ls of above directory: admin1@tp13:/csspc/etc/go/src$ ls /csspc/etc/go/src/cmd/api ls: cannot access '/csspc

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread Konstantin Khomoutov
On Sat, 28 Jan 2017 07:05:13 -0800 (PST) T L wrote: [...] > My understanding is finalisers are guaranteed to run for some cases, > but not for some other cases, for a long running program. > If any cases are not guaranteed to run, then SetFinalizer would be > totally useless. [...] Many of your

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
On Saturday, January 28, 2017 at 10:46:50 PM UTC+8, Dave Cheney wrote: > > > > On Sunday, 29 January 2017 01:42:08 UTC+11, T L wrote: >> >> >> >> On Saturday, January 28, 2017 at 10:33:08 PM UTC+8, Dave Cheney wrote: >>> >>> >>> >>> On Sunday, 29 January 2017 01:25:20 UTC+11, T L wrote:

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread Dave Cheney
On Sunday, 29 January 2017 01:42:08 UTC+11, T L wrote: > > > > On Saturday, January 28, 2017 at 10:33:08 PM UTC+8, Dave Cheney wrote: >> >> >> >> On Sunday, 29 January 2017 01:25:20 UTC+11, T L wrote: >>> >>> >>> >>> On Saturday, January 28, 2017 at 9:33:51 PM UTC+8, C Banning wrote: Fr

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
On Saturday, January 28, 2017 at 10:33:08 PM UTC+8, Dave Cheney wrote: > > > > On Sunday, 29 January 2017 01:25:20 UTC+11, T L wrote: >> >> >> >> On Saturday, January 28, 2017 at 9:33:51 PM UTC+8, C Banning wrote: >>> >>> From the doc: "The finalizer for obj is scheduled to run at some >>> arbit

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
On Saturday, January 28, 2017 at 10:25:20 PM UTC+8, T L wrote: > > > > On Saturday, January 28, 2017 at 9:33:51 PM UTC+8, C Banning wrote: >> >> From the doc: "The finalizer for obj is scheduled to run at some >> arbitrary time after obj becomes unreachable. There is no guarantee that >> finali

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread Dave Cheney
On Sunday, 29 January 2017 01:25:20 UTC+11, T L wrote: > > > > On Saturday, January 28, 2017 at 9:33:51 PM UTC+8, C Banning wrote: >> >> From the doc: "The finalizer for obj is scheduled to run at some >> arbitrary time after obj becomes unreachable. There is no guarantee that >> finalizers wil

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
On Saturday, January 28, 2017 at 9:33:51 PM UTC+8, C Banning wrote: > > From the doc: "The finalizer for obj is scheduled to run at some > arbitrary time after obj becomes unreachable. There is no guarantee that > finalizers will run before a program exits, so typically they are useful > only

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
On Saturday, January 28, 2017 at 9:33:51 PM UTC+8, C Banning wrote: > > From the doc: "The finalizer for obj is scheduled to run at some > arbitrary time after obj becomes unreachable. There is no guarantee that > finalizers will run before a program exits, so typically they are useful > only

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread C Banning
>From the doc: "The finalizer for obj is scheduled to run at some arbitrary time after obj becomes unreachable. There is no guarantee that finalizers will run before a program exits, so typically they are useful only for releasing non-memory resources associated with an object during a long-run

[go-nuts] I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
package main import "time" import "runtime" type T1 struct{ i int } type T2 struct{ i int } func main() { t1 := new(T1) t2 := new(T2) runtime.SetFinalizer(t1, func(*T1) {println(1)}) runtime.SetFinalizer(t2, func(*T2) {println(2)}) runtime.GC()

[go-nuts] I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
package main import "time" import "runtime" type T1 struct{ i int } type T2 struct{ i int } func main() { t1 := new(T1) t2 := new(T2) runtime.SetFinalizer(t1, func(*T1) {println(1)}) runtime.SetFinalizer(t2, func(*T2) {println(2)}) runtime.GC()