* ci: update golangci-lint to v2
update method:
```
golangci-lint migrate
golangci-lint run --fix
```
and fix the last ones manually
* Apply suggestion from @Copilot
* fix tests
---------
Co-authored-by: Hanzo Dev <[email protected]>
* fix issue of downloading and using github sourced migration files of 100MB >=1Mb (which previously failed to download due to their size and the api call performed) by preferring the go-github client library method 'DownloadContents' for such operations (which doesn't have the same limitation)
* empty commit & push to trigger ci
As of Go 1.16, the same functionality is now provided by package io or
package os, and those implementations should be preferred in new code.
So replacing all usage of ioutil pkg with io & os.
Changes:
- embedded variables must be at the package level
- re-use embedded FS in example for tests
- bump Go module version to 1.16 for tests to run
- This may cause issues building in 1.15
* Add io/fs#FS Driver #471
* Refactor iofs.Iofs to be independent of httpfs
* Rename Iofs to IoFS, accepts fs.FS and use fs.DirEntry.Info() to undo the changes in ErrDuplicateMigration
* fix documents and migration directory for testing
* Fix iofs.Driver so that it can be used by embedding it like httpfs.PartialDriver
* iofs.Driver closes the file system if possible
* Rename receiver
* Refactor file driver to use iofs.Driver
* iofs build constraint is not needed so remove it
* Properly return an error in a corner case
* Increase golangci-lint timeout
* Fix example code
* Revert "Increase golangci-lint timeout"
This reverts commit 2cd12a63b50b7ac48d12dd0adc1ec4f4b49c3b93.
* unexport driver, add iofs.PartialDriver, remove type alias from file driver
* do not panic in Open, return error
* Added bitbucket cloud support as source for migration
* added test
* address PR Comments
* Add entry in README.md; update go.mod and go.sum
Co-authored-by: abhigupta91 <[email protected]>
* Include file path in errors from PartialDriver.ReadUp() and ReadDown()
* Use errors.Is(...) instead of os.Is...() in migrate.go: https://github.com/golang/go/issues/41122
* Add pkger source driver support
As go-bindata has been abandoned [1] there are open requests, #116, for
alternative sources with similar functionality. The Buffalo project [2]
created packr and recently pkger [3] was announced [4] with the
intention to supersede packr.
This change adds support for using pkger as a source.
The implementation relies on httpfs.PartialDriver for pretty much all
functionality.
[1] https://github.com/jteeuwen/go-bindata/issues/5
[2] https://gobuffalo.io/
[3] https://github.com/markbates/pkger
[4] https://blog.gobuffalo.io/introducing-pkger-static-file-embedding-in-go-1ce76dc79c65
* pkger: rename Instance to Pkger
* pkger: make WithInstance accept *Pkger
* pkger: refactor and add access to global pkging.Pkger instance
* pkger: fix typo and cleanup debug logging