Граф коммитов

729 Коммитов

Автор SHA1 Сообщение Дата
Gopher Robot efd25daf28 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I6b939f9a4f016b265d30fbd408f34705f89c0982
Reviewed-on: https://go-review.googlesource.com/c/text/+/626375
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-11-07 21:27:58 +00:00
Ian Lance Taylor 8a0e65e7b4 README: don't recommend go get
These days people will just import the packages and the go tool will
do the right thing. We don't need to explain it.

Add a pointer to the git repo, though.

For golang/go#62645

Change-Id: I0a1721eb456645c1422580497e3dcc9906a41223
Reviewed-on: https://go-review.googlesource.com/c/text/+/624296
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2024-11-02 04:17:02 +00:00
Dmitri Shuralyov fefda1abda internal/texttest: remove Run and Bench helpers
Versions of Go whose testing package doesn't yet support subtests and
sub-benchmarks are no longer supported. Drop an intermediate layer of
compatibility from the ./internal/texttest package.

The initial version of this change was git-generate'd with the script:

rm internal/testtext/go1_{6,7}.go
gofmt -r 'testtext.Run(t, n, f) -> t.Run(n, f)' -w .
gofmt -r 'testtext.Bench(b, n, f) -> b.Run(n, f)' -w .
goimports -w .

Unfortunately it seems gofmt -r dropped inner comments inside f, and
also added some spurious blank lines. So it was manually amended not
to include those changes.

Change-Id: I5bcb553b90ce392aada7896d576194be479f2616
Reviewed-on: https://go-review.googlesource.com/c/text/+/621575
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-10-21 18:16:43 +00:00
Dmitri Shuralyov a457f47ba2 all: normalize subtest names to NFC
LUCI builders upload test results to ResultDB, which permits printable
Unicode characters in test names, provided they're written in NFC form.

Change-Id: I0abf67beb52da722af97e6981c308c4b4d801cbb
Reviewed-on: https://go-review.googlesource.com/c/text/+/621555
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2024-10-21 18:15:57 +00:00
Daniël van Eeden 3043346206 x/text: Correct examples in number/doc
Playground example: https://go.dev/play/p/9cuRyaNveO8

Change-Id: I2fbc3fec0f3755eb3d11b47edfb2201d66fc622d
Reviewed-on: https://go-review.googlesource.com/c/text/+/614395
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2024-09-23 14:20:18 +00:00
cuishuang 38a95c2d4a all: fix some comments
Change-Id: I6ba7a9de50acfa522d96609abead28d207ab4f81
Reviewed-on: https://go-review.googlesource.com/c/text/+/611795
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Tim King <taking@google.com>
Auto-Submit: Tim King <taking@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-09-11 02:29:05 +00:00
Dmitri Shuralyov 20097e45e6 all: fix printf(var) mistakes detected by latest printf checker
The CodeWriter.WriteComment method is odd. It calls fmt.Sprintf
on its arguments so the caller doesn't need to, but isn't named
something like WriteCommentf as I'd expect. I tried renaming it,
but it became a bigger change than I wanted. Leaving that for a
future CL - this one just fixes clear mistakes to fix the build.

For golang/go#69267.

Change-Id: Ifba42d4512696194fbf21d6c8d3da76440b1ce9e
Reviewed-on: https://go-review.googlesource.com/c/text/+/610676
Reviewed-by: Tim King <taking@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-09-04 23:13:35 +00:00
Richard Miller 1e3e9fdab1 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 <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>
2024-08-20 17:46:13 +00:00
Gopher Robot b2bec85eb9 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I136532b352871ee714a4ccba9671a370a8abdd95
Reviewed-on: https://go-review.googlesource.com/c/text/+/602518
Auto-Submit: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: David Chase <drchase@google.com>
2024-08-06 15:16:44 +00:00
Russ Cox ae0cf96bbc LICENSE: update per Google Legal
Very minor tweaks:
 - Remove (c) pseudosymbol.
 - Remove "All Rights Reserved."
 - Change "Google Inc." (no longer exists) to "Google LLC".

