Skip to content

json: cannot unmarshal array into Go value of type github.Repository #3217

Open
@hq-zhonger

Description

@hq-zhonger

client := github.NewClient(nil).WithAuthToken(e.getGithubToken())
ctx, cancelFunc := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFunc()
repo, _, err := client.Repositories.Get(ctx, "google/go-github", "commits")
if err != nil {
log.Fatal(err)
}

fmt.Println(repo)

2024/07/24 14:54:44 json: cannot unmarshal array into Go value of type github.Repository

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions