daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Jan 18th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main
  2.  
  3. import "fmt"
  4. import "os"
  5. import qrcode "github.com/skip2/go-qrcode"
  6.  
  7. func main() {
  8.  
  9.         // if not display usage
  10.         if len(os.Args) > 1 {
  11.                 text := os.Args[1]
  12.                 err := qrcode.WriteFile(text, qrcode.Medium, 256, "qr.png")
  13.                 fmt.Println(err)
  14.         } else {
  15.                 fmt.Println("usage: \n ./create-qr TEXT\n will generate qr.png based on input")
  16.         }
  17.  
  18. }
RAW Paste Data
Top