Skip to content

Commit

Permalink
all: rename Example test functions to prevent vet errors
Browse files Browse the repository at this point in the history
Building x/text was being prevented by vet errors caused by Example
test functions of the form ExampleXxx where Xxx was not an identifier
declared in the package. This is corrected by renaming:
  ExampleCollator_Strings to ExampleCollator_strings in text/collate
  ExampleDecodeWindows1252 to Example_decodeWindows1252 in text/encoding
  ExampleSelect to ExampleSelectf in text/feature/plural

Fixes golang/go#68967

Change-Id: Id584a518af766676ab44fc49c12160e36f66542a
Reviewed-on: https://go-review.googlesource.com/c/text/+/606736
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Tim King <taking@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
  • Loading branch information
millerresearch authored and gopherbot committed Aug 20, 2024
1 parent b2bec85 commit 1e3e9fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion collate/sort_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"golang.org/x/text/language"
)

func ExampleCollator_Strings() {
func ExampleCollator_strings() {
c := collate.New(language.Und)
strings := []string{
"ad",
Expand Down
2 changes: 1 addition & 1 deletion encoding/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"golang.org/x/text/transform"
)

func ExampleDecodeWindows1252() {
func Example_decodeWindows1252() {
sr := strings.NewReader("Gar\xe7on !")
tr := charmap.Windows1252.NewDecoder().Reader(sr)
io.Copy(os.Stdout, tr)
Expand Down
2 changes: 1 addition & 1 deletion feature/plural/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"golang.org/x/text/message"
)

func ExampleSelect() {
func ExampleSelectf() {
// Manually set some translations. This is typically done programmatically.
message.Set(language.English, "%d files remaining",
plural.Selectf(1, "%d",
Expand Down

0 comments on commit 1e3e9fd

Please sign in to comment.