From e590afcf2c2d046b1a4b6a11986a8e38a2b93ed7 Mon Sep 17 00:00:00 2001 From: fangguizhen <1297394526@qq.com> Date: Thu, 19 Jan 2023 03:12:12 +0000 Subject: [PATCH] bytes, strings: rename field in CutSuffix tests Change-Id: I63181f6540fc1bfcfc988a16bf9fafbd3575cfdf GitHub-Last-Rev: d90528730a92a087866c1bfc227a0a0bf1cdffbe GitHub-Pull-Request: golang/go#57909 Reviewed-on: https://go-review.googlesource.com/c/go/+/462284 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor TryBot-Result: Gopher Robot Run-TryBot: Ian Lance Taylor Reviewed-by: Cherry Mui --- src/bytes/bytes_test.go | 6 +++--- src/strings/strings_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bytes/bytes_test.go b/src/bytes/bytes_test.go index f58f18c461..fc2824485a 100644 --- a/src/bytes/bytes_test.go +++ b/src/bytes/bytes_test.go @@ -1728,7 +1728,7 @@ func TestCutPrefix(t *testing.T) { var cutSuffixTests = []struct { s, sep string - after string + before string found bool }{ {"abc", "bc", "a", true}, @@ -1741,8 +1741,8 @@ var cutSuffixTests = []struct { func TestCutSuffix(t *testing.T) { for _, tt := range cutSuffixTests { - if after, found := CutSuffix([]byte(tt.s), []byte(tt.sep)); string(after) != tt.after || found != tt.found { - t.Errorf("CutSuffix(%q, %q) = %q, %v, want %q, %v", tt.s, tt.sep, after, found, tt.after, tt.found) + if before, found := CutSuffix([]byte(tt.s), []byte(tt.sep)); string(before) != tt.before || found != tt.found { + t.Errorf("CutSuffix(%q, %q) = %q, %v, want %q, %v", tt.s, tt.sep, before, found, tt.before, tt.found) } } } diff --git a/src/strings/strings_test.go b/src/strings/strings_test.go index 3991d12751..5143ec86c9 100644 --- a/src/strings/strings_test.go +++ b/src/strings/strings_test.go @@ -1668,7 +1668,7 @@ func TestCutPrefix(t *testing.T) { var cutSuffixTests = []struct { s, sep string - after string + before string found bool }{ {"abc", "bc", "a", true}, @@ -1681,8 +1681,8 @@ var cutSuffixTests = []struct { func TestCutSuffix(t *testing.T) { for _, tt := range cutSuffixTests { - if after, found := CutSuffix(tt.s, tt.sep); after != tt.after || found != tt.found { - t.Errorf("CutSuffix(%q, %q) = %q, %v, want %q, %v", tt.s, tt.sep, after, found, tt.after, tt.found) + if before, found := CutSuffix(tt.s, tt.sep); before != tt.before || found != tt.found { + t.Errorf("CutSuffix(%q, %q) = %q, %v, want %q, %v", tt.s, tt.sep, before, found, tt.before, tt.found) } } } -- 2.48.1