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]>
* 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]>
* 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
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.
* 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]>
- 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().
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.