go-gerrit
go-gerrit copied to clipboard
function 'CheckAccountCapability' canot Unmarshal request body
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:
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".
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.