package figtree import ( "fmt" ) type Fig struct { Id string Name string `json:"name"` Desc string `json:"desc"` Type string `json:"type"` Ext string `json:"ext"` Birth string `json:"birth"` } type FancyFig struct { Name string Path string Desc string Birth string } func (f Fig) Fancy() FancyFig { path := fmt.Sprintf("%s%s/%s.%s", FIGS, f.Type, f.Id, f.Ext) return FancyFig{ f.Name, path, f.Desc, f.Birth } }