json output for list command

This commit is contained in:
lapwat
2023-02-17 19:47:23 +01:00
parent 23cc576926
commit efcc45316b
7 changed files with 89 additions and 69 deletions

View File

@@ -1,18 +1,10 @@
package book
type link struct {
href string
text string
Href string `json:"href"`
Text string `json:"name"`
}
func NewLink(href, text string) link {
return link{href, text}
}
func (c link) Href() string {
return c.href
}
func (c link) Text() string {
return c.text
}