[go-nuts] Re: Concurrent access to map

2017-05-15 Thread pierre . curto
Hello, Once you have written out your values to the map, you can read them concurrently and safely. If you need to write again to it (insert or delete), then you must ensure it is done safely. Note that, from what I can see in tip, in 1.9 there will be a safe concurrent map:

Re: [go-nuts] Re: Why does gofmt by default use an 8 space indent?

2017-05-15 Thread Rob Pike
The indent character is tab, whose width is your decision. That's in large part why the indent character is tab: to let you choose how much to indent. -rob On Mon, May 15, 2017 at 8:05 PM, wrote: > Because it warns you that you're probably nesting too deep and should

[go-nuts] Concurrent access to map

2017-05-15 Thread tang . yan
Hi, I am aware of golang map is not safe for concurrent access, especially when there is at least one writer. However, I want to know that if the map has been pre-populated, and different coroutines access (read/write) different key/value pair, is it safe to do so? There is no deletion or

[go-nuts] Re: Why does gofmt by default use an 8 space indent?

2017-05-15 Thread hollowaykeanho
Because it warns you that you're probably nesting too deep and should consider breaking them into smaller functions. It's more of a coding practice, not some language standards. Read #1 from https://www.kernel.org/doc/html/v4.10/process/coding-style.html. On Friday, March 7, 2014 at 10:01:19

[go-nuts] Re: Is it ok to separate Open and Close logic?

2017-05-15 Thread Christoph Berger
Is there any reason that Cleanup(f) should be called within DoingStuff()? (A reason that maybe is not visible in your example but might become obvious in a more complex scenario?) Otherwise you could just call `defer Cleanup(file)` in DoStuff() with exactly the same result, and you are back

[go-nuts] [go/loader] write a conf to load faster a program ?

2017-05-15 Thread mhhcbon
Hi, I wrote this func to load a program, its faster but it has drawbacks about error managements. It might hide some messages. the first time i ran this function, without a special typechecker error handler, I felt overwhelmed by the amount of errors generated. in this func s is an import path,

[go-nuts] Re: [ANN] Ugarit

2017-05-15 Thread Luis Furquim
https://github.com/luisfurquim/ugarit/blob/master/epub30/book.go#L487 > take advantage of filepath.Join() + os.Separator ? maybe. > > Here we cannot use os.Separator, the EPub file is a zip archive and inside a zip, we have to always use '/'. >

[go-nuts] Re: Is it ok to separate Open and Close logic?

2017-05-15 Thread 'Eric Johnson' via golang-nuts
In this kind of scenario, I recommend a (type) wrapper for *File Rework the code as: type Doer *File func NewDoer(f string) (Doer, err) { file, err := os.Open(f) // ... } func (d Doer) Close() error { return d.Close() } Everything else being the same, your caller can then expect

Re: [go-nuts] Re: [ANN] scaffolder - web application servers to order

2017-05-15 Thread Simon Ritchie
Don't wait. Write it yourself. Seriously, if my solution does most of what you want, but it's not quite right, it's very easy to change it. Just hack the templates. Regards Simon On Mon, May 15, 2017 at 4:41 PM, Tong Sun wrote: > Quite agree with the following. > >

[go-nuts] Re: [ANN] gocog - generate code in any language, for any language

2017-05-15 Thread Tong Sun
I was a big fan of GSL , but its old licensing and new 4+ version all gave me troubles. So I ended up writing my own: easygen

[go-nuts] Re: [ANN] scaffolder - web application servers to order

2017-05-15 Thread Tong Sun
Quite agree with the following. scaffolding just like symfony/RoR scaffold generator! That's something I had been hoping and looking for for quite a while. Thanks a lot! On Thursday, May 11, 2017 at 4:37:44 AM UTC-4, mhh...@gmail.com wrote: > > It s awesome, > in my opinion, this is the

[go-nuts] Re: New fully featured bash completion for go - written in go

2017-05-15 Thread Eyal Posener
The right installation commands are: go get github.com/posener/complete/gocomplete gocomplete -install You can also view the code in https://github.com/posener/complete On Saturday, May 13, 2017 at 11:29:47 AM UTC+3, Eyal Posener wrote: > > Simple to install (Assuming GOPATH and PATH are

[go-nuts] Re: [ANN] Ugarit

2017-05-15 Thread Luis Furquim
Hi, Yes, this is correct, it generates epub files in versions 20/30. But it is an initial version, you really can gernerate the epubs and open in iBooks and Adobe. But it is has a long way to evolve yet. The example can be found at

Re: [go-nuts] Re: adding context.Context to new code

2017-05-15 Thread mhhcbon
+1 for any feedback. > One issue was libraries that were used both in paths from http requests (so they needed the context propagated through them) but were also used in places where their callers (starting at main) didn't have any contexts at all yup. Imagine also in the middle of the call

Re: [go-nuts] Huge system RSS memory usage

2017-05-15 Thread miha . dimec
Hi I am back with update. There is most certainly was memory leak connected with openCv. I don't know where is the problem yet. I can confirm this, because I have run test while mocking openCv out, there were no leaks of the type that was desbribed before. RSS was constant. Except there was