package main
import (
"image/png""os""github.com/MarcoWel/gozxing""github.com/MarcoWel/gozxing/oned"
)
funcmain() {
// Generate a barcode image (*BitMatrix)enc:=oned.NewCode128Writer()
img, _:=enc.Encode("Hello, Gophers!", gozxing.BarcodeFormat_CODE_128, 250, 50, nil)
file, _:=os.Create("barcode.png")
deferfile.Close()
// *BitMatrix implements the image.Image interface,// so it is able to be passed to png.Encode directly._=png.Encode(file, img)
}
About
Port of ZXing (https://github.com/zxing/zxing) core to pure Go.