diff --git a/artists.go b/artists.go index 19fa402..15e59ea 100644 --- a/artists.go +++ b/artists.go @@ -17,12 +17,12 @@ func newArtistService(url string) *ArtistService { type Artist struct { Namevariations []string `json:"namevariations"` Profile string `json:"profile"` - Releases_url string `json:"releases_url"` - Resource_url string `json:"resource_url"` - Uri string `json:"uri"` - Urls []string `json:"urls"` - Data_quality string `json:"data_quality"` - Id int `json:"id"` + ReleasesURL string `json:"releases_url"` + ResourceURL string `json:"resource_url"` + URI string `json:"uri"` + URLs []string `json:"urls"` + DataQuality string `json:"data_quality"` + ID int `json:"id"` Images []Image `json:"images"` Members []Member `json:"members"` } diff --git a/discogs.go b/discogs.go index 4858253..c605130 100644 --- a/discogs.go +++ b/discogs.go @@ -12,6 +12,7 @@ const ( discogsAPI = "https://api.discogs.com/" ) +// Options is a set of options to use discogs API client type Options struct { URL string Currency string @@ -73,7 +74,7 @@ func currency(c string) (string, error) { case "": return "USD", nil default: - return "", fmt.Errorf("%v\n", "Invalid currency abbreviation.") + return "", fmt.Errorf("%v", "invalid currency abbreviation") } } diff --git a/masters.go b/masters.go index 5820a91..9af8459 100644 --- a/masters.go +++ b/masters.go @@ -4,6 +4,7 @@ import ( "strconv" ) +// MasterService ... type MasterService struct { url string } @@ -17,21 +18,21 @@ func newMasterService(url string) *MasterService { // Master resource represents a set of similar releases. // Masters (also known as `master releases`) have a `main release` which is often the chronologically earliest. type Master struct { - Styles []string `json:"styles"` - Genres []string `json:"genres"` - Videos []Video `json:"videos"` - Title string `json:"title"` - Main_release int `json:"main_release"` - Main_release_url string `json:"main_release_url"` - Uri string `json:"uri"` - Artists []Artist `json:"artists"` - Version_url string `json:"version_url"` - Year int `json:"year"` - Images []Image `json:"images"` - Resource_url string `json:"resource_url"` - Tracklist []Track `json:"tracklist"` - Id int `json:"id"` - Data_quality string `json:"data_quality"` + Styles []string `json:"styles"` + Genres []string `json:"genres"` + Videos []Video `json:"videos"` + Title string `json:"title"` + MainRelease int `json:"main_release"` + MainReleaseURL string `json:"main_release_url"` + URI string `json:"uri"` + Artists []Artist `json:"artists"` + VersionURL string `json:"version_url"` + Year int `json:"year"` + Images []Image `json:"images"` + ResourceURL string `json:"resource_url"` + Tracklist []Track `json:"tracklist"` + ID int `json:"id"` + DataQuality string `json:"data_quality"` } // Master returns a master release diff --git a/models.go b/models.go index c8f40b1..e8aadfc 100644 --- a/models.go +++ b/models.go @@ -53,7 +53,7 @@ type LabelSource struct { ResourceURL string `json:"resource_url"` } -// Itentifier ... +// Identifier ... type Identifier struct { Type string `json:"type"` Value string `json:"value"` diff --git a/releases.go b/releases.go index b9ac9a8..26387e6 100644 --- a/releases.go +++ b/releases.go @@ -79,7 +79,7 @@ type ReleaseRating struct { Rating Rating `json:"rating"` } -// Ratings retruns community release rating +// Rating retruns community release rating func (s *ReleaseService) Rating(releaseID int) (*ReleaseRating, error) { var rating *ReleaseRating if err := request(s.url+strconv.Itoa(releaseID)+"/rating", nil, &rating); err != nil { diff --git a/search.go b/search.go index 7ffd603..360f03d 100644 --- a/search.go +++ b/search.go @@ -15,7 +15,7 @@ func newSearchService(url string) *SearchService { } } -// SerachRequest describes search request +// SearchRequest describes search request type SearchRequest struct { Q string `url:"q,omitempty"` // search query Type string `url:"type,omitempty"` // one of release, master, artist, label