]> Cypherpunks repositories - gostls13.git/commit
os: fix type check error in benchmark
authorRuss Cox <rsc@golang.org>
Fri, 20 Apr 2018 14:34:38 +0000 (10:34 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 25 Apr 2018 02:46:08 +0000 (02:46 +0000)
commite9bc0c5d244185ab40c3afe20495d49abaef5feb
tree53a4ef037e7ea782ebf77efcf8503492696172f8
parentbe012e1e2e5fb24c765157fd2ca7e05675d6a1c2
os: fix type check error in benchmark

Previously, 's' was only written to, never read,
which is disallowed by the spec. cmd/compile
has a bug where it doesn't notice this when a
closure is involved, but go/types does notice,
which was making "go vet" fail.

This CL moves the variable into the closure
and also makes sure to use it.

Change-Id: I2d83fb6b5c1c9018df03533e966cbdf455f83bf9
Reviewed-on: https://go-review.googlesource.com/108556
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/os/env_test.go