|
@@ -1,16 +1,17 @@
|
|
|
package qr
|
|
|
|
|
|
import (
|
|
|
- "fmt"
|
|
|
+ "os/exec"
|
|
|
|
|
|
"github.com/skip2/go-qrcode"
|
|
|
)
|
|
|
|
|
|
// RenderString as a QR code
|
|
|
func RenderString(s string) {
|
|
|
- q, err := qrcode.New(s, qrcode.Medium)
|
|
|
+ err := qrcode.WriteFile(s, qrcode.Medium, 200, "tmp.png")
|
|
|
if err != nil {
|
|
|
panic(err)
|
|
|
}
|
|
|
- fmt.Println(q.ToSmallString(false))
|
|
|
+ cmd:=exec.Command("rundll32.exe", "url.dll,FileProtocolHandler", "tmp.png")
|
|
|
+ cmd.Start()
|
|
|
}
|