[git-generate]
echo '
,s/\(c\) //
,s/ All rights reserved.//
,s/Google Inc./Google LLC/
w
q
' | sam -d LICENSE

Change-Id: I5c4495c11ac39e1361c3d370a7ceda78459cc089
Reviewed-on: https://go-review.googlesource.com/c/text/+/598587
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
2024-07-16 16:08:04 +00:00
Mauri de Souza Meneguzzo 9c2f3a2135 cmd/gotext: fix segfault in extract & rewrite commands
If extract or rewrite are called with no arguments it results in a
segmentation fault, since we dereference the out flag that was
not defined for these commands.

Fixes golang/go#62697

Change-Id: I697943b7c221431d0361bcec74c18183f6e141ea
GitHub-Last-Rev: 313ddfad2b
GitHub-Pull-Request: golang/text#46
Reviewed-on: https://go-review.googlesource.com/c/text/+/529255
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-14 20:26:09 +00:00
aimuz 59e1219a5f message: optimize lookupAndFormat function for better performance
This commit optimizes the lookupAndFormat function to reduce code redundancy
and improve performance. Benchmarks show a significant performance increase
across various Sprintf and Fprint functions.

benchstat old.txt new.txt
goos: darwin
goarch: arm64
pkg: golang.org/x/text/message
                         │   old.txt   │               new.txt               │
                         │   sec/op    │   sec/op     vs base                │
SprintfPadding-12          333.0n ± 1%   216.0n ± 1%  -35.15% (p=0.000 n=10)
SprintfEmpty-12            307.3n ± 1%   170.9n ± 1%  -44.38% (p=0.000 n=10)
SprintfString-12           313.5n ± 1%   178.9n ± 2%  -42.91% (p=0.000 n=10)
SprintfTruncateString-12   315.6n ± 1%   182.3n ± 2%  -42.23% (p=0.000 n=10)
SprintfQuoteString-12      320.1n ± 0%   198.6n ± 1%  -37.96% (p=0.000 n=10)
SprintfInt-12              325.0n ± 1%   203.1n ± 1%  -37.51% (p=0.000 n=10)
SprintfIntInt-12           340.2n ± 1%   233.2n ± 2%  -31.47% (p=0.000 n=10)
SprintfPrefixedInt-12      335.2n ± 1%   226.2n ± 1%  -32.54% (p=0.000 n=10)
SprintfFloat-12            330.1n ± 1%   209.7n ± 1%  -36.48% (p=0.000 n=10)
SprintfComplex-12          365.1n ± 1%   276.0n ± 2%  -24.41% (p=0.000 n=10)
SprintfBoolean-12          311.8n ± 0%   178.6n ± 3%  -42.72% (p=0.000 n=10)
SprintfHexString-12        328.1n ± 1%   204.8n ± 2%  -37.56% (p=0.000 n=10)
SprintfHexBytes-12         334.0n ± 2%   216.4n ± 1%  -35.20% (p=0.000 n=10)
SprintfBytes-12            340.8n ± 7%   213.9n ± 1%  -37.25% (p=0.000 n=10)
SprintfStringer-12         662.5n ± 3%   453.2n ± 1%  -31.59% (p=0.000 n=10)
SprintfStructure-12        373.8n ± 6%   275.7n ± 1%  -26.23% (p=0.000 n=10)
ManyArgs-12                485.1n ± 4%   425.4n ± 1%  -12.30% (p=0.000 n=10)
FprintInt-12               265.8n ± 2%   262.0n ± 1%   -1.41% (p=0.011 n=10)
FprintfBytes-12            348.4n ± 1%   258.8n ± 1%  -25.70% (p=0.000 n=10)
FprintIntNoAlloc-12        262.0n ± 2%   261.2n ± 2%        ~ (p=0.565 n=10)
geomean                    342.4n        233.7n       -31.75%

Change-Id: Id9999469f3fd0ca0290a5cb81f42fff81277b451
GitHub-Last-Rev: 904d624b13
GitHub-Pull-Request: golang/text#51
Reviewed-on: https://go-review.googlesource.com/c/text/+/584095
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-14 20:24:33 +00:00
Alan Donovan a20a3e2496 x/text: update x/tools for go/ssa range-over-func fix
CL 584295 added a quick fix to a panic in go/ssa when it
encounters range-over-func. This CL imports that fix.
A principled fix will land in CL 555075.

Fixes golang/go#67348

Change-Id: I49dd63d4845d0fc804b6e7d0353584a57aea19fc
Reviewed-on: https://go-review.googlesource.com/c/text/+/584977
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-13 21:04:30 +00:00
Zach Young 8d533a0c40 encoding/charmap: update UCM spec file URL prefix
UCM spec files used by encoding/maketables.go moved from
source.icu-project.org to github.com, and maketables is failing.

The new repo is at
https://github.com/unicode-org/icu-data/tree/main/charset/data/ucm.

Changed all UCM mappings to use the "raw endpoint" prefix,
https://raw.githubusercontent.com/unicode-org/icu-data/main/charset/data/ucm/….

Fixes golang/go#64504.

Change-Id: Ib2ccf948ad79578efc4a0c356bb25325190dc333
GitHub-Last-Rev: 2a277c7d09
GitHub-Pull-Request: golang/text#48
Reviewed-on: https://go-review.googlesource.com/c/text/+/546576
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dominik Honnef <dominik@honnef.co>
2024-04-15 18:14:38 +00:00
Dmitri Shuralyov 6c97a165dd all: update go directive to 1.18
Done with:

go get go@1.18
go mod tidy
go fix ./...

Using go1.21.3.

Also update code generators to use only the new go:build lines,
not the old +build ones.

For golang/go#60268.

Change-Id: I832981d939ab0aad5c941555a6a4cd005958a189
Reviewed-on: https://go-review.googlesource.com/c/text/+/534242
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2023-10-11 21:58:48 +00:00
cui fliter f488e191e6 unicode/norm: fix function name on comment
Change-Id: I1d7daf1101c289f99367db2b23105e99d7e19b65
Reviewed-on: https://go-review.googlesource.com/c/text/+/523255
Run-TryBot: shuang cui <imcusg@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joedian Reid <joedian@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-08-28 17:26:32 +00:00
Smith A fb697c0580 cmd/gotext: actually use -dir flag
gotext has the read -dir flag but is not used.
The dir parameter should be passed to pipeline.Config

Fixes golang/go#61507

Change-Id: I242a768964fe56c4c7877de9dc487777c6815dae
Reviewed-on: https://go-review.googlesource.com/c/text/+/512015
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2023-07-21 21:34:41 +00:00
Il Harper f3e69ed4a8 cmd/gotext: fix misbehaviors
The existing implementation has misbehaviors described in golang/go#56842:

- `gotext extract` ignores `lang` flag
- `gotext generate` ignores `out` flag
- Misbehavior of `gotext generate` when no flag specified

This commit fixes these bugs:

- Update `Command.UsageLine` for `cmdGenerate`
- Fix flag misbehaviors by encapsuling flag definition statements into individual `Command.Init()` functions of commands
- Fix `gotext generate` misbehavior by executing `pipeline.State.Merge()` before `pipeline.State.Generate()`

Fixes golang/go#56842

