diff --git a/src/runtime/containerd-shim-v2/service_test.go b/src/runtime/containerd-shim-v2/service_test.go index 843df7b8d0..f49d7f4f3d 100644 --- a/src/runtime/containerd-shim-v2/service_test.go +++ b/src/runtime/containerd-shim-v2/service_test.go @@ -19,12 +19,12 @@ import ( "github.com/stretchr/testify/assert" ) -func NewService(id string) (service, error) { +func newService(id string) (*service, error) { ctx := context.Background() ctx, cancel := context.WithCancel(ctx) - s := service{ + s := &service{ id: id, pid: uint32(os.Getpid()), ctx: ctx, @@ -43,16 +43,16 @@ func TestServiceCreate(t *testing.T) { assert := assert.New(t) - tmpdir, err := ioutil.TempDir("", "") + tmpdir, _ := ioutil.TempDir("", "") defer os.RemoveAll(tmpdir) bundleDir := filepath.Join(tmpdir, "bundle") - err = makeOCIBundle(bundleDir) + err := makeOCIBundle(bundleDir) assert.NoError(err) ctx := context.Background() - s, err := NewService("foo") + s, err := newService("foo") assert.NoError(err) for i, d := range ktu.ContainerIDTestData { diff --git a/src/runtime/pkg/katatestutils/utils.go b/src/runtime/pkg/katatestutils/utils.go index ad0c99916b..b6da2fdb79 100644 --- a/src/runtime/pkg/katatestutils/utils.go +++ b/src/runtime/pkg/katatestutils/utils.go @@ -53,7 +53,7 @@ type ContainerIDTestDataType struct { Valid bool } -// Set of test data that lists valid and invalid Container IDs +// ContainerIDTestData is a set of test data that lists valid and invalid Container IDs var ContainerIDTestData = []ContainerIDTestDataType{ {"", false}, // Cannot be blank {" ", false}, // Cannot be a space