This is a backport of the respective changes in golang.org/cl/19393. For golang/go#14215. Change-Id: I8d60dd6daa827a60597f3af925e6732914537319 Reviewed-on: https://go-review.googlesource.com/19394 Reviewed-by: Alan Donovan <adonovan@google.com>