This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
go-discogs/examples/discogs_example.go

28 lines
548 B
Go
Raw Normal View History

2016-03-04 16:08:02 +00:00
package main
import (
"fmt"
2016-03-04 16:48:26 +00:00
"github.com/irlndts/go-discogs"
2016-03-04 16:08:02 +00:00
"net/http"
)
func main() {
client := &http.Client{}
2016-03-09 14:54:25 +00:00
d := discogs.NewClient(client).UserAgent("TestDiscogsClient/0.0.1 +http://irlndts.moscow")
2016-03-10 14:25:55 +00:00
/*
params := &discogs.ReleaseParams{Release_id: "8138518"}
release, _, err := d.Release.Release(params)
*/
2016-03-10 14:48:15 +00:00
params := &discogs.ArtistParams{Artist_id: "1000"}
artist, _, err := d.Artist.Artist(params)
2016-03-10 14:25:55 +00:00
2016-03-09 15:14:42 +00:00
if err != nil {
fmt.Println(err)
} else {
2016-03-10 14:25:55 +00:00
//fmt.Println(release.Title)
2016-03-10 14:48:15 +00:00
fmt.Println(artist.Id)
2016-03-09 15:14:42 +00:00
}
//fmt.Println(resp)
2016-03-04 16:08:02 +00:00
}