From 8b39d27eea85691cc45e7d6798060e110e627806 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Thu, 14 May 2026 15:06:31 -0400 Subject: cli: refactor flag handling --- pkgid.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkgid.go') diff --git a/pkgid.go b/pkgid.go index 1268568..f90a33b 100644 --- a/pkgid.go +++ b/pkgid.go @@ -21,8 +21,12 @@ type PkgId struct { Foil } +func (p PkgId) String() string { + return fmt.Sprintf("%s.%s.%s.%s.%s.%s%s%s", p.TrimSize, p.ColorType, p.Quality, p.Binding, p.Paper, p.Finish, p.Linen, p.Foil) +} + func (p PkgId) MarshalText() ([]byte, error) { - return []byte(fmt.Sprintf("%s.%s.%s.%s.%s.%s%s%s", p.TrimSize, p.ColorType, p.Quality, p.Binding, p.Paper, p.Finish, p.Linen, p.Foil)), nil + return []byte(p.String()), nil } func (p *PkgId) UnmarshalText(text []byte) error { -- cgit v1.2.3