Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function 'CheckAccountCapability' canot Unmarshal request body #166

Open
shijl0925 opened this issue Jun 1, 2024 · 2 comments
Open

function 'CheckAccountCapability' canot Unmarshal request body #166

shijl0925 opened this issue Jun 1, 2024 · 2 comments

Comments

@shijl0925
Copy link

shijl0925 commented Jun 1, 2024

package main

import (
	"context"
	gerrit "github.com/andygrunwald/go-gerrit"
	"log"
)

func main() {
	ctx := context.Background()
	instance := "http://127.0.0.1:8080/"
	client, _ := gerrit.NewClient(ctx, instance, nil)
	client.Authentication.SetBasicAuth("admin", "xxx")

	cap, _, err := client.Accounts.CheckAccountCapability(ctx, "admin", "createGroup")
	log.Printf("err: %v", err)
	log.Printf("capability: %s\n", cap)
}

2024/06/01 13:10:41 err: invalid character 'o' looking for beginning of value
2024/06/01 13:10:41 capability:

@shijl0925
Copy link
Author

shijl0925 commented Jun 1, 2024

The checks result of a user has "createGroup" capability should be "ok". I guess the function 'CheckAccountCapability' has a bug. And the gerrit server version is "3.8.0". Go version is "1.21.10".

@andygrunwald
Copy link
Owner

Thanks @shijl0925
I don't have time to look deeply at it right now.
Are you able to debug it? Happy to accept a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants