Created
January 9, 2018 13:44
-
-
Save fnzv/b1132314cfa95b4edc7569042e57daca to your computer and use it in GitHub Desktop.
qr-code generator in Golang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
import "os" | |
import qrcode "github.com/skip2/go-qrcode" | |
func main() { | |
// if not display usage | |
if len(os.Args) > 1 { | |
text := os.Args[1] | |
err := qrcode.WriteFile(text, qrcode.Medium, 256, "qr.png") | |
fmt.Println(err) | |
} else { | |
fmt.Println("usage: \n ./create-qr TEXT\n will generate qr.png based on input") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment