Minor Go-style suggeston: move decode and error assignment into if clause check.