From 87fe7a193a54ee263a7163048c56a1f82477dd1e Mon Sep 17 00:00:00 2001 From: Vladimir Kuznetsov Date: Sun, 1 Mar 2020 04:18:10 +0000 Subject: [PATCH] Update fmt_test.go - rename variable and change format string --- varfmt/fmt_test.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/varfmt/fmt_test.go b/varfmt/fmt_test.go index c5ac498..a0f9f2b 100644 --- a/varfmt/fmt_test.go +++ b/varfmt/fmt_test.go @@ -9,10 +9,10 @@ import ( ) func TestFormat(t *testing.T) { - var interfaceSlice []interface{} = make([]interface{}, 1002) - interfaceSlice[10] = 1 - interfaceSlice[100] = 1 - interfaceSlice[1000] = 1 + s := make([]interface{}, 1002) + s[10] = 1 + s[100] = 1 + s[1000] = 1 for _, tc := range []struct { format string @@ -50,19 +50,19 @@ func TestFormat(t *testing.T) { result: "Hello, World", }, { - format: "check {10}", - args: interfaceSlice[:11], - result: "check 1", + format: "{10}", + args: s[:11], + result: "1", }, { - format: "check {100}", - args: interfaceSlice[:101], - result: "check 1", + format: "{100}", + args: s[:101], + result: "1", }, { - format: "check {1000}", - args: interfaceSlice[:1001], - result: "check 1", + format: "{1000}", + args: s[:1001], + result: "1", }, } { t.Run(tc.result, func(t *testing.T) {