codec: work around https://github.com/golang/go/issues/12927
go 1.4 was throwing an error saying
v declared and not used
We workaround it by referencing v directly within the function,
not just as a function argument.
We will keep this in till go 1.6 is released.
Fixes #108