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
2017-04-25 19:39:32 +03:00

30 lines
511 B
Go

package main
import (
"fmt"
"github.com/irlndts/go-discogs"
)
func main() {
d := discogs.NewClient("TestDiscogsClient/0.0.1 +http://irlndts.moscow", "")
request := &discogs.SearchRequest{Q: "The Swindlers - Dig Out Alive!", Page: 0, Per_page: 1}
search, _, err := d.Search.Search(request)
if err != nil {
fmt.Println(err)
return
}
for _, r := range search.Results {
fmt.Printf("%+v\n", r)
//fmt.Println(r.Id, r.Title)
release, _ := d.Release(r.ID)
fmt.Printf("%+v\n", release)
}
}