Skip to content

Commit 1e3e9fd

Browse files
millerresearchgopherbot
authored andcommitted
all: rename Example test functions to prevent vet errors
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 <[email protected]> Reviewed-by: Tim King <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent b2bec85 commit 1e3e9fd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

collate/sort_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"golang.org/x/text/language"
1313
)
1414

15-
func ExampleCollator_Strings() {
15+
func ExampleCollator_strings() {
1616
c := collate.New(language.Und)
1717
strings := []string{
1818
"ad",

encoding/example_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"golang.org/x/text/transform"
1717
)
1818

19-
func ExampleDecodeWindows1252() {
19+
func Example_decodeWindows1252() {
2020
sr := strings.NewReader("Gar\xe7on !")
2121
tr := charmap.Windows1252.NewDecoder().Reader(sr)
2222
io.Copy(os.Stdout, tr)

feature/plural/example_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"golang.org/x/text/message"
1111
)
1212

13-
func ExampleSelect() {
13+
func ExampleSelectf() {
1414
// Manually set some translations. This is typically done programmatically.
1515
message.Set(language.English, "%d files remaining",
1616
plural.Selectf(1, "%d",

0 commit comments

Comments
 (0)