refactor: move from io/ioutil to io and os package (#17109)
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Add github api token option to generate-license & generate-gitignore (#12700)
* Add github api token option to generate-license & generate-gitignore
Without api toke, Will face rate limit sometimes.
Signed-off-by: a101211279 <1012112796@qq.com>
* Use Basic authentication with tokens
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: a101211279 <1012112796@qq.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Re-attempt to delete temporary upload if the file is locked by another process (#12447)
Replace all calls to os.Remove/os.RemoveAll by retrying util.Remove/util.RemoveAll and remove circular dependencies from util.
Fix #12339
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: silverwind <me@silverwind.io>