mirror of
https://github.com/golang/sys.git
synced 2026-02-08 19:56:04 +03:00
The "?" code assumed that the error value was always called "err", when in reality it might be called something different (like "ret") or even entirely absent. This commit makes the templating robust to that. At the same time, we move a lot of the complexity out of the actual templates and into helper functions, so that this remains easy to read. Change-Id: I939d56413a24f0e3e1bbf13da5adf13e9401747a Reviewed-on: https://go-review.googlesource.com/c/sys/+/275472 Trust: Jason A. Donenfeld <Jason@zx2c4.com> Trust: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>