diff options
Diffstat (limited to 'pkgid.go')
| -rw-r--r-- | pkgid.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 { |