Change-Id: Id5e324b573b2b389bec22181482a97445230d0cc
Reviewed-on: https://go-review.googlesource.com/c/text/+/452115
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2023-07-20 17:29:45 +00:00
cui fliter ab07ad1b65 all: remove repetitive words
Change-Id: I496265fcad6dee919eff6fc1fbcf9121ae61730f
Reviewed-on: https://go-review.googlesource.com/c/text/+/509855
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-07-17 14:36:42 +00:00
Dmitri Shuralyov e50348080f encoding/japanese, language: shorten very long sub-test names
Some of the generated sub-test names end up being excessively long,
which doesn't mix well with them being stored as test IDs that track
test runs over time. Replacing test case names with numbers harms
their readability, so start by trimming a few that end up being 500+
bytes in length.

Change-Id: Id3b22105efc08eb1bb51436aa257682d357d662c
Reviewed-on: https://go-review.googlesource.com/c/text/+/506416
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-06-26 23:12:51 +00:00
Russ Cox 2df65d769a all: regenerate for Unicode 15.0.0
go generate ./...

This CL only contains the changes made by go generate ./...

For golang/go#55079.

Change-Id: I840205f9046e6ccaab370b1dc5393aaf02d5fcb2
Reviewed-on: https://go-review.googlesource.com/c/text/+/503036
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
2023-06-13 19:00:12 +00:00
Russ Cox e3c038a67f all: prepare for Unicode 15.0.0
internal/gen has never been updated for Go 1.17's //go:build tags.
Do that, and add the entry for Unicode 15.0.0.

Unicode 15.0.0 will change 9fff to be a CJK ideograph, which will
break the unicode/runenames example test.
Delete that part of the example.

For golang/go#55079.

Change-Id: I12b0c6d031d6d6e1970c8fe6eb5453fa64c9f365
Reviewed-on: https://go-review.googlesource.com/c/text/+/503035
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
2023-06-13 18:59:47 +00:00
Marcel van Lohuizen 3a7a2557e7 internal/export/idna: make more space for mapping index
This prepares for an upcoming Unicode upgrade.

Beyond Unicode 13 the size of mappings will grow beyond
what can be represented in the allocated 13 bits. Instread
of doubling the size of info, we introduce a table of indices
into the mappings data. This also allows us to remove the
length byte, reducing the overhead of introducing this new
table.

This change allows for about a 5x growth of the number
of mappings, which should suffice for the foreseeable
future.

Change-Id: Id475dc2473145a1f36bd83b983fa4aa170df6206
Reviewed-on: https://go-review.googlesource.com/c/text/+/501515
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-12 16:55:37 +00:00
Dmitri Shuralyov d61dd50441 go.mod: delete repeated "indirect"
It got added by 'go mod tidy' in CL 471399
because the '; ' separator was missing.

For golang/go#48523.
For golang/go#58737.

Change-Id: I63642a4f49beb9679f9c5bbb4e2aa8ed0cc73c9e
Reviewed-on: https://go-review.googlesource.com/c/text/+/501835
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2023-06-08 17:02:29 +00:00
Timothy Gu efb744f6d9 internal/export/idna: fix infinite loop in Go pre-1.10
lookupString returns 0 for incomplete UTF-8 sequences, so to
prevent infinite loops we must specifically check for that case.
However, CL 73730 which fixed this issue in 2017 was lost in the
shuffle that allowed multiple Unicode versions in x/text (CL 83235),
and the fix was never applied to idna9.0.0.go.

This CL fixes that oversight.

Updates golang/go#22184

Change-Id: I3a6ab08b157f4017560020ff259d1afbe49a9e71
Reviewed-on: https://go-review.googlesource.com/c/text/+/361494
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
2023-06-08 16:54:15 +00:00
cui fliter 48e4a4a957 all: fix some comments
Change-Id: I1ae88db264cb5fb513773241ec2a8e7694c8c6e5
Reviewed-on: https://go-review.googlesource.com/c/text/+/480175
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-04-04 14:19:46 +00:00
Ian Lance Taylor 9db913aaf2 go.mod: update to newer x/tools
get get -u golang.org/x/tools
go mod tidy

Fixes golang/go#58737

