You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
}