https://codereview.appspot.com/11321043/diff/1/environs/local/config_test.go#newcode87
environs/local/config_test.go:87: defer
local.SetRootCheckFunction(rootCheck)
I would probably label this origRootCheck or something to that effect,
so it is immediately clear that this was the value before setting it
without having to dig up the return value of SetRootCheckFunction.
LGTM
https:/ /codereview. appspot. com/11321043/ diff/1/ environs/ local/config. go local/config. go (right):
File environs/
https:/ /codereview. appspot. com/11321043/ diff/1/ environs/ local/config. go#newcode16 local/config. go:16: var rootCheckFunction = func() bool {
environs/
On 2013/07/16 03:56:35, wallyworld wrote:
> Perhaps checkRoot() is better?
checkIfRoot ?
https:/ /codereview. appspot. com/11321043/ diff/1/ environs/ local/config_ test.go local/config_ test.go (right):
File environs/
https:/ /codereview. appspot. com/11321043/ diff/1/ environs/ local/config_ test.go# newcode87 local/config_ test.go: 87: defer eckFunction( rootCheck) ction.
environs/
local.SetRootCh
I would probably label this origRootCheck or something to that effect,
so it is immediately clear that this was the value before setting it
without having to dig up the return value of SetRootCheckFun
https:/ /codereview. appspot. com/11321043/ diff/1/ environs/ local/export_ test.go local/export_ test.go (right):
File environs/
https:/ /codereview. appspot. com/11321043/ diff/1/ environs/ local/export_ test.go# newcode17 local/export_ test.go: 17: }
environs/
This is fine as is, though for testing stuff I do still prefer the style
of
return func() {
rootCheckFunction = old
}
But if you ever want to inspect what the real root check does, I suppose
this is fine, too.
https:/ /codereview. appspot. com/11321043/