Change-Id: I5c33106d65183b5b5ac5008d7ca532458831f021
Reviewed-on: https://go-review.googlesource.com/c/text/+/471399
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2023-02-27 23:15:59 +00:00
Oleksandr Redko 30dadde318 all: correct comment typos
Change-Id: I1e31e93937e960fc7fcc4672208dae067e1f33e7
GitHub-Last-Rev: 9cdbf6ffdf
GitHub-Pull-Request: golang/text#42
Reviewed-on: https://go-review.googlesource.com/c/text/+/465655
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-02-07 17:11:07 +00:00
cui fliter 71a9c9afc4 all: fix some comments
Change-Id: Idc053f5d3a787746c0205dbda5cc34b7d2be4655
Reviewed-on: https://go-review.googlesource.com/c/text/+/464255
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2023-01-31 16:01:06 +00:00
Damien Neil ec5565b1b7 README.md: update documentation of module versioning
Since x/ repos are now automatically periodically tagged, the previous
definition of the minor and patch versions of this module are now
obsolete. Delete that section of the README; regular semantic versioning
rules apply here.

Fixes golang/go#57089

Change-Id: I394ae4bb4eec1aa21c26b678b9ed1251b1eecf14
Reviewed-on: https://go-review.googlesource.com/c/text/+/455516
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
2022-12-06 18:24:05 +00:00
Tomasz Jezierski c8236a6712 unicode/bidi: remove unused global
It seems like controlToClass variable is not used anymore.
As it allocates in init we should remove it.
Before:
init golang.org/x/text/unicode/bidi @0.70 ms, 0.003 ms clock, 272 bytes, 2 allocs
After:
init golang.org/x/text/unicode/bidi @0.79 ms, 0 ms clock, 0 bytes, 0 allocs

Change-Id: I79b236feb841c45908431cdb440bd1f4eb082d00
Reviewed-on: https://go-review.googlesource.com/c/text/+/449595
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-11-10 18:46:32 +00:00
cui fliter ada7473102 all: remove redundant type conversion
Change-Id: Ie059c983bcb3cd6bce7b2097720cbee899abf771
GitHub-Last-Rev: ce456997ea
GitHub-Pull-Request: golang/text#33
Reviewed-on: https://go-review.googlesource.com/c/text/+/429059
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-11-09 15:35:36 +00:00
Sebastiaan van Stijn 1bdb400fb3 language: remove compatibility with go < 1.2
This was added in 9f86e0be98 to provide compatibility with go1.1, which is an obsolete version.

Change-Id: Ie3edbf9bd377608344e14ba327c437cbc4aa0c9a
GitHub-Last-Rev: a009d8c981
GitHub-Pull-Request: golang/text#37
Reviewed-on: https://go-review.googlesource.com/c/text/+/442796
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-10-14 17:33:59 +00:00
Heschi Kreinick 252bee0341 go.mod: ignore cyclic dependency for tagging
Another followup to CL 439295, sorry. I forgot x/mod is also a problem,
just via a longer path.

For golang/go#48523.

Change-Id: I0e1685bedc0747f8a939cd650d603910450c61d6
Reviewed-on: https://go-review.googlesource.com/c/text/+/442518
Auto-Submit: Heschi Kreinick <heschi@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-10-12 20:24:58 +00:00
Heschi Kreinick ecab6e5ab6 go.mod: ignore cyclic dependency for tagging
Followup to CL 439295; let's try tagging indirect deps too.

For golang/go#48523.

Change-Id: I35c6b8a3ad382b585c0042888abf085e053ef8fb
Reviewed-on: https://go-review.googlesource.com/c/text/+/442517
Auto-Submit: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Heschi Kreinick <heschi@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-10-12 20:09:49 +00:00
cui fliter 369c86ba11 all: fix a few function names on comments
Change-Id: Ibdf787b7a62e8201393f2a4487cd8c67d8b0c91d
Reviewed-on: https://go-review.googlesource.com/c/text/+/441717
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
2022-10-12 13:49:10 +00:00
Roland Shoemaker 434eadcdbc language: reject excessively large Accept-Language strings
The BCP 47 tag parser has quadratic time complexity due to inherent
aspects of its design. Since the parser is, by design, exposed to
untrusted user input, this can be leveraged to force a program to
consume significant time parsing Accept-Language headers.

