您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920212223242526272829
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Copyright 2018 Jonas Franz. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package migrations
  6. import (
  7. "errors"
  8. "github.com/google/go-github/v24/github"
  9. )
  10. var (
  11. // ErrNotSupported returns the error not supported
  12. ErrNotSupported = errors.New("not supported")
  13. )
  14. // IsRateLimitError returns true if the err is github.RateLimitError
  15. func IsRateLimitError(err error) bool {
  16. _, ok := err.(*github.RateLimitError)
  17. return ok
  18. }
  19. // IsTwoFactorAuthError returns true if the err is github.TwoFactorAuthError
  20. func IsTwoFactorAuthError(err error) bool {
  21. _, ok := err.(*github.TwoFactorAuthError)
  22. return ok
  23. }