FAQ
Just a suggestion.


https://codereview.appspot.com/6641050/diff/3002/src/pkg/io/ioutil/tempfile.go
File src/pkg/io/ioutil/tempfile.go (right):

https://codereview.appspot.com/6641050/diff/3002/src/pkg/io/ioutil/tempfile.go#newcode20
src/pkg/io/ioutil/tempfile.go:20: var randmu sync.Mutex
I would like to see this as

var rand = struct {
value uint32
sync.Mutex
}{}

https://codereview.appspot.com/6641050/diff/3002/src/pkg/io/ioutil/tempfile.go#newcode27
src/pkg/io/ioutil/tempfile.go:27: randmu.Lock()
rand.Lock()

https://codereview.appspot.com/6641050/diff/3002/src/pkg/io/ioutil/tempfile.go#newcode28
src/pkg/io/ioutil/tempfile.go:28: r := rand
r := rand.value

https://codereview.appspot.com/6641050/diff/3002/src/pkg/io/ioutil/tempfile.go#newcode33
src/pkg/io/ioutil/tempfile.go:33: rand = r
rand.value = r

https://codereview.appspot.com/6641050/diff/3002/src/pkg/io/ioutil/tempfile.go#newcode34
src/pkg/io/ioutil/tempfile.go:34: randmu.Unlock()
rand.Unlock()

https://codereview.appspot.com/6641050/

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedOct 9, '12 at 11:59p
activeOct 9, '12 at 11:59p
posts1
users1
websitegolang.org

1 user in discussion

Dave: 1 post

People

Translate

site design / logo © 2022 Grokbase