diff --git a/collate/build/builder_test.go b/collate/build/builder_test.go index ff0aba3a..0e022ecb 100644 --- a/collate/build/builder_test.go +++ b/collate/build/builder_test.go @@ -65,7 +65,7 @@ func newBuilder(t *testing.T, ducet []ducetElem) *Builder { ces = append(ces, ce.w) } if err := b.Add([]rune(e.str), ces, nil); err != nil { - t.Errorf(err.Error()) + t.Error(err) } } b.t = &table{} diff --git a/collate/build/colelem.go b/collate/build/colelem.go index 1aaa062c..f51faa1a 100644 --- a/collate/build/colelem.go +++ b/collate/build/colelem.go @@ -139,7 +139,7 @@ const ( maxPrimary = illegalOffset + 1 ) -// implicitPrimary returns the primary weight for the a rune +// implicitPrimary returns the primary weight for the given rune // for which there is no entry for the rune in the collation table. // We take a different approach from the one specified in // https://unicode.org/reports/tr10/#Implicit_Weights, diff --git a/collate/build/trie_test.go b/collate/build/trie_test.go index 4d4f6e4d..5109e091 100644 --- a/collate/build/trie_test.go +++ b/collate/build/trie_test.go @@ -29,7 +29,7 @@ func makeTestTrie(t *testing.T) trie { idx.addTrie(n) tr, err := idx.generate() if err != nil { - t.Errorf(err.Error()) + t.Error(err) } return *tr } diff --git a/internal/catmsg/codec.go b/internal/catmsg/codec.go index 49c9fc97..547802b0 100644 --- a/internal/catmsg/codec.go +++ b/internal/catmsg/codec.go @@ -257,7 +257,7 @@ func (d *Decoder) setError(err error) { // Language returns the language in which the message is being rendered. // // The destination language may be a child language of the language used for -// encoding. For instance, a decoding language of "pt-PT"" is consistent with an +// encoding. For instance, a decoding language of "pt-PT" is consistent with an // encoding language of "pt". func (d *Decoder) Language() language.Tag { return d.tag } diff --git a/internal/cldrtree/generate.go b/internal/cldrtree/generate.go index 0f0b5f3b..bdd77ce8 100644 --- a/internal/cldrtree/generate.go +++ b/internal/cldrtree/generate.go @@ -21,7 +21,7 @@ func generate(b *Builder, t *Tree, w *gen.CodeWriter) error { fmt.Fprintf(w, "var tree = &cldrtree.Tree{locales, indices, buckets}\n\n") - w.WriteComment("Path values:\n" + b.stats()) + w.WriteComment("Path values:\n%s", b.stats()) fmt.Fprintln(w) // Generate enum types. diff --git a/internal/colltab/collelem.go b/internal/colltab/collelem.go index 0c23c8a4..bdcae9b1 100644 --- a/internal/colltab/collelem.go +++ b/internal/colltab/collelem.go @@ -354,7 +354,7 @@ const ( maxPrimary = illegalOffset + 1 ) -// implicitPrimary returns the primary weight for the a rune +// implicitPrimary returns the primary weight for the given rune // for which there is no entry for the rune in the collation table. // We take a different approach from the one specified in // https://unicode.org/reports/tr10/#Implicit_Weights, diff --git a/internal/gen/code.go b/internal/gen/code.go index 75435c9b..fa4002b4 100644 --- a/internal/gen/code.go +++ b/internal/gen/code.go @@ -342,8 +342,7 @@ func (w *CodeWriter) writeSlice(x interface{}, isArray bool) { if !reflect.DeepEqual(zero, x) { line := fmt.Sprintf("%#v,\n", x) line = line[strings.IndexByte(line, '{'):] - w.printf("%d: ", i) - w.printf(line) + w.printf("%d: %s", i, line) } } case reflect.Array: diff --git a/message/pipeline/pipeline.go b/message/pipeline/pipeline.go index 34f15f8a..2b07e38b 100644 --- a/message/pipeline/pipeline.go +++ b/message/pipeline/pipeline.go @@ -58,7 +58,7 @@ type Config struct { // 1. From the Language field in the file. // 2. If not present, from a valid language tag in the filename, separated // by dots (e.g. "en-US.json" or "incoming.pt_PT.xmb"). - // 3. If not present, from a the closest subdirectory in which the file + // 3. If not present, from the closest subdirectory in which the file // is contained that parses as a valid language tag. TranslationsPattern string diff --git a/number/doc.go b/number/doc.go index 87662308..1999bc8f 100644 --- a/number/doc.go +++ b/number/doc.go @@ -11,16 +11,15 @@ // // p := message.NewPrinter(language.English) // -// p.Printf("%v bottles of beer on the wall.", number.Decimal(1234)) +// p.Printf("%v bottles of beer on the wall.\n", number.Decimal(1234)) // // Prints: 1,234 bottles of beer on the wall. // -// p.Printf("%v of gophers lose too much fur", number.Percent(0.12)) +// p.Printf("%v of gophers lose too much fur.\n", number.Percent(0.12)) // // Prints: 12% of gophers lose too much fur. // -// p := message.NewPrinter(language.Dutch) -// -// p.Printf("There are %v bikes per household.", number.Decimal(1.2)) -// // Prints: Er zijn 1,2 fietsen per huishouden. +// p = message.NewPrinter(language.Dutch) +// p.Printf("There are %v bikes per household.\n", number.Decimal(1.2)) +// // Prints: There are 1,2 bikes per household. // // The width and scale specified in the formatting directives override the // configuration of the formatter. diff --git a/unicode/norm/maketables.go b/unicode/norm/maketables.go index 76534da2..09d40135 100644 --- a/unicode/norm/maketables.go +++ b/unicode/norm/maketables.go @@ -235,7 +235,7 @@ func loadUnicodeData() { } } -// compactCCC converts the sparse set of CCC values to a continguous one, +// compactCCC converts the sparse set of CCC values to a contiguous one, // reducing the number of bits needed from 8 to 6. func compactCCC() { m := make(map[uint8]uint8)