package services import ( "fmt" "github.com/skip2/go-qrcode" "log" ) func GetQRCode() { err := qrcode.WriteFile("https://www.baidu.com", qrcode.Medium, 256, "./static/qrcode.png") if err != nil { log.Fatal(err) } log.Println("二维码生成成功") fmt.Println("ok") }