This is a Go wrapper for working with DEV API.
The aim is to be able to do all tasks on this DEV API endpoint simply by getting an API key.
go get github.com/TaigaMikami/go-devto/devto
-
Visit https://dev.to/settings/account and Get API key.
-
eg.) Retrieve articles and Output an article's title.
package main
import (
"fmt"
"github.com/TaigaMikami/go-devto/devto"
)
func main() {
opt := &devto.RetrieveArticlesOption{
Page: 1,
PerPage: 10,
}
client := devto.NewClient("API Key")
res, err := client.RetrieveArticles(opt)
if err != nil {
panic(err)
}
fmt.Println(res[0].Title)
}
Examples of the API can be found in the examples directory.