runtime: Fix static check errors

Fix comment formatting and unused variable to make static checks pass.

Fixes #1550

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
This commit is contained in:
Chelsea Mafrica 2021-03-25 11:45:19 -07:00
parent f3ebbb1f1a
commit 6fcfea8dcf
2 changed files with 6 additions and 6 deletions

View File

@ -19,12 +19,12 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )
func NewService(id string) (service, error) { func newService(id string) (*service, error) {
ctx := context.Background() ctx := context.Background()
ctx, cancel := context.WithCancel(ctx) ctx, cancel := context.WithCancel(ctx)
s := service{ s := &service{
id: id, id: id,
pid: uint32(os.Getpid()), pid: uint32(os.Getpid()),
ctx: ctx, ctx: ctx,
@ -43,16 +43,16 @@ func TestServiceCreate(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
tmpdir, err := ioutil.TempDir("", "") tmpdir, _ := ioutil.TempDir("", "")
defer os.RemoveAll(tmpdir) defer os.RemoveAll(tmpdir)
bundleDir := filepath.Join(tmpdir, "bundle") bundleDir := filepath.Join(tmpdir, "bundle")
err = makeOCIBundle(bundleDir) err := makeOCIBundle(bundleDir)
assert.NoError(err) assert.NoError(err)
ctx := context.Background() ctx := context.Background()
s, err := NewService("foo") s, err := newService("foo")
assert.NoError(err) assert.NoError(err)
for i, d := range ktu.ContainerIDTestData { for i, d := range ktu.ContainerIDTestData {

View File

@ -53,7 +53,7 @@ type ContainerIDTestDataType struct {
Valid bool 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{ var ContainerIDTestData = []ContainerIDTestDataType{
{"", false}, // Cannot be blank {"", false}, // Cannot be blank
{" ", false}, // Cannot be a space {" ", false}, // Cannot be a space