Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cramja committed Jun 22, 2021
1 parent 28527bd commit 49a4160
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/namespace/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ func TestValidateConfigNamespaces(t *testing.T) {

t.Run("case=supports 3 namespace file formats", func(t *testing.T) {
dir := t.TempDir()
files := map[string]string {
nsfiles := map[string]string{
dir + "/ns.yaml": "name: testns0\nid: 0",
dir + "/ns.json": "{\"name\": \"testns0\",\"id\": 0}",
dir + "/ns.toml": "name = \"testns0\"\nid = 0",
dir + "/ns.toml": "name = \"testns0\"\nid = 0",
}
for fn, contents := range files {
for fn, contents := range nsfiles {
require.NoError(t, ioutil.WriteFile(fn, []byte(contents), fileMode))
}

params := append([]string{"validate"}, keys(files)...)
params := append([]string{"validate"}, keys(nsfiles)...)
cmd.ExecNoErr(t, params...)
})

Expand Down Expand Up @@ -143,8 +143,8 @@ func validateCommand() *cobra.Command {

func keys(m map[string]string) []string {
rv := make([]string, 0, len(m))
for k, _ := range m {
for k := range m {
rv = append(rv, k)
}
return rv
}
}

0 comments on commit 49a4160

Please sign in to comment.