From 0f41f45197e7961e2bf8d42a1c7572bc4034a4b0 Mon Sep 17 00:00:00 2001 From: irlndts Date: Tue, 9 May 2017 18:52:58 +0300 Subject: [PATCH] minor comment fix --- artists.go | 9 ++++++++- examples/discogs_example.go | 2 +- releases.go | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/artists.go b/artists.go index be0ebd8..0323d55 100644 --- a/artists.go +++ b/artists.go @@ -1,14 +1,17 @@ package discogs import ( - "github.com/irlndts/go-apirequest" "net/http" + + "github.com/irlndts/go-apirequest" ) +// ArtistService ... type ArtistService struct { api *apirequest.API } +// ArtistParams ... type ArtistParams struct { Artist_id string Sort string // year, title, format @@ -17,6 +20,7 @@ type ArtistParams struct { Per_page int } +// Artist ... type Artist struct { Namevariations []string `json:"namevariations"` Profile string `json:"profile"` @@ -30,6 +34,7 @@ type Artist struct { Members []Member `json:"members"` } +// ArtistReleases ... type ArtistReleases struct { Paginastion Page `json:"pagination"` Releases []ReleaseSource `json:"releases"` @@ -41,6 +46,7 @@ func newArtistService(api *apirequest.API) *ArtistService { } } +// Artist ... func (self *ArtistService) Artist(params *ArtistParams) (*Artist, *http.Response, error) { artist := new(Artist) apiError := new(APIError) @@ -49,6 +55,7 @@ func (self *ArtistService) Artist(params *ArtistParams) (*Artist, *http.Response return artist, resp, relevantError(err, *apiError) } +// Releases ... func (self *ArtistService) Releases(params *ArtistParams) (*ArtistReleases, *http.Response, error) { releases := new(ArtistReleases) apiError := new(APIError) diff --git a/examples/discogs_example.go b/examples/discogs_example.go index 1e95e9b..1eb45a1 100644 --- a/examples/discogs_example.go +++ b/examples/discogs_example.go @@ -7,7 +7,7 @@ import ( ) func main() { - d := discogs.NewClient().UserAgent("TestDiscogsClient/0.0.1 +http://irlndts.moscow").Token() + d := discogs.NewClient().UserAgent("TestDiscogsClient/0.0.1 +http://irlndts.moscow").Token("oQTQKAprakIQfWOkAxTdYyDpgUqahHtdbHTuYkIy") if err := d.Currency("EUR"); err != nil { fmt.Println(err) diff --git a/releases.go b/releases.go index 7af7eb1..ffeaacf 100644 --- a/releases.go +++ b/releases.go @@ -28,7 +28,7 @@ type Release struct { MasterID int `json:"master_id"` MasterURL string `json:"master_url"` Notes string `json:"notes,omitempty"` - NumForSale int `json:"numfor_sale,omitempty"` + NumForSale int `json:"num_for_sale,omitempty"` Released string `json:"released"` ReleasedFormatted string `json:"released_formatted"` ResourceURL string `json:"resource_url"`