golang.org/x/text@v0.14.0/README.md (about) 1 # Go Text 2 3 [](https://pkg.go.dev/golang.org/x/text) 4 5 This repository holds supplementary Go libraries for text processing, many involving Unicode. 6 7 ## CLDR Versioning 8 9 It is important that the Unicode version used in `x/text` matches the one used 10 by your Go compiler. The `x/text` repository supports multiple versions of 11 Unicode and will match the version of Unicode to that of the Go compiler. At the 12 moment this is supported for Go compilers from version 1.7. 13 14 ## Download/Install 15 16 The easiest way to install is to run `go get -u golang.org/x/text`. You can 17 also manually git clone the repository to `$GOPATH/src/golang.org/x/text`. 18 19 ## Contribute 20 To submit changes to this repository, see http://golang.org/doc/contribute.html. 21 22 To generate the tables in this repository (except for the encoding tables), 23 run go generate from this directory. By default tables are generated for the 24 Unicode version in core and the CLDR version defined in 25 golang.org/x/text/unicode/cldr. 26 27 Running go generate will as a side effect create a DATA subdirectory in this 28 directory, which holds all files that are used as a source for generating the 29 tables. This directory will also serve as a cache. 30 31 ## Testing 32 Run 33 34 go test ./... 35 36 from this directory to run all tests. Add the "-tags icu" flag to also run 37 ICU conformance tests (if available). This requires that you have the correct 38 ICU version installed on your system. 39 40 TODO: 41 - updating unversioned source files. 42 43 ## Generating Tables 44 45 To generate the tables in this repository (except for the encoding 46 tables), run `go generate` from this directory. By default tables are 47 generated for the Unicode version in core and the CLDR version defined in 48 golang.org/x/text/unicode/cldr. 49 50 Running go generate will as a side effect create a DATA subdirectory in this 51 directory which holds all files that are used as a source for generating the 52 tables. This directory will also serve as a cache. 53 54 ## Versions 55 To update a Unicode version run 56 57 UNICODE_VERSION=x.x.x go generate 58 59 where `x.x.x` must correspond to a directory in https://www.unicode.org/Public/. 60 If this version is newer than the version in core it will also update the 61 relevant packages there. The idna package in x/net will always be updated. 62 63 To update a CLDR version run 64 65 CLDR_VERSION=version go generate 66 67 where `version` must correspond to a directory in 68 https://www.unicode.org/Public/cldr/. 69 70 Note that the code gets adapted over time to changes in the data and that 71 backwards compatibility is not maintained. 72 So updating to a different version may not work. 73 74 The files in DATA/{iana|icu|w3|whatwg} are currently not versioned. 75 76 ## Report Issues / Send Patches 77 78 This repository uses Gerrit for code changes. To learn how to submit changes to 79 this repository, see https://golang.org/doc/contribute.html. 80 81 The main issue tracker for the image repository is located at 82 https://github.com/golang/go/issues. Prefix your issue with "x/text:" in the 83 subject line, so it is easy to find.