From 69d77bc150eeee3f466187e3c850375f80454f57 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 5 Jul 2023 12:24:11 +0200 Subject: [PATCH] opts: use string-literals for easier grep'ing Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 84000190d30f715b27b6150bc9fd1a648830b3bc) Signed-off-by: Sebastiaan van Stijn --- opts/opts_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opts/opts_test.go b/opts/opts_test.go index fe4b7f5ce5..49ceea8676 100644 --- a/opts/opts_test.go +++ b/opts/opts_test.go @@ -71,10 +71,10 @@ func TestListOptsWithoutValidator(t *testing.T) { t.Errorf("%d != 3", o.Len()) } if !o.Get("bar") { - t.Error("o.Get(\"bar\") == false") + t.Error(`o.Get("bar") == false`) } if o.Get("baz") { - t.Error("o.Get(\"baz\") == true") + t.Error(`o.Get("baz") == true`) } o.Delete("foo") if o.String() != "[bar bar]" { @@ -106,10 +106,10 @@ func TestListOptsWithValidator(t *testing.T) { t.Errorf("%d != 1", o.Len()) } if !o.Get("max-file=2") { - t.Error("o.Get(\"max-file=2\") == false") + t.Error(`o.Get("max-file=2") == false`) } if o.Get("baz") { - t.Error("o.Get(\"baz\") == true") + t.Error(`o.Get("baz") == true`) } o.Delete("max-file=2") if o.String() != "" { @@ -361,7 +361,7 @@ func TestMapMapOpts(t *testing.T) { o.Set("r1=k12=v12") assert.Check(t, is.DeepEqual(tmpMap["r1"], map[string]string{"k11": "v11", "k12": "v12"})) - if o.Set("invalid-key={\"k\":\"v\"}") == nil { + if o.Set(`invalid-key={"k":"v"}`) == nil { t.Error("validator is not being called") } }