gopl-zh.github.com/tools/mkqrcode.go

34 lines
603 B
Go
Raw Normal View History

2016-01-12 05:52:13 +00:00
// Copyright 2015 <chaishushan{AT}gmail.com>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ingore
package main
import (
"fmt"
"io/ioutil"
"log"
qr "github.com/chai2010/image/qrencoder"
)
const (
2016-02-17 06:45:37 +00:00
gopl_zh_url = "https://bitbucket.org/golang-china/gopl-zh"
2016-01-12 05:52:13 +00:00
output = "gopl-zh-qrcode.png"
)
func main() {
c, err := qr.Encode(gopl_zh_url, qr.H)
if err != nil {
log.Fatal(err)
}
err = ioutil.WriteFile(output, c.PNG(), 0666)
if err != nil {
log.Fatal(err)
}
fmt.Println("output:", output)
}