package api import ( "encoding/json" "io" ) const MethodCredits Method = "credits" type Credits struct { Author string `json:"author"` Homepage string `json:"homepage"` Other []string `json:"other,omitempty"` } func (c *Credits) Respond(w io.Writer, _ ...string) error { b, err := json.Marshal(c) if err != nil { return err } _, err = w.Write(b) return err }