Check Gitea Version Requirement #419

Merged
6543 merged 3 commits from 6543/go-sdk:dont-support-to-old-gitea-versions into master 2020-09-15 16:55:50 +00:00
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"
```
## Version Requirements
* go >= 1.13
* gitea >= 1.10
## Contributing
Fork -> Patch -> Push -> Pull Request

View File

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