118 Commits
Author SHA1 Message Date
e40cf943ca ci: update golangci-lint to v2 (#1341)
* 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]>
2025-12-14 15:14:46 -08:00
Oleksandr Redko fca627ee8e Remove redundant build tags 2025-04-17 23:57:28 +03:00
Dale Hui 97009bec75 New release prep
* Update dktest from v0.3.16 to v0.4.0 to fix docker vulnerability
* Fix linter issues
* Update outdated GitHub Actions
2023-12-18 23:44:05 -08:00
GeorgeWheatcroftandGitHub 6ddc639d02 fix issue of downloading and using github sourced migration files of … (#900)
* 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
2023-03-24 23:18:40 -07:00
linzhengen 138f92cf42 bump ci version & go1.19 fmt ./... 2022-10-05 23:48:20 +09:00
Thomas Spear dd9074f7e9 Run gofmt -s on the files that are failing the lint job upstream
Signed-off-by: Thomas Spear <[email protected]>
2022-09-28 14:19:40 -05:00
Abhinav Nair baec8ed6b6 Replace deprecated ioutil pkg with os & io
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.
2022-06-26 16:57:29 +08:00
Eng Zer Jun 1a301f2273 test: use T.TempDir to create temporary test directory
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <[email protected]>
2022-02-09 09:37:48 +08:00
Khash SajadiandGitHub 494f9ed984 clarify the package name (#660)
* clarify the package name

* Adding import and connection string sections

* more clarification around the go usage
2021-12-07 13:52:37 -08:00
satoru ef19f58ad8 refactor: use sort.Slice 2021-12-07 14:49:37 +08:00
Dale HuiandGitHub b49be7a077 Merge branch 'master' into master 2021-11-04 21:48:03 -07:00
Ben CarlssonandGitHub fd521e82de Set syntax highlighting for pkger example 2021-10-31 13:26:24 -07:00
Greyeye 63bf7db8fa change github auth to use oauth token instead of basic. 2021-10-26 10:57:16 +10:00
Fontinalis 4410832321 fix source/file driver 2021-09-16 14:24:01 +02:00
Dale Hui 1294fa4cfa Update build constraints
Issue caught by linter

https://pkg.go.dev/go/build#hdr-Build_Constraints
https://pkg.go.dev/cmd/go#hdr-Build_constraints
https://go.googlesource.com/proposal/+/master/design/draft-gobuild.md
2021-09-10 21:04:11 -07:00
Dale Hui b37eea94ca Update go-github from v17 to v35 2021-05-28 14:56:29 -07:00
Dale Hui 0826557c8e Fix iofs tests
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
2021-05-10 22:49:46 -07:00
Dale Hui ac46f05b32 Revert "Merge pull request #481 from johejo/revert-472-iofs_source_driver"
This reverts commit 9506436607, reversing
changes made to 97dfb0f843.
2021-05-10 10:50:27 -07:00
Jeff WidmanandGitHub a6a5186f90 Fix typo 2021-03-15 21:45:44 -07:00
BenandGitHub 87b1c2739d Add default GitHub API client (#501) 2021-01-30 23:07:53 -08:00
56f7258a66 Fix issue when gitlab return only first 20 migrations (reopen) (#497)
* Fix issue when gitlab return only first 20 migrations

* CircleCI issue. repush

* gofmt with -s

Co-authored-by: Dale Hui <[email protected]>
2021-01-28 14:35:14 -08:00
Mitsuo HeijoandGitHub 7b7e95ef79 fix test on windows (#482)
* fix test on windows

On Windows, the test fails because os.Remove cannot remove unclosed and still-handled files.

* use t.Error instead of t.Log
2020-11-24 22:53:21 -08:00
Mitsuo HeijoandGitHub 8e817ec3b3 Revert "Add io/fs#FS Driver #471 (#472)"
This reverts commit 6f97cf5be1.
2020-11-21 23:27:36 +09:00
Mitsuo HeijoandGitHub 6f97cf5be1 Add io/fs#FS Driver #471 (#472)
* 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
2020-11-18 10:06:11 -08:00
Vladimir DimitrovandGitHub e8185a2daa Update driver.go (#454)
* Update driver.go

* addressing comments
2020-10-16 22:19:05 -07:00
Dale Hui 0e9dc0524a Run go fix 2020-10-07 15:31:28 -07:00
955d4f5158 Add Bitbucket Cloud Support as source (#450)
* 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]>
2020-09-28 22:08:20 -07:00
Roman LeventovandGitHub 28ff5bd316 Include file path in errors from PartialDriver.ReadUp() and ReadDown() (#421)
* 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
2020-08-29 16:44:38 -07:00
Danny HermesandGitHub ce735a631f Replacing Github with GitHub. (#429)
* Replacing `Github` with `GitHub`.

Done via:

```
$ git grep -l Github | xargs sed -i '' s/Github/GitHub/g
```

* Reverting changes to Go files.
2020-08-17 13:55:44 -07:00
Hannes Gustafsson 32079a4858 source/pkger: add readme 2020-05-24 01:32:26 +01:00
hnnsgstfssnandGitHub a7fbb937e9 Add pkger source driver support (#377)
* 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
2020-04-21 16:43:53 -07:00
Stephen Bishtawi 29b8f0cf95 Cleanup 2020-02-04 17:58:29 -08:00
Stephen Bishtawi 45588e416c Cleanup 2020-02-04 09:40:17 -08:00
Stephen Bishtawi dca2b1d3df Cleanup 2020-02-03 12:32:27 -08:00
Stephen Bishtawi af0a191595 Update 2020-01-31 10:56:16 -08:00
Stephen Bishtawi bd95c0a7c4 Implement WithInstance pattern 2020-01-31 10:24:31 -08:00
Stephen Bishtawi 5ef215b38c More testing 2020-01-30 13:00:45 -08:00
Stephen Bishtawi 6a3b39cfad Add test 2020-01-30 11:09:08 -08:00
Stephen Bishtawi 6aa8069978 Fix when prefix is empty 2020-01-29 17:31:18 -08:00
Stephen Bishtawi 9e2752c3bd Allow using a custom aws session 2020-01-29 14:57:07 -08:00
Dale Hui debfb7f8f4 Rename httpfs package files for improved readability 2020-01-02 00:10:22 -08:00
Dale Hui 622960986e Use httpfs.PartialDriver as main godoc_vfs source implementation 2020-01-02 00:10:22 -08:00
Dale Hui fdfe1bad11 Use httpfs.PartialDriver as main file source implementation 2020-01-01 16:26:24 -08:00
Dale Hui 27e8b80a5a Tweak source.httpfs README 2019-12-24 15:38:36 -08:00
Dale Hui 0223d0c7ce Add additional information in source.ErrDuplicateMigration struct 2019-12-24 15:35:08 -08:00
Julius Kriukas 157f82eeeb Drop errors.Is() usage to support go 1.12.x 2019-12-19 15:46:12 +02:00
Julius Kriukas ccd22dd934 Rename PartialDriver receiver variable to p 2019-12-19 15:36:14 +02:00
Julius Kriukas edf0656e2c Drop delayed error reporting 2019-12-19 15:30:00 +02:00
Julius Kriukas d75a7aa812 Rename Migrator -> PartialDriver 2019-12-19 15:13:02 +02:00
Julius Kriukas b0f60faa3c Add new test with example driver implemenation 2019-12-16 12:01:52 +02:00