Allow gitea dev version (#914)

* update gitea sdk to latest
* As before try to autodetect gitea version, if this does not work, assume it's latest version (v1.17.0 atm)
This commit is contained in:
6543
2022-05-14 17:34:40 +02:00
committed by GitHub
parent c350af645b
commit d06dfc86b4
28 changed files with 358 additions and 163 deletions

View File

@@ -66,7 +66,7 @@ const (
)
// Validate the AddCollaboratorOption struct
func (opt AddCollaboratorOption) Validate() error {
func (opt *AddCollaboratorOption) Validate() error {
if opt.Permission != nil {
if *opt.Permission == AccessModeOwner {
*opt.Permission = AccessModeAdmin
@@ -88,7 +88,7 @@ func (c *Client) AddCollaborator(user, repo, collaborator string, opt AddCollabo
if err := escapeValidatePathSegments(&user, &repo, &collaborator); err != nil {
return nil, err
}
if err := opt.Validate(); err != nil {
if err := (&opt).Validate(); err != nil {
return nil, err
}
body, err := json.Marshal(&opt)