mirror of
https://github.com/moby/moby.git
synced 2025-04-18 20:44:11 +03:00
If we have an error type that we're checking a substring against, we should really be checking using ErrorContains to indicate the right semantics to assert. Mostly done using these transforms: find . -type f -name "*_test.go" | \ xargs gofmt -w -r 'assert.Assert(t, is.ErrorContains(e, s)) -> assert.ErrorContains(t, e, s)' find . -type f -name "*_test.go" | \ xargs gofmt -w -r 'assert.Assert(t, is.Contains(err.Error(), s)) -> assert.ErrorContains(t, err, s)' find . -type f -name "*_test.go" | \ xargs gofmt -w -r 'assert.Check(t, is.Contains(err.Error(), s)) -> assert.Check(t, is.ErrorContains(err, s))' As well as some small fixups to helpers that were doing strings.Contains explicitly. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>