Check Gitea Version Requirement (#419)

Readme: show Version Requirements

SDK: dont support gitea < 1.10

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/419
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
This commit is contained in:
6543 2020-09-15 16:55:31 +00:00
parent 83da05b95f
commit 8b9aa61718
2 changed files with 7 additions and 0 deletions

View file

@ -10,6 +10,10 @@ This project acts as a client SDK implementation written in Go to interact with
import "code.gitea.io/sdk/gitea" import "code.gitea.io/sdk/gitea"
``` ```
## Version Requirements
* go >= 1.13
* gitea >= 1.10
## Contributing ## Contributing
Fork -> Patch -> Push -> Pull Request Fork -> Patch -> Push -> Pull Request

View file

@ -55,6 +55,9 @@ func NewClient(url string, options ...func(*Client)) (*Client, error) {
for _, opt := range options { for _, opt := range options {
opt(client) opt(client)
} }
if err := client.CheckServerVersionConstraint(">=1.10"); err != nil {
return nil, err
}
return client, nil return client, nil
} }