barcodes/generation/ean.go

21 lines
431 B
Go

package generation
import (
"fmt"
"github.com/boombuler/barcode"
"github.com/boombuler/barcode/ean"
)
func generateEAN(parameters Parameters) (barcode.Barcode, error) {
var strippedBarcode barcode.Barcode
GeneratedBarcode, err := ean.Encode(parameters.Content)
if err != nil {
fmt.Println("Error creating Barcode", err)
} else {
strippedBarcode = GeneratedBarcode.(barcode.Barcode)
}
return strippedBarcode, err
}