Sometimes it is very convenient to be able to specify a version for QR code generation.
For example in case when QR code would be embedded into a form with specific layout. In this case if data to be encoded has variable length, then smaller data blocks would be encoded in smaller QR codes and potentially ruin form layout.
This pull request exports NewWithForcedVersion function. It also substitutes log.Fatalf invocation with error return to make function behavior more predictable.
Sometimes it is very convenient to be able to specify a version for QR code generation.
For example in case when QR code would be embedded into a form with specific layout. In this case if data to be encoded has variable length, then smaller data blocks would be encoded in smaller QR codes and potentially ruin form layout.
This pull request exports
NewWithForcedVersion
function. It also substituteslog.Fatalf
invocation with error return to make function behavior more predictable.