The parser cannot be easily rewritten to fix this behavior for
various reasons. Instead the solution implemented in this CL is to
limit the total complexity of tags passed into ParseAcceptLanguage
by limiting the number of dashes in the string to 1000. This should
be more than enough for the majority of real world use cases, where
the number of tags being sent is likely to be in the single digits.

Thanks to the OSS-Fuzz project for discovering this issue and to Adam
Korczynski (ADA Logics) for writing the fuzz case and for reporting the
issue.

Fixes CVE-2022-32149
Fixes golang/go#56152

Change-Id: I7bda1d84cee2b945039c203f26869d58ee9374ae
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1565112
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Reviewed-on: https://go-review.googlesource.com/c/text/+/442235
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
2022-10-11 16:58:47 +00:00
Heschi Kreinick 23407e72ed go.mod: ignore cyclic dependency for tagging
tools and text have a cyclic dependency, which needs to be broken during
the upgrading/tagging process. This direction is due to
message/pipeline, which is marked as "IN DEVELOPMENT", so I think it's
less important to keep it up to date.

For golang/go#48523.

Change-Id: Ic4cdfd05628649035eee8a37e662cf22827c705b
Reviewed-on: https://go-review.googlesource.com/c/text/+/439295
Run-TryBot: Heschi Kreinick <heschi@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-10-05 20:17:40 +00:00
cui fliter b18d3dd8a4 secure/precis: replace bytes.Compare with bytes.Equal
Change-Id: Ifa6ba05253b38e1cb3d5791e62b36a523fb68e52
GitHub-Last-Rev: 2d7de01c3d
GitHub-Pull-Request: golang/text#36
Reviewed-on: https://go-review.googlesource.com/c/text/+/438559
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2022-10-04 22:54:18 +00:00
cui fliter 795e854ff3 all: replace io/ioutil with io and os package
For golang/go#45557

Change-Id: Ibf78d87cc94baa0d1696e5abc2edad3d2723e42b
GitHub-Last-Rev: ad314caaff
GitHub-Pull-Request: golang/text#34
Reviewed-on: https://go-review.googlesource.com/c/text/+/430815
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Meng Zhuo <mzh@golangcn.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-09-19 15:59:07 +00:00
Roland Shoemaker b0ca10ff35 internal/language: bump script types to uint16 and update registry
The IANA language-subtag-registry now contains more than 256 scripts,
causing the uint8 types to overflow during table generation. The
internal script types are bumped to uint16 which should be more than
enough.

Fixes golang/go#45093

Change-Id: I58184902e6652f488521d084fce6e0b424121825
Reviewed-on: https://go-review.googlesource.com/c/text/+/304029
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
2022-08-17 17:41:31 +00:00
Jaroslavs Samcuks ba9b0e1d4b go.mod: update x/tools to HEAD
go get -u golang.org/x/tools
go mod tidy

