Fixes #7050. LGTM=crawshaw, r R=golang-codereviews, crawshaw, r CC=golang-codereviews https://golang.org/cl/91590043