generated from bing/readnotes
25 lines
417 B
Go
25 lines
417 B
Go
package main
|
|
|
|
import (
|
|
"image/color"
|
|
"log"
|
|
"os"
|
|
|
|
"github.com/skip2/go-qrcode"
|
|
)
|
|
|
|
func main(){
|
|
code, err := qrcode.New("http://weixin.qq.com/q/02vEhthpJ1fqD1mfbvxzcy", qrcode.High)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
code.BackgroundColor = color.Transparent
|
|
data, err := code.PNG(256)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
err = os.WriteFile("tmp.png", data, os.ModePerm)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
} |