Pass errors through to main function.

master
Icedream 2017-09-04 11:21:09 +02:00
parent cb7e5027ed
commit cf68a4548f
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
1 changed files with 3 additions and 3 deletions

View File

@ -115,7 +115,7 @@ func main() {
if err != nil {
return
}
generateCliQR(string(input))
err = generateCliQR(string(input))
case cmdOtp.FullCommand(): // otp -> qr
// https://github.com/google/google-authenticator/wiki/Key-Uri-Format
@ -149,14 +149,14 @@ func main() {
RawQuery: query.Encode(),
}
log.Println("Generated URL:", url.String())
generateCliQR(url.String())
err = generateCliQR(url.String())
default: // other
err = ErrCommandNotFound
}
}
func generateCliQR(input string) {
func generateCliQR(input string) (err error) {
grid, err := qrencode.Encode(input, ecLevelMapping[*flagECLevel])
if err != nil {
return