mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
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:
parent
f3ebbb1f1a
commit
6fcfea8dcf
@ -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 {
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user