grim/convey

Replace deprecated ioutil usage

5 months ago, Elliott Sales de Andrade
f2b1178f3266
Replace deprecated ioutil usage

It was deprecated in Go 1.16, but `go.mod` wants 1.17 already.

Testing Done:
Ran `go build .`

Reviewed at https://reviews.imfreedom.org/r/2868/
package docker
import (
"testing"
"github.com/stretchr/testify/assert"
"keep.imfreedom.org/grim/convey/podman"
"keep.imfreedom.org/grim/convey/yaml"
)
func TestTagSingleDestination(t *testing.T) {
tag := Tag{
Source: "foo",
Destination: "bar",
}
assert.NoError(t, tag.Valid())
assert.Equal(t, tag.Destinations, yaml.StringOrSlice{"bar"})
}
func TestTagMultipleDestinations(t *testing.T) {
tag := Tag{
Source: "foo",
Destinations: []string{"bar", "baz"},
}
assert.NoError(t, tag.Valid())
}
func TestTagMergedDestinations(t *testing.T) {
tag := Tag{
Source: "foo",
Destination: "bar",
Destinations: []string{"baz"},
}
assert.NoError(t, tag.Valid())
assert.Equal(t, tag.Destinations, yaml.StringOrSlice{"bar", "baz"})
}
func TestTagSourceRequired(t *testing.T) {
tag := Tag{
Destination: "bar",
}
assert.ErrorIs(t, tag.Valid(), podman.ErrNoImage)
}
func TestTagDestinationsRequired(t *testing.T) {
tag := Tag{
Source: "foo",
}
assert.ErrorIs(t, tag.Valid(), podman.ErrNoTargets)
}