aboutsummaryrefslogtreecommitdiffstats
path: root/pkgid.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2026-05-14 15:06:31 -0400
committerSam Anthony <sam@samanthony.xyz>2026-05-14 15:06:31 -0400
commit8b39d27eea85691cc45e7d6798060e110e627806 (patch)
tree23ff6f39bdd0c4881de048ff300670ccd8824883 /pkgid.go
parentb2fc5a8c62b71d52d167e992c42fa6630cfca9b3 (diff)
downloadlulu-8b39d27eea85691cc45e7d6798060e110e627806.zip
cli: refactor flag handling
Diffstat (limited to 'pkgid.go')
-rw-r--r--pkgid.go6
1 files changed, 5 insertions, 1 deletions
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 {