28 Commits
Author SHA1 Message Date
zeekayandHanzo Dev 85d7501b1f Build on Go 1.27
go fix applied the modernizers. One rewrite it got wrong is corrected here: a
reverse loop over runes became a range over slices.Backward that bound the index
and the value to the SAME name, which does not compile and would have compared a
rune to an index if it had. The value gets its own name.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-17 06:18:28 -07:00
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
leonklingeleandGitHub 426470006b chore: remove dependency on "hashicorp/go-multierror" (#1322)
* feat: remove dependency on "hashicorp/go-multierror"

It seems the project has been unmainted for quite some time already,
see for example https://github.com/hashicorp/go-multierror/issues/97
and https://github.com/hashicorp/go-multierror/issues/98.
This also removes an uneccessary dependency which slims down the go.mod.

Go as of version 1.20 supports appending errors by specifying
multiple "%w" formatters in the "fmt.Errorf"[^0] function.

[^0]: https://pkg.go.dev/fmt#Errorf

* feat: use errors.Join to combine multiple errors

As an update to the previous commit 59f084ea3be2e7ec9d912c1a311402b1e4c40df6,
use "errors.Join"[^0] instead of multiple "%w" formatters for "fmt.Errorf".

[^0]: https://pkg.go.dev/errors#Join

* chore: bring back unused util.go file as removing it is a breaking change
2025-11-29 11:37:42 -08:00
Harald Nordgren 085c3977cf fix linter issues 2025-11-09 16:54:45 +01:00
Dale Hui dfb273f3d1 Replace usage of deprecated docker types
This is a backwards incompatible change,
but there don't seem to be any public imports:
https://pkg.go.dev/github.com/golang-migrate/migrate/[email protected]/testing?tab=importedby
2025-08-19 14:03:55 -07:00
Jochen Schalanda 9f6cf253b6 fix(tests): fix Docker imports 2024-09-07 22:50:55 +02:00
Dale Hui 6808235a38 Use newer math/rand/v2 2024-09-06 23:32:35 -07:00
tsbkw b4a71d4096 fix: Conform to go test naming convention
As reported in #835 go vet reporting the violation of
naming convention of go test.
see: https://pkg.go.dev/testing#hdr-Examples

Although this project use golangci-lint as linter and
it has functionality to skip by nolint:govet, so basically
there is no problems.
However if there is no cons, it is better to conform with
naming convention and fix the code like below.
https://github.com/golang-migrate/migrate/blob/bc74a7acab43c182563b62cc6dbcf06e5f2cb6d2/dktesting/example_test.go#L17
2022-10-26 19:20:29 +09: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
Dale Hui 8bc2777f7e Update docker client usage with breaking change 2021-10-12 22:11:20 -07:00
Dale Hui 94dabb7021 Update golangci-lint to v1.20.0 2019-10-12 15:14:27 -07:00
Sebastiaan van StijnandDale Hui 1039d658e9 Docker: restore "from env" behavior, and perform API version negotiation (#270)
* NewDockerContainer: restore "from env" behavior

commit 7154264d4c replaced the deprecated
`dockerclient.NewEnvClient` with `dockerclient.NewClientWithOpts`, but
did not add the `FromEnv` option to keep  the old behavior.

Signed-off-by: Sebastiaan van Stijn <[email protected]>

* NewDockerContainer: use API version negotiation

This helps in situations where the daemon is older than
the API client. API version negotiation checks the maximum
supported API version by the daemon, and downgrades to that
API version if needed.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
2019-08-20 08:42:07 -07:00
Dale Hui cabafa01a7 Mark testing package as deprecated 2019-05-19 16:52:41 -07:00
Kirill MuratovandDale Hui 8afa5fa221 Enabled maligned, staticcheck and errcheck linters (#206)
* Enabled maligned check

* Enabled staticcheck

* Fixes for golint

* Enabled errcheck linter

* Added fixes for error check

* Added errcheck for tests

* Fixed test

* Increased golangci-lint deadline for travis

* Increased golangci-lint deadline for travis

* Decreased golangci-lint deadline for travis

* Revert for backward compatibility

* Using log.Println() instead of fmt.Println()

* Handling os.RemoveAll() errors

* Using t.Error(error) instead of t.Errorf("%v", err)

* Using t.Fatal(error) instead of t.Fatalf("%v", err)

* Using fmt.Sprint(sum) instead of t.Srintf("%v", sum)

* Refactoring

* Revert for backward compatibility

* Revert

* go mod tidy

* Added error logging

* Added error logging

* Added error handling

* Added error handling

* Added error logging

* Fix error logging

* Added error handling

* Fix

* Added logging for migr.Buffer()

* Fixes

* Firebird test disabled

* Fixed nolint comment

* Updated firebird docker image version

* Disabled test for firebird 2.5

* Fixed // nolint
2019-04-26 15:47:16 -07:00
Dale Hui edfd671802 Update golangci-lint config and implore contributors to use it
- Run golangci-lint on tests and fix found issues
2019-03-28 18:55:12 -07:00
Kirill Muratov 7154264d4c Fixed dockerclient.NewEnvClient is depricated 2019-03-22 22:47:24 +03:00
Dale Hui 18e785b618 Fix memory leak in tests
- Stop leaking tickers. As the docs state, using time.Tick() will leak tickers,
      so use time.NewTicker() with time.Ticker.Stop().
    - Be more efficient by using time.NewTimer() with time.Timer.Stop() instead of time.After().
2019-01-05 13:52:25 -08:00
Dale Hui c132bcc59f Remove unused invalid formatter 2018-01-21 02:04:36 -08:00
Dale Hui 80123f06de Remove redundant delay since the readyFn is sufficient 2018-01-20 00:11:35 -08:00
Dale Hui ab3ae8d9a7 Update all *DockerContainer receivers to handle nil
- Use errors.New() instead of fmt.Errorf() if no formatter string is needed
    - Spacing changes due to `go fmt`
2018-01-19 14:22:55 -08:00
Taylor Wrobel a4e14ee57e Merge port mapping helper functions into one 2017-07-07 23:12:07 -07:00
Taylor Wrobel 849e16ee0a Support running docker with commands and handling multiple exposed ports
Adds the ability to specify a series of commands to run as part
of the docker image execution, and allows for retrieving a mapping
of an exposed via the port bound within the container.
2017-07-07 23:12:07 -07:00
Jolan Malassigne 9394549cf4 add cassandra driver and function to retrieve networkSettings to get port bound to 9042 2017-05-31 10:05:56 +02:00
Matthias Kadenbach 54bd45727f add mysql driver, add ENV to docker containers 2017-02-28 15:10:56 -08:00
Matthias Kadenbach 3f0ef8a7f8 add comment 2017-02-16 11:18:02 -08:00
Matthias Kadenbach 3761178d4f add example for parallelTest 2017-02-09 19:52:50 -08:00
Matthias Kadenbach 3cc548ba2a fixing travis 2017-02-08 01:49:57 -08:00
Matthias Kadenbach b3f9ba012e initial version 3.0.0 preview
hard work
2017-02-07 22:01:29 -08:00