style: rename accessors to idiomatic names
This commit is contained in:
@@ -18,11 +18,11 @@ type Artist struct {
|
||||
} `json:"results"`
|
||||
}
|
||||
|
||||
func (a *Artist) GetTitle() string {
|
||||
func (a *Artist) Title() string {
|
||||
return a.Results.Data.Name
|
||||
}
|
||||
|
||||
func (a *Artist) GetTracks() []*Track {
|
||||
func (a *Artist) Tracks() []*Track {
|
||||
return a.Results.Tracks.Data
|
||||
}
|
||||
|
||||
@@ -30,11 +30,11 @@ func (a *Artist) SetTracks(t []*Track) {
|
||||
a.Results.Tracks.Data = t
|
||||
}
|
||||
|
||||
func (a *Artist) GetOutputDir(outputDir string) string {
|
||||
func (a *Artist) OutputDir(outputDir string) string {
|
||||
base, _ := filenamify.Filenamify(a.Results.Data.Name, filenamify.Options{})
|
||||
return path.Join(outputDir, base)
|
||||
}
|
||||
|
||||
func (a *Artist) Unmarshal(data []byte) error {
|
||||
func (a *Artist) decode(data []byte) error {
|
||||
return json.Unmarshal(data, a)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user