x/tools/go/ssa is used by message/pipeline. Generics instantiation in
x/tools@0.1.11 could be confused with container index. However,
x/tools/go/ssa does have it fixed in x/tools@0.1.12 (see golang/go#52834).
This change upgrades the required version to ensure that fewer users of
message/pipelines have issues.

Updates golang/go#54086

Change-Id: I03882a7bb2c75a8f16ef376d06f2cf714d39e7a2
GitHub-Last-Rev: 351404b6db
GitHub-Pull-Request: golang/text#32
Reviewed-on: https://go-review.googlesource.com/c/text/+/422414
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tim King <taking@google.com>
Reviewed-by: Tim King <taking@google.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
2022-08-12 21:31:49 +00:00
Russ Cox d03b418000 A+C: delete AUTHORS and CONTRIBUTORS
In 2009, Google's open-source lawyers asked us to create the AUTHORS
file to define "The Go Authors", and the CONTRIBUTORS file was in
keeping with open source best practices of the time.

Re-reviewing our repos now in 2022, the open-source lawyers are
comfortable with source control history taking the place of the
AUTHORS file, and most open source projects no longer maintain
CONTRIBUTORS files.

To ease maintenance, remove AUTHORS and CONTRIBUTORS from all repos.

For golang/go#53961.

Change-Id: I3abeb5f16d9a9446e16a3a5318d22a9c622db0b6
Reviewed-on: https://go-review.googlesource.com/c/text/+/418923
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
2022-07-22 15:53:01 +00:00
Kevin Smith b4bca84b03 language/display: fix Tag method comment
Minor fix to comment.

Change-Id: I181de709f02faf433e97f38208039bf789e6b71d
GitHub-Last-Rev: fd7f6501c5
GitHub-Pull-Request: golang/text#19
Reviewed-on: https://go-review.googlesource.com/c/text/+/293469
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-09 17:43:42 +00:00
Bryan C. Mills ea49e3e2d5 go.mod: update x/tools to HEAD
x/tools/go/ssa is used by message/pipeline, and at its latest release
does not support generics. However, x/tools/go/ssa does seem to
support generics at head; upgrade to fix a build break if Go 1.19
ships with generic APIs in any imported packages.

Fixes golang/go#52711.

Change-Id: I75492dbcdfef9024ec2bc324f44c01a4239e1efd
Reviewed-on: https://go-review.googlesource.com/c/text/+/403852
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
2022-05-04 18:46:55 +00:00
Ian Lance Taylor 78819d01d0 go.mod: update to golang.org/x/text v0.1.10
go get -u golang.org/x/tools
go mod tidy

For golang/go#50558
Fixes golang/go#52552

Change-Id: I233aa90922fc23800563fd05beb4be6f7e87cf5b
Reviewed-on: https://go-review.googlesource.com/c/text/+/402254
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-04-28 23:30:42 +00:00
Russ Cox 8db23f83d6 all: gofmt
Gofmt to update doc comments to the new formatting.

For golang/go#51082.

Change-Id: I3e3c5666d5e901f2c5303911ddb548e3dd567fce
Reviewed-on: https://go-review.googlesource.com/c/text/+/399603
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-04-11 22:10:44 +00:00
Bryan C. Mills d1c84af989 message/pipeline: skip TestFullCycle on plan9-arm
This test has timed out several times recently on this builder. The
test is pretty slow even on Linux, and may be especially
filesystem-intensive.

For golang/go#49338

Change-Id: Ife2bb399b10f369f815055bb0ad44bb007f606b7
Reviewed-on: https://go-review.googlesource.com/c/text/+/380414
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-24 02:11:20 +00:00
Amelia Downs 18b340fc7a language: fix typo in update docs
Change-Id: Ied188b87f0a9a1a4fb160b2a7ba239ed70b843a6
Reviewed-on: https://go-review.googlesource.com/c/text/+/359715
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Amelia Downs <adowns@vmware.com>
Trust: Cherry Mui <cherryyz@google.com>
2021-11-05 21:28:22 +00:00
Shengyu Zhang 7d8748685d text/unicod/bidi: remove duplicate assignment
Fixes golang/go#43623

Change-Id: I4da134cccaf6a9e5331229a0ac2a60e5cb711e92
GitHub-Last-Rev: ae0f2d91f8
GitHub-Pull-Request: golang/text#29
Reviewed-on: https://go-review.googlesource.com/c/text/+/358834
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Trust: Marcel van Lohuizen <mpvl@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>
2021-11-05 21:17:44 +00:00