在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:cli/go-gh开源软件地址:https://github.com/cli/go-gh开源编程语言:Go 100.0%开源软件介绍:go-gh betaThis project is in beta! Feedback is welcome. A Go module for CLI Go applications and gh extensions that want a convenient way to interact with gh, and the GitHub API using gh environment configuration.
If you'd like to use Installationgo get github.com/cli/go-gh Usagepackage main
import (
"fmt"
"github.com/cli/go-gh"
)
func main() {
// These examples assume `gh` is installed and has been authenticated
// Execute `gh issue list -R cli/cli`, and print the output.
args := []string{"issue", "list", "-R", "cli/cli"}
stdOut, _, err := gh.Exec(args...)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(stdOut.String())
// Use an API helper to grab repository tags
client, err := gh.RESTClient(nil)
if err != nil {
fmt.Println(err)
return
}
response := []struct{ Name string }{}
err = client.Get("repos/cli/cli/tags", &response)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(response)
} See examples for more use cases. Reference DocumentationFull reference docs can be found on pkg.go.dev. ContributingIf anything feels off, or if you feel that some functionality is missing, please check out the contributing page. There you will find instructions for sharing your feedback, and submitting pull requests to the project. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论