git-codereview: work around compiler bug
Using the 'return &gitTest{...}' form the gt variable is not
set during the deferred func execution, causing the tmp dir
to be removed always, making all the tests fail.
Issue golang/go#9738.
Change-Id: Iac91926ea5d756547eaade52effe68bc7706c17a
Reviewed-on: https://go-review.googlesource.com/3620
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
diff --git a/git-codereview/util_test.go b/git-codereview/util_test.go
index 8197867..cd62f33 100644
--- a/git-codereview/util_test.go
+++ b/git-codereview/util_test.go
@@ -130,12 +130,13 @@
t.Fatal(err)
}
- return &gitTest{
+ gt = &gitTest{
pwd: pwd,
tmpdir: tmpdir,
server: server,
client: client,
}
+ return gt
}
func (gt *gitTest) removeStubHooks() {