Files
docker-cli/cli/command/stack
Sebastiaan van Stijn dea59eabba cli/command/stack/swarm: waitOnServices remove redundant check for multi-error
This check was redundant, because `errors.Join` already checks if the
list of errors is either empty, or only contains `nil` errors, as can
be seen in [this example][1];

    package main

    import (
        "errors"
        "testing"
    )

    func TestMultiErr(t *testing.T) {
        var errs []error
        if err := errors.Join(errs...); err != nil {
            t.Fatal(err)
        }

        errs = append(errs, nil, nil, nil)
        t.Logf("errs contains %d elements", len(errs))
        if err := errors.Join(errs...); err != nil {
            t.Fatal(err)
        }

        errs = append(errs, errors.New("with an error"))
        if err := errors.Join(errs...); err == nil {
            t.Fatal("expected an error")
        }
    }

[1]: https://go.dev/play/p/iSuGP81eght

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-03 13:26:43 +01:00
..
2025-01-14 23:54:33 +01:00
2025-01-14 23:54:33 +01:00
2024-07-04 01:35:12 +02:00
2023-12-12 22:30:16 +01:00
2024-07-04 01:35:12 +02:00