generated from VLADIMIR/template
fix
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// Package team_qr_pdf generates team QR-code PDFs.
|
||||
package team_qr_pdf
|
||||
|
||||
import (
|
||||
@@ -12,8 +13,10 @@ import (
|
||||
"github.com/skip2/go-qrcode"
|
||||
)
|
||||
|
||||
// ErrNoCards indicates that no cards were provided for generation.
|
||||
var ErrNoCards = errors.New("нет карточек")
|
||||
|
||||
// Card contains the data rendered on a team QR-code card.
|
||||
type Card struct {
|
||||
Name string
|
||||
URL string
|
||||
@@ -22,6 +25,7 @@ type Card struct {
|
||||
//go:embed fonts/DejaVuSansCondensed.ttf
|
||||
var font []byte
|
||||
|
||||
// Generate returns a PDF containing team QR-code cards.
|
||||
func Generate(cards []Card) ([]byte, error) {
|
||||
if len(cards) == 0 {
|
||||
return nil, ErrNoCards
|
||||
|
||||
Reference in New Issue
Block a user