Created extension

This commit is contained in:
t-dedah
2022-06-10 15:01:35 +05:30
parent 0c5e5e9835
commit e8ea897520
4 changed files with 87 additions and 0 deletions

26
main.go Normal file
View File

@@ -0,0 +1,26 @@
package main
import (
"fmt"
"github.com/cli/go-gh"
)
func main() {
fmt.Println("hi world, this is the gh-actions-cache extension!")
client, err := gh.RESTClient(nil)
if err != nil {
fmt.Println(err)
return
}
response := struct {Login string}{}
err = client.Get("user", &response)
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("running as %s\n", response.Login)
}
// For more examples of using go-gh, see:
// https://github.com/cli/go-gh/blob/trunk/example_gh_test.go