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

Activity

gmlewis

gmlewis commented on Jul 25, 2024

@gmlewis
Collaborator

Could you please give us more information by sharing the output when using
https://github.com/gmlewis/go-httpdebug
with this call?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @gmlewis@hq-zhonger

        Issue actions

          json: cannot unmarshal array into Go value of type github.Repository · Issue #3217 · google/go-github