If you are looking for encoding an url (or other text) to a QR code array and show a textual presentation of the 2D array, you can rather easily make a command line tool to do this in Go.
Below is a fully working example of such a tool using the go package you mentioned.
In order to compile it and run it, go to http://golang.org where you can find instructions on how to install Go, install external libraries, and compile the tool:
package main
import (
"flag"
"fmt"
"os"
"code.google.com/p/go-qrcode"
)
var (
url = flag.String("url", "", "Url to encode")
level = flag.Int("level", 0, "Recovery level. 0 is lowest, 3 is highest")
)
func main() {
flag.Parse()
if *level < 0 || *level > 3 {
fmt.Println("Level must be between 0 and 3")
os.Exit(1)
}
qr, err := qrcode.New(*url, qrcode.RecoveryLevel(*level))
if err != nil {
fmt.Println(err)
os.Exit(1)
}
printArray(qr.Bitmap())
}
func printArray(a [][]bool) {
fmt.Println("{")
for _, x := range a {
fmt.Print(" {")
out := ""
for _, y := range x {
if y {
out += "1"
} else {
out += "0"
}
fmt.Print(out)
out = ","
}
fmt.Println("}")
}
fmt.Println("}")
}
Usage:
Usage of qrarray.exe:
-level=0: Recovery level. 0 is lowest, 3 is highest
-url="": Url to encode