From b17b9d24c6bcf6d75c2709237bc4394bd6d8e993 Mon Sep 17 00:00:00 2001 From: Martin Englund Date: Tue, 6 Feb 2024 13:28:49 -0800 Subject: [PATCH] docs: use defer instead of os.Exit(m.Run()) as of go1.15 `testing.M` returns the return code of `m.Run()`, so it is possible to use `defer` https://github.com/golang/go/issues/34129 --- README.md | 13 +++++----- docker/auth.go | 2 +- docker/change.go | 2 +- docker/client.go | 2 +- docker/client_unix.go | 2 +- docker/client_windows.go | 2 +- docker/container.go | 2 +- docker/distribution.go | 2 +- docker/env.go | 2 +- docker/event.go | 2 +- docker/exec.go | 2 +- docker/image.go | 2 +- docker/misc.go | 4 ++-- docker/network.go | 2 +- docker/opts/env.go | 2 +- docker/opts/hosts.go | 2 +- docker/opts/hosts_unix.go | 2 +- docker/opts/hosts_windows.go | 2 +- docker/opts/ip.go | 2 +- docker/opts/opts.go | 2 +- docker/opts/opts_unix.go | 2 +- docker/opts/opts_windows.go | 2 +- docker/opts/quotedstring.go | 2 +- docker/opts/runtime.go | 2 +- docker/opts/ulimit.go | 2 +- docker/pkg/archive/archive.go | 15 ++++++------ docker/pkg/archive/archive_linux.go | 5 ++-- docker/pkg/archive/archive_other.go | 2 +- docker/pkg/archive/archive_unix.go | 5 ++-- docker/pkg/archive/archive_windows.go | 4 ++-- docker/pkg/archive/changes.go | 5 ++-- docker/pkg/archive/changes_linux.go | 5 ++-- docker/pkg/archive/changes_other.go | 2 +- docker/pkg/archive/changes_unix.go | 5 ++-- docker/pkg/archive/changes_windows.go | 2 +- docker/pkg/archive/copy.go | 5 ++-- docker/pkg/archive/copy_unix.go | 2 +- docker/pkg/archive/copy_windows.go | 2 +- docker/pkg/archive/diff.go | 5 ++-- docker/pkg/archive/example_changes.go | 5 ++-- docker/pkg/archive/time_linux.go | 2 +- docker/pkg/archive/time_unsupported.go | 2 +- docker/pkg/archive/whiteouts.go | 2 +- docker/pkg/archive/wrap.go | 2 +- docker/pkg/fileutils/fileutils.go | 2 +- docker/pkg/fileutils/fileutils_darwin.go | 2 +- docker/pkg/fileutils/fileutils_unix.go | 2 +- docker/pkg/fileutils/fileutils_windows.go | 2 +- docker/pkg/homedir/homedir_linux.go | 2 +- docker/pkg/homedir/homedir_others.go | 2 +- docker/pkg/homedir/homedir_unix.go | 2 +- docker/pkg/homedir/homedir_windows.go | 2 +- docker/pkg/idtools/idtools.go | 2 +- docker/pkg/idtools/idtools_unix.go | 3 ++- docker/pkg/idtools/idtools_windows.go | 2 +- docker/pkg/idtools/usergroupadd_linux.go | 2 +- .../pkg/idtools/usergroupadd_unsupported.go | 2 +- docker/pkg/idtools/utils_unix.go | 6 ++--- docker/pkg/ioutils/buffer.go | 2 +- docker/pkg/ioutils/bytespipe.go | 2 +- docker/pkg/ioutils/fswriters.go | 2 +- docker/pkg/ioutils/readers.go | 2 +- docker/pkg/ioutils/temp_unix.go | 2 +- docker/pkg/ioutils/temp_windows.go | 2 +- docker/pkg/ioutils/writeflusher.go | 2 +- docker/pkg/ioutils/writers.go | 2 +- docker/pkg/jsonmessage/jsonmessage.go | 10 ++++---- docker/pkg/longpath/longpath.go | 2 +- docker/pkg/mount/flags.go | 2 +- docker/pkg/mount/flags_freebsd.go | 2 +- docker/pkg/mount/flags_linux.go | 2 +- docker/pkg/mount/flags_unsupported.go | 2 +- docker/pkg/mount/mount.go | 3 +-- docker/pkg/mount/mounter_freebsd.go | 2 +- docker/pkg/mount/mounter_linux.go | 2 +- docker/pkg/mount/mounter_unsupported.go | 2 +- docker/pkg/mount/mountinfo.go | 2 +- docker/pkg/mount/mountinfo_freebsd.go | 2 +- docker/pkg/mount/mountinfo_linux.go | 2 +- docker/pkg/mount/mountinfo_unsupported.go | 2 +- docker/pkg/mount/mountinfo_windows.go | 2 +- docker/pkg/mount/sharedsubtree_linux.go | 2 +- docker/pkg/pools/pools.go | 2 +- docker/pkg/stdcopy/stdcopy.go | 2 +- docker/pkg/system/chtimes.go | 2 +- docker/pkg/system/chtimes_unix.go | 2 +- docker/pkg/system/chtimes_windows.go | 2 +- docker/pkg/system/errors.go | 2 +- docker/pkg/system/exitcode.go | 2 +- docker/pkg/system/filesys.go | 2 +- docker/pkg/system/filesys_windows.go | 4 ++-- docker/pkg/system/init.go | 2 +- docker/pkg/system/init_unix.go | 2 +- docker/pkg/system/init_windows.go | 2 +- docker/pkg/system/lcow.go | 2 +- docker/pkg/system/lcow_unix.go | 2 +- docker/pkg/system/lcow_windows.go | 2 +- docker/pkg/system/lstat_unix.go | 2 +- docker/pkg/system/lstat_windows.go | 2 +- docker/pkg/system/meminfo.go | 2 +- docker/pkg/system/meminfo_linux.go | 2 +- docker/pkg/system/meminfo_unsupported.go | 2 +- docker/pkg/system/meminfo_windows.go | 2 +- docker/pkg/system/mknod.go | 2 +- docker/pkg/system/mknod_freebsd.go | 2 +- docker/pkg/system/mknod_windows.go | 2 +- docker/pkg/system/path.go | 2 +- docker/pkg/system/process_unix.go | 2 +- docker/pkg/system/process_windows.go | 2 +- docker/pkg/system/rm.go | 2 +- docker/pkg/system/stat_darwin.go | 2 +- docker/pkg/system/stat_freebsd.go | 2 +- docker/pkg/system/stat_linux.go | 2 +- docker/pkg/system/stat_openbsd.go | 2 +- docker/pkg/system/stat_solaris.go | 2 +- docker/pkg/system/stat_unix.go | 2 +- docker/pkg/system/stat_windows.go | 2 +- docker/pkg/system/syscall_unix.go | 2 +- docker/pkg/system/syscall_windows.go | 2 +- docker/pkg/system/umask.go | 2 +- docker/pkg/system/umask_windows.go | 2 +- docker/pkg/system/utimes_freebsd.go | 2 +- docker/pkg/system/utimes_linux.go | 2 +- docker/pkg/system/utimes_unsupported.go | 2 +- docker/pkg/system/xattrs_linux.go | 2 +- docker/pkg/system/xattrs_unsupported.go | 2 +- docker/plugin.go | 2 +- docker/signal.go | 2 +- docker/tar.go | 2 +- docker/tls.go | 2 +- docker/types/auth.go | 2 +- docker/types/blkiodev/blkio.go | 2 +- docker/types/client.go | 3 ++- docker/types/configs.go | 2 +- docker/types/container/config.go | 3 ++- docker/types/container/container_changes.go | 2 +- docker/types/container/container_create.go | 2 +- docker/types/container/container_top.go | 2 +- docker/types/container/container_update.go | 2 +- docker/types/container/container_wait.go | 2 +- docker/types/container/host_config.go | 3 ++- docker/types/container/hostconfig_unix.go | 2 +- docker/types/container/hostconfig_windows.go | 2 +- docker/types/container/waitcondition.go | 2 +- docker/types/error_response.go | 2 +- docker/types/filters/example_test.go | 2 +- docker/types/filters/parse.go | 8 +++---- docker/types/filters/parse_test.go | 2 +- docker/types/graph_driver_data.go | 2 +- docker/types/id_response.go | 2 +- docker/types/image_delete_response_item.go | 2 +- docker/types/image_summary.go | 2 +- docker/types/mount/mount.go | 2 +- docker/types/network/network.go | 4 ++-- docker/types/plugin.go | 2 +- docker/types/plugin_device.go | 2 +- docker/types/plugin_env.go | 2 +- docker/types/plugin_interface_type.go | 2 +- docker/types/plugin_mount.go | 2 +- docker/types/plugin_responses.go | 2 +- docker/types/port.go | 2 +- docker/types/registry/authenticate.go | 2 +- docker/types/registry/registry.go | 2 +- docker/types/seccomp.go | 2 +- docker/types/service_update_response.go | 2 +- docker/types/stats.go | 2 +- docker/types/strslice/strslice.go | 2 +- docker/types/strslice/strslice_test.go | 2 +- docker/types/types.go | 7 +++--- docker/types/versions/compare.go | 2 +- docker/types/versions/compare_test.go | 2 +- docker/types/versions/v1p19/types.go | 3 ++- docker/types/versions/v1p20/types.go | 3 ++- docker/types/volume.go | 2 +- docker/volume.go | 2 +- dockertest.go | 3 ++- dockertest_test.go | 5 ++-- examples/FakeGoogleCloudStorage.md | 3 +-- examples/MongoDB.md | 24 +++++++++---------- examples/Mountebank.md | 14 +++++------ examples/PostgreSQL.md | 14 +++++------ 181 files changed, 258 insertions(+), 241 deletions(-) diff --git a/README.md b/README.md index a3b88515..a24b1798 100644 --- a/README.md +++ b/README.md @@ -100,14 +100,15 @@ func TestMain(m *testing.M) { log.Fatalf("Could not connect to database: %s", err) } - code := m.Run() + // as of go1.15 testing.M returns the exit code of m.Run(), so it is safe to use defer here + defer func() { + if err := pool.Purge(resource); err != nil { + log.Fatalf("Could not purge resource: %s", err) + } - // You can't defer this because os.Exit doesn't care for defer - if err := pool.Purge(resource); err != nil { - log.Fatalf("Could not purge resource: %s", err) - } + }() - os.Exit(code) + m.Run() } func TestSomething(t *testing.T) { diff --git a/docker/auth.go b/docker/auth.go index baa32d9f..0a7a1aa9 100644 --- a/docker/auth.go +++ b/docker/auth.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2015 go-dockerclient authors. All rights reserved. diff --git a/docker/change.go b/docker/change.go index afef3551..eb806dd5 100644 --- a/docker/change.go +++ b/docker/change.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2014 go-dockerclient authors. All rights reserved. diff --git a/docker/client.go b/docker/client.go index 4a6fdadc..6a79b4e7 100644 --- a/docker/client.go +++ b/docker/client.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2013 go-dockerclient authors. All rights reserved. diff --git a/docker/client_unix.go b/docker/client_unix.go index 2a9cbe8d..3a9d24a5 100644 --- a/docker/client_unix.go +++ b/docker/client_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2016 go-dockerclient authors. All rights reserved. diff --git a/docker/client_windows.go b/docker/client_windows.go index 162e0efc..eadb495f 100644 --- a/docker/client_windows.go +++ b/docker/client_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2016 go-dockerclient authors. All rights reserved. diff --git a/docker/container.go b/docker/container.go index 8b62f763..0d7d3fe7 100644 --- a/docker/container.go +++ b/docker/container.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2013 go-dockerclient authors. All rights reserved. diff --git a/docker/distribution.go b/docker/distribution.go index bf2a07b5..3e610302 100644 --- a/docker/distribution.go +++ b/docker/distribution.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2017 go-dockerclient authors. All rights reserved. diff --git a/docker/env.go b/docker/env.go index db53bbb3..b5c9edd3 100644 --- a/docker/env.go +++ b/docker/env.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2014 Docker authors. All rights reserved. diff --git a/docker/event.go b/docker/event.go index 895b2cc4..982ca1b2 100644 --- a/docker/event.go +++ b/docker/event.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2014 go-dockerclient authors. All rights reserved. diff --git a/docker/exec.go b/docker/exec.go index 9351dfda..1efdfd21 100644 --- a/docker/exec.go +++ b/docker/exec.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2014 go-dockerclient authors. All rights reserved. diff --git a/docker/image.go b/docker/image.go index f5da78ef..f980dc57 100644 --- a/docker/image.go +++ b/docker/image.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2013 go-dockerclient authors. All rights reserved. diff --git a/docker/misc.go b/docker/misc.go index a77aef6c..79731512 100644 --- a/docker/misc.go +++ b/docker/misc.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2013 go-dockerclient authors. All rights reserved. @@ -85,7 +85,7 @@ type DockerInfo struct { InitBinary string DefaultRuntime string LiveRestoreEnabled bool - //Swarm swarm.Info + // Swarm swarm.Info } // PluginsInfo is a struct with the plugins registered with the docker daemon diff --git a/docker/network.go b/docker/network.go index 530e957b..1d7c1009 100644 --- a/docker/network.go +++ b/docker/network.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2015 go-dockerclient authors. All rights reserved. diff --git a/docker/opts/env.go b/docker/opts/env.go index 9c257593..74101f4a 100644 --- a/docker/opts/env.go +++ b/docker/opts/env.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package opts diff --git a/docker/opts/hosts.go b/docker/opts/hosts.go index ff126e0d..36554e45 100644 --- a/docker/opts/hosts.go +++ b/docker/opts/hosts.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package opts diff --git a/docker/opts/hosts_unix.go b/docker/opts/hosts_unix.go index 488f324f..2ce2e6de 100644 --- a/docker/opts/hosts_unix.go +++ b/docker/opts/hosts_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows diff --git a/docker/opts/hosts_windows.go b/docker/opts/hosts_windows.go index e174a41e..f69da848 100644 --- a/docker/opts/hosts_windows.go +++ b/docker/opts/hosts_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package opts diff --git a/docker/opts/ip.go b/docker/opts/ip.go index 9b6b4bb3..3746c5da 100644 --- a/docker/opts/ip.go +++ b/docker/opts/ip.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package opts diff --git a/docker/opts/opts.go b/docker/opts/opts.go index 6fc1be92..99e1b40c 100644 --- a/docker/opts/opts.go +++ b/docker/opts/opts.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package opts diff --git a/docker/opts/opts_unix.go b/docker/opts/opts_unix.go index 37f90545..2dac59ba 100644 --- a/docker/opts/opts_unix.go +++ b/docker/opts/opts_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows diff --git a/docker/opts/opts_windows.go b/docker/opts/opts_windows.go index 85191efc..df4ee7b3 100644 --- a/docker/opts/opts_windows.go +++ b/docker/opts/opts_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package opts diff --git a/docker/opts/quotedstring.go b/docker/opts/quotedstring.go index 2fecdf3e..17957ea0 100644 --- a/docker/opts/quotedstring.go +++ b/docker/opts/quotedstring.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package opts diff --git a/docker/opts/runtime.go b/docker/opts/runtime.go index cd1d76b0..db6e9b77 100644 --- a/docker/opts/runtime.go +++ b/docker/opts/runtime.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package opts diff --git a/docker/opts/ulimit.go b/docker/opts/ulimit.go index 985b10dc..5161f002 100644 --- a/docker/opts/ulimit.go +++ b/docker/opts/ulimit.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package opts diff --git a/docker/pkg/archive/archive.go b/docker/pkg/archive/archive.go index aa4bcc42..fa78bb83 100644 --- a/docker/pkg/archive/archive.go +++ b/docker/pkg/archive/archive.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package archive // import "github.com/ory/dockertest/v3/docker/pkg/archive" @@ -21,12 +21,13 @@ import ( "strings" "syscall" + "github.com/sirupsen/logrus" + "github.com/ory/dockertest/v3/docker/pkg/fileutils" "github.com/ory/dockertest/v3/docker/pkg/idtools" "github.com/ory/dockertest/v3/docker/pkg/ioutils" "github.com/ory/dockertest/v3/docker/pkg/pools" "github.com/ory/dockertest/v3/docker/pkg/system" - "github.com/sirupsen/logrus" ) var unpigzPath string @@ -499,13 +500,13 @@ func (ta *tarAppender) addTarFile(path, name string) error { } } - //check whether the file is overlayfs whiteout - //if yes, skip re-mapping container ID mappings. + // check whether the file is overlayfs whiteout + // if yes, skip re-mapping container ID mappings. isOverlayWhiteout := fi.Mode()&os.ModeCharDevice != 0 && hdr.Devmajor == 0 && hdr.Devminor == 0 - //handle re-mapping container ID mappings back to host ID mappings before - //writing tar headers/files. We skip whiteout files because they were written - //by the kernel and already have proper ownership relative to the host + // handle re-mapping container ID mappings back to host ID mappings before + // writing tar headers/files. We skip whiteout files because they were written + // by the kernel and already have proper ownership relative to the host if !isOverlayWhiteout && !strings.HasPrefix(filepath.Base(hdr.Name), WhiteoutPrefix) && !ta.IDMappings.Empty() { diff --git a/docker/pkg/archive/archive_linux.go b/docker/pkg/archive/archive_linux.go index 2f2c4faa..bba5a267 100644 --- a/docker/pkg/archive/archive_linux.go +++ b/docker/pkg/archive/archive_linux.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package archive // import "github.com/ory/dockertest/v3/docker/pkg/archive" @@ -9,8 +9,9 @@ import ( "path/filepath" "strings" - "github.com/ory/dockertest/v3/docker/pkg/system" "golang.org/x/sys/unix" + + "github.com/ory/dockertest/v3/docker/pkg/system" ) func getWhiteoutConverter(format WhiteoutFormat) tarWhiteoutConverter { diff --git a/docker/pkg/archive/archive_other.go b/docker/pkg/archive/archive_other.go index 8fd78eea..758d27c4 100644 --- a/docker/pkg/archive/archive_other.go +++ b/docker/pkg/archive/archive_other.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !linux diff --git a/docker/pkg/archive/archive_unix.go b/docker/pkg/archive/archive_unix.go index 68290806..a81dfd84 100644 --- a/docker/pkg/archive/archive_unix.go +++ b/docker/pkg/archive/archive_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows @@ -15,9 +15,10 @@ import ( "path/filepath" "syscall" + "golang.org/x/sys/unix" + "github.com/ory/dockertest/v3/docker/pkg/idtools" "github.com/ory/dockertest/v3/docker/pkg/system" - "golang.org/x/sys/unix" ) // fixVolumePathPrefix does platform specific processing to ensure that if diff --git a/docker/pkg/archive/archive_windows.go b/docker/pkg/archive/archive_windows.go index d6a44540..d318da3b 100644 --- a/docker/pkg/archive/archive_windows.go +++ b/docker/pkg/archive/archive_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package archive // import "github.com/ory/dockertest/v3/docker/pkg/archive" @@ -44,7 +44,7 @@ func CanonicalTarNameForPath(p string) (string, error) { // chmodTarEntry is used to adjust the file permissions used in tar header based // on the platform the archival is done. func chmodTarEntry(perm os.FileMode) os.FileMode { - //perm &= 0755 // this 0-ed out tar flags (like link, regular file, directory marker etc.) + // perm &= 0755 // this 0-ed out tar flags (like link, regular file, directory marker etc.) permPart := perm & os.ModePerm noPermPart := perm &^ os.ModePerm // Add the x bit: make everything +x from windows diff --git a/docker/pkg/archive/changes.go b/docker/pkg/archive/changes.go index bc66a10e..0f60649b 100644 --- a/docker/pkg/archive/changes.go +++ b/docker/pkg/archive/changes.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package archive // import "github.com/ory/dockertest/v3/docker/pkg/archive" @@ -16,10 +16,11 @@ import ( "syscall" "time" + "github.com/sirupsen/logrus" + "github.com/ory/dockertest/v3/docker/pkg/idtools" "github.com/ory/dockertest/v3/docker/pkg/pools" "github.com/ory/dockertest/v3/docker/pkg/system" - "github.com/sirupsen/logrus" ) // ChangeType represents the change type. diff --git a/docker/pkg/archive/changes_linux.go b/docker/pkg/archive/changes_linux.go index 9c06b8e9..edb5f49a 100644 --- a/docker/pkg/archive/changes_linux.go +++ b/docker/pkg/archive/changes_linux.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package archive // import "github.com/ory/dockertest/v3/docker/pkg/archive" @@ -12,8 +12,9 @@ import ( "syscall" "unsafe" - "github.com/ory/dockertest/v3/docker/pkg/system" "golang.org/x/sys/unix" + + "github.com/ory/dockertest/v3/docker/pkg/system" ) // walker is used to implement collectFileInfoForChanges on linux. Where this diff --git a/docker/pkg/archive/changes_other.go b/docker/pkg/archive/changes_other.go index b16f06b2..0833fe67 100644 --- a/docker/pkg/archive/changes_other.go +++ b/docker/pkg/archive/changes_other.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !linux diff --git a/docker/pkg/archive/changes_unix.go b/docker/pkg/archive/changes_unix.go index e058c545..b536f5a4 100644 --- a/docker/pkg/archive/changes_unix.go +++ b/docker/pkg/archive/changes_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows @@ -10,8 +10,9 @@ import ( "os" "syscall" - "github.com/ory/dockertest/v3/docker/pkg/system" "golang.org/x/sys/unix" + + "github.com/ory/dockertest/v3/docker/pkg/system" ) func statDifferent(oldStat *system.StatT, newStat *system.StatT) bool { diff --git a/docker/pkg/archive/changes_windows.go b/docker/pkg/archive/changes_windows.go index 3f061121..e151579d 100644 --- a/docker/pkg/archive/changes_windows.go +++ b/docker/pkg/archive/changes_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package archive // import "github.com/ory/dockertest/v3/docker/pkg/archive" diff --git a/docker/pkg/archive/copy.go b/docker/pkg/archive/copy.go index ff792ae4..a0fe8768 100644 --- a/docker/pkg/archive/copy.go +++ b/docker/pkg/archive/copy.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package archive // import "github.com/ory/dockertest/v3/docker/pkg/archive" @@ -12,8 +12,9 @@ import ( "path/filepath" "strings" - "github.com/ory/dockertest/v3/docker/pkg/system" "github.com/sirupsen/logrus" + + "github.com/ory/dockertest/v3/docker/pkg/system" ) // Errors used or returned by this file. diff --git a/docker/pkg/archive/copy_unix.go b/docker/pkg/archive/copy_unix.go index 15d5d3c6..197df99b 100644 --- a/docker/pkg/archive/copy_unix.go +++ b/docker/pkg/archive/copy_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows diff --git a/docker/pkg/archive/copy_windows.go b/docker/pkg/archive/copy_windows.go index 421c3233..40a86ef5 100644 --- a/docker/pkg/archive/copy_windows.go +++ b/docker/pkg/archive/copy_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package archive // import "github.com/ory/dockertest/v3/docker/pkg/archive" diff --git a/docker/pkg/archive/diff.go b/docker/pkg/archive/diff.go index 01cbb26f..6c8b9cb5 100644 --- a/docker/pkg/archive/diff.go +++ b/docker/pkg/archive/diff.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package archive // import "github.com/ory/dockertest/v3/docker/pkg/archive" @@ -13,10 +13,11 @@ import ( "runtime" "strings" + "github.com/sirupsen/logrus" + "github.com/ory/dockertest/v3/docker/pkg/idtools" "github.com/ory/dockertest/v3/docker/pkg/pools" "github.com/ory/dockertest/v3/docker/pkg/system" - "github.com/sirupsen/logrus" ) // UnpackLayer unpack `layer` to a `dest`. The stream `layer` can be diff --git a/docker/pkg/archive/example_changes.go b/docker/pkg/archive/example_changes.go index 8dc77f96..ef22c5f4 100644 --- a/docker/pkg/archive/example_changes.go +++ b/docker/pkg/archive/example_changes.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build ignore @@ -17,8 +17,9 @@ import ( "os" "path" - "github.com/ory/dockertest/v3/docker/pkg/archive" "github.com/sirupsen/logrus" + + "github.com/ory/dockertest/v3/docker/pkg/archive" ) var ( diff --git a/docker/pkg/archive/time_linux.go b/docker/pkg/archive/time_linux.go index e817faab..1a83d4a6 100644 --- a/docker/pkg/archive/time_linux.go +++ b/docker/pkg/archive/time_linux.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package archive // import "github.com/ory/dockertest/v3/docker/pkg/archive" diff --git a/docker/pkg/archive/time_unsupported.go b/docker/pkg/archive/time_unsupported.go index d5887d21..071147ad 100644 --- a/docker/pkg/archive/time_unsupported.go +++ b/docker/pkg/archive/time_unsupported.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !linux diff --git a/docker/pkg/archive/whiteouts.go b/docker/pkg/archive/whiteouts.go index cdc11d97..6de59297 100644 --- a/docker/pkg/archive/whiteouts.go +++ b/docker/pkg/archive/whiteouts.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package archive // import "github.com/ory/dockertest/v3/docker/pkg/archive" diff --git a/docker/pkg/archive/wrap.go b/docker/pkg/archive/wrap.go index 7244e266..48d04ef7 100644 --- a/docker/pkg/archive/wrap.go +++ b/docker/pkg/archive/wrap.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package archive // import "github.com/ory/dockertest/v3/docker/pkg/archive" diff --git a/docker/pkg/fileutils/fileutils.go b/docker/pkg/fileutils/fileutils.go index 85e5e2fc..02032bf9 100644 --- a/docker/pkg/fileutils/fileutils.go +++ b/docker/pkg/fileutils/fileutils.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package fileutils // import "github.com/ory/dockertest/v3/docker/pkg/fileutils" diff --git a/docker/pkg/fileutils/fileutils_darwin.go b/docker/pkg/fileutils/fileutils_darwin.go index 8e56289a..7a948e68 100644 --- a/docker/pkg/fileutils/fileutils_darwin.go +++ b/docker/pkg/fileutils/fileutils_darwin.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package fileutils // import "github.com/ory/dockertest/v3/docker/pkg/fileutils" diff --git a/docker/pkg/fileutils/fileutils_unix.go b/docker/pkg/fileutils/fileutils_unix.go index e2200eff..13f767af 100644 --- a/docker/pkg/fileutils/fileutils_unix.go +++ b/docker/pkg/fileutils/fileutils_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build linux || freebsd diff --git a/docker/pkg/fileutils/fileutils_windows.go b/docker/pkg/fileutils/fileutils_windows.go index 11830fe9..f0f8cc42 100644 --- a/docker/pkg/fileutils/fileutils_windows.go +++ b/docker/pkg/fileutils/fileutils_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package fileutils // import "github.com/ory/dockertest/v3/docker/pkg/fileutils" diff --git a/docker/pkg/homedir/homedir_linux.go b/docker/pkg/homedir/homedir_linux.go index 0df52c09..76e866fd 100644 --- a/docker/pkg/homedir/homedir_linux.go +++ b/docker/pkg/homedir/homedir_linux.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package homedir // import "github.com/ory/dockertest/v3/docker/pkg/homedir" diff --git a/docker/pkg/homedir/homedir_others.go b/docker/pkg/homedir/homedir_others.go index f2a28fea..051f896c 100644 --- a/docker/pkg/homedir/homedir_others.go +++ b/docker/pkg/homedir/homedir_others.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !linux diff --git a/docker/pkg/homedir/homedir_unix.go b/docker/pkg/homedir/homedir_unix.go index 02066f27..68f44002 100644 --- a/docker/pkg/homedir/homedir_unix.go +++ b/docker/pkg/homedir/homedir_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows diff --git a/docker/pkg/homedir/homedir_windows.go b/docker/pkg/homedir/homedir_windows.go index 61c8ad93..23f681bb 100644 --- a/docker/pkg/homedir/homedir_windows.go +++ b/docker/pkg/homedir/homedir_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package homedir // import "github.com/ory/dockertest/v3/docker/pkg/homedir" diff --git a/docker/pkg/idtools/idtools.go b/docker/pkg/idtools/idtools.go index 700a2f94..9cefe67b 100644 --- a/docker/pkg/idtools/idtools.go +++ b/docker/pkg/idtools/idtools.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package idtools // import "github.com/ory/dockertest/v3/docker/pkg/idtools" diff --git a/docker/pkg/idtools/idtools_unix.go b/docker/pkg/idtools/idtools_unix.go index e6742049..256b5f9b 100644 --- a/docker/pkg/idtools/idtools_unix.go +++ b/docker/pkg/idtools/idtools_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows @@ -17,6 +17,7 @@ import ( "syscall" "github.com/opencontainers/runc/libcontainer/user" + "github.com/ory/dockertest/v3/docker/pkg/system" ) diff --git a/docker/pkg/idtools/idtools_windows.go b/docker/pkg/idtools/idtools_windows.go index 4dd8dabc..8a6458fa 100644 --- a/docker/pkg/idtools/idtools_windows.go +++ b/docker/pkg/idtools/idtools_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package idtools // import "github.com/ory/dockertest/v3/docker/pkg/idtools" diff --git a/docker/pkg/idtools/usergroupadd_linux.go b/docker/pkg/idtools/usergroupadd_linux.go index c26f5cb7..505ccd29 100644 --- a/docker/pkg/idtools/usergroupadd_linux.go +++ b/docker/pkg/idtools/usergroupadd_linux.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package idtools // import "github.com/ory/dockertest/v3/docker/pkg/idtools" diff --git a/docker/pkg/idtools/usergroupadd_unsupported.go b/docker/pkg/idtools/usergroupadd_unsupported.go index cf6cf402..65fb83c9 100644 --- a/docker/pkg/idtools/usergroupadd_unsupported.go +++ b/docker/pkg/idtools/usergroupadd_unsupported.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !linux diff --git a/docker/pkg/idtools/utils_unix.go b/docker/pkg/idtools/utils_unix.go index f5488140..96c8921a 100644 --- a/docker/pkg/idtools/utils_unix.go +++ b/docker/pkg/idtools/utils_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows @@ -22,8 +22,8 @@ func resolveBinary(binname string) (string, error) { if err != nil { return "", err } - //only return no error if the final resolved binary basename - //matches what was searched for + // only return no error if the final resolved binary basename + // matches what was searched for if filepath.Base(resolvedPath) == binname { return resolvedPath, nil } diff --git a/docker/pkg/ioutils/buffer.go b/docker/pkg/ioutils/buffer.go index cd73b61d..52257525 100644 --- a/docker/pkg/ioutils/buffer.go +++ b/docker/pkg/ioutils/buffer.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package ioutils // import "github.com/ory/dockertest/v3/docker/pkg/ioutils" diff --git a/docker/pkg/ioutils/bytespipe.go b/docker/pkg/ioutils/bytespipe.go index 42e8fab3..e2ba15e7 100644 --- a/docker/pkg/ioutils/bytespipe.go +++ b/docker/pkg/ioutils/bytespipe.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package ioutils // import "github.com/ory/dockertest/v3/docker/pkg/ioutils" diff --git a/docker/pkg/ioutils/fswriters.go b/docker/pkg/ioutils/fswriters.go index 851280f6..326ce80b 100644 --- a/docker/pkg/ioutils/fswriters.go +++ b/docker/pkg/ioutils/fswriters.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package ioutils // import "github.com/ory/dockertest/v3/docker/pkg/ioutils" diff --git a/docker/pkg/ioutils/readers.go b/docker/pkg/ioutils/readers.go index 970354ec..79178afa 100644 --- a/docker/pkg/ioutils/readers.go +++ b/docker/pkg/ioutils/readers.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package ioutils // import "github.com/ory/dockertest/v3/docker/pkg/ioutils" diff --git a/docker/pkg/ioutils/temp_unix.go b/docker/pkg/ioutils/temp_unix.go index 80da9013..09d553d6 100644 --- a/docker/pkg/ioutils/temp_unix.go +++ b/docker/pkg/ioutils/temp_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows diff --git a/docker/pkg/ioutils/temp_windows.go b/docker/pkg/ioutils/temp_windows.go index e5f0899f..c99a9be8 100644 --- a/docker/pkg/ioutils/temp_windows.go +++ b/docker/pkg/ioutils/temp_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package ioutils // import "github.com/ory/dockertest/v3/docker/pkg/ioutils" diff --git a/docker/pkg/ioutils/writeflusher.go b/docker/pkg/ioutils/writeflusher.go index 07b393c1..0ad74ee1 100644 --- a/docker/pkg/ioutils/writeflusher.go +++ b/docker/pkg/ioutils/writeflusher.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package ioutils // import "github.com/ory/dockertest/v3/docker/pkg/ioutils" diff --git a/docker/pkg/ioutils/writers.go b/docker/pkg/ioutils/writers.go index ddaca87e..e60fdbc9 100644 --- a/docker/pkg/ioutils/writers.go +++ b/docker/pkg/ioutils/writers.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package ioutils // import "github.com/ory/dockertest/v3/docker/pkg/ioutils" diff --git a/docker/pkg/jsonmessage/jsonmessage.go b/docker/pkg/jsonmessage/jsonmessage.go index eb94cdf3..12ba4a41 100644 --- a/docker/pkg/jsonmessage/jsonmessage.go +++ b/docker/pkg/jsonmessage/jsonmessage.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package jsonmessage // import "github.com/ory/dockertest/v3/docker/pkg/jsonmessage" @@ -143,13 +143,13 @@ type JSONMessage struct { Stream string `json:"stream,omitempty"` Status string `json:"status,omitempty"` Progress *JSONProgress `json:"progressDetail,omitempty"` - ProgressMessage string `json:"progress,omitempty"` //deprecated + ProgressMessage string `json:"progress,omitempty"` // deprecated ID string `json:"id,omitempty"` From string `json:"from,omitempty"` Time int64 `json:"time,omitempty"` TimeNano int64 `json:"timeNano,omitempty"` Error *JSONError `json:"errorDetail,omitempty"` - ErrorMessage string `json:"error,omitempty"` //deprecated + ErrorMessage string `json:"error,omitempty"` // deprecated // Aux contains out-of-band data, such as digests for push signing and image id after building. Aux *json.RawMessage `json:"aux,omitempty"` } @@ -219,7 +219,7 @@ func (jm *JSONMessage) Display(out io.Writer, termInfo termInfo) error { clearLine(out, termInfo) endl = "\r" fmt.Fprintf(out, endl) - } else if jm.Progress != nil && jm.Progress.String() != "" { //disable progressbar in non-terminal + } else if jm.Progress != nil && jm.Progress.String() != "" { // disable progressbar in non-terminal return nil } if jm.TimeNano != 0 { @@ -235,7 +235,7 @@ func (jm *JSONMessage) Display(out io.Writer, termInfo termInfo) error { } if jm.Progress != nil && termInfo != nil { fmt.Fprintf(out, "%s %s%s", jm.Status, jm.Progress.String(), endl) - } else if jm.ProgressMessage != "" { //deprecated + } else if jm.ProgressMessage != "" { // deprecated fmt.Fprintf(out, "%s %s%s", jm.Status, jm.ProgressMessage, endl) } else if jm.Stream != "" { fmt.Fprintf(out, "%s%s", jm.Stream, endl) diff --git a/docker/pkg/longpath/longpath.go b/docker/pkg/longpath/longpath.go index 3d205961..5889bab6 100644 --- a/docker/pkg/longpath/longpath.go +++ b/docker/pkg/longpath/longpath.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // longpath introduces some constants and helper functions for handling long paths diff --git a/docker/pkg/mount/flags.go b/docker/pkg/mount/flags.go index acda9461..5ef2a905 100644 --- a/docker/pkg/mount/flags.go +++ b/docker/pkg/mount/flags.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package mount // import "github.com/ory/dockertest/v3/docker/pkg/mount" diff --git a/docker/pkg/mount/flags_freebsd.go b/docker/pkg/mount/flags_freebsd.go index 3f0213bb..a25396e2 100644 --- a/docker/pkg/mount/flags_freebsd.go +++ b/docker/pkg/mount/flags_freebsd.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build freebsd && cgo diff --git a/docker/pkg/mount/flags_linux.go b/docker/pkg/mount/flags_linux.go index 3c779c01..8d109d85 100644 --- a/docker/pkg/mount/flags_linux.go +++ b/docker/pkg/mount/flags_linux.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package mount // import "github.com/ory/dockertest/v3/docker/pkg/mount" diff --git a/docker/pkg/mount/flags_unsupported.go b/docker/pkg/mount/flags_unsupported.go index 83700e8f..e1ead079 100644 --- a/docker/pkg/mount/flags_unsupported.go +++ b/docker/pkg/mount/flags_unsupported.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build (!linux && !freebsd) || (freebsd && !cgo) diff --git a/docker/pkg/mount/mount.go b/docker/pkg/mount/mount.go index 15fb5c8d..f4023bf1 100644 --- a/docker/pkg/mount/mount.go +++ b/docker/pkg/mount/mount.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package mount // import "github.com/ory/dockertest/v3/docker/pkg/mount" @@ -6,7 +6,6 @@ package mount // import "github.com/ory/dockertest/v3/docker/pkg/mount" import ( "sort" "strings" - "syscall" "github.com/sirupsen/logrus" diff --git a/docker/pkg/mount/mounter_freebsd.go b/docker/pkg/mount/mounter_freebsd.go index b3886213..608c2e68 100644 --- a/docker/pkg/mount/mounter_freebsd.go +++ b/docker/pkg/mount/mounter_freebsd.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package mount // import "github.com/ory/dockertest/v3/docker/pkg/mount" diff --git a/docker/pkg/mount/mounter_linux.go b/docker/pkg/mount/mounter_linux.go index c1754b9f..d4d90599 100644 --- a/docker/pkg/mount/mounter_linux.go +++ b/docker/pkg/mount/mounter_linux.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package mount // import "github.com/ory/dockertest/v3/docker/pkg/mount" diff --git a/docker/pkg/mount/mounter_unsupported.go b/docker/pkg/mount/mounter_unsupported.go index 984f55e9..fae753ce 100644 --- a/docker/pkg/mount/mounter_unsupported.go +++ b/docker/pkg/mount/mounter_unsupported.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build (!linux && !freebsd) || (freebsd && !cgo) diff --git a/docker/pkg/mount/mountinfo.go b/docker/pkg/mount/mountinfo.go index fda7e44d..f2bc773c 100644 --- a/docker/pkg/mount/mountinfo.go +++ b/docker/pkg/mount/mountinfo.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package mount // import "github.com/ory/dockertest/v3/docker/pkg/mount" diff --git a/docker/pkg/mount/mountinfo_freebsd.go b/docker/pkg/mount/mountinfo_freebsd.go index 0b0b2cbe..f9179844 100644 --- a/docker/pkg/mount/mountinfo_freebsd.go +++ b/docker/pkg/mount/mountinfo_freebsd.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package mount // import "github.com/ory/dockertest/v3/docker/pkg/mount" diff --git a/docker/pkg/mount/mountinfo_linux.go b/docker/pkg/mount/mountinfo_linux.go index b73433c7..67204bdf 100644 --- a/docker/pkg/mount/mountinfo_linux.go +++ b/docker/pkg/mount/mountinfo_linux.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package mount // import "github.com/ory/dockertest/v3/docker/pkg/mount" diff --git a/docker/pkg/mount/mountinfo_unsupported.go b/docker/pkg/mount/mountinfo_unsupported.go index ecea6269..e88bbb46 100644 --- a/docker/pkg/mount/mountinfo_unsupported.go +++ b/docker/pkg/mount/mountinfo_unsupported.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build (!windows && !linux && !freebsd) || (freebsd && !cgo) diff --git a/docker/pkg/mount/mountinfo_windows.go b/docker/pkg/mount/mountinfo_windows.go index b6b679a1..cb1e9cef 100644 --- a/docker/pkg/mount/mountinfo_windows.go +++ b/docker/pkg/mount/mountinfo_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package mount // import "github.com/ory/dockertest/v3/docker/pkg/mount" diff --git a/docker/pkg/mount/sharedsubtree_linux.go b/docker/pkg/mount/sharedsubtree_linux.go index bea9f998..10fdce6c 100644 --- a/docker/pkg/mount/sharedsubtree_linux.go +++ b/docker/pkg/mount/sharedsubtree_linux.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package mount // import "github.com/ory/dockertest/v3/docker/pkg/mount" diff --git a/docker/pkg/pools/pools.go b/docker/pkg/pools/pools.go index a6d33d95..d3e13b4b 100644 --- a/docker/pkg/pools/pools.go +++ b/docker/pkg/pools/pools.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Package pools provides a collection of pools which provide various diff --git a/docker/pkg/stdcopy/stdcopy.go b/docker/pkg/stdcopy/stdcopy.go index 10387391..f6701984 100644 --- a/docker/pkg/stdcopy/stdcopy.go +++ b/docker/pkg/stdcopy/stdcopy.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package stdcopy // import "github.com/ory/dockertest/v3/docker/pkg/stdcopy" diff --git a/docker/pkg/system/chtimes.go b/docker/pkg/system/chtimes.go index 4b5999f5..39568a81 100644 --- a/docker/pkg/system/chtimes.go +++ b/docker/pkg/system/chtimes.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/chtimes_unix.go b/docker/pkg/system/chtimes_unix.go index a433ffd0..d2c041d8 100644 --- a/docker/pkg/system/chtimes_unix.go +++ b/docker/pkg/system/chtimes_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows diff --git a/docker/pkg/system/chtimes_windows.go b/docker/pkg/system/chtimes_windows.go index 582ea7d2..aabc3f65 100644 --- a/docker/pkg/system/chtimes_windows.go +++ b/docker/pkg/system/chtimes_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/errors.go b/docker/pkg/system/errors.go index 792ebd47..b46dfa23 100644 --- a/docker/pkg/system/errors.go +++ b/docker/pkg/system/errors.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/exitcode.go b/docker/pkg/system/exitcode.go index e7a6d503..f1bc3c5f 100644 --- a/docker/pkg/system/exitcode.go +++ b/docker/pkg/system/exitcode.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/filesys.go b/docker/pkg/system/filesys.go index fbea7af3..01110115 100644 --- a/docker/pkg/system/filesys.go +++ b/docker/pkg/system/filesys.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows diff --git a/docker/pkg/system/filesys_windows.go b/docker/pkg/system/filesys_windows.go index d32a4378..ecffda4c 100644 --- a/docker/pkg/system/filesys_windows.go +++ b/docker/pkg/system/filesys_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" @@ -239,7 +239,7 @@ func windowsOpenSequential(path string, mode int, _ uint32) (fd windows.Handle, createmode = windows.OPEN_EXISTING } // Use FILE_FLAG_SEQUENTIAL_SCAN rather than FILE_ATTRIBUTE_NORMAL as implemented in golang. - //https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx + // https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx const fileFlagSequentialScan = 0x08000000 // FILE_FLAG_SEQUENTIAL_SCAN h, e := windows.CreateFile(pathp, access, sharemode, sa, createmode, fileFlagSequentialScan, 0) return h, e diff --git a/docker/pkg/system/init.go b/docker/pkg/system/init.go index 538aa69f..c1ce4fb3 100644 --- a/docker/pkg/system/init.go +++ b/docker/pkg/system/init.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/init_unix.go b/docker/pkg/system/init_unix.go index b7cd038a..8f8d2a7d 100644 --- a/docker/pkg/system/init_unix.go +++ b/docker/pkg/system/init_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows diff --git a/docker/pkg/system/init_windows.go b/docker/pkg/system/init_windows.go index 99eefea2..4b2343ea 100644 --- a/docker/pkg/system/init_windows.go +++ b/docker/pkg/system/init_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/lcow.go b/docker/pkg/system/lcow.go index 2869cda6..961c2d58 100644 --- a/docker/pkg/system/lcow.go +++ b/docker/pkg/system/lcow.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/lcow_unix.go b/docker/pkg/system/lcow_unix.go index 6bba8122..2333c5b0 100644 --- a/docker/pkg/system/lcow_unix.go +++ b/docker/pkg/system/lcow_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows diff --git a/docker/pkg/system/lcow_windows.go b/docker/pkg/system/lcow_windows.go index 8d1f44de..8db0f106 100644 --- a/docker/pkg/system/lcow_windows.go +++ b/docker/pkg/system/lcow_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/lstat_unix.go b/docker/pkg/system/lstat_unix.go index af2e57c6..2bdaad03 100644 --- a/docker/pkg/system/lstat_unix.go +++ b/docker/pkg/system/lstat_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows diff --git a/docker/pkg/system/lstat_windows.go b/docker/pkg/system/lstat_windows.go index e448d8ce..92dae7cc 100644 --- a/docker/pkg/system/lstat_windows.go +++ b/docker/pkg/system/lstat_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/meminfo.go b/docker/pkg/system/meminfo.go index 10b1a8b2..64713f3a 100644 --- a/docker/pkg/system/meminfo.go +++ b/docker/pkg/system/meminfo.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/meminfo_linux.go b/docker/pkg/system/meminfo_linux.go index 43ab5fde..2ebb2389 100644 --- a/docker/pkg/system/meminfo_linux.go +++ b/docker/pkg/system/meminfo_linux.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/meminfo_unsupported.go b/docker/pkg/system/meminfo_unsupported.go index 63335090..1faab2a8 100644 --- a/docker/pkg/system/meminfo_unsupported.go +++ b/docker/pkg/system/meminfo_unsupported.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !linux && !windows diff --git a/docker/pkg/system/meminfo_windows.go b/docker/pkg/system/meminfo_windows.go index def936c6..caebcae5 100644 --- a/docker/pkg/system/meminfo_windows.go +++ b/docker/pkg/system/meminfo_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/mknod.go b/docker/pkg/system/mknod.go index de493a51..4343b1dd 100644 --- a/docker/pkg/system/mknod.go +++ b/docker/pkg/system/mknod.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows && !freebsd diff --git a/docker/pkg/system/mknod_freebsd.go b/docker/pkg/system/mknod_freebsd.go index 598bd556..97eafda2 100644 --- a/docker/pkg/system/mknod_freebsd.go +++ b/docker/pkg/system/mknod_freebsd.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build freebsd diff --git a/docker/pkg/system/mknod_windows.go b/docker/pkg/system/mknod_windows.go index 2ed294c9..737f8f93 100644 --- a/docker/pkg/system/mknod_windows.go +++ b/docker/pkg/system/mknod_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build windows diff --git a/docker/pkg/system/path.go b/docker/pkg/system/path.go index fd96352d..13155778 100644 --- a/docker/pkg/system/path.go +++ b/docker/pkg/system/path.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/process_unix.go b/docker/pkg/system/process_unix.go index c7f7d841..406eb842 100644 --- a/docker/pkg/system/process_unix.go +++ b/docker/pkg/system/process_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build linux || freebsd || darwin diff --git a/docker/pkg/system/process_windows.go b/docker/pkg/system/process_windows.go index 26c061f9..7f3986ad 100644 --- a/docker/pkg/system/process_windows.go +++ b/docker/pkg/system/process_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/rm.go b/docker/pkg/system/rm.go index 09a7a360..08bcaf7f 100644 --- a/docker/pkg/system/rm.go +++ b/docker/pkg/system/rm.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/stat_darwin.go b/docker/pkg/system/stat_darwin.go index 49ac3aac..cba40a48 100644 --- a/docker/pkg/system/stat_darwin.go +++ b/docker/pkg/system/stat_darwin.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/stat_freebsd.go b/docker/pkg/system/stat_freebsd.go index 49ac3aac..cba40a48 100644 --- a/docker/pkg/system/stat_freebsd.go +++ b/docker/pkg/system/stat_freebsd.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/stat_linux.go b/docker/pkg/system/stat_linux.go index d827d3cf..b70d704f 100644 --- a/docker/pkg/system/stat_linux.go +++ b/docker/pkg/system/stat_linux.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/stat_openbsd.go b/docker/pkg/system/stat_openbsd.go index 86931f83..8117298a 100644 --- a/docker/pkg/system/stat_openbsd.go +++ b/docker/pkg/system/stat_openbsd.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/stat_solaris.go b/docker/pkg/system/stat_solaris.go index 86931f83..8117298a 100644 --- a/docker/pkg/system/stat_solaris.go +++ b/docker/pkg/system/stat_solaris.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/stat_unix.go b/docker/pkg/system/stat_unix.go index 73ac5e17..7e54f3a9 100644 --- a/docker/pkg/system/stat_unix.go +++ b/docker/pkg/system/stat_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows diff --git a/docker/pkg/system/stat_windows.go b/docker/pkg/system/stat_windows.go index bffb7a34..a18b3aae 100644 --- a/docker/pkg/system/stat_windows.go +++ b/docker/pkg/system/stat_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/syscall_unix.go b/docker/pkg/system/syscall_unix.go index 738c68dd..a25a055d 100644 --- a/docker/pkg/system/syscall_unix.go +++ b/docker/pkg/system/syscall_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build linux || freebsd diff --git a/docker/pkg/system/syscall_windows.go b/docker/pkg/system/syscall_windows.go index 986b04b4..c7cf78fa 100644 --- a/docker/pkg/system/syscall_windows.go +++ b/docker/pkg/system/syscall_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/umask.go b/docker/pkg/system/umask.go index e7cfdf0e..750b39a5 100644 --- a/docker/pkg/system/umask.go +++ b/docker/pkg/system/umask.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows diff --git a/docker/pkg/system/umask_windows.go b/docker/pkg/system/umask_windows.go index df35d296..7e4a3952 100644 --- a/docker/pkg/system/umask_windows.go +++ b/docker/pkg/system/umask_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/utimes_freebsd.go b/docker/pkg/system/utimes_freebsd.go index 321c0c5e..91ccd47c 100644 --- a/docker/pkg/system/utimes_freebsd.go +++ b/docker/pkg/system/utimes_freebsd.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/utimes_linux.go b/docker/pkg/system/utimes_linux.go index 5d014964..5f45d866 100644 --- a/docker/pkg/system/utimes_linux.go +++ b/docker/pkg/system/utimes_linux.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/utimes_unsupported.go b/docker/pkg/system/utimes_unsupported.go index 9f122197..fc2dbc5f 100644 --- a/docker/pkg/system/utimes_unsupported.go +++ b/docker/pkg/system/utimes_unsupported.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !linux && !freebsd diff --git a/docker/pkg/system/xattrs_linux.go b/docker/pkg/system/xattrs_linux.go index 7b263944..6767f167 100644 --- a/docker/pkg/system/xattrs_linux.go +++ b/docker/pkg/system/xattrs_linux.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package system // import "github.com/ory/dockertest/v3/docker/pkg/system" diff --git a/docker/pkg/system/xattrs_unsupported.go b/docker/pkg/system/xattrs_unsupported.go index dc1d1a5c..5a4fb1cd 100644 --- a/docker/pkg/system/xattrs_unsupported.go +++ b/docker/pkg/system/xattrs_unsupported.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !linux diff --git a/docker/plugin.go b/docker/plugin.go index cd6a464c..a5cc19ac 100644 --- a/docker/plugin.go +++ b/docker/plugin.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2018 go-dockerclient authors. All rights reserved. diff --git a/docker/signal.go b/docker/signal.go index 05d24828..05de9f1e 100644 --- a/docker/signal.go +++ b/docker/signal.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2014 go-dockerclient authors. All rights reserved. diff --git a/docker/tar.go b/docker/tar.go index a7482aca..73baad3f 100644 --- a/docker/tar.go +++ b/docker/tar.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2014 go-dockerclient authors. All rights reserved. diff --git a/docker/tls.go b/docker/tls.go index dd936c63..7bd8e6c2 100644 --- a/docker/tls.go +++ b/docker/tls.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2014 go-dockerclient authors. All rights reserved. diff --git a/docker/types/auth.go b/docker/types/auth.go index 07197e38..07317462 100644 --- a/docker/types/auth.go +++ b/docker/types/auth.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types // import "github.com/ory/dockertest/v3/docker/types" diff --git a/docker/types/blkiodev/blkio.go b/docker/types/blkiodev/blkio.go index 3b2f5810..fdcbf696 100644 --- a/docker/types/blkiodev/blkio.go +++ b/docker/types/blkiodev/blkio.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package blkiodev // import "github.com/ory/dockertest/v3/docker/types/blkiodev" diff --git a/docker/types/client.go b/docker/types/client.go index 93a54fb0..6cd4a7c3 100644 --- a/docker/types/client.go +++ b/docker/types/client.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types // import "github.com/ory/dockertest/v3/docker/types" @@ -9,6 +9,7 @@ import ( "net" units "github.com/docker/go-units" + "github.com/ory/dockertest/v3/docker/types/container" "github.com/ory/dockertest/v3/docker/types/filters" ) diff --git a/docker/types/configs.go b/docker/types/configs.go index 6f29f66d..0db754c4 100644 --- a/docker/types/configs.go +++ b/docker/types/configs.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types // import "github.com/ory/dockertest/v3/docker/types" diff --git a/docker/types/container/config.go b/docker/types/container/config.go index 62a2c83c..6198dda5 100644 --- a/docker/types/container/config.go +++ b/docker/types/container/config.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package container // import "github.com/ory/dockertest/v3/docker/types/container" @@ -7,6 +7,7 @@ import ( "time" "github.com/docker/go-connections/nat" + "github.com/ory/dockertest/v3/docker/types/strslice" ) diff --git a/docker/types/container/container_changes.go b/docker/types/container/container_changes.go index a9dd0521..cd538504 100644 --- a/docker/types/container/container_changes.go +++ b/docker/types/container/container_changes.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package container diff --git a/docker/types/container/container_create.go b/docker/types/container/container_create.go index 909190f8..276264a7 100644 --- a/docker/types/container/container_create.go +++ b/docker/types/container/container_create.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package container diff --git a/docker/types/container/container_top.go b/docker/types/container/container_top.go index 13ce9a38..47711494 100644 --- a/docker/types/container/container_top.go +++ b/docker/types/container/container_top.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package container diff --git a/docker/types/container/container_update.go b/docker/types/container/container_update.go index e0e50e06..4c3f327c 100644 --- a/docker/types/container/container_update.go +++ b/docker/types/container/container_update.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package container diff --git a/docker/types/container/container_wait.go b/docker/types/container/container_wait.go index f8f342c2..67c75ad5 100644 --- a/docker/types/container/container_wait.go +++ b/docker/types/container/container_wait.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package container diff --git a/docker/types/container/host_config.go b/docker/types/container/host_config.go index a1db0d37..aeb699b9 100644 --- a/docker/types/container/host_config.go +++ b/docker/types/container/host_config.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package container // import "github.com/ory/dockertest/v3/docker/types/container" @@ -8,6 +8,7 @@ import ( "github.com/docker/go-connections/nat" "github.com/docker/go-units" + "github.com/ory/dockertest/v3/docker/types/blkiodev" "github.com/ory/dockertest/v3/docker/types/mount" "github.com/ory/dockertest/v3/docker/types/strslice" diff --git a/docker/types/container/hostconfig_unix.go b/docker/types/container/hostconfig_unix.go index bca366d2..8f8f8337 100644 --- a/docker/types/container/hostconfig_unix.go +++ b/docker/types/container/hostconfig_unix.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 //go:build !windows diff --git a/docker/types/container/hostconfig_windows.go b/docker/types/container/hostconfig_windows.go index e1714b1c..f3f13f8a 100644 --- a/docker/types/container/hostconfig_windows.go +++ b/docker/types/container/hostconfig_windows.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package container // import "github.com/ory/dockertest/v3/docker/types/container" diff --git a/docker/types/container/waitcondition.go b/docker/types/container/waitcondition.go index 4fbd5c38..78e56b80 100644 --- a/docker/types/container/waitcondition.go +++ b/docker/types/container/waitcondition.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package container // import "github.com/ory/dockertest/v3/docker/types/container" diff --git a/docker/types/error_response.go b/docker/types/error_response.go index 8a05fa75..c62a6c7c 100644 --- a/docker/types/error_response.go +++ b/docker/types/error_response.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types diff --git a/docker/types/filters/example_test.go b/docker/types/filters/example_test.go index 6404e831..5485bf7a 100644 --- a/docker/types/filters/example_test.go +++ b/docker/types/filters/example_test.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package filters // import "github.com/ory/dockertest/v3/docker/types/filters" diff --git a/docker/types/filters/parse.go b/docker/types/filters/parse.go index 6f1928c6..1f8c15e4 100644 --- a/docker/types/filters/parse.go +++ b/docker/types/filters/parse.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 /* @@ -192,7 +192,7 @@ func (args Args) Len() int { func (args Args) MatchKVList(key string, sources map[string]string) bool { fieldValues := args.fields[key] - //do not filter if there is no filter set or cannot determine filter + // do not filter if there is no filter set or cannot determine filter if len(fieldValues) == 0 { return true } @@ -238,7 +238,7 @@ func (args Args) Match(field, source string) bool { // ExactMatch returns true if the source matches exactly one of the values. func (args Args) ExactMatch(key, source string) bool { fieldValues, ok := args.fields[key] - //do not filter if there is no filter set or cannot determine filter + // do not filter if there is no filter set or cannot determine filter if !ok || len(fieldValues) == 0 { return true } @@ -251,7 +251,7 @@ func (args Args) ExactMatch(key, source string) bool { // matches exactly the value. func (args Args) UniqueExactMatch(key, source string) bool { fieldValues := args.fields[key] - //do not filter if there is no filter set or cannot determine filter + // do not filter if there is no filter set or cannot determine filter if len(fieldValues) == 0 { return true } diff --git a/docker/types/filters/parse_test.go b/docker/types/filters/parse_test.go index d2e2f61c..fd46c6f6 100644 --- a/docker/types/filters/parse_test.go +++ b/docker/types/filters/parse_test.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package filters // import "github.com/ory/dockertest/v3/docker/types/filters" diff --git a/docker/types/graph_driver_data.go b/docker/types/graph_driver_data.go index 1932fea9..96a3ac4f 100644 --- a/docker/types/graph_driver_data.go +++ b/docker/types/graph_driver_data.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types diff --git a/docker/types/id_response.go b/docker/types/id_response.go index 59755f55..11765036 100644 --- a/docker/types/id_response.go +++ b/docker/types/id_response.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types diff --git a/docker/types/image_delete_response_item.go b/docker/types/image_delete_response_item.go index 503b4e20..0c385a10 100644 --- a/docker/types/image_delete_response_item.go +++ b/docker/types/image_delete_response_item.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types diff --git a/docker/types/image_summary.go b/docker/types/image_summary.go index 1b4783e9..78862f41 100644 --- a/docker/types/image_summary.go +++ b/docker/types/image_summary.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types diff --git a/docker/types/mount/mount.go b/docker/types/mount/mount.go index f675b899..a9daabce 100644 --- a/docker/types/mount/mount.go +++ b/docker/types/mount/mount.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package mount // import "github.com/ory/dockertest/v3/docker/types/mount" diff --git a/docker/types/network/network.go b/docker/types/network/network.go index f98ebfb3..3133936b 100644 --- a/docker/types/network/network.go +++ b/docker/types/network/network.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package network // import "github.com/ory/dockertest/v3/docker/types/network" @@ -12,7 +12,7 @@ type Address struct { // IPAM represents IP Address Management type IPAM struct { Driver string - Options map[string]string //Per network IPAM driver options + Options map[string]string // Per network IPAM driver options Config []IPAMConfig } diff --git a/docker/types/plugin.go b/docker/types/plugin.go index 01b29fb7..e8d5d386 100644 --- a/docker/types/plugin.go +++ b/docker/types/plugin.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types diff --git a/docker/types/plugin_device.go b/docker/types/plugin_device.go index b9af6cd2..a80af2cc 100644 --- a/docker/types/plugin_device.go +++ b/docker/types/plugin_device.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types diff --git a/docker/types/plugin_env.go b/docker/types/plugin_env.go index dedcfd26..f5b8cc19 100644 --- a/docker/types/plugin_env.go +++ b/docker/types/plugin_env.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types diff --git a/docker/types/plugin_interface_type.go b/docker/types/plugin_interface_type.go index 47251e13..0b14bf8c 100644 --- a/docker/types/plugin_interface_type.go +++ b/docker/types/plugin_interface_type.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types diff --git a/docker/types/plugin_mount.go b/docker/types/plugin_mount.go index 9d19441e..ef9a887a 100644 --- a/docker/types/plugin_mount.go +++ b/docker/types/plugin_mount.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types diff --git a/docker/types/plugin_responses.go b/docker/types/plugin_responses.go index 7352affb..64842d4a 100644 --- a/docker/types/plugin_responses.go +++ b/docker/types/plugin_responses.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types // import "github.com/ory/dockertest/v3/docker/types" diff --git a/docker/types/port.go b/docker/types/port.go index 0733d078..0c3bc3b9 100644 --- a/docker/types/port.go +++ b/docker/types/port.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types diff --git a/docker/types/registry/authenticate.go b/docker/types/registry/authenticate.go index a581a95f..468ad180 100644 --- a/docker/types/registry/authenticate.go +++ b/docker/types/registry/authenticate.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package registry // import "github.com/ory/dockertest/v3/docker/types/registry" diff --git a/docker/types/registry/registry.go b/docker/types/registry/registry.go index ceb9a281..fc8c5aae 100644 --- a/docker/types/registry/registry.go +++ b/docker/types/registry/registry.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package registry // import "github.com/ory/dockertest/v3/docker/types/registry" diff --git a/docker/types/seccomp.go b/docker/types/seccomp.go index 065cdc74..cd9b7bb0 100644 --- a/docker/types/seccomp.go +++ b/docker/types/seccomp.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types // import "github.com/ory/dockertest/v3/docker/types" diff --git a/docker/types/service_update_response.go b/docker/types/service_update_response.go index 2fed33d3..7489e738 100644 --- a/docker/types/service_update_response.go +++ b/docker/types/service_update_response.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types diff --git a/docker/types/stats.go b/docker/types/stats.go index e7b8ebce..0c9832b5 100644 --- a/docker/types/stats.go +++ b/docker/types/stats.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Package types is used for API stability in the types and response to the diff --git a/docker/types/strslice/strslice.go b/docker/types/strslice/strslice.go index 9632aed6..d9d14723 100644 --- a/docker/types/strslice/strslice.go +++ b/docker/types/strslice/strslice.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package strslice // import "github.com/ory/dockertest/v3/docker/types/strslice" diff --git a/docker/types/strslice/strslice_test.go b/docker/types/strslice/strslice_test.go index 98471f9e..1957146d 100644 --- a/docker/types/strslice/strslice_test.go +++ b/docker/types/strslice/strslice_test.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package strslice // import "github.com/ory/dockertest/v3/docker/types/strslice" diff --git a/docker/types/types.go b/docker/types/types.go index f3c1a27e..76adc28c 100644 --- a/docker/types/types.go +++ b/docker/types/types.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types // import "github.com/ory/dockertest/v3/docker/types" @@ -12,6 +12,7 @@ import ( "time" "github.com/docker/go-connections/nat" + "github.com/ory/dockertest/v3/docker/types/container" "github.com/ory/dockertest/v3/docker/types/filters" "github.com/ory/dockertest/v3/docker/types/mount" @@ -182,7 +183,7 @@ type Info struct { RegistryConfig *registry.ServiceConfig NCPU int MemTotal int64 - //GenericResources []swarm.GenericResource + // GenericResources []swarm.GenericResource DockerRootDir string HTTPProxy string `json:"HttpProxy"` HTTPSProxy string `json:"HttpsProxy"` @@ -195,7 +196,7 @@ type Info struct { ClusterAdvertise string Runtimes map[string]Runtime DefaultRuntime string - //Swarm swarm.Info + // Swarm swarm.Info // LiveRestoreEnabled determines whether containers should be kept // running when the daemon is shutdown or upon daemon start if // running containers are detected diff --git a/docker/types/versions/compare.go b/docker/types/versions/compare.go index b9106331..5d1ab05c 100644 --- a/docker/types/versions/compare.go +++ b/docker/types/versions/compare.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package versions // import "github.com/ory/dockertest/v3/docker/types/versions" diff --git a/docker/types/versions/compare_test.go b/docker/types/versions/compare_test.go index 2aabc586..4d32fdb4 100644 --- a/docker/types/versions/compare_test.go +++ b/docker/types/versions/compare_test.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package versions // import "github.com/ory/dockertest/v3/docker/types/versions" diff --git a/docker/types/versions/v1p19/types.go b/docker/types/versions/v1p19/types.go index d1b6f608..ba8ce9f2 100644 --- a/docker/types/versions/v1p19/types.go +++ b/docker/types/versions/v1p19/types.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Package v1p19 provides specific API types for the API version 1, patch 19. @@ -6,6 +6,7 @@ package v1p19 // import "github.com/ory/dockertest/v3/docker/types/versions/v1p1 import ( "github.com/docker/go-connections/nat" + "github.com/ory/dockertest/v3/docker/types" "github.com/ory/dockertest/v3/docker/types/container" "github.com/ory/dockertest/v3/docker/types/versions/v1p20" diff --git a/docker/types/versions/v1p20/types.go b/docker/types/versions/v1p20/types.go index d65183e6..5968b86e 100644 --- a/docker/types/versions/v1p20/types.go +++ b/docker/types/versions/v1p20/types.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Package v1p20 provides specific API types for the API version 1, patch 20. @@ -6,6 +6,7 @@ package v1p20 // import "github.com/ory/dockertest/v3/docker/types/versions/v1p2 import ( "github.com/docker/go-connections/nat" + "github.com/ory/dockertest/v3/docker/types" "github.com/ory/dockertest/v3/docker/types/container" ) diff --git a/docker/types/volume.go b/docker/types/volume.go index 9b3e9683..d2199511 100644 --- a/docker/types/volume.go +++ b/docker/types/volume.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package types diff --git a/docker/volume.go b/docker/volume.go index e4421611..f5fae9f8 100644 --- a/docker/volume.go +++ b/docker/volume.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 // Copyright 2015 go-dockerclient authors. All rights reserved. diff --git a/dockertest.go b/dockertest.go index 5d122249..4c54266b 100644 --- a/dockertest.go +++ b/dockertest.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package dockertest @@ -15,6 +15,7 @@ import ( "time" "github.com/cenkalti/backoff/v4" + dc "github.com/ory/dockertest/v3/docker" options "github.com/ory/dockertest/v3/docker/opts" ) diff --git a/dockertest_test.go b/dockertest_test.go index 254ba3ae..b3ebe3f8 100644 --- a/dockertest_test.go +++ b/dockertest_test.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Ory Corp +// Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 package dockertest @@ -17,9 +17,10 @@ import ( _ "github.com/go-sql-driver/mysql" _ "github.com/lib/pq" - dc "github.com/ory/dockertest/v3/docker" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + dc "github.com/ory/dockertest/v3/docker" ) var ( diff --git a/examples/FakeGoogleCloudStorage.md b/examples/FakeGoogleCloudStorage.md index 96c35a4b..41a62e8e 100644 --- a/examples/FakeGoogleCloudStorage.md +++ b/examples/FakeGoogleCloudStorage.md @@ -63,8 +63,7 @@ func TestMain(m *testing.M) { log.Fatalf("Could not connect to Docker: %s", err) } - code := m.Run() - os.Exit(code) + m.Run() } func setUpGcloud() { diff --git a/examples/MongoDB.md b/examples/MongoDB.md index db6cb529..cfed1fcf 100644 --- a/examples/MongoDB.md +++ b/examples/MongoDB.md @@ -66,20 +66,20 @@ func TestMain(m *testing.M) { log.Fatalf("Could not connect to docker: %s", err) } - // run tests - code := m.Run() - - // When you're done, kill and remove the container - if err = pool.Purge(resource); err != nil { - log.Fatalf("Could not purge resource: %s", err) - } + defer func() { + // When you're done, kill and remove the container + if err = pool.Purge(resource); err != nil { + log.Fatalf("Could not purge resource: %s", err) + } - // disconnect mongodb client - if err = dbClient.Disconnect(context.TODO()); err != nil { - panic(err) - } + // disconnect mongodb client + if err = dbClient.Disconnect(context.TODO()); err != nil { + panic(err) + } + }() - os.Exit(code) + // run tests + m.Run() } ``` diff --git a/examples/Mountebank.md b/examples/Mountebank.md index d0fa92b7..dc319f5d 100644 --- a/examples/Mountebank.md +++ b/examples/Mountebank.md @@ -78,15 +78,15 @@ func TestMain(m *testing.M) { }); err != nil { log.Fatalf("Could not connect to docker: %s", err) } - //Run tests - code := m.Run() - // You can't defer this because os.Exit doesn't care for defer - if err := pool.Purge(resource); err != nil { - log.Fatalf("Could not purge resource: %s", err) - } + defer func() { + if err := pool.Purge(resource); err != nil { + log.Fatalf("Could not purge resource: %s", err) + } + }() - os.Exit(code) + // run tests + m.Run() } func TestHandler(t *testing.T) { diff --git a/examples/PostgreSQL.md b/examples/PostgreSQL.md index c832e17c..f5adb333 100644 --- a/examples/PostgreSQL.md +++ b/examples/PostgreSQL.md @@ -65,15 +65,15 @@ func TestMain(m *testing.M) { }); err != nil { log.Fatalf("Could not connect to docker: %s", err) } - //Run tests - code := m.Run() - // You can't defer this because os.Exit doesn't care for defer - if err := pool.Purge(resource); err != nil { - log.Fatalf("Could not purge resource: %s", err) - } + defer func() { + if err := pool.Purge(resource); err != nil { + log.Fatalf("Could not purge resource: %s", err) + } + }() - os.Exit(code) + // run tests + m.Run() } func TestRealbob(t *testing.T) {