Yandex Disk SDK on GoLand
It is a fast, safe and efficient tool that works immediately after installation.
Use module (recommended)
import "github.com/nikitaksv/yandex-disk-sdk-go"
Use vendor
go get github.com/nikitaksv/yandex-disk-sdk-go
Useful links on official docs:
Create new instance Yandex.Disk
yaDisk,err := yadisk.NewYaDisk(ctx.Background(),http.DefaultClient, &yadisk.Token{AccessToken: "YOUR_TOKEN"})
if err != nil {
panic(err.Error())
}
disk,err := yaDisk.GetDisk([]string{})
if err != nil {
// If response get error
e, ok := err.(*yadisk.Error)
if !ok {
panic(err.Error())
}
// e.ErrorID
// e.Message
}