From 7f18468c09d6cb0126a4318939a47da2f6e0aac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Miri=C4=87?= Date: Fri, 14 Aug 2020 10:32:54 +0200 Subject: [PATCH] Replace dep with Go modules Closes #1070 --- .gitignore | 12 + Gopkg.lock | 734 -- Gopkg.toml | 108 - go.mod | 92 + go.sum | 179 + vendor/github.com/Azure/go-ntlmssp/README.md | 29 + .../DataDog/datadog-go/statsd/README.md | 64 + .../github.com/GeertJohan/go.rice/.gitignore | 8 + .../github.com/GeertJohan/go.rice/README.md | 151 + .../PuerkitoBio/goquery/.gitattributes | 1 + .../github.com/PuerkitoBio/goquery/.gitignore | 16 + .../github.com/PuerkitoBio/goquery/README.md | 146 + vendor/github.com/Shopify/sarama/.gitignore | 26 + vendor/github.com/Shopify/sarama/CHANGELOG.md | 503 ++ vendor/github.com/Shopify/sarama/README.md | 39 + vendor/github.com/Shopify/sarama/Vagrantfile | 20 + .../Soontao/goHttpDigestClient/.gitignore | 33 + .../Soontao/goHttpDigestClient/README.md | 26 + .../github.com/andybalholm/brotli/README.md | 5 + vendor/github.com/andybalholm/brotli/go.mod | 5 + vendor/github.com/andybalholm/brotli/go.sum | 2 + .../github.com/andybalholm/cascadia/LICENSE | 0 .../github.com/andybalholm/cascadia/README.md | 7 + vendor/github.com/andybalholm/cascadia/go.mod | 3 + vendor/github.com/daaku/go.zipexe/readme.md | 5 + vendor/github.com/dlclark/regexp2/.gitignore | 25 + vendor/github.com/dlclark/regexp2/ATTRIB | 133 + vendor/github.com/dlclark/regexp2/README.md | 67 + vendor/github.com/dop251/goja/.gitignore | 3 + vendor/github.com/dop251/goja/README.md | 253 + .../dop251/goja/ast/README.markdown | 1068 +++ .../dop251/goja/file/README.markdown | 110 + .../dop251/goja/parser/README.markdown | 184 + .../dop251/goja/token/README.markdown | 171 + vendor/github.com/dop251/goja/token/tokenfmt | 222 + .../dustin/go-humanize/README.markdown | 124 + .../eapache/go-resiliency/breaker/README.md | 34 + .../eapache/go-xerial-snappy/.gitignore | 24 + .../eapache/go-xerial-snappy/README.md | 13 + vendor/github.com/eapache/queue/.gitignore | 23 + vendor/github.com/eapache/queue/README.md | 16 + vendor/github.com/fatih/color/README.md | 177 + vendor/github.com/gedex/inflector/README.md | 25 + vendor/github.com/ghodss/yaml/.gitignore | 20 + vendor/github.com/ghodss/yaml/README.md | 121 + vendor/github.com/gin-contrib/sse/README.md | 58 + vendor/github.com/gin-gonic/gin/.gitignore | 4 + vendor/github.com/gin-gonic/gin/BENCHMARKS.md | 298 + vendor/github.com/gin-gonic/gin/CHANGELOG.md | 191 + vendor/github.com/gin-gonic/gin/README.md | 977 +++ .../go-sourcemap/sourcemap/README.md | 43 + vendor/github.com/golang/gddo/gosrc/LICENSE | 27 - vendor/github.com/golang/snappy/.gitignore | 16 + vendor/github.com/golang/snappy/README | 107 + vendor/github.com/gorilla/context/README.md | 7 + .../github.com/gorilla/mux/ISSUE_TEMPLATE.md | 11 + vendor/github.com/gorilla/mux/README.md | 560 ++ .../github.com/gorilla/websocket/.gitignore | 25 + vendor/github.com/gorilla/websocket/README.md | 64 + vendor/github.com/gorilla/websocket/go.mod | 3 + vendor/github.com/gorilla/websocket/go.sum | 0 .../inconshreveable/mousetrap/README.md | 23 + .../julienschmidt/httprouter/README.md | 266 + vendor/github.com/kardianos/osext/README.md | 21 + .../kelseyhightower/envconfig/MAINTAINERS | 2 + .../kelseyhightower/envconfig/README.md | 192 + .../kelseyhightower/envconfig/go.mod | 1 + .../klauspost/compress/fse/README.md | 79 + .../klauspost/compress/huff0/.gitignore | 1 + .../klauspost/compress/huff0/README.md | 87 + .../klauspost/compress/snappy/.gitignore | 16 + .../klauspost/compress/snappy/README | 107 + .../klauspost/compress/snappy/runbench.cmd | 2 + .../klauspost/compress/zstd/README.md | 383 + .../compress/zstd/internal/xxhash/README.md | 58 + .../go-windows-terminal-sequences/README.md | 40 + .../go-windows-terminal-sequences/go.mod | 1 + .../testdata/dependent-chart-alias/LICENSE | 1 - .../LICENSE | 1 - .../LICENSE | 1 - .../LICENSE | 1 - .../pkg/chartutil/testdata/frobnitz/LICENSE | 1 - .../testdata/frobnitz_backslash/LICENSE | 1 - .../chartutil/testdata/joonix/charts/frobnitz | 1 - .../repository/cache/local-index.yaml | 1 - .../repository/cache/local-index.yaml | 1 - .../github.com/labstack/echo/.gitattributes | 20 + vendor/github.com/labstack/echo/.gitignore | 7 + vendor/github.com/labstack/echo/Gopkg.lock | 75 + vendor/github.com/labstack/echo/Gopkg.toml | 87 + vendor/github.com/labstack/echo/README.md | 62 + .../labstack/gommon/color/README.md | 86 + .../github.com/labstack/gommon/log/README.md | 5 + vendor/github.com/manyminds/api2go/.gitignore | 23 + vendor/github.com/manyminds/api2go/README.md | 673 ++ .../manyminds/api2go/jsonapi/Readme.md | 14 + .../github.com/mattn/go-colorable/README.md | 48 + vendor/github.com/mattn/go-isatty/README.md | 50 + .../mitchellh/mapstructure/README.md | 46 + vendor/github.com/nu7hatch/gouuid/.gitignore | 11 + vendor/github.com/nu7hatch/gouuid/README.md | 21 + vendor/github.com/oxtoacart/bpool/README.md | 65 + vendor/github.com/pierrec/lz4/.gitignore | 31 + vendor/github.com/pierrec/lz4/README.md | 31 + vendor/github.com/pkg/errors/.gitignore | 24 + vendor/github.com/pkg/errors/README.md | 52 + .../github.com/rcrowley/go-metrics/.gitignore | 9 + .../github.com/rcrowley/go-metrics/README.md | 168 + .../github.com/rcrowley/go-metrics/memory.md | 285 + .../rcrowley/go-metrics/validate.sh | 10 + vendor/github.com/serenize/snaker/README.md | 25 + vendor/github.com/sirupsen/logrus/.gitignore | 2 + .../github.com/sirupsen/logrus/CHANGELOG.md | 158 + vendor/github.com/sirupsen/logrus/README.md | 494 ++ vendor/github.com/sirupsen/logrus/go.mod | 11 + vendor/github.com/sirupsen/logrus/go.sum | 15 + vendor/github.com/spf13/afero/README.md | 452 ++ vendor/github.com/spf13/cobra/.gitignore | 36 + vendor/github.com/spf13/cobra/.mailmap | 3 + vendor/github.com/spf13/cobra/README.md | 736 ++ .../spf13/cobra/bash_completions.md | 256 + .../github.com/spf13/cobra/cobra/cmd/add.go | 179 - .../spf13/cobra/cobra/cmd/helpers.go | 168 - .../github.com/spf13/cobra/cobra/cmd/init.go | 234 - .../spf13/cobra/cobra/cmd/license_agpl.go | 683 -- .../spf13/cobra/cobra/cmd/license_apache_2.go | 238 - .../cobra/cobra/cmd/license_bsd_clause_2.go | 71 - .../cobra/cobra/cmd/license_bsd_clause_3.go | 78 - .../spf13/cobra/cobra/cmd/license_gpl_2.go | 376 - .../spf13/cobra/cobra/cmd/license_gpl_3.go | 711 -- .../spf13/cobra/cobra/cmd/license_lgpl.go | 186 - .../spf13/cobra/cobra/cmd/license_mit.go | 63 - .../spf13/cobra/cobra/cmd/licenses.go | 118 - .../spf13/cobra/cobra/cmd/project.go | 200 - .../github.com/spf13/cobra/cobra/cmd/root.go | 79 - .../cobra/cobra/cmd/testdata/LICENSE.golden | 202 - vendor/github.com/spf13/cobra/cobra/main.go | 20 - vendor/github.com/spf13/cobra/doc/man_docs.go | 236 - vendor/github.com/spf13/cobra/doc/md_docs.go | 159 - .../github.com/spf13/cobra/doc/rest_docs.go | 185 - vendor/github.com/spf13/cobra/doc/util.go | 51 - .../github.com/spf13/cobra/doc/yaml_docs.go | 169 - vendor/github.com/spf13/pflag/.gitignore | 2 + vendor/github.com/spf13/pflag/README.md | 296 + vendor/github.com/tidwall/gjson/README.md | 401 ++ vendor/github.com/tidwall/match/README.md | 32 + vendor/github.com/tidwall/pretty/README.md | 124 + vendor/github.com/ugorji/go/codec/README.md | 206 + vendor/github.com/ugorji/go/codec/noop.go | 219 - vendor/github.com/ugorji/go/codec/test.py | 126 + vendor/github.com/ugorji/go/codec/xml.go | 508 -- vendor/github.com/urfave/negroni/.gitignore | 1 + vendor/github.com/urfave/negroni/CHANGELOG.md | 64 + vendor/github.com/urfave/negroni/README.md | 547 ++ .../valyala/bytebufferpool/README.md | 21 + .../github.com/valyala/fasttemplate/README.md | 85 + vendor/github.com/viki-org/dnscache/readme.md | 38 + .../github.com/zyedidia/highlight/README.md | 127 + vendor/golang.org/x/net/html/atom/gen.go | 712 -- vendor/golang.org/x/net/http2/.gitignore | 2 + vendor/golang.org/x/net/http2/Dockerfile | 51 + vendor/golang.org/x/net/http2/README | 20 + vendor/golang.org/x/sys/unix/.gitignore | 2 + vendor/golang.org/x/sys/unix/README.md | 173 + vendor/golang.org/x/sys/unix/mkall.sh | 188 + vendor/golang.org/x/sys/unix/mkerrors.sh | 581 ++ vendor/golang.org/x/sys/unix/mkpost.go | 97 - vendor/golang.org/x/sys/unix/mksyscall.pl | 341 + .../x/sys/unix/mksyscall_solaris.pl | 289 + .../golang.org/x/sys/unix/mksysctl_openbsd.pl | 264 + .../golang.org/x/sys/unix/mksysnum_darwin.pl | 39 + .../x/sys/unix/mksysnum_dragonfly.pl | 50 + .../golang.org/x/sys/unix/mksysnum_freebsd.pl | 50 + .../golang.org/x/sys/unix/mksysnum_netbsd.pl | 58 + .../golang.org/x/sys/unix/mksysnum_openbsd.pl | 50 + vendor/golang.org/x/sys/unix/types_darwin.go | 277 - .../golang.org/x/sys/unix/types_dragonfly.go | 280 - vendor/golang.org/x/sys/unix/types_freebsd.go | 402 -- vendor/golang.org/x/sys/unix/types_netbsd.go | 270 - vendor/golang.org/x/sys/unix/types_openbsd.go | 282 - vendor/golang.org/x/sys/unix/types_solaris.go | 283 - vendor/golang.org/x/text/cases/gen.go | 839 --- vendor/golang.org/x/text/cases/gen_trieval.go | 219 - .../x/text/collate/build/builder.go | 702 -- .../x/text/collate/build/colelem.go | 294 - .../x/text/collate/build/contract.go | 309 - .../golang.org/x/text/collate/build/order.go | 393 - .../golang.org/x/text/collate/build/table.go | 81 - .../golang.org/x/text/collate/build/trie.go | 290 - .../golang.org/x/text/collate/maketables.go | 553 -- vendor/golang.org/x/text/internal/gen.go | 52 - vendor/golang.org/x/text/internal/gen/code.go | 369 - vendor/golang.org/x/text/internal/gen/gen.go | 333 - .../x/text/internal/triegen/compact.go | 58 - .../x/text/internal/triegen/print.go | 251 - .../x/text/internal/triegen/triegen.go | 494 -- vendor/golang.org/x/text/internal/ucd/ucd.go | 371 - vendor/golang.org/x/text/language/gen.go | 1712 ----- .../golang.org/x/text/language/gen_common.go | 20 - .../golang.org/x/text/language/gen_index.go | 162 - vendor/golang.org/x/text/unicode/bidi/gen.go | 133 - .../x/text/unicode/bidi/gen_ranges.go | 57 - .../x/text/unicode/bidi/gen_trieval.go | 64 - vendor/golang.org/x/text/unicode/cldr/base.go | 105 - vendor/golang.org/x/text/unicode/cldr/cldr.go | 130 - .../golang.org/x/text/unicode/cldr/collate.go | 359 - .../golang.org/x/text/unicode/cldr/decode.go | 171 - .../golang.org/x/text/unicode/cldr/makexml.go | 400 -- .../golang.org/x/text/unicode/cldr/resolve.go | 602 -- .../golang.org/x/text/unicode/cldr/slice.go | 144 - vendor/golang.org/x/text/unicode/cldr/xml.go | 1494 ---- .../x/text/unicode/norm/maketables.go | 976 --- .../golang.org/x/text/unicode/norm/triegen.go | 117 - .../x/text/unicode/rangetable/gen.go | 115 - .../x/text/unicode/rangetable/merge.go | 260 - .../x/text/unicode/rangetable/rangetable.go | 70 - .../x/text/unicode/rangetable/tables10.0.0.go | 6378 ----------------- .../x/text/unicode/rangetable/tables9.0.0.go | 5737 --------------- .../go-playground/validator.v8/.gitignore | 29 + .../go-playground/validator.v8/README.md | 366 + vendor/gopkg.in/guregu/null.v3/.gitignore | 2 + vendor/gopkg.in/guregu/null.v3/README.md | 75 + vendor/gopkg.in/yaml.v2/README.md | 135 + vendor/gopkg.in/yaml.v2/go.mod | 5 + 224 files changed, 16759 insertions(+), 33428 deletions(-) delete mode 100644 Gopkg.lock delete mode 100644 Gopkg.toml create mode 100644 go.mod create mode 100644 go.sum create mode 100644 vendor/github.com/Azure/go-ntlmssp/README.md create mode 100644 vendor/github.com/DataDog/datadog-go/statsd/README.md create mode 100644 vendor/github.com/GeertJohan/go.rice/.gitignore create mode 100644 vendor/github.com/GeertJohan/go.rice/README.md create mode 100644 vendor/github.com/PuerkitoBio/goquery/.gitattributes create mode 100644 vendor/github.com/PuerkitoBio/goquery/.gitignore create mode 100644 vendor/github.com/PuerkitoBio/goquery/README.md create mode 100644 vendor/github.com/Shopify/sarama/.gitignore create mode 100644 vendor/github.com/Shopify/sarama/CHANGELOG.md create mode 100644 vendor/github.com/Shopify/sarama/README.md create mode 100644 vendor/github.com/Shopify/sarama/Vagrantfile create mode 100644 vendor/github.com/Soontao/goHttpDigestClient/.gitignore create mode 100644 vendor/github.com/Soontao/goHttpDigestClient/README.md create mode 100644 vendor/github.com/andybalholm/brotli/README.md create mode 100644 vendor/github.com/andybalholm/brotli/go.mod create mode 100644 vendor/github.com/andybalholm/brotli/go.sum mode change 100755 => 100644 vendor/github.com/andybalholm/cascadia/LICENSE create mode 100644 vendor/github.com/andybalholm/cascadia/README.md create mode 100644 vendor/github.com/andybalholm/cascadia/go.mod create mode 100644 vendor/github.com/daaku/go.zipexe/readme.md create mode 100644 vendor/github.com/dlclark/regexp2/.gitignore create mode 100644 vendor/github.com/dlclark/regexp2/ATTRIB create mode 100644 vendor/github.com/dlclark/regexp2/README.md create mode 100644 vendor/github.com/dop251/goja/.gitignore create mode 100644 vendor/github.com/dop251/goja/README.md create mode 100644 vendor/github.com/dop251/goja/ast/README.markdown create mode 100644 vendor/github.com/dop251/goja/file/README.markdown create mode 100644 vendor/github.com/dop251/goja/parser/README.markdown create mode 100644 vendor/github.com/dop251/goja/token/README.markdown create mode 100644 vendor/github.com/dop251/goja/token/tokenfmt create mode 100644 vendor/github.com/dustin/go-humanize/README.markdown create mode 100644 vendor/github.com/eapache/go-resiliency/breaker/README.md create mode 100644 vendor/github.com/eapache/go-xerial-snappy/.gitignore create mode 100644 vendor/github.com/eapache/go-xerial-snappy/README.md create mode 100644 vendor/github.com/eapache/queue/.gitignore create mode 100644 vendor/github.com/eapache/queue/README.md create mode 100644 vendor/github.com/fatih/color/README.md create mode 100644 vendor/github.com/gedex/inflector/README.md create mode 100644 vendor/github.com/ghodss/yaml/.gitignore create mode 100644 vendor/github.com/ghodss/yaml/README.md create mode 100644 vendor/github.com/gin-contrib/sse/README.md create mode 100644 vendor/github.com/gin-gonic/gin/.gitignore create mode 100644 vendor/github.com/gin-gonic/gin/BENCHMARKS.md create mode 100644 vendor/github.com/gin-gonic/gin/CHANGELOG.md create mode 100644 vendor/github.com/gin-gonic/gin/README.md create mode 100644 vendor/github.com/go-sourcemap/sourcemap/README.md delete mode 100644 vendor/github.com/golang/gddo/gosrc/LICENSE create mode 100644 vendor/github.com/golang/snappy/.gitignore create mode 100644 vendor/github.com/golang/snappy/README create mode 100644 vendor/github.com/gorilla/context/README.md create mode 100644 vendor/github.com/gorilla/mux/ISSUE_TEMPLATE.md create mode 100644 vendor/github.com/gorilla/mux/README.md create mode 100644 vendor/github.com/gorilla/websocket/.gitignore create mode 100644 vendor/github.com/gorilla/websocket/README.md create mode 100644 vendor/github.com/gorilla/websocket/go.mod create mode 100644 vendor/github.com/gorilla/websocket/go.sum create mode 100644 vendor/github.com/inconshreveable/mousetrap/README.md create mode 100644 vendor/github.com/julienschmidt/httprouter/README.md create mode 100644 vendor/github.com/kardianos/osext/README.md create mode 100644 vendor/github.com/kelseyhightower/envconfig/MAINTAINERS create mode 100644 vendor/github.com/kelseyhightower/envconfig/README.md create mode 100644 vendor/github.com/kelseyhightower/envconfig/go.mod create mode 100644 vendor/github.com/klauspost/compress/fse/README.md create mode 100644 vendor/github.com/klauspost/compress/huff0/.gitignore create mode 100644 vendor/github.com/klauspost/compress/huff0/README.md create mode 100644 vendor/github.com/klauspost/compress/snappy/.gitignore create mode 100644 vendor/github.com/klauspost/compress/snappy/README create mode 100644 vendor/github.com/klauspost/compress/snappy/runbench.cmd create mode 100644 vendor/github.com/klauspost/compress/zstd/README.md create mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md create mode 100644 vendor/github.com/konsorten/go-windows-terminal-sequences/README.md create mode 100644 vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod delete mode 100644 vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-alias/LICENSE delete mode 100644 vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-no-requirements-yaml/LICENSE delete mode 100644 vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-with-all-in-requirements-yaml/LICENSE delete mode 100644 vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-with-mixed-requirements-yaml/LICENSE delete mode 100644 vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/frobnitz/LICENSE delete mode 100755 vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/frobnitz_backslash/LICENSE delete mode 120000 vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/joonix/charts/frobnitz delete mode 120000 vendor/github.com/kubernetes/helm/pkg/downloader/testdata/helmhome/repository/cache/local-index.yaml delete mode 120000 vendor/github.com/kubernetes/helm/pkg/getter/testdata/repository/cache/local-index.yaml create mode 100644 vendor/github.com/labstack/echo/.gitattributes create mode 100644 vendor/github.com/labstack/echo/.gitignore create mode 100644 vendor/github.com/labstack/echo/Gopkg.lock create mode 100644 vendor/github.com/labstack/echo/Gopkg.toml create mode 100644 vendor/github.com/labstack/echo/README.md create mode 100644 vendor/github.com/labstack/gommon/color/README.md create mode 100644 vendor/github.com/labstack/gommon/log/README.md create mode 100644 vendor/github.com/manyminds/api2go/.gitignore create mode 100644 vendor/github.com/manyminds/api2go/README.md create mode 100644 vendor/github.com/manyminds/api2go/jsonapi/Readme.md create mode 100644 vendor/github.com/mattn/go-colorable/README.md create mode 100644 vendor/github.com/mattn/go-isatty/README.md create mode 100644 vendor/github.com/mitchellh/mapstructure/README.md create mode 100644 vendor/github.com/nu7hatch/gouuid/.gitignore create mode 100644 vendor/github.com/nu7hatch/gouuid/README.md create mode 100644 vendor/github.com/oxtoacart/bpool/README.md create mode 100644 vendor/github.com/pierrec/lz4/.gitignore create mode 100644 vendor/github.com/pierrec/lz4/README.md create mode 100644 vendor/github.com/pkg/errors/.gitignore create mode 100644 vendor/github.com/pkg/errors/README.md create mode 100644 vendor/github.com/rcrowley/go-metrics/.gitignore create mode 100644 vendor/github.com/rcrowley/go-metrics/README.md create mode 100644 vendor/github.com/rcrowley/go-metrics/memory.md create mode 100644 vendor/github.com/rcrowley/go-metrics/validate.sh create mode 100644 vendor/github.com/serenize/snaker/README.md create mode 100644 vendor/github.com/sirupsen/logrus/.gitignore create mode 100644 vendor/github.com/sirupsen/logrus/CHANGELOG.md create mode 100644 vendor/github.com/sirupsen/logrus/README.md create mode 100644 vendor/github.com/sirupsen/logrus/go.mod create mode 100644 vendor/github.com/sirupsen/logrus/go.sum create mode 100644 vendor/github.com/spf13/afero/README.md create mode 100644 vendor/github.com/spf13/cobra/.gitignore create mode 100644 vendor/github.com/spf13/cobra/.mailmap create mode 100644 vendor/github.com/spf13/cobra/README.md create mode 100644 vendor/github.com/spf13/cobra/bash_completions.md delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/add.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/helpers.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/init.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/license_agpl.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/license_apache_2.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_2.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_3.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_2.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_3.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/license_lgpl.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/license_mit.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/licenses.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/project.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/root.go delete mode 100644 vendor/github.com/spf13/cobra/cobra/cmd/testdata/LICENSE.golden delete mode 100644 vendor/github.com/spf13/cobra/cobra/main.go delete mode 100644 vendor/github.com/spf13/cobra/doc/man_docs.go delete mode 100644 vendor/github.com/spf13/cobra/doc/md_docs.go delete mode 100644 vendor/github.com/spf13/cobra/doc/rest_docs.go delete mode 100644 vendor/github.com/spf13/cobra/doc/util.go delete mode 100644 vendor/github.com/spf13/cobra/doc/yaml_docs.go create mode 100644 vendor/github.com/spf13/pflag/.gitignore create mode 100644 vendor/github.com/spf13/pflag/README.md create mode 100644 vendor/github.com/tidwall/gjson/README.md create mode 100644 vendor/github.com/tidwall/match/README.md create mode 100644 vendor/github.com/tidwall/pretty/README.md create mode 100644 vendor/github.com/ugorji/go/codec/README.md delete mode 100644 vendor/github.com/ugorji/go/codec/noop.go create mode 100644 vendor/github.com/ugorji/go/codec/test.py delete mode 100644 vendor/github.com/ugorji/go/codec/xml.go create mode 100644 vendor/github.com/urfave/negroni/.gitignore create mode 100644 vendor/github.com/urfave/negroni/CHANGELOG.md create mode 100644 vendor/github.com/urfave/negroni/README.md create mode 100644 vendor/github.com/valyala/bytebufferpool/README.md create mode 100644 vendor/github.com/valyala/fasttemplate/README.md create mode 100644 vendor/github.com/viki-org/dnscache/readme.md create mode 100644 vendor/github.com/zyedidia/highlight/README.md delete mode 100644 vendor/golang.org/x/net/html/atom/gen.go create mode 100644 vendor/golang.org/x/net/http2/.gitignore create mode 100644 vendor/golang.org/x/net/http2/Dockerfile create mode 100644 vendor/golang.org/x/net/http2/README create mode 100644 vendor/golang.org/x/sys/unix/.gitignore create mode 100644 vendor/golang.org/x/sys/unix/README.md create mode 100644 vendor/golang.org/x/sys/unix/mkall.sh create mode 100644 vendor/golang.org/x/sys/unix/mkerrors.sh delete mode 100644 vendor/golang.org/x/sys/unix/mkpost.go create mode 100644 vendor/golang.org/x/sys/unix/mksyscall.pl create mode 100644 vendor/golang.org/x/sys/unix/mksyscall_solaris.pl create mode 100644 vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl create mode 100644 vendor/golang.org/x/sys/unix/mksysnum_darwin.pl create mode 100644 vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl create mode 100644 vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl create mode 100644 vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl create mode 100644 vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl delete mode 100644 vendor/golang.org/x/sys/unix/types_darwin.go delete mode 100644 vendor/golang.org/x/sys/unix/types_dragonfly.go delete mode 100644 vendor/golang.org/x/sys/unix/types_freebsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_netbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_openbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_solaris.go delete mode 100644 vendor/golang.org/x/text/cases/gen.go delete mode 100644 vendor/golang.org/x/text/cases/gen_trieval.go delete mode 100644 vendor/golang.org/x/text/collate/build/builder.go delete mode 100644 vendor/golang.org/x/text/collate/build/colelem.go delete mode 100644 vendor/golang.org/x/text/collate/build/contract.go delete mode 100644 vendor/golang.org/x/text/collate/build/order.go delete mode 100644 vendor/golang.org/x/text/collate/build/table.go delete mode 100644 vendor/golang.org/x/text/collate/build/trie.go delete mode 100644 vendor/golang.org/x/text/collate/maketables.go delete mode 100644 vendor/golang.org/x/text/internal/gen.go delete mode 100644 vendor/golang.org/x/text/internal/gen/code.go delete mode 100644 vendor/golang.org/x/text/internal/gen/gen.go delete mode 100644 vendor/golang.org/x/text/internal/triegen/compact.go delete mode 100644 vendor/golang.org/x/text/internal/triegen/print.go delete mode 100644 vendor/golang.org/x/text/internal/triegen/triegen.go delete mode 100644 vendor/golang.org/x/text/internal/ucd/ucd.go delete mode 100644 vendor/golang.org/x/text/language/gen.go delete mode 100644 vendor/golang.org/x/text/language/gen_common.go delete mode 100644 vendor/golang.org/x/text/language/gen_index.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/gen.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/gen_ranges.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/gen_trieval.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/base.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/cldr.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/collate.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/decode.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/makexml.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/resolve.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/slice.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/xml.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/maketables.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/triegen.go delete mode 100644 vendor/golang.org/x/text/unicode/rangetable/gen.go delete mode 100644 vendor/golang.org/x/text/unicode/rangetable/merge.go delete mode 100644 vendor/golang.org/x/text/unicode/rangetable/rangetable.go delete mode 100644 vendor/golang.org/x/text/unicode/rangetable/tables10.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/rangetable/tables9.0.0.go create mode 100644 vendor/gopkg.in/go-playground/validator.v8/.gitignore create mode 100644 vendor/gopkg.in/go-playground/validator.v8/README.md create mode 100644 vendor/gopkg.in/guregu/null.v3/.gitignore create mode 100644 vendor/gopkg.in/guregu/null.v3/README.md create mode 100644 vendor/gopkg.in/yaml.v2/README.md create mode 100644 vendor/gopkg.in/yaml.v2/go.mod diff --git a/.gitignore b/.gitignore index b23515118d08..48566c96fa45 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,15 @@ test.debug .vagrant *.DS_Store + +/vendor/**/.editorconfig +/vendor/**/*.jpg +/vendor/**/*.json +/vendor/**/.*.json +/vendor/**/Makefile +/vendor/**/*.png +/vendor/**/*.tmpl +/vendor/**/*.txt +/vendor/**/*.y*ml +/vendor/**/.*.y*ml +/vendor/github.com/dlclark/regexp2/testoutput1 \ No newline at end of file diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index d2fe51c43184..000000000000 --- a/Gopkg.lock +++ /dev/null @@ -1,734 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - branch = "master" - digest = "1:b2644fc631c849dc4122f7a33b4462eb9aa5aad165fa6de5fd2a167a46ed6f14" - name = "github.com/Azure/go-ntlmssp" - packages = ["."] - pruneopts = "NUT" - revision = "4a21cbd618b459155f8b8ee7f4491cd54f5efa77" - -[[projects]] - digest = "1:6d83aad9c98e13079ad8a4dbc740892edf5384bcd07f1d789bb66cd8ecfae2cd" - name = "github.com/DataDog/datadog-go" - packages = ["statsd"] - pruneopts = "NUT" - revision = "e67964b4021ad3a334e748e8811eb3cd6becbc6e" - version = "2.1.0" - -[[projects]] - branch = "master" - digest = "1:7d8fe22a434ddfb29d95e10a0231eb2d96100b9eaaf7bff7312eee7df7a34bfa" - name = "github.com/GeertJohan/go.rice" - packages = [ - ".", - "embedded", - ] - pruneopts = "NUT" - revision = "c02ca9a983da5807ddf7d796784928f5be4afd09" - -[[projects]] - digest = "1:624350cee1483d2682b9010eec50daf8a1d306151db87dd8c0e908d5760e7120" - name = "github.com/PuerkitoBio/goquery" - packages = ["."] - pruneopts = "NUT" - revision = "09540e565986583836b5fc792fe951ec5fd201dd" - version = "v1.3.0" - -[[projects]] - digest = "1:5e4d460c6a93b2091d07c2382bedd44539786b3e746946535741be9af156ec54" - name = "github.com/Shopify/sarama" - packages = ["."] - pruneopts = "NUT" - revision = "f7be6aa2bc7b2e38edf816b08b582782194a1c02" - version = "v1.16.0" - -[[projects]] - branch = "master" - digest = "1:df6450256d48d28ae22f47411292d2a68fed5b7dd9d09490a74b4b257170c975" - name = "github.com/Soontao/goHttpDigestClient" - packages = ["."] - pruneopts = "NUT" - revision = "6d28bb1415c5d06b76a4dcc4bb6e0dd39ce61af9" - -[[projects]] - branch = "master" - digest = "1:98012c5c875e178d2c803326167f60e78d84da918b34b5f62301b51061d712e5" - name = "github.com/andybalholm/brotli" - packages = ["."] - pruneopts = "NUT" - revision = "71eb68cc467c35a70c4b3d0c46b590260fe3f303" - -[[projects]] - digest = "1:fc86904a62ac4bfff8cfbe94f42231ce3d8cea8fe2506d5293eaef468f8eaecf" - name = "github.com/andybalholm/cascadia" - packages = ["."] - pruneopts = "NUT" - revision = "901648c87902174f774fac311d7f176f8647bdaa" - version = "v1.0.0" - -[[projects]] - branch = "master" - digest = "1:8a49786ec8f770dc1fdc251970f86e1f12b4938cf52b261ffa6f66158670c8c7" - name = "github.com/daaku/go.zipexe" - packages = ["."] - pruneopts = "NUT" - revision = "a5fe2436ffcb3236e175e5149162b41cd28bd27d" - -[[projects]] - digest = "1:a2c1d0e43bd3baaa071d1b9ed72c27d78169b2b269f71c105ac4ba34b1be4a39" - name = "github.com/davecgh/go-spew" - packages = ["spew"] - pruneopts = "NUT" - revision = "346938d642f2ec3594ed81d874461961cd0faa76" - version = "v1.1.0" - -[[projects]] - digest = "1:e32db9fddc5e745860ca0f4176670d2cf839d3afa06b09ad595b8a99be8b5cb6" - name = "github.com/dlclark/regexp2" - packages = [ - ".", - "syntax", - ] - pruneopts = "NUT" - revision = "487489b64fb796de2e55f4e8a4ad1e145f80e957" - version = "v1.1.6" - -[[projects]] - branch = "master" - digest = "1:6931c0a301a6b2180a8edb9f6ea5749cb49bb1fa61171453507eed5e51441932" - name = "github.com/dop251/goja" - packages = [ - ".", - "ast", - "file", - "ftoa", - "ftoa/internal/fast", - "parser", - "token", - "unistring", - ] - pruneopts = "NUT" - revision = "cd0eddb06559f22c75fac4aa45d78ee4f8ff3312" - -[[projects]] - branch = "master" - digest = "1:e6005275e27bf8eae9197d27d0f76a4463512cbbbc94d2408563e95fe1c80c12" - name = "github.com/dustin/go-humanize" - packages = ["."] - pruneopts = "NUT" - revision = "bb3d318650d48840a39aa21a027c6630e198e626" - -[[projects]] - digest = "1:08143362be979b087c2c1bae5dde986e988d3d5d4dc661727cbe436411b3f33a" - name = "github.com/eapache/go-resiliency" - packages = ["breaker"] - pruneopts = "NUT" - revision = "ea41b0fad31007accc7f806884dcdf3da98b79ce" - version = "v1.1.0" - -[[projects]] - branch = "master" - digest = "1:0b70d299db64766a4ee7128f0f94944f2356ca9d3499c79123dbc3a1d2ba803e" - name = "github.com/eapache/go-xerial-snappy" - packages = ["."] - pruneopts = "NUT" - revision = "bb955e01b9346ac19dc29eb16586c90ded99a98c" - -[[projects]] - digest = "1:0d36a2b325b9e75f8057f7f9fbe778d348d70ba652cb9335485b69d1a5c4e038" - name = "github.com/eapache/queue" - packages = ["."] - pruneopts = "NUT" - revision = "44cc805cf13205b55f69e14bcb69867d1ae92f98" - version = "v1.1.0" - -[[projects]] - digest = "1:b0d5e98ac0f0a509eb320f542e748582d637aae09e74538212e9712d1e71064b" - name = "github.com/fatih/color" - packages = ["."] - pruneopts = "NUT" - revision = "570b54cabe6b8eb0bc2dfce68d964677d63b5260" - version = "v1.5.0" - -[[projects]] - branch = "master" - digest = "1:907cbf58962bd763feb63ee996d47fe12def4b85f760a1aae9e99fe72d7bba39" - name = "github.com/gedex/inflector" - packages = ["."] - pruneopts = "NUT" - revision = "16278e9db8130ac7ec405dc174cfb94344f16325" - -[[projects]] - digest = "1:81466b4218bf6adddac2572a30ac733a9255919bc2f470b4827a317bd4ee1756" - name = "github.com/ghodss/yaml" - packages = ["."] - pruneopts = "NUT" - revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7" - version = "v1.0.0" - -[[projects]] - branch = "master" - digest = "1:23edf5aaca7a1f15d68215ac41595c0732152757e9d7b3f282821222784049f1" - name = "github.com/gin-contrib/sse" - packages = ["."] - pruneopts = "NUT" - revision = "22d885f9ecc78bf4ee5d72b937e4bbcdc58e8cae" - -[[projects]] - digest = "1:10095a140b7829bcf199c8447725c0b1b9874a527b3d73cb2fc9ffc4a5fe8178" - name = "github.com/gin-gonic/gin" - packages = [ - ".", - "binding", - "render", - ] - pruneopts = "NUT" - revision = "d459835d2b077e44f7c9b453505ee29881d5d12d" - version = "v1.2" - -[[projects]] - digest = "1:7d5c6757be75cd60d5936e26b2894c16bbb555bd8dad4724b0fa19efb3a6f78b" - name = "github.com/go-sourcemap/sourcemap" - packages = [ - ".", - "internal/base64vlq", - ] - pruneopts = "NUT" - revision = "b019cc30c1eaa584753491b0d8f8c1534bf1eb44" - version = "v2.1.2" - -[[projects]] - branch = "master" - digest = "1:8f251d09f52a8920bdba202b0c18a24cafb4f70f94b9afd8d02bf7643cfc99a0" - name = "github.com/golang/gddo" - packages = [ - "httputil", - "httputil/header", - ] - pruneopts = "NUT" - revision = "af0f2af80721261f4d211b2c9563f7b46b2aab06" - -[[projects]] - digest = "1:9f35c1344b56e5868d511d231f215edd0650aa572664f856444affdd256e43e4" - name = "github.com/golang/protobuf" - packages = ["proto"] - pruneopts = "NUT" - revision = "925541529c1fa6821df4e44ce2723319eb2be768" - version = "v1.0.0" - -[[projects]] - branch = "master" - digest = "1:9413ddbde906f91f062fda0dfa9a7cff43458cd1b2282c0fa25c61d89300b116" - name = "github.com/golang/snappy" - packages = ["."] - pruneopts = "NUT" - revision = "553a641470496b2327abcac10b36396bd98e45c9" - -[[projects]] - digest = "1:dbd86d229eacaa86a98b10f8fb3e3fc69a1913e0f4e010e7cc1f92bf12edca92" - name = "github.com/gorilla/context" - packages = ["."] - pruneopts = "NUT" - revision = "1ea25387ff6f684839d82767c1733ff4d4d15d0a" - version = "v1.1" - -[[projects]] - digest = "1:eced3d718020962f1cc6ac109b840ba17dc817a291062b5948ba7aecc8c6665d" - name = "github.com/gorilla/mux" - packages = ["."] - pruneopts = "NUT" - revision = "53c1911da2b537f792e7cafcb446b05ffe33b996" - version = "v1.6.1" - -[[projects]] - digest = "1:c9c619da0235710875bae079870a396912a475402f9ccd50667f6ad309476259" - name = "github.com/gorilla/websocket" - packages = ["."] - pruneopts = "NUT" - revision = "b65e62901fc1c0d968042419e74789f6af455eb9" - version = "v1.4.2" - -[[projects]] - digest = "1:406338ad39ab2e37b7f4452906442a3dbf0eb3379dd1f06aafb5c07e769a5fbb" - name = "github.com/inconshreveable/mousetrap" - packages = ["."] - pruneopts = "NUT" - revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" - version = "v1.0" - -[[projects]] - branch = "master" - digest = "1:50708c8fc92aec981df5c446581cf9f90ba9e2a5692118e0ce75d4534aaa14a2" - name = "github.com/influxdata/influxdb1-client" - packages = [ - "models", - "pkg/escape", - "v2", - ] - pruneopts = "NUT" - revision = "8ff2fc3824fcb533795f9a2f233275f0bb18d6c5" - -[[projects]] - branch = "master" - digest = "1:9a2761d838e0576046f6f9523df4de34d40536c9907eded54fa304bd478b363f" - name = "github.com/julienschmidt/httprouter" - packages = ["."] - pruneopts = "NUT" - revision = "d1898390779332322e6b5ca5011da4bf249bb056" - -[[projects]] - branch = "master" - digest = "1:263f9b0a0bcbfff9d5e7d9f2aa11f53995d98214fe0fb97e429e7a5f4534a0f9" - name = "github.com/kardianos/osext" - packages = ["."] - pruneopts = "NUT" - revision = "ae77be60afb1dcacde03767a8c37337fad28ac14" - -[[projects]] - digest = "1:08c58ac78a8c1f61e9a96350066d30fe194b8779799bd932a79932a5166a173f" - name = "github.com/kelseyhightower/envconfig" - packages = ["."] - pruneopts = "NUT" - revision = "0b417c4ec4a8a82eecc22a1459a504aa55163d61" - version = "v1.4.0" - -[[projects]] - digest = "1:a1eb0245eb436bd1949fdb00f6b2d925874fa0d2c5e709779f3c50fe281b9eee" - name = "github.com/klauspost/compress" - packages = [ - "fse", - "huff0", - "snappy", - "zstd", - "zstd/internal/xxhash", - ] - pruneopts = "NUT" - revision = "315059c39568ee89ae0c118bc6dc7306041543c3" - version = "v1.7.2" - -[[projects]] - digest = "1:4059c14e87a2de3a434430340521b5feece186c1469eff0834c29a63870de3ed" - name = "github.com/konsorten/go-windows-terminal-sequences" - packages = ["."] - pruneopts = "NUT" - revision = "5c8c8bd35d3832f5d134ae1e1e375b69a4d25242" - version = "v1.0.1" - -[[projects]] - digest = "1:2578ea84d8555a62f49e5f750848ec5d3bad2e5ba9e3977186e407c7501d3b95" - name = "github.com/kubernetes/helm" - packages = ["pkg/strvals"] - pruneopts = "NUT" - revision = "f6025bb9ee7daf9fee0026541c90a6f557a3e0bc" - version = "v2.9.0" - -[[projects]] - digest = "1:d629cf8871b001b80440bda8c2f50bcb6eca7ec080cb670fcceaf26d176d9cd5" - name = "github.com/labstack/echo" - packages = ["."] - pruneopts = "NUT" - revision = "b338075a0fc6e1a0683dbf03d09b4957a289e26f" - version = "3.2.6" - -[[projects]] - digest = "1:3e5716c10e24021c0c44dd1e3043b6d23a83cd143f8225281fba1b4d0143e4b7" - name = "github.com/labstack/gommon" - packages = [ - "color", - "log", - ] - pruneopts = "NUT" - revision = "57409ada9da0f2afad6664c49502f8c50fbd8476" - version = "0.2.3" - -[[projects]] - branch = "master" - digest = "1:afbe9705722abb0d54d4ee48404ef173ba0cfd04fb0c4a76f927e8a68bfaea8a" - name = "github.com/manyminds/api2go" - packages = [ - ".", - "jsonapi", - "routing", - ] - pruneopts = "NUT" - revision = "95be7bd0455eb57da87c8b74723d2846f4c8a408" - -[[projects]] - digest = "1:08c231ec84231a7e23d67e4b58f975e1423695a32467a362ee55a803f9de8061" - name = "github.com/mattn/go-colorable" - packages = ["."] - pruneopts = "NUT" - revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072" - version = "v0.0.9" - -[[projects]] - branch = "master" - digest = "1:bffa444ca07c69c599ae5876bc18b25bfd5fa85b297ca10a25594d284a7e9c5d" - name = "github.com/mattn/go-isatty" - packages = ["."] - pruneopts = "NUT" - revision = "6ca4dbf54d38eea1a992b3c722a76a5d1c4cb25c" - -[[projects]] - branch = "master" - digest = "1:5a4a89d8e15fa92a2b9be9a49e854878a0b1d0aa0744bfa85210ff8725b57a47" - name = "github.com/mccutchen/go-httpbin" - packages = [ - "httpbin", - "httpbin/assets", - "httpbin/digest", - ] - pruneopts = "NUT" - revision = "c5cb2f4802fac63859778c72989fe88dce35fe35" - -[[projects]] - branch = "master" - digest = "1:eeb1f466766c40a4656b090593e103d2ce327b914329232bc1d4632dae17fc4f" - name = "github.com/mitchellh/mapstructure" - packages = ["."] - pruneopts = "NUT" - revision = "00c29f56e2386353d58c599509e8dc3801b0d716" - -[[projects]] - branch = "master" - digest = "1:16bbae9910129be5a18b951eabacd54414d3faea094dfab92bb3c84884d46b11" - name = "github.com/nu7hatch/gouuid" - packages = ["."] - pruneopts = "NUT" - revision = "179d4d0c4d8d407a32af483c2354df1d2c91e6c3" - -[[projects]] - branch = "master" - digest = "1:8fe179a5468c41a57dd75dcb283c1a81c4ca38a934380ff996437033d7d9509a" - name = "github.com/oxtoacart/bpool" - packages = ["."] - pruneopts = "NUT" - revision = "4e1c5567d7c2dd59fa4c7c83d34c2f3528b025d6" - -[[projects]] - digest = "1:e39e722511703c69078a9455ce2c132db079547fd37861b42045d26a9dcd9c27" - name = "github.com/pierrec/lz4" - packages = ["."] - pruneopts = "NUT" - revision = "2fcda4cb7018ce05a25959d2fe08c83e3329f169" - version = "v1.1" - -[[projects]] - digest = "1:186e021e0c2fa61e181151d8b2fef4d2b6b217a55794bd591de73773b934a32a" - name = "github.com/pierrec/xxHash" - packages = ["xxHash32"] - pruneopts = "NUT" - revision = "f051bb7f1d1aaf1b5a665d74fb6b0217712c69f7" - version = "v0.1.1" - -[[projects]] - digest = "1:5cf3f025cbee5951a4ee961de067c8a89fc95a5adabead774f82822efabab121" - name = "github.com/pkg/errors" - packages = ["."] - pruneopts = "NUT" - revision = "645ef00459ed84a119197bfb8d8205042c6df63d" - version = "v0.8.0" - -[[projects]] - digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" - name = "github.com/pmezard/go-difflib" - packages = ["difflib"] - pruneopts = "NUT" - revision = "792786c7400a136282c1664665ae0a8db921c6c2" - version = "v1.0.0" - -[[projects]] - branch = "master" - digest = "1:7c522337040d4ec9a136cd9d64fe4677ee1d3eae4a7f8831c2108f9bec43fa48" - name = "github.com/rcrowley/go-metrics" - packages = ["."] - pruneopts = "NUT" - revision = "e2704e165165ec55d062f5919b4b29494e9fa790" - -[[projects]] - branch = "master" - digest = "1:7aa71ff260e0b8e557fdf25b76f454741c5716ed2bd9204329ad67b01b5d2bfd" - name = "github.com/serenize/snaker" - packages = ["."] - pruneopts = "NUT" - revision = "a683aaf2d516deecd70cad0c72e3ca773ecfcef0" - -[[projects]] - branch = "master" - digest = "1:88925026dc080b29f50bc9c917224dac3d4fa1df614df38429c3b373130c9a56" - name = "github.com/sirupsen/logrus" - packages = [ - ".", - "hooks/test", - ] - pruneopts = "NUT" - revision = "7eeb7b7cbdeb0a582a5b7a1512d91f956f1674aa" - -[[projects]] - branch = "master" - digest = "1:330e9062b308ac597e28485699c02223bd052437a6eed32a173c9227dcb9d95a" - name = "github.com/spf13/afero" - packages = [ - ".", - "mem", - ] - pruneopts = "NUT" - revision = "787d034dfe70e44075ccc060d346146ef53270ad" - -[[projects]] - branch = "master" - digest = "1:234b95cdbb31612ff4f97e0ac69abdede0c60f5f84e5d3f40123859f77d8bc2c" - name = "github.com/spf13/cobra" - packages = ["."] - pruneopts = "NT" - revision = "a114f312e075f65bf30d6d9a1430113f857e543b" - -[[projects]] - digest = "1:15e5c398fbd9d2c439b635a08ac161b13d04f0c2aa587fe256b65dc0c3efe8b7" - name = "github.com/spf13/pflag" - packages = ["."] - pruneopts = "NUT" - revision = "583c0c0531f06d5278b7d917446061adc344b5cd" - version = "v1.0.1" - -[[projects]] - digest = "1:0d3d375df794ab11a192668f4eacdb116ccd99aa574fe357185a2d463e07f2fb" - name = "github.com/stretchr/testify" - packages = [ - "assert", - "require", - ] - pruneopts = "NUT" - revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71" - version = "v1.2.1" - -[[projects]] - branch = "master" - digest = "1:2f83658d78200672f74b3dacb01e17788449319282f5034c734bd1a52e7573db" - name = "github.com/tidwall/gjson" - packages = ["."] - pruneopts = "NUT" - revision = "1e3f6aeaa5bad08d777ea7807b279a07885dd8b2" - -[[projects]] - branch = "master" - digest = "1:420af1239081e32845242dbfbf364362ee8e10fe1e315e5a6d6cae4bd7c1dd67" - name = "github.com/tidwall/match" - packages = ["."] - pruneopts = "NUT" - revision = "1731857f09b1f38450e2c12409748407822dc6be" - -[[projects]] - branch = "master" - digest = "1:76c0c4091c146bfb33186b84febc68537cf5321993abd0d404d9c0eba83fc0cf" - name = "github.com/tidwall/pretty" - packages = ["."] - pruneopts = "NUT" - revision = "65a9db5fad5105a89e17f38adcc9878685be6d78" - -[[projects]] - digest = "1:1ed7acee0f08ecd69b52fa94213269e880900a910e1631f18fac6f9c908b9408" - name = "github.com/ugorji/go" - packages = ["codec"] - pruneopts = "NUT" - revision = "9831f2c3ac1068a78f50999a30db84270f647af6" - version = "v1.1" - -[[projects]] - branch = "master" - digest = "1:bafdddf0e04f4d66c948468a03ecaf30e9cc894c2eed59a89cade22bc4364de8" - name = "github.com/urfave/negroni" - packages = ["."] - pruneopts = "NUT" - revision = "22c5532ea862c34fdad414e90f8cc00b4f6f4cab" - -[[projects]] - branch = "master" - digest = "1:af354641f23332b1a8d5d361d11b5a9171589e412a67d499633706c611acc064" - name = "github.com/valyala/bytebufferpool" - packages = ["."] - pruneopts = "NUT" - revision = "e746df99fe4a3986f4d4f79e13c1e0117ce9c2f7" - -[[projects]] - branch = "master" - digest = "1:f17377eef01c91aee2d0f93095d672bd27697c62e5546bde97f9c8412c141356" - name = "github.com/valyala/fasttemplate" - packages = ["."] - pruneopts = "NUT" - revision = "dcecefd839c4193db0d35b88ec65b4c12d360ab0" - -[[projects]] - branch = "master" - digest = "1:4c736f43e1c60e65ebf35a0ac2d5380119ed0123cf5cdf38521418bb14ac3f71" - name = "github.com/viki-org/dnscache" - packages = ["."] - pruneopts = "NUT" - revision = "c70c1f23c5d84ab39054ec6b418a5ed0fa51cade" - -[[projects]] - branch = "master" - digest = "1:3156b32b5027be4ddd43cf4ac31602322d265c12be9c3986b334734cc3c53ca4" - name = "github.com/zyedidia/highlight" - packages = ["."] - pruneopts = "NUT" - revision = "201131ce5cf5ba174570dcd878d1f2698db5af9f" - -[[projects]] - branch = "master" - digest = "1:5710f443edd59a8b20c6786b23b3fc873ff9267ec050dd520ec2416db884b3fe" - name = "golang.org/x/crypto" - packages = [ - "acme", - "acme/autocert", - "md4", - "ocsp", - "ripemd160", - "ssh/terminal", - ] - pruneopts = "NUT" - revision = "c7dcf104e3a7a1417abc0230cb0d5240d764159d" - -[[projects]] - branch = "master" - digest = "1:e1ac31e25fd520610e39e9bb01dc7812b44085930118d76a0c7835a785ece07e" - name = "golang.org/x/net" - packages = [ - "context", - "html", - "html/atom", - "http/httpguts", - "http2", - "http2/hpack", - "idna", - ] - pruneopts = "NUT" - revision = "351d144fa1fc0bd934e2408202be0c29f25e35a0" - -[[projects]] - branch = "master" - digest = "1:b1a955501003b967a2c814e41ded50c7b29dfdeb7f266b7987b8ed38f65205d6" - name = "golang.org/x/sys" - packages = [ - "unix", - "windows", - ] - pruneopts = "NUT" - revision = "c28acc882ebcbfbe8ce9f0f14b9ac26ee138dd51" - -[[projects]] - digest = "1:0a6ace3c8a521f2c8861e89b8a22fc869c831e9bf6ad21fc62eb59afa16a8bff" - name = "golang.org/x/text" - packages = [ - "cases", - "collate", - "collate/build", - "internal", - "internal/colltab", - "internal/gen", - "internal/tag", - "internal/triegen", - "internal/ucd", - "language", - "secure/bidirule", - "transform", - "unicode/bidi", - "unicode/cldr", - "unicode/norm", - "unicode/rangetable", - ] - pruneopts = "NUT" - revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" - version = "v0.3.0" - -[[projects]] - branch = "master" - digest = "1:51a479a09b7ed06b7be5a854e27fcc328718ae0e5ad159f9ddeef12d0326c2e7" - name = "golang.org/x/time" - packages = ["rate"] - pruneopts = "NUT" - revision = "6dc17368e09b0e8634d71cac8168d853e869a0c7" - -[[projects]] - digest = "1:0215407129c5f116ae8f6d3af64df59c39d3f606a72ef77a1e6ed874f92a8d9c" - name = "gopkg.in/go-playground/validator.v8" - packages = ["."] - pruneopts = "NUT" - revision = "5f1438d3fca68893a817e4a66806cea46a9e4ebf" - version = "v8.18.2" - -[[projects]] - digest = "1:b0b604e19e80db4c03aea55950a2956b3057e7ccfb10dc28ac7caa2fd95cf2de" - name = "gopkg.in/guregu/null.v3" - packages = ["."] - pruneopts = "NUT" - revision = "e81d6d8d57747b34d7c5fe0d20ebf57692f04ea9" - version = "v3.3.0" - -[[projects]] - digest = "1:b92c04db63b4a79baff7afe06e0ee1076383a16834f8b8a90dc04644651f5315" - name = "gopkg.in/yaml.v2" - packages = ["."] - pruneopts = "NUT" - revision = "7f97868eec74b32b0982dd158a51a446d1da7eb5" - version = "v2.1.1" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "github.com/Azure/go-ntlmssp", - "github.com/DataDog/datadog-go/statsd", - "github.com/GeertJohan/go.rice", - "github.com/GeertJohan/go.rice/embedded", - "github.com/PuerkitoBio/goquery", - "github.com/Shopify/sarama", - "github.com/Soontao/goHttpDigestClient", - "github.com/andybalholm/brotli", - "github.com/dop251/goja", - "github.com/dop251/goja/parser", - "github.com/dustin/go-humanize", - "github.com/fatih/color", - "github.com/gorilla/websocket", - "github.com/influxdata/influxdb1-client/v2", - "github.com/julienschmidt/httprouter", - "github.com/kelseyhightower/envconfig", - "github.com/klauspost/compress/zstd", - "github.com/kubernetes/helm/pkg/strvals", - "github.com/manyminds/api2go", - "github.com/manyminds/api2go/jsonapi", - "github.com/mattn/go-colorable", - "github.com/mattn/go-isatty", - "github.com/mccutchen/go-httpbin/httpbin", - "github.com/mitchellh/mapstructure", - "github.com/oxtoacart/bpool", - "github.com/pkg/errors", - "github.com/pmezard/go-difflib/difflib", - "github.com/serenize/snaker", - "github.com/sirupsen/logrus", - "github.com/sirupsen/logrus/hooks/test", - "github.com/spf13/afero", - "github.com/spf13/cobra", - "github.com/spf13/pflag", - "github.com/stretchr/testify/assert", - "github.com/stretchr/testify/require", - "github.com/tidwall/gjson", - "github.com/tidwall/pretty", - "github.com/urfave/negroni", - "github.com/viki-org/dnscache", - "github.com/zyedidia/highlight", - "golang.org/x/crypto/md4", - "golang.org/x/crypto/ocsp", - "golang.org/x/crypto/ripemd160", - "golang.org/x/crypto/ssh/terminal", - "golang.org/x/net/html", - "golang.org/x/net/http2", - "golang.org/x/text/unicode/norm", - "golang.org/x/time/rate", - "gopkg.in/guregu/null.v3", - "gopkg.in/yaml.v2", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index e05ac644974d..000000000000 --- a/Gopkg.toml +++ /dev/null @@ -1,108 +0,0 @@ -# Gopkg.toml for k6 -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. - -[[constraint]] - branch = "master" - name = "github.com/GeertJohan/go.rice" - -[[constraint]] - branch = "master" - name = "github.com/dop251/goja" - -[[constraint]] - branch = "master" - name = "github.com/dustin/go-humanize" - -[[constraint]] - branch = "master" - name = "github.com/manyminds/api2go" - -[[constraint]] - branch = "master" - name = "github.com/mattn/go-isatty" - -[[constraint]] - branch = "master" - name = "github.com/mccutchen/go-httpbin" - -[[constraint]] - branch = "master" - name = "github.com/oxtoacart/bpool" - -[[constraint]] - branch = "master" - name = "github.com/sirupsen/logrus" - -[[constraint]] - branch = "master" - name = "github.com/spf13/afero" - -[[constraint]] - branch = "master" - name = "github.com/urfave/negroni" - -[[constraint]] - branch = "master" - name = "github.com/viki-org/dnscache" - -[[constraint]] - branch = "master" - name = "github.com/zyedidia/highlight" - -[[constraint]] - branch = "master" - name = "golang.org/x/crypto" - -[[constraint]] - branch = "master" - name = "golang.org/x/time" - -[[constraint]] - name = "gopkg.in/guregu/null.v3" - version = "^3.3.0" - -[[constraint]] - branch = "master" - name = "github.com/spf13/cobra" - -[[constraint]] - branch = "master" - name = "github.com/Soontao/goHttpDigestClient" - -[[constraint]] - branch = "master" - name = "github.com/Azure/go-ntlmssp" - -[[constraint]] - branch = "master" - name = "github.com/tidwall/gjson" - -# TODO: remove this once it's no longer necessary -# https://github.com/manyminds/api2go/issues/304 -[[override]] - name = "github.com/julienschmidt/httprouter" - branch = "master" - -[prune] - go-tests = true - unused-packages = true - non-go = true - - # TODO: remove this when cobra's license files are not deleted by dep ensure... - [[prune.project]] - name = "github.com/spf13/cobra" - unused-packages = false - -[[constraint]] - name = "github.com/klauspost/compress" - version = "1.7.2" - -[[constraint]] - branch = "master" - name = "github.com/andybalholm/brotli" - -[[constraint]] - name = "github.com/kelseyhightower/envconfig" - version = "^1.4.0" diff --git a/go.mod b/go.mod new file mode 100644 index 000000000000..1e93d1d7fca8 --- /dev/null +++ b/go.mod @@ -0,0 +1,92 @@ +module github.com/loadimpact/k6 + +go 1.14 + +require ( + github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4 + github.com/DataDog/datadog-go v0.0.0-20180330214955-e67964b4021a + github.com/GeertJohan/go.rice v0.0.0-20170420135705-c02ca9a983da + github.com/PuerkitoBio/goquery v1.3.0 + github.com/Shopify/sarama v1.16.0 + github.com/Shopify/toxiproxy v2.1.4+incompatible // indirect + github.com/Soontao/goHttpDigestClient v0.0.0-20170320082612-6d28bb1415c5 + github.com/andybalholm/brotli v0.0.0-20190704151324-71eb68cc467c + github.com/andybalholm/cascadia v1.0.0 // indirect + github.com/daaku/go.zipexe v0.0.0-20150329023125-a5fe2436ffcb // indirect + github.com/dlclark/regexp2 v1.1.6 // indirect + github.com/dop251/goja v0.0.0-20200811154920-cd0eddb06559 + github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4 + github.com/eapache/go-resiliency v1.1.0 // indirect + github.com/eapache/go-xerial-snappy v0.0.0-20160609142408-bb955e01b934 // indirect + github.com/eapache/queue v1.1.0 // indirect + github.com/fatih/color v1.5.0 + github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 // indirect + github.com/ghodss/yaml v1.0.0 // indirect + github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 // indirect + github.com/gin-gonic/gin v1.1.5-0.20170702092826-d459835d2b07 // indirect + github.com/go-sourcemap/sourcemap v2.1.2+incompatible // indirect + github.com/golang/snappy v0.0.0-20170215233205-553a64147049 // indirect + github.com/google/go-cmp v0.5.1 // indirect + github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f // indirect + github.com/gorilla/mux v1.6.1 // indirect + github.com/gorilla/websocket v1.4.2 + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/influxdata/influxdb1-client v0.0.0-20190402204710-8ff2fc3824fc + github.com/julienschmidt/httprouter v1.1.1-0.20180222160526-d18983907793 + github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 // indirect + github.com/kelseyhightower/envconfig v1.4.0 + github.com/klauspost/compress v1.7.2 + github.com/klauspost/cpuid v1.3.1 // indirect + github.com/kubernetes/helm v2.9.0+incompatible + github.com/labstack/echo v3.2.6+incompatible // indirect + github.com/labstack/gommon v0.2.2-0.20170925052817-57409ada9da0 // indirect + github.com/manyminds/api2go v0.0.0-20180125085803-95be7bd0455e + github.com/mattn/go-colorable v0.0.9 + github.com/mattn/go-isatty v0.0.4 + github.com/mccutchen/go-httpbin v1.1.2-0.20190116014521-c5cb2f4802fa + github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238 + github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect + github.com/onsi/ginkgo v1.14.0 // indirect + github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2 + github.com/pierrec/lz4 v1.0.2-0.20171218195038-2fcda4cb7018 // indirect + github.com/pierrec/xxHash v0.1.1 // indirect + github.com/pkg/errors v0.8.0 + github.com/pmezard/go-difflib v1.0.0 + github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165 // indirect + github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 + github.com/sirupsen/logrus v1.1.2-0.20181101075517-7eeb7b7cbdeb + github.com/spf13/afero v1.1.1 + github.com/spf13/cobra v0.0.4-0.20180629152535-a114f312e075 + github.com/spf13/pflag v1.0.1 + github.com/stretchr/testify v1.2.2 + github.com/tidwall/gjson v1.1.3 + github.com/tidwall/match v1.0.0 // indirect + github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51 + github.com/ugorji/go v1.1.7 // indirect + github.com/urfave/negroni v0.3.1-0.20180130044549-22c5532ea862 + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4 // indirect + github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8 + github.com/zyedidia/highlight v0.0.0-20170330143449-201131ce5cf5 + golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 + golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 + golang.org/x/text v0.3.2 + golang.org/x/time v0.0.0-20170927054726-6dc17368e09b + gopkg.in/go-playground/assert.v1 v1.2.1 // indirect + gopkg.in/go-playground/validator.v8 v8.18.2 // indirect + gopkg.in/guregu/null.v2 v2.1.2 // indirect + gopkg.in/guregu/null.v3 v3.3.0 + gopkg.in/yaml.v2 v2.3.0 +) + +replace ( + github.com/davecgh/go-spew => github.com/davecgh/go-spew v1.1.0 + github.com/golang/protobuf => github.com/golang/protobuf v1.0.0 + github.com/stretchr/testify => github.com/stretchr/testify v1.2.1 + github.com/ugorji/go => github.com/ugorji/go v0.0.0-20180112141927-9831f2c3ac10 + golang.org/x/crypto => golang.org/x/crypto v0.0.0-20180308185624-c7dcf104e3a7 + golang.org/x/net => golang.org/x/net v0.0.0-20181201002055-351d144fa1fc + golang.org/x/sys => golang.org/x/sys v0.0.0-20180312081825-c28acc882ebc + golang.org/x/text => golang.org/x/text v0.3.0 + gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.1.1 +) diff --git a/go.sum b/go.sum new file mode 100644 index 000000000000..b4a62a1d99ef --- /dev/null +++ b/go.sum @@ -0,0 +1,179 @@ +github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4 h1:pSm8mp0T2OH2CPmPDPtwHPr3VAQaOwVF/JbllOPP4xA= +github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= +github.com/DataDog/datadog-go v0.0.0-20180330214955-e67964b4021a h1:zpQSzEApXM0qkXcpdjeJ4OpnBWhD/X8zT/iT1wYLiVU= +github.com/DataDog/datadog-go v0.0.0-20180330214955-e67964b4021a/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/GeertJohan/go.rice v0.0.0-20170420135705-c02ca9a983da h1:UVU3a9pRUyLdnBtn60WjRl0s4SEyJc2ChCY56OAR6wI= +github.com/GeertJohan/go.rice v0.0.0-20170420135705-c02ca9a983da/go.mod h1:DgrzXonpdQbfN3uYaGz1EG4Sbhyum/MMIn6Cphlh2bw= +github.com/PuerkitoBio/goquery v1.3.0 h1:2LzdaeRwZjIMW7iKEei51jiCPB33mou4AI7QCzS4NgE= +github.com/PuerkitoBio/goquery v1.3.0/go.mod h1:T9ezsOHcCrDCgA8aF1Cqr3sSYbO/xgdy8/R/XiIMAhA= +github.com/Shopify/sarama v1.16.0 h1:9pI5+ZN06jB3bu5kHXqzzaErMC5rimcIZBQL9IOiEQ0= +github.com/Shopify/sarama v1.16.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/Soontao/goHttpDigestClient v0.0.0-20170320082612-6d28bb1415c5 h1:k+1+doEm31k0rRjCjLnGG3YRkuO9ljaEyS2ajZd6GK8= +github.com/Soontao/goHttpDigestClient v0.0.0-20170320082612-6d28bb1415c5/go.mod h1:5Q4+CyR7+Q3VMG8f78ou+QSX/BNUNUx5W48eFRat8DQ= +github.com/andybalholm/brotli v0.0.0-20190704151324-71eb68cc467c h1:pBKtfXLqKZ+GPHGjlBheGaXK2lddydUG3XhWGrYjxOA= +github.com/andybalholm/brotli v0.0.0-20190704151324-71eb68cc467c/go.mod h1:+lx6/Aqd1kLJ1GQfkvOnaZ1WGmLpMpbprPuIOOZX30U= +github.com/andybalholm/cascadia v1.0.0 h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRySc45o= +github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/daaku/go.zipexe v0.0.0-20150329023125-a5fe2436ffcb h1:tUf55Po0vzOendQ7NWytcdK0VuzQmfAgvGBUOQvN0WA= +github.com/daaku/go.zipexe v0.0.0-20150329023125-a5fe2436ffcb/go.mod h1:U0vRfAucUOohvdCxt5MWLF+TePIL0xbCkbKIiV8TQCE= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dlclark/regexp2 v1.1.6 h1:CqB4MjHw0MFCDj+PHHjiESmHX+N7t0tJzKvC6M97BRg= +github.com/dlclark/regexp2 v1.1.6/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/dop251/goja v0.0.0-20200811154920-cd0eddb06559 h1:j53LTiKFnfAjigMGpsPQVpXN6sG64p8CyH5btbZdg3s= +github.com/dop251/goja v0.0.0-20200811154920-cd0eddb06559/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4 h1:qk/FSDDxo05wdJH28W+p5yivv7LuLYLRXPPD8KQCtZs= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0 h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK2197aU= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20160609142408-bb955e01b934 h1:oGLoaVIefp3tiOgi7+KInR/nNPvEpPM6GFo+El7fd14= +github.com/eapache/go-xerial-snappy v0.0.0-20160609142408-bb955e01b934/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/fatih/color v1.5.0 h1:vBh+kQp8lg9XPr56u1CPrWjFXtdphMoGWVHr9/1c+A0= +github.com/fatih/color v1.5.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ= +github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813/go.mod h1:P+oSoE9yhSRvsmYyZsshflcR6ePWYLql6UU1amW13IM= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 h1:AzN37oI0cOS+cougNAV9szl6CVoj2RYwzS3DpUQNtlY= +github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-gonic/gin v1.1.5-0.20170702092826-d459835d2b07 h1:Gm6bjW5SQ/sIib9Zcgyyw5chSE6SLcgVZIflI0qGI6s= +github.com/gin-gonic/gin v1.1.5-0.20170702092826-d459835d2b07/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y= +github.com/go-sourcemap/sourcemap v2.1.2+incompatible h1:0b/xya7BKGhXuqFESKM4oIiRo9WOt2ebz7KxfreD6ug= +github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 h1:KRMr9A3qfbVM7iV/WcLY/rL5LICqwMHLhwRXKu99fXw= +github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= +github.com/golang/protobuf v1.0.0 h1:lsek0oXi8iFE9L+EXARyHIjU5rlWIhhTkjDz3vHhWWQ= +github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/snappy v0.0.0-20170215233205-553a64147049 h1:K9KHZbXKpGydfDN0aZrsoHpLJlZsBrGMFWbgLDGnPZk= +github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f h1:9oNbS1z4rVpbnkHBdPZU4jo9bSmrLpII768arSyMFgk= +github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.1 h1:KOwqsTYZdeuMacU7CxjMNYEKeBvLbxW+psodrbcEa3A= +github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb1-client v0.0.0-20190402204710-8ff2fc3824fc h1:KpMgaYJRieDkHZJWY3LMafvtqS/U8xX6+lUN+OKpl/Y= +github.com/influxdata/influxdb1-client v0.0.0-20190402204710-8ff2fc3824fc/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/julienschmidt/httprouter v1.1.1-0.20180222160526-d18983907793 h1:C70cJzQWvJh+6Rw8q2Qngi8J8uc1BC6FqJneu0f2pr8= +github.com/julienschmidt/httprouter v1.1.1-0.20180222160526-d18983907793/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 h1:PJPDf8OUfOK1bb/NeTKd4f1QXZItOX389VN3B6qC8ro= +github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= +github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= +github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= +github.com/klauspost/compress v1.7.2 h1:liMOoeIvFpr9kEvalrZ7VVBA4wGf7zfOgwBjzz/5g2Y= +github.com/klauspost/compress v1.7.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s= +github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kubernetes/helm v2.9.0+incompatible h1:X6Tl40RMiqT0GD8hT3+jFPgkZV1EB6vYsoJDX8YkY+c= +github.com/kubernetes/helm v2.9.0+incompatible/go.mod h1:3Nb8I82ptmDi7OvvBQK25X1bwxg+WMAkusUQXHxu8ag= +github.com/labstack/echo v3.2.6+incompatible h1:28U/uXFFKBIP+VQIqq641LuYhMS7Br9ZlwEXERaohCc= +github.com/labstack/echo v3.2.6+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s= +github.com/labstack/gommon v0.2.2-0.20170925052817-57409ada9da0 h1:7AIW1qc9sYYTZLamTsRKSmVvJDXkZZrIWXHDK4Gq4X0= +github.com/labstack/gommon v0.2.2-0.20170925052817-57409ada9da0/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4= +github.com/manyminds/api2go v0.0.0-20180125085803-95be7bd0455e h1:Jg9dDZCJYqtv9GHQ34yDBFgEJLl4Hi4VEkKUyzHXCV8= +github.com/manyminds/api2go v0.0.0-20180125085803-95be7bd0455e/go.mod h1:Z60vy0EZVSu0bOugCHdcN5ZxFMKSpjRgsnh0XKPFqqk= +github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mccutchen/go-httpbin v1.1.2-0.20190116014521-c5cb2f4802fa h1:lx8ZnNPwjkXSzOROz0cg69RlErRXs+L3eDkggASWKLo= +github.com/mccutchen/go-httpbin v1.1.2-0.20190116014521-c5cb2f4802fa/go.mod h1:fhpOYavp5g2K74XDl/ao2y4KvhqVtKlkg1e+0UaQv7I= +github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238 h1:+MZW2uvHgN8kYvksEN3f7eFL2wpzk0GxmlFsMybWc7E= +github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2 h1:CXwSGu/LYmbjEab5aMCs5usQRVBGThelUKBNnoSOuso= +github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2/go.mod h1:L3UMQOThbttwfYRNFOWLLVXMhk5Lkio4GGOtw5UrxS0= +github.com/pierrec/lz4 v1.0.2-0.20171218195038-2fcda4cb7018 h1:z+gewaCBdXQRy5LXNOOKQU0gU93ro44uK92zqkB9KCc= +github.com/pierrec/lz4 v1.0.2-0.20171218195038-2fcda4cb7018/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/xxHash v0.1.1 h1:KP4NrV9023xp3M4FkTYfcXqWigsOCImL1ANJ7sh5vg4= +github.com/pierrec/xxHash v0.1.1/go.mod h1:w2waW5Zoa/Wc4Yqe0wgrIYAGKqRMf7czn2HNKXmuL+I= +github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165 h1:nkcn14uNmFEuGCb2mBZbBb24RdNRL08b/wb+xBOYpuk= +github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 h1:ofR1ZdrNSkiWcMsRrubK9tb2/SlZVWttAfqUjJi6QYc= +github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs= +github.com/sirupsen/logrus v1.1.2-0.20181101075517-7eeb7b7cbdeb h1:Zs7k4rxIvfXFjav0ia3QqnauqGfG2hr8+y6NZYwq8iA= +github.com/sirupsen/logrus v1.1.2-0.20181101075517-7eeb7b7cbdeb/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/spf13/afero v1.1.1 h1:Lt3ihYMlE+lreX1GS4Qw4ZsNpYQLxIXKBTEOXm3nt6I= +github.com/spf13/afero v1.1.1/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cobra v0.0.4-0.20180629152535-a114f312e075 h1:bfSj+hHTrZKbMJHEldrx659CxsvTHbAznKTfb42l2M4= +github.com/spf13/cobra v0.0.4-0.20180629152535-a114f312e075/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.1 h1:52QO5WkIUcHGIR7EnGagH88x1bUzqGXTC5/1bDTUQ7U= +github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/tidwall/gjson v1.1.3 h1:u4mspaByxY+Qk4U1QYYVzGFI8qxN/3jtEV0ZDb2vRic= +github.com/tidwall/gjson v1.1.3/go.mod h1:c/nTNbUr0E0OrXEhq1pwa8iEgc2DOt4ZZqAt1HtCkPA= +github.com/tidwall/match v1.0.0 h1:Ym1EcFkp+UQ4ptxfWlW+iMdq5cPH5nEuGzdf/Pb7VmI= +github.com/tidwall/match v1.0.0/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= +github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51 h1:BP2bjP495BBPaBcS5rmqviTfrOkN5rO5ceKAMRZCRFc= +github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/ugorji/go v0.0.0-20180112141927-9831f2c3ac10 h1:4zp+5ElNBLy5qmaDFrbVDolQSOtPmquw+W6EMNEpi+k= +github.com/ugorji/go v0.0.0-20180112141927-9831f2c3ac10/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= +github.com/urfave/negroni v0.3.1-0.20180130044549-22c5532ea862 h1:o3gEt3MZ4RRJUzO8qtPd31kJYU3m/ga9re5xbjVFUvA= +github.com/urfave/negroni v0.3.1-0.20180130044549-22c5532ea862/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4 h1:gKMu1Bf6QINDnvyZuTaACm9ofY+PRh+5vFz4oxBZeF8= +github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4/go.mod h1:50wTf68f99/Zt14pr046Tgt3Lp2vLyFZKzbFXTOabXw= +github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8 h1:EVObHAr8DqpoJCVv6KYTle8FEImKhtkfcZetNqxDoJQ= +github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= +github.com/zyedidia/highlight v0.0.0-20170330143449-201131ce5cf5 h1:Zs6mpwXvlqpF9zHl5XaN0p5V4J9XvP+WBuiuXyIgqvc= +github.com/zyedidia/highlight v0.0.0-20170330143449-201131ce5cf5/go.mod h1:c1r+Ob9tUTPB0FKWO1+x+Hsc/zNa45WdGq7Y38Ybip0= +golang.org/x/crypto v0.0.0-20180308185624-c7dcf104e3a7 h1:c9Tyi4qyEZwEJ1+Zm6Fcqf+68wmUdMzfXYTp3s8Nzg8= +golang.org/x/crypto v0.0.0-20180308185624-c7dcf104e3a7/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc h1:a3CU5tJYVj92DY2LaA1kUkrsqD5/3mLDhx2NcNqyW+0= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180312081825-c28acc882ebc h1:eCzBKjjvhDDXMoH5l7eA+YK1PEtyJ2QLj3f4IArr+zg= +golang.org/x/sys v0.0.0-20180312081825-c28acc882ebc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/time v0.0.0-20170927054726-6dc17368e09b h1:3X+R0qq1+64izd8es+EttB6qcY+JDlVmAhpRXl7gpzU= +golang.org/x/time v0.0.0-20170927054726-6dc17368e09b/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.2 h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ= +gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/guregu/null.v2 v2.1.2 h1:YOuepWdYqGnrenzPyMi+ybCjeDzjdazynbwsXXOk4i8= +gopkg.in/guregu/null.v2 v2.1.2/go.mod h1:XORrx8tyS5ZDcyUboCIxQtta/Aujk/6pfWrn9Xe33mU= +gopkg.in/guregu/null.v3 v3.3.0 h1:8j3ggqq+NgKt/O7mbFVUFKUMWN+l1AmT5jQmJ6nPh2c= +gopkg.in/guregu/null.v3 v3.3.0/go.mod h1:E4tX2Qe3h7QdL+uZ3a0vqvYwKQsRSQKM5V4YltdgH9Y= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.1.1 h1:fxK3tv8mQPVEgxu/S2LJ040LyqiajHt+syP0CdDS/Sc= +gopkg.in/yaml.v2 v2.1.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/Azure/go-ntlmssp/README.md b/vendor/github.com/Azure/go-ntlmssp/README.md new file mode 100644 index 000000000000..55cdcefab705 --- /dev/null +++ b/vendor/github.com/Azure/go-ntlmssp/README.md @@ -0,0 +1,29 @@ +# go-ntlmssp +Golang package that provides NTLM/Negotiate authentication over HTTP + +[![GoDoc](https://godoc.org/github.com/Azure/go-ntlmssp?status.svg)](https://godoc.org/github.com/Azure/go-ntlmssp) [![Build Status](https://travis-ci.org/Azure/go-ntlmssp.svg?branch=dev)](https://travis-ci.org/Azure/go-ntlmssp) + +Protocol details from https://msdn.microsoft.com/en-us/library/cc236621.aspx +Implementation hints from http://davenport.sourceforge.net/ntlm.html + +This package only implements authentication, no key exchange or encryption. It +only supports Unicode (UTF16LE) encoding of protocol strings, no OEM encoding. +This package implements NTLMv2. + +# Usage + +``` +url, user, password := "http://www.example.com/secrets", "robpike", "pw123" +client := &http.Client{ + Transport: ntlmssp.Negotiator{ + RoundTripper:&http.Transport{}, + }, +} + +req, _ := http.NewRequest("GET", url, nil) +req.SetBasicAuth(user, password) +res, _ := client.Do(req) +``` + +----- +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/vendor/github.com/DataDog/datadog-go/statsd/README.md b/vendor/github.com/DataDog/datadog-go/statsd/README.md new file mode 100644 index 000000000000..f68df54be9f6 --- /dev/null +++ b/vendor/github.com/DataDog/datadog-go/statsd/README.md @@ -0,0 +1,64 @@ +## Overview + +Package `statsd` provides a Go [dogstatsd](http://docs.datadoghq.com/guides/dogstatsd/) client. Dogstatsd extends Statsd, adding tags +and histograms. + +## Get the code + + $ go get github.com/DataDog/datadog-go/statsd + +## Usage + +```go +// Create the client +c, err := statsd.New("127.0.0.1:8125") +if err != nil { + log.Fatal(err) +} +// Prefix every metric with the app name +c.Namespace = "flubber." +// Send the EC2 availability zone as a tag with every metric +c.Tags = append(c.Tags, "us-east-1a") + +// Do some metrics! +err = c.Gauge("request.queue_depth", 12, nil, 1) +err = c.Timing("request.duration", duration, nil, 1) // Uses a time.Duration! +err = c.TimeInMilliseconds("request", 12, nil, 1) +err = c.Incr("request.count_total", nil, 1) +err = c.Decr("request.count_total", nil, 1) +err = c.Count("request.count_total", 2, nil, 1) +``` + +## Buffering Client + +DogStatsD accepts packets with multiple statsd payloads in them. Using the BufferingClient via `NewBufferingClient` will buffer up commands and send them when the buffer is reached or after 100msec. + +## Unix Domain Sockets Client + +DogStatsD version 6 accepts packets through a Unix Socket datagram connection. You can use this protocol by giving a +`unix:///path/to/dsd.socket` addr argument to the `New` or `NewBufferingClient`. + +With this protocol, writes can become blocking if the server's receiving buffer is full. Our default behaviour is to +timeout and drop the packet after 1 ms. You can set a custom timeout duration via the `SetWriteTimeout` method. + +The default mode is to pass write errors from the socket to the caller. This includes write errors the library will +automatically recover from (DogStatsD server not ready yet or is restarting). You can drop these errors and emulate +the UDP behaviour by setting the `SkipErrors` property to `true`. Please note that packets will be dropped in both modes. + +## Development + +Run the tests with: + + $ go test + +## Documentation + +Please see: http://godoc.org/github.com/DataDog/datadog-go/statsd + +## License + +go-dogstatsd is released under the [MIT license](http://www.opensource.org/licenses/mit-license.php). + +## Credits + +Original code by [ooyala](https://github.com/ooyala/go-dogstatsd). diff --git a/vendor/github.com/GeertJohan/go.rice/.gitignore b/vendor/github.com/GeertJohan/go.rice/.gitignore new file mode 100644 index 000000000000..a3c98197a0c6 --- /dev/null +++ b/vendor/github.com/GeertJohan/go.rice/.gitignore @@ -0,0 +1,8 @@ +/example/example +/example/example.exe +/rice/rice +/rice/rice.exe + +*.rice-box.go +*.rice-box.syso +.wercker diff --git a/vendor/github.com/GeertJohan/go.rice/README.md b/vendor/github.com/GeertJohan/go.rice/README.md new file mode 100644 index 000000000000..836e6715b06f --- /dev/null +++ b/vendor/github.com/GeertJohan/go.rice/README.md @@ -0,0 +1,151 @@ +## go.rice + +[![Build Status](https://travis-ci.org/GeertJohan/go.rice.png)](https://travis-ci.org/GeertJohan/go.rice) +[![Godoc](https://img.shields.io/badge/godoc-go.rice-blue.svg?style=flat-square)](https://godoc.org/github.com/GeertJohan/go.rice) + +go.rice is a [Go](http://golang.org) package that makes working with resources such as html,js,css,images and templates very easy. During development `go.rice` will load required files directly from disk. Upon deployment it is easy to add all resource files to a executable using the `rice` tool, without changing the source code for your package. go.rice provides several methods to add resources to a binary. + +### What does it do? +The first thing go.rice does is finding the correct absolute path for your resource files. Say you are executing go binary in your home directory, but your `html-files` are located in `$GOPATH/src/yourApplication/html-files`. `go.rice` will lookup the correct path for that directory (relative to the location of yourApplication). The only thing you have to do is include the resources using `rice.FindBox("html-files")`. + +This only works when the source is available to the machine executing the binary. Which is always the case when the binary was installed with `go get` or `go install`. It might occur that you wish to simply provide a binary, without source. The `rice` tool analyses source code and finds call's to `rice.FindBox(..)` and adds the required directories to the executable binary. There are several methods to add these resources. You can 'embed' by generating go source code, or append the resource to the executable as zip file. In both cases `go.rice` will detect the embedded or appended resources and load those, instead of looking up files from disk. + +### Installation + +Use `go get` to install the package the `rice` tool. +``` +go get github.com/GeertJohan/go.rice +go get github.com/GeertJohan/go.rice/rice +``` + +### Package usage + +Import the package: `import "github.com/GeertJohan/go.rice"` + +**Serving a static content folder over HTTP with a rice Box** +```go +http.Handle("/", http.FileServer(rice.MustFindBox("http-files").HTTPBox())) +http.ListenAndServe(":8080", nil) +``` + +**Service a static content folder over HTTP at a non-root location** +```go +box := rice.MustFindBox("cssfiles") +cssFileServer := http.StripPrefix("/css/", http.FileServer(box.HTTPBox())) +http.Handle("/css/", cssFileServer) +http.ListenAndServe(":8080", nil) +``` + +Note the *trailing slash* in `/css/` in both the call to +`http.StripPrefix` and `http.Handle`. + +**Loading a template** +```go +// find a rice.Box +templateBox, err := rice.FindBox("example-templates") +if err != nil { + log.Fatal(err) +} +// get file contents as string +templateString, err := templateBox.String("message.tmpl") +if err != nil { + log.Fatal(err) +} +// parse and execute the template +tmplMessage, err := template.New("message").Parse(templateString) +if err != nil { + log.Fatal(err) +} +tmplMessage.Execute(os.Stdout, map[string]string{"Message": "Hello, world!"}) + +``` + +Never call `FindBox()` or `MustFindBox()` from an `init()` function, as the boxes might have not been loaded at that time. + +### Tool usage +The `rice` tool lets you add the resources to a binary executable so the files are not loaded from the filesystem anymore. This creates a 'standalone' executable. There are several ways to add the resources to a binary, each has pro's and con's but all will work without requiring changes to the way you load the resources. + +#### embed-go +**Embed resources by generating Go source code** + +This method must be executed before building. It generates a single Go source file called *rice-box.go* for each package, that is compiled by the go compiler into the binary. + +The downside with this option is that the generated go source files can become very large, which will slow down compilation and require lots of memory to compile. + +Execute the following commands: +``` +rice embed-go +go build +``` + +*A Note on Symbolic Links*: `embed-go` uses the `os.Walk` function +from the standard library. The `os.Walk` function does **not** follow +symbolic links. So, when creating a box, be aware that any symbolic +links inside your box's directory will not be followed. **However**, +if the box itself is a symbolic link, its actual location will be +resolved first and then walked. In summary, if your box location is a +symbolic link, it will be followed but none of the symbolic links in +the box will be followed. + +#### embed-syso +**Embed resources by generating a coff .syso file and some .go source code** + +** This method is experimental and should not be used for production systems just yet ** + +This method must be executed before building. It generates a COFF .syso file and Go source file that are compiled by the go compiler into the binary. + +Execute the following commands: +``` +rice embed-syso +go build +``` + +#### append +**Append resources to executable as zip file** + +This method changes an already built executable. It appends the resources as zip file to the binary. It makes compilation a lot faster and can be used with large resource files. + +Downsides for appending are that it requires `zip` to be installed and does not provide a working Seek method. + +Run the following commands to create a standalone executable. +``` +go build -o example +rice append --exec example +``` + +**Note: requires zip command to be installed** + +On windows, install zip from http://gnuwin32.sourceforge.net/packages/zip.htm or cygwin/msys toolsets. + +#### Help information +Run `rice -h` for information about all options. + +You can run the -h option for each sub-command, e.g. `rice append -h`. + +### Order of precedence +When opening a new box, the rice package tries to locate the resources in the following order: + + - embedded in generated go source + - appended as zip + - 'live' from filesystem + + +### License +This project is licensed under a Simplified BSD license. Please read the [LICENSE file][license]. + +### TODO & Development +This package is not completed yet. Though it already provides working embedding, some important featuers are still missing. + - implement Readdir() correctly on virtualDir + - in-code TODO's + - find boxes in imported packages + +Less important stuff: + - idea, os/arch dependent embeds. rice checks if embedding file has _os_arch or build flags. If box is not requested by file without buildflags, then the buildflags are applied to the embed file. + +### Package documentation + +You will find package documentation at [godoc.org/github.com/GeertJohan/go.rice][godoc]. + + + [license]: https://github.com/GeertJohan/go.rice/blob/master/LICENSE + [godoc]: http://godoc.org/github.com/GeertJohan/go.rice diff --git a/vendor/github.com/PuerkitoBio/goquery/.gitattributes b/vendor/github.com/PuerkitoBio/goquery/.gitattributes new file mode 100644 index 000000000000..0cc26ec01c68 --- /dev/null +++ b/vendor/github.com/PuerkitoBio/goquery/.gitattributes @@ -0,0 +1 @@ +testdata/* linguist-vendored diff --git a/vendor/github.com/PuerkitoBio/goquery/.gitignore b/vendor/github.com/PuerkitoBio/goquery/.gitignore new file mode 100644 index 000000000000..970381cd26ae --- /dev/null +++ b/vendor/github.com/PuerkitoBio/goquery/.gitignore @@ -0,0 +1,16 @@ +# editor temporary files +*.sublime-* +.DS_Store +*.swp +#*.*# +tags + +# direnv config +.env* + +# test binaries +*.test + +# coverage and profilte outputs +*.out + diff --git a/vendor/github.com/PuerkitoBio/goquery/README.md b/vendor/github.com/PuerkitoBio/goquery/README.md new file mode 100644 index 000000000000..40522062d0bf --- /dev/null +++ b/vendor/github.com/PuerkitoBio/goquery/README.md @@ -0,0 +1,146 @@ +# goquery - a little like that j-thing, only in Go +[![build status](https://secure.travis-ci.org/PuerkitoBio/goquery.svg?branch=master)](http://travis-ci.org/PuerkitoBio/goquery) [![GoDoc](https://godoc.org/github.com/PuerkitoBio/goquery?status.png)](http://godoc.org/github.com/PuerkitoBio/goquery) [![Sourcegraph Badge](https://sourcegraph.com/github.com/PuerkitoBio/goquery/-/badge.svg)](https://sourcegraph.com/github.com/PuerkitoBio/goquery?badge) + + +goquery brings a syntax and a set of features similar to [jQuery][] to the [Go language][go]. It is based on Go's [net/html package][html] and the CSS Selector library [cascadia][]. Since the net/html parser returns nodes, and not a full-featured DOM tree, jQuery's stateful manipulation functions (like height(), css(), detach()) have been left off. + +Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML. See the [wiki][] for various options to do this. + +Syntax-wise, it is as close as possible to jQuery, with the same function names when possible, and that warm and fuzzy chainable interface. jQuery being the ultra-popular library that it is, I felt that writing a similar HTML-manipulating library was better to follow its API than to start anew (in the same spirit as Go's `fmt` package), even though some of its methods are less than intuitive (looking at you, [index()][index]...). + +## Table of Contents + +* [Installation](#installation) +* [Changelog](#changelog) +* [API](#api) +* [Examples](#examples) +* [Related Projects](#related-projects) +* [License](#license) + +## Installation + +Please note that because of the net/html dependency, goquery requires Go1.1+. + + $ go get github.com/PuerkitoBio/goquery + +(optional) To run unit tests: + + $ cd $GOPATH/src/github.com/PuerkitoBio/goquery + $ go test + +(optional) To run benchmarks (warning: it runs for a few minutes): + + $ cd $GOPATH/src/github.com/PuerkitoBio/goquery + $ go test -bench=".*" + +## Changelog + +**Note that goquery's API is now stable, and will not break.** + +* **2018-01-28 (v1.3.0)** : Add `ToEnd` constant to `Slice` until the end of the selection (thanks to @davidjwilkins for raising the issue). +* **2018-01-11 (v1.2.0)** : Add `AddBack*` and deprecate `AndSelf` (thanks to @davidjwilkins). +* **2017-02-12 (v1.1.0)** : Add `SetHtml` and `SetText` (thanks to @glebtv). +* **2016-12-29 (v1.0.2)** : Optimize allocations for `Selection.Text` (thanks to @radovskyb). +* **2016-08-28 (v1.0.1)** : Optimize performance for large documents. +* **2016-07-27 (v1.0.0)** : Tag version 1.0.0. +* **2016-06-15** : Invalid selector strings internally compile to a `Matcher` implementation that never matches any node (instead of a panic). So for example, `doc.Find("~")` returns an empty `*Selection` object. +* **2016-02-02** : Add `NodeName` utility function similar to the DOM's `nodeName` property. It returns the tag name of the first element in a selection, and other relevant values of non-element nodes (see godoc for details). Add `OuterHtml` utility function similar to the DOM's `outerHTML` property (named `OuterHtml` in small caps for consistency with the existing `Html` method on the `Selection`). +* **2015-04-20** : Add `AttrOr` helper method to return the attribute's value or a default value if absent. Thanks to [piotrkowalczuk][piotr]. +* **2015-02-04** : Add more manipulation functions - Prepend* - thanks again to [Andrew Stone][thatguystone]. +* **2014-11-28** : Add more manipulation functions - ReplaceWith*, Wrap* and Unwrap - thanks again to [Andrew Stone][thatguystone]. +* **2014-11-07** : Add manipulation functions (thanks to [Andrew Stone][thatguystone]) and `*Matcher` functions, that receive compiled cascadia selectors instead of selector strings, thus avoiding potential panics thrown by goquery via `cascadia.MustCompile` calls. This results in better performance (selectors can be compiled once and reused) and more idiomatic error handling (you can handle cascadia's compilation errors, instead of recovering from panics, which had been bugging me for a long time). Note that the actual type expected is a `Matcher` interface, that `cascadia.Selector` implements. Other matcher implementations could be used. +* **2014-11-06** : Change import paths of net/html to golang.org/x/net/html (see https://groups.google.com/forum/#!topic/golang-nuts/eD8dh3T9yyA). Make sure to update your code to use the new import path too when you call goquery with `html.Node`s. +* **v0.3.2** : Add `NewDocumentFromReader()` (thanks jweir) which allows creating a goquery document from an io.Reader. +* **v0.3.1** : Add `NewDocumentFromResponse()` (thanks assassingj) which allows creating a goquery document from an http response. +* **v0.3.0** : Add `EachWithBreak()` which allows to break out of an `Each()` loop by returning false. This function was added instead of changing the existing `Each()` to avoid breaking compatibility. +* **v0.2.1** : Make go-getable, now that [go.net/html is Go1.0-compatible][gonet] (thanks to @matrixik for pointing this out). +* **v0.2.0** : Add support for negative indices in Slice(). **BREAKING CHANGE** `Document.Root` is removed, `Document` is now a `Selection` itself (a selection of one, the root element, just like `Document.Root` was before). Add jQuery's Closest() method. +* **v0.1.1** : Add benchmarks to use as baseline for refactorings, refactor Next...() and Prev...() methods to use the new html package's linked list features (Next/PrevSibling, FirstChild). Good performance boost (40+% in some cases). +* **v0.1.0** : Initial release. + +## API + +goquery exposes two structs, `Document` and `Selection`, and the `Matcher` interface. Unlike jQuery, which is loaded as part of a DOM document, and thus acts on its containing document, goquery doesn't know which HTML document to act upon. So it needs to be told, and that's what the `Document` type is for. It holds the root document node as the initial Selection value to manipulate. + +jQuery often has many variants for the same function (no argument, a selector string argument, a jQuery object argument, a DOM element argument, ...). Instead of exposing the same features in goquery as a single method with variadic empty interface arguments, statically-typed signatures are used following this naming convention: + +* When the jQuery equivalent can be called with no argument, it has the same name as jQuery for the no argument signature (e.g.: `Prev()`), and the version with a selector string argument is called `XxxFiltered()` (e.g.: `PrevFiltered()`) +* When the jQuery equivalent **requires** one argument, the same name as jQuery is used for the selector string version (e.g.: `Is()`) +* The signatures accepting a jQuery object as argument are defined in goquery as `XxxSelection()` and take a `*Selection` object as argument (e.g.: `FilterSelection()`) +* The signatures accepting a DOM element as argument in jQuery are defined in goquery as `XxxNodes()` and take a variadic argument of type `*html.Node` (e.g.: `FilterNodes()`) +* The signatures accepting a function as argument in jQuery are defined in goquery as `XxxFunction()` and take a function as argument (e.g.: `FilterFunction()`) +* The goquery methods that can be called with a selector string have a corresponding version that take a `Matcher` interface and are defined as `XxxMatcher()` (e.g.: `IsMatcher()`) + +Utility functions that are not in jQuery but are useful in Go are implemented as functions (that take a `*Selection` as parameter), to avoid a potential naming clash on the `*Selection`'s methods (reserved for jQuery-equivalent behaviour). + +The complete [godoc reference documentation can be found here][doc]. + +Please note that Cascadia's selectors do not necessarily match all supported selectors of jQuery (Sizzle). See the [cascadia project][cascadia] for details. Invalid selector strings compile to a `Matcher` that fails to match any node. Behaviour of the various functions that take a selector string as argument follows from that fact, e.g. (where `~` is an invalid selector string): + +* `Find("~")` returns an empty selection because the selector string doesn't match anything. +* `Add("~")` returns a new selection that holds the same nodes as the original selection, because it didn't add any node (selector string didn't match anything). +* `ParentsFiltered("~")` returns an empty selection because the selector string doesn't match anything. +* `ParentsUntil("~")` returns all parents of the selection because the selector string didn't match any element to stop before the top element. + +## Examples + +See some tips and tricks in the [wiki][]. + +Adapted from example_test.go: + +```Go +package main + +import ( + "fmt" + "log" + + "github.com/PuerkitoBio/goquery" +) + +func ExampleScrape() { + doc, err := goquery.NewDocument("http://metalsucks.net") + if err != nil { + log.Fatal(err) + } + + // Find the review items + doc.Find(".sidebar-reviews article .content-block").Each(func(i int, s *goquery.Selection) { + // For each item found, get the band and title + band := s.Find("a").Text() + title := s.Find("i").Text() + fmt.Printf("Review %d: %s - %s\n", i, band, title) + }) +} + +func main() { + ExampleScrape() +} +``` + +## Related Projects + +- [Goq][goq], an HTML deserialization and scraping library based on goquery and struct tags. +- [andybalholm/cascadia][cascadia], the CSS selector library used by goquery. +- [suntong/cascadia][cascadiacli], a command-line interface to the cascadia CSS selector library, useful to test selectors. +- [asciimoo/colly](https://github.com/asciimoo/colly), a lightning fast and elegant Scraping Framework + +## License + +The [BSD 3-Clause license][bsd], the same as the [Go language][golic]. Cascadia's license is [here][caslic]. + +[jquery]: http://jquery.com/ +[go]: http://golang.org/ +[cascadia]: https://github.com/andybalholm/cascadia +[cascadiacli]: https://github.com/suntong/cascadia +[bsd]: http://opensource.org/licenses/BSD-3-Clause +[golic]: http://golang.org/LICENSE +[caslic]: https://github.com/andybalholm/cascadia/blob/master/LICENSE +[doc]: http://godoc.org/github.com/PuerkitoBio/goquery +[index]: http://api.jquery.com/index/ +[gonet]: https://github.com/golang/net/ +[html]: http://godoc.org/golang.org/x/net/html +[wiki]: https://github.com/PuerkitoBio/goquery/wiki/Tips-and-tricks +[thatguystone]: https://github.com/thatguystone +[piotr]: https://github.com/piotrkowalczuk +[goq]: https://github.com/andrewstuart/goq diff --git a/vendor/github.com/Shopify/sarama/.gitignore b/vendor/github.com/Shopify/sarama/.gitignore new file mode 100644 index 000000000000..c6c482dca8e3 --- /dev/null +++ b/vendor/github.com/Shopify/sarama/.gitignore @@ -0,0 +1,26 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so +*.test + +# Folders +_obj +_test +.vagrant + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe + +coverage.txt diff --git a/vendor/github.com/Shopify/sarama/CHANGELOG.md b/vendor/github.com/Shopify/sarama/CHANGELOG.md new file mode 100644 index 000000000000..836841650c3d --- /dev/null +++ b/vendor/github.com/Shopify/sarama/CHANGELOG.md @@ -0,0 +1,503 @@ +# Changelog + +#### Version 1.16.0 (2018-02-12) + +New Features: + - Add support for the Create/Delete Topics request/response pairs + ([#1007](https://github.com/Shopify/sarama/pull/1007), + [#1008](https://github.com/Shopify/sarama/pull/1008)). + - Add support for the Describe/Create/Delete ACL request/response pairs + ([#1009](https://github.com/Shopify/sarama/pull/1009)). + - Add support for the five transaction-related request/response pairs + ([#1016](https://github.com/Shopify/sarama/pull/1016)). + +Improvements: + - Permit setting version on mock producer responses + ([#999](https://github.com/Shopify/sarama/pull/999)). + - Add `NewMockBrokerListener` helper for testing TLS connections + ([#1019](https://github.com/Shopify/sarama/pull/1019)). + - Changed the default value for `Consumer.Fetch.Default` from 32KiB to 1MiB + which results in much higher throughput in most cases + ([#1024](https://github.com/Shopify/sarama/pull/1024)). + - Reuse the `time.Ticker` across fetch requests in the PartitionConsumer to + reduce CPU and memory usage when processing many partitions + ([#1028](https://github.com/Shopify/sarama/pull/1028)). + - Assign relative offsets to messages in the producer to save the brokers a + recompression pass + ([#1002](https://github.com/Shopify/sarama/pull/1002), + [#1015](https://github.com/Shopify/sarama/pull/1015)). + +Bug Fixes: + - Fix producing uncompressed batches with the new protocol format + ([#1032](https://github.com/Shopify/sarama/issues/1032)). + - Fix consuming compacted topics with the new protocol format + ([#1005](https://github.com/Shopify/sarama/issues/1005)). + - Fix consuming topics with a mix of protocol formats + ([#1021](https://github.com/Shopify/sarama/issues/1021)). + - Fix consuming when the broker includes multiple batches in a single response + ([#1022](https://github.com/Shopify/sarama/issues/1022)). + - Fix detection of `PartialTrailingMessage` when the partial message was + truncated before the magic value indicating its version + ([#1030](https://github.com/Shopify/sarama/pull/1030)). + - Fix expectation-checking in the mock of `SyncProducer.SendMessages` + ([#1035](https://github.com/Shopify/sarama/pull/1035)). + +#### Version 1.15.0 (2017-12-08) + +New Features: + - Claim official support for Kafka 1.0, though it did already work + ([#984](https://github.com/Shopify/sarama/pull/984)). + - Helper methods for Kafka version numbers to/from strings + ([#989](https://github.com/Shopify/sarama/pull/989)). + - Implement CreatePartitions request/response + ([#985](https://github.com/Shopify/sarama/pull/985)). + +Improvements: + - Add error codes 45-60 + ([#986](https://github.com/Shopify/sarama/issues/986)). + +Bug Fixes: + - Fix slow consuming for certain Kafka 0.11/1.0 configurations + ([#982](https://github.com/Shopify/sarama/pull/982)). + - Correctly determine when a FetchResponse contains the new message format + ([#990](https://github.com/Shopify/sarama/pull/990)). + - Fix producing with multiple headers + ([#996](https://github.com/Shopify/sarama/pull/996)). + - Fix handling of truncated record batches + ([#998](https://github.com/Shopify/sarama/pull/998)). + - Fix leaking metrics when closing brokers + ([#991](https://github.com/Shopify/sarama/pull/991)). + +#### Version 1.14.0 (2017-11-13) + +New Features: + - Add support for the new Kafka 0.11 record-batch format, including the wire + protocol and the necessary behavioural changes in the producer and consumer. + Transactions and idempotency are not yet supported, but producing and + consuming should work with all the existing bells and whistles (batching, + compression, etc) as well as the new custom headers. Thanks to Vlad Hanciuta + of Arista Networks for this work. Part of + ([#901](https://github.com/Shopify/sarama/issues/901)). + +Bug Fixes: + - Fix encoding of ProduceResponse versions in test + ([#970](https://github.com/Shopify/sarama/pull/970)). + - Return partial replicas list when we have it + ([#975](https://github.com/Shopify/sarama/pull/975)). + +#### Version 1.13.0 (2017-10-04) + +New Features: + - Support for FetchRequest version 3 + ([#905](https://github.com/Shopify/sarama/pull/905)). + - Permit setting version on mock FetchResponses + ([#939](https://github.com/Shopify/sarama/pull/939)). + - Add a configuration option to support storing only minimal metadata for + extremely large clusters + ([#937](https://github.com/Shopify/sarama/pull/937)). + - Add `PartitionOffsetManager.ResetOffset` for backtracking tracked offsets + ([#932](https://github.com/Shopify/sarama/pull/932)). + +Improvements: + - Provide the block-level timestamp when consuming compressed messages + ([#885](https://github.com/Shopify/sarama/issues/885)). + - `Client.Replicas` and `Client.InSyncReplicas` now respect the order returned + by the broker, which can be meaningful + ([#930](https://github.com/Shopify/sarama/pull/930)). + - Use a `Ticker` to reduce consumer timer overhead at the cost of higher + variance in the actual timeout + ([#933](https://github.com/Shopify/sarama/pull/933)). + +Bug Fixes: + - Gracefully handle messages with negative timestamps + ([#907](https://github.com/Shopify/sarama/pull/907)). + - Raise a proper error when encountering an unknown message version + ([#940](https://github.com/Shopify/sarama/pull/940)). + +#### Version 1.12.0 (2017-05-08) + +New Features: + - Added support for the `ApiVersions` request and response pair, and Kafka + version 0.10.2 ([#867](https://github.com/Shopify/sarama/pull/867)). Note + that you still need to specify the Kafka version in the Sarama configuration + for the time being. + - Added a `Brokers` method to the Client which returns the complete set of + active brokers ([#813](https://github.com/Shopify/sarama/pull/813)). + - Added an `InSyncReplicas` method to the Client which returns the set of all + in-sync broker IDs for the given partition, now that the Kafka versions for + which this was misleading are no longer in our supported set + ([#872](https://github.com/Shopify/sarama/pull/872)). + - Added a `NewCustomHashPartitioner` method which allows constructing a hash + partitioner with a custom hash method in case the default (FNV-1a) is not + suitable + ([#837](https://github.com/Shopify/sarama/pull/837), + [#841](https://github.com/Shopify/sarama/pull/841)). + +Improvements: + - Recognize more Kafka error codes + ([#859](https://github.com/Shopify/sarama/pull/859)). + +Bug Fixes: + - Fix an issue where decoding a malformed FetchRequest would not return the + correct error ([#818](https://github.com/Shopify/sarama/pull/818)). + - Respect ordering of group protocols in JoinGroupRequests. This fix is + transparent if you're using the `AddGroupProtocol` or + `AddGroupProtocolMetadata` helpers; otherwise you will need to switch from + the `GroupProtocols` field (now deprecated) to use `OrderedGroupProtocols` + ([#812](https://github.com/Shopify/sarama/issues/812)). + - Fix an alignment-related issue with atomics on 32-bit architectures + ([#859](https://github.com/Shopify/sarama/pull/859)). + +#### Version 1.11.0 (2016-12-20) + +_Important:_ As of Sarama 1.11 it is necessary to set the config value of +`Producer.Return.Successes` to true in order to use the SyncProducer. Previous +versions would silently override this value when instantiating a SyncProducer +which led to unexpected values and data races. + +New Features: + - Metrics! Thanks to Sébastien Launay for all his work on this feature + ([#701](https://github.com/Shopify/sarama/pull/701), + [#746](https://github.com/Shopify/sarama/pull/746), + [#766](https://github.com/Shopify/sarama/pull/766)). + - Add support for LZ4 compression + ([#786](https://github.com/Shopify/sarama/pull/786)). + - Add support for ListOffsetRequest v1 and Kafka 0.10.1 + ([#775](https://github.com/Shopify/sarama/pull/775)). + - Added a `HighWaterMarks` method to the Consumer which aggregates the + `HighWaterMarkOffset` values of its child topic/partitions + ([#769](https://github.com/Shopify/sarama/pull/769)). + +Bug Fixes: + - Fixed producing when using timestamps, compression and Kafka 0.10 + ([#759](https://github.com/Shopify/sarama/pull/759)). + - Added missing decoder methods to DescribeGroups response + ([#756](https://github.com/Shopify/sarama/pull/756)). + - Fix producer shutdown when `Return.Errors` is disabled + ([#787](https://github.com/Shopify/sarama/pull/787)). + - Don't mutate configuration in SyncProducer + ([#790](https://github.com/Shopify/sarama/pull/790)). + - Fix crash on SASL initialization failure + ([#795](https://github.com/Shopify/sarama/pull/795)). + +#### Version 1.10.1 (2016-08-30) + +Bug Fixes: + - Fix the documentation for `HashPartitioner` which was incorrect + ([#717](https://github.com/Shopify/sarama/pull/717)). + - Permit client creation even when it is limited by ACLs + ([#722](https://github.com/Shopify/sarama/pull/722)). + - Several fixes to the consumer timer optimization code, regressions introduced + in v1.10.0. Go's timers are finicky + ([#730](https://github.com/Shopify/sarama/pull/730), + [#733](https://github.com/Shopify/sarama/pull/733), + [#734](https://github.com/Shopify/sarama/pull/734)). + - Handle consuming compressed relative offsets with Kafka 0.10 + ([#735](https://github.com/Shopify/sarama/pull/735)). + +#### Version 1.10.0 (2016-08-02) + +_Important:_ As of Sarama 1.10 it is necessary to tell Sarama the version of +Kafka you are running against (via the `config.Version` value) in order to use +features that may not be compatible with old Kafka versions. If you don't +specify this value it will default to 0.8.2 (the minimum supported), and trying +to use more recent features (like the offset manager) will fail with an error. + +_Also:_ The offset-manager's behaviour has been changed to match the upstream +java consumer (see [#705](https://github.com/Shopify/sarama/pull/705) and +[#713](https://github.com/Shopify/sarama/pull/713)). If you use the +offset-manager, please ensure that you are committing one *greater* than the +last consumed message offset or else you may end up consuming duplicate +messages. + +New Features: + - Support for Kafka 0.10 + ([#672](https://github.com/Shopify/sarama/pull/672), + [#678](https://github.com/Shopify/sarama/pull/678), + [#681](https://github.com/Shopify/sarama/pull/681), and others). + - Support for configuring the target Kafka version + ([#676](https://github.com/Shopify/sarama/pull/676)). + - Batch producing support in the SyncProducer + ([#677](https://github.com/Shopify/sarama/pull/677)). + - Extend producer mock to allow setting expectations on message contents + ([#667](https://github.com/Shopify/sarama/pull/667)). + +Improvements: + - Support `nil` compressed messages for deleting in compacted topics + ([#634](https://github.com/Shopify/sarama/pull/634)). + - Pre-allocate decoding errors, greatly reducing heap usage and GC time against + misbehaving brokers ([#690](https://github.com/Shopify/sarama/pull/690)). + - Re-use consumer expiry timers, removing one allocation per consumed message + ([#707](https://github.com/Shopify/sarama/pull/707)). + +Bug Fixes: + - Actually default the client ID to "sarama" like we say we do + ([#664](https://github.com/Shopify/sarama/pull/664)). + - Fix a rare issue where `Client.Leader` could return the wrong error + ([#685](https://github.com/Shopify/sarama/pull/685)). + - Fix a possible tight loop in the consumer + ([#693](https://github.com/Shopify/sarama/pull/693)). + - Match upstream's offset-tracking behaviour + ([#705](https://github.com/Shopify/sarama/pull/705)). + - Report UnknownTopicOrPartition errors from the offset manager + ([#706](https://github.com/Shopify/sarama/pull/706)). + - Fix possible negative partition value from the HashPartitioner + ([#709](https://github.com/Shopify/sarama/pull/709)). + +#### Version 1.9.0 (2016-05-16) + +New Features: + - Add support for custom offset manager retention durations + ([#602](https://github.com/Shopify/sarama/pull/602)). + - Publish low-level mocks to enable testing of third-party producer/consumer + implementations ([#570](https://github.com/Shopify/sarama/pull/570)). + - Declare support for Golang 1.6 + ([#611](https://github.com/Shopify/sarama/pull/611)). + - Support for SASL plain-text auth + ([#648](https://github.com/Shopify/sarama/pull/648)). + +Improvements: + - Simplified broker locking scheme slightly + ([#604](https://github.com/Shopify/sarama/pull/604)). + - Documentation cleanup + ([#605](https://github.com/Shopify/sarama/pull/605), + [#621](https://github.com/Shopify/sarama/pull/621), + [#654](https://github.com/Shopify/sarama/pull/654)). + +Bug Fixes: + - Fix race condition shutting down the OffsetManager + ([#658](https://github.com/Shopify/sarama/pull/658)). + +#### Version 1.8.0 (2016-02-01) + +New Features: + - Full support for Kafka 0.9: + - All protocol messages and fields + ([#586](https://github.com/Shopify/sarama/pull/586), + [#588](https://github.com/Shopify/sarama/pull/588), + [#590](https://github.com/Shopify/sarama/pull/590)). + - Verified that TLS support works + ([#581](https://github.com/Shopify/sarama/pull/581)). + - Fixed the OffsetManager compatibility + ([#585](https://github.com/Shopify/sarama/pull/585)). + +Improvements: + - Optimize for fewer system calls when reading from the network + ([#584](https://github.com/Shopify/sarama/pull/584)). + - Automatically retry `InvalidMessage` errors to match upstream behaviour + ([#589](https://github.com/Shopify/sarama/pull/589)). + +#### Version 1.7.0 (2015-12-11) + +New Features: + - Preliminary support for Kafka 0.9 + ([#572](https://github.com/Shopify/sarama/pull/572)). This comes with several + caveats: + - Protocol-layer support is mostly in place + ([#577](https://github.com/Shopify/sarama/pull/577)), however Kafka 0.9 + renamed some messages and fields, which we did not in order to preserve API + compatibility. + - The producer and consumer work against 0.9, but the offset manager does + not ([#573](https://github.com/Shopify/sarama/pull/573)). + - TLS support may or may not work + ([#581](https://github.com/Shopify/sarama/pull/581)). + +Improvements: + - Don't wait for request timeouts on dead brokers, greatly speeding recovery + when the TCP connection is left hanging + ([#548](https://github.com/Shopify/sarama/pull/548)). + - Refactored part of the producer. The new version provides a much more elegant + solution to [#449](https://github.com/Shopify/sarama/pull/449). It is also + slightly more efficient, and much more precise in calculating batch sizes + when compression is used + ([#549](https://github.com/Shopify/sarama/pull/549), + [#550](https://github.com/Shopify/sarama/pull/550), + [#551](https://github.com/Shopify/sarama/pull/551)). + +Bug Fixes: + - Fix race condition in consumer test mock + ([#553](https://github.com/Shopify/sarama/pull/553)). + +#### Version 1.6.1 (2015-09-25) + +Bug Fixes: + - Fix panic that could occur if a user-supplied message value failed to encode + ([#449](https://github.com/Shopify/sarama/pull/449)). + +#### Version 1.6.0 (2015-09-04) + +New Features: + - Implementation of a consumer offset manager using the APIs introduced in + Kafka 0.8.2. The API is designed mainly for integration into a future + high-level consumer, not for direct use, although it is *possible* to use it + directly. + ([#461](https://github.com/Shopify/sarama/pull/461)). + +Improvements: + - CRC32 calculation is much faster on machines with SSE4.2 instructions, + removing a major hotspot from most profiles + ([#255](https://github.com/Shopify/sarama/pull/255)). + +Bug Fixes: + - Make protocol decoding more robust against some malformed packets generated + by go-fuzz ([#523](https://github.com/Shopify/sarama/pull/523), + [#525](https://github.com/Shopify/sarama/pull/525)) or found in other ways + ([#528](https://github.com/Shopify/sarama/pull/528)). + - Fix a potential race condition panic in the consumer on shutdown + ([#529](https://github.com/Shopify/sarama/pull/529)). + +#### Version 1.5.0 (2015-08-17) + +New Features: + - TLS-encrypted network connections are now supported. This feature is subject + to change when Kafka releases built-in TLS support, but for now this is + enough to work with TLS-terminating proxies + ([#154](https://github.com/Shopify/sarama/pull/154)). + +Improvements: + - The consumer will not block if a single partition is not drained by the user; + all other partitions will continue to consume normally + ([#485](https://github.com/Shopify/sarama/pull/485)). + - Formatting of error strings has been much improved + ([#495](https://github.com/Shopify/sarama/pull/495)). + - Internal refactoring of the producer for code cleanliness and to enable + future work ([#300](https://github.com/Shopify/sarama/pull/300)). + +Bug Fixes: + - Fix a potential deadlock in the consumer on shutdown + ([#475](https://github.com/Shopify/sarama/pull/475)). + +#### Version 1.4.3 (2015-07-21) + +Bug Fixes: + - Don't include the partitioner in the producer's "fetch partitions" + circuit-breaker ([#466](https://github.com/Shopify/sarama/pull/466)). + - Don't retry messages until the broker is closed when abandoning a broker in + the producer ([#468](https://github.com/Shopify/sarama/pull/468)). + - Update the import path for snappy-go, it has moved again and the API has + changed slightly ([#486](https://github.com/Shopify/sarama/pull/486)). + +#### Version 1.4.2 (2015-05-27) + +Bug Fixes: + - Update the import path for snappy-go, it has moved from google code to github + ([#456](https://github.com/Shopify/sarama/pull/456)). + +#### Version 1.4.1 (2015-05-25) + +Improvements: + - Optimizations when decoding snappy messages, thanks to John Potocny + ([#446](https://github.com/Shopify/sarama/pull/446)). + +Bug Fixes: + - Fix hypothetical race conditions on producer shutdown + ([#450](https://github.com/Shopify/sarama/pull/450), + [#451](https://github.com/Shopify/sarama/pull/451)). + +#### Version 1.4.0 (2015-05-01) + +New Features: + - The consumer now implements `Topics()` and `Partitions()` methods to enable + users to dynamically choose what topics/partitions to consume without + instantiating a full client + ([#431](https://github.com/Shopify/sarama/pull/431)). + - The partition-consumer now exposes the high water mark offset value returned + by the broker via the `HighWaterMarkOffset()` method ([#339](https://github.com/Shopify/sarama/pull/339)). + - Added a `kafka-console-consumer` tool capable of handling multiple + partitions, and deprecated the now-obsolete `kafka-console-partitionConsumer` + ([#439](https://github.com/Shopify/sarama/pull/439), + [#442](https://github.com/Shopify/sarama/pull/442)). + +Improvements: + - The producer's logging during retry scenarios is more consistent, more + useful, and slightly less verbose + ([#429](https://github.com/Shopify/sarama/pull/429)). + - The client now shuffles its initial list of seed brokers in order to prevent + thundering herd on the first broker in the list + ([#441](https://github.com/Shopify/sarama/pull/441)). + +Bug Fixes: + - The producer now correctly manages its state if retries occur when it is + shutting down, fixing several instances of confusing behaviour and at least + one potential deadlock ([#419](https://github.com/Shopify/sarama/pull/419)). + - The consumer now handles messages for different partitions asynchronously, + making it much more resilient to specific user code ordering + ([#325](https://github.com/Shopify/sarama/pull/325)). + +#### Version 1.3.0 (2015-04-16) + +New Features: + - The client now tracks consumer group coordinators using + ConsumerMetadataRequests similar to how it tracks partition leadership using + regular MetadataRequests ([#411](https://github.com/Shopify/sarama/pull/411)). + This adds two methods to the client API: + - `Coordinator(consumerGroup string) (*Broker, error)` + - `RefreshCoordinator(consumerGroup string) error` + +Improvements: + - ConsumerMetadataResponses now automatically create a Broker object out of the + ID/address/port combination for the Coordinator; accessing the fields + individually has been deprecated + ([#413](https://github.com/Shopify/sarama/pull/413)). + - Much improved handling of `OffsetOutOfRange` errors in the consumer. + Consumers will fail to start if the provided offset is out of range + ([#418](https://github.com/Shopify/sarama/pull/418)) + and they will automatically shut down if the offset falls out of range + ([#424](https://github.com/Shopify/sarama/pull/424)). + - Small performance improvement in encoding and decoding protocol messages + ([#427](https://github.com/Shopify/sarama/pull/427)). + +Bug Fixes: + - Fix a rare race condition in the client's background metadata refresher if + it happens to be activated while the client is being closed + ([#422](https://github.com/Shopify/sarama/pull/422)). + +#### Version 1.2.0 (2015-04-07) + +Improvements: + - The producer's behaviour when `Flush.Frequency` is set is now more intuitive + ([#389](https://github.com/Shopify/sarama/pull/389)). + - The producer is now somewhat more memory-efficient during and after retrying + messages due to an improved queue implementation + ([#396](https://github.com/Shopify/sarama/pull/396)). + - The consumer produces much more useful logging output when leadership + changes ([#385](https://github.com/Shopify/sarama/pull/385)). + - The client's `GetOffset` method will now automatically refresh metadata and + retry once in the event of stale information or similar + ([#394](https://github.com/Shopify/sarama/pull/394)). + - Broker connections now have support for using TCP keepalives + ([#407](https://github.com/Shopify/sarama/issues/407)). + +Bug Fixes: + - The OffsetCommitRequest message now correctly implements all three possible + API versions ([#390](https://github.com/Shopify/sarama/pull/390), + [#400](https://github.com/Shopify/sarama/pull/400)). + +#### Version 1.1.0 (2015-03-20) + +Improvements: + - Wrap the producer's partitioner call in a circuit-breaker so that repeatedly + broken topics don't choke throughput + ([#373](https://github.com/Shopify/sarama/pull/373)). + +Bug Fixes: + - Fix the producer's internal reference counting in certain unusual scenarios + ([#367](https://github.com/Shopify/sarama/pull/367)). + - Fix the consumer's internal reference counting in certain unusual scenarios + ([#369](https://github.com/Shopify/sarama/pull/369)). + - Fix a condition where the producer's internal control messages could have + gotten stuck ([#368](https://github.com/Shopify/sarama/pull/368)). + - Fix an issue where invalid partition lists would be cached when asking for + metadata for a non-existant topic ([#372](https://github.com/Shopify/sarama/pull/372)). + + +#### Version 1.0.0 (2015-03-17) + +Version 1.0.0 is the first tagged version, and is almost a complete rewrite. The primary differences with previous untagged versions are: + +- The producer has been rewritten; there is now a `SyncProducer` with a blocking API, and an `AsyncProducer` that is non-blocking. +- The consumer has been rewritten to only open one connection per broker instead of one connection per partition. +- The main types of Sarama are now interfaces to make depedency injection easy; mock implementations for `Consumer`, `SyncProducer` and `AsyncProducer` are provided in the `github.com/Shopify/sarama/mocks` package. +- For most uses cases, it is no longer necessary to open a `Client`; this will be done for you. +- All the configuration values have been unified in the `Config` struct. +- Much improved test suite. diff --git a/vendor/github.com/Shopify/sarama/README.md b/vendor/github.com/Shopify/sarama/README.md new file mode 100644 index 000000000000..28431f13eb8f --- /dev/null +++ b/vendor/github.com/Shopify/sarama/README.md @@ -0,0 +1,39 @@ +sarama +====== + +[![GoDoc](https://godoc.org/github.com/Shopify/sarama?status.png)](https://godoc.org/github.com/Shopify/sarama) +[![Build Status](https://travis-ci.org/Shopify/sarama.svg?branch=master)](https://travis-ci.org/Shopify/sarama) +[![Coverage](https://codecov.io/gh/Shopify/sarama/branch/master/graph/badge.svg)](https://codecov.io/gh/Shopify/sarama) + +Sarama is an MIT-licensed Go client library for [Apache Kafka](https://kafka.apache.org/) version 0.8 (and later). + +### Getting started + +- API documentation and examples are available via [godoc](https://godoc.org/github.com/Shopify/sarama). +- Mocks for testing are available in the [mocks](./mocks) subpackage. +- The [examples](./examples) directory contains more elaborate example applications. +- The [tools](./tools) directory contains command line tools that can be useful for testing, diagnostics, and instrumentation. + +You might also want to look at the [Frequently Asked Questions](https://github.com/Shopify/sarama/wiki/Frequently-Asked-Questions). + +### Compatibility and API stability + +Sarama provides a "2 releases + 2 months" compatibility guarantee: we support +the two latest stable releases of Kafka and Go, and we provide a two month +grace period for older releases. This means we currently officially support +Go 1.9 and 1.8, and Kafka 1.0 through 0.10, although older releases are +still likely to work. + +Sarama follows semantic versioning and provides API stability via the gopkg.in service. +You can import a version with a guaranteed stable API via http://gopkg.in/Shopify/sarama.v1. +A changelog is available [here](CHANGELOG.md). + +### Contributing + +* Get started by checking our [contribution guidelines](https://github.com/Shopify/sarama/blob/master/.github/CONTRIBUTING.md). +* Read the [Sarama wiki](https://github.com/Shopify/sarama/wiki) for more + technical and design details. +* The [Kafka Protocol Specification](https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol) + contains a wealth of useful information. +* For more general issues, there is [a google group](https://groups.google.com/forum/#!forum/kafka-clients) for Kafka client developers. +* If you have any questions, just ask! diff --git a/vendor/github.com/Shopify/sarama/Vagrantfile b/vendor/github.com/Shopify/sarama/Vagrantfile new file mode 100644 index 000000000000..f4b848a301bb --- /dev/null +++ b/vendor/github.com/Shopify/sarama/Vagrantfile @@ -0,0 +1,20 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +# We have 5 * 192MB ZK processes and 5 * 320MB Kafka processes => 2560MB +MEMORY = 3072 + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + config.vm.box = "ubuntu/trusty64" + + config.vm.provision :shell, path: "vagrant/provision.sh" + + config.vm.network "private_network", ip: "192.168.100.67" + + config.vm.provider "virtualbox" do |v| + v.memory = MEMORY + end +end diff --git a/vendor/github.com/Soontao/goHttpDigestClient/.gitignore b/vendor/github.com/Soontao/goHttpDigestClient/.gitignore new file mode 100644 index 000000000000..68057ab16c8c --- /dev/null +++ b/vendor/github.com/Soontao/goHttpDigestClient/.gitignore @@ -0,0 +1,33 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof + +vendor + +#ide + +.idea + +vendor +/goHttpDigestClient.iml diff --git a/vendor/github.com/Soontao/goHttpDigestClient/README.md b/vendor/github.com/Soontao/goHttpDigestClient/README.md new file mode 100644 index 000000000000..0735e9dc3d4c --- /dev/null +++ b/vendor/github.com/Soontao/goHttpDigestClient/README.md @@ -0,0 +1,26 @@ +# go-http-digest-client + +[![Build Status](https://travis-ci.org/Soontao/goHttpDigestClient.svg?branch=master)](https://travis-ci.org/Soontao/goHttpDigestClient) [![Coverage Status](https://coveralls.io/repos/github/Soontao/goHttpDigestClient/badge.svg?branch=master)](https://coveralls.io/github/Soontao/goHttpDigestClient?branch=master) + +Library just for http digest auth, and refer RFC-2617 + +## install + +get -u -v github.com/Soontao/goHttpDigestClient + +## usage + +```go +func TestClientAuthorize(t *testing.T) { + req, err := http.NewRequest("GET", testDigestAuthServerURL, nil) + if err != nil { + t.Fatal(err) + } + opt := &ClientOption{username: testServerUsername, password: testServerPassword} + res, err := DefaultClient.Do(req, opt) +} +``` + +## todo + +* [ ] if option in Client, only need 1 request get challenge \ No newline at end of file diff --git a/vendor/github.com/andybalholm/brotli/README.md b/vendor/github.com/andybalholm/brotli/README.md new file mode 100644 index 000000000000..02d115e55a30 --- /dev/null +++ b/vendor/github.com/andybalholm/brotli/README.md @@ -0,0 +1,5 @@ +This package is a brotli compressor and decompressor implemented in Go. +It was translated from the reference implementation (https://github.com/google/brotli) +with the `c2go` tool at https://github.com/andybalholm/c2go. + +I am using it in production with https://github.com/andybalholm/redwood. diff --git a/vendor/github.com/andybalholm/brotli/go.mod b/vendor/github.com/andybalholm/brotli/go.mod new file mode 100644 index 000000000000..cb505fa05aba --- /dev/null +++ b/vendor/github.com/andybalholm/brotli/go.mod @@ -0,0 +1,5 @@ +module github.com/andybalholm/brotli + +go 1.12 + +require github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 diff --git a/vendor/github.com/andybalholm/brotli/go.sum b/vendor/github.com/andybalholm/brotli/go.sum new file mode 100644 index 000000000000..2ed61f3836d5 --- /dev/null +++ b/vendor/github.com/andybalholm/brotli/go.sum @@ -0,0 +1,2 @@ +github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 h1:KRMr9A3qfbVM7iV/WcLY/rL5LICqwMHLhwRXKu99fXw= +github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= diff --git a/vendor/github.com/andybalholm/cascadia/LICENSE b/vendor/github.com/andybalholm/cascadia/LICENSE old mode 100755 new mode 100644 diff --git a/vendor/github.com/andybalholm/cascadia/README.md b/vendor/github.com/andybalholm/cascadia/README.md new file mode 100644 index 000000000000..9021cb92aa32 --- /dev/null +++ b/vendor/github.com/andybalholm/cascadia/README.md @@ -0,0 +1,7 @@ +# cascadia + +[![](https://travis-ci.org/andybalholm/cascadia.svg)](https://travis-ci.org/andybalholm/cascadia) + +The Cascadia package implements CSS selectors for use with the parse trees produced by the html package. + +To test CSS selectors without writing Go code, check out [cascadia](https://github.com/suntong/cascadia) the command line tool, a thin wrapper around this package. diff --git a/vendor/github.com/andybalholm/cascadia/go.mod b/vendor/github.com/andybalholm/cascadia/go.mod new file mode 100644 index 000000000000..e6febbbfed1b --- /dev/null +++ b/vendor/github.com/andybalholm/cascadia/go.mod @@ -0,0 +1,3 @@ +module "github.com/andybalholm/cascadia" + +require "golang.org/x/net" v0.0.0-20180218175443-cbe0f9307d01 diff --git a/vendor/github.com/daaku/go.zipexe/readme.md b/vendor/github.com/daaku/go.zipexe/readme.md new file mode 100644 index 000000000000..3ec0e8e56e5d --- /dev/null +++ b/vendor/github.com/daaku/go.zipexe/readme.md @@ -0,0 +1,5 @@ +go.zipexe +========= + +This module was taken as-is from https://github.com/cookieo9/resources-go. +Documentation: https://godoc.org/github.com/daaku/go.zipexe diff --git a/vendor/github.com/dlclark/regexp2/.gitignore b/vendor/github.com/dlclark/regexp2/.gitignore new file mode 100644 index 000000000000..38a7addcf4d3 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/.gitignore @@ -0,0 +1,25 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof +*.out \ No newline at end of file diff --git a/vendor/github.com/dlclark/regexp2/ATTRIB b/vendor/github.com/dlclark/regexp2/ATTRIB new file mode 100644 index 000000000000..cdf4560b9e67 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/ATTRIB @@ -0,0 +1,133 @@ +============ +These pieces of code were ported from dotnet/corefx: + +syntax/charclass.go (from RegexCharClass.cs): ported to use the built-in Go unicode classes. Canonicalize is + a direct port, but most of the other code required large changes because the C# implementation + used a string to represent the CharSet data structure and I cleaned that up in my implementation. + +syntax/code.go (from RegexCode.cs): ported literally with various cleanups and layout to make it more Go-ish. + +syntax/escape.go (from RegexParser.cs): ported Escape method and added some optimizations. Unescape is inspired by + the C# implementation but couldn't be directly ported because of the lack of do-while syntax in Go. + +syntax/parser.go (from RegexpParser.cs and RegexOptions.cs): ported parser struct and associated methods as + literally as possible. Several language differences required changes. E.g. lack pre/post-fix increments as + expressions, lack of do-while loops, lack of overloads, etc. + +syntax/prefix.go (from RegexFCD.cs and RegexBoyerMoore.cs): ported as literally as possible and added support + for unicode chars that are longer than the 16-bit char in C# for the 32-bit rune in Go. + +syntax/replacerdata.go (from RegexReplacement.cs): conceptually ported and re-organized to handle differences + in charclass implementation, and fix odd code layout between RegexParser.cs, Regex.cs, and RegexReplacement.cs. + +syntax/tree.go (from RegexTree.cs and RegexNode.cs): ported literally as possible. + +syntax/writer.go (from RegexWriter.cs): ported literally with minor changes to make it more Go-ish. + +match.go (from RegexMatch.cs): ported, simplified, and changed to handle Go's lack of inheritence. + +regexp.go (from Regex.cs and RegexOptions.cs): conceptually serves the same "starting point", but is simplified + and changed to handle differences in C# strings and Go strings/runes. + +replace.go (from RegexReplacement.cs): ported closely and then cleaned up to combine the MatchEvaluator and + simple string replace implementations. + +runner.go (from RegexRunner.cs): ported literally as possible. + +regexp_test.go (from CaptureTests.cs and GroupNamesAndNumbers.cs): conceptually ported, but the code was + manually structured like Go tests. + +replace_test.go (from RegexReplaceStringTest0.cs): conceptually ported + +rtl_test.go (from RightToLeft.cs): conceptually ported +--- +dotnet/corefx was released under this license: + +The MIT License (MIT) + +Copyright (c) Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +============ +These pieces of code are copied from the Go framework: + +- The overall directory structure of regexp2 was inspired by the Go runtime regexp package. +- The optimization in the escape method of syntax/escape.go is from the Go runtime QuoteMeta() func in regexp/regexp.go +- The method signatures in regexp.go are designed to match the Go framework regexp methods closely +- func regexp2.MustCompile and func quote are almost identifical to the regexp package versions +- BenchmarkMatch* and TestProgramTooLong* funcs in regexp_performance_test.go were copied from the framework + regexp/exec_test.go +--- +The Go framework was released under this license: + +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +============ +Some test data were gathered from the Mono project. + +regexp_mono_test.go: ported from https://github.com/mono/mono/blob/master/mcs/class/System/Test/System.Text.RegularExpressions/PerlTrials.cs +--- +Mono tests released under this license: + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/vendor/github.com/dlclark/regexp2/README.md b/vendor/github.com/dlclark/regexp2/README.md new file mode 100644 index 000000000000..f4dc33dab403 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/README.md @@ -0,0 +1,67 @@ +# regexp2 - full featured regular expressions for Go +Regexp2 is a feature-rich RegExp engine for Go. It doesn't have constant time guarantees like the built-in `regexp` package, but it allows backtracking and is compatible with Perl5 and .NET. You'll likely be better off with the RE2 engine from the `regexp` package and should only use this if you need to write very complex patterns or require compatibility with .NET. + +## Basis of the engine +The engine is ported from the .NET framework's System.Text.RegularExpressions.Regex engine. That engine was open sourced in 2015 under the MIT license. There are some fundamental differences between .NET strings and Go strings that required a bit of borrowing from the Go framework regex engine as well. I cleaned up a couple of the dirtier bits during the port (regexcharclass.cs was terrible), but the parse tree, code emmitted, and therefore patterns matched should be identical. + +## Installing +This is a go-gettable library, so install is easy: + + go get github.com/dlclark/regexp2/... + +## Usage +Usage is similar to the Go `regexp` package. Just like in `regexp`, you start by converting a regex into a state machine via the `Compile` or `MustCompile` methods. They ultimately do the same thing, but `MustCompile` will panic if the regex is invalid. You can then use the provided `Regexp` struct to find matches repeatedly. A `Regexp` struct is safe to use across goroutines. + +```go +re := regexp2.MustCompile(`Your pattern`, 0) +if isMatch, _ := re.MatchString(`Something to match`); isMatch { + //do something +} +``` + +The only error that the `*Match*` methods *should* return is a Timeout if you set the `re.MatchTimeout` field. Any other error is a bug in the `regexp2` package. If you need more details about capture groups in a match then use the `FindStringMatch` method, like so: + +```go +if m, _ := re.FindStringMatch(`Something to match`); m != nil { + // the whole match is always group 0 + fmt.Printf("Group 0: %v\n", m.String()) + + // you can get all the groups too + gps := m.Groups() + + // a group can be captured multiple times, so each cap is separately addressable + fmt.Printf("Group 1, first capture", gps[1].Captures[0].String()) + fmt.Printf("Group 1, second capture", gps[1].Captures[1].String()) +} +``` + +Group 0 is embedded in the Match. Group 0 is an automatically-assigned group that encompasses the whole pattern. This means that `m.String()` is the same as `m.Group.String()` and `m.Groups()[0].String()` + +The __last__ capture is embedded in each group, so `g.String()` will return the same thing as `g.Capture.String()` and `g.Captures[len(g.Captures)-1].String()`. + +## Compare `regexp` and `regexp2` +| Category | regexp | regexp2 | +| --- | --- | --- | +| Catastrophic backtracking possible | no, constant execution time guarantees | yes, if your pattern is at risk you can use the `re.MatchTimeout` field | +| Python-style capture groups `(Pre)` | yes | no | +| .NET-style capture groups `(re)` or `('name're)` | no | yes | +| comments `(?#comment)` | no | yes | +| branch numbering reset `(?\|a\|b)` | no | no | +| possessive match `(?>re)` | no | yes | +| positive lookahead `(?=re)` | no | yes | +| negative lookahead `(?!re)` | no | yes | +| positive lookbehind `(?<=re)` | no | yes | +| negative lookbehind `(? 0) { + console.log("Hello, World."); + return; + } + + var xyzzy = NaN; + console.log("Nothing happens."); + return xyzzy; + })(); + ` + + // Parse some JavaScript, yielding a *ast.Program and/or an ErrorList + program, err := parser.ParseFile(nil, filename, src, 0) + + +### Warning + +The parser and AST interfaces are still works-in-progress (particularly where +node types are concerned) and may change in the future. + +## Usage + +#### func ParseFile + +```go +func ParseFile(fileSet *file.FileSet, filename string, src interface{}, mode Mode) (*ast.Program, error) +``` +ParseFile parses the source code of a single JavaScript/ECMAScript source file +and returns the corresponding ast.Program node. + +If fileSet == nil, ParseFile parses source without a FileSet. If fileSet != nil, +ParseFile first adds filename and src to fileSet. + +The filename argument is optional and is used for labelling errors, etc. + +src may be a string, a byte slice, a bytes.Buffer, or an io.Reader, but it MUST +always be in UTF-8. + + // Parse some JavaScript, yielding a *ast.Program and/or an ErrorList + program, err := parser.ParseFile(nil, "", `if (abc > 1) {}`, 0) + +#### func ParseFunction + +```go +func ParseFunction(parameterList, body string) (*ast.FunctionLiteral, error) +``` +ParseFunction parses a given parameter list and body as a function and returns +the corresponding ast.FunctionLiteral node. + +The parameter list, if any, should be a comma-separated list of identifiers. + +#### func ReadSource + +```go +func ReadSource(filename string, src interface{}) ([]byte, error) +``` + +#### func TransformRegExp + +```go +func TransformRegExp(pattern string) (string, error) +``` +TransformRegExp transforms a JavaScript pattern into a Go "regexp" pattern. + +re2 (Go) cannot do backtracking, so the presence of a lookahead (?=) (?!) or +backreference (\1, \2, ...) will cause an error. + +re2 (Go) has a different definition for \s: [\t\n\f\r ]. The JavaScript +definition, on the other hand, also includes \v, Unicode "Separator, Space", +etc. + +If the pattern is invalid (not valid even in JavaScript), then this function +returns the empty string and an error. + +If the pattern is valid, but incompatible (contains a lookahead or +backreference), then this function returns the transformation (a non-empty +string) AND an error. + +#### type Error + +```go +type Error struct { + Position file.Position + Message string +} +``` + +An Error represents a parsing error. It includes the position where the error +occurred and a message/description. + +#### func (Error) Error + +```go +func (self Error) Error() string +``` + +#### type ErrorList + +```go +type ErrorList []*Error +``` + +ErrorList is a list of *Errors. + +#### func (*ErrorList) Add + +```go +func (self *ErrorList) Add(position file.Position, msg string) +``` +Add adds an Error with given position and message to an ErrorList. + +#### func (ErrorList) Err + +```go +func (self ErrorList) Err() error +``` +Err returns an error equivalent to this ErrorList. If the list is empty, Err +returns nil. + +#### func (ErrorList) Error + +```go +func (self ErrorList) Error() string +``` +Error implements the Error interface. + +#### func (ErrorList) Len + +```go +func (self ErrorList) Len() int +``` + +#### func (ErrorList) Less + +```go +func (self ErrorList) Less(i, j int) bool +``` + +#### func (*ErrorList) Reset + +```go +func (self *ErrorList) Reset() +``` +Reset resets an ErrorList to no errors. + +#### func (ErrorList) Sort + +```go +func (self ErrorList) Sort() +``` + +#### func (ErrorList) Swap + +```go +func (self ErrorList) Swap(i, j int) +``` + +#### type Mode + +```go +type Mode uint +``` + +A Mode value is a set of flags (or 0). They control optional parser +functionality. + +-- +**godocdown** http://github.com/robertkrimen/godocdown diff --git a/vendor/github.com/dop251/goja/token/README.markdown b/vendor/github.com/dop251/goja/token/README.markdown new file mode 100644 index 000000000000..ff3b16104030 --- /dev/null +++ b/vendor/github.com/dop251/goja/token/README.markdown @@ -0,0 +1,171 @@ +# token +-- + import "github.com/robertkrimen/otto/token" + +Package token defines constants representing the lexical tokens of JavaScript +(ECMA5). + +## Usage + +```go +const ( + ILLEGAL + EOF + COMMENT + KEYWORD + + STRING + BOOLEAN + NULL + NUMBER + IDENTIFIER + + PLUS // + + MINUS // - + MULTIPLY // * + SLASH // / + REMAINDER // % + + AND // & + OR // | + EXCLUSIVE_OR // ^ + SHIFT_LEFT // << + SHIFT_RIGHT // >> + UNSIGNED_SHIFT_RIGHT // >>> + AND_NOT // &^ + + ADD_ASSIGN // += + SUBTRACT_ASSIGN // -= + MULTIPLY_ASSIGN // *= + QUOTIENT_ASSIGN // /= + REMAINDER_ASSIGN // %= + + AND_ASSIGN // &= + OR_ASSIGN // |= + EXCLUSIVE_OR_ASSIGN // ^= + SHIFT_LEFT_ASSIGN // <<= + SHIFT_RIGHT_ASSIGN // >>= + UNSIGNED_SHIFT_RIGHT_ASSIGN // >>>= + AND_NOT_ASSIGN // &^= + + LOGICAL_AND // && + LOGICAL_OR // || + INCREMENT // ++ + DECREMENT // -- + + EQUAL // == + STRICT_EQUAL // === + LESS // < + GREATER // > + ASSIGN // = + NOT // ! + + BITWISE_NOT // ~ + + NOT_EQUAL // != + STRICT_NOT_EQUAL // !== + LESS_OR_EQUAL // <= + GREATER_OR_EQUAL // >= + + LEFT_PARENTHESIS // ( + LEFT_BRACKET // [ + LEFT_BRACE // { + COMMA // , + PERIOD // . + + RIGHT_PARENTHESIS // ) + RIGHT_BRACKET // ] + RIGHT_BRACE // } + SEMICOLON // ; + COLON // : + QUESTION_MARK // ? + + IF + IN + DO + + VAR + FOR + NEW + TRY + + THIS + ELSE + CASE + VOID + WITH + + WHILE + BREAK + CATCH + THROW + + RETURN + TYPEOF + DELETE + SWITCH + + DEFAULT + FINALLY + + FUNCTION + CONTINUE + DEBUGGER + + INSTANCEOF +) +``` + +#### type Token + +```go +type Token int +``` + +Token is the set of lexical tokens in JavaScript (ECMA5). + +#### func IsKeyword + +```go +func IsKeyword(literal string) (Token, bool) +``` +IsKeyword returns the keyword token if literal is a keyword, a KEYWORD token if +the literal is a future keyword (const, let, class, super, ...), or 0 if the +literal is not a keyword. + +If the literal is a keyword, IsKeyword returns a second value indicating if the +literal is considered a future keyword in strict-mode only. + +7.6.1.2 Future Reserved Words: + + const + class + enum + export + extends + import + super + +7.6.1.2 Future Reserved Words (strict): + + implements + interface + let + package + private + protected + public + static + +#### func (Token) String + +```go +func (tkn Token) String() string +``` +String returns the string corresponding to the token. For operators, delimiters, +and keywords the string is the actual token string (e.g., for the token PLUS, +the String() is "+"). For all other tokens the string corresponds to the token +name (e.g. for the token IDENTIFIER, the string is "IDENTIFIER"). + +-- +**godocdown** http://github.com/robertkrimen/godocdown diff --git a/vendor/github.com/dop251/goja/token/tokenfmt b/vendor/github.com/dop251/goja/token/tokenfmt new file mode 100644 index 000000000000..63dd5d9e6d1e --- /dev/null +++ b/vendor/github.com/dop251/goja/token/tokenfmt @@ -0,0 +1,222 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +my (%token, @order, @keywords); + +{ + my $keywords; + my @const; + push @const, <<_END_; +package token + +const( + _ Token = iota +_END_ + + for (split m/\n/, <<_END_) { +ILLEGAL +EOF +COMMENT +KEYWORD + +STRING +BOOLEAN +NULL +NUMBER +IDENTIFIER + +PLUS + +MINUS - +MULTIPLY * +SLASH / +REMAINDER % + +AND & +OR | +EXCLUSIVE_OR ^ +SHIFT_LEFT << +SHIFT_RIGHT >> +UNSIGNED_SHIFT_RIGHT >>> +AND_NOT &^ + +ADD_ASSIGN += +SUBTRACT_ASSIGN -= +MULTIPLY_ASSIGN *= +QUOTIENT_ASSIGN /= +REMAINDER_ASSIGN %= + +AND_ASSIGN &= +OR_ASSIGN |= +EXCLUSIVE_OR_ASSIGN ^= +SHIFT_LEFT_ASSIGN <<= +SHIFT_RIGHT_ASSIGN >>= +UNSIGNED_SHIFT_RIGHT_ASSIGN >>>= +AND_NOT_ASSIGN &^= + +LOGICAL_AND && +LOGICAL_OR || +INCREMENT ++ +DECREMENT -- + +EQUAL == +STRICT_EQUAL === +LESS < +GREATER > +ASSIGN = +NOT ! + +BITWISE_NOT ~ + +NOT_EQUAL != +STRICT_NOT_EQUAL !== +LESS_OR_EQUAL <= +GREATER_OR_EQUAL <= + +LEFT_PARENTHESIS ( +LEFT_BRACKET [ +LEFT_BRACE { +COMMA , +PERIOD . + +RIGHT_PARENTHESIS ) +RIGHT_BRACKET ] +RIGHT_BRACE } +SEMICOLON ; +COLON : +QUESTION_MARK ? + +firstKeyword +IF +IN +DO + +VAR +FOR +NEW +TRY + +THIS +ELSE +CASE +VOID +WITH + +WHILE +BREAK +CATCH +THROW + +RETURN +TYPEOF +DELETE +SWITCH + +DEFAULT +FINALLY + +FUNCTION +CONTINUE +DEBUGGER + +INSTANCEOF +lastKeyword +_END_ + chomp; + + next if m/^\s*#/; + + my ($name, $symbol) = m/(\w+)\s*(\S+)?/; + + if (defined $symbol) { + push @order, $name; + push @const, "$name // $symbol"; + $token{$name} = $symbol; + } elsif (defined $name) { + $keywords ||= $name eq 'firstKeyword'; + + push @const, $name; + #$const[-1] .= " Token = iota" if 2 == @const; + if ($name =~ m/^([A-Z]+)/) { + push @keywords, $name if $keywords; + push @order, $name; + if ($token{SEMICOLON}) { + $token{$name} = lc $1; + } else { + $token{$name} = $name; + } + } + } else { + push @const, ""; + } + + } + push @const, ")"; + print join "\n", @const, ""; +} + +{ + print <<_END_; + +var token2string = [...]string{ +_END_ + for my $name (@order) { + print "$name: \"$token{$name}\",\n"; + } + print <<_END_; +} +_END_ + + print <<_END_; + +var keywordTable = map[string]_keyword{ +_END_ + for my $name (@keywords) { + print <<_END_ + "@{[ lc $name ]}": _keyword{ + token: $name, + }, +_END_ + } + + for my $name (qw/ + const + class + enum + export + extends + import + super + /) { + print <<_END_ + "$name": _keyword{ + token: KEYWORD, + futureKeyword: true, + }, +_END_ + } + + for my $name (qw/ + implements + interface + let + package + private + protected + public + static + /) { + print <<_END_ + "$name": _keyword{ + token: KEYWORD, + futureKeyword: true, + strict: true, + }, +_END_ + } + + print <<_END_; +} +_END_ +} diff --git a/vendor/github.com/dustin/go-humanize/README.markdown b/vendor/github.com/dustin/go-humanize/README.markdown new file mode 100644 index 000000000000..91b4ae56464b --- /dev/null +++ b/vendor/github.com/dustin/go-humanize/README.markdown @@ -0,0 +1,124 @@ +# Humane Units [![Build Status](https://travis-ci.org/dustin/go-humanize.svg?branch=master)](https://travis-ci.org/dustin/go-humanize) [![GoDoc](https://godoc.org/github.com/dustin/go-humanize?status.svg)](https://godoc.org/github.com/dustin/go-humanize) + +Just a few functions for helping humanize times and sizes. + +`go get` it as `github.com/dustin/go-humanize`, import it as +`"github.com/dustin/go-humanize"`, use it as `humanize`. + +See [godoc](https://godoc.org/github.com/dustin/go-humanize) for +complete documentation. + +## Sizes + +This lets you take numbers like `82854982` and convert them to useful +strings like, `83 MB` or `79 MiB` (whichever you prefer). + +Example: + +```go +fmt.Printf("That file is %s.", humanize.Bytes(82854982)) // That file is 83 MB. +``` + +## Times + +This lets you take a `time.Time` and spit it out in relative terms. +For example, `12 seconds ago` or `3 days from now`. + +Example: + +```go +fmt.Printf("This was touched %s.", humanize.Time(someTimeInstance)) // This was touched 7 hours ago. +``` + +Thanks to Kyle Lemons for the time implementation from an IRC +conversation one day. It's pretty neat. + +## Ordinals + +From a [mailing list discussion][odisc] where a user wanted to be able +to label ordinals. + + 0 -> 0th + 1 -> 1st + 2 -> 2nd + 3 -> 3rd + 4 -> 4th + [...] + +Example: + +```go +fmt.Printf("You're my %s best friend.", humanize.Ordinal(193)) // You are my 193rd best friend. +``` + +## Commas + +Want to shove commas into numbers? Be my guest. + + 0 -> 0 + 100 -> 100 + 1000 -> 1,000 + 1000000000 -> 1,000,000,000 + -100000 -> -100,000 + +Example: + +```go +fmt.Printf("You owe $%s.\n", humanize.Comma(6582491)) // You owe $6,582,491. +``` + +## Ftoa + +Nicer float64 formatter that removes trailing zeros. + +```go +fmt.Printf("%f", 2.24) // 2.240000 +fmt.Printf("%s", humanize.Ftoa(2.24)) // 2.24 +fmt.Printf("%f", 2.0) // 2.000000 +fmt.Printf("%s", humanize.Ftoa(2.0)) // 2 +``` + +## SI notation + +Format numbers with [SI notation][sinotation]. + +Example: + +```go +humanize.SI(0.00000000223, "M") // 2.23 nM +``` + +## English-specific functions + +The following functions are in the `humanize/english` subpackage. + +### Plurals + +Simple English pluralization + +```go +english.PluralWord(1, "object", "") // object +english.PluralWord(42, "object", "") // objects +english.PluralWord(2, "bus", "") // buses +english.PluralWord(99, "locus", "loci") // loci + +english.Plural(1, "object", "") // 1 object +english.Plural(42, "object", "") // 42 objects +english.Plural(2, "bus", "") // 2 buses +english.Plural(99, "locus", "loci") // 99 loci +``` + +### Word series + +Format comma-separated words lists with conjuctions: + +```go +english.WordSeries([]string{"foo"}, "and") // foo +english.WordSeries([]string{"foo", "bar"}, "and") // foo and bar +english.WordSeries([]string{"foo", "bar", "baz"}, "and") // foo, bar and baz + +english.OxfordWordSeries([]string{"foo", "bar", "baz"}, "and") // foo, bar, and baz +``` + +[odisc]: https://groups.google.com/d/topic/golang-nuts/l8NhI74jl-4/discussion +[sinotation]: http://en.wikipedia.org/wiki/Metric_prefix diff --git a/vendor/github.com/eapache/go-resiliency/breaker/README.md b/vendor/github.com/eapache/go-resiliency/breaker/README.md new file mode 100644 index 000000000000..2d1b3d93225d --- /dev/null +++ b/vendor/github.com/eapache/go-resiliency/breaker/README.md @@ -0,0 +1,34 @@ +circuit-breaker +=============== + +[![Build Status](https://travis-ci.org/eapache/go-resiliency.svg?branch=master)](https://travis-ci.org/eapache/go-resiliency) +[![GoDoc](https://godoc.org/github.com/eapache/go-resiliency/breaker?status.svg)](https://godoc.org/github.com/eapache/go-resiliency/breaker) +[![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-active-blue.svg)](https://eapache.github.io/conduct.html) + +The circuit-breaker resiliency pattern for golang. + +Creating a breaker takes three parameters: +- error threshold (for opening the breaker) +- success threshold (for closing the breaker) +- timeout (how long to keep the breaker open) + +```go +b := breaker.New(3, 1, 5*time.Second) + +for { + result := b.Run(func() error { + // communicate with some external service and + // return an error if the communication failed + return nil + }) + + switch result { + case nil: + // success! + case breaker.ErrBreakerOpen: + // our function wasn't run because the breaker was open + default: + // some other error + } +} +``` diff --git a/vendor/github.com/eapache/go-xerial-snappy/.gitignore b/vendor/github.com/eapache/go-xerial-snappy/.gitignore new file mode 100644 index 000000000000..daf913b1b347 --- /dev/null +++ b/vendor/github.com/eapache/go-xerial-snappy/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/vendor/github.com/eapache/go-xerial-snappy/README.md b/vendor/github.com/eapache/go-xerial-snappy/README.md new file mode 100644 index 000000000000..3f2695c72826 --- /dev/null +++ b/vendor/github.com/eapache/go-xerial-snappy/README.md @@ -0,0 +1,13 @@ +# go-xerial-snappy + +[![Build Status](https://travis-ci.org/eapache/go-xerial-snappy.svg?branch=master)](https://travis-ci.org/eapache/go-xerial-snappy) + +Xerial-compatible Snappy framing support for golang. + +Packages using Xerial for snappy encoding use a framing format incompatible with +basically everything else in existence. This package wraps Go's built-in snappy +package to support it. + +Apps that use this format include Apache Kafka (see +https://github.com/dpkp/kafka-python/issues/126#issuecomment-35478921 for +details). diff --git a/vendor/github.com/eapache/queue/.gitignore b/vendor/github.com/eapache/queue/.gitignore new file mode 100644 index 000000000000..836562412fe8 --- /dev/null +++ b/vendor/github.com/eapache/queue/.gitignore @@ -0,0 +1,23 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test diff --git a/vendor/github.com/eapache/queue/README.md b/vendor/github.com/eapache/queue/README.md new file mode 100644 index 000000000000..8e782335cd77 --- /dev/null +++ b/vendor/github.com/eapache/queue/README.md @@ -0,0 +1,16 @@ +Queue +===== + +[![Build Status](https://travis-ci.org/eapache/queue.svg)](https://travis-ci.org/eapache/queue) +[![GoDoc](https://godoc.org/github.com/eapache/queue?status.png)](https://godoc.org/github.com/eapache/queue) +[![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-active-blue.svg)](https://eapache.github.io/conduct.html) + +A fast Golang queue using a ring-buffer, based on the version suggested by Dariusz Górecki. +Using this instead of other, simpler, queue implementations (slice+append or linked list) provides +substantial memory and time benefits, and fewer GC pauses. + +The queue implemented here is as fast as it is in part because it is *not* thread-safe. + +Follows semantic versioning using https://gopkg.in/ - import from +[`gopkg.in/eapache/queue.v1`](https://gopkg.in/eapache/queue.v1) +for guaranteed API stability. diff --git a/vendor/github.com/fatih/color/README.md b/vendor/github.com/fatih/color/README.md new file mode 100644 index 000000000000..623baf3c39e2 --- /dev/null +++ b/vendor/github.com/fatih/color/README.md @@ -0,0 +1,177 @@ +# Color [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/fatih/color) [![Build Status](http://img.shields.io/travis/fatih/color.svg?style=flat-square)](https://travis-ci.org/fatih/color) + + + +Color lets you use colorized outputs in terms of [ANSI Escape +Codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors) in Go (Golang). It +has support for Windows too! The API can be used in several ways, pick one that +suits you. + + +![Color](http://i.imgur.com/c1JI0lA.png) + + +## Install + +```bash +go get github.com/fatih/color +``` + +Note that the `vendor` folder is here for stability. Remove the folder if you +already have the dependencies in your GOPATH. + +## Examples + +### Standard colors + +```go +// Print with default helper functions +color.Cyan("Prints text in cyan.") + +// A newline will be appended automatically +color.Blue("Prints %s in blue.", "text") + +// These are using the default foreground colors +color.Red("We have red") +color.Magenta("And many others ..") + +``` + +### Mix and reuse colors + +```go +// Create a new color object +c := color.New(color.FgCyan).Add(color.Underline) +c.Println("Prints cyan text with an underline.") + +// Or just add them to New() +d := color.New(color.FgCyan, color.Bold) +d.Printf("This prints bold cyan %s\n", "too!.") + +// Mix up foreground and background colors, create new mixes! +red := color.New(color.FgRed) + +boldRed := red.Add(color.Bold) +boldRed.Println("This will print text in bold red.") + +whiteBackground := red.Add(color.BgWhite) +whiteBackground.Println("Red text with white background.") +``` + +### Use your own output (io.Writer) + +```go +// Use your own io.Writer output +color.New(color.FgBlue).Fprintln(myWriter, "blue color!") + +blue := color.New(color.FgBlue) +blue.Fprint(writer, "This will print text in blue.") +``` + +### Custom print functions (PrintFunc) + +```go +// Create a custom print function for convenience +red := color.New(color.FgRed).PrintfFunc() +red("Warning") +red("Error: %s", err) + +// Mix up multiple attributes +notice := color.New(color.Bold, color.FgGreen).PrintlnFunc() +notice("Don't forget this...") +``` + +### Custom fprint functions (FprintFunc) + +```go +blue := color.New(FgBlue).FprintfFunc() +blue(myWriter, "important notice: %s", stars) + +// Mix up with multiple attributes +success := color.New(color.Bold, color.FgGreen).FprintlnFunc() +success(myWriter, "Don't forget this...") +``` + +### Insert into noncolor strings (SprintFunc) + +```go +// Create SprintXxx functions to mix strings with other non-colorized strings: +yellow := color.New(color.FgYellow).SprintFunc() +red := color.New(color.FgRed).SprintFunc() +fmt.Printf("This is a %s and this is %s.\n", yellow("warning"), red("error")) + +info := color.New(color.FgWhite, color.BgGreen).SprintFunc() +fmt.Printf("This %s rocks!\n", info("package")) + +// Use helper functions +fmt.Println("This", color.RedString("warning"), "should be not neglected.") +fmt.Printf("%v %v\n", color.GreenString("Info:"), "an important message.") + +// Windows supported too! Just don't forget to change the output to color.Output +fmt.Fprintf(color.Output, "Windows support: %s", color.GreenString("PASS")) +``` + +### Plug into existing code + +```go +// Use handy standard colors +color.Set(color.FgYellow) + +fmt.Println("Existing text will now be in yellow") +fmt.Printf("This one %s\n", "too") + +color.Unset() // Don't forget to unset + +// You can mix up parameters +color.Set(color.FgMagenta, color.Bold) +defer color.Unset() // Use it in your function + +fmt.Println("All text will now be bold magenta.") +``` + +### Disable color + +There might be a case where you want to disable color output (for example to +pipe the standard output of your app to somewhere else). `Color` has support to +disable colors both globally and for single color definition. For example +suppose you have a CLI app and a `--no-color` bool flag. You can easily disable +the color output with: + +```go + +var flagNoColor = flag.Bool("no-color", false, "Disable color output") + +if *flagNoColor { + color.NoColor = true // disables colorized output +} +``` + +It also has support for single color definitions (local). You can +disable/enable color output on the fly: + +```go +c := color.New(color.FgCyan) +c.Println("Prints cyan text") + +c.DisableColor() +c.Println("This is printed without any color") + +c.EnableColor() +c.Println("This prints again cyan...") +``` + +## Todo + +* Save/Return previous values +* Evaluate fmt.Formatter interface + + +## Credits + + * [Fatih Arslan](https://github.com/fatih) + * Windows support via @mattn: [colorable](https://github.com/mattn/go-colorable) + +## License + +The MIT License (MIT) - see [`LICENSE.md`](https://github.com/fatih/color/blob/master/LICENSE.md) for more details + diff --git a/vendor/github.com/gedex/inflector/README.md b/vendor/github.com/gedex/inflector/README.md new file mode 100644 index 000000000000..45c7b266d562 --- /dev/null +++ b/vendor/github.com/gedex/inflector/README.md @@ -0,0 +1,25 @@ +Inflector +========= + +Inflector pluralizes and singularizes English nouns. + +[![Build Status](https://travis-ci.org/gedex/inflector.png?branch=master)](https://travis-ci.org/gedex/inflector) +[![Coverage Status](https://coveralls.io/repos/gedex/inflector/badge.png?branch=master)](https://coveralls.io/r/gedex/inflector?branch=master) +[![GoDoc](https://godoc.org/github.com/gedex/inflector?status.svg)](https://godoc.org/github.com/gedex/inflector) + +## Basic Usage + +There are only two exported functions: `Pluralize` and `Singularize`. + +~~~go +fmt.Println(inflector.Singularize("People")) // will print "Person" +fmt.Println(inflector.Pluralize("octopus")) // will print "octopuses" +~~~ + +## Credits + +* [CakePHP's Inflector](https://github.com/cakephp/cakephp/blob/master/lib/Cake/Utility/Inflector.php) + +## License + +This library is distributed under the BSD-style license found in the LICENSE.md file. diff --git a/vendor/github.com/ghodss/yaml/.gitignore b/vendor/github.com/ghodss/yaml/.gitignore new file mode 100644 index 000000000000..e256a31e00a5 --- /dev/null +++ b/vendor/github.com/ghodss/yaml/.gitignore @@ -0,0 +1,20 @@ +# OSX leaves these everywhere on SMB shares +._* + +# Eclipse files +.classpath +.project +.settings/** + +# Emacs save files +*~ + +# Vim-related files +[._]*.s[a-w][a-z] +[._]s[a-w][a-z] +*.un~ +Session.vim +.netrwhist + +# Go test binaries +*.test diff --git a/vendor/github.com/ghodss/yaml/README.md b/vendor/github.com/ghodss/yaml/README.md new file mode 100644 index 000000000000..0200f75b4d12 --- /dev/null +++ b/vendor/github.com/ghodss/yaml/README.md @@ -0,0 +1,121 @@ +# YAML marshaling and unmarshaling support for Go + +[![Build Status](https://travis-ci.org/ghodss/yaml.svg)](https://travis-ci.org/ghodss/yaml) + +## Introduction + +A wrapper around [go-yaml](https://github.com/go-yaml/yaml) designed to enable a better way of handling YAML when marshaling to and from structs. + +In short, this library first converts YAML to JSON using go-yaml and then uses `json.Marshal` and `json.Unmarshal` to convert to or from the struct. This means that it effectively reuses the JSON struct tags as well as the custom JSON methods `MarshalJSON` and `UnmarshalJSON` unlike go-yaml. For a detailed overview of the rationale behind this method, [see this blog post](http://ghodss.com/2014/the-right-way-to-handle-yaml-in-golang/). + +## Compatibility + +This package uses [go-yaml](https://github.com/go-yaml/yaml) and therefore supports [everything go-yaml supports](https://github.com/go-yaml/yaml#compatibility). + +## Caveats + +**Caveat #1:** When using `yaml.Marshal` and `yaml.Unmarshal`, binary data should NOT be preceded with the `!!binary` YAML tag. If you do, go-yaml will convert the binary data from base64 to native binary data, which is not compatible with JSON. You can still use binary in your YAML files though - just store them without the `!!binary` tag and decode the base64 in your code (e.g. in the custom JSON methods `MarshalJSON` and `UnmarshalJSON`). This also has the benefit that your YAML and your JSON binary data will be decoded exactly the same way. As an example: + +``` +BAD: + exampleKey: !!binary gIGC + +GOOD: + exampleKey: gIGC +... and decode the base64 data in your code. +``` + +**Caveat #2:** When using `YAMLToJSON` directly, maps with keys that are maps will result in an error since this is not supported by JSON. This error will occur in `Unmarshal` as well since you can't unmarshal map keys anyways since struct fields can't be keys. + +## Installation and usage + +To install, run: + +``` +$ go get github.com/ghodss/yaml +``` + +And import using: + +``` +import "github.com/ghodss/yaml" +``` + +Usage is very similar to the JSON library: + +```go +package main + +import ( + "fmt" + + "github.com/ghodss/yaml" +) + +type Person struct { + Name string `json:"name"` // Affects YAML field names too. + Age int `json:"age"` +} + +func main() { + // Marshal a Person struct to YAML. + p := Person{"John", 30} + y, err := yaml.Marshal(p) + if err != nil { + fmt.Printf("err: %v\n", err) + return + } + fmt.Println(string(y)) + /* Output: + age: 30 + name: John + */ + + // Unmarshal the YAML back into a Person struct. + var p2 Person + err = yaml.Unmarshal(y, &p2) + if err != nil { + fmt.Printf("err: %v\n", err) + return + } + fmt.Println(p2) + /* Output: + {John 30} + */ +} +``` + +`yaml.YAMLToJSON` and `yaml.JSONToYAML` methods are also available: + +```go +package main + +import ( + "fmt" + + "github.com/ghodss/yaml" +) + +func main() { + j := []byte(`{"name": "John", "age": 30}`) + y, err := yaml.JSONToYAML(j) + if err != nil { + fmt.Printf("err: %v\n", err) + return + } + fmt.Println(string(y)) + /* Output: + name: John + age: 30 + */ + j2, err := yaml.YAMLToJSON(y) + if err != nil { + fmt.Printf("err: %v\n", err) + return + } + fmt.Println(string(j2)) + /* Output: + {"age":30,"name":"John"} + */ +} +``` diff --git a/vendor/github.com/gin-contrib/sse/README.md b/vendor/github.com/gin-contrib/sse/README.md new file mode 100644 index 000000000000..c9c49cf94959 --- /dev/null +++ b/vendor/github.com/gin-contrib/sse/README.md @@ -0,0 +1,58 @@ +# Server-Sent Events + +[![GoDoc](https://godoc.org/github.com/gin-contrib/sse?status.svg)](https://godoc.org/github.com/gin-contrib/sse) +[![Build Status](https://travis-ci.org/gin-contrib/sse.svg)](https://travis-ci.org/gin-contrib/sse) +[![codecov](https://codecov.io/gh/gin-contrib/sse/branch/master/graph/badge.svg)](https://codecov.io/gh/gin-contrib/sse) +[![Go Report Card](https://goreportcard.com/badge/github.com/gin-contrib/sse)](https://goreportcard.com/report/github.com/gin-contrib/sse) + +Server-sent events (SSE) is a technology where a browser receives automatic updates from a server via HTTP connection. The Server-Sent Events EventSource API is [standardized as part of HTML5[1] by the W3C](http://www.w3.org/TR/2009/WD-eventsource-20091029/). + +- [Read this great SSE introduction by the HTML5Rocks guys](http://www.html5rocks.com/en/tutorials/eventsource/basics/) +- [Browser support](http://caniuse.com/#feat=eventsource) + +## Sample code + +```go +import "github.com/gin-contrib/sse" + +func httpHandler(w http.ResponseWriter, req *http.Request) { + // data can be a primitive like a string, an integer or a float + sse.Encode(w, sse.Event{ + Event: "message", + Data: "some data\nmore data", + }) + + // also a complex type, like a map, a struct or a slice + sse.Encode(w, sse.Event{ + Id: "124", + Event: "message", + Data: map[string]interface{}{ + "user": "manu", + "date": time.Now().Unix(), + "content": "hi!", + }, + }) +} +``` +``` +event: message +data: some data\\nmore data + +id: 124 +event: message +data: {"content":"hi!","date":1431540810,"user":"manu"} + +``` + +## Content-Type + +```go +fmt.Println(sse.ContentType) +``` +``` +text/event-stream +``` + +## Decoding support + +There is a client-side implementation of SSE coming soon. diff --git a/vendor/github.com/gin-gonic/gin/.gitignore b/vendor/github.com/gin-gonic/gin/.gitignore new file mode 100644 index 000000000000..f3b636dff948 --- /dev/null +++ b/vendor/github.com/gin-gonic/gin/.gitignore @@ -0,0 +1,4 @@ +vendor/* +!vendor/vendor.json +coverage.out +count.out diff --git a/vendor/github.com/gin-gonic/gin/BENCHMARKS.md b/vendor/github.com/gin-gonic/gin/BENCHMARKS.md new file mode 100644 index 000000000000..6efe3ca4203f --- /dev/null +++ b/vendor/github.com/gin-gonic/gin/BENCHMARKS.md @@ -0,0 +1,298 @@ +**Machine:** intel i7 ivy bridge quad-core. 8GB RAM. +**Date:** June 4th, 2015 +[https://github.com/gin-gonic/go-http-routing-benchmark](https://github.com/gin-gonic/go-http-routing-benchmark) + +``` +BenchmarkAce_Param 5000000 372 ns/op 32 B/op 1 allocs/op +BenchmarkBear_Param 1000000 1165 ns/op 424 B/op 5 allocs/op +BenchmarkBeego_Param 1000000 2440 ns/op 720 B/op 10 allocs/op +BenchmarkBone_Param 1000000 1067 ns/op 384 B/op 3 allocs/op +BenchmarkDenco_Param 5000000 240 ns/op 32 B/op 1 allocs/op +BenchmarkEcho_Param 10000000 130 ns/op 0 B/op 0 allocs/op +BenchmarkGin_Param 10000000 133 ns/op 0 B/op 0 allocs/op +BenchmarkGocraftWeb_Param 1000000 1826 ns/op 656 B/op 9 allocs/op +BenchmarkGoji_Param 2000000 957 ns/op 336 B/op 2 allocs/op +BenchmarkGoJsonRest_Param 1000000 2021 ns/op 657 B/op 14 allocs/op +BenchmarkGoRestful_Param 200000 8825 ns/op 2496 B/op 31 allocs/op +BenchmarkGorillaMux_Param 500000 3340 ns/op 784 B/op 9 allocs/op +BenchmarkHttpRouter_Param 10000000 152 ns/op 32 B/op 1 allocs/op +BenchmarkHttpTreeMux_Param 2000000 717 ns/op 336 B/op 2 allocs/op +BenchmarkKocha_Param 3000000 423 ns/op 56 B/op 3 allocs/op +BenchmarkMacaron_Param 1000000 3410 ns/op 1104 B/op 11 allocs/op +BenchmarkMartini_Param 200000 7101 ns/op 1152 B/op 12 allocs/op +BenchmarkPat_Param 1000000 2040 ns/op 656 B/op 14 allocs/op +BenchmarkPossum_Param 1000000 2048 ns/op 624 B/op 7 allocs/op +BenchmarkR2router_Param 1000000 1144 ns/op 432 B/op 6 allocs/op +BenchmarkRevel_Param 200000 6725 ns/op 1672 B/op 28 allocs/op +BenchmarkRivet_Param 1000000 1121 ns/op 464 B/op 5 allocs/op +BenchmarkTango_Param 1000000 1479 ns/op 256 B/op 10 allocs/op +BenchmarkTigerTonic_Param 1000000 3393 ns/op 992 B/op 19 allocs/op +BenchmarkTraffic_Param 300000 5525 ns/op 1984 B/op 23 allocs/op +BenchmarkVulcan_Param 2000000 924 ns/op 98 B/op 3 allocs/op +BenchmarkZeus_Param 1000000 1084 ns/op 368 B/op 3 allocs/op +BenchmarkAce_Param5 3000000 614 ns/op 160 B/op 1 allocs/op +BenchmarkBear_Param5 1000000 1617 ns/op 469 B/op 5 allocs/op +BenchmarkBeego_Param5 1000000 3373 ns/op 992 B/op 13 allocs/op +BenchmarkBone_Param5 1000000 1478 ns/op 432 B/op 3 allocs/op +BenchmarkDenco_Param5 3000000 570 ns/op 160 B/op 1 allocs/op +BenchmarkEcho_Param5 5000000 256 ns/op 0 B/op 0 allocs/op +BenchmarkGin_Param5 10000000 222 ns/op 0 B/op 0 allocs/op +BenchmarkGocraftWeb_Param5 1000000 2789 ns/op 928 B/op 12 allocs/op +BenchmarkGoji_Param5 1000000 1287 ns/op 336 B/op 2 allocs/op +BenchmarkGoJsonRest_Param5 1000000 3670 ns/op 1105 B/op 17 allocs/op +BenchmarkGoRestful_Param5 200000 10756 ns/op 2672 B/op 31 allocs/op +BenchmarkGorillaMux_Param5 300000 5543 ns/op 912 B/op 9 allocs/op +BenchmarkHttpRouter_Param5 5000000 403 ns/op 160 B/op 1 allocs/op +BenchmarkHttpTreeMux_Param5 1000000 1089 ns/op 336 B/op 2 allocs/op +BenchmarkKocha_Param5 1000000 1682 ns/op 440 B/op 10 allocs/op +BenchmarkMacaron_Param5 300000 4596 ns/op 1376 B/op 14 allocs/op +BenchmarkMartini_Param5 100000 15703 ns/op 1280 B/op 12 allocs/op +BenchmarkPat_Param5 300000 5320 ns/op 1008 B/op 42 allocs/op +BenchmarkPossum_Param5 1000000 2155 ns/op 624 B/op 7 allocs/op +BenchmarkR2router_Param5 1000000 1559 ns/op 432 B/op 6 allocs/op +BenchmarkRevel_Param5 200000 8184 ns/op 2024 B/op 35 allocs/op +BenchmarkRivet_Param5 1000000 1914 ns/op 528 B/op 9 allocs/op +BenchmarkTango_Param5 1000000 3280 ns/op 944 B/op 18 allocs/op +BenchmarkTigerTonic_Param5 200000 11638 ns/op 2519 B/op 53 allocs/op +BenchmarkTraffic_Param5 200000 8941 ns/op 2280 B/op 31 allocs/op +BenchmarkVulcan_Param5 1000000 1279 ns/op 98 B/op 3 allocs/op +BenchmarkZeus_Param5 1000000 1574 ns/op 416 B/op 3 allocs/op +BenchmarkAce_Param20 1000000 1528 ns/op 640 B/op 1 allocs/op +BenchmarkBear_Param20 300000 4906 ns/op 1633 B/op 5 allocs/op +BenchmarkBeego_Param20 200000 10529 ns/op 3868 B/op 17 allocs/op +BenchmarkBone_Param20 300000 7362 ns/op 2539 B/op 5 allocs/op +BenchmarkDenco_Param20 1000000 1884 ns/op 640 B/op 1 allocs/op +BenchmarkEcho_Param20 2000000 689 ns/op 0 B/op 0 allocs/op +BenchmarkGin_Param20 3000000 545 ns/op 0 B/op 0 allocs/op +BenchmarkGocraftWeb_Param20 200000 9437 ns/op 3804 B/op 16 allocs/op +BenchmarkGoji_Param20 500000 3987 ns/op 1246 B/op 2 allocs/op +BenchmarkGoJsonRest_Param20 100000 12799 ns/op 4492 B/op 21 allocs/op +BenchmarkGoRestful_Param20 100000 19451 ns/op 5244 B/op 33 allocs/op +BenchmarkGorillaMux_Param20 100000 12456 ns/op 3275 B/op 11 allocs/op +BenchmarkHttpRouter_Param20 1000000 1333 ns/op 640 B/op 1 allocs/op +BenchmarkHttpTreeMux_Param20 300000 6490 ns/op 2187 B/op 4 allocs/op +BenchmarkKocha_Param20 300000 5335 ns/op 1808 B/op 27 allocs/op +BenchmarkMacaron_Param20 200000 11325 ns/op 4252 B/op 18 allocs/op +BenchmarkMartini_Param20 20000 64419 ns/op 3644 B/op 14 allocs/op +BenchmarkPat_Param20 50000 24672 ns/op 4888 B/op 151 allocs/op +BenchmarkPossum_Param20 1000000 2085 ns/op 624 B/op 7 allocs/op +BenchmarkR2router_Param20 300000 6809 ns/op 2283 B/op 8 allocs/op +BenchmarkRevel_Param20 100000 16600 ns/op 5551 B/op 54 allocs/op +BenchmarkRivet_Param20 200000 8428 ns/op 2620 B/op 26 allocs/op +BenchmarkTango_Param20 100000 16302 ns/op 8224 B/op 48 allocs/op +BenchmarkTigerTonic_Param20 30000 46828 ns/op 10538 B/op 178 allocs/op +BenchmarkTraffic_Param20 50000 28871 ns/op 7998 B/op 66 allocs/op +BenchmarkVulcan_Param20 1000000 2267 ns/op 98 B/op 3 allocs/op +BenchmarkZeus_Param20 300000 6828 ns/op 2507 B/op 5 allocs/op +BenchmarkAce_ParamWrite 3000000 502 ns/op 40 B/op 2 allocs/op +BenchmarkBear_ParamWrite 1000000 1303 ns/op 424 B/op 5 allocs/op +BenchmarkBeego_ParamWrite 1000000 2489 ns/op 728 B/op 11 allocs/op +BenchmarkBone_ParamWrite 1000000 1181 ns/op 384 B/op 3 allocs/op +BenchmarkDenco_ParamWrite 5000000 315 ns/op 32 B/op 1 allocs/op +BenchmarkEcho_ParamWrite 10000000 237 ns/op 8 B/op 1 allocs/op +BenchmarkGin_ParamWrite 5000000 336 ns/op 0 B/op 0 allocs/op +BenchmarkGocraftWeb_ParamWrite 1000000 2079 ns/op 664 B/op 10 allocs/op +BenchmarkGoji_ParamWrite 1000000 1092 ns/op 336 B/op 2 allocs/op +BenchmarkGoJsonRest_ParamWrite 1000000 3329 ns/op 1136 B/op 19 allocs/op +BenchmarkGoRestful_ParamWrite 200000 9273 ns/op 2504 B/op 32 allocs/op +BenchmarkGorillaMux_ParamWrite 500000 3919 ns/op 792 B/op 10 allocs/op +BenchmarkHttpRouter_ParamWrite 10000000 223 ns/op 32 B/op 1 allocs/op +BenchmarkHttpTreeMux_ParamWrite 2000000 788 ns/op 336 B/op 2 allocs/op +BenchmarkKocha_ParamWrite 3000000 549 ns/op 56 B/op 3 allocs/op +BenchmarkMacaron_ParamWrite 500000 4558 ns/op 1216 B/op 16 allocs/op +BenchmarkMartini_ParamWrite 200000 8850 ns/op 1256 B/op 16 allocs/op +BenchmarkPat_ParamWrite 500000 3679 ns/op 1088 B/op 19 allocs/op +BenchmarkPossum_ParamWrite 1000000 2114 ns/op 624 B/op 7 allocs/op +BenchmarkR2router_ParamWrite 1000000 1320 ns/op 432 B/op 6 allocs/op +BenchmarkRevel_ParamWrite 200000 8048 ns/op 2128 B/op 33 allocs/op +BenchmarkRivet_ParamWrite 1000000 1393 ns/op 472 B/op 6 allocs/op +BenchmarkTango_ParamWrite 2000000 819 ns/op 136 B/op 5 allocs/op +BenchmarkTigerTonic_ParamWrite 300000 5860 ns/op 1440 B/op 25 allocs/op +BenchmarkTraffic_ParamWrite 200000 7429 ns/op 2400 B/op 27 allocs/op +BenchmarkVulcan_ParamWrite 2000000 972 ns/op 98 B/op 3 allocs/op +BenchmarkZeus_ParamWrite 1000000 1226 ns/op 368 B/op 3 allocs/op +BenchmarkAce_GithubStatic 5000000 294 ns/op 0 B/op 0 allocs/op +BenchmarkBear_GithubStatic 3000000 575 ns/op 88 B/op 3 allocs/op +BenchmarkBeego_GithubStatic 1000000 1561 ns/op 368 B/op 7 allocs/op +BenchmarkBone_GithubStatic 200000 12301 ns/op 2880 B/op 60 allocs/op +BenchmarkDenco_GithubStatic 20000000 74.6 ns/op 0 B/op 0 allocs/op +BenchmarkEcho_GithubStatic 10000000 176 ns/op 0 B/op 0 allocs/op +BenchmarkGin_GithubStatic 10000000 159 ns/op 0 B/op 0 allocs/op +BenchmarkGocraftWeb_GithubStatic 1000000 1116 ns/op 304 B/op 6 allocs/op +BenchmarkGoji_GithubStatic 5000000 413 ns/op 0 B/op 0 allocs/op +BenchmarkGoRestful_GithubStatic 30000 55200 ns/op 3520 B/op 36 allocs/op +BenchmarkGoJsonRest_GithubStatic 1000000 1504 ns/op 337 B/op 12 allocs/op +BenchmarkGorillaMux_GithubStatic 100000 23620 ns/op 464 B/op 8 allocs/op +BenchmarkHttpRouter_GithubStatic 20000000 78.3 ns/op 0 B/op 0 allocs/op +BenchmarkHttpTreeMux_GithubStatic 20000000 84.9 ns/op 0 B/op 0 allocs/op +BenchmarkKocha_GithubStatic 20000000 111 ns/op 0 B/op 0 allocs/op +BenchmarkMacaron_GithubStatic 1000000 2686 ns/op 752 B/op 8 allocs/op +BenchmarkMartini_GithubStatic 100000 22244 ns/op 832 B/op 11 allocs/op +BenchmarkPat_GithubStatic 100000 13278 ns/op 3648 B/op 76 allocs/op +BenchmarkPossum_GithubStatic 1000000 1429 ns/op 480 B/op 4 allocs/op +BenchmarkR2router_GithubStatic 2000000 726 ns/op 144 B/op 5 allocs/op +BenchmarkRevel_GithubStatic 300000 6271 ns/op 1288 B/op 25 allocs/op +BenchmarkRivet_GithubStatic 3000000 474 ns/op 112 B/op 2 allocs/op +BenchmarkTango_GithubStatic 1000000 1842 ns/op 256 B/op 10 allocs/op +BenchmarkTigerTonic_GithubStatic 5000000 361 ns/op 48 B/op 1 allocs/op +BenchmarkTraffic_GithubStatic 30000 47197 ns/op 18920 B/op 149 allocs/op +BenchmarkVulcan_GithubStatic 1000000 1415 ns/op 98 B/op 3 allocs/op +BenchmarkZeus_GithubStatic 1000000 2522 ns/op 512 B/op 11 allocs/op +BenchmarkAce_GithubParam 3000000 578 ns/op 96 B/op 1 allocs/op +BenchmarkBear_GithubParam 1000000 1592 ns/op 464 B/op 5 allocs/op +BenchmarkBeego_GithubParam 1000000 2891 ns/op 784 B/op 11 allocs/op +BenchmarkBone_GithubParam 300000 6440 ns/op 1456 B/op 16 allocs/op +BenchmarkDenco_GithubParam 3000000 514 ns/op 128 B/op 1 allocs/op +BenchmarkEcho_GithubParam 5000000 292 ns/op 0 B/op 0 allocs/op +BenchmarkGin_GithubParam 10000000 242 ns/op 0 B/op 0 allocs/op +BenchmarkGocraftWeb_GithubParam 1000000 2343 ns/op 720 B/op 10 allocs/op +BenchmarkGoji_GithubParam 1000000 1566 ns/op 336 B/op 2 allocs/op +BenchmarkGoJsonRest_GithubParam 1000000 2828 ns/op 721 B/op 15 allocs/op +BenchmarkGoRestful_GithubParam 10000 177711 ns/op 2816 B/op 35 allocs/op +BenchmarkGorillaMux_GithubParam 100000 13591 ns/op 816 B/op 9 allocs/op +BenchmarkHttpRouter_GithubParam 5000000 352 ns/op 96 B/op 1 allocs/op +BenchmarkHttpTreeMux_GithubParam 2000000 973 ns/op 336 B/op 2 allocs/op +BenchmarkKocha_GithubParam 2000000 889 ns/op 128 B/op 5 allocs/op +BenchmarkMacaron_GithubParam 500000 4047 ns/op 1168 B/op 12 allocs/op +BenchmarkMartini_GithubParam 50000 28982 ns/op 1184 B/op 12 allocs/op +BenchmarkPat_GithubParam 200000 8747 ns/op 2480 B/op 56 allocs/op +BenchmarkPossum_GithubParam 1000000 2158 ns/op 624 B/op 7 allocs/op +BenchmarkR2router_GithubParam 1000000 1352 ns/op 432 B/op 6 allocs/op +BenchmarkRevel_GithubParam 200000 7673 ns/op 1784 B/op 30 allocs/op +BenchmarkRivet_GithubParam 1000000 1573 ns/op 480 B/op 6 allocs/op +BenchmarkTango_GithubParam 1000000 2418 ns/op 480 B/op 13 allocs/op +BenchmarkTigerTonic_GithubParam 300000 6048 ns/op 1440 B/op 28 allocs/op +BenchmarkTraffic_GithubParam 100000 20143 ns/op 6024 B/op 55 allocs/op +BenchmarkVulcan_GithubParam 1000000 2224 ns/op 98 B/op 3 allocs/op +BenchmarkZeus_GithubParam 500000 4156 ns/op 1312 B/op 12 allocs/op +BenchmarkAce_GithubAll 10000 109482 ns/op 13792 B/op 167 allocs/op +BenchmarkBear_GithubAll 10000 287490 ns/op 79952 B/op 943 allocs/op +BenchmarkBeego_GithubAll 3000 562184 ns/op 146272 B/op 2092 allocs/op +BenchmarkBone_GithubAll 500 2578716 ns/op 648016 B/op 8119 allocs/op +BenchmarkDenco_GithubAll 20000 94955 ns/op 20224 B/op 167 allocs/op +BenchmarkEcho_GithubAll 30000 58705 ns/op 0 B/op 0 allocs/op +BenchmarkGin_GithubAll 30000 50991 ns/op 0 B/op 0 allocs/op +BenchmarkGocraftWeb_GithubAll 5000 449648 ns/op 133280 B/op 1889 allocs/op +BenchmarkGoji_GithubAll 2000 689748 ns/op 56113 B/op 334 allocs/op +BenchmarkGoJsonRest_GithubAll 5000 537769 ns/op 135995 B/op 2940 allocs/op +BenchmarkGoRestful_GithubAll 100 18410628 ns/op 797236 B/op 7725 allocs/op +BenchmarkGorillaMux_GithubAll 200 8036360 ns/op 153137 B/op 1791 allocs/op +BenchmarkHttpRouter_GithubAll 20000 63506 ns/op 13792 B/op 167 allocs/op +BenchmarkHttpTreeMux_GithubAll 10000 165927 ns/op 56112 B/op 334 allocs/op +BenchmarkKocha_GithubAll 10000 171362 ns/op 23304 B/op 843 allocs/op +BenchmarkMacaron_GithubAll 2000 817008 ns/op 224960 B/op 2315 allocs/op +BenchmarkMartini_GithubAll 100 12609209 ns/op 237952 B/op 2686 allocs/op +BenchmarkPat_GithubAll 300 4830398 ns/op 1504101 B/op 32222 allocs/op +BenchmarkPossum_GithubAll 10000 301716 ns/op 97440 B/op 812 allocs/op +BenchmarkR2router_GithubAll 10000 270691 ns/op 77328 B/op 1182 allocs/op +BenchmarkRevel_GithubAll 1000 1491919 ns/op 345553 B/op 5918 allocs/op +BenchmarkRivet_GithubAll 10000 283860 ns/op 84272 B/op 1079 allocs/op +BenchmarkTango_GithubAll 5000 473821 ns/op 87078 B/op 2470 allocs/op +BenchmarkTigerTonic_GithubAll 2000 1120131 ns/op 241088 B/op 6052 allocs/op +BenchmarkTraffic_GithubAll 200 8708979 ns/op 2664762 B/op 22390 allocs/op +BenchmarkVulcan_GithubAll 5000 353392 ns/op 19894 B/op 609 allocs/op +BenchmarkZeus_GithubAll 2000 944234 ns/op 300688 B/op 2648 allocs/op +BenchmarkAce_GPlusStatic 5000000 251 ns/op 0 B/op 0 allocs/op +BenchmarkBear_GPlusStatic 3000000 415 ns/op 72 B/op 3 allocs/op +BenchmarkBeego_GPlusStatic 1000000 1416 ns/op 352 B/op 7 allocs/op +BenchmarkBone_GPlusStatic 10000000 192 ns/op 32 B/op 1 allocs/op +BenchmarkDenco_GPlusStatic 30000000 47.6 ns/op 0 B/op 0 allocs/op +BenchmarkEcho_GPlusStatic 10000000 131 ns/op 0 B/op 0 allocs/op +BenchmarkGin_GPlusStatic 10000000 131 ns/op 0 B/op 0 allocs/op +BenchmarkGocraftWeb_GPlusStatic 1000000 1035 ns/op 288 B/op 6 allocs/op +BenchmarkGoji_GPlusStatic 5000000 304 ns/op 0 B/op 0 allocs/op +BenchmarkGoJsonRest_GPlusStatic 1000000 1286 ns/op 337 B/op 12 allocs/op +BenchmarkGoRestful_GPlusStatic 200000 9649 ns/op 2160 B/op 30 allocs/op +BenchmarkGorillaMux_GPlusStatic 1000000 2346 ns/op 464 B/op 8 allocs/op +BenchmarkHttpRouter_GPlusStatic 30000000 42.7 ns/op 0 B/op 0 allocs/op +BenchmarkHttpTreeMux_GPlusStatic 30000000 49.5 ns/op 0 B/op 0 allocs/op +BenchmarkKocha_GPlusStatic 20000000 74.8 ns/op 0 B/op 0 allocs/op +BenchmarkMacaron_GPlusStatic 1000000 2520 ns/op 736 B/op 8 allocs/op +BenchmarkMartini_GPlusStatic 300000 5310 ns/op 832 B/op 11 allocs/op +BenchmarkPat_GPlusStatic 5000000 398 ns/op 96 B/op 2 allocs/op +BenchmarkPossum_GPlusStatic 1000000 1434 ns/op 480 B/op 4 allocs/op +BenchmarkR2router_GPlusStatic 2000000 646 ns/op 144 B/op 5 allocs/op +BenchmarkRevel_GPlusStatic 300000 6172 ns/op 1272 B/op 25 allocs/op +BenchmarkRivet_GPlusStatic 3000000 444 ns/op 112 B/op 2 allocs/op +BenchmarkTango_GPlusStatic 1000000 1400 ns/op 208 B/op 10 allocs/op +BenchmarkTigerTonic_GPlusStatic 10000000 213 ns/op 32 B/op 1 allocs/op +BenchmarkTraffic_GPlusStatic 1000000 3091 ns/op 1208 B/op 16 allocs/op +BenchmarkVulcan_GPlusStatic 2000000 863 ns/op 98 B/op 3 allocs/op +BenchmarkZeus_GPlusStatic 10000000 237 ns/op 16 B/op 1 allocs/op +BenchmarkAce_GPlusParam 3000000 435 ns/op 64 B/op 1 allocs/op +BenchmarkBear_GPlusParam 1000000 1205 ns/op 448 B/op 5 allocs/op +BenchmarkBeego_GPlusParam 1000000 2494 ns/op 720 B/op 10 allocs/op +BenchmarkBone_GPlusParam 1000000 1126 ns/op 384 B/op 3 allocs/op +BenchmarkDenco_GPlusParam 5000000 325 ns/op 64 B/op 1 allocs/op +BenchmarkEcho_GPlusParam 10000000 168 ns/op 0 B/op 0 allocs/op +BenchmarkGin_GPlusParam 10000000 170 ns/op 0 B/op 0 allocs/op +BenchmarkGocraftWeb_GPlusParam 1000000 1895 ns/op 656 B/op 9 allocs/op +BenchmarkGoji_GPlusParam 1000000 1071 ns/op 336 B/op 2 allocs/op +BenchmarkGoJsonRest_GPlusParam 1000000 2282 ns/op 657 B/op 14 allocs/op +BenchmarkGoRestful_GPlusParam 100000 19400 ns/op 2560 B/op 33 allocs/op +BenchmarkGorillaMux_GPlusParam 500000 5001 ns/op 784 B/op 9 allocs/op +BenchmarkHttpRouter_GPlusParam 10000000 240 ns/op 64 B/op 1 allocs/op +BenchmarkHttpTreeMux_GPlusParam 2000000 797 ns/op 336 B/op 2 allocs/op +BenchmarkKocha_GPlusParam 3000000 505 ns/op 56 B/op 3 allocs/op +BenchmarkMacaron_GPlusParam 1000000 3668 ns/op 1104 B/op 11 allocs/op +BenchmarkMartini_GPlusParam 200000 10672 ns/op 1152 B/op 12 allocs/op +BenchmarkPat_GPlusParam 1000000 2376 ns/op 704 B/op 14 allocs/op +BenchmarkPossum_GPlusParam 1000000 2090 ns/op 624 B/op 7 allocs/op +BenchmarkR2router_GPlusParam 1000000 1233 ns/op 432 B/op 6 allocs/op +BenchmarkRevel_GPlusParam 200000 6778 ns/op 1704 B/op 28 allocs/op +BenchmarkRivet_GPlusParam 1000000 1279 ns/op 464 B/op 5 allocs/op +BenchmarkTango_GPlusParam 1000000 1981 ns/op 272 B/op 10 allocs/op +BenchmarkTigerTonic_GPlusParam 500000 3893 ns/op 1064 B/op 19 allocs/op +BenchmarkTraffic_GPlusParam 200000 6585 ns/op 2000 B/op 23 allocs/op +BenchmarkVulcan_GPlusParam 1000000 1233 ns/op 98 B/op 3 allocs/op +BenchmarkZeus_GPlusParam 1000000 1350 ns/op 368 B/op 3 allocs/op +BenchmarkAce_GPlus2Params 3000000 512 ns/op 64 B/op 1 allocs/op +BenchmarkBear_GPlus2Params 1000000 1564 ns/op 464 B/op 5 allocs/op +BenchmarkBeego_GPlus2Params 1000000 3043 ns/op 784 B/op 11 allocs/op +BenchmarkBone_GPlus2Params 1000000 3152 ns/op 736 B/op 7 allocs/op +BenchmarkDenco_GPlus2Params 3000000 431 ns/op 64 B/op 1 allocs/op +BenchmarkEcho_GPlus2Params 5000000 247 ns/op 0 B/op 0 allocs/op +BenchmarkGin_GPlus2Params 10000000 219 ns/op 0 B/op 0 allocs/op +BenchmarkGocraftWeb_GPlus2Params 1000000 2363 ns/op 720 B/op 10 allocs/op +BenchmarkGoji_GPlus2Params 1000000 1540 ns/op 336 B/op 2 allocs/op +BenchmarkGoJsonRest_GPlus2Params 1000000 2872 ns/op 721 B/op 15 allocs/op +BenchmarkGoRestful_GPlus2Params 100000 23030 ns/op 2720 B/op 35 allocs/op +BenchmarkGorillaMux_GPlus2Params 200000 10516 ns/op 816 B/op 9 allocs/op +BenchmarkHttpRouter_GPlus2Params 5000000 273 ns/op 64 B/op 1 allocs/op +BenchmarkHttpTreeMux_GPlus2Params 2000000 939 ns/op 336 B/op 2 allocs/op +BenchmarkKocha_GPlus2Params 2000000 844 ns/op 128 B/op 5 allocs/op +BenchmarkMacaron_GPlus2Params 500000 3914 ns/op 1168 B/op 12 allocs/op +BenchmarkMartini_GPlus2Params 50000 35759 ns/op 1280 B/op 16 allocs/op +BenchmarkPat_GPlus2Params 200000 7089 ns/op 2304 B/op 41 allocs/op +BenchmarkPossum_GPlus2Params 1000000 2093 ns/op 624 B/op 7 allocs/op +BenchmarkR2router_GPlus2Params 1000000 1320 ns/op 432 B/op 6 allocs/op +BenchmarkRevel_GPlus2Params 200000 7351 ns/op 1800 B/op 30 allocs/op +BenchmarkRivet_GPlus2Params 1000000 1485 ns/op 480 B/op 6 allocs/op +BenchmarkTango_GPlus2Params 1000000 2111 ns/op 448 B/op 12 allocs/op +BenchmarkTigerTonic_GPlus2Params 300000 6271 ns/op 1528 B/op 28 allocs/op +BenchmarkTraffic_GPlus2Params 100000 14886 ns/op 3312 B/op 34 allocs/op +BenchmarkVulcan_GPlus2Params 1000000 1883 ns/op 98 B/op 3 allocs/op +BenchmarkZeus_GPlus2Params 1000000 2686 ns/op 784 B/op 6 allocs/op +BenchmarkAce_GPlusAll 300000 5912 ns/op 640 B/op 11 allocs/op +BenchmarkBear_GPlusAll 100000 16448 ns/op 5072 B/op 61 allocs/op +BenchmarkBeego_GPlusAll 50000 32916 ns/op 8976 B/op 129 allocs/op +BenchmarkBone_GPlusAll 50000 25836 ns/op 6992 B/op 76 allocs/op +BenchmarkDenco_GPlusAll 500000 4462 ns/op 672 B/op 11 allocs/op +BenchmarkEcho_GPlusAll 500000 2806 ns/op 0 B/op 0 allocs/op +BenchmarkGin_GPlusAll 500000 2579 ns/op 0 B/op 0 allocs/op +BenchmarkGocraftWeb_GPlusAll 50000 25223 ns/op 8144 B/op 116 allocs/op +BenchmarkGoji_GPlusAll 100000 14237 ns/op 3696 B/op 22 allocs/op +BenchmarkGoJsonRest_GPlusAll 50000 29227 ns/op 8221 B/op 183 allocs/op +BenchmarkGoRestful_GPlusAll 10000 203144 ns/op 36064 B/op 441 allocs/op +BenchmarkGorillaMux_GPlusAll 20000 80906 ns/op 9712 B/op 115 allocs/op +BenchmarkHttpRouter_GPlusAll 500000 3040 ns/op 640 B/op 11 allocs/op +BenchmarkHttpTreeMux_GPlusAll 200000 9627 ns/op 3696 B/op 22 allocs/op +BenchmarkKocha_GPlusAll 200000 8108 ns/op 976 B/op 43 allocs/op +BenchmarkMacaron_GPlusAll 30000 48083 ns/op 13968 B/op 142 allocs/op +BenchmarkMartini_GPlusAll 10000 196978 ns/op 15072 B/op 178 allocs/op +BenchmarkPat_GPlusAll 30000 58865 ns/op 16880 B/op 343 allocs/op +BenchmarkPossum_GPlusAll 100000 19685 ns/op 6240 B/op 52 allocs/op +BenchmarkR2router_GPlusAll 100000 16251 ns/op 5040 B/op 76 allocs/op +BenchmarkRevel_GPlusAll 20000 93489 ns/op 21656 B/op 368 allocs/op +BenchmarkRivet_GPlusAll 100000 16907 ns/op 5408 B/op 64 allocs/op +``` diff --git a/vendor/github.com/gin-gonic/gin/CHANGELOG.md b/vendor/github.com/gin-gonic/gin/CHANGELOG.md new file mode 100644 index 000000000000..ee485ec3b532 --- /dev/null +++ b/vendor/github.com/gin-gonic/gin/CHANGELOG.md @@ -0,0 +1,191 @@ +# CHANGELOG + +### Gin 1.2 + +- [NEW] Switch from godeps to govendor +- [NEW] Add support for Let's Encrypt via gin-gonic/autotls +- [NEW] Improve README examples and add extra at examples folder +- [NEW] Improved support with App Engine +- [NEW] Add custom template delimiters, see #860 +- [NEW] Add Template Func Maps, see #962 +- [NEW] Add \*context.Handler(), see #928 +- [NEW] Add \*context.GetRawData() +- [NEW] Add \*context.GetHeader() (request) +- [NEW] Add \*context.AbortWithStatusJSON() (JSON content type) +- [NEW] Add \*context.Keys type cast helpers +- [NEW] Add \*context.ShouldBindWith() +- [NEW] Add \*context.MustBindWith() +- [NEW] Add \*engine.SetFuncMap() +- [DEPRECATE] On next release: \*context.BindWith(), see #855 +- [FIX] Refactor render +- [FIX] Reworked tests +- [FIX] logger now supports cygwin +- [FIX] Use X-Forwarded-For before X-Real-Ip +- [FIX] time.Time binding (#904) + +### Gin 1.1.4 + +- [NEW] Support google appengine for IsTerminal func + +### Gin 1.1.3 + +- [FIX] Reverted Logger: skip ANSI color commands + +### Gin 1.1 + +- [NEW] Implement QueryArray and PostArray methods +- [NEW] Refactor GetQuery and GetPostForm +- [NEW] Add contribution guide +- [FIX] Corrected typos in README +- [FIX] Removed additional Iota +- [FIX] Changed imports to gopkg instead of github in README (#733) +- [FIX] Logger: skip ANSI color commands if output is not a tty + +### Gin 1.0rc2 (...) + +- [PERFORMANCE] Fast path for writing Content-Type. +- [PERFORMANCE] Much faster 404 routing +- [PERFORMANCE] Allocation optimizations +- [PERFORMANCE] Faster root tree lookup +- [PERFORMANCE] Zero overhead, String() and JSON() rendering. +- [PERFORMANCE] Faster ClientIP parsing +- [PERFORMANCE] Much faster SSE implementation +- [NEW] Benchmarks suite +- [NEW] Bind validation can be disabled and replaced with custom validators. +- [NEW] More flexible HTML render +- [NEW] Multipart and PostForm bindings +- [NEW] Adds method to return all the registered routes +- [NEW] Context.HandlerName() returns the main handler's name +- [NEW] Adds Error.IsType() helper +- [FIX] Binding multipart form +- [FIX] Integration tests +- [FIX] Crash when binding non struct object in Context. +- [FIX] RunTLS() implementation +- [FIX] Logger() unit tests +- [FIX] Adds SetHTMLTemplate() warning +- [FIX] Context.IsAborted() +- [FIX] More unit tests +- [FIX] JSON, XML, HTML renders accept custom content-types +- [FIX] gin.AbortIndex is unexported +- [FIX] Better approach to avoid directory listing in StaticFS() +- [FIX] Context.ClientIP() always returns the IP with trimmed spaces. +- [FIX] Better warning when running in debug mode. +- [FIX] Google App Engine integration. debugPrint does not use os.Stdout +- [FIX] Fixes integer overflow in error type +- [FIX] Error implements the json.Marshaller interface +- [FIX] MIT license in every file + + +### Gin 1.0rc1 (May 22, 2015) + +- [PERFORMANCE] Zero allocation router +- [PERFORMANCE] Faster JSON, XML and text rendering +- [PERFORMANCE] Custom hand optimized HttpRouter for Gin +- [PERFORMANCE] Misc code optimizations. Inlining, tail call optimizations +- [NEW] Built-in support for golang.org/x/net/context +- [NEW] Any(path, handler). Create a route that matches any path +- [NEW] Refactored rendering pipeline (faster and static typeded) +- [NEW] Refactored errors API +- [NEW] IndentedJSON() prints pretty JSON +- [NEW] Added gin.DefaultWriter +- [NEW] UNIX socket support +- [NEW] RouterGroup.BasePath is exposed +- [NEW] JSON validation using go-validate-yourself (very powerful options) +- [NEW] Completed suite of unit tests +- [NEW] HTTP streaming with c.Stream() +- [NEW] StaticFile() creates a router for serving just one file. +- [NEW] StaticFS() has an option to disable directory listing. +- [NEW] StaticFS() for serving static files through virtual filesystems +- [NEW] Server-Sent Events native support +- [NEW] WrapF() and WrapH() helpers for wrapping http.HandlerFunc and http.Handler +- [NEW] Added LoggerWithWriter() middleware +- [NEW] Added RecoveryWithWriter() middleware +- [NEW] Added DefaultPostFormValue() +- [NEW] Added DefaultFormValue() +- [NEW] Added DefaultParamValue() +- [FIX] BasicAuth() when using custom realm +- [FIX] Bug when serving static files in nested routing group +- [FIX] Redirect using built-in http.Redirect() +- [FIX] Logger when printing the requested path +- [FIX] Documentation typos +- [FIX] Context.Engine renamed to Context.engine +- [FIX] Better debugging messages +- [FIX] ErrorLogger +- [FIX] Debug HTTP render +- [FIX] Refactored binding and render modules +- [FIX] Refactored Context initialization +- [FIX] Refactored BasicAuth() +- [FIX] NoMethod/NoRoute handlers +- [FIX] Hijacking http +- [FIX] Better support for Google App Engine (using log instead of fmt) + + +### Gin 0.6 (Mar 9, 2015) + +- [NEW] Support multipart/form-data +- [NEW] NoMethod handler +- [NEW] Validate sub structures +- [NEW] Support for HTTP Realm Auth +- [FIX] Unsigned integers in binding +- [FIX] Improve color logger + + +### Gin 0.5 (Feb 7, 2015) + +- [NEW] Content Negotiation +- [FIX] Solved security bug that allow a client to spoof ip +- [FIX] Fix unexported/ignored fields in binding + + +### Gin 0.4 (Aug 21, 2014) + +- [NEW] Development mode +- [NEW] Unit tests +- [NEW] Add Content.Redirect() +- [FIX] Deferring WriteHeader() +- [FIX] Improved documentation for model binding + + +### Gin 0.3 (Jul 18, 2014) + +- [PERFORMANCE] Normal log and error log are printed in the same call. +- [PERFORMANCE] Improve performance of NoRouter() +- [PERFORMANCE] Improve context's memory locality, reduce CPU cache faults. +- [NEW] Flexible rendering API +- [NEW] Add Context.File() +- [NEW] Add shorcut RunTLS() for http.ListenAndServeTLS +- [FIX] Rename NotFound404() to NoRoute() +- [FIX] Errors in context are purged +- [FIX] Adds HEAD method in Static file serving +- [FIX] Refactors Static() file serving +- [FIX] Using keyed initialization to fix app-engine integration +- [FIX] Can't unmarshal JSON array, #63 +- [FIX] Renaming Context.Req to Context.Request +- [FIX] Check application/x-www-form-urlencoded when parsing form + + +### Gin 0.2b (Jul 08, 2014) +- [PERFORMANCE] Using sync.Pool to allocatio/gc overhead +- [NEW] Travis CI integration +- [NEW] Completely new logger +- [NEW] New API for serving static files. gin.Static() +- [NEW] gin.H() can be serialized into XML +- [NEW] Typed errors. Errors can be typed. Internet/external/custom. +- [NEW] Support for Godeps +- [NEW] Travis/Godocs badges in README +- [NEW] New Bind() and BindWith() methods for parsing request body. +- [NEW] Add Content.Copy() +- [NEW] Add context.LastError() +- [NEW] Add shorcut for OPTIONS HTTP method +- [FIX] Tons of README fixes +- [FIX] Header is written before body +- [FIX] BasicAuth() and changes API a little bit +- [FIX] Recovery() middleware only prints panics +- [FIX] Context.Get() does not panic anymore. Use MustGet() instead. +- [FIX] Multiple http.WriteHeader() in NotFound handlers +- [FIX] Engine.Run() panics if http server can't be setted up +- [FIX] Crash when route path doesn't start with '/' +- [FIX] Do not update header when status code is negative +- [FIX] Setting response headers before calling WriteHeader in context.String() +- [FIX] Add MIT license +- [FIX] Changes behaviour of ErrorLogger() and Logger() diff --git a/vendor/github.com/gin-gonic/gin/README.md b/vendor/github.com/gin-gonic/gin/README.md new file mode 100644 index 000000000000..029606b71d86 --- /dev/null +++ b/vendor/github.com/gin-gonic/gin/README.md @@ -0,0 +1,977 @@ +# Gin Web Framework + + + +[![Build Status](https://travis-ci.org/gin-gonic/gin.svg)](https://travis-ci.org/gin-gonic/gin) + [![codecov](https://codecov.io/gh/gin-gonic/gin/branch/master/graph/badge.svg)](https://codecov.io/gh/gin-gonic/gin) + [![Go Report Card](https://goreportcard.com/badge/github.com/gin-gonic/gin)](https://goreportcard.com/report/github.com/gin-gonic/gin) + [![GoDoc](https://godoc.org/github.com/gin-gonic/gin?status.svg)](https://godoc.org/github.com/gin-gonic/gin) + [![Join the chat at https://gitter.im/gin-gonic/gin](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/gin-gonic/gin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +Gin is a web framework written in Go (Golang). It features a martini-like API with much better performance, up to 40 times faster thanks to [httprouter](https://github.com/julienschmidt/httprouter). If you need performance and good productivity, you will love Gin. + +![Gin console logger](https://gin-gonic.github.io/gin/other/console.png) + +```sh +$ cat test.go +``` + +```go +package main + +import "github.com/gin-gonic/gin" + +func main() { + r := gin.Default() + r.GET("/ping", func(c *gin.Context) { + c.JSON(200, gin.H{ + "message": "pong", + }) + }) + r.Run() // listen and serve on 0.0.0.0:8080 +} +``` + +## Benchmarks + +Gin uses a custom version of [HttpRouter](https://github.com/julienschmidt/httprouter) + +[See all benchmarks](/BENCHMARKS.md) + + +Benchmark name | (1) | (2) | (3) | (4) +--------------------------------|----------:|----------:|----------:|------: +BenchmarkAce_GithubAll | 10000 | 109482 | 13792 | 167 +BenchmarkBear_GithubAll | 10000 | 287490 | 79952 | 943 +BenchmarkBeego_GithubAll | 3000 | 562184 | 146272 | 2092 +BenchmarkBone_GithubAll | 500 | 2578716 | 648016 | 8119 +BenchmarkDenco_GithubAll | 20000 | 94955 | 20224 | 167 +BenchmarkEcho_GithubAll | 30000 | 58705 | 0 | 0 +**BenchmarkGin_GithubAll** | **30000** | **50991** | **0** | **0** +BenchmarkGocraftWeb_GithubAll | 5000 | 449648 | 133280 | 1889 +BenchmarkGoji_GithubAll | 2000 | 689748 | 56113 | 334 +BenchmarkGoJsonRest_GithubAll | 5000 | 537769 | 135995 | 2940 +BenchmarkGoRestful_GithubAll | 100 | 18410628 | 797236 | 7725 +BenchmarkGorillaMux_GithubAll | 200 | 8036360 | 153137 | 1791 +BenchmarkHttpRouter_GithubAll | 20000 | 63506 | 13792 | 167 +BenchmarkHttpTreeMux_GithubAll | 10000 | 165927 | 56112 | 334 +BenchmarkKocha_GithubAll | 10000 | 171362 | 23304 | 843 +BenchmarkMacaron_GithubAll | 2000 | 817008 | 224960 | 2315 +BenchmarkMartini_GithubAll | 100 | 12609209 | 237952 | 2686 +BenchmarkPat_GithubAll | 300 | 4830398 | 1504101 | 32222 +BenchmarkPossum_GithubAll | 10000 | 301716 | 97440 | 812 +BenchmarkR2router_GithubAll | 10000 | 270691 | 77328 | 1182 +BenchmarkRevel_GithubAll | 1000 | 1491919 | 345553 | 5918 +BenchmarkRivet_GithubAll | 10000 | 283860 | 84272 | 1079 +BenchmarkTango_GithubAll | 5000 | 473821 | 87078 | 2470 +BenchmarkTigerTonic_GithubAll | 2000 | 1120131 | 241088 | 6052 +BenchmarkTraffic_GithubAll | 200 | 8708979 | 2664762 | 22390 +BenchmarkVulcan_GithubAll | 5000 | 353392 | 19894 | 609 +BenchmarkZeus_GithubAll | 2000 | 944234 | 300688 | 2648 + +(1): Total Repetitions +(2): Single Repetition Duration (ns/op) +(3): Heap Memory (B/op) +(4): Average Allocations per Repetition (allocs/op) + +## Gin v1. stable + +- [x] Zero allocation router. +- [x] Still the fastest http router and framework. From routing to writing. +- [x] Complete suite of unit tests +- [x] Battle tested +- [x] API frozen, new releases will not break your code. + + +## Start using it + +1. Download and install it: + +```sh +$ go get github.com/gin-gonic/gin +``` + +2. Import it in your code: + +```go +import "github.com/gin-gonic/gin" +``` + +3. (Optional) Import `net/http`. This is required for example if using constants such as `http.StatusOK`. + +```go +import "net/http" +``` + +## API Examples + +### Using GET, POST, PUT, PATCH, DELETE and OPTIONS + +```go +func main() { + // Disable Console Color + // gin.DisableConsoleColor() + + // Creates a gin router with default middleware: + // logger and recovery (crash-free) middleware + router := gin.Default() + + router.GET("/someGet", getting) + router.POST("/somePost", posting) + router.PUT("/somePut", putting) + router.DELETE("/someDelete", deleting) + router.PATCH("/somePatch", patching) + router.HEAD("/someHead", head) + router.OPTIONS("/someOptions", options) + + // By default it serves on :8080 unless a + // PORT environment variable was defined. + router.Run() + // router.Run(":3000") for a hard coded port +} +``` + +### Parameters in path + +```go +func main() { + router := gin.Default() + + // This handler will match /user/john but will not match neither /user/ or /user + router.GET("/user/:name", func(c *gin.Context) { + name := c.Param("name") + c.String(http.StatusOK, "Hello %s", name) + }) + + // However, this one will match /user/john/ and also /user/john/send + // If no other routers match /user/john, it will redirect to /user/john/ + router.GET("/user/:name/*action", func(c *gin.Context) { + name := c.Param("name") + action := c.Param("action") + message := name + " is " + action + c.String(http.StatusOK, message) + }) + + router.Run(":8080") +} +``` + +### Querystring parameters + +```go +func main() { + router := gin.Default() + + // Query string parameters are parsed using the existing underlying request object. + // The request responds to a url matching: /welcome?firstname=Jane&lastname=Doe + router.GET("/welcome", func(c *gin.Context) { + firstname := c.DefaultQuery("firstname", "Guest") + lastname := c.Query("lastname") // shortcut for c.Request.URL.Query().Get("lastname") + + c.String(http.StatusOK, "Hello %s %s", firstname, lastname) + }) + router.Run(":8080") +} +``` + +### Multipart/Urlencoded Form + +```go +func main() { + router := gin.Default() + + router.POST("/form_post", func(c *gin.Context) { + message := c.PostForm("message") + nick := c.DefaultPostForm("nick", "anonymous") + + c.JSON(200, gin.H{ + "status": "posted", + "message": message, + "nick": nick, + }) + }) + router.Run(":8080") +} +``` + +### Another example: query + post form + +``` +POST /post?id=1234&page=1 HTTP/1.1 +Content-Type: application/x-www-form-urlencoded + +name=manu&message=this_is_great +``` + +```go +func main() { + router := gin.Default() + + router.POST("/post", func(c *gin.Context) { + + id := c.Query("id") + page := c.DefaultQuery("page", "0") + name := c.PostForm("name") + message := c.PostForm("message") + + fmt.Printf("id: %s; page: %s; name: %s; message: %s", id, page, name, message) + }) + router.Run(":8080") +} +``` + +``` +id: 1234; page: 1; name: manu; message: this_is_great +``` + +### Upload files + +#### Single file + +References issue [#774](https://github.com/gin-gonic/gin/issues/774) and detail [example code](examples/upload-file/single). + +```go +func main() { + router := gin.Default() + router.POST("/upload", func(c *gin.Context) { + // single file + file, _ := c.FormFile("file") + log.Println(file.Filename) + + c.String(http.StatusOK, fmt.Printf("'%s' uploaded!", file.Filename)) + }) + router.Run(":8080") +} +``` + +How to `curl`: + +```bash +curl -X POST http://localhost:8080/upload \ + -F "file=@/Users/appleboy/test.zip" \ + -H "Content-Type: multipart/form-data" +``` + +#### Multiple files + +See the detail [example code](examples/upload-file/multiple). + +```go +func main() { + router := gin.Default() + router.POST("/upload", func(c *gin.Context) { + // Multipart form + form, _ := c.MultipartForm() + files := form.File["upload[]"] + + for _, file := range files { + log.Println(file.Filename) + } + c.String(http.StatusOK, fmt.Printf("%d files uploaded!", len(files))) + }) + router.Run(":8080") +} +``` + +How to `curl`: + +```bash +curl -X POST http://localhost:8080/upload \ + -F "upload[]=@/Users/appleboy/test1.zip" \ + -F "upload[]=@/Users/appleboy/test2.zip" \ + -H "Content-Type: multipart/form-data" +``` + +### Grouping routes + +```go +func main() { + router := gin.Default() + + // Simple group: v1 + v1 := router.Group("/v1") + { + v1.POST("/login", loginEndpoint) + v1.POST("/submit", submitEndpoint) + v1.POST("/read", readEndpoint) + } + + // Simple group: v2 + v2 := router.Group("/v2") + { + v2.POST("/login", loginEndpoint) + v2.POST("/submit", submitEndpoint) + v2.POST("/read", readEndpoint) + } + + router.Run(":8080") +} +``` + +### Blank Gin without middleware by default + +Use + +```go +r := gin.New() +``` + +instead of + +```go +r := gin.Default() +``` + + +### Using middleware +```go +func main() { + // Creates a router without any middleware by default + r := gin.New() + + // Global middleware + r.Use(gin.Logger()) + r.Use(gin.Recovery()) + + // Per route middleware, you can add as many as you desire. + r.GET("/benchmark", MyBenchLogger(), benchEndpoint) + + // Authorization group + // authorized := r.Group("/", AuthRequired()) + // exactly the same as: + authorized := r.Group("/") + // per group middleware! in this case we use the custom created + // AuthRequired() middleware just in the "authorized" group. + authorized.Use(AuthRequired()) + { + authorized.POST("/login", loginEndpoint) + authorized.POST("/submit", submitEndpoint) + authorized.POST("/read", readEndpoint) + + // nested group + testing := authorized.Group("testing") + testing.GET("/analytics", analyticsEndpoint) + } + + // Listen and serve on 0.0.0.0:8080 + r.Run(":8080") +} +``` + +### Model binding and validation + +To bind a request body into a type, use model binding. We currently support binding of JSON, XML and standard form values (foo=bar&boo=baz). + +Note that you need to set the corresponding binding tag on all fields you want to bind. For example, when binding from JSON, set `json:"fieldname"`. + +When using the Bind-method, Gin tries to infer the binder depending on the Content-Type header. If you are sure what you are binding, you can use BindWith. + +You can also specify that specific fields are required. If a field is decorated with `binding:"required"` and has a empty value when binding, the current request will fail with an error. + +```go +// Binding from JSON +type Login struct { + User string `form:"user" json:"user" binding:"required"` + Password string `form:"password" json:"password" binding:"required"` +} + +func main() { + router := gin.Default() + + // Example for binding JSON ({"user": "manu", "password": "123"}) + router.POST("/loginJSON", func(c *gin.Context) { + var json Login + if c.BindJSON(&json) == nil { + if json.User == "manu" && json.Password == "123" { + c.JSON(http.StatusOK, gin.H{"status": "you are logged in"}) + } else { + c.JSON(http.StatusUnauthorized, gin.H{"status": "unauthorized"}) + } + } + }) + + // Example for binding a HTML form (user=manu&password=123) + router.POST("/loginForm", func(c *gin.Context) { + var form Login + // This will infer what binder to use depending on the content-type header. + if c.Bind(&form) == nil { + if form.User == "manu" && form.Password == "123" { + c.JSON(http.StatusOK, gin.H{"status": "you are logged in"}) + } else { + c.JSON(http.StatusUnauthorized, gin.H{"status": "unauthorized"}) + } + } + }) + + // Listen and serve on 0.0.0.0:8080 + router.Run(":8080") +} +``` + +### Bind Query String + +See the [detail information](https://github.com/gin-gonic/gin/issues/742#issuecomment-264681292). + +```go +package main + +import "log" +import "github.com/gin-gonic/gin" + +type Person struct { + Name string `form:"name"` + Address string `form:"address"` +} + +func main() { + route := gin.Default() + route.GET("/testing", startPage) + route.Run(":8085") +} + +func startPage(c *gin.Context) { + var person Person + // If `GET`, only `Form` binding engine (`query`) used. + // If `POST`, first checks the `content-type` for `JSON` or `XML`, then uses `Form` (`form-data`). + // See more at https://github.com/gin-gonic/gin/blob/develop/binding/binding.go#L45 + if c.Bind(&person) == nil { + log.Println(person.Name) + log.Println(person.Address) + } + + c.String(200, "Success") +} +``` + +### Multipart/Urlencoded binding + +```go +package main + +import ( + "github.com/gin-gonic/gin" +) + +type LoginForm struct { + User string `form:"user" binding:"required"` + Password string `form:"password" binding:"required"` +} + +func main() { + router := gin.Default() + router.POST("/login", func(c *gin.Context) { + // you can bind multipart form with explicit binding declaration: + // c.MustBindWith(&form, binding.Form) + // or you can simply use autobinding with Bind method: + var form LoginForm + // in this case proper binding will be automatically selected + if c.Bind(&form) == nil { + if form.User == "user" && form.Password == "password" { + c.JSON(200, gin.H{"status": "you are logged in"}) + } else { + c.JSON(401, gin.H{"status": "unauthorized"}) + } + } + }) + router.Run(":8080") +} +``` + +Test it with: +```sh +$ curl -v --form user=user --form password=password http://localhost:8080/login +``` + +### XML, JSON and YAML rendering + +```go +func main() { + r := gin.Default() + + // gin.H is a shortcut for map[string]interface{} + r.GET("/someJSON", func(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{"message": "hey", "status": http.StatusOK}) + }) + + r.GET("/moreJSON", func(c *gin.Context) { + // You also can use a struct + var msg struct { + Name string `json:"user"` + Message string + Number int + } + msg.Name = "Lena" + msg.Message = "hey" + msg.Number = 123 + // Note that msg.Name becomes "user" in the JSON + // Will output : {"user": "Lena", "Message": "hey", "Number": 123} + c.JSON(http.StatusOK, msg) + }) + + r.GET("/someXML", func(c *gin.Context) { + c.XML(http.StatusOK, gin.H{"message": "hey", "status": http.StatusOK}) + }) + + r.GET("/someYAML", func(c *gin.Context) { + c.YAML(http.StatusOK, gin.H{"message": "hey", "status": http.StatusOK}) + }) + + // Listen and serve on 0.0.0.0:8080 + r.Run(":8080") +} +``` + +### Serving static files + +```go +func main() { + router := gin.Default() + router.Static("/assets", "./assets") + router.StaticFS("/more_static", http.Dir("my_file_system")) + router.StaticFile("/favicon.ico", "./resources/favicon.ico") + + // Listen and serve on 0.0.0.0:8080 + router.Run(":8080") +} +``` + +### HTML rendering + +Using LoadHTMLGlob() or LoadHTMLFiles() + +```go +func main() { + router := gin.Default() + router.LoadHTMLGlob("templates/*") + //router.LoadHTMLFiles("templates/template1.html", "templates/template2.html") + router.GET("/index", func(c *gin.Context) { + c.HTML(http.StatusOK, "index.tmpl", gin.H{ + "title": "Main website", + }) + }) + router.Run(":8080") +} +``` + +templates/index.tmpl + +```html + +

+ {{ .title }} +

+ +``` + +Using templates with same name in different directories + +```go +func main() { + router := gin.Default() + router.LoadHTMLGlob("templates/**/*") + router.GET("/posts/index", func(c *gin.Context) { + c.HTML(http.StatusOK, "posts/index.tmpl", gin.H{ + "title": "Posts", + }) + }) + router.GET("/users/index", func(c *gin.Context) { + c.HTML(http.StatusOK, "users/index.tmpl", gin.H{ + "title": "Users", + }) + }) + router.Run(":8080") +} +``` + +templates/posts/index.tmpl + +```html +{{ define "posts/index.tmpl" }} +

+ {{ .title }} +

+

Using posts/index.tmpl

+ +{{ end }} +``` + +templates/users/index.tmpl + +```html +{{ define "users/index.tmpl" }} +

+ {{ .title }} +

+

Using users/index.tmpl

+ +{{ end }} +``` + +You can also use your own html template render + +```go +import "html/template" + +func main() { + router := gin.Default() + html := template.Must(template.ParseFiles("file1", "file2")) + router.SetHTMLTemplate(html) + router.Run(":8080") +} +``` + +You may use custom delims + +```go + r := gin.Default() + r.Delims("{[{", "}]}") + r.LoadHTMLGlob("/path/to/templates")) +``` + +#### Add custom template funcs + +main.go + +```go + ... + + func formatAsDate(t time.Time) string { + year, month, day := t.Date() + return fmt.Sprintf("%d/%02d/%02d", year, month, day) + } + + ... + + router.SetFuncMap(template.FuncMap{ + "formatAsDate": formatAsDate, + }) + + ... + + router.GET("/raw", func(c *Context) { + c.HTML(http.StatusOK, "raw.tmpl", map[string]interface{}{ + "now": time.Date(2017, 07, 01, 0, 0, 0, 0, time.UTC), + }) + }) + + ... +``` + +raw.tmpl + +```html +Date: {[{.now | formatAsDate}]} +``` + +Result: +``` +Date: 2017/07/01 +``` + +### Multitemplate + +Gin allow by default use only one html.Template. Check [a multitemplate render](https://github.com/gin-contrib/multitemplate) for using features like go 1.6 `block template`. + +### Redirects + +Issuing a HTTP redirect is easy: + +```go +r.GET("/test", func(c *gin.Context) { + c.Redirect(http.StatusMovedPermanently, "http://www.google.com/") +}) +``` +Both internal and external locations are supported. + + +### Custom Middleware + +```go +func Logger() gin.HandlerFunc { + return func(c *gin.Context) { + t := time.Now() + + // Set example variable + c.Set("example", "12345") + + // before request + + c.Next() + + // after request + latency := time.Since(t) + log.Print(latency) + + // access the status we are sending + status := c.Writer.Status() + log.Println(status) + } +} + +func main() { + r := gin.New() + r.Use(Logger()) + + r.GET("/test", func(c *gin.Context) { + example := c.MustGet("example").(string) + + // it would print: "12345" + log.Println(example) + }) + + // Listen and serve on 0.0.0.0:8080 + r.Run(":8080") +} +``` + +### Using BasicAuth() middleware + +```go +// simulate some private data +var secrets = gin.H{ + "foo": gin.H{"email": "foo@bar.com", "phone": "123433"}, + "austin": gin.H{"email": "austin@example.com", "phone": "666"}, + "lena": gin.H{"email": "lena@guapa.com", "phone": "523443"}, +} + +func main() { + r := gin.Default() + + // Group using gin.BasicAuth() middleware + // gin.Accounts is a shortcut for map[string]string + authorized := r.Group("/admin", gin.BasicAuth(gin.Accounts{ + "foo": "bar", + "austin": "1234", + "lena": "hello2", + "manu": "4321", + })) + + // /admin/secrets endpoint + // hit "localhost:8080/admin/secrets + authorized.GET("/secrets", func(c *gin.Context) { + // get user, it was set by the BasicAuth middleware + user := c.MustGet(gin.AuthUserKey).(string) + if secret, ok := secrets[user]; ok { + c.JSON(http.StatusOK, gin.H{"user": user, "secret": secret}) + } else { + c.JSON(http.StatusOK, gin.H{"user": user, "secret": "NO SECRET :("}) + } + }) + + // Listen and serve on 0.0.0.0:8080 + r.Run(":8080") +} +``` + +### Goroutines inside a middleware + +When starting inside a middleware or handler, you **SHOULD NOT** use the original context inside it, you have to use a read-only copy. + +```go +func main() { + r := gin.Default() + + r.GET("/long_async", func(c *gin.Context) { + // create copy to be used inside the goroutine + cCp := c.Copy() + go func() { + // simulate a long task with time.Sleep(). 5 seconds + time.Sleep(5 * time.Second) + + // note that you are using the copied context "cCp", IMPORTANT + log.Println("Done! in path " + cCp.Request.URL.Path) + }() + }) + + r.GET("/long_sync", func(c *gin.Context) { + // simulate a long task with time.Sleep(). 5 seconds + time.Sleep(5 * time.Second) + + // since we are NOT using a goroutine, we do not have to copy the context + log.Println("Done! in path " + c.Request.URL.Path) + }) + + // Listen and serve on 0.0.0.0:8080 + r.Run(":8080") +} +``` + +### Custom HTTP configuration + +Use `http.ListenAndServe()` directly, like this: + +```go +func main() { + router := gin.Default() + http.ListenAndServe(":8080", router) +} +``` +or + +```go +func main() { + router := gin.Default() + + s := &http.Server{ + Addr: ":8080", + Handler: router, + ReadTimeout: 10 * time.Second, + WriteTimeout: 10 * time.Second, + MaxHeaderBytes: 1 << 20, + } + s.ListenAndServe() +} +``` + +### Support Let's Encrypt + +example for 1-line LetsEncrypt HTTPS servers. + +[embedmd]:# (examples/auto-tls/example1.go go) +```go +package main + +import ( + "log" + + "github.com/gin-gonic/autotls" + "github.com/gin-gonic/gin" +) + +func main() { + r := gin.Default() + + // Ping handler + r.GET("/ping", func(c *gin.Context) { + c.String(200, "pong") + }) + + log.Fatal(autotls.Run(r, "example1.com", "example2.com")) +} +``` + +example for custom autocert manager. + +[embedmd]:# (examples/auto-tls/example2.go go) +```go +package main + +import ( + "log" + + "github.com/gin-gonic/autotls" + "github.com/gin-gonic/gin" + "golang.org/x/crypto/acme/autocert" +) + +func main() { + r := gin.Default() + + // Ping handler + r.GET("/ping", func(c *gin.Context) { + c.String(200, "pong") + }) + + m := autocert.Manager{ + Prompt: autocert.AcceptTOS, + HostPolicy: autocert.HostWhitelist("example1.com", "example2.com"), + Cache: autocert.DirCache("/var/www/.cache"), + } + + log.Fatal(autotls.RunWithManager(r, m)) +} +``` + +### Graceful restart or stop + +Do you want to graceful restart or stop your web server? +There are some ways this can be done. + +We can use [fvbock/endless](https://github.com/fvbock/endless) to replace the default `ListenAndServe`. Refer issue [#296](https://github.com/gin-gonic/gin/issues/296) for more details. + +```go +router := gin.Default() +router.GET("/", handler) +// [...] +endless.ListenAndServe(":4242", router) +``` + +An alternative to endless: + +* [manners](https://github.com/braintree/manners): A polite Go HTTP server that shuts down gracefully. +* [graceful](https://github.com/tylerb/graceful): Graceful is a Go package enabling graceful shutdown of an http.Handler server. +* [grace](https://github.com/facebookgo/grace): Graceful restart & zero downtime deploy for Go servers. + +If you are using Go 1.8, you may not need to use this library! Consider using http.Server's built-in [Shutdown()](https://golang.org/pkg/net/http/#Server.Shutdown) method for graceful shutdowns. See the full [graceful-shutdown](./examples/graceful-shutdown) example with gin. + +[embedmd]:# (examples/graceful-shutdown/graceful-shutdown/server.go go) +```go +// +build go1.8 + +package main + +import ( + "context" + "log" + "net/http" + "os" + "os/signal" + "time" + + "github.com/gin-gonic/gin" +) + +func main() { + router := gin.Default() + router.GET("/", func(c *gin.Context) { + time.Sleep(5 * time.Second) + c.String(http.StatusOK, "Welcome Gin Server") + }) + + srv := &http.Server{ + Addr: ":8080", + Handler: router, + } + + go func() { + // service connections + if err := srv.ListenAndServe(); err != nil { + log.Printf("listen: %s\n", err) + } + }() + + // Wait for interrupt signal to gracefully shutdown the server with + // a timeout of 5 seconds. + quit := make(chan os.Signal) + signal.Notify(quit, os.Interrupt) + <-quit + log.Println("Shutdown Server ...") + + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + if err := srv.Shutdown(ctx); err != nil { + log.Fatal("Server Shutdown:", err) + } + log.Println("Server exist") +} +``` + +## Contributing + +- With issues: + - Use the search tool before opening a new issue. + - Please provide source code and commit sha if you found a bug. + - Review existing issues and provide feedback or react to them. +- With pull requests: + - Open your pull request against develop + - Your pull request should have no more than two commits, if not you should squash them. + - It should pass all tests in the available continuous integrations systems such as TravisCI. + - You should add/modify tests to cover your proposed code changes. + - If your pull request contains a new feature, please document it on the README. + +## Users + +Awesome project lists using [Gin](https://github.com/gin-gonic/gin) web framework. + +* [drone](https://github.com/drone/drone): Drone is a Continuous Delivery platform built on Docker, written in Go +* [gorush](https://github.com/appleboy/gorush): A push notification server written in Go. diff --git a/vendor/github.com/go-sourcemap/sourcemap/README.md b/vendor/github.com/go-sourcemap/sourcemap/README.md new file mode 100644 index 000000000000..ba9b3b881cec --- /dev/null +++ b/vendor/github.com/go-sourcemap/sourcemap/README.md @@ -0,0 +1,43 @@ +# Source maps consumer for Golang + +[![Build Status](https://travis-ci.org/go-sourcemap/sourcemap.svg)](https://travis-ci.org/go-sourcemap/sourcemap) + +API docs: https://godoc.org/github.com/go-sourcemap/sourcemap. +Examples: https://godoc.org/github.com/go-sourcemap/sourcemap#pkg-examples. +Spec: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit. + +## Installation + +Install: + +```shell +go get -u github.com/go-sourcemap/sourcemap +``` + +## Quickstart + +```go +func ExampleParse() { + mapURL := "http://code.jquery.com/jquery-2.0.3.min.map" + resp, err := http.Get(mapURL) + if err != nil { + panic(err) + } + defer resp.Body.Close() + + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + panic(err) + } + + smap, err := sourcemap.Parse(mapURL, b) + if err != nil { + panic(err) + } + + line, column := 5, 6789 + file, fn, line, col, ok := smap.Source(line, column) + fmt.Println(file, fn, line, col, ok) + // Output: http://code.jquery.com/jquery-2.0.3.js apply 4360 27 true +} +``` diff --git a/vendor/github.com/golang/gddo/gosrc/LICENSE b/vendor/github.com/golang/gddo/gosrc/LICENSE deleted file mode 100644 index 65d761bc9f28..000000000000 --- a/vendor/github.com/golang/gddo/gosrc/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/golang/snappy/.gitignore b/vendor/github.com/golang/snappy/.gitignore new file mode 100644 index 000000000000..042091d9b3b0 --- /dev/null +++ b/vendor/github.com/golang/snappy/.gitignore @@ -0,0 +1,16 @@ +cmd/snappytool/snappytool +testdata/bench + +# These explicitly listed benchmark data files are for an obsolete version of +# snappy_test.go. +testdata/alice29.txt +testdata/asyoulik.txt +testdata/fireworks.jpeg +testdata/geo.protodata +testdata/html +testdata/html_x_4 +testdata/kppkn.gtb +testdata/lcet10.txt +testdata/paper-100k.pdf +testdata/plrabn12.txt +testdata/urls.10K diff --git a/vendor/github.com/golang/snappy/README b/vendor/github.com/golang/snappy/README new file mode 100644 index 000000000000..cea12879a0ea --- /dev/null +++ b/vendor/github.com/golang/snappy/README @@ -0,0 +1,107 @@ +The Snappy compression format in the Go programming language. + +To download and install from source: +$ go get github.com/golang/snappy + +Unless otherwise noted, the Snappy-Go source files are distributed +under the BSD-style license found in the LICENSE file. + + + +Benchmarks. + +The golang/snappy benchmarks include compressing (Z) and decompressing (U) ten +or so files, the same set used by the C++ Snappy code (github.com/google/snappy +and note the "google", not "golang"). On an "Intel(R) Core(TM) i7-3770 CPU @ +3.40GHz", Go's GOARCH=amd64 numbers as of 2016-05-29: + +"go test -test.bench=." + +_UFlat0-8 2.19GB/s ± 0% html +_UFlat1-8 1.41GB/s ± 0% urls +_UFlat2-8 23.5GB/s ± 2% jpg +_UFlat3-8 1.91GB/s ± 0% jpg_200 +_UFlat4-8 14.0GB/s ± 1% pdf +_UFlat5-8 1.97GB/s ± 0% html4 +_UFlat6-8 814MB/s ± 0% txt1 +_UFlat7-8 785MB/s ± 0% txt2 +_UFlat8-8 857MB/s ± 0% txt3 +_UFlat9-8 719MB/s ± 1% txt4 +_UFlat10-8 2.84GB/s ± 0% pb +_UFlat11-8 1.05GB/s ± 0% gaviota + +_ZFlat0-8 1.04GB/s ± 0% html +_ZFlat1-8 534MB/s ± 0% urls +_ZFlat2-8 15.7GB/s ± 1% jpg +_ZFlat3-8 740MB/s ± 3% jpg_200 +_ZFlat4-8 9.20GB/s ± 1% pdf +_ZFlat5-8 991MB/s ± 0% html4 +_ZFlat6-8 379MB/s ± 0% txt1 +_ZFlat7-8 352MB/s ± 0% txt2 +_ZFlat8-8 396MB/s ± 1% txt3 +_ZFlat9-8 327MB/s ± 1% txt4 +_ZFlat10-8 1.33GB/s ± 1% pb +_ZFlat11-8 605MB/s ± 1% gaviota + + + +"go test -test.bench=. -tags=noasm" + +_UFlat0-8 621MB/s ± 2% html +_UFlat1-8 494MB/s ± 1% urls +_UFlat2-8 23.2GB/s ± 1% jpg +_UFlat3-8 1.12GB/s ± 1% jpg_200 +_UFlat4-8 4.35GB/s ± 1% pdf +_UFlat5-8 609MB/s ± 0% html4 +_UFlat6-8 296MB/s ± 0% txt1 +_UFlat7-8 288MB/s ± 0% txt2 +_UFlat8-8 309MB/s ± 1% txt3 +_UFlat9-8 280MB/s ± 1% txt4 +_UFlat10-8 753MB/s ± 0% pb +_UFlat11-8 400MB/s ± 0% gaviota + +_ZFlat0-8 409MB/s ± 1% html +_ZFlat1-8 250MB/s ± 1% urls +_ZFlat2-8 12.3GB/s ± 1% jpg +_ZFlat3-8 132MB/s ± 0% jpg_200 +_ZFlat4-8 2.92GB/s ± 0% pdf +_ZFlat5-8 405MB/s ± 1% html4 +_ZFlat6-8 179MB/s ± 1% txt1 +_ZFlat7-8 170MB/s ± 1% txt2 +_ZFlat8-8 189MB/s ± 1% txt3 +_ZFlat9-8 164MB/s ± 1% txt4 +_ZFlat10-8 479MB/s ± 1% pb +_ZFlat11-8 270MB/s ± 1% gaviota + + + +For comparison (Go's encoded output is byte-for-byte identical to C++'s), here +are the numbers from C++ Snappy's + +make CXXFLAGS="-O2 -DNDEBUG -g" clean snappy_unittest.log && cat snappy_unittest.log + +BM_UFlat/0 2.4GB/s html +BM_UFlat/1 1.4GB/s urls +BM_UFlat/2 21.8GB/s jpg +BM_UFlat/3 1.5GB/s jpg_200 +BM_UFlat/4 13.3GB/s pdf +BM_UFlat/5 2.1GB/s html4 +BM_UFlat/6 1.0GB/s txt1 +BM_UFlat/7 959.4MB/s txt2 +BM_UFlat/8 1.0GB/s txt3 +BM_UFlat/9 864.5MB/s txt4 +BM_UFlat/10 2.9GB/s pb +BM_UFlat/11 1.2GB/s gaviota + +BM_ZFlat/0 944.3MB/s html (22.31 %) +BM_ZFlat/1 501.6MB/s urls (47.78 %) +BM_ZFlat/2 14.3GB/s jpg (99.95 %) +BM_ZFlat/3 538.3MB/s jpg_200 (73.00 %) +BM_ZFlat/4 8.3GB/s pdf (83.30 %) +BM_ZFlat/5 903.5MB/s html4 (22.52 %) +BM_ZFlat/6 336.0MB/s txt1 (57.88 %) +BM_ZFlat/7 312.3MB/s txt2 (61.91 %) +BM_ZFlat/8 353.1MB/s txt3 (54.99 %) +BM_ZFlat/9 289.9MB/s txt4 (66.26 %) +BM_ZFlat/10 1.2GB/s pb (19.68 %) +BM_ZFlat/11 527.4MB/s gaviota (37.72 %) diff --git a/vendor/github.com/gorilla/context/README.md b/vendor/github.com/gorilla/context/README.md new file mode 100644 index 000000000000..c60a31b053bc --- /dev/null +++ b/vendor/github.com/gorilla/context/README.md @@ -0,0 +1,7 @@ +context +======= +[![Build Status](https://travis-ci.org/gorilla/context.png?branch=master)](https://travis-ci.org/gorilla/context) + +gorilla/context is a general purpose registry for global request variables. + +Read the full documentation here: http://www.gorillatoolkit.org/pkg/context diff --git a/vendor/github.com/gorilla/mux/ISSUE_TEMPLATE.md b/vendor/github.com/gorilla/mux/ISSUE_TEMPLATE.md new file mode 100644 index 000000000000..232be82e47a6 --- /dev/null +++ b/vendor/github.com/gorilla/mux/ISSUE_TEMPLATE.md @@ -0,0 +1,11 @@ +**What version of Go are you running?** (Paste the output of `go version`) + + +**What version of gorilla/mux are you at?** (Paste the output of `git rev-parse HEAD` inside `$GOPATH/src/github.com/gorilla/mux`) + + +**Describe your problem** (and what you have tried so far) + + +**Paste a minimal, runnable, reproduction of your issue below** (use backticks to format it) + diff --git a/vendor/github.com/gorilla/mux/README.md b/vendor/github.com/gorilla/mux/README.md new file mode 100644 index 000000000000..f9b3103f0684 --- /dev/null +++ b/vendor/github.com/gorilla/mux/README.md @@ -0,0 +1,560 @@ +gorilla/mux +=== +[![GoDoc](https://godoc.org/github.com/gorilla/mux?status.svg)](https://godoc.org/github.com/gorilla/mux) +[![Build Status](https://travis-ci.org/gorilla/mux.svg?branch=master)](https://travis-ci.org/gorilla/mux) +[![Sourcegraph](https://sourcegraph.com/github.com/gorilla/mux/-/badge.svg)](https://sourcegraph.com/github.com/gorilla/mux?badge) + +![Gorilla Logo](http://www.gorillatoolkit.org/static/images/gorilla-icon-64.png) + +http://www.gorillatoolkit.org/pkg/mux + +Package `gorilla/mux` implements a request router and dispatcher for matching incoming requests to +their respective handler. + +The name mux stands for "HTTP request multiplexer". Like the standard `http.ServeMux`, `mux.Router` matches incoming requests against a list of registered routes and calls a handler for the route that matches the URL or other conditions. The main features are: + +* It implements the `http.Handler` interface so it is compatible with the standard `http.ServeMux`. +* Requests can be matched based on URL host, path, path prefix, schemes, header and query values, HTTP methods or using custom matchers. +* URL hosts, paths and query values can have variables with an optional regular expression. +* Registered URLs can be built, or "reversed", which helps maintaining references to resources. +* Routes can be used as subrouters: nested routes are only tested if the parent route matches. This is useful to define groups of routes that share common conditions like a host, a path prefix or other repeated attributes. As a bonus, this optimizes request matching. + +--- + +* [Install](#install) +* [Examples](#examples) +* [Matching Routes](#matching-routes) +* [Static Files](#static-files) +* [Registered URLs](#registered-urls) +* [Walking Routes](#walking-routes) +* [Graceful Shutdown](#graceful-shutdown) +* [Middleware](#middleware) +* [Full Example](#full-example) + +--- + +## Install + +With a [correctly configured](https://golang.org/doc/install#testing) Go toolchain: + +```sh +go get -u github.com/gorilla/mux +``` + +## Examples + +Let's start registering a couple of URL paths and handlers: + +```go +func main() { + r := mux.NewRouter() + r.HandleFunc("/", HomeHandler) + r.HandleFunc("/products", ProductsHandler) + r.HandleFunc("/articles", ArticlesHandler) + http.Handle("/", r) +} +``` + +Here we register three routes mapping URL paths to handlers. This is equivalent to how `http.HandleFunc()` works: if an incoming request URL matches one of the paths, the corresponding handler is called passing (`http.ResponseWriter`, `*http.Request`) as parameters. + +Paths can have variables. They are defined using the format `{name}` or `{name:pattern}`. If a regular expression pattern is not defined, the matched variable will be anything until the next slash. For example: + +```go +r := mux.NewRouter() +r.HandleFunc("/products/{key}", ProductHandler) +r.HandleFunc("/articles/{category}/", ArticlesCategoryHandler) +r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler) +``` + +The names are used to create a map of route variables which can be retrieved calling `mux.Vars()`: + +```go +func ArticlesCategoryHandler(w http.ResponseWriter, r *http.Request) { + vars := mux.Vars(r) + w.WriteHeader(http.StatusOK) + fmt.Fprintf(w, "Category: %v\n", vars["category"]) +} +``` + +And this is all you need to know about the basic usage. More advanced options are explained below. + +### Matching Routes + +Routes can also be restricted to a domain or subdomain. Just define a host pattern to be matched. They can also have variables: + +```go +r := mux.NewRouter() +// Only matches if domain is "www.example.com". +r.Host("www.example.com") +// Matches a dynamic subdomain. +r.Host("{subdomain:[a-z]+}.domain.com") +``` + +There are several other matchers that can be added. To match path prefixes: + +```go +r.PathPrefix("/products/") +``` + +...or HTTP methods: + +```go +r.Methods("GET", "POST") +``` + +...or URL schemes: + +```go +r.Schemes("https") +``` + +...or header values: + +```go +r.Headers("X-Requested-With", "XMLHttpRequest") +``` + +...or query values: + +```go +r.Queries("key", "value") +``` + +...or to use a custom matcher function: + +```go +r.MatcherFunc(func(r *http.Request, rm *RouteMatch) bool { + return r.ProtoMajor == 0 +}) +``` + +...and finally, it is possible to combine several matchers in a single route: + +```go +r.HandleFunc("/products", ProductsHandler). + Host("www.example.com"). + Methods("GET"). + Schemes("http") +``` + +Routes are tested in the order they were added to the router. If two routes match, the first one wins: + +```go +r := mux.NewRouter() +r.HandleFunc("/specific", specificHandler) +r.PathPrefix("/").Handler(catchAllHandler) +``` + +Setting the same matching conditions again and again can be boring, so we have a way to group several routes that share the same requirements. We call it "subrouting". + +For example, let's say we have several URLs that should only match when the host is `www.example.com`. Create a route for that host and get a "subrouter" from it: + +```go +r := mux.NewRouter() +s := r.Host("www.example.com").Subrouter() +``` + +Then register routes in the subrouter: + +```go +s.HandleFunc("/products/", ProductsHandler) +s.HandleFunc("/products/{key}", ProductHandler) +s.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler) +``` + +The three URL paths we registered above will only be tested if the domain is `www.example.com`, because the subrouter is tested first. This is not only convenient, but also optimizes request matching. You can create subrouters combining any attribute matchers accepted by a route. + +Subrouters can be used to create domain or path "namespaces": you define subrouters in a central place and then parts of the app can register its paths relatively to a given subrouter. + +There's one more thing about subroutes. When a subrouter has a path prefix, the inner routes use it as base for their paths: + +```go +r := mux.NewRouter() +s := r.PathPrefix("/products").Subrouter() +// "/products/" +s.HandleFunc("/", ProductsHandler) +// "/products/{key}/" +s.HandleFunc("/{key}/", ProductHandler) +// "/products/{key}/details" +s.HandleFunc("/{key}/details", ProductDetailsHandler) +``` +### Listing Routes + +Routes on a mux can be listed using the Router.Walk method—useful for generating documentation: + +```go +package main + +import ( + "fmt" + "net/http" + "strings" + + "github.com/gorilla/mux" +) + +func handler(w http.ResponseWriter, r *http.Request) { + return +} + +func main() { + r := mux.NewRouter() + r.HandleFunc("/", handler) + r.HandleFunc("/products", handler).Methods("POST") + r.HandleFunc("/articles", handler).Methods("GET") + r.HandleFunc("/articles/{id}", handler).Methods("GET", "PUT") + r.HandleFunc("/authors", handler).Queries("surname", "{surname}") + r.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error { + t, err := route.GetPathTemplate() + if err != nil { + return err + } + qt, err := route.GetQueriesTemplates() + if err != nil { + return err + } + // p will contain regular expression is compatible with regular expression in Perl, Python, and other languages. + // for instance the regular expression for path '/articles/{id}' will be '^/articles/(?P[^/]+)$' + p, err := route.GetPathRegexp() + if err != nil { + return err + } + // qr will contain a list of regular expressions with the same semantics as GetPathRegexp, + // just applied to the Queries pairs instead, e.g., 'Queries("surname", "{surname}") will return + // {"^surname=(?P.*)$}. Where each combined query pair will have an entry in the list. + qr, err := route.GetQueriesRegexp() + if err != nil { + return err + } + m, err := route.GetMethods() + if err != nil { + return err + } + fmt.Println(strings.Join(m, ","), strings.Join(qt, ","), strings.Join(qr, ","), t, p) + return nil + }) + http.Handle("/", r) +} +``` + +### Static Files + +Note that the path provided to `PathPrefix()` represents a "wildcard": calling +`PathPrefix("/static/").Handler(...)` means that the handler will be passed any +request that matches "/static/*". This makes it easy to serve static files with mux: + +```go +func main() { + var dir string + + flag.StringVar(&dir, "dir", ".", "the directory to serve files from. Defaults to the current dir") + flag.Parse() + r := mux.NewRouter() + + // This will serve files under http://localhost:8000/static/ + r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir(dir)))) + + srv := &http.Server{ + Handler: r, + Addr: "127.0.0.1:8000", + // Good practice: enforce timeouts for servers you create! + WriteTimeout: 15 * time.Second, + ReadTimeout: 15 * time.Second, + } + + log.Fatal(srv.ListenAndServe()) +} +``` + +### Registered URLs + +Now let's see how to build registered URLs. + +Routes can be named. All routes that define a name can have their URLs built, or "reversed". We define a name calling `Name()` on a route. For example: + +```go +r := mux.NewRouter() +r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler). + Name("article") +``` + +To build a URL, get the route and call the `URL()` method, passing a sequence of key/value pairs for the route variables. For the previous route, we would do: + +```go +url, err := r.Get("article").URL("category", "technology", "id", "42") +``` + +...and the result will be a `url.URL` with the following path: + +``` +"/articles/technology/42" +``` + +This also works for host and query value variables: + +```go +r := mux.NewRouter() +r.Host("{subdomain}.domain.com"). + Path("/articles/{category}/{id:[0-9]+}"). + Queries("filter", "{filter}"). + HandlerFunc(ArticleHandler). + Name("article") + +// url.String() will be "http://news.domain.com/articles/technology/42?filter=gorilla" +url, err := r.Get("article").URL("subdomain", "news", + "category", "technology", + "id", "42", + "filter", "gorilla") +``` + +All variables defined in the route are required, and their values must conform to the corresponding patterns. These requirements guarantee that a generated URL will always match a registered route -- the only exception is for explicitly defined "build-only" routes which never match. + +Regex support also exists for matching Headers within a route. For example, we could do: + +```go +r.HeadersRegexp("Content-Type", "application/(text|json)") +``` + +...and the route will match both requests with a Content-Type of `application/json` as well as `application/text` + +There's also a way to build only the URL host or path for a route: use the methods `URLHost()` or `URLPath()` instead. For the previous route, we would do: + +```go +// "http://news.domain.com/" +host, err := r.Get("article").URLHost("subdomain", "news") + +// "/articles/technology/42" +path, err := r.Get("article").URLPath("category", "technology", "id", "42") +``` + +And if you use subrouters, host and path defined separately can be built as well: + +```go +r := mux.NewRouter() +s := r.Host("{subdomain}.domain.com").Subrouter() +s.Path("/articles/{category}/{id:[0-9]+}"). + HandlerFunc(ArticleHandler). + Name("article") + +// "http://news.domain.com/articles/technology/42" +url, err := r.Get("article").URL("subdomain", "news", + "category", "technology", + "id", "42") +``` + +### Walking Routes + +The `Walk` function on `mux.Router` can be used to visit all of the routes that are registered on a router. For example, +the following prints all of the registered routes: + +```go +r := mux.NewRouter() +r.HandleFunc("/", handler) +r.HandleFunc("/products", handler).Methods("POST") +r.HandleFunc("/articles", handler).Methods("GET") +r.HandleFunc("/articles/{id}", handler).Methods("GET", "PUT") +r.HandleFunc("/authors", handler).Queries("surname", "{surname}") +r.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error { + t, err := route.GetPathTemplate() + if err != nil { + return err + } + qt, err := route.GetQueriesTemplates() + if err != nil { + return err + } + // p will contain a regular expression that is compatible with regular expressions in Perl, Python, and other languages. + // For example, the regular expression for path '/articles/{id}' will be '^/articles/(?P[^/]+)$'. + p, err := route.GetPathRegexp() + if err != nil { + return err + } + // qr will contain a list of regular expressions with the same semantics as GetPathRegexp, + // just applied to the Queries pairs instead, e.g., 'Queries("surname", "{surname}") will return + // {"^surname=(?P.*)$}. Where each combined query pair will have an entry in the list. + qr, err := route.GetQueriesRegexp() + if err != nil { + return err + } + m, err := route.GetMethods() + if err != nil { + return err + } + fmt.Println(strings.Join(m, ","), strings.Join(qt, ","), strings.Join(qr, ","), t, p) + return nil +}) +``` + +### Graceful Shutdown + +Go 1.8 introduced the ability to [gracefully shutdown](https://golang.org/doc/go1.8#http_shutdown) a `*http.Server`. Here's how to do that alongside `mux`: + +```go +package main + +import ( + "context" + "flag" + "log" + "net/http" + "os" + "os/signal" + + "github.com/gorilla/mux" +) + +func main() { + var wait time.Duration + flag.DurationVar(&wait, "graceful-timeout", time.Second * 15, "the duration for which the server gracefully wait for existing connections to finish - e.g. 15s or 1m") + flag.Parse() + + r := mux.NewRouter() + // Add your routes as needed + + srv := &http.Server{ + Addr: "0.0.0.0:8080", + // Good practice to set timeouts to avoid Slowloris attacks. + WriteTimeout: time.Second * 15, + ReadTimeout: time.Second * 15, + IdleTimeout: time.Second * 60, + Handler: r, // Pass our instance of gorilla/mux in. + } + + // Run our server in a goroutine so that it doesn't block. + go func() { + if err := srv.ListenAndServe(); err != nil { + log.Println(err) + } + }() + + c := make(chan os.Signal, 1) + // We'll accept graceful shutdowns when quit via SIGINT (Ctrl+C) + // SIGKILL, SIGQUIT or SIGTERM (Ctrl+/) will not be caught. + signal.Notify(c, os.Interrupt) + + // Block until we receive our signal. + <-c + + // Create a deadline to wait for. + ctx, cancel := context.WithTimeout(ctx, wait) + // Doesn't block if no connections, but will otherwise wait + // until the timeout deadline. + srv.Shutdown(ctx) + // Optionally, you could run srv.Shutdown in a goroutine and block on + // <-ctx.Done() if your application should wait for other services + // to finalize based on context cancellation. + log.Println("shutting down") + os.Exit(0) +} +``` + +### Middleware + +Mux supports the addition of middlewares to a [Router](https://godoc.org/github.com/gorilla/mux#Router), which are executed in the order they are added if a match is found, including its subrouters. +Middlewares are (typically) small pieces of code which take one request, do something with it, and pass it down to another middleware or the final handler. Some common use cases for middleware are request logging, header manipulation, or `ResponseWriter` hijacking. + +Mux middlewares are defined using the de facto standard type: + +```go +type MiddlewareFunc func(http.Handler) http.Handler +``` + +Typically, the returned handler is a closure which does something with the http.ResponseWriter and http.Request passed to it, and then calls the handler passed as parameter to the MiddlewareFunc. This takes advantage of closures being able access variables from the context where they are created, while retaining the signature enforced by the receivers. + +A very basic middleware which logs the URI of the request being handled could be written as: + +```go +func simpleMw(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + // Do stuff here + log.Println(r.RequestURI) + // Call the next handler, which can be another middleware in the chain, or the final handler. + next.ServeHTTP(w, r) + }) +} +``` + +Middlewares can be added to a router using `Router.AddMiddlewareFunc()`: + +```go +r := mux.NewRouter() +r.HandleFunc("/", handler) +r.AddMiddleware(simpleMw) +``` + +A more complex authentication middleware, which maps session token to users, could be written as: + +```go +// Define our struct +type authenticationMiddleware struct { + tokenUsers map[string]string +} + +// Initialize it somewhere +func (amw *authenticationMiddleware) Populate() { + amw.tokenUsers["00000000"] = "user0" + amw.tokenUsers["aaaaaaaa"] = "userA" + amw.tokenUsers["05f717e5"] = "randomUser" + amw.tokenUsers["deadbeef"] = "user0" +} + +// Middleware function, which will be called for each request +func (amw *authenticationMiddleware) Middleware(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + token := r.Header.Get("X-Session-Token") + + if user, found := amw.tokenUsers[token]; found { + // We found the token in our map + log.Printf("Authenticated user %s\n", user) + // Pass down the request to the next middleware (or final handler) + next.ServeHTTP(w, r) + } else { + // Write an error and stop the handler chain + http.Error(w, "Forbidden", 403) + } + }) +} +``` + +```go +r := mux.NewRouter() +r.HandleFunc("/", handler) + +amw := authenticationMiddleware{} +amw.Populate() + +r.AddMiddlewareFunc(amw.Middleware) +``` + +Note: The handler chain will be stopped if your middleware doesn't call `next.ServeHTTP()` with the corresponding parameters. This can be used to abort a request if the middleware writer wants to. Middlewares *should* write to `ResponseWriter` if they *are* going to terminate the request, and they *should not* write to `ResponseWriter` if they *are not* going to terminate it. + +## Full Example + +Here's a complete, runnable example of a small `mux` based server: + +```go +package main + +import ( + "net/http" + "log" + "github.com/gorilla/mux" +) + +func YourHandler(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("Gorilla!\n")) +} + +func main() { + r := mux.NewRouter() + // Routes consist of a path and a handler function. + r.HandleFunc("/", YourHandler) + + // Bind to a port and pass our router in + log.Fatal(http.ListenAndServe(":8000", r)) +} +``` + +## License + +BSD licensed. See the LICENSE file for details. diff --git a/vendor/github.com/gorilla/websocket/.gitignore b/vendor/github.com/gorilla/websocket/.gitignore new file mode 100644 index 000000000000..cd3fcd1ef72a --- /dev/null +++ b/vendor/github.com/gorilla/websocket/.gitignore @@ -0,0 +1,25 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe + +.idea/ +*.iml diff --git a/vendor/github.com/gorilla/websocket/README.md b/vendor/github.com/gorilla/websocket/README.md new file mode 100644 index 000000000000..19aa2e75c824 --- /dev/null +++ b/vendor/github.com/gorilla/websocket/README.md @@ -0,0 +1,64 @@ +# Gorilla WebSocket + +[![GoDoc](https://godoc.org/github.com/gorilla/websocket?status.svg)](https://godoc.org/github.com/gorilla/websocket) +[![CircleCI](https://circleci.com/gh/gorilla/websocket.svg?style=svg)](https://circleci.com/gh/gorilla/websocket) + +Gorilla WebSocket is a [Go](http://golang.org/) implementation of the +[WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. + +### Documentation + +* [API Reference](https://pkg.go.dev/github.com/gorilla/websocket?tab=doc) +* [Chat example](https://github.com/gorilla/websocket/tree/master/examples/chat) +* [Command example](https://github.com/gorilla/websocket/tree/master/examples/command) +* [Client and server example](https://github.com/gorilla/websocket/tree/master/examples/echo) +* [File watch example](https://github.com/gorilla/websocket/tree/master/examples/filewatch) + +### Status + +The Gorilla WebSocket package provides a complete and tested implementation of +the [WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. The +package API is stable. + +### Installation + + go get github.com/gorilla/websocket + +### Protocol Compliance + +The Gorilla WebSocket package passes the server tests in the [Autobahn Test +Suite](https://github.com/crossbario/autobahn-testsuite) using the application in the [examples/autobahn +subdirectory](https://github.com/gorilla/websocket/tree/master/examples/autobahn). + +### Gorilla WebSocket compared with other packages + + + + + + + + + + + + + + + + + + +
github.com/gorillagolang.org/x/net
RFC 6455 Features
Passes Autobahn Test SuiteYesNo
Receive fragmented messageYesNo, see note 1
Send close messageYesNo
Send pings and receive pongsYesNo
Get the type of a received data messageYesYes, see note 2
Other Features
Compression ExtensionsExperimentalNo
Read message using io.ReaderYesNo, see note 3
Write message using io.WriteCloserYesNo, see note 3
+ +Notes: + +1. Large messages are fragmented in [Chrome's new WebSocket implementation](http://www.ietf.org/mail-archive/web/hybi/current/msg10503.html). +2. The application can get the type of a received data message by implementing + a [Codec marshal](http://godoc.org/golang.org/x/net/websocket#Codec.Marshal) + function. +3. The go.net io.Reader and io.Writer operate across WebSocket frame boundaries. + Read returns when the input buffer is full or a frame boundary is + encountered. Each call to Write sends a single frame message. The Gorilla + io.Reader and io.WriteCloser operate on a single WebSocket message. + diff --git a/vendor/github.com/gorilla/websocket/go.mod b/vendor/github.com/gorilla/websocket/go.mod new file mode 100644 index 000000000000..1a7afd5028a7 --- /dev/null +++ b/vendor/github.com/gorilla/websocket/go.mod @@ -0,0 +1,3 @@ +module github.com/gorilla/websocket + +go 1.12 diff --git a/vendor/github.com/gorilla/websocket/go.sum b/vendor/github.com/gorilla/websocket/go.sum new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/vendor/github.com/inconshreveable/mousetrap/README.md b/vendor/github.com/inconshreveable/mousetrap/README.md new file mode 100644 index 000000000000..7a950d1774f0 --- /dev/null +++ b/vendor/github.com/inconshreveable/mousetrap/README.md @@ -0,0 +1,23 @@ +# mousetrap + +mousetrap is a tiny library that answers a single question. + +On a Windows machine, was the process invoked by someone double clicking on +the executable file while browsing in explorer? + +### Motivation + +Windows developers unfamiliar with command line tools will often "double-click" +the executable for a tool. Because most CLI tools print the help and then exit +when invoked without arguments, this is often very frustrating for those users. + +mousetrap provides a way to detect these invocations so that you can provide +more helpful behavior and instructions on how to run the CLI tool. To see what +this looks like, both from an organizational and a technical perspective, see +https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/ + +### The interface + +The library exposes a single interface: + + func StartedByExplorer() (bool) diff --git a/vendor/github.com/julienschmidt/httprouter/README.md b/vendor/github.com/julienschmidt/httprouter/README.md new file mode 100644 index 000000000000..eabf4aad349c --- /dev/null +++ b/vendor/github.com/julienschmidt/httprouter/README.md @@ -0,0 +1,266 @@ +# HttpRouter [![Build Status](https://travis-ci.org/julienschmidt/httprouter.svg?branch=master)](https://travis-ci.org/julienschmidt/httprouter) [![Coverage Status](https://coveralls.io/repos/github/julienschmidt/httprouter/badge.svg?branch=master)](https://coveralls.io/github/julienschmidt/httprouter?branch=master) [![GoDoc](https://godoc.org/github.com/julienschmidt/httprouter?status.svg)](http://godoc.org/github.com/julienschmidt/httprouter) + +HttpRouter is a lightweight high performance HTTP request router (also called *multiplexer* or just *mux* for short) for [Go](https://golang.org/). + +In contrast to the [default mux](https://golang.org/pkg/net/http/#ServeMux) of Go's `net/http` package, this router supports variables in the routing pattern and matches against the request method. It also scales better. + +The router is optimized for high performance and a small memory footprint. It scales well even with very long paths and a large number of routes. A compressing dynamic trie (radix tree) structure is used for efficient matching. + +## Features + +**Only explicit matches:** With other routers, like [`http.ServeMux`](https://golang.org/pkg/net/http/#ServeMux), a requested URL path could match multiple patterns. Therefore they have some awkward pattern priority rules, like *longest match* or *first registered, first matched*. By design of this router, a request can only match exactly one or no route. As a result, there are also no unintended matches, which makes it great for SEO and improves the user experience. + +**Stop caring about trailing slashes:** Choose the URL style you like, the router automatically redirects the client if a trailing slash is missing or if there is one extra. Of course it only does so, if the new path has a handler. If you don't like it, you can [turn off this behavior](https://godoc.org/github.com/julienschmidt/httprouter#Router.RedirectTrailingSlash). + +**Path auto-correction:** Besides detecting the missing or additional trailing slash at no extra cost, the router can also fix wrong cases and remove superfluous path elements (like `../` or `//`). Is [CAPTAIN CAPS LOCK](http://www.urbandictionary.com/define.php?term=Captain+Caps+Lock) one of your users? HttpRouter can help him by making a case-insensitive look-up and redirecting him to the correct URL. + +**Parameters in your routing pattern:** Stop parsing the requested URL path, just give the path segment a name and the router delivers the dynamic value to you. Because of the design of the router, path parameters are very cheap. + +**Zero Garbage:** The matching and dispatching process generates zero bytes of garbage. The only heap allocations that are made are building the slice of the key-value pairs for path parameters, and building new context and request objects (the latter only in the standard `Handler`/`HandlerFunc` api). In the 3-argument API, if the request path contains no parameters not a single heap allocation is necessary. + +**Best Performance:** [Benchmarks speak for themselves](https://github.com/julienschmidt/go-http-routing-benchmark). See below for technical details of the implementation. + +**No more server crashes:** You can set a [Panic handler](https://godoc.org/github.com/julienschmidt/httprouter#Router.PanicHandler) to deal with panics occurring during handling a HTTP request. The router then recovers and lets the `PanicHandler` log what happened and deliver a nice error page. + +**Perfect for APIs:** The router design encourages to build sensible, hierarchical RESTful APIs. Moreover it has builtin native support for [OPTIONS requests](http://zacstewart.com/2012/04/14/http-options-method.html) and `405 Method Not Allowed` replies. + +Of course you can also set **custom [`NotFound`](https://godoc.org/github.com/julienschmidt/httprouter#Router.NotFound) and [`MethodNotAllowed`](https://godoc.org/github.com/julienschmidt/httprouter#Router.MethodNotAllowed) handlers** and [**serve static files**](https://godoc.org/github.com/julienschmidt/httprouter#Router.ServeFiles). + +## Usage + +This is just a quick introduction, view the [GoDoc](http://godoc.org/github.com/julienschmidt/httprouter) for details. + +Let's start with a trivial example: + +```go +package main + +import ( + "fmt" + "github.com/julienschmidt/httprouter" + "net/http" + "log" +) + +func Index(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { + fmt.Fprint(w, "Welcome!\n") +} + +func Hello(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { + fmt.Fprintf(w, "hello, %s!\n", ps.ByName("name")) +} + +func main() { + router := httprouter.New() + router.GET("/", Index) + router.GET("/hello/:name", Hello) + + log.Fatal(http.ListenAndServe(":8080", router)) +} +``` + +### Named parameters + +As you can see, `:name` is a *named parameter*. The values are accessible via `httprouter.Params`, which is just a slice of `httprouter.Param`s. You can get the value of a parameter either by its index in the slice, or by using the `ByName(name)` method: `:name` can be retrived by `ByName("name")`. + +Named parameters only match a single path segment: + +``` +Pattern: /user/:user + + /user/gordon match + /user/you match + /user/gordon/profile no match + /user/ no match +``` + +**Note:** Since this router has only explicit matches, you can not register static routes and parameters for the same path segment. For example you can not register the patterns `/user/new` and `/user/:user` for the same request method at the same time. The routing of different request methods is independent from each other. + +### Catch-All parameters + +The second type are *catch-all* parameters and have the form `*name`. Like the name suggests, they match everything. Therefore they must always be at the **end** of the pattern: + +``` +Pattern: /src/*filepath + + /src/ match + /src/somefile.go match + /src/subdir/somefile.go match +``` + +## How does it work? + +The router relies on a tree structure which makes heavy use of *common prefixes*, it is basically a *compact* [*prefix tree*](https://en.wikipedia.org/wiki/Trie) (or just [*Radix tree*](https://en.wikipedia.org/wiki/Radix_tree)). Nodes with a common prefix also share a common parent. Here is a short example what the routing tree for the `GET` request method could look like: + +``` +Priority Path Handle +9 \ *<1> +3 ├s nil +2 |├earch\ *<2> +1 |└upport\ *<3> +2 ├blog\ *<4> +1 | └:post nil +1 | └\ *<5> +2 ├about-us\ *<6> +1 | └team\ *<7> +1 └contact\ *<8> +``` + +Every `*` represents the memory address of a handler function (a pointer). If you follow a path trough the tree from the root to the leaf, you get the complete route path, e.g `\blog\:post\`, where `:post` is just a placeholder ([*parameter*](#named-parameters)) for an actual post name. Unlike hash-maps, a tree structure also allows us to use dynamic parts like the `:post` parameter, since we actually match against the routing patterns instead of just comparing hashes. [As benchmarks show](https://github.com/julienschmidt/go-http-routing-benchmark), this works very well and efficient. + +Since URL paths have a hierarchical structure and make use only of a limited set of characters (byte values), it is very likely that there are a lot of common prefixes. This allows us to easily reduce the routing into ever smaller problems. Moreover the router manages a separate tree for every request method. For one thing it is more space efficient than holding a method->handle map in every single node, it also allows us to greatly reduce the routing problem before even starting the look-up in the prefix-tree. + +For even better scalability, the child nodes on each tree level are ordered by priority, where the priority is just the number of handles registered in sub nodes (children, grandchildren, and so on..). This helps in two ways: + +1. Nodes which are part of the most routing paths are evaluated first. This helps to make as much routes as possible to be reachable as fast as possible. +2. It is some sort of cost compensation. The longest reachable path (highest cost) can always be evaluated first. The following scheme visualizes the tree structure. Nodes are evaluated from top to bottom and from left to right. + +``` +├------------ +├--------- +├----- +├---- +├-- +├-- +└- +``` + +## Why doesn't this work with `http.Handler`? + +**It does!** The router itself implements the `http.Handler` interface. Moreover the router provides convenient [adapters for `http.Handler`](https://godoc.org/github.com/julienschmidt/httprouter#Router.Handler)s and [`http.HandlerFunc`](https://godoc.org/github.com/julienschmidt/httprouter#Router.HandlerFunc)s which allows them to be used as a [`httprouter.Handle`](https://godoc.org/github.com/julienschmidt/httprouter#Router.Handle) when registering a route. The only disadvantage is, that no parameter values can be retrieved when a `http.Handler` or `http.HandlerFunc` is used, since there is no efficient way to pass the values with the existing function parameters. Therefore [`httprouter.Handle`](https://godoc.org/github.com/julienschmidt/httprouter#Router.Handle) has a third function parameter. + +Just try it out for yourself, the usage of HttpRouter is very straightforward. The package is compact and minimalistic, but also probably one of the easiest routers to set up. + +## Where can I find Middleware *X*? + +This package just provides a very efficient request router with a few extra features. The router is just a [`http.Handler`](https://golang.org/pkg/net/http/#Handler), you can chain any http.Handler compatible middleware before the router, for example the [Gorilla handlers](http://www.gorillatoolkit.org/pkg/handlers). Or you could [just write your own](https://justinas.org/writing-http-middleware-in-go/), it's very easy! + +Alternatively, you could try [a web framework based on HttpRouter](#web-frameworks-based-on-httprouter). + +### Multi-domain / Sub-domains + +Here is a quick example: Does your server serve multiple domains / hosts? +You want to use sub-domains? +Define a router per host! + +```go +// We need an object that implements the http.Handler interface. +// Therefore we need a type for which we implement the ServeHTTP method. +// We just use a map here, in which we map host names (with port) to http.Handlers +type HostSwitch map[string]http.Handler + +// Implement the ServeHTTP method on our new type +func (hs HostSwitch) ServeHTTP(w http.ResponseWriter, r *http.Request) { + // Check if a http.Handler is registered for the given host. + // If yes, use it to handle the request. + if handler := hs[r.Host]; handler != nil { + handler.ServeHTTP(w, r) + } else { + // Handle host names for which no handler is registered + http.Error(w, "Forbidden", 403) // Or Redirect? + } +} + +func main() { + // Initialize a router as usual + router := httprouter.New() + router.GET("/", Index) + router.GET("/hello/:name", Hello) + + // Make a new HostSwitch and insert the router (our http handler) + // for example.com and port 12345 + hs := make(HostSwitch) + hs["example.com:12345"] = router + + // Use the HostSwitch to listen and serve on port 12345 + log.Fatal(http.ListenAndServe(":12345", hs)) +} +``` + +### Basic Authentication + +Another quick example: Basic Authentication (RFC 2617) for handles: + +```go +package main + +import ( + "fmt" + "log" + "net/http" + + "github.com/julienschmidt/httprouter" +) + +func BasicAuth(h httprouter.Handle, requiredUser, requiredPassword string) httprouter.Handle { + return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { + // Get the Basic Authentication credentials + user, password, hasAuth := r.BasicAuth() + + if hasAuth && user == requiredUser && password == requiredPassword { + // Delegate request to the given handle + h(w, r, ps) + } else { + // Request Basic Authentication otherwise + w.Header().Set("WWW-Authenticate", "Basic realm=Restricted") + http.Error(w, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized) + } + } +} + +func Index(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { + fmt.Fprint(w, "Not protected!\n") +} + +func Protected(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { + fmt.Fprint(w, "Protected!\n") +} + +func main() { + user := "gordon" + pass := "secret!" + + router := httprouter.New() + router.GET("/", Index) + router.GET("/protected/", BasicAuth(Protected, user, pass)) + + log.Fatal(http.ListenAndServe(":8080", router)) +} +``` + +## Chaining with the NotFound handler + +**NOTE: It might be required to set [`Router.HandleMethodNotAllowed`](https://godoc.org/github.com/julienschmidt/httprouter#Router.HandleMethodNotAllowed) to `false` to avoid problems.** + +You can use another [`http.Handler`](https://golang.org/pkg/net/http/#Handler), for example another router, to handle requests which could not be matched by this router by using the [`Router.NotFound`](https://godoc.org/github.com/julienschmidt/httprouter#Router.NotFound) handler. This allows chaining. + +### Static files + +The `NotFound` handler can for example be used to serve static files from the root path `/` (like an `index.html` file along with other assets): + +```go +// Serve static files from the ./public directory +router.NotFound = http.FileServer(http.Dir("public")) +``` + +But this approach sidesteps the strict core rules of this router to avoid routing problems. A cleaner approach is to use a distinct sub-path for serving files, like `/static/*filepath` or `/files/*filepath`. + +## Web Frameworks based on HttpRouter + +If the HttpRouter is a bit too minimalistic for you, you might try one of the following more high-level 3rd-party web frameworks building upon the HttpRouter package: + +* [Ace](https://github.com/plimble/ace): Blazing fast Go Web Framework +* [api2go](https://github.com/manyminds/api2go): A JSON API Implementation for Go +* [Gin](https://github.com/gin-gonic/gin): Features a martini-like API with much better performance +* [Goat](https://github.com/bahlo/goat): A minimalistic REST API server in Go +* [goMiddlewareChain](https://github.com/TobiEiss/goMiddlewareChain): An express.js-like-middleware-chain +* [Hikaru](https://github.com/najeira/hikaru): Supports standalone and Google AppEngine +* [Hitch](https://github.com/nbio/hitch): Hitch ties httprouter, [httpcontext](https://github.com/nbio/httpcontext), and middleware up in a bow +* [httpway](https://github.com/corneldamian/httpway): Simple middleware extension with context for httprouter and a server with gracefully shutdown support +* [kami](https://github.com/guregu/kami): A tiny web framework using x/net/context +* [Medeina](https://github.com/imdario/medeina): Inspired by Ruby's Roda and Cuba +* [Neko](https://github.com/rocwong/neko): A lightweight web application framework for Golang +* [River](https://github.com/abiosoft/river): River is a simple and lightweight REST server +* [Roxanna](https://github.com/iamthemuffinman/Roxanna): An amalgamation of httprouter, better logging, and hot reload +* [siesta](https://github.com/VividCortex/siesta): Composable HTTP handlers with contexts +* [xmux](https://github.com/rs/xmux): xmux is a httprouter fork on top of xhandler (net/context aware) diff --git a/vendor/github.com/kardianos/osext/README.md b/vendor/github.com/kardianos/osext/README.md new file mode 100644 index 000000000000..15cbc3d953ed --- /dev/null +++ b/vendor/github.com/kardianos/osext/README.md @@ -0,0 +1,21 @@ +### Extensions to the "os" package. + +[![GoDoc](https://godoc.org/github.com/kardianos/osext?status.svg)](https://godoc.org/github.com/kardianos/osext) + +## Find the current Executable and ExecutableFolder. + +As of go1.8 the Executable function may be found in `os`. The Executable function +in the std lib `os` package is used if available. + +There is sometimes utility in finding the current executable file +that is running. This can be used for upgrading the current executable +or finding resources located relative to the executable file. Both +working directory and the os.Args[0] value are arbitrary and cannot +be relied on; os.Args[0] can be "faked". + +Multi-platform and supports: + * Linux + * OS X + * Windows + * Plan 9 + * BSDs. diff --git a/vendor/github.com/kelseyhightower/envconfig/MAINTAINERS b/vendor/github.com/kelseyhightower/envconfig/MAINTAINERS new file mode 100644 index 000000000000..6527a9f2cc27 --- /dev/null +++ b/vendor/github.com/kelseyhightower/envconfig/MAINTAINERS @@ -0,0 +1,2 @@ +Kelsey Hightower kelsey.hightower@gmail.com github.com/kelseyhightower +Travis Parker travis.parker@gmail.com github.com/teepark diff --git a/vendor/github.com/kelseyhightower/envconfig/README.md b/vendor/github.com/kelseyhightower/envconfig/README.md new file mode 100644 index 000000000000..33408d645e4b --- /dev/null +++ b/vendor/github.com/kelseyhightower/envconfig/README.md @@ -0,0 +1,192 @@ +# envconfig + +[![Build Status](https://travis-ci.org/kelseyhightower/envconfig.svg)](https://travis-ci.org/kelseyhightower/envconfig) + +```Go +import "github.com/kelseyhightower/envconfig" +``` + +## Documentation + +See [godoc](http://godoc.org/github.com/kelseyhightower/envconfig) + +## Usage + +Set some environment variables: + +```Bash +export MYAPP_DEBUG=false +export MYAPP_PORT=8080 +export MYAPP_USER=Kelsey +export MYAPP_RATE="0.5" +export MYAPP_TIMEOUT="3m" +export MYAPP_USERS="rob,ken,robert" +export MYAPP_COLORCODES="red:1,green:2,blue:3" +``` + +Write some code: + +```Go +package main + +import ( + "fmt" + "log" + "time" + + "github.com/kelseyhightower/envconfig" +) + +type Specification struct { + Debug bool + Port int + User string + Users []string + Rate float32 + Timeout time.Duration + ColorCodes map[string]int +} + +func main() { + var s Specification + err := envconfig.Process("myapp", &s) + if err != nil { + log.Fatal(err.Error()) + } + format := "Debug: %v\nPort: %d\nUser: %s\nRate: %f\nTimeout: %s\n" + _, err = fmt.Printf(format, s.Debug, s.Port, s.User, s.Rate, s.Timeout) + if err != nil { + log.Fatal(err.Error()) + } + + fmt.Println("Users:") + for _, u := range s.Users { + fmt.Printf(" %s\n", u) + } + + fmt.Println("Color codes:") + for k, v := range s.ColorCodes { + fmt.Printf(" %s: %d\n", k, v) + } +} +``` + +Results: + +```Bash +Debug: false +Port: 8080 +User: Kelsey +Rate: 0.500000 +Timeout: 3m0s +Users: + rob + ken + robert +Color codes: + red: 1 + green: 2 + blue: 3 +``` + +## Struct Tag Support + +Envconfig supports the use of struct tags to specify alternate, default, and required +environment variables. + +For example, consider the following struct: + +```Go +type Specification struct { + ManualOverride1 string `envconfig:"manual_override_1"` + DefaultVar string `default:"foobar"` + RequiredVar string `required:"true"` + IgnoredVar string `ignored:"true"` + AutoSplitVar string `split_words:"true"` + RequiredAndAutoSplitVar string `required:"true" split_words:"true"` +} +``` + +Envconfig has automatic support for CamelCased struct elements when the +`split_words:"true"` tag is supplied. Without this tag, `AutoSplitVar` above +would look for an environment variable called `MYAPP_AUTOSPLITVAR`. With the +setting applied it will look for `MYAPP_AUTO_SPLIT_VAR`. Note that numbers +will get globbed into the previous word. If the setting does not do the +right thing, you may use a manual override. + +Envconfig will process value for `ManualOverride1` by populating it with the +value for `MYAPP_MANUAL_OVERRIDE_1`. Without this struct tag, it would have +instead looked up `MYAPP_MANUALOVERRIDE1`. With the `split_words:"true"` tag +it would have looked up `MYAPP_MANUAL_OVERRIDE1`. + +```Bash +export MYAPP_MANUAL_OVERRIDE_1="this will be the value" + +# export MYAPP_MANUALOVERRIDE1="and this will not" +``` + +If envconfig can't find an environment variable value for `MYAPP_DEFAULTVAR`, +it will populate it with "foobar" as a default value. + +If envconfig can't find an environment variable value for `MYAPP_REQUIREDVAR`, +it will return an error when asked to process the struct. If +`MYAPP_REQUIREDVAR` is present but empty, envconfig will not return an error. + +If envconfig can't find an environment variable in the form `PREFIX_MYVAR`, and there +is a struct tag defined, it will try to populate your variable with an environment +variable that directly matches the envconfig tag in your struct definition: + +```shell +export SERVICE_HOST=127.0.0.1 +export MYAPP_DEBUG=true +``` +```Go +type Specification struct { + ServiceHost string `envconfig:"SERVICE_HOST"` + Debug bool +} +``` + +Envconfig won't process a field with the "ignored" tag set to "true", even if a corresponding +environment variable is set. + +## Supported Struct Field Types + +envconfig supports these struct field types: + + * string + * int8, int16, int32, int64 + * bool + * float32, float64 + * slices of any supported type + * maps (keys and values of any supported type) + * [encoding.TextUnmarshaler](https://golang.org/pkg/encoding/#TextUnmarshaler) + * [encoding.BinaryUnmarshaler](https://golang.org/pkg/encoding/#BinaryUnmarshaler) + * [time.Duration](https://golang.org/pkg/time/#Duration) + +Embedded structs using these fields are also supported. + +## Custom Decoders + +Any field whose type (or pointer-to-type) implements `envconfig.Decoder` can +control its own deserialization: + +```Bash +export DNS_SERVER=8.8.8.8 +``` + +```Go +type IPDecoder net.IP + +func (ipd *IPDecoder) Decode(value string) error { + *ipd = IPDecoder(net.ParseIP(value)) + return nil +} + +type DNSConfig struct { + Address IPDecoder `envconfig:"DNS_SERVER"` +} +``` + +Also, envconfig will use a `Set(string) error` method like from the +[flag.Value](https://godoc.org/flag#Value) interface if implemented. diff --git a/vendor/github.com/kelseyhightower/envconfig/go.mod b/vendor/github.com/kelseyhightower/envconfig/go.mod new file mode 100644 index 000000000000..1561d1e4e048 --- /dev/null +++ b/vendor/github.com/kelseyhightower/envconfig/go.mod @@ -0,0 +1 @@ +module github.com/kelseyhightower/envconfig diff --git a/vendor/github.com/klauspost/compress/fse/README.md b/vendor/github.com/klauspost/compress/fse/README.md new file mode 100644 index 000000000000..ea7324da671f --- /dev/null +++ b/vendor/github.com/klauspost/compress/fse/README.md @@ -0,0 +1,79 @@ +# Finite State Entropy + +This package provides Finite State Entropy encoding and decoding. + +Finite State Entropy (also referenced as [tANS](https://en.wikipedia.org/wiki/Asymmetric_numeral_systems#tANS)) +encoding provides a fast near-optimal symbol encoding/decoding +for byte blocks as implemented in [zstandard](https://github.com/facebook/zstd). + +This can be used for compressing input with a lot of similar input values to the smallest number of bytes. +This does not perform any multi-byte [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder) as LZ coders, +but it can be used as a secondary step to compressors (like Snappy) that does not do entropy encoding. + +* [Godoc documentation](https://godoc.org/github.com/klauspost/compress/fse) + +## News + + * Feb 2018: First implementation released. Consider this beta software for now. + +# Usage + +This package provides a low level interface that allows to compress single independent blocks. + +Each block is separate, and there is no built in integrity checks. +This means that the caller should keep track of block sizes and also do checksums if needed. + +Compressing a block is done via the [`Compress`](https://godoc.org/github.com/klauspost/compress/fse#Compress) function. +You must provide input and will receive the output and maybe an error. + +These error values can be returned: + +| Error | Description | +|---------------------|-----------------------------------------------------------------------------| +| `` | Everything ok, output is returned | +| `ErrIncompressible` | Returned when input is judged to be too hard to compress | +| `ErrUseRLE` | Returned from the compressor when the input is a single byte value repeated | +| `(error)` | An internal error occurred. | + +As can be seen above there are errors that will be returned even under normal operation so it is important to handle these. + +To reduce allocations you can provide a [`Scratch`](https://godoc.org/github.com/klauspost/compress/fse#Scratch) object +that can be re-used for successive calls. Both compression and decompression accepts a `Scratch` object, and the same +object can be used for both. + +Be aware, that when re-using a `Scratch` object that the *output* buffer is also re-used, so if you are still using this +you must set the `Out` field in the scratch to nil. The same buffer is used for compression and decompression output. + +Decompressing is done by calling the [`Decompress`](https://godoc.org/github.com/klauspost/compress/fse#Decompress) function. +You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back +your input was likely corrupted. + +It is important to note that a successful decoding does *not* mean your output matches your original input. +There are no integrity checks, so relying on errors from the decompressor does not assure your data is valid. + +For more detailed usage, see examples in the [godoc documentation](https://godoc.org/github.com/klauspost/compress/fse#pkg-examples). + +# Performance + +A lot of factors are affecting speed. Block sizes and compressibility of the material are primary factors. +All compression functions are currently only running on the calling goroutine so only one core will be used per block. + +The compressor is significantly faster if symbols are kept as small as possible. The highest byte value of the input +is used to reduce some of the processing, so if all your input is above byte value 64 for instance, it may be +beneficial to transpose all your input values down by 64. + +With moderate block sizes around 64k speed are typically 200MB/s per core for compression and +around 300MB/s decompression speed. + +The same hardware typically does Huffman (deflate) encoding at 125MB/s and decompression at 100MB/s. + +# Plans + +At one point, more internals will be exposed to facilitate more "expert" usage of the components. + +A streaming interface is also likely to be implemented. Likely compatible with [FSE stream format](https://github.com/Cyan4973/FiniteStateEntropy/blob/dev/programs/fileio.c#L261). + +# Contributing + +Contributions are always welcome. Be aware that adding public functions will require good justification and breaking +changes will likely not be accepted. If in doubt open an issue before writing the PR. \ No newline at end of file diff --git a/vendor/github.com/klauspost/compress/huff0/.gitignore b/vendor/github.com/klauspost/compress/huff0/.gitignore new file mode 100644 index 000000000000..b3d262958f85 --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/.gitignore @@ -0,0 +1 @@ +/huff0-fuzz.zip diff --git a/vendor/github.com/klauspost/compress/huff0/README.md b/vendor/github.com/klauspost/compress/huff0/README.md new file mode 100644 index 000000000000..0a8448ce9f9c --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/README.md @@ -0,0 +1,87 @@ +# Huff0 entropy compression + +This package provides Huff0 encoding and decoding as used in zstd. + +[Huff0](https://github.com/Cyan4973/FiniteStateEntropy#new-generation-entropy-coders), +a Huffman codec designed for modern CPU, featuring OoO (Out of Order) operations on multiple ALU +(Arithmetic Logic Unit), achieving extremely fast compression and decompression speeds. + +This can be used for compressing input with a lot of similar input values to the smallest number of bytes. +This does not perform any multi-byte [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder) as LZ coders, +but it can be used as a secondary step to compressors (like Snappy) that does not do entropy encoding. + +* [Godoc documentation](https://godoc.org/github.com/klauspost/compress/huff0) + +THIS PACKAGE IS NOT CONSIDERED STABLE AND API OR ENCODING MAY CHANGE IN THE FUTURE. + +## News + + * Mar 2018: First implementation released. Consider this beta software for now. + +# Usage + +This package provides a low level interface that allows to compress single independent blocks. + +Each block is separate, and there is no built in integrity checks. +This means that the caller should keep track of block sizes and also do checksums if needed. + +Compressing a block is done via the [`Compress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Compress1X) and +[`Compress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Compress4X) functions. +You must provide input and will receive the output and maybe an error. + +These error values can be returned: + +| Error | Description | +|---------------------|-----------------------------------------------------------------------------| +| `` | Everything ok, output is returned | +| `ErrIncompressible` | Returned when input is judged to be too hard to compress | +| `ErrUseRLE` | Returned from the compressor when the input is a single byte value repeated | +| `ErrTooBig` | Returned if the input block exceeds the maximum allowed size (128 Kib) | +| `(error)` | An internal error occurred. | + + +As can be seen above some of there are errors that will be returned even under normal operation so it is important to handle these. + +To reduce allocations you can provide a [`Scratch`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch) object +that can be re-used for successive calls. Both compression and decompression accepts a `Scratch` object, and the same +object can be used for both. + +Be aware, that when re-using a `Scratch` object that the *output* buffer is also re-used, so if you are still using this +you must set the `Out` field in the scratch to nil. The same buffer is used for compression and decompression output. + +The `Scratch` object will retain state that allows to re-use previous tables for encoding and decoding. + +## Tables and re-use + +Huff0 allows for reusing tables from the previous block to save space if that is expected to give better/faster results. + +The Scratch object allows you to set a [`ReusePolicy`](https://godoc.org/github.com/klauspost/compress/huff0#ReusePolicy) +that controls this behaviour. See the documentation for details. This can be altered between each block. + +Do however note that this information is *not* stored in the output block and it is up to the users of the package to +record whether [`ReadTable`](https://godoc.org/github.com/klauspost/compress/huff0#ReadTable) should be called, +based on the boolean reported back from the CompressXX call. + +If you want to store the table separate from the data, you can access them as `OutData` and `OutTable` on the +[`Scratch`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch) object. + +## Decompressing + +The first part of decoding is to initialize the decoding table through [`ReadTable`](https://godoc.org/github.com/klauspost/compress/huff0#ReadTable). +This will initialize the decoding tables. +You can supply the complete block to `ReadTable` and it will return the data part of the block +which can be given to the decompressor. + +Decompressing is done by calling the [`Decompress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress1X) +or [`Decompress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress4X) function. + +You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back +your input was likely corrupted. + +It is important to note that a successful decoding does *not* mean your output matches your original input. +There are no integrity checks, so relying on errors from the decompressor does not assure your data is valid. + +# Contributing + +Contributions are always welcome. Be aware that adding public functions will require good justification and breaking +changes will likely not be accepted. If in doubt open an issue before writing the PR. \ No newline at end of file diff --git a/vendor/github.com/klauspost/compress/snappy/.gitignore b/vendor/github.com/klauspost/compress/snappy/.gitignore new file mode 100644 index 000000000000..042091d9b3b0 --- /dev/null +++ b/vendor/github.com/klauspost/compress/snappy/.gitignore @@ -0,0 +1,16 @@ +cmd/snappytool/snappytool +testdata/bench + +# These explicitly listed benchmark data files are for an obsolete version of +# snappy_test.go. +testdata/alice29.txt +testdata/asyoulik.txt +testdata/fireworks.jpeg +testdata/geo.protodata +testdata/html +testdata/html_x_4 +testdata/kppkn.gtb +testdata/lcet10.txt +testdata/paper-100k.pdf +testdata/plrabn12.txt +testdata/urls.10K diff --git a/vendor/github.com/klauspost/compress/snappy/README b/vendor/github.com/klauspost/compress/snappy/README new file mode 100644 index 000000000000..cea12879a0ea --- /dev/null +++ b/vendor/github.com/klauspost/compress/snappy/README @@ -0,0 +1,107 @@ +The Snappy compression format in the Go programming language. + +To download and install from source: +$ go get github.com/golang/snappy + +Unless otherwise noted, the Snappy-Go source files are distributed +under the BSD-style license found in the LICENSE file. + + + +Benchmarks. + +The golang/snappy benchmarks include compressing (Z) and decompressing (U) ten +or so files, the same set used by the C++ Snappy code (github.com/google/snappy +and note the "google", not "golang"). On an "Intel(R) Core(TM) i7-3770 CPU @ +3.40GHz", Go's GOARCH=amd64 numbers as of 2016-05-29: + +"go test -test.bench=." + +_UFlat0-8 2.19GB/s ± 0% html +_UFlat1-8 1.41GB/s ± 0% urls +_UFlat2-8 23.5GB/s ± 2% jpg +_UFlat3-8 1.91GB/s ± 0% jpg_200 +_UFlat4-8 14.0GB/s ± 1% pdf +_UFlat5-8 1.97GB/s ± 0% html4 +_UFlat6-8 814MB/s ± 0% txt1 +_UFlat7-8 785MB/s ± 0% txt2 +_UFlat8-8 857MB/s ± 0% txt3 +_UFlat9-8 719MB/s ± 1% txt4 +_UFlat10-8 2.84GB/s ± 0% pb +_UFlat11-8 1.05GB/s ± 0% gaviota + +_ZFlat0-8 1.04GB/s ± 0% html +_ZFlat1-8 534MB/s ± 0% urls +_ZFlat2-8 15.7GB/s ± 1% jpg +_ZFlat3-8 740MB/s ± 3% jpg_200 +_ZFlat4-8 9.20GB/s ± 1% pdf +_ZFlat5-8 991MB/s ± 0% html4 +_ZFlat6-8 379MB/s ± 0% txt1 +_ZFlat7-8 352MB/s ± 0% txt2 +_ZFlat8-8 396MB/s ± 1% txt3 +_ZFlat9-8 327MB/s ± 1% txt4 +_ZFlat10-8 1.33GB/s ± 1% pb +_ZFlat11-8 605MB/s ± 1% gaviota + + + +"go test -test.bench=. -tags=noasm" + +_UFlat0-8 621MB/s ± 2% html +_UFlat1-8 494MB/s ± 1% urls +_UFlat2-8 23.2GB/s ± 1% jpg +_UFlat3-8 1.12GB/s ± 1% jpg_200 +_UFlat4-8 4.35GB/s ± 1% pdf +_UFlat5-8 609MB/s ± 0% html4 +_UFlat6-8 296MB/s ± 0% txt1 +_UFlat7-8 288MB/s ± 0% txt2 +_UFlat8-8 309MB/s ± 1% txt3 +_UFlat9-8 280MB/s ± 1% txt4 +_UFlat10-8 753MB/s ± 0% pb +_UFlat11-8 400MB/s ± 0% gaviota + +_ZFlat0-8 409MB/s ± 1% html +_ZFlat1-8 250MB/s ± 1% urls +_ZFlat2-8 12.3GB/s ± 1% jpg +_ZFlat3-8 132MB/s ± 0% jpg_200 +_ZFlat4-8 2.92GB/s ± 0% pdf +_ZFlat5-8 405MB/s ± 1% html4 +_ZFlat6-8 179MB/s ± 1% txt1 +_ZFlat7-8 170MB/s ± 1% txt2 +_ZFlat8-8 189MB/s ± 1% txt3 +_ZFlat9-8 164MB/s ± 1% txt4 +_ZFlat10-8 479MB/s ± 1% pb +_ZFlat11-8 270MB/s ± 1% gaviota + + + +For comparison (Go's encoded output is byte-for-byte identical to C++'s), here +are the numbers from C++ Snappy's + +make CXXFLAGS="-O2 -DNDEBUG -g" clean snappy_unittest.log && cat snappy_unittest.log + +BM_UFlat/0 2.4GB/s html +BM_UFlat/1 1.4GB/s urls +BM_UFlat/2 21.8GB/s jpg +BM_UFlat/3 1.5GB/s jpg_200 +BM_UFlat/4 13.3GB/s pdf +BM_UFlat/5 2.1GB/s html4 +BM_UFlat/6 1.0GB/s txt1 +BM_UFlat/7 959.4MB/s txt2 +BM_UFlat/8 1.0GB/s txt3 +BM_UFlat/9 864.5MB/s txt4 +BM_UFlat/10 2.9GB/s pb +BM_UFlat/11 1.2GB/s gaviota + +BM_ZFlat/0 944.3MB/s html (22.31 %) +BM_ZFlat/1 501.6MB/s urls (47.78 %) +BM_ZFlat/2 14.3GB/s jpg (99.95 %) +BM_ZFlat/3 538.3MB/s jpg_200 (73.00 %) +BM_ZFlat/4 8.3GB/s pdf (83.30 %) +BM_ZFlat/5 903.5MB/s html4 (22.52 %) +BM_ZFlat/6 336.0MB/s txt1 (57.88 %) +BM_ZFlat/7 312.3MB/s txt2 (61.91 %) +BM_ZFlat/8 353.1MB/s txt3 (54.99 %) +BM_ZFlat/9 289.9MB/s txt4 (66.26 %) +BM_ZFlat/10 1.2GB/s pb (19.68 %) +BM_ZFlat/11 527.4MB/s gaviota (37.72 %) diff --git a/vendor/github.com/klauspost/compress/snappy/runbench.cmd b/vendor/github.com/klauspost/compress/snappy/runbench.cmd new file mode 100644 index 000000000000..d24eb4b47c37 --- /dev/null +++ b/vendor/github.com/klauspost/compress/snappy/runbench.cmd @@ -0,0 +1,2 @@ +del old.txt +go test -bench=. >>old.txt && go test -bench=. >>old.txt && go test -bench=. >>old.txt && benchstat -delta-test=ttest old.txt new.txt diff --git a/vendor/github.com/klauspost/compress/zstd/README.md b/vendor/github.com/klauspost/compress/zstd/README.md new file mode 100644 index 000000000000..670f98af44d2 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/README.md @@ -0,0 +1,383 @@ +# zstd + +[Zstandard](https://facebook.github.io/zstd/) is a real-time compression algorithm, providing high compression ratios. +It offers a very wide range of compression / speed trade-off, while being backed by a very fast decoder. +A high performance compression algorithm is implemented. For now focused on speed. + +This package provides [compression](#Compressor) to and [decompression](#Decompressor) of Zstandard content. +Note that custom dictionaries are not supported yet, so if your code relies on that, +you cannot use the package as-is. + +This package is pure Go and without use of "unsafe". +If a significant speedup can be achieved using "unsafe", it may be added as an option later. + +The `zstd` package is provided as open source software using a Go standard license. + +Currently the package is heavily optimized for 64 bit processors and will be significantly slower on 32 bit processors. + +## Installation + +Install using `go get -u github.com/klauspost/compress`. The package is located in `github.com/klauspost/compress/zstd`. + +Godoc Documentation: https://godoc.org/github.com/klauspost/compress/zstd + + +## Compressor + +### Status: + +BETA - there may still be subtle bugs, but a wide variety of content has been tested. +There may still be implementation specific stuff in regards to error handling that could lead to edge cases. + +For now, a high speed (fastest) and medium-fast (default) compressor has been implemented. + +The "Fastest" compression ratio is roughly equivalent to zstd level 1. +The "Default" compression ration is roughly equivalent to zstd level 3 (default). + +In terms of speed, it is typically 2x as fast as the stdlib deflate/gzip in its fastest mode. The compression ratio compared to stdlib is around level 3, but usually 3x as fast. + +Compared to cgo zstd, the speed is around level 3 (default), but compression slightly worse, between level 1&2. + + +### Usage + +An Encoder can be used for either compressing a stream via the +`io.WriteCloser` interface supported by the Encoder or as multiple independent +tasks via the `EncodeAll` function. +Smaller encodes are encouraged to use the EncodeAll function. +Use `NewWriter` to create a new instance that can be used for both. + +To create a writer with default options, do like this: + +```Go +// Compress input to output. +func Compress(in io.Reader, out io.Writer) error { + w, err := NewWriter(output) + if err != nil { + return err + } + _, err := io.Copy(w, input) + if err != nil { + enc.Close() + return err + } + return enc.Close() +} +``` + +Now you can encode by writing data to `enc`. The output will be finished writing when `Close()` is called. +Even if your encode fails, you should still call `Close()` to release any resources that may be held up. + +The above is fine for big encodes. However, whenever possible try to *reuse* the writer. + +To reuse the encoder, you can use the `Reset(io.Writer)` function to change to another output. +This will allow the encoder to reuse all resources and avoid wasteful allocations. + +Currently stream encoding has 'light' concurrency, meaning up to 2 goroutines can be working on part +of a stream. This is independent of the `WithEncoderConcurrency(n)`, but that is likely to change +in the future. So if you want to limit concurrency for future updates, specify the concurrency +you would like. + +You can specify your desired compression level using `WithEncoderLevel()` option. Currently only pre-defined +compression settings can be specified. + +#### Future Compatibility Guarantees + +This will be an evolving project. When using this package it is important to note that both the compression efficiency and speed may change. + +The goal will be to keep the default efficiency at the default zstd (level 3). +However the encoding should never be assumed to remain the same, +and you should not use hashes of compressed output for similarity checks. + +The Encoder can be assumed to produce the same output from the exact same code version. +However, the may be modes in the future that break this, +although they will not be enabled without an explicit option. + +This encoder is not designed to (and will probably never) output the exact same bitstream as the reference encoder. + +Also note, that the cgo decompressor currently does not [report all errors on invalid input](https://github.com/DataDog/zstd/issues/59), +[omits error checks](https://github.com/DataDog/zstd/issues/61), [ignores checksums](https://github.com/DataDog/zstd/issues/43) +and seems to ignore concatenated streams, even though [it is part of the spec](https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#frames). + +#### Blocks + +For compressing small blocks, the returned encoder has a function called `EncodeAll(src, dst []byte) []byte`. + +`EncodeAll` will encode all input in src and append it to dst. +This function can be called concurrently, but each call will only run on a single goroutine. + +Encoded blocks can be concatenated and the result will be the combined input stream. +Data compressed with EncodeAll can be decoded with the Decoder, using either a stream or `DecodeAll`. + +Especially when encoding blocks you should take special care to reuse the encoder. +This will effectively make it run without allocations after a warmup period. +To make it run completely without allocations, supply a destination buffer with space for all content. + +```Go +import "github.com/klauspost/compress/zstd" + +// Create a writer that caches compressors. +// For this operation type we supply a nil Reader. +var encoder, _ = zstd.NewWriter(nil) + +// Compress a buffer. +// If you have a destination buffer, the allocation in the call can also be eliminated. +func Compress(src []byte) []byte { + return encoder.EncodeAll(src, make([]byte, 0, len(src))) +} +``` + +You can control the maximum number of concurrent encodes using the `WithEncoderConcurrency(n)` +option when creating the writer. + +Using the Encoder for both a stream and individual blocks concurrently is safe. + +### Performance + +I have collected some speed examples to compare speed and compression against other compressors. + +* `file` is the input file. +* `out` is the compressor used. `zskp` is this package. `gzstd` is gzip standard library. `zstd` is the Datadog cgo library. +* `level` is the compression level used. For `zskp` level 1 is "fastest", level 2 is "default". +* `insize`/`outsize` is the input/output size. +* `millis` is the number of milliseconds used for compression. +* `mb/s` is megabytes (2^20 bytes) per second. + +``` +The test data for the Large Text Compression Benchmark is the first +10^9 bytes of the English Wikipedia dump on Mar. 3, 2006. +http://mattmahoney.net/dc/textdata.html + +file out level insize outsize millis mb/s +enwik9 zskp 1 1000000000 343833033 5840 163.30 +enwik9 zskp 2 1000000000 317822183 8449 112.87 +enwik9 gzstd 1 1000000000 382578136 13627 69.98 +enwik9 gzstd 3 1000000000 349139651 22344 42.68 +enwik9 zstd 1 1000000000 357416379 4838 197.12 +enwik9 zstd 3 1000000000 313734522 7556 126.21 + +GOB stream of binary data. Highly compressible. +https://files.klauspost.com/compress/gob-stream.7z + +file out level insize outsize millis mb/s +gob-stream zskp 1 1911399616 234981983 5100 357.42 +gob-stream zskp 2 1911399616 208674003 6698 272.15 +gob-stream gzstd 1 1911399616 357382641 14727 123.78 +gob-stream gzstd 3 1911399616 327835097 17005 107.19 +gob-stream zstd 1 1911399616 250787165 4075 447.22 +gob-stream zstd 3 1911399616 208191888 5511 330.77 + +Highly compressible JSON file. Similar to logs in a lot of ways. +https://files.klauspost.com/compress/adresser.001.gz + +file out level insize outsize millis mb/s +adresser.001 zskp 1 1073741824 18510122 1477 692.83 +adresser.001 zskp 2 1073741824 19831697 1705 600.59 +adresser.001 gzstd 1 1073741824 47755503 3079 332.47 +adresser.001 gzstd 3 1073741824 40052381 3051 335.63 +adresser.001 zstd 1 1073741824 16135896 994 1030.18 +adresser.001 zstd 3 1073741824 17794465 905 1131.49 + +VM Image, Linux mint with a few installed applications: +https://files.klauspost.com/compress/rawstudio-mint14.7z + +file out level insize outsize millis mb/s +rawstudio-mint14.tar zskp 1 8558382592 3648168838 33398 244.38 +rawstudio-mint14.tar zskp 2 8558382592 3376721436 50962 160.16 +rawstudio-mint14.tar gzstd 1 8558382592 3926257486 84712 96.35 +rawstudio-mint14.tar gzstd 3 8558382592 3740711978 176344 46.28 +rawstudio-mint14.tar zstd 1 8558382592 3607859742 27903 292.51 +rawstudio-mint14.tar zstd 3 8558382592 3341710879 46700 174.77 + + +The test data is designed to test archivers in realistic backup scenarios. +http://mattmahoney.net/dc/10gb.html + +file out level insize outsize millis mb/s +10gb.tar zskp 1 10065157632 4883149814 45715 209.97 +10gb.tar zskp 2 10065157632 4638110010 60970 157.44 +10gb.tar gzstd 1 10065157632 5198296126 97769 98.18 +10gb.tar gzstd 3 10065157632 4932665487 313427 30.63 +10gb.tar zstd 1 10065157632 4940796535 40391 237.65 +10gb.tar zstd 3 10065157632 4638618579 52911 181.42 + +Silesia Corpus: +http://sun.aei.polsl.pl/~sdeor/corpus/silesia.zip + +file out level insize outsize millis mb/s +silesia.tar zskp 1 211947520 73025800 1108 182.26 +silesia.tar zskp 2 211947520 67674684 1599 126.41 +silesia.tar gzstd 1 211947520 80007735 2515 80.37 +silesia.tar gzstd 3 211947520 73133380 4259 47.45 +silesia.tar zstd 1 211947520 73513991 933 216.64 +silesia.tar zstd 3 211947520 66793301 1377 146.79 +``` + +### Converters + +As part of the development process a *Snappy* -> *Zstandard* converter was also built. + +This can convert a *framed* [Snappy Stream](https://godoc.org/github.com/golang/snappy#Writer) to a zstd stream. Note that a single block is not framed. + +Conversion is done by converting the stream directly from Snappy without intermediate full decoding. +Therefore the compression ratio is much less than what can be done by a full decompression +and compression, and a faulty Snappy stream may lead to a faulty Zstandard stream without +any errors being generated. +No CRC value is being generated and not all CRC values of the Snappy stream are checked. +However, it provides really fast re-compression of Snappy streams. + + +``` +BenchmarkSnappy_ConvertSilesia-8 1 1156001600 ns/op 183.35 MB/s +Snappy len 103008711 -> zstd len 82687318 + +BenchmarkSnappy_Enwik9-8 1 6472998400 ns/op 154.49 MB/s +Snappy len 508028601 -> zstd len 390921079 +``` + + +```Go + s := zstd.SnappyConverter{} + n, err = s.Convert(input, output) + if err != nil { + fmt.Println("Re-compressed stream to", n, "bytes") + } +``` + +The converter `s` can be reused to avoid allocations, even after errors. + + +## Decompressor + +STATUS: Release Candidate - there may still be subtle bugs, but a wide variety of content has been tested. + + +### Usage + +The package has been designed for two main usages, big streams of data and smaller in-memory buffers. +There are two main usages of the package for these. Both of them are accessed by creating a `Decoder`. + +For streaming use a simple setup could look like this: + +```Go +import "github.com/klauspost/compress/zstd" + +func Decompress(in io.Reader, out io.Writer) error { + d, err := zstd.NewReader(input) + if err != nil { + return err + } + defer d.Close() + + // Copy content... + _, err := io.Copy(out, d) + return err +} +``` + +It is important to use the "Close" function when you no longer need the Reader to stop running goroutines. +See "Allocation-less operation" below. + +For decoding buffers, it could look something like this: + +```Go +import "github.com/klauspost/compress/zstd" + +// Create a reader that caches decompressors. +// For this operation type we supply a nil Reader. +var decoder, _ = zstd.NewReader(nil) + +// Decompress a buffer. We don't supply a destination buffer, +// so it will be allocated by the decoder. +func Decompress(src []byte) ([]byte, error) { + return decoder.DecodeAll(src, nil) +} +``` + +Both of these cases should provide the functionality needed. +The decoder can be used for *concurrent* decompression of multiple buffers. +It will only allow a certain number of concurrent operations to run. +To tweak that yourself use the `WithDecoderConcurrency(n)` option when creating the decoder. + +### Allocation-less operation + +The decoder has been designed to operate without allocations after a warmup. + +This means that you should *store* the decoder for best performance. +To re-use a stream decoder, use the `Reset(r io.Reader) error` to switch to another stream. +A decoder can safely be re-used even if the previous stream failed. + +To release the resources, you must call the `Close()` function on a decoder. +After this it can *no longer be reused*, but all running goroutines will be stopped. +So you *must* use this if you will no longer need the Reader. + +For decompressing smaller buffers a single decoder can be used. +When decoding buffers, you can supply a destination slice with length 0 and your expected capacity. +In this case no unneeded allocations should be made. + +### Concurrency + +The buffer decoder does everything on the same goroutine and does nothing concurrently. +It can however decode several buffers concurrently. Use `WithDecoderConcurrency(n)` to limit that. + +The stream decoder operates on + +* One goroutine reads input and splits the input to several block decoders. +* A number of decoders will decode blocks. +* A goroutine coordinates these blocks and sends history from one to the next. + +So effectively this also means the decoder will "read ahead" and prepare data to always be available for output. + +Since "blocks" are quite dependent on the output of the previous block stream decoding will only have limited concurrency. + +In practice this means that concurrency is often limited to utilizing about 2 cores effectively. + + +### Benchmarks + +These are some examples of performance compared to [datadog cgo library](https://github.com/DataDog/zstd). + +The first two are streaming decodes and the last are smaller inputs. + +``` +BenchmarkDecoderSilesia-8 20 642550210 ns/op 329.85 MB/s 3101 B/op 8 allocs/op +BenchmarkDecoderSilesiaCgo-8 100 384930000 ns/op 550.61 MB/s 451878 B/op 9713 allocs/op + +BenchmarkDecoderEnwik9-2 10 3146000080 ns/op 317.86 MB/s 2649 B/op 9 allocs/op +BenchmarkDecoderEnwik9Cgo-2 20 1905900000 ns/op 524.69 MB/s 1125120 B/op 45785 allocs/op + +BenchmarkDecoder_DecodeAll/z000000.zst-8 200 7049994 ns/op 138.26 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000001.zst-8 100000 19560 ns/op 97.49 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000002.zst-8 5000 297599 ns/op 236.99 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000003.zst-8 2000 725502 ns/op 141.17 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000004.zst-8 200000 9314 ns/op 54.54 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000005.zst-8 10000 137500 ns/op 104.72 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000006.zst-8 500 2316009 ns/op 206.06 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000007.zst-8 20000 64499 ns/op 344.90 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000008.zst-8 50000 24900 ns/op 219.56 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000009.zst-8 1000 2348999 ns/op 154.01 MB/s 40 B/op 2 allocs/op + +BenchmarkDecoder_DecodeAllCgo/z000000.zst-8 500 4268005 ns/op 228.38 MB/s 1228849 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000001.zst-8 100000 15250 ns/op 125.05 MB/s 2096 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000002.zst-8 10000 147399 ns/op 478.49 MB/s 73776 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000003.zst-8 5000 320798 ns/op 319.27 MB/s 139312 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000004.zst-8 200000 10004 ns/op 50.77 MB/s 560 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000005.zst-8 20000 73599 ns/op 195.64 MB/s 19120 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000006.zst-8 1000 1119003 ns/op 426.48 MB/s 557104 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000007.zst-8 20000 103450 ns/op 215.04 MB/s 71296 B/op 9 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000008.zst-8 100000 20130 ns/op 271.58 MB/s 6192 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000009.zst-8 2000 1123500 ns/op 322.00 MB/s 368688 B/op 3 allocs/op +``` + +This reflects the performance around May 2019, but this may be out of date. + +# Contributions + +Contributions are always welcome. +For new features/fixes, remember to add tests and for performance enhancements include benchmarks. + +For sending files for reproducing errors use a service like [goobox](https://goobox.io/#/upload) or similar to share your files. + +For general feedback and experience reports, feel free to open an issue or write me on [Twitter](https://twitter.com/sh0dan). + +This package includes the excellent [`github.com/cespare/xxhash`](https://github.com/cespare/xxhash) package Copyright (c) 2016 Caleb Spare. \ No newline at end of file diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md new file mode 100644 index 000000000000..69aa3bb587c8 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md @@ -0,0 +1,58 @@ +# xxhash + +VENDORED: Go to [github.com/cespare/xxhash](https://github.com/cespare/xxhash) for original package. + + +[![GoDoc](https://godoc.org/github.com/cespare/xxhash?status.svg)](https://godoc.org/github.com/cespare/xxhash) +[![Build Status](https://travis-ci.org/cespare/xxhash.svg?branch=master)](https://travis-ci.org/cespare/xxhash) + +xxhash is a Go implementation of the 64-bit +[xxHash](http://cyan4973.github.io/xxHash/) algorithm, XXH64. This is a +high-quality hashing algorithm that is much faster than anything in the Go +standard library. + +This package provides a straightforward API: + +``` +func Sum64(b []byte) uint64 +func Sum64String(s string) uint64 +type Digest struct{ ... } + func New() *Digest +``` + +The `Digest` type implements hash.Hash64. Its key methods are: + +``` +func (*Digest) Write([]byte) (int, error) +func (*Digest) WriteString(string) (int, error) +func (*Digest) Sum64() uint64 +``` + +This implementation provides a fast pure-Go implementation and an even faster +assembly implementation for amd64. + +## Benchmarks + +Here are some quick benchmarks comparing the pure-Go and assembly +implementations of Sum64. + +| input size | purego | asm | +| --- | --- | --- | +| 5 B | 979.66 MB/s | 1291.17 MB/s | +| 100 B | 7475.26 MB/s | 7973.40 MB/s | +| 4 KB | 17573.46 MB/s | 17602.65 MB/s | +| 10 MB | 17131.46 MB/s | 17142.16 MB/s | + +These numbers were generated on Ubuntu 18.04 with an Intel i7-8700K CPU using +the following commands under Go 1.11.2: + +``` +$ go test -tags purego -benchtime 10s -bench '/xxhash,direct,bytes' +$ go test -benchtime 10s -bench '/xxhash,direct,bytes' +``` + +## Projects using this package + +- [InfluxDB](https://github.com/influxdata/influxdb) +- [Prometheus](https://github.com/prometheus/prometheus) +- [FreeCache](https://github.com/coocood/freecache) diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md b/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md new file mode 100644 index 000000000000..949b77e304e4 --- /dev/null +++ b/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md @@ -0,0 +1,40 @@ +# Windows Terminal Sequences + +This library allow for enabling Windows terminal color support for Go. + +See [Console Virtual Terminal Sequences](https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences) for details. + +## Usage + +```go +import ( + "syscall" + + sequences "github.com/konsorten/go-windows-terminal-sequences" +) + +func main() { + sequences.EnableVirtualTerminalProcessing(syscall.Stdout, true) +} + +``` + +## Authors + +The tool is sponsored by the [marvin + konsorten GmbH](http://www.konsorten.de). + +We thank all the authors who provided code to this library: + +* Felix Kollmann + +## License + +(The MIT License) + +Copyright (c) 2018 marvin + konsorten GmbH (open-source@konsorten.de) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod b/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod new file mode 100644 index 000000000000..716c6131256f --- /dev/null +++ b/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod @@ -0,0 +1 @@ +module github.com/konsorten/go-windows-terminal-sequences diff --git a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-alias/LICENSE b/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-alias/LICENSE deleted file mode 100644 index 6121943b10a6..000000000000 --- a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-alias/LICENSE +++ /dev/null @@ -1 +0,0 @@ -LICENSE placeholder. diff --git a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-no-requirements-yaml/LICENSE b/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-no-requirements-yaml/LICENSE deleted file mode 100644 index 6121943b10a6..000000000000 --- a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-no-requirements-yaml/LICENSE +++ /dev/null @@ -1 +0,0 @@ -LICENSE placeholder. diff --git a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-with-all-in-requirements-yaml/LICENSE b/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-with-all-in-requirements-yaml/LICENSE deleted file mode 100644 index 6121943b10a6..000000000000 --- a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-with-all-in-requirements-yaml/LICENSE +++ /dev/null @@ -1 +0,0 @@ -LICENSE placeholder. diff --git a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-with-mixed-requirements-yaml/LICENSE b/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-with-mixed-requirements-yaml/LICENSE deleted file mode 100644 index 6121943b10a6..000000000000 --- a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/dependent-chart-with-mixed-requirements-yaml/LICENSE +++ /dev/null @@ -1 +0,0 @@ -LICENSE placeholder. diff --git a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/frobnitz/LICENSE b/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/frobnitz/LICENSE deleted file mode 100644 index 6121943b10a6..000000000000 --- a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/frobnitz/LICENSE +++ /dev/null @@ -1 +0,0 @@ -LICENSE placeholder. diff --git a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/frobnitz_backslash/LICENSE b/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/frobnitz_backslash/LICENSE deleted file mode 100755 index 6121943b10a6..000000000000 --- a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/frobnitz_backslash/LICENSE +++ /dev/null @@ -1 +0,0 @@ -LICENSE placeholder. diff --git a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/joonix/charts/frobnitz b/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/joonix/charts/frobnitz deleted file mode 120000 index fde1b78ac5f3..000000000000 --- a/vendor/github.com/kubernetes/helm/pkg/chartutil/testdata/joonix/charts/frobnitz +++ /dev/null @@ -1 +0,0 @@ -../../frobnitz \ No newline at end of file diff --git a/vendor/github.com/kubernetes/helm/pkg/downloader/testdata/helmhome/repository/cache/local-index.yaml b/vendor/github.com/kubernetes/helm/pkg/downloader/testdata/helmhome/repository/cache/local-index.yaml deleted file mode 120000 index ed068e99e4db..000000000000 --- a/vendor/github.com/kubernetes/helm/pkg/downloader/testdata/helmhome/repository/cache/local-index.yaml +++ /dev/null @@ -1 +0,0 @@ -repository/local/index.yaml \ No newline at end of file diff --git a/vendor/github.com/kubernetes/helm/pkg/getter/testdata/repository/cache/local-index.yaml b/vendor/github.com/kubernetes/helm/pkg/getter/testdata/repository/cache/local-index.yaml deleted file mode 120000 index ed068e99e4db..000000000000 --- a/vendor/github.com/kubernetes/helm/pkg/getter/testdata/repository/cache/local-index.yaml +++ /dev/null @@ -1 +0,0 @@ -repository/local/index.yaml \ No newline at end of file diff --git a/vendor/github.com/labstack/echo/.gitattributes b/vendor/github.com/labstack/echo/.gitattributes new file mode 100644 index 000000000000..49b63e526945 --- /dev/null +++ b/vendor/github.com/labstack/echo/.gitattributes @@ -0,0 +1,20 @@ +# Automatically normalize line endings for all text-based files +# http://git-scm.com/docs/gitattributes#_end_of_line_conversion +* text=auto + +# For the following file types, normalize line endings to LF on checking and +# prevent conversion to CRLF when they are checked out (this is required in +# order to prevent newline related issues) +.* text eol=lf +*.go text eol=lf +*.yml text eol=lf +*.html text eol=lf +*.css text eol=lf +*.js text eol=lf +*.json text eol=lf +LICENSE text eol=lf + +# Exclude `website` and `cookbook` from GitHub's language statistics +# https://github.com/github/linguist#using-gitattributes +cookbook/* linguist-documentation +website/* linguist-documentation diff --git a/vendor/github.com/labstack/echo/.gitignore b/vendor/github.com/labstack/echo/.gitignore new file mode 100644 index 000000000000..dd74acca45d3 --- /dev/null +++ b/vendor/github.com/labstack/echo/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +coverage.txt +_test +vendor +.idea +*.iml +*.out diff --git a/vendor/github.com/labstack/echo/Gopkg.lock b/vendor/github.com/labstack/echo/Gopkg.lock new file mode 100644 index 000000000000..272aaa5248d6 --- /dev/null +++ b/vendor/github.com/labstack/echo/Gopkg.lock @@ -0,0 +1,75 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + name = "github.com/davecgh/go-spew" + packages = ["spew"] + revision = "346938d642f2ec3594ed81d874461961cd0faa76" + version = "v1.1.0" + +[[projects]] + name = "github.com/dgrijalva/jwt-go" + packages = ["."] + revision = "d2709f9f1f31ebcda9651b03077758c1f3a0018c" + version = "v3.0.0" + +[[projects]] + name = "github.com/labstack/gommon" + packages = ["bytes","color","log","random"] + revision = "1121fd3e243c202482226a7afe4dcd07ffc4139a" + version = "v0.2.1" + +[[projects]] + name = "github.com/mattn/go-colorable" + packages = ["."] + revision = "d228849504861217f796da67fae4f6e347643f15" + version = "v0.0.7" + +[[projects]] + name = "github.com/mattn/go-isatty" + packages = ["."] + revision = "fc9e8d8ef48496124e79ae0df75490096eccf6fe" + version = "v0.0.2" + +[[projects]] + name = "github.com/pmezard/go-difflib" + packages = ["difflib"] + revision = "792786c7400a136282c1664665ae0a8db921c6c2" + version = "v1.0.0" + +[[projects]] + name = "github.com/stretchr/testify" + packages = ["assert"] + revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0" + version = "v1.1.4" + +[[projects]] + branch = "master" + name = "github.com/valyala/bytebufferpool" + packages = ["."] + revision = "e746df99fe4a3986f4d4f79e13c1e0117ce9c2f7" + +[[projects]] + branch = "master" + name = "github.com/valyala/fasttemplate" + packages = ["."] + revision = "dcecefd839c4193db0d35b88ec65b4c12d360ab0" + +[[projects]] + branch = "master" + name = "golang.org/x/crypto" + packages = ["acme","acme/autocert"] + revision = "e1a4589e7d3ea14a3352255d04b6f1a418845e5e" + +[[projects]] + branch = "master" + name = "golang.org/x/sys" + packages = ["unix"] + revision = "b90f89a1e7a9c1f6b918820b3daa7f08488c8594" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "5f74a2a2ba5b07475ad0faa1b4c021b973ad40b2ae749e3d94e15fe839bb440e" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/vendor/github.com/labstack/echo/Gopkg.toml b/vendor/github.com/labstack/echo/Gopkg.toml new file mode 100644 index 000000000000..a24f61b94690 --- /dev/null +++ b/vendor/github.com/labstack/echo/Gopkg.toml @@ -0,0 +1,87 @@ + +## Gopkg.toml example (these lines may be deleted) + +## "metadata" defines metadata about the project that could be used by other independent +## systems. The metadata defined here will be ignored by dep. +# [metadata] +# key1 = "value that convey data to other systems" +# system1-data = "value that is used by a system" +# system2-data = "value that is used by another system" + +## "required" lists a set of packages (not projects) that must be included in +## Gopkg.lock. This list is merged with the set of packages imported by the current +## project. Use it when your project needs a package it doesn't explicitly import - +## including "main" packages. +# required = ["github.com/user/thing/cmd/thing"] + +## "ignored" lists a set of packages (not projects) that are ignored when +## dep statically analyzes source code. Ignored packages can be in this project, +## or in a dependency. +# ignored = ["github.com/user/project/badpkg"] + +## Constraints are rules for how directly imported projects +## may be incorporated into the depgraph. They are respected by +## dep whether coming from the Gopkg.toml of the current project or a dependency. +# [[constraint]] +## Required: the root import path of the project being constrained. +# name = "github.com/user/project" +# +## Recommended: the version constraint to enforce for the project. +## Only one of "branch", "version" or "revision" can be specified. +# version = "1.0.0" +# branch = "master" +# revision = "abc123" +# +## Optional: an alternate location (URL or import path) for the project's source. +# source = "https://github.com/myfork/package.git" +# +## "metadata" defines metadata about the dependency or override that could be used +## by other independent systems. The metadata defined here will be ignored by dep. +# [metadata] +# key1 = "value that convey data to other systems" +# system1-data = "value that is used by a system" +# system2-data = "value that is used by another system" + +## Overrides have the same structure as [[constraint]], but supersede all +## [[constraint]] declarations from all projects. Only [[override]] from +## the current project's are applied. +## +## Overrides are a sledgehammer. Use them only as a last resort. +# [[override]] +## Required: the root import path of the project being constrained. +# name = "github.com/user/project" +# +## Optional: specifying a version constraint override will cause all other +## constraints on this project to be ignored; only the overridden constraint +## need be satisfied. +## Again, only one of "branch", "version" or "revision" can be specified. +# version = "1.0.0" +# branch = "master" +# revision = "abc123" +# +## Optional: specifying an alternate source location as an override will +## enforce that the alternate location is used for that project, regardless of +## what source location any dependent projects specify. +# source = "https://github.com/myfork/package.git" + + + +[[constraint]] + name = "github.com/dgrijalva/jwt-go" + version = "3.0.0" + +[[constraint]] + name = "github.com/labstack/gommon" + version = "0.2.1" + +[[constraint]] + name = "github.com/stretchr/testify" + version = "1.1.4" + +[[constraint]] + branch = "master" + name = "github.com/valyala/fasttemplate" + +[[constraint]] + branch = "master" + name = "golang.org/x/crypto" diff --git a/vendor/github.com/labstack/echo/README.md b/vendor/github.com/labstack/echo/README.md new file mode 100644 index 000000000000..544fd0dd0b84 --- /dev/null +++ b/vendor/github.com/labstack/echo/README.md @@ -0,0 +1,62 @@ + + +[![Sourcegraph](https://sourcegraph.com/github.com/labstack/echo/-/badge.svg?style=flat-square)](https://sourcegraph.com/github.com/labstack/echo?badge) +[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/labstack/echo) +[![Go Report Card](https://goreportcard.com/badge/github.com/labstack/echo?style=flat-square)](https://goreportcard.com/report/github.com/labstack/echo) +[![Build Status](http://img.shields.io/travis/labstack/echo.svg?style=flat-square)](https://travis-ci.org/labstack/echo) +[![Codecov](https://img.shields.io/codecov/c/github/labstack/echo.svg?style=flat-square)](https://codecov.io/gh/labstack/echo) [![Forum](https://img.shields.io/badge/community-forum-00afd1.svg?style=flat-square)](https://forum.labstack.com) +[![Twitter](https://img.shields.io/badge/twitter-@labstack-55acee.svg?style=flat-square)](https://twitter.com/labstack) +[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/labstack/echo/master/LICENSE) + +## Feature Overview + +- Optimized HTTP router which smartly prioritize routes +- Build robust and scalable RESTful APIs +- Group APIs +- Extensible middleware framework +- Define middleware at root, group or route level +- Data binding for JSON, XML and form payload +- Handy functions to send variety of HTTP responses +- Centralized HTTP error handling +- Template rendering with any template engine +- Define your format for the logger +- Highly customizable +- Automatic TLS via Let’s Encrypt +- HTTP/2 support + +## Performance + +![Performance](https://i.imgur.com/F2V7TfO.png) + +## [Get Started](https://echo.labstack.com/guide) + +## Support Us + +- :star: the project +- [Donate](https://echo.labstack.com/support-echo) +- :earth_americas: spread the word +- [Contribute](#contribute) to the project + +## Contribute + +**Use issues for everything** + +- For a small change, just send a PR. +- For bigger changes open an issue for discussion before sending a PR. +- PR should have: + - Test case + - Documentation + - Example (If it makes sense) +- You can also contribute by: + - Reporting issues + - Suggesting new features or enhancements + - Improve/fix documentation + +## Credits +- [Vishal Rana](https://github.com/vishr) - Author +- [Nitin Rana](https://github.com/nr17) - Consultant +- [Contributors](https://github.com/labstack/echo/graphs/contributors) + +## License + +[MIT](https://github.com/labstack/echo/blob/master/LICENSE) diff --git a/vendor/github.com/labstack/gommon/color/README.md b/vendor/github.com/labstack/gommon/color/README.md new file mode 100644 index 000000000000..297c35186731 --- /dev/null +++ b/vendor/github.com/labstack/gommon/color/README.md @@ -0,0 +1,86 @@ +# Color + +Style terminal text. + +## Installation + +```sh +go get github.com/labstack/gommon/color +``` + +## Windows? + +Try [cmder](http://bliker.github.io/cmder) or https://github.com/mattn/go-colorable + +## [Usage](https://github.com/labstack/gommon/blob/master/color/color_test.go) + +```sh +import github.com/labstack/gommon/color +``` + +### Colored text + +```go +color.Println(color.Black("black")) +color.Println(color.Red("red")) +color.Println(color.Green("green")) +color.Println(color.Yellow("yellow")) +color.Println(color.Blue("blue")) +color.Println(color.Magenta("magenta")) +color.Println(color.Cyan("cyan")) +color.Println(color.White("white")) +color.Println(color.Grey("grey")) +``` +![Colored Text](http://i.imgur.com/8RtY1QR.png) + +### Colored background + +```go +color.Println(color.BlackBg("black background", color.Wht)) +color.Println(color.RedBg("red background")) +color.Println(color.GreenBg("green background")) +color.Println(color.YellowBg("yellow background")) +color.Println(color.BlueBg("blue background")) +color.Println(color.MagentaBg("magenta background")) +color.Println(color.CyanBg("cyan background")) +color.Println(color.WhiteBg("white background")) +``` +![Colored Background](http://i.imgur.com/SrrS6lw.png) + +### Emphasis + +```go +color.Println(color.Bold("bold")) +color.Println(color.Dim("dim")) +color.Println(color.Italic("italic")) +color.Println(color.Underline("underline")) +color.Println(color.Inverse("inverse")) +color.Println(color.Hidden("hidden")) +color.Println(color.Strikeout("strikeout")) +``` +![Emphasis](http://i.imgur.com/3RSJBbc.png) + +### Mix and match + +```go +color.Println(color.Green("bold green with white background", color.B, color.WhtBg)) +color.Println(color.Red("underline red", color.U)) +color.Println(color.Yellow("dim yellow", color.D)) +color.Println(color.Cyan("inverse cyan", color.In)) +color.Println(color.Blue("bold underline dim blue", color.B, color.U, color.D)) +``` +![Mix and match](http://i.imgur.com/jWGq9Ca.png) + +### Enable/Disable the package + +```go +color.Disable() +color.Enable() +``` + +### New instance + +```go +c := New() +c.Green("green") +``` diff --git a/vendor/github.com/labstack/gommon/log/README.md b/vendor/github.com/labstack/gommon/log/README.md new file mode 100644 index 000000000000..d5b9e9f09304 --- /dev/null +++ b/vendor/github.com/labstack/gommon/log/README.md @@ -0,0 +1,5 @@ +## WORK IN PROGRESS + +### Usage + +[log_test.go](log_test.go) diff --git a/vendor/github.com/manyminds/api2go/.gitignore b/vendor/github.com/manyminds/api2go/.gitignore new file mode 100644 index 000000000000..836562412fe8 --- /dev/null +++ b/vendor/github.com/manyminds/api2go/.gitignore @@ -0,0 +1,23 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test diff --git a/vendor/github.com/manyminds/api2go/README.md b/vendor/github.com/manyminds/api2go/README.md new file mode 100644 index 000000000000..105c655ed1a5 --- /dev/null +++ b/vendor/github.com/manyminds/api2go/README.md @@ -0,0 +1,673 @@ +# api2go + +[![Join the chat at https://gitter.im/manyminds/api2go](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/manyminds/api2go?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![GoDoc](https://godoc.org/github.com/manyminds/api2go?status.svg)](https://godoc.org/github.com/manyminds/api2go) +[![Build Status](https://travis-ci.org/manyminds/api2go.svg?branch=master)](https://travis-ci.org/manyminds/api2go) +[![Coverage Status](https://coveralls.io/repos/github/manyminds/api2go/badge.svg?branch=master)](https://coveralls.io/github/manyminds/api2go?branch=master) +[![Go Report Card](https://goreportcard.com/badge/manyminds/api2go)](https://goreportcard.com/report/manyminds/api2go) + +A [JSON API](http://jsonapi.org) Implementation for Go, to be used e.g. as server for [Ember Data](https://github.com/emberjs/data). + +## TOC +- [Installation](#installation) +- [Basic functionality](#basic-functionality) +- [Examples](#examples) +- [Interfaces to implement](#interfaces-to-implement) + - [Responder](#responder) + - [EntityNamer](#entitynamer) + - [MarshalIdentifier](#marshalidentifier) + - [UnmarshalIdentifier](#unmarshalidentifier) + - [Marshalling with References to other structs](#marshalling-with-references-to-other-structs) + - [Unmarshalling with references to other structs](#unmarshalling-with-references-to-other-structs) +- [Manual marshalling / unmarshalling](#manual-marshalling--unmarshalling) +- [SQL Null-Types](#sql-null-types) +- [Using api2go with the gin framework](#using-api2go-with-the-gin-framework) +- [Building a REST API](#building-a-rest-api) + - [Query Params](#query-params) + - [Using Pagination](#using-pagination) + - [Fetching related IDs](#fetching-related-ids) + - [Fetching related resources](#fetching-related-resources) + - [Using middleware](#using-middleware) + - [Dynamic URL Handling](#dynamic-url-handling) +- [Tests](#tests) + +# Installation + +For the complete api2go package use: +```go +go get github.com/manyminds/api2go +``` + +If you only need marshalling and/or unmarshalling: +``` +go get github.com/manyminds/api2go/jsonapi +``` + +## Basic functionality +Api2go will Marshal/Unmarshal exactly like the internal `json` package from Go +with one addition: It will decorate the Marshalled json with jsonapi meta +objects. Jsonapi wraps the payload inside an `attributes` object. The rest is +just Meta-Data which will be generated by api2go. + +So let's take this basic example: + +```go +type Article struct { + ID string + Title string `json:"title"` +} +``` + +Would `json.Marshal` into this Json: + +```json +{ + "ID": "Some-ID", + "title": "the title" +} +``` + +For api2go, you have to ignore tag the `ID` field and then the result could be +something like this: + +```json +{ + "type": "articles", + "id": "1", + "attributes": { + "title": "Rails is Omakase" + }, + "relationships": { + "author": { + "links": { + "self": "/articles/1/relationships/author", + "related": "/articles/1/author" + }, + "data": { "type": "people", "id": "9" } + } + } +} +``` + +All the additional information is retrieved by implementing some interfaces. + +## Examples + +- Basic Examples can be found [here](https://github.com/manyminds/api2go/blob/master/examples/crud_example.go). +- For a more real life example implementation of api2go using [jinzhu/gorm](https://github.com/jinzhu/gorm) and [gin-gonic/gin](https://github.com/gin-gonic/gin) you can have a look at hnakamur's [repository](https://github.com/hnakamur/api2go-gorm-gin-crud-example) + +## Interfaces to implement +For the following query and result examples, imagine the following 2 structs which represent a posts and +comments that belong with a has-many relation to the post. + +```go +type Post struct { + ID int `json:"-"` // Ignore ID field because the ID is fetched via the + // GetID() method and must not be inside the attributes object. + Title string `json:"title"` + Comments []Comment `json:"-"` // this will be ignored by the api2go marshaller + CommentsIDs []int `json:"-"` // it's only useful for our internal relationship handling +} + +type Comment struct { + ID int `json:"-"` + Text string `json:"text"` +} +``` + +You must at least implement the [MarshalIdentifier](#marshalidentifier) interface, which is the one for marshalling/unmarshalling the primary `ID` of the struct +that you want to marshal/unmarshal. This is because of the huge variety of types that you could use for the primary ID. For example a string, +a UUID or a BSON Object for MongoDB etc... + +In the Post example struct, the `ID` field is ignored because api2go will use the `GetID` method that you implemented +for your struct to fetch the ID of the struct. +Every field inside a struct will be marshalled into the `attributes` object in +the json. In our example, we just want to have the `Title` field there. + +Don't forget to name all your fields with the `json:"yourName"` tag. + +### Responder +```go +type Responder interface { + Metadata() map[string]interface{} + Result() interface{} + StatusCode() int +} +``` + +The Responder interface must be implemented if you are using our API. It +contains everything that is needed for a response. You can see an example usage +of it in our example project. + +### EntityNamer +```go +type EntityNamer interface { + GetName() string +} +``` + +EntityNamer is an optional interface. Normally, the name of +a struct will be automatically generated in its plural form. For example if +your struct has the type `Post`, its generated name is `posts`. And the url +for the GET request for post with ID 1 would be `/posts/1`. + +If you implement the `GetName()` method and it returns `special-posts`, then +this would be the name in the `type` field of the generated json and also the +name for the generated routes. + +Currently, you must implement this interface, if you have a struct type that +consists of multiple words and you want to use a **hyphenized** name. For example `UnicornPost`. +Our default Jsonifier would then generate the name `unicornPosts`. But if you +want the [recommended](http://jsonapi.org/recommendations/#naming) name, you +have to implement `GetName` + +```go +func (s UnicornPost) GetName() string { + return "unicorn-posts" +} +``` + +### MarshalIdentifier +```go +type MarshalIdentifier interface { + GetID() string +} +``` + +Implement this interface to marshal a struct. + +### UnmarshalIdentifier +```go +type UnmarshalIdentifier interface { + SetID(string) error +} +``` + +This is the corresponding interface to MarshalIdentifier. Implement this interface in order to unmarshal incoming json into +a struct. + +### Marshalling with References to other structs +For relationships to work, there are 3 Interfaces that you can use: + +```go +type MarshalReferences interface { + GetReferences() []Reference +} + +// MarshalLinkedRelations must be implemented if there are references and the reference IDs should be included +type MarshalLinkedRelations interface { + MarshalReferences + MarshalIdentifier + GetReferencedIDs() []ReferenceID +} + +// MarshalIncludedRelations must be implemented if referenced structs should be included +type MarshalIncludedRelations interface { + MarshalReferences + MarshalIdentifier + GetReferencedStructs() []MarshalIdentifier +} +``` + +Implementing those interfaces is not mandatory and depends on your use cases. If your API has any relationships, +you must at least implement `MarshalReferences` and `MarshalLinkedRelations`. + +`MarshalReferences` must be implemented in order for api2go to know which relations are possible for your struct. + +`MarshalLinkedRelations` must be implemented to retrieve the `IDs` of the relations that are connected to this struct. This method +could also return an empty array, if there are currently no relations. This is why there is the `MarshalReferences` interface, so that api2go +knows what is possible, even if nothing is referenced at the time. + +In addition to that, you can implement `MarshalIncludedRelations` which exports the complete referenced structs and embeds them in the json +result inside the `included` object. + +**That way you can choose how you internally manage relations.** So, there are no limits regarding the use of ORMs. + +### Unmarshalling with references to other structs +Incoming jsons can also contain reference IDs. In order to unmarshal them correctly, you have to implement the following interfaces. If you only have to-one +relationships, the `UnmarshalToOneRelations` interface is enough. + +```go +// UnmarshalToOneRelations must be implemented to unmarshal to-one relations +type UnmarshalToOneRelations interface { + SetToOneReferenceID(name, ID string) error +} + +// UnmarshalToManyRelations must be implemented to unmarshal to-many relations +type UnmarshalToManyRelations interface { + SetToManyReferenceIDs(name string, IDs []string) error +} +``` + +**If you need to know more about how to use the interfaces, look at our tests or at the example project.** + +## Manual marshalling / unmarshalling +Please keep in mind that this only works if you implemented the previously mentioned interfaces. Manual marshalling and +unmarshalling makes sense, if you do not want to use our API that automatically generates all the necessary routes for you. You +can directly use our sub-package `github.com/manyminds/api2go/jsonapi` + +```go +comment1 = Comment{ID: 1, Text: "First!"} +comment2 = Comment{ID: 2, Text: "Second!"} +post = Post{ID: 1, Title: "Foobar", Comments: []Comment{comment1, comment2}} + +json, err := jsonapi.Marshal(post) +``` + +will yield + +```json +{ + "data": [ + { + "id": "1", + "type": "posts", + "attributes": { + "title": "Foobar" + }, + "relationships": { + "comments": { + "data": [ + { + "id": "1", + "type": "comments" + }, + { + "id": "2", + "type": "comments" + } + ] + } + } + } + ], + "included": [ + { + "id": "1", + "type": "comments", + "attributes": { + "text": "First!" + } + }, + { + "id": "2", + "type": "comments", + "attributes": { + "text": "Second!" + } + } + ] +} +``` + +You can also use `jsonapi.MarshalWithURLs` to automatically generate URLs for the rest endpoints that have a +version and BaseURL prefix. This will generate the same routes that our API uses. This adds `self` and `related` fields +for relations inside the `relationships` object. + +Recover the structure from above using. Keep in mind that Unmarshalling with +included structs does not work yet. So Api2go cannot be used as a client yet. + +```go +var posts []Post +err := jsonapi.Unmarshal(json, &posts) +// posts[0] == Post{ID: 1, Title: "Foobar", CommentsIDs: []int{1, 2}} +``` +## SQL Null-Types +When using a SQL Database it is most likely you want to use the special SQL-Types from the `database/sql` package. These are + +- sql.NullBool +- sql.NullFloat64 +- sql.NullInt64 +- sql.NullString + +The Problem is, that they internally manage the `null` value behavior by using a custom struct. In order to Marshal und Unmarshal +these values, it is required to implement the `json.Marshaller` and `json.Unmarshaller` interfaces of the go standard library. + +But you dont have to do this by yourself! There already is a library that did the work for you. We recommend that you use the types +of this library: http://gopkg.in/guregu/null.v2/zero + +In order to use omitempty with those types, you need to specify them as pointers in your struct. + +## Using api2go with the gin framework + +If you want to use api2go with [gin](https://github.com/gin-gonic/gin) you need to use a different router than the default one. +Get the according adapter using: + +```go get -tags=gingonic github.com/manyminds/api2go``` + +Currently the supported tags are: `gingonic`,`gorillamux`, or `echo`. + +After that you can bootstrap api2go the following way: +```go + import ( + "github.com/gin-gonic/gin" + "github.com/manyminds/api2go" + "github.com/manyminds/api2go/routing" + "github.com/manyminds/api2go/examples/model" + "github.com/manyminds/api2go/examples/resource" + "github.com/manyminds/api2go/examples/storage" + ) + + func main() { + r := gin.Default() + api := api2go.NewAPIWithRouting( + "api", + api2go.NewStaticResolver("/"), + routing.Gin(r), + ) + + userStorage := storage.NewUserStorage() + chocStorage := storage.NewChocolateStorage() + api.AddResource(model.User{}, resource.UserResource{ChocStorage: chocStorage, UserStorage: userStorage}) + api.AddResource(model.Chocolate{}, resource.ChocolateResource{ChocStorage: chocStorage, UserStorage: userStorage}) + + r.GET("/ping", func(c *gin.Context) { + c.String(200, "pong") + }) + r.Run(":8080") + } +``` + +Keep in mind that you absolutely should map api2go under its own namespace to not get conflicts with your normal routes. + +If you need api2go with any different go framework, just send a PR with the according adapter :-) + +## Building a REST API + +First, write an implementation of either `api2go.ResourceGetter`, `api2go.ResourceCreator`, `api2go.ResourceUpdater`, `api2go.ResourceDeleter`, or any combination of them. +You can also write an implementation the `CRUD` interface which embed all of them. +You have to implement at least one of these 4 methods: + +```go +type fixtureSource struct {} + +// FindOne returns an object by its ID +// Possible success status code 200 +func (s *fixtureSource) FindOne(ID string, r api2go.Request) (Responder, error) {} + +// Create a new object. Newly created object/struct must be in Responder. +// Possible status codes are: +// - 201 Created: Resource was created and needs to be returned +// - 202 Accepted: Processing is delayed, return nothing +// - 204 No Content: Resource created with a client generated ID, and no fields were modified by +// the server +func (s *fixtureSource) Create(obj interface{}, r api2go.Request) (Responder, err error) {} + +// Delete an object +// Possible status codes are: +// - 200 OK: Deletion was a success, returns meta information, currently not implemented! Do not use this +// - 202 Accepted: Processing is delayed, return nothing +// - 204 No Content: Deletion was successful, return nothing +func (s *fixtureSource) Delete(id string, r api2go.Request) (Responder, err error) {} + +// Update an object +// Possible status codes are: +// - 200 OK: Update successful, however some field(s) were changed, returns updates source +// - 202 Accepted: Processing is delayed, return nothing +// - 204 No Content: Update was successful, no fields were changed by the server, return nothing +func (s *fixtureSource) Update(obj interface{}, r api2go.Request) (Responder, err error) {} +``` + +If you want to return a jsonapi compatible error because something went wrong inside the CRUD methods, you can use our +`HTTPError` struct, which can be created with `NewHTTPError`. This allows you to set the error status code and add +as many information about the error as you like. See: [jsonapi error](http://jsonapi.org/format/#errors) + +To fetch all objects of a specific resource you can choose to implement one or both of the following +interfaces: + +```go +type FindAll interface { + // FindAll returns all objects + FindAll(req Request) (Responder, error) +} + +type PaginatedFindAll interface { + PaginatedFindAll(req Request) (totalCount uint, response Responder, err error) +} +``` + +`FindAll` returns everything. You could limit the results only by using Query Params which are described [here](#query-params) + +`PaginatedFindAll` can also use Query Params, but in addition to that it does not need to send all objects at once and can split +up the result with pagination. You have to return the total number of found objects in order to let our API automatically generate +pagination links. More about pagination is described [here](#using-pagination) + +You can then create an API: + +```go +api := api2go.NewAPI("v1") +api.AddResource(Post{}, &PostsSource{}) +http.ListenAndServe(":8080", api.Handler()) +``` + +Instead of `api2go.NewAPI` you can also use `api2go.NewAPIWithBaseURL("v1", "http://yourdomain.com")` to prefix all +automatically generated routes with your domain and protocoll. + +This generates the standard endpoints: + +``` +OPTIONS /v1/posts +OPTIONS /v1/posts/ +GET /v1/posts +POST /v1/posts +GET /v1/posts/ +PATCH /v1/posts/ +DELETE /v1/posts/ +GET /v1/posts//comments // fetch referenced comments of a post +GET /v1/posts//relationships/comments // fetch IDs of the referenced comments only +PATCH /v1/posts//relationships/comments // replace all related comments + +// These 2 routes are only created for to-many relations that implement EditToManyRelations interface +POST /v1/posts//relationships/comments // Add a new comment reference, only for to-many relations +DELETE /v1/posts//relationships/comments // Delete a comment reference, only for to-many relations +``` + +For the last two generated routes, it is necessary to implement the `jsonapi.EditToManyRelations` interface. + +```go +type EditToManyRelations interface { + AddToManyIDs(name string, IDs []string) error + DeleteToManyIDs(name string, IDs []string) error +} +``` + +All PATCH, POST and DELETE routes do a `FindOne` and update the values/relations in the previously found struct. This +struct will then be passed on to the `Update` method of a resource struct. So you get all these routes "for free" and just +have to implement the `ResourceUpdater` `Update` method. + +### Query Params +To support all the features mentioned in the `Fetching Resources` section of Jsonapi: +http://jsonapi.org/format/#fetching + +If you want to support any parameters mentioned there, you can access them in your Resource +via the `api2go.Request` Parameter. This currently supports `QueryParams` which holds +all query parameters as `map[string][]string` unfiltered. So you can use it for: + * Filtering + * Inclusion of Linked Resources + * Sparse Fieldsets + * Sorting + * Aything else you want to do that is not in the official Jsonapi Spec + +```go +type fixtureSource struct {} + +func (s *fixtureSource) FindAll(req api2go.Request) (Responder, error) { + for key, values range req.QueryParams { + ... + } + ... +} +``` + +If there are multiple values, you have to separate them with a comma. api2go automatically +slices the values for you. + +``` +Example Request +GET /people?fields=id,name,age + +req.QueryParams["fields"] contains values: ["id", "name", "age"] +``` + +### Using Pagination +Api2go can automatically generate the required links for pagination. Currently there are 2 combinations of query +parameters supported: + +- page[number], page[size] +- page[offset], page[limit] + +Pagination is optional. If you want to support pagination, you have to implement the `PaginatedFindAll` method +in you resource struct. For an example, you best look into our example project. + +Example request + +``` +GET /v0/users?page[number]=2&page[size]=2 +``` + +would return a json with the top level links object + +```json +{ + "links": { + "first": "http://localhost:31415/v0/users?page[number]=1&page[size]=2", + "last": "http://localhost:31415/v0/users?page[number]=5&page[size]=2", + "next": "http://localhost:31415/v0/users?page[number]=3&page[size]=2", + "prev": "http://localhost:31415/v0/users?page[number]=1&page[size]=2" + }, + "data": [...] +} +``` + +### Fetching related IDs +The IDs of a relationship can be fetched by following the `self` link of a relationship object in the `links` object +of a result. For the posts and comments example you could use the following generated URL: + +``` +GET /v1/posts/1/relationships/comments +``` + +This would return all comments that are currently referenced by post with ID 1. For example: + +```json +{ + "links": { + "self": "/v1/posts/1/relationships/comments", + "related": "/v1/posts/1/comments" + }, + "data": [ + { + "type": "comments", + "id": "1" + }, + { + "type":"comments", + "id": "2" + } + ] +} +``` + +### Fetching related resources +Api2go always creates a `related` field for elements in the `relationships` object of the result. This is like it's +specified on jsonapi.org. Post example: + +```json +{ + "data": [ + { + "id": "1", + "type": "posts", + "title": "Foobar", + "relationships": { + "comments": { + "links": { + "related": "/v1/posts/1/comments", + "self": "/v1/posts/1/relationships/comments" + }, + "data": [ + { + "id": "1", + "type": "comments" + }, + { + "id": "2", + "type": "comments" + } + ] + } + } + } + ] +} +``` + +If a client requests this `related` url, the `FindAll` method of the comments resource will be called with a query +parameter `postsID`. + +So if you implement the `FindAll` method, do not forget to check for all possible query Parameters. This means you have +to check all your other structs and if it references the one for that you are implementing `FindAll`, check for the +query Paramter and only return comments that belong to it. In this example, return the comments for the Post. + +### Using middleware +We provide a custom `APIContext` with +a [context](https://godoc.org/context) implementation that you +can use if you for example need to check if a user is properly authenticated +before a request reaches the api2go routes. + +You can either use our struct or implement your own with the `APIContexter` +interface + +```go +type APIContexter interface { + context.Context + Set(key string, value interface{}) + Get(key string) (interface{}, bool) + Reset() +} +``` + +If you implemented your own `APIContexter`, don't forget to define +a `APIContextAllocatorFunc` and set it with `func (api *API) SetContextAllocator(allocator APIContextAllocatorFunc)` + +But in most cases, this is not needed. + +To use a middleware, it is needed to implement our +`type HandlerFunc func(APIContexter, http.ResponseWriter, *http.Request)`. A `HandlerFunc` can then be +registered with `func (api *API) UseMiddleware(middleware ...HandlerFunc)`. You can either pass one or many middlewares +that will be executed in order before any other api2go routes. Use this to set up database connections, user authentication +and so on. + +### Dynamic URL handling +If you have different TLDs for one api, or want to use different domains in development and production, you can implement a custom +URLResolver in api2go. + +There is a simple interface, which can be used if you get TLD information from the database, the server environment, or anything else +that's not request dependant: +```go +type URLResolver interface { + GetBaseURL() string +} +``` +And a more complex one that also gets request information: +```go +type RequestAwareURLResolver interface { + URLResolver + SetRequest(http.Request) +} +``` + +For most use cases we provide a CallbackResolver which works on a per request basis and may fill +your basic needs. This is particulary useful if you are using an nginx proxy which sets `X-Forwarded-For` headers. + +```go +resolver := NewCallbackResolver(func(r http.Request) string{}) +api := NewApiWithMarshalling("v1", resolver, marshalers) +``` +## Tests + +```sh +go test ./... +ginkgo -r # Alternative +ginkgo watch -r -notify # Watch for changes +``` diff --git a/vendor/github.com/manyminds/api2go/jsonapi/Readme.md b/vendor/github.com/manyminds/api2go/jsonapi/Readme.md new file mode 100644 index 000000000000..1cd577fd9b87 --- /dev/null +++ b/vendor/github.com/manyminds/api2go/jsonapi/Readme.md @@ -0,0 +1,14 @@ +# api2go JSONAPI package + +This package contains [JSON API](http://jsonapi.org) compatible +marshal und unmarshal functionality. + +``` + go get github.com/manyminds/api2go/jsonapi +``` + +## Usage + +For information on how to use this package, please refer to the +documentation on the [api2go](https://github.com/manyminds/api2go) main project, +the integration_test.go or the [godoc](http://godoc.org/github.com/manyminds/api2go/jsonapi). diff --git a/vendor/github.com/mattn/go-colorable/README.md b/vendor/github.com/mattn/go-colorable/README.md new file mode 100644 index 000000000000..56729a92ca62 --- /dev/null +++ b/vendor/github.com/mattn/go-colorable/README.md @@ -0,0 +1,48 @@ +# go-colorable + +[![Godoc Reference](https://godoc.org/github.com/mattn/go-colorable?status.svg)](http://godoc.org/github.com/mattn/go-colorable) +[![Build Status](https://travis-ci.org/mattn/go-colorable.svg?branch=master)](https://travis-ci.org/mattn/go-colorable) +[![Coverage Status](https://coveralls.io/repos/github/mattn/go-colorable/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-colorable?branch=master) +[![Go Report Card](https://goreportcard.com/badge/mattn/go-colorable)](https://goreportcard.com/report/mattn/go-colorable) + +Colorable writer for windows. + +For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.) +This package is possible to handle escape sequence for ansi color on windows. + +## Too Bad! + +![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/bad.png) + + +## So Good! + +![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/good.png) + +## Usage + +```go +logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true}) +logrus.SetOutput(colorable.NewColorableStdout()) + +logrus.Info("succeeded") +logrus.Warn("not correct") +logrus.Error("something error") +logrus.Fatal("panic") +``` + +You can compile above code on non-windows OSs. + +## Installation + +``` +$ go get github.com/mattn/go-colorable +``` + +# License + +MIT + +# Author + +Yasuhiro Matsumoto (a.k.a mattn) diff --git a/vendor/github.com/mattn/go-isatty/README.md b/vendor/github.com/mattn/go-isatty/README.md new file mode 100644 index 000000000000..1e69004bb039 --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/README.md @@ -0,0 +1,50 @@ +# go-isatty + +[![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) +[![Build Status](https://travis-ci.org/mattn/go-isatty.svg?branch=master)](https://travis-ci.org/mattn/go-isatty) +[![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) +[![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) + +isatty for golang + +## Usage + +```go +package main + +import ( + "fmt" + "github.com/mattn/go-isatty" + "os" +) + +func main() { + if isatty.IsTerminal(os.Stdout.Fd()) { + fmt.Println("Is Terminal") + } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { + fmt.Println("Is Cygwin/MSYS2 Terminal") + } else { + fmt.Println("Is Not Terminal") + } +} +``` + +## Installation + +``` +$ go get github.com/mattn/go-isatty +``` + +## License + +MIT + +## Author + +Yasuhiro Matsumoto (a.k.a mattn) + +## Thanks + +* k-takata: base idea for IsCygwinTerminal + + https://github.com/k-takata/go-iscygpty diff --git a/vendor/github.com/mitchellh/mapstructure/README.md b/vendor/github.com/mitchellh/mapstructure/README.md new file mode 100644 index 000000000000..0018dc7d9f94 --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/README.md @@ -0,0 +1,46 @@ +# mapstructure [![Godoc](https://godoc.org/github.com/mitchellh/mapstructure?status.svg)](https://godoc.org/github.com/mitchellh/mapstructure) + +mapstructure is a Go library for decoding generic map values to structures +and vice versa, while providing helpful error handling. + +This library is most useful when decoding values from some data stream (JSON, +Gob, etc.) where you don't _quite_ know the structure of the underlying data +until you read a part of it. You can therefore read a `map[string]interface{}` +and use this library to decode it into the proper underlying native Go +structure. + +## Installation + +Standard `go get`: + +``` +$ go get github.com/mitchellh/mapstructure +``` + +## Usage & Example + +For usage and examples see the [Godoc](http://godoc.org/github.com/mitchellh/mapstructure). + +The `Decode` function has examples associated with it there. + +## But Why?! + +Go offers fantastic standard libraries for decoding formats such as JSON. +The standard method is to have a struct pre-created, and populate that struct +from the bytes of the encoded format. This is great, but the problem is if +you have configuration or an encoding that changes slightly depending on +specific fields. For example, consider this JSON: + +```json +{ + "type": "person", + "name": "Mitchell" +} +``` + +Perhaps we can't populate a specific structure without first reading +the "type" field from the JSON. We could always do two passes over the +decoding of the JSON (reading the "type" first, and the rest later). +However, it is much simpler to just decode this into a `map[string]interface{}` +structure, read the "type" key, then use something like this library +to decode it into the proper structure. diff --git a/vendor/github.com/nu7hatch/gouuid/.gitignore b/vendor/github.com/nu7hatch/gouuid/.gitignore new file mode 100644 index 000000000000..f9d9cd8abe0d --- /dev/null +++ b/vendor/github.com/nu7hatch/gouuid/.gitignore @@ -0,0 +1,11 @@ +_obj +_test +*.6 +*.out +_testmain.go +\#* +.\#* +*.log +_cgo* +*.o +*.a diff --git a/vendor/github.com/nu7hatch/gouuid/README.md b/vendor/github.com/nu7hatch/gouuid/README.md new file mode 100644 index 000000000000..e3d025d5e5b6 --- /dev/null +++ b/vendor/github.com/nu7hatch/gouuid/README.md @@ -0,0 +1,21 @@ +# Pure Go UUID implementation + +This package provides immutable UUID structs and the functions +NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 +and 5 UUIDs as specified in [RFC 4122](http://www.ietf.org/rfc/rfc4122.txt). + +## Installation + +Use the `go` tool: + + $ go get github.com/nu7hatch/gouuid + +## Usage + +See [documentation and examples](http://godoc.org/github.com/nu7hatch/gouuid) +for more information. + +## Copyright + +Copyright (C) 2011 by Krzysztof Kowalik . See [COPYING](https://github.com/nu7hatch/gouuid/tree/master/COPYING) +file for details. diff --git a/vendor/github.com/oxtoacart/bpool/README.md b/vendor/github.com/oxtoacart/bpool/README.md new file mode 100644 index 000000000000..9acf3f928a5f --- /dev/null +++ b/vendor/github.com/oxtoacart/bpool/README.md @@ -0,0 +1,65 @@ +# bpool [![GoDoc](https://godoc.org/github.com/oxtoacart/bpool?status.png)](https://godoc.org/github.com/oxtoacart/bpool) + +Package bpool implements leaky pools of byte arrays and Buffers as bounded channels. +It is based on the leaky buffer example from the Effective Go documentation: http://golang.org/doc/effective_go.html#leaky_buffer + +bpool provides the following pool types: + +* [bpool.BufferPool](https://godoc.org/github.com/oxtoacart/bpool#BufferPool) + which provides a fixed-size pool of + [bytes.Buffers](http://golang.org/pkg/bytes/#Buffer). +* [bpool.BytePool](https://godoc.org/github.com/oxtoacart/bpool#BytePool) which + provides a fixed-size pool of `[]byte` slices with a pre-set width (length). +* [bpool.SizedBufferPool](https://godoc.org/github.com/oxtoacart/bpool#SizedBufferPool), + which is an alternative to `bpool.BufferPool` that pre-sizes the capacity of + buffers issued from the pool and discards buffers that have grown too large + upon return. + +A common use case for this package is to use buffers to execute HTML templates +against (via ExecuteTemplate) or encode JSON into (via json.NewEncoder). This +allows you to catch any rendering or marshalling errors prior to writing to a +`http.ResponseWriter`, which helps to avoid writing incomplete or malformed data +to the response. + +## Install + +`go get github.com/oxtoacart/bpool` + +## Documentation + +See [godoc.org](http://godoc.org/github.com/oxtoacart/bpool) or use `godoc github.com/oxtoacart/bpool` + +## Example + +Here's a quick example for using `bpool.BufferPool`. We create a pool of the +desired size, call the `Get()` method to obtain a buffer for use, and call +`Put(buf)` to return the buffer to the pool. + +```go + +var bufpool *bpool.BufferPool + +func main() { + + bufpool = bpool.NewBufferPool(48) + +} + +func someFunction() error { + + // Get a buffer from the pool + buf := bufpool.Get() + ... + ... + ... + // Return the buffer to the pool + bufpool.Put(buf) + + return nil +} +``` + +## License + +Apache 2.0 Licensed. See the LICENSE file for details. + diff --git a/vendor/github.com/pierrec/lz4/.gitignore b/vendor/github.com/pierrec/lz4/.gitignore new file mode 100644 index 000000000000..c2bb6e4af122 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/.gitignore @@ -0,0 +1,31 @@ +# Created by https://www.gitignore.io/api/macos + +### macOS ### +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# End of https://www.gitignore.io/api/macos diff --git a/vendor/github.com/pierrec/lz4/README.md b/vendor/github.com/pierrec/lz4/README.md new file mode 100644 index 000000000000..dd3c9d47e18b --- /dev/null +++ b/vendor/github.com/pierrec/lz4/README.md @@ -0,0 +1,31 @@ +[![godoc](https://godoc.org/github.com/pierrec/lz4?status.png)](https://godoc.org/github.com/pierrec/lz4) +[![Build Status](https://travis-ci.org/pierrec/lz4.svg?branch=master)](https://travis-ci.org/pierrec/lz4) + +# lz4 +LZ4 compression and decompression in pure Go + +## Usage + +```go +import "github.com/pierrec/lz4" +``` + +## Description + +Package lz4 implements reading and writing lz4 compressed data (a frame), +as specified in http://fastcompression.blogspot.fr/2013/04/lz4-streaming-format-final.html, +using an io.Reader (decompression) and io.Writer (compression). +It is designed to minimize memory usage while maximizing throughput by being able to +[de]compress data concurrently. + +The Reader and the Writer support concurrent processing provided the supplied buffers are +large enough (in multiples of BlockMaxSize) and there is no block dependency. +Reader.WriteTo and Writer.ReadFrom do leverage the concurrency transparently. +The runtime.GOMAXPROCS() value is used to apply concurrency or not. + +Although the block level compression and decompression functions are exposed and are fully compatible +with the lz4 block format definition, they are low level and should not be used directly. +For a complete description of an lz4 compressed block, see: +http://fastcompression.blogspot.fr/2011/05/lz4-explained.html + +See https://github.com/Cyan4973/lz4 for the reference C implementation. diff --git a/vendor/github.com/pkg/errors/.gitignore b/vendor/github.com/pkg/errors/.gitignore new file mode 100644 index 000000000000..daf913b1b347 --- /dev/null +++ b/vendor/github.com/pkg/errors/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/vendor/github.com/pkg/errors/README.md b/vendor/github.com/pkg/errors/README.md new file mode 100644 index 000000000000..273db3c98aea --- /dev/null +++ b/vendor/github.com/pkg/errors/README.md @@ -0,0 +1,52 @@ +# errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/b98mptawhudj53ep/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/errors/branch/master) [![GoDoc](https://godoc.org/github.com/pkg/errors?status.svg)](http://godoc.org/github.com/pkg/errors) [![Report card](https://goreportcard.com/badge/github.com/pkg/errors)](https://goreportcard.com/report/github.com/pkg/errors) + +Package errors provides simple error handling primitives. + +`go get github.com/pkg/errors` + +The traditional error handling idiom in Go is roughly akin to +```go +if err != nil { + return err +} +``` +which applied recursively up the call stack results in error reports without context or debugging information. The errors package allows programmers to add context to the failure path in their code in a way that does not destroy the original value of the error. + +## Adding context to an error + +The errors.Wrap function returns a new error that adds context to the original error. For example +```go +_, err := ioutil.ReadAll(r) +if err != nil { + return errors.Wrap(err, "read failed") +} +``` +## Retrieving the cause of an error + +Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to reverse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`. +```go +type causer interface { + Cause() error +} +``` +`errors.Cause` will recursively retrieve the topmost error which does not implement `causer`, which is assumed to be the original cause. For example: +```go +switch err := errors.Cause(err).(type) { +case *MyError: + // handle specifically +default: + // unknown error +} +``` + +[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors). + +## Contributing + +We welcome pull requests, bug fixes and issue reports. With that said, the bar for adding new symbols to this package is intentionally set high. + +Before proposing a change, please discuss your change by raising an issue. + +## Licence + +BSD-2-Clause diff --git a/vendor/github.com/rcrowley/go-metrics/.gitignore b/vendor/github.com/rcrowley/go-metrics/.gitignore new file mode 100644 index 000000000000..83c8f82374a2 --- /dev/null +++ b/vendor/github.com/rcrowley/go-metrics/.gitignore @@ -0,0 +1,9 @@ +*.[68] +*.a +*.out +*.swp +_obj +_testmain.go +cmd/metrics-bench/metrics-bench +cmd/metrics-example/metrics-example +cmd/never-read/never-read diff --git a/vendor/github.com/rcrowley/go-metrics/README.md b/vendor/github.com/rcrowley/go-metrics/README.md new file mode 100644 index 000000000000..b7356b5fc1f7 --- /dev/null +++ b/vendor/github.com/rcrowley/go-metrics/README.md @@ -0,0 +1,168 @@ +go-metrics +========== + +![travis build status](https://travis-ci.org/rcrowley/go-metrics.svg?branch=master) + +Go port of Coda Hale's Metrics library: . + +Documentation: . + +Usage +----- + +Create and update metrics: + +```go +c := metrics.NewCounter() +metrics.Register("foo", c) +c.Inc(47) + +g := metrics.NewGauge() +metrics.Register("bar", g) +g.Update(47) + +r := NewRegistry() +g := metrics.NewRegisteredFunctionalGauge("cache-evictions", r, func() int64 { return cache.getEvictionsCount() }) + +s := metrics.NewExpDecaySample(1028, 0.015) // or metrics.NewUniformSample(1028) +h := metrics.NewHistogram(s) +metrics.Register("baz", h) +h.Update(47) + +m := metrics.NewMeter() +metrics.Register("quux", m) +m.Mark(47) + +t := metrics.NewTimer() +metrics.Register("bang", t) +t.Time(func() {}) +t.Update(47) +``` + +Register() is not threadsafe. For threadsafe metric registration use +GetOrRegister: + +```go +t := metrics.GetOrRegisterTimer("account.create.latency", nil) +t.Time(func() {}) +t.Update(47) +``` + +**NOTE:** Be sure to unregister short-lived meters and timers otherwise they will +leak memory: + +```go +// Will call Stop() on the Meter to allow for garbage collection +metrics.Unregister("quux") +// Or similarly for a Timer that embeds a Meter +metrics.Unregister("bang") +``` + +Periodically log every metric in human-readable form to standard error: + +```go +go metrics.Log(metrics.DefaultRegistry, 5 * time.Second, log.New(os.Stderr, "metrics: ", log.Lmicroseconds)) +``` + +Periodically log every metric in slightly-more-parseable form to syslog: + +```go +w, _ := syslog.Dial("unixgram", "/dev/log", syslog.LOG_INFO, "metrics") +go metrics.Syslog(metrics.DefaultRegistry, 60e9, w) +``` + +Periodically emit every metric to Graphite using the [Graphite client](https://github.com/cyberdelia/go-metrics-graphite): + +```go + +import "github.com/cyberdelia/go-metrics-graphite" + +addr, _ := net.ResolveTCPAddr("tcp", "127.0.0.1:2003") +go graphite.Graphite(metrics.DefaultRegistry, 10e9, "metrics", addr) +``` + +Periodically emit every metric into InfluxDB: + +**NOTE:** this has been pulled out of the library due to constant fluctuations +in the InfluxDB API. In fact, all client libraries are on their way out. see +issues [#121](https://github.com/rcrowley/go-metrics/issues/121) and +[#124](https://github.com/rcrowley/go-metrics/issues/124) for progress and details. + +```go +import "github.com/vrischmann/go-metrics-influxdb" + +go influxdb.InfluxDB(metrics.DefaultRegistry, + 10e9, + "127.0.0.1:8086", + "database-name", + "username", + "password" +) +``` + +Periodically upload every metric to Librato using the [Librato client](https://github.com/mihasya/go-metrics-librato): + +**Note**: the client included with this repository under the `librato` package +has been deprecated and moved to the repository linked above. + +```go +import "github.com/mihasya/go-metrics-librato" + +go librato.Librato(metrics.DefaultRegistry, + 10e9, // interval + "example@example.com", // account owner email address + "token", // Librato API token + "hostname", // source + []float64{0.95}, // percentiles to send + time.Millisecond, // time unit +) +``` + +Periodically emit every metric to StatHat: + +```go +import "github.com/rcrowley/go-metrics/stathat" + +go stathat.Stathat(metrics.DefaultRegistry, 10e9, "example@example.com") +``` + +Maintain all metrics along with expvars at `/debug/metrics`: + +This uses the same mechanism as [the official expvar](http://golang.org/pkg/expvar/) +but exposed under `/debug/metrics`, which shows a json representation of all your usual expvars +as well as all your go-metrics. + + +```go +import "github.com/rcrowley/go-metrics/exp" + +exp.Exp(metrics.DefaultRegistry) +``` + +Installation +------------ + +```sh +go get github.com/rcrowley/go-metrics +``` + +StatHat support additionally requires their Go client: + +```sh +go get github.com/stathat/go +``` + +Publishing Metrics +------------------ + +Clients are available for the following destinations: + +* Librato - https://github.com/mihasya/go-metrics-librato +* Graphite - https://github.com/cyberdelia/go-metrics-graphite +* InfluxDB - https://github.com/vrischmann/go-metrics-influxdb +* Ganglia - https://github.com/appscode/metlia +* Prometheus - https://github.com/deathowl/go-metrics-prometheus +* DataDog - https://github.com/syntaqx/go-metrics-datadog +* SignalFX - https://github.com/pascallouisperez/go-metrics-signalfx +* Honeycomb - https://github.com/getspine/go-metrics-honeycomb +* Wavefront - https://github.com/wavefrontHQ/go-metrics-wavefront diff --git a/vendor/github.com/rcrowley/go-metrics/memory.md b/vendor/github.com/rcrowley/go-metrics/memory.md new file mode 100644 index 000000000000..47454f54b640 --- /dev/null +++ b/vendor/github.com/rcrowley/go-metrics/memory.md @@ -0,0 +1,285 @@ +Memory usage +============ + +(Highly unscientific.) + +Command used to gather static memory usage: + +```sh +grep ^Vm "/proc/$(ps fax | grep [m]etrics-bench | awk '{print $1}')/status" +``` + +Program used to gather baseline memory usage: + +```go +package main + +import "time" + +func main() { + time.Sleep(600e9) +} +``` + +Baseline +-------- + +``` +VmPeak: 42604 kB +VmSize: 42604 kB +VmLck: 0 kB +VmHWM: 1120 kB +VmRSS: 1120 kB +VmData: 35460 kB +VmStk: 136 kB +VmExe: 1020 kB +VmLib: 1848 kB +VmPTE: 36 kB +VmSwap: 0 kB +``` + +Program used to gather metric memory usage (with other metrics being similar): + +```go +package main + +import ( + "fmt" + "metrics" + "time" +) + +func main() { + fmt.Sprintf("foo") + metrics.NewRegistry() + time.Sleep(600e9) +} +``` + +1000 counters registered +------------------------ + +``` +VmPeak: 44016 kB +VmSize: 44016 kB +VmLck: 0 kB +VmHWM: 1928 kB +VmRSS: 1928 kB +VmData: 36868 kB +VmStk: 136 kB +VmExe: 1024 kB +VmLib: 1848 kB +VmPTE: 40 kB +VmSwap: 0 kB +``` + +**1.412 kB virtual, TODO 0.808 kB resident per counter.** + +100000 counters registered +-------------------------- + +``` +VmPeak: 55024 kB +VmSize: 55024 kB +VmLck: 0 kB +VmHWM: 12440 kB +VmRSS: 12440 kB +VmData: 47876 kB +VmStk: 136 kB +VmExe: 1024 kB +VmLib: 1848 kB +VmPTE: 64 kB +VmSwap: 0 kB +``` + +**0.1242 kB virtual, 0.1132 kB resident per counter.** + +1000 gauges registered +---------------------- + +``` +VmPeak: 44012 kB +VmSize: 44012 kB +VmLck: 0 kB +VmHWM: 1928 kB +VmRSS: 1928 kB +VmData: 36868 kB +VmStk: 136 kB +VmExe: 1020 kB +VmLib: 1848 kB +VmPTE: 40 kB +VmSwap: 0 kB +``` + +**1.408 kB virtual, 0.808 kB resident per counter.** + +100000 gauges registered +------------------------ + +``` +VmPeak: 55020 kB +VmSize: 55020 kB +VmLck: 0 kB +VmHWM: 12432 kB +VmRSS: 12432 kB +VmData: 47876 kB +VmStk: 136 kB +VmExe: 1020 kB +VmLib: 1848 kB +VmPTE: 60 kB +VmSwap: 0 kB +``` + +**0.12416 kB virtual, 0.11312 resident per gauge.** + +1000 histograms with a uniform sample size of 1028 +-------------------------------------------------- + +``` +VmPeak: 72272 kB +VmSize: 72272 kB +VmLck: 0 kB +VmHWM: 16204 kB +VmRSS: 16204 kB +VmData: 65100 kB +VmStk: 136 kB +VmExe: 1048 kB +VmLib: 1848 kB +VmPTE: 80 kB +VmSwap: 0 kB +``` + +**29.668 kB virtual, TODO 15.084 resident per histogram.** + +10000 histograms with a uniform sample size of 1028 +--------------------------------------------------- + +``` +VmPeak: 256912 kB +VmSize: 256912 kB +VmLck: 0 kB +VmHWM: 146204 kB +VmRSS: 146204 kB +VmData: 249740 kB +VmStk: 136 kB +VmExe: 1048 kB +VmLib: 1848 kB +VmPTE: 448 kB +VmSwap: 0 kB +``` + +**21.4308 kB virtual, 14.5084 kB resident per histogram.** + +50000 histograms with a uniform sample size of 1028 +--------------------------------------------------- + +``` +VmPeak: 908112 kB +VmSize: 908112 kB +VmLck: 0 kB +VmHWM: 645832 kB +VmRSS: 645588 kB +VmData: 900940 kB +VmStk: 136 kB +VmExe: 1048 kB +VmLib: 1848 kB +VmPTE: 1716 kB +VmSwap: 1544 kB +``` + +**17.31016 kB virtual, 12.88936 kB resident per histogram.** + +1000 histograms with an exponentially-decaying sample size of 1028 and alpha of 0.015 +------------------------------------------------------------------------------------- + +``` +VmPeak: 62480 kB +VmSize: 62480 kB +VmLck: 0 kB +VmHWM: 11572 kB +VmRSS: 11572 kB +VmData: 55308 kB +VmStk: 136 kB +VmExe: 1048 kB +VmLib: 1848 kB +VmPTE: 64 kB +VmSwap: 0 kB +``` + +**19.876 kB virtual, 10.452 kB resident per histogram.** + +10000 histograms with an exponentially-decaying sample size of 1028 and alpha of 0.015 +-------------------------------------------------------------------------------------- + +``` +VmPeak: 153296 kB +VmSize: 153296 kB +VmLck: 0 kB +VmHWM: 101176 kB +VmRSS: 101176 kB +VmData: 146124 kB +VmStk: 136 kB +VmExe: 1048 kB +VmLib: 1848 kB +VmPTE: 240 kB +VmSwap: 0 kB +``` + +**11.0692 kB virtual, 10.0056 kB resident per histogram.** + +50000 histograms with an exponentially-decaying sample size of 1028 and alpha of 0.015 +-------------------------------------------------------------------------------------- + +``` +VmPeak: 557264 kB +VmSize: 557264 kB +VmLck: 0 kB +VmHWM: 501056 kB +VmRSS: 501056 kB +VmData: 550092 kB +VmStk: 136 kB +VmExe: 1048 kB +VmLib: 1848 kB +VmPTE: 1032 kB +VmSwap: 0 kB +``` + +**10.2932 kB virtual, 9.99872 kB resident per histogram.** + +1000 meters +----------- + +``` +VmPeak: 74504 kB +VmSize: 74504 kB +VmLck: 0 kB +VmHWM: 24124 kB +VmRSS: 24124 kB +VmData: 67340 kB +VmStk: 136 kB +VmExe: 1040 kB +VmLib: 1848 kB +VmPTE: 92 kB +VmSwap: 0 kB +``` + +**31.9 kB virtual, 23.004 kB resident per meter.** + +10000 meters +------------ + +``` +VmPeak: 278920 kB +VmSize: 278920 kB +VmLck: 0 kB +VmHWM: 227300 kB +VmRSS: 227300 kB +VmData: 271756 kB +VmStk: 136 kB +VmExe: 1040 kB +VmLib: 1848 kB +VmPTE: 488 kB +VmSwap: 0 kB +``` + +**23.6316 kB virtual, 22.618 kB resident per meter.** diff --git a/vendor/github.com/rcrowley/go-metrics/validate.sh b/vendor/github.com/rcrowley/go-metrics/validate.sh new file mode 100644 index 000000000000..c4ae91e642d6 --- /dev/null +++ b/vendor/github.com/rcrowley/go-metrics/validate.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +# check there are no formatting issues +GOFMT_LINES=`gofmt -l . | wc -l | xargs` +test $GOFMT_LINES -eq 0 || echo "gofmt needs to be run, ${GOFMT_LINES} files have issues" + +# run the tests for the root package +go test -race . diff --git a/vendor/github.com/serenize/snaker/README.md b/vendor/github.com/serenize/snaker/README.md new file mode 100644 index 000000000000..cec40486f1ff --- /dev/null +++ b/vendor/github.com/serenize/snaker/README.md @@ -0,0 +1,25 @@ +# snaker + +[![Build Status](https://travis-ci.org/serenize/snaker.svg?branch=master)](https://travis-ci.org/serenize/snaker) +[![GoDoc](https://godoc.org/github.com/serenize/snaker?status.svg)](https://godoc.org/github.com/serenize/snaker) + +This is a small utility to convert camel cased strings to snake case and back, except some defined words. + +## QBS Usage + +To replace the original toSnake and back algorithms for [https://github.com/coocood/qbs](https://github.com/coocood/qbs) +you can easily use snaker: + +Import snaker +```go +import ( + github.com/coocood/qbs + github.com/serenize/snaker +) +``` + +Register the snaker methods to qbs +```go +qbs.ColumnNameToFieldName = snaker.SnakeToCamel +qbs.FieldNameToColumnName = snaker.CamelToSnake +``` diff --git a/vendor/github.com/sirupsen/logrus/.gitignore b/vendor/github.com/sirupsen/logrus/.gitignore new file mode 100644 index 000000000000..6b7d7d1e8b90 --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/.gitignore @@ -0,0 +1,2 @@ +logrus +vendor diff --git a/vendor/github.com/sirupsen/logrus/CHANGELOG.md b/vendor/github.com/sirupsen/logrus/CHANGELOG.md new file mode 100644 index 000000000000..ff047186909c --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/CHANGELOG.md @@ -0,0 +1,158 @@ +# 1.1.1 +This is a bug fix release. + * fix the build break on Solaris + * don't drop a whole trace in JSONFormatter when a field param is a function pointer which can not be serialized + +# 1.1.0 +This new release introduces: + * several fixes: + * a fix for a race condition on entry formatting + * proper cleanup of previously used entries before putting them back in the pool + * the extra new line at the end of message in text formatter has been removed + * a new global public API to check if a level is activated: IsLevelEnabled + * the following methods have been added to the Logger object + * IsLevelEnabled + * SetFormatter + * SetOutput + * ReplaceHooks + * introduction of go module + * an indent configuration for the json formatter + * output colour support for windows + * the field sort function is now configurable for text formatter + * the CLICOLOR and CLICOLOR\_FORCE environment variable support in text formater + +# 1.0.6 + +This new release introduces: + * a new api WithTime which allows to easily force the time of the log entry + which is mostly useful for logger wrapper + * a fix reverting the immutability of the entry given as parameter to the hooks + a new configuration field of the json formatter in order to put all the fields + in a nested dictionnary + * a new SetOutput method in the Logger + * a new configuration of the textformatter to configure the name of the default keys + * a new configuration of the text formatter to disable the level truncation + +# 1.0.5 + +* Fix hooks race (#707) +* Fix panic deadlock (#695) + +# 1.0.4 + +* Fix race when adding hooks (#612) +* Fix terminal check in AppEngine (#635) + +# 1.0.3 + +* Replace example files with testable examples + +# 1.0.2 + +* bug: quote non-string values in text formatter (#583) +* Make (*Logger) SetLevel a public method + +# 1.0.1 + +* bug: fix escaping in text formatter (#575) + +# 1.0.0 + +* Officially changed name to lower-case +* bug: colors on Windows 10 (#541) +* bug: fix race in accessing level (#512) + +# 0.11.5 + +* feature: add writer and writerlevel to entry (#372) + +# 0.11.4 + +* bug: fix undefined variable on solaris (#493) + +# 0.11.3 + +* formatter: configure quoting of empty values (#484) +* formatter: configure quoting character (default is `"`) (#484) +* bug: fix not importing io correctly in non-linux environments (#481) + +# 0.11.2 + +* bug: fix windows terminal detection (#476) + +# 0.11.1 + +* bug: fix tty detection with custom out (#471) + +# 0.11.0 + +* performance: Use bufferpool to allocate (#370) +* terminal: terminal detection for app-engine (#343) +* feature: exit handler (#375) + +# 0.10.0 + +* feature: Add a test hook (#180) +* feature: `ParseLevel` is now case-insensitive (#326) +* feature: `FieldLogger` interface that generalizes `Logger` and `Entry` (#308) +* performance: avoid re-allocations on `WithFields` (#335) + +# 0.9.0 + +* logrus/text_formatter: don't emit empty msg +* logrus/hooks/airbrake: move out of main repository +* logrus/hooks/sentry: move out of main repository +* logrus/hooks/papertrail: move out of main repository +* logrus/hooks/bugsnag: move out of main repository +* logrus/core: run tests with `-race` +* logrus/core: detect TTY based on `stderr` +* logrus/core: support `WithError` on logger +* logrus/core: Solaris support + +# 0.8.7 + +* logrus/core: fix possible race (#216) +* logrus/doc: small typo fixes and doc improvements + + +# 0.8.6 + +* hooks/raven: allow passing an initialized client + +# 0.8.5 + +* logrus/core: revert #208 + +# 0.8.4 + +* formatter/text: fix data race (#218) + +# 0.8.3 + +* logrus/core: fix entry log level (#208) +* logrus/core: improve performance of text formatter by 40% +* logrus/core: expose `LevelHooks` type +* logrus/core: add support for DragonflyBSD and NetBSD +* formatter/text: print structs more verbosely + +# 0.8.2 + +* logrus: fix more Fatal family functions + +# 0.8.1 + +* logrus: fix not exiting on `Fatalf` and `Fatalln` + +# 0.8.0 + +* logrus: defaults to stderr instead of stdout +* hooks/sentry: add special field for `*http.Request` +* formatter/text: ignore Windows for colors + +# 0.7.3 + +* formatter/\*: allow configuration of timestamp layout + +# 0.7.2 + +* formatter/text: Add configuration option for time format (#158) diff --git a/vendor/github.com/sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md new file mode 100644 index 000000000000..39873105514d --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/README.md @@ -0,0 +1,494 @@ +# Logrus :walrus: [![Build Status](https://travis-ci.org/sirupsen/logrus.svg?branch=master)](https://travis-ci.org/sirupsen/logrus) [![GoDoc](https://godoc.org/github.com/sirupsen/logrus?status.svg)](https://godoc.org/github.com/sirupsen/logrus) + +Logrus is a structured logger for Go (golang), completely API compatible with +the standard library logger. + +**Seeing weird case-sensitive problems?** It's in the past been possible to +import Logrus as both upper- and lower-case. Due to the Go package environment, +this caused issues in the community and we needed a standard. Some environments +experienced problems with the upper-case variant, so the lower-case was decided. +Everything using `logrus` will need to use the lower-case: +`github.com/sirupsen/logrus`. Any package that isn't, should be changed. + +To fix Glide, see [these +comments](https://github.com/sirupsen/logrus/issues/553#issuecomment-306591437). +For an in-depth explanation of the casing issue, see [this +comment](https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276). + +**Are you interested in assisting in maintaining Logrus?** Currently I have a +lot of obligations, and I am unable to provide Logrus with the maintainership it +needs. If you'd like to help, please reach out to me at `simon at author's +username dot com`. + +Nicely color-coded in development (when a TTY is attached, otherwise just +plain text): + +![Colored](http://i.imgur.com/PY7qMwd.png) + +With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash +or Splunk: + +```json +{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the +ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"} + +{"level":"warning","msg":"The group's number increased tremendously!", +"number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"} + +{"animal":"walrus","level":"info","msg":"A giant walrus appears!", +"size":10,"time":"2014-03-10 19:57:38.562500591 -0400 EDT"} + +{"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.", +"size":9,"time":"2014-03-10 19:57:38.562527896 -0400 EDT"} + +{"level":"fatal","msg":"The ice breaks!","number":100,"omg":true, +"time":"2014-03-10 19:57:38.562543128 -0400 EDT"} +``` + +With the default `log.SetFormatter(&log.TextFormatter{})` when a TTY is not +attached, the output is compatible with the +[logfmt](http://godoc.org/github.com/kr/logfmt) format: + +```text +time="2015-03-26T01:27:38-04:00" level=debug msg="Started observing beach" animal=walrus number=8 +time="2015-03-26T01:27:38-04:00" level=info msg="A group of walrus emerges from the ocean" animal=walrus size=10 +time="2015-03-26T01:27:38-04:00" level=warning msg="The group's number increased tremendously!" number=122 omg=true +time="2015-03-26T01:27:38-04:00" level=debug msg="Temperature changes" temperature=-4 +time="2015-03-26T01:27:38-04:00" level=panic msg="It's over 9000!" animal=orca size=9009 +time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" err=&{0x2082280c0 map[animal:orca size:9009] 2015-03-26 01:27:38.441574009 -0400 EDT panic It's over 9000!} number=100 omg=true +``` +To ensure this behaviour even if a TTY is attached, set your formatter as follows: + +```go + log.SetFormatter(&log.TextFormatter{ + DisableColors: true, + FullTimestamp: true, + }) +``` + +#### Logging Method Name + +If you wish to add the calling method as a field, instruct the logger via: +```go +log.SetReportCaller(true) +``` +This adds the caller as 'method' like so: + +```json +{"animal":"penguin","level":"fatal","method":"github.com/sirupsen/arcticcreatures.migrate","msg":"a penguin swims by", +"time":"2014-03-10 19:57:38.562543129 -0400 EDT"} +``` + +```text +time="2015-03-26T01:27:38-04:00" level=fatal method=github.com/sirupsen/arcticcreatures.migrate msg="a penguin swims by" animal=penguin +``` +Note that this does add measurable overhead - the cost will depend on the version of Go, but is +between 20 and 40% in recent tests with 1.6 and 1.7. You can validate this in your +environment via benchmarks: +``` +go test -bench=.*CallerTracing +``` + + +#### Case-sensitivity + +The organization's name was changed to lower-case--and this will not be changed +back. If you are getting import conflicts due to case sensitivity, please use +the lower-case import: `github.com/sirupsen/logrus`. + +#### Example + +The simplest way to use Logrus is simply the package-level exported logger: + +```go +package main + +import ( + log "github.com/sirupsen/logrus" +) + +func main() { + log.WithFields(log.Fields{ + "animal": "walrus", + }).Info("A walrus appears") +} +``` + +Note that it's completely api-compatible with the stdlib logger, so you can +replace your `log` imports everywhere with `log "github.com/sirupsen/logrus"` +and you'll now have the flexibility of Logrus. You can customize it all you +want: + +```go +package main + +import ( + "os" + log "github.com/sirupsen/logrus" +) + +func init() { + // Log as JSON instead of the default ASCII formatter. + log.SetFormatter(&log.JSONFormatter{}) + + // Output to stdout instead of the default stderr + // Can be any io.Writer, see below for File example + log.SetOutput(os.Stdout) + + // Only log the warning severity or above. + log.SetLevel(log.WarnLevel) +} + +func main() { + log.WithFields(log.Fields{ + "animal": "walrus", + "size": 10, + }).Info("A group of walrus emerges from the ocean") + + log.WithFields(log.Fields{ + "omg": true, + "number": 122, + }).Warn("The group's number increased tremendously!") + + log.WithFields(log.Fields{ + "omg": true, + "number": 100, + }).Fatal("The ice breaks!") + + // A common pattern is to re-use fields between logging statements by re-using + // the logrus.Entry returned from WithFields() + contextLogger := log.WithFields(log.Fields{ + "common": "this is a common field", + "other": "I also should be logged always", + }) + + contextLogger.Info("I'll be logged with common and other field") + contextLogger.Info("Me too") +} +``` + +For more advanced usage such as logging to multiple locations from the same +application, you can also create an instance of the `logrus` Logger: + +```go +package main + +import ( + "os" + "github.com/sirupsen/logrus" +) + +// Create a new instance of the logger. You can have any number of instances. +var log = logrus.New() + +func main() { + // The API for setting attributes is a little different than the package level + // exported logger. See Godoc. + log.Out = os.Stdout + + // You could set this to any `io.Writer` such as a file + // file, err := os.OpenFile("logrus.log", os.O_CREATE|os.O_WRONLY, 0666) + // if err == nil { + // log.Out = file + // } else { + // log.Info("Failed to log to file, using default stderr") + // } + + log.WithFields(logrus.Fields{ + "animal": "walrus", + "size": 10, + }).Info("A group of walrus emerges from the ocean") +} +``` + +#### Fields + +Logrus encourages careful, structured logging through logging fields instead of +long, unparseable error messages. For example, instead of: `log.Fatalf("Failed +to send event %s to topic %s with key %d")`, you should log the much more +discoverable: + +```go +log.WithFields(log.Fields{ + "event": event, + "topic": topic, + "key": key, +}).Fatal("Failed to send event") +``` + +We've found this API forces you to think about logging in a way that produces +much more useful logging messages. We've been in countless situations where just +a single added field to a log statement that was already there would've saved us +hours. The `WithFields` call is optional. + +In general, with Logrus using any of the `printf`-family functions should be +seen as a hint you should add a field, however, you can still use the +`printf`-family functions with Logrus. + +#### Default Fields + +Often it's helpful to have fields _always_ attached to log statements in an +application or parts of one. For example, you may want to always log the +`request_id` and `user_ip` in the context of a request. Instead of writing +`log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip})` on +every line, you can create a `logrus.Entry` to pass around instead: + +```go +requestLogger := log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip}) +requestLogger.Info("something happened on that request") # will log request_id and user_ip +requestLogger.Warn("something not great happened") +``` + +#### Hooks + +You can add hooks for logging levels. For example to send errors to an exception +tracking service on `Error`, `Fatal` and `Panic`, info to StatsD or log to +multiple places simultaneously, e.g. syslog. + +Logrus comes with [built-in hooks](hooks/). Add those, or your custom hook, in +`init`: + +```go +import ( + log "github.com/sirupsen/logrus" + "gopkg.in/gemnasium/logrus-airbrake-hook.v2" // the package is named "airbrake" + logrus_syslog "github.com/sirupsen/logrus/hooks/syslog" + "log/syslog" +) + +func init() { + + // Use the Airbrake hook to report errors that have Error severity or above to + // an exception tracker. You can create custom hooks, see the Hooks section. + log.AddHook(airbrake.NewHook(123, "xyz", "production")) + + hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") + if err != nil { + log.Error("Unable to connect to local syslog daemon") + } else { + log.AddHook(hook) + } +} +``` +Note: Syslog hook also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md). + +A list of currently known of service hook can be found in this wiki [page](https://github.com/sirupsen/logrus/wiki/Hooks) + + +#### Level logging + +Logrus has seven logging levels: Trace, Debug, Info, Warning, Error, Fatal and Panic. + +```go +log.Trace("Something very low level.") +log.Debug("Useful debugging information.") +log.Info("Something noteworthy happened!") +log.Warn("You should probably take a look at this.") +log.Error("Something failed but I'm not quitting.") +// Calls os.Exit(1) after logging +log.Fatal("Bye.") +// Calls panic() after logging +log.Panic("I'm bailing.") +``` + +You can set the logging level on a `Logger`, then it will only log entries with +that severity or anything above it: + +```go +// Will log anything that is info or above (warn, error, fatal, panic). Default. +log.SetLevel(log.InfoLevel) +``` + +It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose +environment if your application has that. + +#### Entries + +Besides the fields added with `WithField` or `WithFields` some fields are +automatically added to all logging events: + +1. `time`. The timestamp when the entry was created. +2. `msg`. The logging message passed to `{Info,Warn,Error,Fatal,Panic}` after + the `AddFields` call. E.g. `Failed to send event.` +3. `level`. The logging level. E.g. `info`. + +#### Environments + +Logrus has no notion of environment. + +If you wish for hooks and formatters to only be used in specific environments, +you should handle that yourself. For example, if your application has a global +variable `Environment`, which is a string representation of the environment you +could do: + +```go +import ( + log "github.com/sirupsen/logrus" +) + +init() { + // do something here to set environment depending on an environment variable + // or command-line flag + if Environment == "production" { + log.SetFormatter(&log.JSONFormatter{}) + } else { + // The TextFormatter is default, you don't actually have to do this. + log.SetFormatter(&log.TextFormatter{}) + } +} +``` + +This configuration is how `logrus` was intended to be used, but JSON in +production is mostly only useful if you do log aggregation with tools like +Splunk or Logstash. + +#### Formatters + +The built-in logging formatters are: + +* `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise + without colors. + * *Note:* to force colored output when there is no TTY, set the `ForceColors` + field to `true`. To force no colored output even if there is a TTY set the + `DisableColors` field to `true`. For Windows, see + [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable). + * When colors are enabled, levels are truncated to 4 characters by default. To disable + truncation set the `DisableLevelTruncation` field to `true`. + * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#TextFormatter). +* `logrus.JSONFormatter`. Logs fields as JSON. + * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#JSONFormatter). + +Third party logging formatters: + +* [`FluentdFormatter`](https://github.com/joonix/log). Formats entries that can be parsed by Kubernetes and Google Container Engine. +* [`GELF`](https://github.com/fabienm/go-logrus-formatters). Formats entries so they comply to Graylog's [GELF 1.1 specification](http://docs.graylog.org/en/2.4/pages/gelf.html). +* [`logstash`](https://github.com/bshuster-repo/logrus-logstash-hook). Logs fields as [Logstash](http://logstash.net) Events. +* [`prefixed`](https://github.com/x-cray/logrus-prefixed-formatter). Displays log entry source along with alternative layout. +* [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the P͉̫o̳̼̊w̖͈̰͎e̬͔̭͂r͚̼̹̲ ̫͓͉̳͈ō̠͕͖̚f̝͍̠ ͕̲̞͖͑Z̖̫̤̫ͪa͉̬͈̗l͖͎g̳̥o̰̥̅!̣͔̲̻͊̄ ̙̘̦̹̦. + +You can define your formatter by implementing the `Formatter` interface, +requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a +`Fields` type (`map[string]interface{}`) with all your fields as well as the +default ones (see Entries section above): + +```go +type MyJSONFormatter struct { +} + +log.SetFormatter(new(MyJSONFormatter)) + +func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) { + // Note this doesn't include Time, Level and Message which are available on + // the Entry. Consult `godoc` on information about those fields or read the + // source of the official loggers. + serialized, err := json.Marshal(entry.Data) + if err != nil { + return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) + } + return append(serialized, '\n'), nil +} +``` + +#### Logger as an `io.Writer` + +Logrus can be transformed into an `io.Writer`. That writer is the end of an `io.Pipe` and it is your responsibility to close it. + +```go +w := logger.Writer() +defer w.Close() + +srv := http.Server{ + // create a stdlib log.Logger that writes to + // logrus.Logger. + ErrorLog: log.New(w, "", 0), +} +``` + +Each line written to that writer will be printed the usual way, using formatters +and hooks. The level for those entries is `info`. + +This means that we can override the standard library logger easily: + +```go +logger := logrus.New() +logger.Formatter = &logrus.JSONFormatter{} + +// Use logrus for standard log output +// Note that `log` here references stdlib's log +// Not logrus imported under the name `log`. +log.SetOutput(logger.Writer()) +``` + +#### Rotation + +Log rotation is not provided with Logrus. Log rotation should be done by an +external program (like `logrotate(8)`) that can compress and delete old log +entries. It should not be a feature of the application-level logger. + +#### Tools + +| Tool | Description | +| ---- | ----------- | +|[Logrus Mate](https://github.com/gogap/logrus_mate)|Logrus mate is a tool for Logrus to manage loggers, you can initial logger's level, hook and formatter by config file, the logger will generated with different config at different environment.| +|[Logrus Viper Helper](https://github.com/heirko/go-contrib/tree/master/logrusHelper)|An Helper around Logrus to wrap with spf13/Viper to load configuration with fangs! And to simplify Logrus configuration use some behavior of [Logrus Mate](https://github.com/gogap/logrus_mate). [sample](https://github.com/heirko/iris-contrib/blob/master/middleware/logrus-logger/example) | + +#### Testing + +Logrus has a built in facility for asserting the presence of log messages. This is implemented through the `test` hook and provides: + +* decorators for existing logger (`test.NewLocal` and `test.NewGlobal`) which basically just add the `test` hook +* a test logger (`test.NewNullLogger`) that just records log messages (and does not output any): + +```go +import( + "github.com/sirupsen/logrus" + "github.com/sirupsen/logrus/hooks/test" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestSomething(t*testing.T){ + logger, hook := test.NewNullLogger() + logger.Error("Helloerror") + + assert.Equal(t, 1, len(hook.Entries)) + assert.Equal(t, logrus.ErrorLevel, hook.LastEntry().Level) + assert.Equal(t, "Helloerror", hook.LastEntry().Message) + + hook.Reset() + assert.Nil(t, hook.LastEntry()) +} +``` + +#### Fatal handlers + +Logrus can register one or more functions that will be called when any `fatal` +level message is logged. The registered handlers will be executed before +logrus performs a `os.Exit(1)`. This behavior may be helpful if callers need +to gracefully shutdown. Unlike a `panic("Something went wrong...")` call which can be intercepted with a deferred `recover` a call to `os.Exit(1)` can not be intercepted. + +``` +... +handler := func() { + // gracefully shutdown something... +} +logrus.RegisterExitHandler(handler) +... +``` + +#### Thread safety + +By default, Logger is protected by a mutex for concurrent writes. The mutex is held when calling hooks and writing logs. +If you are sure such locking is not needed, you can call logger.SetNoLock() to disable the locking. + +Situation when locking is not needed includes: + +* You have no hooks registered, or hooks calling is already thread-safe. + +* Writing to logger.Out is already thread-safe, for example: + + 1) logger.Out is protected by locks. + + 2) logger.Out is a os.File handler opened with `O_APPEND` flag, and every write is smaller than 4k. (This allow multi-thread/multi-process writing) + + (Refer to http://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/) diff --git a/vendor/github.com/sirupsen/logrus/go.mod b/vendor/github.com/sirupsen/logrus/go.mod new file mode 100644 index 000000000000..94574cc635c5 --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/go.mod @@ -0,0 +1,11 @@ +module github.com/sirupsen/logrus + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/konsorten/go-windows-terminal-sequences v1.0.1 + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/objx v0.1.1 // indirect + github.com/stretchr/testify v1.2.2 + golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 + golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 +) diff --git a/vendor/github.com/sirupsen/logrus/go.sum b/vendor/github.com/sirupsen/logrus/go.sum new file mode 100644 index 000000000000..133d34ae1165 --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/go.sum @@ -0,0 +1,15 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe h1:CHRGQ8V7OlCYtwaKPJi3iA7J+YdNKdo8j7nG5IgDhjs= +github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/vendor/github.com/spf13/afero/README.md b/vendor/github.com/spf13/afero/README.md new file mode 100644 index 000000000000..0c9b04b53fcb --- /dev/null +++ b/vendor/github.com/spf13/afero/README.md @@ -0,0 +1,452 @@ +![afero logo-sm](https://cloud.githubusercontent.com/assets/173412/11490338/d50e16dc-97a5-11e5-8b12-019a300d0fcb.png) + +A FileSystem Abstraction System for Go + +[![Build Status](https://travis-ci.org/spf13/afero.svg)](https://travis-ci.org/spf13/afero) [![Build status](https://ci.appveyor.com/api/projects/status/github/spf13/afero?branch=master&svg=true)](https://ci.appveyor.com/project/spf13/afero) [![GoDoc](https://godoc.org/github.com/spf13/afero?status.svg)](https://godoc.org/github.com/spf13/afero) [![Join the chat at https://gitter.im/spf13/afero](https://badges.gitter.im/Dev%20Chat.svg)](https://gitter.im/spf13/afero?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +# Overview + +Afero is an filesystem framework providing a simple, uniform and universal API +interacting with any filesystem, as an abstraction layer providing interfaces, +types and methods. Afero has an exceptionally clean interface and simple design +without needless constructors or initialization methods. + +Afero is also a library providing a base set of interoperable backend +filesystems that make it easy to work with afero while retaining all the power +and benefit of the os and ioutil packages. + +Afero provides significant improvements over using the os package alone, most +notably the ability to create mock and testing filesystems without relying on the disk. + +It is suitable for use in a any situation where you would consider using the OS +package as it provides an additional abstraction that makes it easy to use a +memory backed file system during testing. It also adds support for the http +filesystem for full interoperability. + + +## Afero Features + +* A single consistent API for accessing a variety of filesystems +* Interoperation between a variety of file system types +* A set of interfaces to encourage and enforce interoperability between backends +* An atomic cross platform memory backed file system +* Support for compositional (union) file systems by combining multiple file systems acting as one +* Specialized backends which modify existing filesystems (Read Only, Regexp filtered) +* A set of utility functions ported from io, ioutil & hugo to be afero aware + + +# Using Afero + +Afero is easy to use and easier to adopt. + +A few different ways you could use Afero: + +* Use the interfaces alone to define you own file system. +* Wrap for the OS packages. +* Define different filesystems for different parts of your application. +* Use Afero for mock filesystems while testing + +## Step 1: Install Afero + +First use go get to install the latest version of the library. + + $ go get github.com/spf13/afero + +Next include Afero in your application. +```go +import "github.com/spf13/afero" +``` + +## Step 2: Declare a backend + +First define a package variable and set it to a pointer to a filesystem. +```go +var AppFs = afero.NewMemMapFs() + +or + +var AppFs = afero.NewOsFs() +``` +It is important to note that if you repeat the composite literal you +will be using a completely new and isolated filesystem. In the case of +OsFs it will still use the same underlying filesystem but will reduce +the ability to drop in other filesystems as desired. + +## Step 3: Use it like you would the OS package + +Throughout your application use any function and method like you normally +would. + +So if my application before had: +```go +os.Open('/tmp/foo') +``` +We would replace it with: +```go +AppFs.Open('/tmp/foo') +``` + +`AppFs` being the variable we defined above. + + +## List of all available functions + +File System Methods Available: +```go +Chmod(name string, mode os.FileMode) : error +Chtimes(name string, atime time.Time, mtime time.Time) : error +Create(name string) : File, error +Mkdir(name string, perm os.FileMode) : error +MkdirAll(path string, perm os.FileMode) : error +Name() : string +Open(name string) : File, error +OpenFile(name string, flag int, perm os.FileMode) : File, error +Remove(name string) : error +RemoveAll(path string) : error +Rename(oldname, newname string) : error +Stat(name string) : os.FileInfo, error +``` +File Interfaces and Methods Available: +```go +io.Closer +io.Reader +io.ReaderAt +io.Seeker +io.Writer +io.WriterAt + +Name() : string +Readdir(count int) : []os.FileInfo, error +Readdirnames(n int) : []string, error +Stat() : os.FileInfo, error +Sync() : error +Truncate(size int64) : error +WriteString(s string) : ret int, err error +``` +In some applications it may make sense to define a new package that +simply exports the file system variable for easy access from anywhere. + +## Using Afero's utility functions + +Afero provides a set of functions to make it easier to use the underlying file systems. +These functions have been primarily ported from io & ioutil with some developed for Hugo. + +The afero utilities support all afero compatible backends. + +The list of utilities includes: + +```go +DirExists(path string) (bool, error) +Exists(path string) (bool, error) +FileContainsBytes(filename string, subslice []byte) (bool, error) +GetTempDir(subPath string) string +IsDir(path string) (bool, error) +IsEmpty(path string) (bool, error) +ReadDir(dirname string) ([]os.FileInfo, error) +ReadFile(filename string) ([]byte, error) +SafeWriteReader(path string, r io.Reader) (err error) +TempDir(dir, prefix string) (name string, err error) +TempFile(dir, prefix string) (f File, err error) +Walk(root string, walkFn filepath.WalkFunc) error +WriteFile(filename string, data []byte, perm os.FileMode) error +WriteReader(path string, r io.Reader) (err error) +``` +For a complete list see [Afero's GoDoc](https://godoc.org/github.com/spf13/afero) + +They are available under two different approaches to use. You can either call +them directly where the first parameter of each function will be the file +system, or you can declare a new `Afero`, a custom type used to bind these +functions as methods to a given filesystem. + +### Calling utilities directly + +```go +fs := new(afero.MemMapFs) +f, err := afero.TempFile(fs,"", "ioutil-test") + +``` + +### Calling via Afero + +```go +fs := afero.NewMemMapFs() +afs := &afero.Afero{Fs: fs} +f, err := afs.TempFile("", "ioutil-test") +``` + +## Using Afero for Testing + +There is a large benefit to using a mock filesystem for testing. It has a +completely blank state every time it is initialized and can be easily +reproducible regardless of OS. You could create files to your heart’s content +and the file access would be fast while also saving you from all the annoying +issues with deleting temporary files, Windows file locking, etc. The MemMapFs +backend is perfect for testing. + +* Much faster than performing I/O operations on disk +* Avoid security issues and permissions +* Far more control. 'rm -rf /' with confidence +* Test setup is far more easier to do +* No test cleanup needed + +One way to accomplish this is to define a variable as mentioned above. +In your application this will be set to afero.NewOsFs() during testing you +can set it to afero.NewMemMapFs(). + +It wouldn't be uncommon to have each test initialize a blank slate memory +backend. To do this I would define my `appFS = afero.NewOsFs()` somewhere +appropriate in my application code. This approach ensures that Tests are order +independent, with no test relying on the state left by an earlier test. + +Then in my tests I would initialize a new MemMapFs for each test: +```go +func TestExist(t *testing.T) { + appFS := afero.NewMemMapFs() + // create test files and directories + appFS.MkdirAll("src/a", 0755) + afero.WriteFile(appFS, "src/a/b", []byte("file b"), 0644) + afero.WriteFile(appFS, "src/c", []byte("file c"), 0644) + name := "src/c" + _, err := appFS.Stat(name) + if os.IsNotExist(err) { + t.Errorf("file \"%s\" does not exist.\n", name) + } +} +``` + +# Available Backends + +## Operating System Native + +### OsFs + +The first is simply a wrapper around the native OS calls. This makes it +very easy to use as all of the calls are the same as the existing OS +calls. It also makes it trivial to have your code use the OS during +operation and a mock filesystem during testing or as needed. + +```go +appfs := afero.NewOsFs() +appfs.MkdirAll("src/a", 0755)) +``` + +## Memory Backed Storage + +### MemMapFs + +Afero also provides a fully atomic memory backed filesystem perfect for use in +mocking and to speed up unnecessary disk io when persistence isn’t +necessary. It is fully concurrent and will work within go routines +safely. + +```go +mm := afero.NewMemMapFs() +mm.MkdirAll("src/a", 0755)) +``` + +#### InMemoryFile + +As part of MemMapFs, Afero also provides an atomic, fully concurrent memory +backed file implementation. This can be used in other memory backed file +systems with ease. Plans are to add a radix tree memory stored file +system using InMemoryFile. + +## Network Interfaces + +### SftpFs + +Afero has experimental support for secure file transfer protocol (sftp). Which can +be used to perform file operations over a encrypted channel. + +## Filtering Backends + +### BasePathFs + +The BasePathFs restricts all operations to a given path within an Fs. +The given file name to the operations on this Fs will be prepended with +the base path before calling the source Fs. + +```go +bp := afero.NewBasePathFs(afero.NewOsFs(), "/base/path") +``` + +### ReadOnlyFs + +A thin wrapper around the source Fs providing a read only view. + +```go +fs := afero.NewReadOnlyFs(afero.NewOsFs()) +_, err := fs.Create("/file.txt") +// err = syscall.EPERM +``` + +# RegexpFs + +A filtered view on file names, any file NOT matching +the passed regexp will be treated as non-existing. +Files not matching the regexp provided will not be created. +Directories are not filtered. + +```go +fs := afero.NewRegexpFs(afero.NewMemMapFs(), regexp.MustCompile(`\.txt$`)) +_, err := fs.Create("/file.html") +// err = syscall.ENOENT +``` + +### HttpFs + +Afero provides an http compatible backend which can wrap any of the existing +backends. + +The Http package requires a slightly specific version of Open which +returns an http.File type. + +Afero provides an httpFs file system which satisfies this requirement. +Any Afero FileSystem can be used as an httpFs. + +```go +httpFs := afero.NewHttpFs() +fileserver := http.FileServer(httpFs.Dir())) +http.Handle("/", fileserver) +``` + +## Composite Backends + +Afero provides the ability have two filesystems (or more) act as a single +file system. + +### CacheOnReadFs + +The CacheOnReadFs will lazily make copies of any accessed files from the base +layer into the overlay. Subsequent reads will be pulled from the overlay +directly permitting the request is within the cache duration of when it was +created in the overlay. + +If the base filesystem is writeable, any changes to files will be +done first to the base, then to the overlay layer. Write calls to open file +handles like `Write()` or `Truncate()` to the overlay first. + +To writing files to the overlay only, you can use the overlay Fs directly (not +via the union Fs). + +Cache files in the layer for the given time.Duration, a cache duration of 0 +means "forever" meaning the file will not be re-requested from the base ever. + +A read-only base will make the overlay also read-only but still copy files +from the base to the overlay when they're not present (or outdated) in the +caching layer. + +```go +base := afero.NewOsFs() +layer := afero.NewMemMapFs() +ufs := afero.NewCacheOnReadFs(base, layer, 100 * time.Second) +``` + +### CopyOnWriteFs() + +The CopyOnWriteFs is a read only base file system with a potentially +writeable layer on top. + +Read operations will first look in the overlay and if not found there, will +serve the file from the base. + +Changes to the file system will only be made in the overlay. + +Any attempt to modify a file found only in the base will copy the file to the +overlay layer before modification (including opening a file with a writable +handle). + +Removing and Renaming files present only in the base layer is not currently +permitted. If a file is present in the base layer and the overlay, only the +overlay will be removed/renamed. + +```go + base := afero.NewOsFs() + roBase := afero.NewReadOnlyFs(base) + ufs := afero.NewCopyOnWriteFs(roBase, afero.NewMemMapFs()) + + fh, _ = ufs.Create("/home/test/file2.txt") + fh.WriteString("This is a test") + fh.Close() +``` + +In this example all write operations will only occur in memory (MemMapFs) +leaving the base filesystem (OsFs) untouched. + + +## Desired/possible backends + +The following is a short list of possible backends we hope someone will +implement: + +* SSH +* ZIP +* TAR +* S3 + +# About the project + +## What's in the name + +Afero comes from the latin roots Ad-Facere. + +**"Ad"** is a prefix meaning "to". + +**"Facere"** is a form of the root "faciō" making "make or do". + +The literal meaning of afero is "to make" or "to do" which seems very fitting +for a library that allows one to make files and directories and do things with them. + +The English word that shares the same roots as Afero is "affair". Affair shares +the same concept but as a noun it means "something that is made or done" or "an +object of a particular type". + +It's also nice that unlike some of my other libraries (hugo, cobra, viper) it +Googles very well. + +## Release Notes + +* **0.10.0** 2015.12.10 + * Full compatibility with Windows + * Introduction of afero utilities + * Test suite rewritten to work cross platform + * Normalize paths for MemMapFs + * Adding Sync to the file interface + * **Breaking Change** Walk and ReadDir have changed parameter order + * Moving types used by MemMapFs to a subpackage + * General bugfixes and improvements +* **0.9.0** 2015.11.05 + * New Walk function similar to filepath.Walk + * MemMapFs.OpenFile handles O_CREATE, O_APPEND, O_TRUNC + * MemMapFs.Remove now really deletes the file + * InMemoryFile.Readdir and Readdirnames work correctly + * InMemoryFile functions lock it for concurrent access + * Test suite improvements +* **0.8.0** 2014.10.28 + * First public version + * Interfaces feel ready for people to build using + * Interfaces satisfy all known uses + * MemMapFs passes the majority of the OS test suite + * OsFs passes the majority of the OS test suite + +## Contributing + +1. Fork it +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create new Pull Request + +## Contributors + +Names in no particular order: + +* [spf13](https://github.com/spf13) +* [jaqx0r](https://github.com/jaqx0r) +* [mbertschler](https://github.com/mbertschler) +* [xor-gate](https://github.com/xor-gate) + +## License + +Afero is released under the Apache 2.0 license. See +[LICENSE.txt](https://github.com/spf13/afero/blob/master/LICENSE.txt) diff --git a/vendor/github.com/spf13/cobra/.gitignore b/vendor/github.com/spf13/cobra/.gitignore new file mode 100644 index 000000000000..1b8c7c261167 --- /dev/null +++ b/vendor/github.com/spf13/cobra/.gitignore @@ -0,0 +1,36 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +# Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore +# swap +[._]*.s[a-w][a-z] +[._]s[a-w][a-z] +# session +Session.vim +# temporary +.netrwhist +*~ +# auto-generated tag files +tags + +*.exe + +cobra.test diff --git a/vendor/github.com/spf13/cobra/.mailmap b/vendor/github.com/spf13/cobra/.mailmap new file mode 100644 index 000000000000..94ec53068aa1 --- /dev/null +++ b/vendor/github.com/spf13/cobra/.mailmap @@ -0,0 +1,3 @@ +Steve Francia +Bjørn Erik Pedersen +Fabiano Franz diff --git a/vendor/github.com/spf13/cobra/README.md b/vendor/github.com/spf13/cobra/README.md new file mode 100644 index 000000000000..851fcc087cae --- /dev/null +++ b/vendor/github.com/spf13/cobra/README.md @@ -0,0 +1,736 @@ +![cobra logo](https://cloud.githubusercontent.com/assets/173412/10886352/ad566232-814f-11e5-9cd0-aa101788c117.png) + +Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files. + +Many of the most widely used Go projects are built using Cobra including: + +* [Kubernetes](http://kubernetes.io/) +* [Hugo](http://gohugo.io) +* [rkt](https://github.com/coreos/rkt) +* [etcd](https://github.com/coreos/etcd) +* [Moby (former Docker)](https://github.com/moby/moby) +* [Docker (distribution)](https://github.com/docker/distribution) +* [OpenShift](https://www.openshift.com/) +* [Delve](https://github.com/derekparker/delve) +* [GopherJS](http://www.gopherjs.org/) +* [CockroachDB](http://www.cockroachlabs.com/) +* [Bleve](http://www.blevesearch.com/) +* [ProjectAtomic (enterprise)](http://www.projectatomic.io/) +* [GiantSwarm's swarm](https://github.com/giantswarm/cli) +* [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack) +* [rclone](http://rclone.org/) +* [nehm](https://github.com/bogem/nehm) +* [Pouch](https://github.com/alibaba/pouch) + +[![Build Status](https://travis-ci.org/spf13/cobra.svg "Travis CI status")](https://travis-ci.org/spf13/cobra) +[![CircleCI status](https://circleci.com/gh/spf13/cobra.png?circle-token=:circle-token "CircleCI status")](https://circleci.com/gh/spf13/cobra) +[![GoDoc](https://godoc.org/github.com/spf13/cobra?status.svg)](https://godoc.org/github.com/spf13/cobra) + +# Table of Contents + +- [Overview](#overview) +- [Concepts](#concepts) + * [Commands](#commands) + * [Flags](#flags) +- [Installing](#installing) +- [Getting Started](#getting-started) + * [Using the Cobra Generator](#using-the-cobra-generator) + * [Using the Cobra Library](#using-the-cobra-library) + * [Working with Flags](#working-with-flags) + * [Positional and Custom Arguments](#positional-and-custom-arguments) + * [Example](#example) + * [Help Command](#help-command) + * [Usage Message](#usage-message) + * [PreRun and PostRun Hooks](#prerun-and-postrun-hooks) + * [Suggestions when "unknown command" happens](#suggestions-when-unknown-command-happens) + * [Generating documentation for your command](#generating-documentation-for-your-command) + * [Generating bash completions](#generating-bash-completions) +- [Contributing](#contributing) +- [License](#license) + +# Overview + +Cobra is a library providing a simple interface to create powerful modern CLI +interfaces similar to git & go tools. + +Cobra is also an application that will generate your application scaffolding to rapidly +develop a Cobra-based application. + +Cobra provides: +* Easy subcommand-based CLIs: `app server`, `app fetch`, etc. +* Fully POSIX-compliant flags (including short & long versions) +* Nested subcommands +* Global, local and cascading flags +* Easy generation of applications & commands with `cobra init appname` & `cobra add cmdname` +* Intelligent suggestions (`app srver`... did you mean `app server`?) +* Automatic help generation for commands and flags +* Automatic help flag recognition of `-h`, `--help`, etc. +* Automatically generated bash autocomplete for your application +* Automatically generated man pages for your application +* Command aliases so you can change things without breaking them +* The flexibility to define your own help, usage, etc. +* Optional tight integration with [viper](http://github.com/spf13/viper) for 12-factor apps + +# Concepts + +Cobra is built on a structure of commands, arguments & flags. + +**Commands** represent actions, **Args** are things and **Flags** are modifiers for those actions. + +The best applications will read like sentences when used. Users will know how +to use the application because they will natively understand how to use it. + +The pattern to follow is +`APPNAME VERB NOUN --ADJECTIVE.` + or +`APPNAME COMMAND ARG --FLAG` + +A few good real world examples may better illustrate this point. + +In the following example, 'server' is a command, and 'port' is a flag: + + hugo server --port=1313 + +In this command we are telling Git to clone the url bare. + + git clone URL --bare + +## Commands + +Command is the central point of the application. Each interaction that +the application supports will be contained in a Command. A command can +have children commands and optionally run an action. + +In the example above, 'server' is the command. + +[More about cobra.Command](https://godoc.org/github.com/spf13/cobra#Command) + +## Flags + +A flag is a way to modify the behavior of a command. Cobra supports +fully POSIX-compliant flags as well as the Go [flag package](https://golang.org/pkg/flag/). +A Cobra command can define flags that persist through to children commands +and flags that are only available to that command. + +In the example above, 'port' is the flag. + +Flag functionality is provided by the [pflag +library](https://github.com/spf13/pflag), a fork of the flag standard library +which maintains the same interface while adding POSIX compliance. + +# Installing +Using Cobra is easy. First, use `go get` to install the latest version +of the library. This command will install the `cobra` generator executable +along with the library and its dependencies: + + go get -u github.com/spf13/cobra/cobra + +Next, include Cobra in your application: + +```go +import "github.com/spf13/cobra" +``` + +# Getting Started + +While you are welcome to provide your own organization, typically a Cobra-based +application will follow the following organizational structure: + +``` + ▾ appName/ + ▾ cmd/ + add.go + your.go + commands.go + here.go + main.go +``` + +In a Cobra app, typically the main.go file is very bare. It serves one purpose: initializing Cobra. + +```go +package main + +import ( + "fmt" + "os" + + "{pathToYourApp}/cmd" +) + +func main() { + cmd.Execute() +} +``` + +## Using the Cobra Generator + +Cobra provides its own program that will create your application and add any +commands you want. It's the easiest way to incorporate Cobra into your application. + +[Here](https://github.com/spf13/cobra/blob/master/cobra/README.md) you can find more information about it. + +## Using the Cobra Library + +To manually implement Cobra you need to create a bare main.go file and a rootCmd file. +You will optionally provide additional commands as you see fit. + +### Create rootCmd + +Cobra doesn't require any special constructors. Simply create your commands. + +Ideally you place this in app/cmd/root.go: + +```go +var rootCmd = &cobra.Command{ + Use: "hugo", + Short: "Hugo is a very fast static site generator", + Long: `A Fast and Flexible Static Site Generator built with + love by spf13 and friends in Go. + Complete documentation is available at http://hugo.spf13.com`, + Run: func(cmd *cobra.Command, args []string) { + // Do Stuff Here + }, +} + +func Execute() { + if err := rootCmd.Execute(); err != nil { + fmt.Println(err) + os.Exit(1) + } +} +``` + +You will additionally define flags and handle configuration in your init() function. + +For example cmd/root.go: + +```go +import ( + "fmt" + "os" + + homedir "github.com/mitchellh/go-homedir" + "github.com/spf13/cobra" + "github.com/spf13/viper" +) + +func init() { + cobra.OnInitialize(initConfig) + rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cobra.yaml)") + rootCmd.PersistentFlags().StringVarP(&projectBase, "projectbase", "b", "", "base project directory eg. github.com/spf13/") + rootCmd.PersistentFlags().StringP("author", "a", "YOUR NAME", "Author name for copyright attribution") + rootCmd.PersistentFlags().StringVarP(&userLicense, "license", "l", "", "Name of license for the project (can provide `licensetext` in config)") + rootCmd.PersistentFlags().Bool("viper", true, "Use Viper for configuration") + viper.BindPFlag("author", rootCmd.PersistentFlags().Lookup("author")) + viper.BindPFlag("projectbase", rootCmd.PersistentFlags().Lookup("projectbase")) + viper.BindPFlag("useViper", rootCmd.PersistentFlags().Lookup("viper")) + viper.SetDefault("author", "NAME HERE ") + viper.SetDefault("license", "apache") +} + +func initConfig() { + // Don't forget to read config either from cfgFile or from home directory! + if cfgFile != "" { + // Use config file from the flag. + viper.SetConfigFile(cfgFile) + } else { + // Find home directory. + home, err := homedir.Dir() + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + // Search config in home directory with name ".cobra" (without extension). + viper.AddConfigPath(home) + viper.SetConfigName(".cobra") + } + + if err := viper.ReadInConfig(); err != nil { + fmt.Println("Can't read config:", err) + os.Exit(1) + } +} +``` + +### Create your main.go + +With the root command you need to have your main function execute it. +Execute should be run on the root for clarity, though it can be called on any command. + +In a Cobra app, typically the main.go file is very bare. It serves, one purpose, to initialize Cobra. + +```go +package main + +import ( + "fmt" + "os" + + "{pathToYourApp}/cmd" +) + +func main() { + cmd.Execute() +} +``` + +### Create additional commands + +Additional commands can be defined and typically are each given their own file +inside of the cmd/ directory. + +If you wanted to create a version command you would create cmd/version.go and +populate it with the following: + +```go +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +func init() { + rootCmd.AddCommand(versionCmd) +} + +var versionCmd = &cobra.Command{ + Use: "version", + Short: "Print the version number of Hugo", + Long: `All software has versions. This is Hugo's`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("Hugo Static Site Generator v0.9 -- HEAD") + }, +} +``` + +## Working with Flags + +Flags provide modifiers to control how the action command operates. + +### Assign flags to a command + +Since the flags are defined and used in different locations, we need to +define a variable outside with the correct scope to assign the flag to +work with. + +```go +var Verbose bool +var Source string +``` + +There are two different approaches to assign a flag. + +### Persistent Flags + +A flag can be 'persistent' meaning that this flag will be available to the +command it's assigned to as well as every command under that command. For +global flags, assign a flag as a persistent flag on the root. + +```go +rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose output") +``` + +### Local Flags + +A flag can also be assigned locally which will only apply to that specific command. + +```go +rootCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") +``` + +### Local Flag on Parent Commands + +By default Cobra only parses local flags on the target command, any local flags on +parent commands are ignored. By enabling `Command.TraverseChildren` Cobra will +parse local flags on each command before executing the target command. + +```go +command := cobra.Command{ + Use: "print [OPTIONS] [COMMANDS]", + TraverseChildren: true, +} +``` + +### Bind Flags with Config + +You can also bind your flags with [viper](https://github.com/spf13/viper): +```go +var author string + +func init() { + rootCmd.PersistentFlags().StringVar(&author, "author", "YOUR NAME", "Author name for copyright attribution") + viper.BindPFlag("author", rootCmd.PersistentFlags().Lookup("author")) +} +``` + +In this example the persistent flag `author` is bound with `viper`. +**Note**, that the variable `author` will not be set to the value from config, +when the `--author` flag is not provided by user. + +More in [viper documentation](https://github.com/spf13/viper#working-with-flags). + +### Required flags + +Flags are optional by default. If instead you wish your command to report an error +when a flag has not been set, mark it as required: +```go +rootCmd.Flags().StringVarP(&Region, "region", "r", "", "AWS region (required)") +rootCmd.MarkFlagRequired("region") +``` + +## Positional and Custom Arguments + +Validation of positional arguments can be specified using the `Args` field +of `Command`. + +The following validators are built in: + +- `NoArgs` - the command will report an error if there are any positional args. +- `ArbitraryArgs` - the command will accept any args. +- `OnlyValidArgs` - the command will report an error if there are any positional args that are not in the `ValidArgs` field of `Command`. +- `MinimumNArgs(int)` - the command will report an error if there are not at least N positional args. +- `MaximumNArgs(int)` - the command will report an error if there are more than N positional args. +- `ExactArgs(int)` - the command will report an error if there are not exactly N positional args. +- `RangeArgs(min, max)` - the command will report an error if the number of args is not between the minimum and maximum number of expected args. + +An example of setting the custom validator: + +```go +var cmd = &cobra.Command{ + Short: "hello", + Args: func(cmd *cobra.Command, args []string) error { + if len(args) < 1 { + return errors.New("requires at least one arg") + } + if myapp.IsValidColor(args[0]) { + return nil + } + return fmt.Errorf("invalid color specified: %s", args[0]) + }, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("Hello, World!") + }, +} +``` + +## Example + +In the example below, we have defined three commands. Two are at the top level +and one (cmdTimes) is a child of one of the top commands. In this case the root +is not executable meaning that a subcommand is required. This is accomplished +by not providing a 'Run' for the 'rootCmd'. + +We have only defined one flag for a single command. + +More documentation about flags is available at https://github.com/spf13/pflag + +```go +package main + +import ( + "fmt" + "strings" + + "github.com/spf13/cobra" +) + +func main() { + var echoTimes int + + var cmdPrint = &cobra.Command{ + Use: "print [string to print]", + Short: "Print anything to the screen", + Long: `print is for printing anything back to the screen. +For many years people have printed back to the screen.`, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("Print: " + strings.Join(args, " ")) + }, + } + + var cmdEcho = &cobra.Command{ + Use: "echo [string to echo]", + Short: "Echo anything to the screen", + Long: `echo is for echoing anything back. +Echo works a lot like print, except it has a child command.`, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("Print: " + strings.Join(args, " ")) + }, + } + + var cmdTimes = &cobra.Command{ + Use: "times [# times] [string to echo]", + Short: "Echo anything to the screen more times", + Long: `echo things multiple times back to the user by providing +a count and a string.`, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + for i := 0; i < echoTimes; i++ { + fmt.Println("Echo: " + strings.Join(args, " ")) + } + }, + } + + cmdTimes.Flags().IntVarP(&echoTimes, "times", "t", 1, "times to echo the input") + + var rootCmd = &cobra.Command{Use: "app"} + rootCmd.AddCommand(cmdPrint, cmdEcho) + cmdEcho.AddCommand(cmdTimes) + rootCmd.Execute() +} +``` + +For a more complete example of a larger application, please checkout [Hugo](http://gohugo.io/). + +## Help Command + +Cobra automatically adds a help command to your application when you have subcommands. +This will be called when a user runs 'app help'. Additionally, help will also +support all other commands as input. Say, for instance, you have a command called +'create' without any additional configuration; Cobra will work when 'app help +create' is called. Every command will automatically have the '--help' flag added. + +### Example + +The following output is automatically generated by Cobra. Nothing beyond the +command and flag definitions are needed. + + $ cobra help + + Cobra is a CLI library for Go that empowers applications. + This application is a tool to generate the needed files + to quickly create a Cobra application. + + Usage: + cobra [command] + + Available Commands: + add Add a command to a Cobra Application + help Help about any command + init Initialize a Cobra Application + + Flags: + -a, --author string author name for copyright attribution (default "YOUR NAME") + --config string config file (default is $HOME/.cobra.yaml) + -h, --help help for cobra + -l, --license string name of license for the project + --viper use Viper for configuration (default true) + + Use "cobra [command] --help" for more information about a command. + + +Help is just a command like any other. There is no special logic or behavior +around it. In fact, you can provide your own if you want. + +### Defining your own help + +You can provide your own Help command or your own template for the default command to use +with following functions: + +```go +cmd.SetHelpCommand(cmd *Command) +cmd.SetHelpFunc(f func(*Command, []string)) +cmd.SetHelpTemplate(s string) +``` + +The latter two will also apply to any children commands. + +## Usage Message + +When the user provides an invalid flag or invalid command, Cobra responds by +showing the user the 'usage'. + +### Example +You may recognize this from the help above. That's because the default help +embeds the usage as part of its output. + + $ cobra --invalid + Error: unknown flag: --invalid + Usage: + cobra [command] + + Available Commands: + add Add a command to a Cobra Application + help Help about any command + init Initialize a Cobra Application + + Flags: + -a, --author string author name for copyright attribution (default "YOUR NAME") + --config string config file (default is $HOME/.cobra.yaml) + -h, --help help for cobra + -l, --license string name of license for the project + --viper use Viper for configuration (default true) + + Use "cobra [command] --help" for more information about a command. + +### Defining your own usage +You can provide your own usage function or template for Cobra to use. +Like help, the function and template are overridable through public methods: + +```go +cmd.SetUsageFunc(f func(*Command) error) +cmd.SetUsageTemplate(s string) +``` + +## Version Flag + +Cobra adds a top-level '--version' flag if the Version field is set on the root command. +Running an application with the '--version' flag will print the version to stdout using +the version template. The template can be customized using the +`cmd.SetVersionTemplate(s string)` function. + +## PreRun and PostRun Hooks + +It is possible to run functions before or after the main `Run` function of your command. The `PersistentPreRun` and `PreRun` functions will be executed before `Run`. `PersistentPostRun` and `PostRun` will be executed after `Run`. The `Persistent*Run` functions will be inherited by children if they do not declare their own. These functions are run in the following order: + +- `PersistentPreRun` +- `PreRun` +- `Run` +- `PostRun` +- `PersistentPostRun` + +An example of two commands which use all of these features is below. When the subcommand is executed, it will run the root command's `PersistentPreRun` but not the root command's `PersistentPostRun`: + +```go +package main + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +func main() { + + var rootCmd = &cobra.Command{ + Use: "root [sub]", + Short: "My root command", + PersistentPreRun: func(cmd *cobra.Command, args []string) { + fmt.Printf("Inside rootCmd PersistentPreRun with args: %v\n", args) + }, + PreRun: func(cmd *cobra.Command, args []string) { + fmt.Printf("Inside rootCmd PreRun with args: %v\n", args) + }, + Run: func(cmd *cobra.Command, args []string) { + fmt.Printf("Inside rootCmd Run with args: %v\n", args) + }, + PostRun: func(cmd *cobra.Command, args []string) { + fmt.Printf("Inside rootCmd PostRun with args: %v\n", args) + }, + PersistentPostRun: func(cmd *cobra.Command, args []string) { + fmt.Printf("Inside rootCmd PersistentPostRun with args: %v\n", args) + }, + } + + var subCmd = &cobra.Command{ + Use: "sub [no options!]", + Short: "My subcommand", + PreRun: func(cmd *cobra.Command, args []string) { + fmt.Printf("Inside subCmd PreRun with args: %v\n", args) + }, + Run: func(cmd *cobra.Command, args []string) { + fmt.Printf("Inside subCmd Run with args: %v\n", args) + }, + PostRun: func(cmd *cobra.Command, args []string) { + fmt.Printf("Inside subCmd PostRun with args: %v\n", args) + }, + PersistentPostRun: func(cmd *cobra.Command, args []string) { + fmt.Printf("Inside subCmd PersistentPostRun with args: %v\n", args) + }, + } + + rootCmd.AddCommand(subCmd) + + rootCmd.SetArgs([]string{""}) + rootCmd.Execute() + fmt.Println() + rootCmd.SetArgs([]string{"sub", "arg1", "arg2"}) + rootCmd.Execute() +} +``` + +Output: +``` +Inside rootCmd PersistentPreRun with args: [] +Inside rootCmd PreRun with args: [] +Inside rootCmd Run with args: [] +Inside rootCmd PostRun with args: [] +Inside rootCmd PersistentPostRun with args: [] + +Inside rootCmd PersistentPreRun with args: [arg1 arg2] +Inside subCmd PreRun with args: [arg1 arg2] +Inside subCmd Run with args: [arg1 arg2] +Inside subCmd PostRun with args: [arg1 arg2] +Inside subCmd PersistentPostRun with args: [arg1 arg2] +``` + +## Suggestions when "unknown command" happens + +Cobra will print automatic suggestions when "unknown command" errors happen. This allows Cobra to behave similarly to the `git` command when a typo happens. For example: + +``` +$ hugo srever +Error: unknown command "srever" for "hugo" + +Did you mean this? + server + +Run 'hugo --help' for usage. +``` + +Suggestions are automatic based on every subcommand registered and use an implementation of [Levenshtein distance](http://en.wikipedia.org/wiki/Levenshtein_distance). Every registered command that matches a minimum distance of 2 (ignoring case) will be displayed as a suggestion. + +If you need to disable suggestions or tweak the string distance in your command, use: + +```go +command.DisableSuggestions = true +``` + +or + +```go +command.SuggestionsMinimumDistance = 1 +``` + +You can also explicitly set names for which a given command will be suggested using the `SuggestFor` attribute. This allows suggestions for strings that are not close in terms of string distance, but makes sense in your set of commands and for some which you don't want aliases. Example: + +``` +$ kubectl remove +Error: unknown command "remove" for "kubectl" + +Did you mean this? + delete + +Run 'kubectl help' for usage. +``` + +## Generating documentation for your command + +Cobra can generate documentation based on subcommands, flags, etc. in the following formats: + +- [Markdown](doc/md_docs.md) +- [ReStructured Text](doc/rest_docs.md) +- [Man Page](doc/man_docs.md) + +## Generating bash completions + +Cobra can generate a bash-completion file. If you add more information to your command, these completions can be amazingly powerful and flexible. Read more about it in [Bash Completions](bash_completions.md). + +# Contributing + +1. Fork it +2. Download your fork to your PC (`git clone https://github.com/your_username/cobra && cd cobra`) +3. Create your feature branch (`git checkout -b my-new-feature`) +4. Make changes and add them (`git add .`) +5. Commit your changes (`git commit -m 'Add some feature'`) +6. Push to the branch (`git push origin my-new-feature`) +7. Create new pull request + +# License + +Cobra is released under the Apache 2.0 license. See [LICENSE.txt](https://github.com/spf13/cobra/blob/master/LICENSE.txt) diff --git a/vendor/github.com/spf13/cobra/bash_completions.md b/vendor/github.com/spf13/cobra/bash_completions.md new file mode 100644 index 000000000000..49d068066fd3 --- /dev/null +++ b/vendor/github.com/spf13/cobra/bash_completions.md @@ -0,0 +1,256 @@ +# Generating Bash Completions For Your Own cobra.Command + +If you are using the generator you can create a completion command by running + +```bash +cobra add completion +``` + +Update the help text show how to install the bash_completion Linux show here [Kubectl docs show mac options](https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion) + +Writing the shell script to stdout allows the most flexible use. + +```go +// completionCmd represents the completion command +var completionCmd = &cobra.Command{ + Use: "completion", + Short: "Generates bash completion scripts", + Long: `To load completion run + +. <(bitbucket completion) + +To configure your bash shell to load completions for each session add to your bashrc + +# ~/.bashrc or ~/.profile +. <(bitbucket completion) +`, + Run: func(cmd *cobra.Command, args []string) { + rootCmd.GenBashCompletion(os.Stdout); + }, +} +``` + +**Note:** The cobra generator may include messages printed to stdout for example if the config file is loaded, this will break the auto complete script + + +## Example from kubectl + +Generating bash completions from a cobra command is incredibly easy. An actual program which does so for the kubernetes kubectl binary is as follows: + +```go +package main + +import ( + "io/ioutil" + "os" + + "k8s.io/kubernetes/pkg/kubectl/cmd" + "k8s.io/kubernetes/pkg/kubectl/cmd/util" +) + +func main() { + kubectl := cmd.NewKubectlCommand(util.NewFactory(nil), os.Stdin, ioutil.Discard, ioutil.Discard) + kubectl.GenBashCompletionFile("out.sh") +} +``` + +`out.sh` will get you completions of subcommands and flags. Copy it to `/etc/bash_completion.d/` as described [here](https://debian-administration.org/article/316/An_introduction_to_bash_completion_part_1) and reset your terminal to use autocompletion. If you make additional annotations to your code, you can get even more intelligent and flexible behavior. + +## Creating your own custom functions + +Some more actual code that works in kubernetes: + +```bash +const ( + bash_completion_func = `__kubectl_parse_get() +{ + local kubectl_output out + if kubectl_output=$(kubectl get --no-headers "$1" 2>/dev/null); then + out=($(echo "${kubectl_output}" | awk '{print $1}')) + COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) ) + fi +} + +__kubectl_get_resource() +{ + if [[ ${#nouns[@]} -eq 0 ]]; then + return 1 + fi + __kubectl_parse_get ${nouns[${#nouns[@]} -1]} + if [[ $? -eq 0 ]]; then + return 0 + fi +} + +__custom_func() { + case ${last_command} in + kubectl_get | kubectl_describe | kubectl_delete | kubectl_stop) + __kubectl_get_resource + return + ;; + *) + ;; + esac +} +`) +``` + +And then I set that in my command definition: + +```go +cmds := &cobra.Command{ + Use: "kubectl", + Short: "kubectl controls the Kubernetes cluster manager", + Long: `kubectl controls the Kubernetes cluster manager. + +Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`, + Run: runHelp, + BashCompletionFunction: bash_completion_func, +} +``` + +The `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__custom_func()` to be called when the built in processor was unable to find a solution. In the case of kubernetes a valid command might look something like `kubectl get pod [mypod]`. If you type `kubectl get pod [tab][tab]` the `__customc_func()` will run because the cobra.Command only understood "kubectl" and "get." `__custom_func()` will see that the cobra.Command is "kubectl_get" and will thus call another helper `__kubectl_get_resource()`. `__kubectl_get_resource` will look at the 'nouns' collected. In our example the only noun will be `pod`. So it will call `__kubectl_parse_get pod`. `__kubectl_parse_get` will actually call out to kubernetes and get any pods. It will then set `COMPREPLY` to valid pods! + +## Have the completions code complete your 'nouns' + +In the above example "pod" was assumed to already be typed. But if you want `kubectl get [tab][tab]` to show a list of valid "nouns" you have to set them. Simplified code from `kubectl get` looks like: + +```go +validArgs []string = { "pod", "node", "service", "replicationcontroller" } + +cmd := &cobra.Command{ + Use: "get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | RESOURCE/NAME ...)", + Short: "Display one or many resources", + Long: get_long, + Example: get_example, + Run: func(cmd *cobra.Command, args []string) { + err := RunGet(f, out, cmd, args) + util.CheckErr(err) + }, + ValidArgs: validArgs, +} +``` + +Notice we put the "ValidArgs" on the "get" subcommand. Doing so will give results like + +```bash +# kubectl get [tab][tab] +node pod replicationcontroller service +``` + +## Plural form and shortcuts for nouns + +If your nouns have a number of aliases, you can define them alongside `ValidArgs` using `ArgAliases`: + +```go +argAliases []string = { "pods", "nodes", "services", "svc", "replicationcontrollers", "rc" } + +cmd := &cobra.Command{ + ... + ValidArgs: validArgs, + ArgAliases: argAliases +} +``` + +The aliases are not shown to the user on tab completion, but they are accepted as valid nouns by +the completion algorithm if entered manually, e.g. in: + +```bash +# kubectl get rc [tab][tab] +backend frontend database +``` + +Note that without declaring `rc` as an alias, the completion algorithm would show the list of nouns +in this example again instead of the replication controllers. + +## Mark flags as required + +Most of the time completions will only show subcommands. But if a flag is required to make a subcommand work, you probably want it to show up when the user types [tab][tab]. Marking a flag as 'Required' is incredibly easy. + +```go +cmd.MarkFlagRequired("pod") +cmd.MarkFlagRequired("container") +``` + +and you'll get something like + +```bash +# kubectl exec [tab][tab][tab] +-c --container= -p --pod= +``` + +# Specify valid filename extensions for flags that take a filename + +In this example we use --filename= and expect to get a json or yaml file as the argument. To make this easier we annotate the --filename flag with valid filename extensions. + +```go + annotations := []string{"json", "yaml", "yml"} + annotation := make(map[string][]string) + annotation[cobra.BashCompFilenameExt] = annotations + + flag := &pflag.Flag{ + Name: "filename", + Shorthand: "f", + Usage: usage, + Value: value, + DefValue: value.String(), + Annotations: annotation, + } + cmd.Flags().AddFlag(flag) +``` + +Now when you run a command with this filename flag you'll get something like + +```bash +# kubectl create -f +test/ example/ rpmbuild/ +hello.yml test.json +``` + +So while there are many other files in the CWD it only shows me subdirs and those with valid extensions. + +# Specify custom flag completion + +Similar to the filename completion and filtering using cobra.BashCompFilenameExt, you can specify +a custom flag completion function with cobra.BashCompCustom: + +```go + annotation := make(map[string][]string) + annotation[cobra.BashCompCustom] = []string{"__kubectl_get_namespaces"} + + flag := &pflag.Flag{ + Name: "namespace", + Usage: usage, + Annotations: annotation, + } + cmd.Flags().AddFlag(flag) +``` + +In addition add the `__handle_namespace_flag` implementation in the `BashCompletionFunction` +value, e.g.: + +```bash +__kubectl_get_namespaces() +{ + local template + template="{{ range .items }}{{ .metadata.name }} {{ end }}" + local kubectl_out + if kubectl_out=$(kubectl get -o template --template="${template}" namespace 2>/dev/null); then + COMPREPLY=( $( compgen -W "${kubectl_out}[*]" -- "$cur" ) ) + fi +} +``` +# Using bash aliases for commands + +You can also configure the `bash aliases` for the commands and they will also support completions. + +```bash +alias aliasname=origcommand +complete -o default -F __start_origcommand aliasname + +# and now when you run `aliasname` completion will make +# suggestions as it did for `origcommand`. + +$) aliasname +completion firstcommand secondcommand +``` diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/add.go b/vendor/github.com/spf13/cobra/cobra/cmd/add.go deleted file mode 100644 index fb22096a39a5..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/add.go +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cmd - -import ( - "fmt" - "os" - "path/filepath" - "unicode" - - "github.com/spf13/cobra" -) - -func init() { - addCmd.Flags().StringVarP(&packageName, "package", "t", "", "target package name (e.g. github.com/spf13/hugo)") - addCmd.Flags().StringVarP(&parentName, "parent", "p", "rootCmd", "variable name of parent command for this command") -} - -var packageName, parentName string - -var addCmd = &cobra.Command{ - Use: "add [command name]", - Aliases: []string{"command"}, - Short: "Add a command to a Cobra Application", - Long: `Add (cobra add) will create a new command, with a license and -the appropriate structure for a Cobra-based CLI application, -and register it to its parent (default rootCmd). - -If you want your command to be public, pass in the command name -with an initial uppercase letter. - -Example: cobra add server -> resulting in a new cmd/server.go`, - - Run: func(cmd *cobra.Command, args []string) { - if len(args) < 1 { - er("add needs a name for the command") - } - - var project *Project - if packageName != "" { - project = NewProject(packageName) - } else { - wd, err := os.Getwd() - if err != nil { - er(err) - } - project = NewProjectFromPath(wd) - } - - cmdName := validateCmdName(args[0]) - cmdPath := filepath.Join(project.CmdPath(), cmdName+".go") - createCmdFile(project.License(), cmdPath, cmdName) - - fmt.Fprintln(cmd.OutOrStdout(), cmdName, "created at", cmdPath) - }, -} - -// validateCmdName returns source without any dashes and underscore. -// If there will be dash or underscore, next letter will be uppered. -// It supports only ASCII (1-byte character) strings. -// https://github.com/spf13/cobra/issues/269 -func validateCmdName(source string) string { - i := 0 - l := len(source) - // The output is initialized on demand, then first dash or underscore - // occurs. - var output string - - for i < l { - if source[i] == '-' || source[i] == '_' { - if output == "" { - output = source[:i] - } - - // If it's last rune and it's dash or underscore, - // don't add it output and break the loop. - if i == l-1 { - break - } - - // If next character is dash or underscore, - // just skip the current character. - if source[i+1] == '-' || source[i+1] == '_' { - i++ - continue - } - - // If the current character is dash or underscore, - // upper next letter and add to output. - output += string(unicode.ToUpper(rune(source[i+1]))) - // We know, what source[i] is dash or underscore and source[i+1] is - // uppered character, so make i = i+2. - i += 2 - continue - } - - // If the current character isn't dash or underscore, - // just add it. - if output != "" { - output += string(source[i]) - } - i++ - } - - if output == "" { - return source // source is initially valid name. - } - return output -} - -func createCmdFile(license License, path, cmdName string) { - template := `{{comment .copyright}} -{{if .license}}{{comment .license}}{{end}} - -package {{.cmdPackage}} - -import ( - "fmt" - - "github.com/spf13/cobra" -) - -// {{.cmdName}}Cmd represents the {{.cmdName}} command -var {{.cmdName}}Cmd = &cobra.Command{ - Use: "{{.cmdName}}", - Short: "A brief description of your command", - Long: ` + "`" + `A longer description that spans multiple lines and likely contains examples -and usage of using your command. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.` + "`" + `, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("{{.cmdName}} called") - }, -} - -func init() { - {{.parentName}}.AddCommand({{.cmdName}}Cmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // {{.cmdName}}Cmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // {{.cmdName}}Cmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") -} -` - - data := make(map[string]interface{}) - data["copyright"] = copyrightLine() - data["license"] = license.Header - data["cmdPackage"] = filepath.Base(filepath.Dir(path)) // last dir of path - data["parentName"] = parentName - data["cmdName"] = cmdName - - cmdScript, err := executeTemplate(template, data) - if err != nil { - er(err) - } - err = writeStringToFile(path, cmdScript) - if err != nil { - er(err) - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/helpers.go b/vendor/github.com/spf13/cobra/cobra/cmd/helpers.go deleted file mode 100644 index cd94b3e31c1d..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/helpers.go +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cmd - -import ( - "bytes" - "fmt" - "io" - "os" - "os/exec" - "path/filepath" - "strings" - "text/template" -) - -var srcPaths []string - -func init() { - // Initialize srcPaths. - envGoPath := os.Getenv("GOPATH") - goPaths := filepath.SplitList(envGoPath) - if len(goPaths) == 0 { - // Adapted from https://github.com/Masterminds/glide/pull/798/files. - // As of Go 1.8 the GOPATH is no longer required to be set. Instead there - // is a default value. If there is no GOPATH check for the default value. - // Note, checking the GOPATH first to avoid invoking the go toolchain if - // possible. - - goExecutable := os.Getenv("COBRA_GO_EXECUTABLE") - if len(goExecutable) <= 0 { - goExecutable = "go" - } - - out, err := exec.Command(goExecutable, "env", "GOPATH").Output() - if err != nil { - er(err) - } - - toolchainGoPath := strings.TrimSpace(string(out)) - goPaths = filepath.SplitList(toolchainGoPath) - if len(goPaths) == 0 { - er("$GOPATH is not set") - } - } - srcPaths = make([]string, 0, len(goPaths)) - for _, goPath := range goPaths { - srcPaths = append(srcPaths, filepath.Join(goPath, "src")) - } -} - -func er(msg interface{}) { - fmt.Println("Error:", msg) - os.Exit(1) -} - -// isEmpty checks if a given path is empty. -// Hidden files in path are ignored. -func isEmpty(path string) bool { - fi, err := os.Stat(path) - if err != nil { - er(err) - } - - if !fi.IsDir() { - return fi.Size() == 0 - } - - f, err := os.Open(path) - if err != nil { - er(err) - } - defer f.Close() - - names, err := f.Readdirnames(-1) - if err != nil && err != io.EOF { - er(err) - } - - for _, name := range names { - if len(name) > 0 && name[0] != '.' { - return false - } - } - return true -} - -// exists checks if a file or directory exists. -func exists(path string) bool { - if path == "" { - return false - } - _, err := os.Stat(path) - if err == nil { - return true - } - if !os.IsNotExist(err) { - er(err) - } - return false -} - -func executeTemplate(tmplStr string, data interface{}) (string, error) { - tmpl, err := template.New("").Funcs(template.FuncMap{"comment": commentifyString}).Parse(tmplStr) - if err != nil { - return "", err - } - - buf := new(bytes.Buffer) - err = tmpl.Execute(buf, data) - return buf.String(), err -} - -func writeStringToFile(path string, s string) error { - return writeToFile(path, strings.NewReader(s)) -} - -// writeToFile writes r to file with path only -// if file/directory on given path doesn't exist. -func writeToFile(path string, r io.Reader) error { - if exists(path) { - return fmt.Errorf("%v already exists", path) - } - - dir := filepath.Dir(path) - if dir != "" { - if err := os.MkdirAll(dir, 0777); err != nil { - return err - } - } - - file, err := os.Create(path) - if err != nil { - return err - } - defer file.Close() - - _, err = io.Copy(file, r) - return err -} - -// commentfyString comments every line of in. -func commentifyString(in string) string { - var newlines []string - lines := strings.Split(in, "\n") - for _, line := range lines { - if strings.HasPrefix(line, "//") { - newlines = append(newlines, line) - } else { - if line == "" { - newlines = append(newlines, "//") - } else { - newlines = append(newlines, "// "+line) - } - } - } - return strings.Join(newlines, "\n") -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/init.go b/vendor/github.com/spf13/cobra/cobra/cmd/init.go deleted file mode 100644 index d65e6c8c5910..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/init.go +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cmd - -import ( - "fmt" - "os" - "path" - "path/filepath" - - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -var initCmd = &cobra.Command{ - Use: "init [name]", - Aliases: []string{"initialize", "initialise", "create"}, - Short: "Initialize a Cobra Application", - Long: `Initialize (cobra init) will create a new application, with a license -and the appropriate structure for a Cobra-based CLI application. - - * If a name is provided, it will be created in the current directory; - * If no name is provided, the current directory will be assumed; - * If a relative path is provided, it will be created inside $GOPATH - (e.g. github.com/spf13/hugo); - * If an absolute path is provided, it will be created; - * If the directory already exists but is empty, it will be used. - -Init will not use an existing directory with contents.`, - - Run: func(cmd *cobra.Command, args []string) { - wd, err := os.Getwd() - if err != nil { - er(err) - } - - var project *Project - if len(args) == 0 { - project = NewProjectFromPath(wd) - } else if len(args) == 1 { - arg := args[0] - if arg[0] == '.' { - arg = filepath.Join(wd, arg) - } - if filepath.IsAbs(arg) { - project = NewProjectFromPath(arg) - } else { - project = NewProject(arg) - } - } else { - er("please provide only one argument") - } - - initializeProject(project) - - fmt.Fprintln(cmd.OutOrStdout(), `Your Cobra application is ready at -`+project.AbsPath()+` - -Give it a try by going there and running `+"`go run main.go`."+` -Add commands to it by running `+"`cobra add [cmdname]`.") - }, -} - -func initializeProject(project *Project) { - if !exists(project.AbsPath()) { // If path doesn't yet exist, create it - err := os.MkdirAll(project.AbsPath(), os.ModePerm) - if err != nil { - er(err) - } - } else if !isEmpty(project.AbsPath()) { // If path exists and is not empty don't use it - er("Cobra will not create a new project in a non empty directory: " + project.AbsPath()) - } - - // We have a directory and it's empty. Time to initialize it. - createLicenseFile(project.License(), project.AbsPath()) - createMainFile(project) - createRootCmdFile(project) -} - -func createLicenseFile(license License, path string) { - data := make(map[string]interface{}) - data["copyright"] = copyrightLine() - - // Generate license template from text and data. - text, err := executeTemplate(license.Text, data) - if err != nil { - er(err) - } - - // Write license text to LICENSE file. - err = writeStringToFile(filepath.Join(path, "LICENSE"), text) - if err != nil { - er(err) - } -} - -func createMainFile(project *Project) { - mainTemplate := `{{ comment .copyright }} -{{if .license}}{{ comment .license }}{{end}} - -package main - -import "{{ .importpath }}" - -func main() { - cmd.Execute() -} -` - data := make(map[string]interface{}) - data["copyright"] = copyrightLine() - data["license"] = project.License().Header - data["importpath"] = path.Join(project.Name(), filepath.Base(project.CmdPath())) - - mainScript, err := executeTemplate(mainTemplate, data) - if err != nil { - er(err) - } - - err = writeStringToFile(filepath.Join(project.AbsPath(), "main.go"), mainScript) - if err != nil { - er(err) - } -} - -func createRootCmdFile(project *Project) { - template := `{{comment .copyright}} -{{if .license}}{{comment .license}}{{end}} - -package cmd - -import ( - "fmt" - "os" -{{if .viper}} - homedir "github.com/mitchellh/go-homedir"{{end}} - "github.com/spf13/cobra"{{if .viper}} - "github.com/spf13/viper"{{end}} -){{if .viper}} - -var cfgFile string{{end}} - -// rootCmd represents the base command when called without any subcommands -var rootCmd = &cobra.Command{ - Use: "{{.appName}}", - Short: "A brief description of your application", - Long: ` + "`" + `A longer description that spans multiple lines and likely contains -examples and usage of using your application. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.` + "`" + `, - // Uncomment the following line if your bare application - // has an action associated with it: - // Run: func(cmd *cobra.Command, args []string) { }, -} - -// Execute adds all child commands to the root command and sets flags appropriately. -// This is called by main.main(). It only needs to happen once to the rootCmd. -func Execute() { - if err := rootCmd.Execute(); err != nil { - fmt.Println(err) - os.Exit(1) - } -} - -func init() { {{- if .viper}} - cobra.OnInitialize(initConfig) -{{end}} - // Here you will define your flags and configuration settings. - // Cobra supports persistent flags, which, if defined here, - // will be global for your application.{{ if .viper }} - rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.{{ .appName }}.yaml)"){{ else }} - // rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.{{ .appName }}.yaml)"){{ end }} - - // Cobra also supports local flags, which will only run - // when this action is called directly. - rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") -}{{ if .viper }} - -// initConfig reads in config file and ENV variables if set. -func initConfig() { - if cfgFile != "" { - // Use config file from the flag. - viper.SetConfigFile(cfgFile) - } else { - // Find home directory. - home, err := homedir.Dir() - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - // Search config in home directory with name ".{{ .appName }}" (without extension). - viper.AddConfigPath(home) - viper.SetConfigName(".{{ .appName }}") - } - - viper.AutomaticEnv() // read in environment variables that match - - // If a config file is found, read it in. - if err := viper.ReadInConfig(); err == nil { - fmt.Println("Using config file:", viper.ConfigFileUsed()) - } -}{{ end }} -` - - data := make(map[string]interface{}) - data["copyright"] = copyrightLine() - data["viper"] = viper.GetBool("useViper") - data["license"] = project.License().Header - data["appName"] = path.Base(project.Name()) - - rootCmdScript, err := executeTemplate(template, data) - if err != nil { - er(err) - } - - err = writeStringToFile(filepath.Join(project.CmdPath(), "root.go"), rootCmdScript) - if err != nil { - er(err) - } - -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_agpl.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_agpl.go deleted file mode 100644 index bc22e9732ba7..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_agpl.go +++ /dev/null @@ -1,683 +0,0 @@ -package cmd - -func initAgpl() { - Licenses["agpl"] = License{ - Name: "GNU Affero General Public License", - PossibleMatches: []string{"agpl", "affero gpl", "gnu agpl"}, - Header: ` -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see .`, - Text: ` GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_apache_2.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_apache_2.go deleted file mode 100644 index 38393d541714..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_apache_2.go +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initApache2() { - Licenses["apache"] = License{ - Name: "Apache 2.0", - PossibleMatches: []string{"apache", "apache20", "apache 2.0", "apache2.0", "apache-2.0"}, - Header: ` -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License.`, - Text: ` - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_2.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_2.go deleted file mode 100644 index 4a847e04a061..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_2.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initBsdClause2() { - Licenses["freebsd"] = License{ - Name: "Simplified BSD License", - PossibleMatches: []string{"freebsd", "simpbsd", "simple bsd", "2-clause bsd", - "2 clause bsd", "simplified bsd license"}, - Header: `All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE.`, - Text: `{{ .copyright }} -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_3.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_3.go deleted file mode 100644 index c7476b31f568..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_3.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initBsdClause3() { - Licenses["bsd"] = License{ - Name: "NewBSD", - PossibleMatches: []string{"bsd", "newbsd", "3 clause bsd", "3-clause bsd"}, - Header: `All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE.`, - Text: `{{ .copyright }} -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_2.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_2.go deleted file mode 100644 index 03e05b3a7eb4..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_2.go +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initGpl2() { - Licenses["gpl2"] = License{ - Name: "GNU General Public License 2.0", - PossibleMatches: []string{"gpl2", "gnu gpl2", "gplv2"}, - Header: ` -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program. If not, see .`, - Text: ` GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type 'show c' for details. - -The hypothetical commands 'show w' and 'show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than 'show w' and 'show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - 'Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_3.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_3.go deleted file mode 100644 index ce07679c77b5..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_3.go +++ /dev/null @@ -1,711 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initGpl3() { - Licenses["gpl3"] = License{ - Name: "GNU General Public License 3.0", - PossibleMatches: []string{"gpl3", "gplv3", "gpl", "gnu gpl3", "gnu gpl"}, - Header: ` -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see .`, - Text: ` GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type 'show c' for details. - -The hypothetical commands 'show w' and 'show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_lgpl.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_lgpl.go deleted file mode 100644 index 0f8b96cad03d..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_lgpl.go +++ /dev/null @@ -1,186 +0,0 @@ -package cmd - -func initLgpl() { - Licenses["lgpl"] = License{ - Name: "GNU Lesser General Public License", - PossibleMatches: []string{"lgpl", "lesser gpl", "gnu lgpl"}, - Header: ` -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program. If not, see .`, - Text: ` GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library.`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_mit.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_mit.go deleted file mode 100644 index bd2d0c4fa83b..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_mit.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initMit() { - Licenses["mit"] = License{ - Name: "MIT License", - PossibleMatches: []string{"mit"}, - Header: ` -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE.`, - Text: `The MIT License (MIT) - -{{ .copyright }} - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/licenses.go b/vendor/github.com/spf13/cobra/cobra/cmd/licenses.go deleted file mode 100644 index a070134ddc16..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/licenses.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -import ( - "strings" - "time" - - "github.com/spf13/viper" -) - -// Licenses contains all possible licenses a user can choose from. -var Licenses = make(map[string]License) - -// License represents a software license agreement, containing the Name of -// the license, its possible matches (on the command line as given to cobra), -// the header to be used with each file on the file's creating, and the text -// of the license -type License struct { - Name string // The type of license in use - PossibleMatches []string // Similar names to guess - Text string // License text data - Header string // License header for source files -} - -func init() { - // Allows a user to not use a license. - Licenses["none"] = License{"None", []string{"none", "false"}, "", ""} - - initApache2() - initMit() - initBsdClause3() - initBsdClause2() - initGpl2() - initGpl3() - initLgpl() - initAgpl() -} - -// getLicense returns license specified by user in flag or in config. -// If user didn't specify the license, it returns Apache License 2.0. -// -// TODO: Inspect project for existing license -func getLicense() License { - // If explicitly flagged, use that. - if userLicense != "" { - return findLicense(userLicense) - } - - // If user wants to have custom license, use that. - if viper.IsSet("license.header") || viper.IsSet("license.text") { - return License{Header: viper.GetString("license.header"), - Text: viper.GetString("license.text")} - } - - // If user wants to have built-in license, use that. - if viper.IsSet("license") { - return findLicense(viper.GetString("license")) - } - - // If user didn't set any license, use Apache 2.0 by default. - return Licenses["apache"] -} - -func copyrightLine() string { - author := viper.GetString("author") - - year := viper.GetString("year") // For tests. - if year == "" { - year = time.Now().Format("2006") - } - - return "Copyright © " + year + " " + author -} - -// findLicense looks for License object of built-in licenses. -// If it didn't find license, then the app will be terminated and -// error will be printed. -func findLicense(name string) License { - found := matchLicense(name) - if found == "" { - er("unknown license: " + name) - } - return Licenses[found] -} - -// matchLicense compares the given a license name -// to PossibleMatches of all built-in licenses. -// It returns blank string, if name is blank string or it didn't find -// then appropriate match to name. -func matchLicense(name string) string { - if name == "" { - return "" - } - - for key, lic := range Licenses { - for _, match := range lic.PossibleMatches { - if strings.EqualFold(name, match) { - return key - } - } - } - - return "" -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/project.go b/vendor/github.com/spf13/cobra/cobra/cmd/project.go deleted file mode 100644 index 7ddb8258571d..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/project.go +++ /dev/null @@ -1,200 +0,0 @@ -package cmd - -import ( - "os" - "path/filepath" - "runtime" - "strings" -) - -// Project contains name, license and paths to projects. -type Project struct { - absPath string - cmdPath string - srcPath string - license License - name string -} - -// NewProject returns Project with specified project name. -func NewProject(projectName string) *Project { - if projectName == "" { - er("can't create project with blank name") - } - - p := new(Project) - p.name = projectName - - // 1. Find already created protect. - p.absPath = findPackage(projectName) - - // 2. If there are no created project with this path, and user is in GOPATH, - // then use GOPATH/src/projectName. - if p.absPath == "" { - wd, err := os.Getwd() - if err != nil { - er(err) - } - for _, srcPath := range srcPaths { - goPath := filepath.Dir(srcPath) - if filepathHasPrefix(wd, goPath) { - p.absPath = filepath.Join(srcPath, projectName) - break - } - } - } - - // 3. If user is not in GOPATH, then use (first GOPATH)/src/projectName. - if p.absPath == "" { - p.absPath = filepath.Join(srcPaths[0], projectName) - } - - return p -} - -// findPackage returns full path to existing go package in GOPATHs. -func findPackage(packageName string) string { - if packageName == "" { - return "" - } - - for _, srcPath := range srcPaths { - packagePath := filepath.Join(srcPath, packageName) - if exists(packagePath) { - return packagePath - } - } - - return "" -} - -// NewProjectFromPath returns Project with specified absolute path to -// package. -func NewProjectFromPath(absPath string) *Project { - if absPath == "" { - er("can't create project: absPath can't be blank") - } - if !filepath.IsAbs(absPath) { - er("can't create project: absPath is not absolute") - } - - // If absPath is symlink, use its destination. - fi, err := os.Lstat(absPath) - if err != nil { - er("can't read path info: " + err.Error()) - } - if fi.Mode()&os.ModeSymlink != 0 { - path, err := os.Readlink(absPath) - if err != nil { - er("can't read the destination of symlink: " + err.Error()) - } - absPath = path - } - - p := new(Project) - p.absPath = strings.TrimSuffix(absPath, findCmdDir(absPath)) - p.name = filepath.ToSlash(trimSrcPath(p.absPath, p.SrcPath())) - return p -} - -// trimSrcPath trims at the beginning of absPath the srcPath. -func trimSrcPath(absPath, srcPath string) string { - relPath, err := filepath.Rel(srcPath, absPath) - if err != nil { - er(err) - } - return relPath -} - -// License returns the License object of project. -func (p *Project) License() License { - if p.license.Text == "" && p.license.Name != "None" { - p.license = getLicense() - } - return p.license -} - -// Name returns the name of project, e.g. "github.com/spf13/cobra" -func (p Project) Name() string { - return p.name -} - -// CmdPath returns absolute path to directory, where all commands are located. -func (p *Project) CmdPath() string { - if p.absPath == "" { - return "" - } - if p.cmdPath == "" { - p.cmdPath = filepath.Join(p.absPath, findCmdDir(p.absPath)) - } - return p.cmdPath -} - -// findCmdDir checks if base of absPath is cmd dir and returns it or -// looks for existing cmd dir in absPath. -func findCmdDir(absPath string) string { - if !exists(absPath) || isEmpty(absPath) { - return "cmd" - } - - if isCmdDir(absPath) { - return filepath.Base(absPath) - } - - files, _ := filepath.Glob(filepath.Join(absPath, "c*")) - for _, file := range files { - if isCmdDir(file) { - return filepath.Base(file) - } - } - - return "cmd" -} - -// isCmdDir checks if base of name is one of cmdDir. -func isCmdDir(name string) bool { - name = filepath.Base(name) - for _, cmdDir := range []string{"cmd", "cmds", "command", "commands"} { - if name == cmdDir { - return true - } - } - return false -} - -// AbsPath returns absolute path of project. -func (p Project) AbsPath() string { - return p.absPath -} - -// SrcPath returns absolute path to $GOPATH/src where project is located. -func (p *Project) SrcPath() string { - if p.srcPath != "" { - return p.srcPath - } - if p.absPath == "" { - p.srcPath = srcPaths[0] - return p.srcPath - } - - for _, srcPath := range srcPaths { - if filepathHasPrefix(p.absPath, srcPath) { - p.srcPath = srcPath - break - } - } - - return p.srcPath -} - -func filepathHasPrefix(path string, prefix string) bool { - if len(path) <= len(prefix) { - return false - } - if runtime.GOOS == "windows" { - // Paths in windows are case-insensitive. - return strings.EqualFold(path[0:len(prefix)], prefix) - } - return path[0:len(prefix)] == prefix - -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/root.go b/vendor/github.com/spf13/cobra/cobra/cmd/root.go deleted file mode 100644 index 19568f98024d..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/root.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cmd - -import ( - "fmt" - - homedir "github.com/mitchellh/go-homedir" - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -var ( - // Used for flags. - cfgFile, userLicense string - - rootCmd = &cobra.Command{ - Use: "cobra", - Short: "A generator for Cobra based Applications", - Long: `Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, - } -) - -// Execute executes the root command. -func Execute() { - rootCmd.Execute() -} - -func init() { - cobra.OnInitialize(initConfig) - - rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cobra.yaml)") - rootCmd.PersistentFlags().StringP("author", "a", "YOUR NAME", "author name for copyright attribution") - rootCmd.PersistentFlags().StringVarP(&userLicense, "license", "l", "", "name of license for the project") - rootCmd.PersistentFlags().Bool("viper", true, "use Viper for configuration") - viper.BindPFlag("author", rootCmd.PersistentFlags().Lookup("author")) - viper.BindPFlag("useViper", rootCmd.PersistentFlags().Lookup("viper")) - viper.SetDefault("author", "NAME HERE ") - viper.SetDefault("license", "apache") - - rootCmd.AddCommand(addCmd) - rootCmd.AddCommand(initCmd) -} - -func initConfig() { - if cfgFile != "" { - // Use config file from the flag. - viper.SetConfigFile(cfgFile) - } else { - // Find home directory. - home, err := homedir.Dir() - if err != nil { - er(err) - } - - // Search config in home directory with name ".cobra" (without extension). - viper.AddConfigPath(home) - viper.SetConfigName(".cobra") - } - - viper.AutomaticEnv() - - if err := viper.ReadInConfig(); err == nil { - fmt.Println("Using config file:", viper.ConfigFileUsed()) - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/testdata/LICENSE.golden b/vendor/github.com/spf13/cobra/cobra/cmd/testdata/LICENSE.golden deleted file mode 100644 index d64569567334..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/testdata/LICENSE.golden +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/spf13/cobra/cobra/main.go b/vendor/github.com/spf13/cobra/cobra/main.go deleted file mode 100644 index c3a9d9cb04c2..000000000000 --- a/vendor/github.com/spf13/cobra/cobra/main.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import "github.com/spf13/cobra/cobra/cmd" - -func main() { - cmd.Execute() -} diff --git a/vendor/github.com/spf13/cobra/doc/man_docs.go b/vendor/github.com/spf13/cobra/doc/man_docs.go deleted file mode 100644 index baa48118a691..000000000000 --- a/vendor/github.com/spf13/cobra/doc/man_docs.go +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2015 Red Hat Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package doc - -import ( - "bytes" - "fmt" - "io" - "os" - "path/filepath" - "sort" - "strings" - "time" - - "github.com/cpuguy83/go-md2man/md2man" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -// GenManTree will generate a man page for this command and all descendants -// in the directory given. The header may be nil. This function may not work -// correctly if your command names have `-` in them. If you have `cmd` with two -// subcmds, `sub` and `sub-third`, and `sub` has a subcommand called `third` -// it is undefined which help output will be in the file `cmd-sub-third.1`. -func GenManTree(cmd *cobra.Command, header *GenManHeader, dir string) error { - return GenManTreeFromOpts(cmd, GenManTreeOptions{ - Header: header, - Path: dir, - CommandSeparator: "-", - }) -} - -// GenManTreeFromOpts generates a man page for the command and all descendants. -// The pages are written to the opts.Path directory. -func GenManTreeFromOpts(cmd *cobra.Command, opts GenManTreeOptions) error { - header := opts.Header - if header == nil { - header = &GenManHeader{} - } - for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() { - continue - } - if err := GenManTreeFromOpts(c, opts); err != nil { - return err - } - } - section := "1" - if header.Section != "" { - section = header.Section - } - - separator := "_" - if opts.CommandSeparator != "" { - separator = opts.CommandSeparator - } - basename := strings.Replace(cmd.CommandPath(), " ", separator, -1) - filename := filepath.Join(opts.Path, basename+"."+section) - f, err := os.Create(filename) - if err != nil { - return err - } - defer f.Close() - - headerCopy := *header - return GenMan(cmd, &headerCopy, f) -} - -// GenManTreeOptions is the options for generating the man pages. -// Used only in GenManTreeFromOpts. -type GenManTreeOptions struct { - Header *GenManHeader - Path string - CommandSeparator string -} - -// GenManHeader is a lot like the .TH header at the start of man pages. These -// include the title, section, date, source, and manual. We will use the -// current time if Date if unset and will use "Auto generated by spf13/cobra" -// if the Source is unset. -type GenManHeader struct { - Title string - Section string - Date *time.Time - date string - Source string - Manual string -} - -// GenMan will generate a man page for the given command and write it to -// w. The header argument may be nil, however obviously w may not. -func GenMan(cmd *cobra.Command, header *GenManHeader, w io.Writer) error { - if header == nil { - header = &GenManHeader{} - } - fillHeader(header, cmd.CommandPath()) - - b := genMan(cmd, header) - _, err := w.Write(md2man.Render(b)) - return err -} - -func fillHeader(header *GenManHeader, name string) { - if header.Title == "" { - header.Title = strings.ToUpper(strings.Replace(name, " ", "\\-", -1)) - } - if header.Section == "" { - header.Section = "1" - } - if header.Date == nil { - now := time.Now() - header.Date = &now - } - header.date = (*header.Date).Format("Jan 2006") - if header.Source == "" { - header.Source = "Auto generated by spf13/cobra" - } -} - -func manPreamble(buf *bytes.Buffer, header *GenManHeader, cmd *cobra.Command, dashedName string) { - description := cmd.Long - if len(description) == 0 { - description = cmd.Short - } - - buf.WriteString(fmt.Sprintf(`%% %s(%s)%s -%% %s -%% %s -# NAME -`, header.Title, header.Section, header.date, header.Source, header.Manual)) - buf.WriteString(fmt.Sprintf("%s \\- %s\n\n", dashedName, cmd.Short)) - buf.WriteString("# SYNOPSIS\n") - buf.WriteString(fmt.Sprintf("**%s**\n\n", cmd.UseLine())) - buf.WriteString("# DESCRIPTION\n") - buf.WriteString(description + "\n\n") -} - -func manPrintFlags(buf *bytes.Buffer, flags *pflag.FlagSet) { - flags.VisitAll(func(flag *pflag.Flag) { - if len(flag.Deprecated) > 0 || flag.Hidden { - return - } - format := "" - if len(flag.Shorthand) > 0 && len(flag.ShorthandDeprecated) == 0 { - format = fmt.Sprintf("**-%s**, **--%s**", flag.Shorthand, flag.Name) - } else { - format = fmt.Sprintf("**--%s**", flag.Name) - } - if len(flag.NoOptDefVal) > 0 { - format += "[" - } - if flag.Value.Type() == "string" { - // put quotes on the value - format += "=%q" - } else { - format += "=%s" - } - if len(flag.NoOptDefVal) > 0 { - format += "]" - } - format += "\n\t%s\n\n" - buf.WriteString(fmt.Sprintf(format, flag.DefValue, flag.Usage)) - }) -} - -func manPrintOptions(buf *bytes.Buffer, command *cobra.Command) { - flags := command.NonInheritedFlags() - if flags.HasAvailableFlags() { - buf.WriteString("# OPTIONS\n") - manPrintFlags(buf, flags) - buf.WriteString("\n") - } - flags = command.InheritedFlags() - if flags.HasAvailableFlags() { - buf.WriteString("# OPTIONS INHERITED FROM PARENT COMMANDS\n") - manPrintFlags(buf, flags) - buf.WriteString("\n") - } -} - -func genMan(cmd *cobra.Command, header *GenManHeader) []byte { - cmd.InitDefaultHelpCmd() - cmd.InitDefaultHelpFlag() - - // something like `rootcmd-subcmd1-subcmd2` - dashCommandName := strings.Replace(cmd.CommandPath(), " ", "-", -1) - - buf := new(bytes.Buffer) - - manPreamble(buf, header, cmd, dashCommandName) - manPrintOptions(buf, cmd) - if len(cmd.Example) > 0 { - buf.WriteString("# EXAMPLE\n") - buf.WriteString(fmt.Sprintf("```\n%s\n```\n", cmd.Example)) - } - if hasSeeAlso(cmd) { - buf.WriteString("# SEE ALSO\n") - seealsos := make([]string, 0) - if cmd.HasParent() { - parentPath := cmd.Parent().CommandPath() - dashParentPath := strings.Replace(parentPath, " ", "-", -1) - seealso := fmt.Sprintf("**%s(%s)**", dashParentPath, header.Section) - seealsos = append(seealsos, seealso) - cmd.VisitParents(func(c *cobra.Command) { - if c.DisableAutoGenTag { - cmd.DisableAutoGenTag = c.DisableAutoGenTag - } - }) - } - children := cmd.Commands() - sort.Sort(byName(children)) - for _, c := range children { - if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() { - continue - } - seealso := fmt.Sprintf("**%s-%s(%s)**", dashCommandName, c.Name(), header.Section) - seealsos = append(seealsos, seealso) - } - buf.WriteString(strings.Join(seealsos, ", ") + "\n") - } - if !cmd.DisableAutoGenTag { - buf.WriteString(fmt.Sprintf("# HISTORY\n%s Auto generated by spf13/cobra\n", header.Date.Format("2-Jan-2006"))) - } - return buf.Bytes() -} diff --git a/vendor/github.com/spf13/cobra/doc/md_docs.go b/vendor/github.com/spf13/cobra/doc/md_docs.go deleted file mode 100644 index d76f6d5ecb45..000000000000 --- a/vendor/github.com/spf13/cobra/doc/md_docs.go +++ /dev/null @@ -1,159 +0,0 @@ -//Copyright 2015 Red Hat Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package doc - -import ( - "bytes" - "fmt" - "io" - "os" - "path/filepath" - "sort" - "strings" - "time" - - "github.com/spf13/cobra" -) - -func printOptions(buf *bytes.Buffer, cmd *cobra.Command, name string) error { - flags := cmd.NonInheritedFlags() - flags.SetOutput(buf) - if flags.HasAvailableFlags() { - buf.WriteString("### Options\n\n```\n") - flags.PrintDefaults() - buf.WriteString("```\n\n") - } - - parentFlags := cmd.InheritedFlags() - parentFlags.SetOutput(buf) - if parentFlags.HasAvailableFlags() { - buf.WriteString("### Options inherited from parent commands\n\n```\n") - parentFlags.PrintDefaults() - buf.WriteString("```\n\n") - } - return nil -} - -// GenMarkdown creates markdown output. -func GenMarkdown(cmd *cobra.Command, w io.Writer) error { - return GenMarkdownCustom(cmd, w, func(s string) string { return s }) -} - -// GenMarkdownCustom creates custom markdown output. -func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string) string) error { - cmd.InitDefaultHelpCmd() - cmd.InitDefaultHelpFlag() - - buf := new(bytes.Buffer) - name := cmd.CommandPath() - - short := cmd.Short - long := cmd.Long - if len(long) == 0 { - long = short - } - - buf.WriteString("## " + name + "\n\n") - buf.WriteString(short + "\n\n") - buf.WriteString("### Synopsis\n\n") - buf.WriteString(long + "\n\n") - - if cmd.Runnable() { - buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.UseLine())) - } - - if len(cmd.Example) > 0 { - buf.WriteString("### Examples\n\n") - buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.Example)) - } - - if err := printOptions(buf, cmd, name); err != nil { - return err - } - if hasSeeAlso(cmd) { - buf.WriteString("### SEE ALSO\n\n") - if cmd.HasParent() { - parent := cmd.Parent() - pname := parent.CommandPath() - link := pname + ".md" - link = strings.Replace(link, " ", "_", -1) - buf.WriteString(fmt.Sprintf("* [%s](%s)\t - %s\n", pname, linkHandler(link), parent.Short)) - cmd.VisitParents(func(c *cobra.Command) { - if c.DisableAutoGenTag { - cmd.DisableAutoGenTag = c.DisableAutoGenTag - } - }) - } - - children := cmd.Commands() - sort.Sort(byName(children)) - - for _, child := range children { - if !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() { - continue - } - cname := name + " " + child.Name() - link := cname + ".md" - link = strings.Replace(link, " ", "_", -1) - buf.WriteString(fmt.Sprintf("* [%s](%s)\t - %s\n", cname, linkHandler(link), child.Short)) - } - buf.WriteString("\n") - } - if !cmd.DisableAutoGenTag { - buf.WriteString("###### Auto generated by spf13/cobra on " + time.Now().Format("2-Jan-2006") + "\n") - } - _, err := buf.WriteTo(w) - return err -} - -// GenMarkdownTree will generate a markdown page for this command and all -// descendants in the directory given. The header may be nil. -// This function may not work correctly if your command names have `-` in them. -// If you have `cmd` with two subcmds, `sub` and `sub-third`, -// and `sub` has a subcommand called `third`, it is undefined which -// help output will be in the file `cmd-sub-third.1`. -func GenMarkdownTree(cmd *cobra.Command, dir string) error { - identity := func(s string) string { return s } - emptyStr := func(s string) string { return "" } - return GenMarkdownTreeCustom(cmd, dir, emptyStr, identity) -} - -// GenMarkdownTreeCustom is the the same as GenMarkdownTree, but -// with custom filePrepender and linkHandler. -func GenMarkdownTreeCustom(cmd *cobra.Command, dir string, filePrepender, linkHandler func(string) string) error { - for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() { - continue - } - if err := GenMarkdownTreeCustom(c, dir, filePrepender, linkHandler); err != nil { - return err - } - } - - basename := strings.Replace(cmd.CommandPath(), " ", "_", -1) + ".md" - filename := filepath.Join(dir, basename) - f, err := os.Create(filename) - if err != nil { - return err - } - defer f.Close() - - if _, err := io.WriteString(f, filePrepender(filename)); err != nil { - return err - } - if err := GenMarkdownCustom(cmd, f, linkHandler); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/spf13/cobra/doc/rest_docs.go b/vendor/github.com/spf13/cobra/doc/rest_docs.go deleted file mode 100644 index 051d8dc832a4..000000000000 --- a/vendor/github.com/spf13/cobra/doc/rest_docs.go +++ /dev/null @@ -1,185 +0,0 @@ -//Copyright 2015 Red Hat Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package doc - -import ( - "bytes" - "fmt" - "io" - "os" - "path/filepath" - "sort" - "strings" - "time" - - "github.com/spf13/cobra" -) - -func printOptionsReST(buf *bytes.Buffer, cmd *cobra.Command, name string) error { - flags := cmd.NonInheritedFlags() - flags.SetOutput(buf) - if flags.HasAvailableFlags() { - buf.WriteString("Options\n") - buf.WriteString("~~~~~~~\n\n::\n\n") - flags.PrintDefaults() - buf.WriteString("\n") - } - - parentFlags := cmd.InheritedFlags() - parentFlags.SetOutput(buf) - if parentFlags.HasAvailableFlags() { - buf.WriteString("Options inherited from parent commands\n") - buf.WriteString("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n") - parentFlags.PrintDefaults() - buf.WriteString("\n") - } - return nil -} - -// linkHandler for default ReST hyperlink markup -func defaultLinkHandler(name, ref string) string { - return fmt.Sprintf("`%s <%s.rst>`_", name, ref) -} - -// GenReST creates reStructured Text output. -func GenReST(cmd *cobra.Command, w io.Writer) error { - return GenReSTCustom(cmd, w, defaultLinkHandler) -} - -// GenReSTCustom creates custom reStructured Text output. -func GenReSTCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string, string) string) error { - cmd.InitDefaultHelpCmd() - cmd.InitDefaultHelpFlag() - - buf := new(bytes.Buffer) - name := cmd.CommandPath() - - short := cmd.Short - long := cmd.Long - if len(long) == 0 { - long = short - } - ref := strings.Replace(name, " ", "_", -1) - - buf.WriteString(".. _" + ref + ":\n\n") - buf.WriteString(name + "\n") - buf.WriteString(strings.Repeat("-", len(name)) + "\n\n") - buf.WriteString(short + "\n\n") - buf.WriteString("Synopsis\n") - buf.WriteString("~~~~~~~~\n\n") - buf.WriteString("\n" + long + "\n\n") - - if cmd.Runnable() { - buf.WriteString(fmt.Sprintf("::\n\n %s\n\n", cmd.UseLine())) - } - - if len(cmd.Example) > 0 { - buf.WriteString("Examples\n") - buf.WriteString("~~~~~~~~\n\n") - buf.WriteString(fmt.Sprintf("::\n\n%s\n\n", indentString(cmd.Example, " "))) - } - - if err := printOptionsReST(buf, cmd, name); err != nil { - return err - } - if hasSeeAlso(cmd) { - buf.WriteString("SEE ALSO\n") - buf.WriteString("~~~~~~~~\n\n") - if cmd.HasParent() { - parent := cmd.Parent() - pname := parent.CommandPath() - ref = strings.Replace(pname, " ", "_", -1) - buf.WriteString(fmt.Sprintf("* %s \t - %s\n", linkHandler(pname, ref), parent.Short)) - cmd.VisitParents(func(c *cobra.Command) { - if c.DisableAutoGenTag { - cmd.DisableAutoGenTag = c.DisableAutoGenTag - } - }) - } - - children := cmd.Commands() - sort.Sort(byName(children)) - - for _, child := range children { - if !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() { - continue - } - cname := name + " " + child.Name() - ref = strings.Replace(cname, " ", "_", -1) - buf.WriteString(fmt.Sprintf("* %s \t - %s\n", linkHandler(cname, ref), child.Short)) - } - buf.WriteString("\n") - } - if !cmd.DisableAutoGenTag { - buf.WriteString("*Auto generated by spf13/cobra on " + time.Now().Format("2-Jan-2006") + "*\n") - } - _, err := buf.WriteTo(w) - return err -} - -// GenReSTTree will generate a ReST page for this command and all -// descendants in the directory given. -// This function may not work correctly if your command names have `-` in them. -// If you have `cmd` with two subcmds, `sub` and `sub-third`, -// and `sub` has a subcommand called `third`, it is undefined which -// help output will be in the file `cmd-sub-third.1`. -func GenReSTTree(cmd *cobra.Command, dir string) error { - emptyStr := func(s string) string { return "" } - return GenReSTTreeCustom(cmd, dir, emptyStr, defaultLinkHandler) -} - -// GenReSTTreeCustom is the the same as GenReSTTree, but -// with custom filePrepender and linkHandler. -func GenReSTTreeCustom(cmd *cobra.Command, dir string, filePrepender func(string) string, linkHandler func(string, string) string) error { - for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() { - continue - } - if err := GenReSTTreeCustom(c, dir, filePrepender, linkHandler); err != nil { - return err - } - } - - basename := strings.Replace(cmd.CommandPath(), " ", "_", -1) + ".rst" - filename := filepath.Join(dir, basename) - f, err := os.Create(filename) - if err != nil { - return err - } - defer f.Close() - - if _, err := io.WriteString(f, filePrepender(filename)); err != nil { - return err - } - if err := GenReSTCustom(cmd, f, linkHandler); err != nil { - return err - } - return nil -} - -// adapted from: https://github.com/kr/text/blob/main/indent.go -func indentString(s, p string) string { - var res []byte - b := []byte(s) - prefix := []byte(p) - bol := true - for _, c := range b { - if bol && c != '\n' { - res = append(res, prefix...) - } - res = append(res, c) - bol = c == '\n' - } - return string(res) -} diff --git a/vendor/github.com/spf13/cobra/doc/util.go b/vendor/github.com/spf13/cobra/doc/util.go deleted file mode 100644 index 8d3dbecec829..000000000000 --- a/vendor/github.com/spf13/cobra/doc/util.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2015 Red Hat Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package doc - -import ( - "strings" - - "github.com/spf13/cobra" -) - -// Test to see if we have a reason to print See Also information in docs -// Basically this is a test for a parent commend or a subcommand which is -// both not deprecated and not the autogenerated help command. -func hasSeeAlso(cmd *cobra.Command) bool { - if cmd.HasParent() { - return true - } - for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() { - continue - } - return true - } - return false -} - -// Temporary workaround for yaml lib generating incorrect yaml with long strings -// that do not contain \n. -func forceMultiLine(s string) string { - if len(s) > 60 && !strings.Contains(s, "\n") { - s = s + "\n" - } - return s -} - -type byName []*cobra.Command - -func (s byName) Len() int { return len(s) } -func (s byName) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s byName) Less(i, j int) bool { return s[i].Name() < s[j].Name() } diff --git a/vendor/github.com/spf13/cobra/doc/yaml_docs.go b/vendor/github.com/spf13/cobra/doc/yaml_docs.go deleted file mode 100644 index ea00af07e817..000000000000 --- a/vendor/github.com/spf13/cobra/doc/yaml_docs.go +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2016 French Ben. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package doc - -import ( - "fmt" - "io" - "os" - "path/filepath" - "sort" - "strings" - - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "gopkg.in/yaml.v2" -) - -type cmdOption struct { - Name string - Shorthand string `yaml:",omitempty"` - DefaultValue string `yaml:"default_value,omitempty"` - Usage string `yaml:",omitempty"` -} - -type cmdDoc struct { - Name string - Synopsis string `yaml:",omitempty"` - Description string `yaml:",omitempty"` - Options []cmdOption `yaml:",omitempty"` - InheritedOptions []cmdOption `yaml:"inherited_options,omitempty"` - Example string `yaml:",omitempty"` - SeeAlso []string `yaml:"see_also,omitempty"` -} - -// GenYamlTree creates yaml structured ref files for this command and all descendants -// in the directory given. This function may not work -// correctly if your command names have `-` in them. If you have `cmd` with two -// subcmds, `sub` and `sub-third`, and `sub` has a subcommand called `third` -// it is undefined which help output will be in the file `cmd-sub-third.1`. -func GenYamlTree(cmd *cobra.Command, dir string) error { - identity := func(s string) string { return s } - emptyStr := func(s string) string { return "" } - return GenYamlTreeCustom(cmd, dir, emptyStr, identity) -} - -// GenYamlTreeCustom creates yaml structured ref files. -func GenYamlTreeCustom(cmd *cobra.Command, dir string, filePrepender, linkHandler func(string) string) error { - for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() { - continue - } - if err := GenYamlTreeCustom(c, dir, filePrepender, linkHandler); err != nil { - return err - } - } - - basename := strings.Replace(cmd.CommandPath(), " ", "_", -1) + ".yaml" - filename := filepath.Join(dir, basename) - f, err := os.Create(filename) - if err != nil { - return err - } - defer f.Close() - - if _, err := io.WriteString(f, filePrepender(filename)); err != nil { - return err - } - if err := GenYamlCustom(cmd, f, linkHandler); err != nil { - return err - } - return nil -} - -// GenYaml creates yaml output. -func GenYaml(cmd *cobra.Command, w io.Writer) error { - return GenYamlCustom(cmd, w, func(s string) string { return s }) -} - -// GenYamlCustom creates custom yaml output. -func GenYamlCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string) string) error { - cmd.InitDefaultHelpCmd() - cmd.InitDefaultHelpFlag() - - yamlDoc := cmdDoc{} - yamlDoc.Name = cmd.CommandPath() - - yamlDoc.Synopsis = forceMultiLine(cmd.Short) - yamlDoc.Description = forceMultiLine(cmd.Long) - - if len(cmd.Example) > 0 { - yamlDoc.Example = cmd.Example - } - - flags := cmd.NonInheritedFlags() - if flags.HasFlags() { - yamlDoc.Options = genFlagResult(flags) - } - flags = cmd.InheritedFlags() - if flags.HasFlags() { - yamlDoc.InheritedOptions = genFlagResult(flags) - } - - if hasSeeAlso(cmd) { - result := []string{} - if cmd.HasParent() { - parent := cmd.Parent() - result = append(result, parent.CommandPath()+" - "+parent.Short) - } - children := cmd.Commands() - sort.Sort(byName(children)) - for _, child := range children { - if !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() { - continue - } - result = append(result, child.Name()+" - "+child.Short) - } - yamlDoc.SeeAlso = result - } - - final, err := yaml.Marshal(&yamlDoc) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - if _, err := w.Write(final); err != nil { - return err - } - return nil -} - -func genFlagResult(flags *pflag.FlagSet) []cmdOption { - var result []cmdOption - - flags.VisitAll(func(flag *pflag.Flag) { - // Todo, when we mark a shorthand is deprecated, but specify an empty message. - // The flag.ShorthandDeprecated is empty as the shorthand is deprecated. - // Using len(flag.ShorthandDeprecated) > 0 can't handle this, others are ok. - if !(len(flag.ShorthandDeprecated) > 0) && len(flag.Shorthand) > 0 { - opt := cmdOption{ - flag.Name, - flag.Shorthand, - flag.DefValue, - forceMultiLine(flag.Usage), - } - result = append(result, opt) - } else { - opt := cmdOption{ - Name: flag.Name, - DefaultValue: forceMultiLine(flag.DefValue), - Usage: forceMultiLine(flag.Usage), - } - result = append(result, opt) - } - }) - - return result -} diff --git a/vendor/github.com/spf13/pflag/.gitignore b/vendor/github.com/spf13/pflag/.gitignore new file mode 100644 index 000000000000..c3da29013463 --- /dev/null +++ b/vendor/github.com/spf13/pflag/.gitignore @@ -0,0 +1,2 @@ +.idea/* + diff --git a/vendor/github.com/spf13/pflag/README.md b/vendor/github.com/spf13/pflag/README.md new file mode 100644 index 000000000000..b052414d1295 --- /dev/null +++ b/vendor/github.com/spf13/pflag/README.md @@ -0,0 +1,296 @@ +[![Build Status](https://travis-ci.org/spf13/pflag.svg?branch=master)](https://travis-ci.org/spf13/pflag) +[![Go Report Card](https://goreportcard.com/badge/github.com/spf13/pflag)](https://goreportcard.com/report/github.com/spf13/pflag) +[![GoDoc](https://godoc.org/github.com/spf13/pflag?status.svg)](https://godoc.org/github.com/spf13/pflag) + +## Description + +pflag is a drop-in replacement for Go's flag package, implementing +POSIX/GNU-style --flags. + +pflag is compatible with the [GNU extensions to the POSIX recommendations +for command-line options][1]. For a more precise description, see the +"Command-line flag syntax" section below. + +[1]: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html + +pflag is available under the same style of BSD license as the Go language, +which can be found in the LICENSE file. + +## Installation + +pflag is available using the standard `go get` command. + +Install by running: + + go get github.com/spf13/pflag + +Run tests by running: + + go test github.com/spf13/pflag + +## Usage + +pflag is a drop-in replacement of Go's native flag package. If you import +pflag under the name "flag" then all code should continue to function +with no changes. + +``` go +import flag "github.com/spf13/pflag" +``` + +There is one exception to this: if you directly instantiate the Flag struct +there is one more field "Shorthand" that you will need to set. +Most code never instantiates this struct directly, and instead uses +functions such as String(), BoolVar(), and Var(), and is therefore +unaffected. + +Define flags using flag.String(), Bool(), Int(), etc. + +This declares an integer flag, -flagname, stored in the pointer ip, with type *int. + +``` go +var ip *int = flag.Int("flagname", 1234, "help message for flagname") +``` + +If you like, you can bind the flag to a variable using the Var() functions. + +``` go +var flagvar int +func init() { + flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname") +} +``` + +Or you can create custom flags that satisfy the Value interface (with +pointer receivers) and couple them to flag parsing by + +``` go +flag.Var(&flagVal, "name", "help message for flagname") +``` + +For such flags, the default value is just the initial value of the variable. + +After all flags are defined, call + +``` go +flag.Parse() +``` + +to parse the command line into the defined flags. + +Flags may then be used directly. If you're using the flags themselves, +they are all pointers; if you bind to variables, they're values. + +``` go +fmt.Println("ip has value ", *ip) +fmt.Println("flagvar has value ", flagvar) +``` + +There are helpers function to get values later if you have the FlagSet but +it was difficult to keep up with all of the flag pointers in your code. +If you have a pflag.FlagSet with a flag called 'flagname' of type int you +can use GetInt() to get the int value. But notice that 'flagname' must exist +and it must be an int. GetString("flagname") will fail. + +``` go +i, err := flagset.GetInt("flagname") +``` + +After parsing, the arguments after the flag are available as the +slice flag.Args() or individually as flag.Arg(i). +The arguments are indexed from 0 through flag.NArg()-1. + +The pflag package also defines some new functions that are not in flag, +that give one-letter shorthands for flags. You can use these by appending +'P' to the name of any function that defines a flag. + +``` go +var ip = flag.IntP("flagname", "f", 1234, "help message") +var flagvar bool +func init() { + flag.BoolVarP(&flagvar, "boolname", "b", true, "help message") +} +flag.VarP(&flagVal, "varname", "v", "help message") +``` + +Shorthand letters can be used with single dashes on the command line. +Boolean shorthand flags can be combined with other shorthand flags. + +The default set of command-line flags is controlled by +top-level functions. The FlagSet type allows one to define +independent sets of flags, such as to implement subcommands +in a command-line interface. The methods of FlagSet are +analogous to the top-level functions for the command-line +flag set. + +## Setting no option default values for flags + +After you create a flag it is possible to set the pflag.NoOptDefVal for +the given flag. Doing this changes the meaning of the flag slightly. If +a flag has a NoOptDefVal and the flag is set on the command line without +an option the flag will be set to the NoOptDefVal. For example given: + +``` go +var ip = flag.IntP("flagname", "f", 1234, "help message") +flag.Lookup("flagname").NoOptDefVal = "4321" +``` + +Would result in something like + +| Parsed Arguments | Resulting Value | +| ------------- | ------------- | +| --flagname=1357 | ip=1357 | +| --flagname | ip=4321 | +| [nothing] | ip=1234 | + +## Command line flag syntax + +``` +--flag // boolean flags, or flags with no option default values +--flag x // only on flags without a default value +--flag=x +``` + +Unlike the flag package, a single dash before an option means something +different than a double dash. Single dashes signify a series of shorthand +letters for flags. All but the last shorthand letter must be boolean flags +or a flag with a default value + +``` +// boolean or flags where the 'no option default value' is set +-f +-f=true +-abc +but +-b true is INVALID + +// non-boolean and flags without a 'no option default value' +-n 1234 +-n=1234 +-n1234 + +// mixed +-abcs "hello" +-absd="hello" +-abcs1234 +``` + +Flag parsing stops after the terminator "--". Unlike the flag package, +flags can be interspersed with arguments anywhere on the command line +before this terminator. + +Integer flags accept 1234, 0664, 0x1234 and may be negative. +Boolean flags (in their long form) accept 1, 0, t, f, true, false, +TRUE, FALSE, True, False. +Duration flags accept any input valid for time.ParseDuration. + +## Mutating or "Normalizing" Flag names + +It is possible to set a custom flag name 'normalization function.' It allows flag names to be mutated both when created in the code and when used on the command line to some 'normalized' form. The 'normalized' form is used for comparison. Two examples of using the custom normalization func follow. + +**Example #1**: You want -, _, and . in flags to compare the same. aka --my-flag == --my_flag == --my.flag + +``` go +func wordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { + from := []string{"-", "_"} + to := "." + for _, sep := range from { + name = strings.Replace(name, sep, to, -1) + } + return pflag.NormalizedName(name) +} + +myFlagSet.SetNormalizeFunc(wordSepNormalizeFunc) +``` + +**Example #2**: You want to alias two flags. aka --old-flag-name == --new-flag-name + +``` go +func aliasNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { + switch name { + case "old-flag-name": + name = "new-flag-name" + break + } + return pflag.NormalizedName(name) +} + +myFlagSet.SetNormalizeFunc(aliasNormalizeFunc) +``` + +## Deprecating a flag or its shorthand +It is possible to deprecate a flag, or just its shorthand. Deprecating a flag/shorthand hides it from help text and prints a usage message when the deprecated flag/shorthand is used. + +**Example #1**: You want to deprecate a flag named "badflag" as well as inform the users what flag they should use instead. +```go +// deprecate a flag by specifying its name and a usage message +flags.MarkDeprecated("badflag", "please use --good-flag instead") +``` +This hides "badflag" from help text, and prints `Flag --badflag has been deprecated, please use --good-flag instead` when "badflag" is used. + +**Example #2**: You want to keep a flag name "noshorthandflag" but deprecate its shortname "n". +```go +// deprecate a flag shorthand by specifying its flag name and a usage message +flags.MarkShorthandDeprecated("noshorthandflag", "please use --noshorthandflag only") +``` +This hides the shortname "n" from help text, and prints `Flag shorthand -n has been deprecated, please use --noshorthandflag only` when the shorthand "n" is used. + +Note that usage message is essential here, and it should not be empty. + +## Hidden flags +It is possible to mark a flag as hidden, meaning it will still function as normal, however will not show up in usage/help text. + +**Example**: You have a flag named "secretFlag" that you need for internal use only and don't want it showing up in help text, or for its usage text to be available. +```go +// hide a flag by specifying its name +flags.MarkHidden("secretFlag") +``` + +## Disable sorting of flags +`pflag` allows you to disable sorting of flags for help and usage message. + +**Example**: +```go +flags.BoolP("verbose", "v", false, "verbose output") +flags.String("coolflag", "yeaah", "it's really cool flag") +flags.Int("usefulflag", 777, "sometimes it's very useful") +flags.SortFlags = false +flags.PrintDefaults() +``` +**Output**: +``` + -v, --verbose verbose output + --coolflag string it's really cool flag (default "yeaah") + --usefulflag int sometimes it's very useful (default 777) +``` + + +## Supporting Go flags when using pflag +In order to support flags defined using Go's `flag` package, they must be added to the `pflag` flagset. This is usually necessary +to support flags defined by third-party dependencies (e.g. `golang/glog`). + +**Example**: You want to add the Go flags to the `CommandLine` flagset +```go +import ( + goflag "flag" + flag "github.com/spf13/pflag" +) + +var ip *int = flag.Int("flagname", 1234, "help message for flagname") + +func main() { + flag.CommandLine.AddGoFlagSet(goflag.CommandLine) + flag.Parse() +} +``` + +## More info + +You can see the full reference documentation of the pflag package +[at godoc.org][3], or through go's standard documentation system by +running `godoc -http=:6060` and browsing to +[http://localhost:6060/pkg/github.com/spf13/pflag][2] after +installation. + +[2]: http://localhost:6060/pkg/github.com/spf13/pflag +[3]: http://godoc.org/github.com/spf13/pflag diff --git a/vendor/github.com/tidwall/gjson/README.md b/vendor/github.com/tidwall/gjson/README.md new file mode 100644 index 000000000000..70240d99279d --- /dev/null +++ b/vendor/github.com/tidwall/gjson/README.md @@ -0,0 +1,401 @@ +

+GJSON +
+Build Status +GoDoc +GJSON Playground +

+ + + +

get json values quickly

+ +GJSON is a Go package that provides a [fast](#performance) and [simple](#get-a-value) way to get values from a json document. +It has features such as [one line retrieval](#get-a-value), [dot notation paths](#path-syntax), [iteration](#iterate-through-an-object-or-array), and [parsing json lines](#json-lines). + +Also check out [SJSON](https://github.com/tidwall/sjson) for modifying json, and the [JJ](https://github.com/tidwall/jj) command line tool. + +Getting Started +=============== + +## Installing + +To start using GJSON, install Go and run `go get`: + +```sh +$ go get -u github.com/tidwall/gjson +``` + +This will retrieve the library. + +## Get a value +Get searches json for the specified path. A path is in dot syntax, such as "name.last" or "age". When the value is found it's returned immediately. + +```go +package main + +import "github.com/tidwall/gjson" + +const json = `{"name":{"first":"Janet","last":"Prichard"},"age":47}` + +func main() { + value := gjson.Get(json, "name.last") + println(value.String()) +} +``` + +This will print: + +``` +Prichard +``` +*There's also the [GetMany](#get-multiple-values-at-once) function to get multiple values at once, and [GetBytes](#working-with-bytes) for working with JSON byte slices.* + +## Path Syntax + +A path is a series of keys separated by a dot. +A key may contain special wildcard characters '\*' and '?'. +To access an array value use the index as the key. +To get the number of elements in an array or to access a child path, use the '#' character. +The dot and wildcard characters can be escaped with '\\'. + +```json +{ + "name": {"first": "Tom", "last": "Anderson"}, + "age":37, + "children": ["Sara","Alex","Jack"], + "fav.movie": "Deer Hunter", + "friends": [ + {"first": "Dale", "last": "Murphy", "age": 44}, + {"first": "Roger", "last": "Craig", "age": 68}, + {"first": "Jane", "last": "Murphy", "age": 47} + ] +} +``` +``` +"name.last" >> "Anderson" +"age" >> 37 +"children" >> ["Sara","Alex","Jack"] +"children.#" >> 3 +"children.1" >> "Alex" +"child*.2" >> "Jack" +"c?ildren.0" >> "Sara" +"fav\.movie" >> "Deer Hunter" +"friends.#.first" >> ["Dale","Roger","Jane"] +"friends.1.last" >> "Craig" +``` + +You can also query an array for the first match by using `#[...]`, or find all matches with `#[...]#`. +Queries support the `==`, `!=`, `<`, `<=`, `>`, `>=` comparison operators and the simple pattern matching `%` operator. + +``` +friends.#[last=="Murphy"].first >> "Dale" +friends.#[last=="Murphy"]#.first >> ["Dale","Jane"] +friends.#[age>45]#.last >> ["Craig","Murphy"] +friends.#[first%"D*"].last >> "Murphy" +``` + +## JSON Lines + +There's support for [JSON Lines](http://jsonlines.org/) using the `..` prefix, which treats a multilined document as an array. + +For example: + +``` +{"name": "Gilbert", "age": 61} +{"name": "Alexa", "age": 34} +{"name": "May", "age": 57} +{"name": "Deloise", "age": 44} +``` + +``` +..# >> 4 +..1 >> {"name": "Alexa", "age": 34} +..3 >> {"name": "Deloise", "age": 44} +..#.name >> ["Gilbert","Alexa","May","Deloise"] +..#[name="May"].age >> 57 +``` + +The `ForEachLines` function will iterate through JSON lines. + +```go +gjson.ForEachLine(json, func(line gjson.Result) bool{ + println(line.String()) + return true +}) +``` + +## Result Type + +GJSON supports the json types `string`, `number`, `bool`, and `null`. +Arrays and Objects are returned as their raw json types. + +The `Result` type holds one of these: + +``` +bool, for JSON booleans +float64, for JSON numbers +string, for JSON string literals +nil, for JSON null +``` + +To directly access the value: + +```go +result.Type // can be String, Number, True, False, Null, or JSON +result.Str // holds the string +result.Num // holds the float64 number +result.Raw // holds the raw json +result.Index // index of raw value in original json, zero means index unknown +``` + +There are a variety of handy functions that work on a result: + +```go +result.Exists() bool +result.Value() interface{} +result.Int() int64 +result.Uint() uint64 +result.Float() float64 +result.String() string +result.Bool() bool +result.Time() time.Time +result.Array() []gjson.Result +result.Map() map[string]gjson.Result +result.Get(path string) Result +result.ForEach(iterator func(key, value Result) bool) +result.Less(token Result, caseSensitive bool) bool +``` + +The `result.Value()` function returns an `interface{}` which requires type assertion and is one of the following Go types: + +The `result.Array()` function returns back an array of values. +If the result represents a non-existent value, then an empty array will be returned. +If the result is not a JSON array, the return value will be an array containing one result. + +```go +boolean >> bool +number >> float64 +string >> string +null >> nil +array >> []interface{} +object >> map[string]interface{} +``` + +### 64-bit integers + +The `result.Int()` and `result.Uint()` calls are capable of reading all 64 bits, allowing for large JSON integers. + +```go +result.Int() int64 // -9223372036854775808 to 9223372036854775807 +result.Uint() int64 // 0 to 18446744073709551615 +``` + +## Get nested array values + +Suppose you want all the last names from the following json: + +```json +{ + "programmers": [ + { + "firstName": "Janet", + "lastName": "McLaughlin", + }, { + "firstName": "Elliotte", + "lastName": "Hunter", + }, { + "firstName": "Jason", + "lastName": "Harold", + } + ] +} +``` + +You would use the path "programmers.#.lastName" like such: + +```go +result := gjson.Get(json, "programmers.#.lastName") +for _, name := range result.Array() { + println(name.String()) +} +``` + +You can also query an object inside an array: + +```go +name := gjson.Get(json, `programmers.#[lastName="Hunter"].firstName`) +println(name.String()) // prints "Elliotte" +``` + +## Iterate through an object or array + +The `ForEach` function allows for quickly iterating through an object or array. +The key and value are passed to the iterator function for objects. +Only the value is passed for arrays. +Returning `false` from an iterator will stop iteration. + +```go +result := gjson.Get(json, "programmers") +result.ForEach(func(key, value gjson.Result) bool { + println(value.String()) + return true // keep iterating +}) +``` + +## Simple Parse and Get + +There's a `Parse(json)` function that will do a simple parse, and `result.Get(path)` that will search a result. + +For example, all of these will return the same result: + +```go +gjson.Parse(json).Get("name").Get("last") +gjson.Get(json, "name").Get("last") +gjson.Get(json, "name.last") +``` + +## Check for the existence of a value + +Sometimes you just want to know if a value exists. + +```go +value := gjson.Get(json, "name.last") +if !value.Exists() { + println("no last name") +} else { + println(value.String()) +} + +// Or as one step +if gjson.Get(json, "name.last").Exists() { + println("has a last name") +} +``` + +## Validate JSON + +The `Get*` and `Parse*` functions expects that the json is well-formed. Bad json will not panic, but it may return back unexpected results. + +If you are consuming JSON from an unpredictable source then you may want to validate prior to using GJSON. + +```go +if !gjson.Valid(json) { + return errors.New("invalid json") +} +value := gjson.Get(json, "name.last") +``` + +## Unmarshal to a map + +To unmarshal to a `map[string]interface{}`: + +```go +m, ok := gjson.Parse(json).Value().(map[string]interface{}) +if !ok { + // not a map +} +``` + +## Working with Bytes + +If your JSON is contained in a `[]byte` slice, there's the [GetBytes](https://godoc.org/github.com/tidwall/gjson#GetBytes) function. This is preferred over `Get(string(data), path)`. + +```go +var json []byte = ... +result := gjson.GetBytes(json, path) +``` + +If you are using the `gjson.GetBytes(json, path)` function and you want to avoid converting `result.Raw` to a `[]byte`, then you can use this pattern: + +```go +var json []byte = ... +result := gjson.GetBytes(json, path) +var raw []byte +if result.Index > 0 { + raw = json[result.Index:result.Index+len(result.Raw)] +} else { + raw = []byte(result.Raw) +} +``` + +This is a best-effort no allocation sub slice of the original json. This method utilizes the `result.Index` field, which is the position of the raw data in the original json. It's possible that the value of `result.Index` equals zero, in which case the `result.Raw` is converted to a `[]byte`. + +## Get multiple values at once + +The `GetMany` function can be used to get multiple values at the same time. + +```go +results := gjson.GetMany(json, "name.first", "name.last", "age") +``` + +The return value is a `[]Result`, which will always contain exactly the same number of items as the input paths. + +## Performance + +Benchmarks of GJSON alongside [encoding/json](https://golang.org/pkg/encoding/json/), +[ffjson](https://github.com/pquerna/ffjson), +[EasyJSON](https://github.com/mailru/easyjson), +[jsonparser](https://github.com/buger/jsonparser), +and [json-iterator](https://github.com/json-iterator/go) + +``` +BenchmarkGJSONGet-8 3000000 372 ns/op 0 B/op 0 allocs/op +BenchmarkGJSONUnmarshalMap-8 900000 4154 ns/op 1920 B/op 26 allocs/op +BenchmarkJSONUnmarshalMap-8 600000 9019 ns/op 3048 B/op 69 allocs/op +BenchmarkJSONDecoder-8 300000 14120 ns/op 4224 B/op 184 allocs/op +BenchmarkFFJSONLexer-8 1500000 3111 ns/op 896 B/op 8 allocs/op +BenchmarkEasyJSONLexer-8 3000000 887 ns/op 613 B/op 6 allocs/op +BenchmarkJSONParserGet-8 3000000 499 ns/op 21 B/op 0 allocs/op +BenchmarkJSONIterator-8 3000000 812 ns/op 544 B/op 9 allocs/op +``` + +JSON document used: + +```json +{ + "widget": { + "debug": "on", + "window": { + "title": "Sample Konfabulator Widget", + "name": "main_window", + "width": 500, + "height": 500 + }, + "image": { + "src": "Images/Sun.png", + "hOffset": 250, + "vOffset": 250, + "alignment": "center" + }, + "text": { + "data": "Click Here", + "size": 36, + "style": "bold", + "vOffset": 100, + "alignment": "center", + "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;" + } + } +} +``` + +Each operation was rotated though one of the following search paths: + +``` +widget.window.name +widget.image.hOffset +widget.text.onMouseUp +``` + +*These benchmarks were run on a MacBook Pro 15" 2.8 GHz Intel Core i7 using Go 1.8 and can be be found [here](https://github.com/tidwall/gjson-benchmarks).* + + +## Contact +Josh Baker [@tidwall](http://twitter.com/tidwall) + +## License + +GJSON source code is available under the MIT [License](/LICENSE). diff --git a/vendor/github.com/tidwall/match/README.md b/vendor/github.com/tidwall/match/README.md new file mode 100644 index 000000000000..2aa5bc38ba11 --- /dev/null +++ b/vendor/github.com/tidwall/match/README.md @@ -0,0 +1,32 @@ +Match +===== +Build Status +GoDoc + +Match is a very simple pattern matcher where '*' matches on any +number characters and '?' matches on any one character. + +Installing +---------- + +``` +go get -u github.com/tidwall/match +``` + +Example +------- + +```go +match.Match("hello", "*llo") +match.Match("jello", "?ello") +match.Match("hello", "h*o") +``` + + +Contact +------- +Josh Baker [@tidwall](http://twitter.com/tidwall) + +License +------- +Redcon source code is available under the MIT [License](/LICENSE). diff --git a/vendor/github.com/tidwall/pretty/README.md b/vendor/github.com/tidwall/pretty/README.md new file mode 100644 index 000000000000..d2b8864d5064 --- /dev/null +++ b/vendor/github.com/tidwall/pretty/README.md @@ -0,0 +1,124 @@ +# Pretty +[![Build Status](https://img.shields.io/travis/tidwall/pretty.svg?style=flat-square)](https://travis-ci.org/tidwall/prettty) +[![Coverage Status](https://img.shields.io/badge/coverage-100%25-brightgreen.svg?style=flat-square)](http://gocover.io/github.com/tidwall/pretty) +[![GoDoc](https://img.shields.io/badge/api-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/tidwall/pretty) + + +Pretty is a Go package that provides [fast](#performance) methods for formatting JSON for human readability, or to compact JSON for smaller payloads. + +Getting Started +=============== + +## Installing + +To start using Pretty, install Go and run `go get`: + +```sh +$ go get -u github.com/tidwall/pretty +``` + +This will retrieve the library. + +## Pretty + +Using this example: + +```json +{"name": {"first":"Tom","last":"Anderson"}, "age":37, +"children": ["Sara","Alex","Jack"], +"fav.movie": "Deer Hunter", "friends": [ + {"first": "Janet", "last": "Murphy", "age": 44} + ]} +``` + +The following code: +```go +result = pretty.Pretty(example) +``` + +Will format the json to: + +```json +{ + "name": { + "first": "Tom", + "last": "Anderson" + }, + "age": 37, + "children": ["Sara", "Alex", "Jack"], + "fav.movie": "Deer Hunter", + "friends": [ + { + "first": "Janet", + "last": "Murphy", + "age": 44 + } + ] +} +``` + +## Color + +Color will colorize the json for outputing to the screen. + +```json +result = pretty.Color(json, nil) +``` + +Will add color to the result for printing to the terminal. +The second param is used for a customizing the style, and passing nil will use the default `pretty.TerminalStyle`. + +## Ugly + +The following code: +```go +result = pretty.Ugly(example) +``` + +Will format the json to: + +```json +{"name":{"first":"Tom","last":"Anderson"},"age":37,"children":["Sara","Alex","Jack"],"fav.movie":"Deer Hunter","friends":[{"first":"Janet","last":"Murphy","age":44}]}``` +``` + + +## Customized output + +There's a `PrettyOptions(json, opts)` function which allows for customizing the output with the following options: + +```go +type Options struct { + // Width is an max column width for single line arrays + // Default is 80 + Width int + // Prefix is a prefix for all lines + // Default is an empty string + Prefix string + // Indent is the nested indentation + // Default is two spaces + Indent string + // SortKeys will sort the keys alphabetically + // Default is false + SortKeys bool +} +``` +## Performance + +Benchmarks of Pretty alongside the builtin `encoding/json` Indent/Compact methods. +``` +BenchmarkPretty-8 1000000 1283 ns/op 720 B/op 2 allocs/op +BenchmarkUgly-8 3000000 426 ns/op 240 B/op 1 allocs/op +BenchmarkUglyInPlace-8 5000000 340 ns/op 0 B/op 0 allocs/op +BenchmarkJSONIndent-8 300000 4628 ns/op 1069 B/op 4 allocs/op +BenchmarkJSONCompact-8 1000000 2469 ns/op 758 B/op 4 allocs/op +``` + +*These benchmarks were run on a MacBook Pro 15" 2.8 GHz Intel Core i7 using Go 1.7.* + +## Contact +Josh Baker [@tidwall](http://twitter.com/tidwall) + +## License + +Pretty source code is available under the MIT [License](/LICENSE). + diff --git a/vendor/github.com/ugorji/go/codec/README.md b/vendor/github.com/ugorji/go/codec/README.md new file mode 100644 index 000000000000..50d65e550d60 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/README.md @@ -0,0 +1,206 @@ +# Codec + +High Performance, Feature-Rich Idiomatic Go codec/encoding library for +binc, msgpack, cbor, json. + +Supported Serialization formats are: + + - msgpack: https://github.com/msgpack/msgpack + - binc: http://github.com/ugorji/binc + - cbor: http://cbor.io http://tools.ietf.org/html/rfc7049 + - json: http://json.org http://tools.ietf.org/html/rfc7159 + - simple: + +To install: + + go get github.com/ugorji/go/codec + +This package will carefully use 'unsafe' for performance reasons in specific places. +You can build without unsafe use by passing the safe or appengine tag +i.e. 'go install -tags=safe ...'. Note that unsafe is only supported for the last 3 +go sdk versions e.g. current go release is go 1.9, so we support unsafe use only from +go 1.7+ . This is because supporting unsafe requires knowledge of implementation details. + +Online documentation: http://godoc.org/github.com/ugorji/go/codec +Detailed Usage/How-to Primer: http://ugorji.net/blog/go-codec-primer + +The idiomatic Go support is as seen in other encoding packages in +the standard library (ie json, xml, gob, etc). + +Rich Feature Set includes: + + - Simple but extremely powerful and feature-rich API + - Support for go1.4 and above, while selectively using newer APIs for later releases + - Excellent code coverage ( > 90% ) + - Very High Performance. + Our extensive benchmarks show us outperforming Gob, Json, Bson, etc by 2-4X. + - Careful selected use of 'unsafe' for targeted performance gains. + 100% mode exists where 'unsafe' is not used at all. + - Lock-free (sans mutex) concurrency for scaling to 100's of cores + - Coerce types where appropriate + e.g. decode an int in the stream into a float, decode numbers from formatted strings, etc + - Corner Cases: + Overflows, nil maps/slices, nil values in streams are handled correctly + - Standard field renaming via tags + - Support for omitting empty fields during an encoding + - Encoding from any value and decoding into pointer to any value + (struct, slice, map, primitives, pointers, interface{}, etc) + - Extensions to support efficient encoding/decoding of any named types + - Support encoding.(Binary|Text)(M|Unm)arshaler interfaces + - Support IsZero() bool to determine if a value is a zero value. + Analogous to time.Time.IsZero() bool. + - Decoding without a schema (into a interface{}). + Includes Options to configure what specific map or slice type to use + when decoding an encoded list or map into a nil interface{} + - Mapping a non-interface type to an interface, so we can decode appropriately + into any interface type with a correctly configured non-interface value. + - Encode a struct as an array, and decode struct from an array in the data stream + - Option to encode struct keys as numbers (instead of strings) + (to support structured streams with fields encoded as numeric codes) + - Comprehensive support for anonymous fields + - Fast (no-reflection) encoding/decoding of common maps and slices + - Code-generation for faster performance. + - Support binary (e.g. messagepack, cbor) and text (e.g. json) formats + - Support indefinite-length formats to enable true streaming + (for formats which support it e.g. json, cbor) + - Support canonical encoding, where a value is ALWAYS encoded as same sequence of bytes. + This mostly applies to maps, where iteration order is non-deterministic. + - NIL in data stream decoded as zero value + - Never silently skip data when decoding. + User decides whether to return an error or silently skip data when keys or indexes + in the data stream do not map to fields in the struct. + - Encode/Decode from/to chan types (for iterative streaming support) + - Drop-in replacement for encoding/json. `json:` key in struct tag supported. + - Provides a RPC Server and Client Codec for net/rpc communication protocol. + - Handle unique idiosyncrasies of codecs e.g. + - For messagepack, configure how ambiguities in handling raw bytes are resolved + - For messagepack, provide rpc server/client codec to support + msgpack-rpc protocol defined at: + https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md + +## Extension Support + +Users can register a function to handle the encoding or decoding of +their custom types. + +There are no restrictions on what the custom type can be. Some examples: + + type BisSet []int + type BitSet64 uint64 + type UUID string + type MyStructWithUnexportedFields struct { a int; b bool; c []int; } + type GifImage struct { ... } + +As an illustration, MyStructWithUnexportedFields would normally be +encoded as an empty map because it has no exported fields, while UUID +would be encoded as a string. However, with extension support, you can +encode any of these however you like. + +## Custom Encoding and Decoding + +This package maintains symmetry in the encoding and decoding halfs. +We determine how to encode or decode by walking this decision tree + + - is type a codec.Selfer? + - is there an extension registered for the type? + - is format binary, and is type a encoding.BinaryMarshaler and BinaryUnmarshaler? + - is format specifically json, and is type a encoding/json.Marshaler and Unmarshaler? + - is format text-based, and type an encoding.TextMarshaler? + - else we use a pair of functions based on the "kind" of the type e.g. map, slice, int64, etc + +This symmetry is important to reduce chances of issues happening because the +encoding and decoding sides are out of sync e.g. decoded via very specific +encoding.TextUnmarshaler but encoded via kind-specific generalized mode. + +Consequently, if a type only defines one-half of the symmetry +(e.g. it implements UnmarshalJSON() but not MarshalJSON() ), +then that type doesn't satisfy the check and we will continue walking down the +decision tree. + +## RPC + +RPC Client and Server Codecs are implemented, so the codecs can be used +with the standard net/rpc package. + +## Usage + +Typical usage model: + + // create and configure Handle + var ( + bh codec.BincHandle + mh codec.MsgpackHandle + ch codec.CborHandle + ) + + mh.MapType = reflect.TypeOf(map[string]interface{}(nil)) + + // configure extensions + // e.g. for msgpack, define functions and enable Time support for tag 1 + // mh.SetExt(reflect.TypeOf(time.Time{}), 1, myExt) + + // create and use decoder/encoder + var ( + r io.Reader + w io.Writer + b []byte + h = &bh // or mh to use msgpack + ) + + dec = codec.NewDecoder(r, h) + dec = codec.NewDecoderBytes(b, h) + err = dec.Decode(&v) + + enc = codec.NewEncoder(w, h) + enc = codec.NewEncoderBytes(&b, h) + err = enc.Encode(v) + + //RPC Server + go func() { + for { + conn, err := listener.Accept() + rpcCodec := codec.GoRpc.ServerCodec(conn, h) + //OR rpcCodec := codec.MsgpackSpecRpc.ServerCodec(conn, h) + rpc.ServeCodec(rpcCodec) + } + }() + + //RPC Communication (client side) + conn, err = net.Dial("tcp", "localhost:5555") + rpcCodec := codec.GoRpc.ClientCodec(conn, h) + //OR rpcCodec := codec.MsgpackSpecRpc.ClientCodec(conn, h) + client := rpc.NewClientWithCodec(rpcCodec) + +## Running Tests + +To run tests, use the following: + + go test + +To run the full suite of tests, use the following: + + go test -tags alltests -run Suite + +You can run the tag 'safe' to run tests or build in safe mode. e.g. + + go test -tags safe -run Json + go test -tags "alltests safe" -run Suite + +## Running Benchmarks + +Please see http://github.com/ugorji/go-codec-bench . + +## Caveats + +Struct fields matching the following are ignored during encoding and decoding + + - struct tag value set to - + - func, complex numbers, unsafe pointers + - unexported and not embedded + - unexported and embedded and not struct kind + - unexported and embedded pointers (from go1.10) + +Every other field in a struct will be encoded/decoded. + +Embedded fields are encoded as if they exist in the top-level struct, +with some caveats. See Encode documentation. diff --git a/vendor/github.com/ugorji/go/codec/noop.go b/vendor/github.com/ugorji/go/codec/noop.go deleted file mode 100644 index 424bd49d79d0..000000000000 --- a/vendor/github.com/ugorji/go/codec/noop.go +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// +build ignore - -package codec - -import ( - "math/rand" - "time" -) - -// NoopHandle returns a no-op handle. It basically does nothing. -// It is only useful for benchmarking, as it gives an idea of the -// overhead from the codec framework. -// -// LIBRARY USERS: *** DO NOT USE *** -func NoopHandle(slen int) *noopHandle { - h := noopHandle{} - h.rand = rand.New(rand.NewSource(time.Now().UnixNano())) - h.B = make([][]byte, slen) - h.S = make([]string, slen) - for i := 0; i < len(h.S); i++ { - b := make([]byte, i+1) - for j := 0; j < len(b); j++ { - b[j] = 'a' + byte(i) - } - h.B[i] = b - h.S[i] = string(b) - } - return &h -} - -// noopHandle does nothing. -// It is used to simulate the overhead of the codec framework. -type noopHandle struct { - BasicHandle - binaryEncodingType - noopDrv // noopDrv is unexported here, so we can get a copy of it when needed. -} - -type noopDrv struct { - d *Decoder - e *Encoder - i int - S []string - B [][]byte - mks []bool // stack. if map (true), else if array (false) - mk bool // top of stack. what container are we on? map or array? - ct valueType // last response for IsContainerType. - cb int // counter for ContainerType - rand *rand.Rand -} - -func (h *noopDrv) r(v int) int { return h.rand.Intn(v) } -func (h *noopDrv) m(v int) int { h.i++; return h.i % v } - -func (h *noopDrv) newEncDriver(e *Encoder) encDriver { h.e = e; return h } -func (h *noopDrv) newDecDriver(d *Decoder) decDriver { h.d = d; return h } - -func (h *noopDrv) reset() {} -func (h *noopDrv) uncacheRead() {} - -// --- encDriver - -// stack functions (for map and array) -func (h *noopDrv) start(b bool) { - // println("start", len(h.mks)+1) - h.mks = append(h.mks, b) - h.mk = b -} -func (h *noopDrv) end() { - // println("end: ", len(h.mks)-1) - h.mks = h.mks[:len(h.mks)-1] - if len(h.mks) > 0 { - h.mk = h.mks[len(h.mks)-1] - } else { - h.mk = false - } -} - -func (h *noopDrv) EncodeBuiltin(rt uintptr, v interface{}) {} -func (h *noopDrv) EncodeNil() {} -func (h *noopDrv) EncodeInt(i int64) {} -func (h *noopDrv) EncodeUint(i uint64) {} -func (h *noopDrv) EncodeBool(b bool) {} -func (h *noopDrv) EncodeFloat32(f float32) {} -func (h *noopDrv) EncodeFloat64(f float64) {} -func (h *noopDrv) EncodeRawExt(re *RawExt, e *Encoder) {} -func (h *noopDrv) EncodeArrayStart(length int) { h.start(true) } -func (h *noopDrv) EncodeMapStart(length int) { h.start(false) } -func (h *noopDrv) EncodeEnd() { h.end() } - -func (h *noopDrv) EncodeString(c charEncoding, v string) {} - -// func (h *noopDrv) EncodeSymbol(v string) {} -func (h *noopDrv) EncodeStringBytes(c charEncoding, v []byte) {} - -func (h *noopDrv) EncodeExt(rv interface{}, xtag uint64, ext Ext, e *Encoder) {} - -// ---- decDriver -func (h *noopDrv) initReadNext() {} -func (h *noopDrv) CheckBreak() bool { return false } -func (h *noopDrv) IsBuiltinType(rt uintptr) bool { return false } -func (h *noopDrv) DecodeBuiltin(rt uintptr, v interface{}) {} -func (h *noopDrv) DecodeInt(bitsize uint8) (i int64) { return int64(h.m(15)) } -func (h *noopDrv) DecodeUint(bitsize uint8) (ui uint64) { return uint64(h.m(35)) } -func (h *noopDrv) DecodeFloat(chkOverflow32 bool) (f float64) { return float64(h.m(95)) } -func (h *noopDrv) DecodeBool() (b bool) { return h.m(2) == 0 } -func (h *noopDrv) DecodeString() (s string) { return h.S[h.m(8)] } -func (h *noopDrv) DecodeStringAsBytes() []byte { return h.DecodeBytes(nil, true) } - -func (h *noopDrv) DecodeBytes(bs []byte, zerocopy bool) []byte { return h.B[h.m(len(h.B))] } - -func (h *noopDrv) ReadEnd() { h.end() } - -// toggle map/slice -func (h *noopDrv) ReadMapStart() int { h.start(true); return h.m(10) } -func (h *noopDrv) ReadArrayStart() int { h.start(false); return h.m(10) } - -func (h *noopDrv) ContainerType() (vt valueType) { - // return h.m(2) == 0 - // handle kStruct, which will bomb is it calls this and - // doesn't get back a map or array. - // consequently, if the return value is not map or array, - // reset it to one of them based on h.m(7) % 2 - // for kstruct: at least one out of every 2 times, - // return one of valueTypeMap or Array (else kstruct bombs) - // however, every 10th time it is called, we just return something else. - var vals = [...]valueType{valueTypeArray, valueTypeMap} - // ------------ TAKE ------------ - // if h.cb%2 == 0 { - // if h.ct == valueTypeMap || h.ct == valueTypeArray { - // } else { - // h.ct = vals[h.m(2)] - // } - // } else if h.cb%5 == 0 { - // h.ct = valueType(h.m(8)) - // } else { - // h.ct = vals[h.m(2)] - // } - // ------------ TAKE ------------ - // if h.cb%16 == 0 { - // h.ct = valueType(h.cb % 8) - // } else { - // h.ct = vals[h.cb%2] - // } - h.ct = vals[h.cb%2] - h.cb++ - return h.ct - - // if h.ct == valueTypeNil || h.ct == valueTypeString || h.ct == valueTypeBytes { - // return h.ct - // } - // return valueTypeUnset - // TODO: may need to tweak this so it works. - // if h.ct == valueTypeMap && vt == valueTypeArray || - // h.ct == valueTypeArray && vt == valueTypeMap { - // h.cb = !h.cb - // h.ct = vt - // return h.cb - // } - // // go in a loop and check it. - // h.ct = vt - // h.cb = h.m(7) == 0 - // return h.cb -} -func (h *noopDrv) TryDecodeAsNil() bool { - if h.mk { - return false - } else { - return h.m(8) == 0 - } -} -func (h *noopDrv) DecodeExt(rv interface{}, xtag uint64, ext Ext) uint64 { - return 0 -} - -func (h *noopDrv) DecodeNaked() { - // use h.r (random) not h.m() because h.m() could cause the same value to be given. - var sk int - if h.mk { - // if mapkey, do not support values of nil OR bytes, array, map or rawext - sk = h.r(7) + 1 - } else { - sk = h.r(12) - } - n := &h.d.n - switch sk { - case 0: - n.v = valueTypeNil - case 1: - n.v, n.b = valueTypeBool, false - case 2: - n.v, n.b = valueTypeBool, true - case 3: - n.v, n.i = valueTypeInt, h.DecodeInt(64) - case 4: - n.v, n.u = valueTypeUint, h.DecodeUint(64) - case 5: - n.v, n.f = valueTypeFloat, h.DecodeFloat(true) - case 6: - n.v, n.f = valueTypeFloat, h.DecodeFloat(false) - case 7: - n.v, n.s = valueTypeString, h.DecodeString() - case 8: - n.v, n.l = valueTypeBytes, h.B[h.m(len(h.B))] - case 9: - n.v = valueTypeArray - case 10: - n.v = valueTypeMap - default: - n.v = valueTypeExt - n.u = h.DecodeUint(64) - n.l = h.B[h.m(len(h.B))] - } - h.ct = n.v - return -} diff --git a/vendor/github.com/ugorji/go/codec/test.py b/vendor/github.com/ugorji/go/codec/test.py new file mode 100644 index 000000000000..800376f6841b --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/test.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python + +# This will create golden files in a directory passed to it. +# A Test calls this internally to create the golden files +# So it can process them (so we don't have to checkin the files). + +# Ensure msgpack-python and cbor are installed first, using: +# sudo apt-get install python-dev +# sudo apt-get install python-pip +# pip install --user msgpack-python msgpack-rpc-python cbor + +# Ensure all "string" keys are utf strings (else encoded as bytes) + +import cbor, msgpack, msgpackrpc, sys, os, threading + +def get_test_data_list(): + # get list with all primitive types, and a combo type + l0 = [ + -8, + -1616, + -32323232, + -6464646464646464, + 192, + 1616, + 32323232, + 6464646464646464, + 192, + -3232.0, + -6464646464.0, + 3232.0, + 6464.0, + 6464646464.0, + False, + True, + u"null", + None, + u"some&day>some 0 + if stopTimeSec > 0: + def myStopRpcServer(): + server.stop() + t = threading.Timer(stopTimeSec, myStopRpcServer) + t.start() + server.start() + +def doRpcClientToPythonSvc(port): + address = msgpackrpc.Address('127.0.0.1', port) + client = msgpackrpc.Client(address, unpack_encoding='utf-8') + print client.call("Echo123", "A1", "B2", "C3") + print client.call("EchoStruct", {"A" :"Aa", "B":"Bb", "C":"Cc"}) + +def doRpcClientToGoSvc(port): + # print ">>>> port: ", port, " <<<<<" + address = msgpackrpc.Address('127.0.0.1', port) + client = msgpackrpc.Client(address, unpack_encoding='utf-8') + print client.call("TestRpcInt.Echo123", ["A1", "B2", "C3"]) + print client.call("TestRpcInt.EchoStruct", {"A" :"Aa", "B":"Bb", "C":"Cc"}) + +def doMain(args): + if len(args) == 2 and args[0] == "testdata": + build_test_data(args[1]) + elif len(args) == 3 and args[0] == "rpc-server": + doRpcServer(int(args[1]), int(args[2])) + elif len(args) == 2 and args[0] == "rpc-client-python-service": + doRpcClientToPythonSvc(int(args[1])) + elif len(args) == 2 and args[0] == "rpc-client-go-service": + doRpcClientToGoSvc(int(args[1])) + else: + print("Usage: test.py " + + "[testdata|rpc-server|rpc-client-python-service|rpc-client-go-service] ...") + +if __name__ == "__main__": + doMain(sys.argv[1:]) + diff --git a/vendor/github.com/ugorji/go/codec/xml.go b/vendor/github.com/ugorji/go/codec/xml.go deleted file mode 100644 index 19fc36caf3cc..000000000000 --- a/vendor/github.com/ugorji/go/codec/xml.go +++ /dev/null @@ -1,508 +0,0 @@ -// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// +build ignore - -package codec - -import "reflect" - -/* - -A strict Non-validating namespace-aware XML 1.0 parser and (en|de)coder. - -We are attempting this due to perceived issues with encoding/xml: - - Complicated. It tried to do too much, and is not as simple to use as json. - - Due to over-engineering, reflection is over-used AND performance suffers: - java is 6X faster:http://fabsk.eu/blog/category/informatique/dev/golang/ - even PYTHON performs better: http://outgoing.typepad.com/outgoing/2014/07/exploring-golang.html - -codec framework will offer the following benefits - - VASTLY improved performance (when using reflection-mode or codecgen) - - simplicity and consistency: with the rest of the supported formats - - all other benefits of codec framework (streaming, codegeneration, etc) - -codec is not a drop-in replacement for encoding/xml. -It is a replacement, based on the simplicity and performance of codec. -Look at it like JAXB for Go. - -Challenges: - - Need to output XML preamble, with all namespaces at the right location in the output. - - Each "end" block is dynamic, so we need to maintain a context-aware stack - - How to decide when to use an attribute VS an element - - How to handle chardata, attr, comment EXPLICITLY. - - Should it output fragments? - e.g. encoding a bool should just output true OR false, which is not well-formed XML. - -Extend the struct tag. See representative example: - type X struct { - ID uint8 `codec:"http://ugorji.net/x-namespace xid id,omitempty,toarray,attr,cdata"` - // format: [namespace-uri ][namespace-prefix ]local-name, ... - } - -Based on this, we encode - - fields as elements, BUT - encode as attributes if struct tag contains ",attr" and is a scalar (bool, number or string) - - text as entity-escaped text, BUT encode as CDATA if struct tag contains ",cdata". - -To handle namespaces: - - XMLHandle is denoted as being namespace-aware. - Consequently, we WILL use the ns:name pair to encode and decode if defined, else use the plain name. - - *Encoder and *Decoder know whether the Handle "prefers" namespaces. - - add *Encoder.getEncName(*structFieldInfo). - No one calls *structFieldInfo.indexForEncName directly anymore - - OR better yet: indexForEncName is namespace-aware, and helper.go is all namespace-aware - indexForEncName takes a parameter of the form namespace:local-name OR local-name - - add *Decoder.getStructFieldInfo(encName string) // encName here is either like abc, or h1:nsabc - by being a method on *Decoder, or maybe a method on the Handle itself. - No one accesses .encName anymore - - let encode.go and decode.go use these (for consistency) - - only problem exists for gen.go, where we create a big switch on encName. - Now, we also have to add a switch on strings.endsWith(kName, encNsName) - - gen.go will need to have many more methods, and then double-on the 2 switch loops like: - switch k { - case "abc" : x.abc() - case "def" : x.def() - default { - switch { - case !nsAware: panic(...) - case strings.endsWith(":abc"): x.abc() - case strings.endsWith(":def"): x.def() - default: panic(...) - } - } - } - -The structure below accommodates this: - - type typeInfo struct { - sfi []*structFieldInfo // sorted by encName - sfins // sorted by namespace - sfia // sorted, to have those with attributes at the top. Needed to write XML appropriately. - sfip // unsorted - } - type structFieldInfo struct { - encName - nsEncName - ns string - attr bool - cdata bool - } - -indexForEncName is now an internal helper function that takes a sorted array -(one of ti.sfins or ti.sfi). It is only used by *Encoder.getStructFieldInfo(...) - -There will be a separate parser from the builder. -The parser will have a method: next() xmlToken method. It has lookahead support, -so you can pop multiple tokens, make a determination, and push them back in the order popped. -This will be needed to determine whether we are "nakedly" decoding a container or not. -The stack will be implemented using a slice and push/pop happens at the [0] element. - -xmlToken has fields: - - type uint8: 0 | ElementStart | ElementEnd | AttrKey | AttrVal | Text - - value string - - ns string - -SEE: http://www.xml.com/pub/a/98/10/guide0.html?page=3#ENTDECL - -The following are skipped when parsing: - - External Entities (from external file) - - Notation Declaration e.g. - - Entity Declarations & References - - XML Declaration (assume UTF-8) - - XML Directive i.e. - - Other Declarations: Notation, etc. - - Comment - - Processing Instruction - - schema / DTD for validation: - We are not a VALIDATING parser. Validation is done elsewhere. - However, some parts of the DTD internal subset are used (SEE BELOW). - For Attribute List Declarations e.g. - - We considered using the ATTLIST to get "default" value, but not to validate the contents. (VETOED) - -The following XML features are supported - - Namespace - - Element - - Attribute - - cdata - - Unicode escape - -The following DTD (when as an internal sub-set) features are supported: - - Internal Entities e.g. - AND entities for the set: [<>&"'] - - Parameter entities e.g. - - -At decode time, a structure containing the following is kept - - namespace mapping - - default attribute values - - all internal entities (<>&"' and others written in the document) - -When decode starts, it parses XML namespace declarations and creates a map in the -xmlDecDriver. While parsing, that map continuously gets updated. -The only problem happens when a namespace declaration happens on the node that it defines. -e.g. -To handle this, each Element must be fully parsed at a time, -even if it amounts to multiple tokens which are returned one at a time on request. - -xmlns is a special attribute name. - - It is used to define namespaces, including the default - - It is never returned as an AttrKey or AttrVal. - *We may decide later to allow user to use it e.g. you want to parse the xmlns mappings into a field.* - -Number, bool, null, mapKey, etc can all be decoded from any xmlToken. -This accommodates map[int]string for example. - -It should be possible to create a schema from the types, -or vice versa (generate types from schema with appropriate tags). -This is however out-of-scope from this parsing project. - -We should write all namespace information at the first point that it is referenced in the tree, -and use the mapping for all child nodes and attributes. This means that state is maintained -at a point in the tree. This also means that calls to Decode or MustDecode will reset some state. - -When decoding, it is important to keep track of entity references and default attribute values. -It seems these can only be stored in the DTD components. We should honor them when decoding. - -Configuration for XMLHandle will look like this: - - XMLHandle - DefaultNS string - // Encoding: - NS map[string]string // ns URI to key, used for encoding - // Decoding: in case ENTITY declared in external schema or dtd, store info needed here - Entities map[string]string // map of entity rep to character - - -During encode, if a namespace mapping is not defined for a namespace found on a struct, -then we create a mapping for it using nsN (where N is 1..1000000, and doesn't conflict -with any other namespace mapping). - -Note that different fields in a struct can have different namespaces. -However, all fields will default to the namespace on the _struct field (if defined). - -An XML document is a name, a map of attributes and a list of children. -Consequently, we cannot "DecodeNaked" into a map[string]interface{} (for example). -We have to "DecodeNaked" into something that resembles XML data. - -To support DecodeNaked (decode into nil interface{}), we have to define some "supporting" types: - type Name struct { // Preferred. Less allocations due to conversions. - Local string - Space string - } - type Element struct { - Name Name - Attrs map[Name]string - Children []interface{} // each child is either *Element or string - } -Only two "supporting" types are exposed for XML: Name and Element. - -// ------------------ - -We considered 'type Name string' where Name is like "Space Local" (space-separated). -We decided against it, because each creation of a name would lead to -double allocation (first convert []byte to string, then concatenate them into a string). -The benefit is that it is faster to read Attrs from a map. But given that Element is a value -object, we want to eschew methods and have public exposed variables. - -We also considered the following, where xml types were not value objects, and we used -intelligent accessor methods to extract information and for performance. -*** WE DECIDED AGAINST THIS. *** - type Attr struct { - Name Name - Value string - } - // Element is a ValueObject: There are no accessor methods. - // Make element self-contained. - type Element struct { - Name Name - attrsMap map[string]string // where key is "Space Local" - attrs []Attr - childrenT []string - childrenE []Element - childrenI []int // each child is a index into T or E. - } - func (x *Element) child(i) interface{} // returns string or *Element - -// ------------------ - -Per XML spec and our default handling, white space is always treated as -insignificant between elements, except in a text node. The xml:space='preserve' -attribute is ignored. - -**Note: there is no xml: namespace. The xml: attributes were defined before namespaces.** -**So treat them as just "directives" that should be interpreted to mean something**. - -On encoding, we support indenting aka prettifying markup in the same way we support it for json. - -A document or element can only be encoded/decoded from/to a struct. In this mode: - - struct name maps to element name (or tag-info from _struct field) - - fields are mapped to child elements or attributes - -A map is either encoded as attributes on current element, or as a set of child elements. -Maps are encoded as attributes iff their keys and values are primitives (number, bool, string). - -A list is encoded as a set of child elements. - -Primitives (number, bool, string) are encoded as an element, attribute or text -depending on the context. - -Extensions must encode themselves as a text string. - -Encoding is tough, specifically when encoding mappings, because we need to encode -as either attribute or element. To do this, we need to default to encoding as attributes, -and then let Encoder inform the Handle when to start encoding as nodes. -i.e. Encoder does something like: - - h.EncodeMapStart() - h.Encode(), h.Encode(), ... - h.EncodeMapNotAttrSignal() // this is not a bool, because it's a signal - h.Encode(), h.Encode(), ... - h.EncodeEnd() - -Only XMLHandle understands this, and will set itself to start encoding as elements. - -This support extends to maps. For example, if a struct field is a map, and it has -the struct tag signifying it should be attr, then all its fields are encoded as attributes. -e.g. - - type X struct { - M map[string]int `codec:"m,attr"` // encode keys as attributes named - } - -Question: - - if encoding a map, what if map keys have spaces in them??? - Then they cannot be attributes or child elements. Error. - -Options to consider adding later: - - For attribute values, normalize by trimming beginning and ending white space, - and converting every white space sequence to a single space. - - ATTLIST restrictions are enforced. - e.g. default value of xml:space, skipping xml:XYZ style attributes, etc. - - Consider supporting NON-STRICT mode (e.g. to handle HTML parsing). - Some elements e.g. br, hr, etc need not close and should be auto-closed - ... (see http://www.w3.org/TR/html4/loose.dtd) - An expansive set of entities are pre-defined. - - Have easy way to create a HTML parser: - add a HTML() method to XMLHandle, that will set Strict=false, specify AutoClose, - and add HTML Entities to the list. - - Support validating element/attribute XMLName before writing it. - Keep this behind a flag, which is set to false by default (for performance). - type XMLHandle struct { - CheckName bool - } - -Misc: - -ROADMAP (1 weeks): - - build encoder (1 day) - - build decoder (based off xmlParser) (1 day) - - implement xmlParser (2 days). - Look at encoding/xml for inspiration. - - integrate and TEST (1 days) - - write article and post it (1 day) - -// ---------- MORE NOTES FROM 2017-11-30 ------------ - -when parsing -- parse the attributes first -- then parse the nodes - -basically: -- if encoding a field: we use the field name for the wrapper -- if encoding a non-field, then just use the element type name - - map[string]string ==> abcval... or - val... OR - val1val2... <- PREFERED - []string ==> v1v2... - string v1 ==> v1 - bool true ==> true - float 1.0 ==> 1.0 - ... - - F1 map[string]string ==> abcval... OR - val... OR - val... <- PREFERED - F2 []string ==> v1v2... - F3 bool ==> true - ... - -- a scalar is encoded as: - (value) of type T ==> - (value) of field F ==> -- A kv-pair is encoded as: - (key,value) ==> OR - (key,value) of field F ==> OR -- A map or struct is just a list of kv-pairs -- A list is encoded as sequences of same node e.g. - - - value21 - value22 -- we may have to singularize the field name, when entering into xml, - and pluralize them when encoding. -- bi-directional encode->decode->encode is not a MUST. - even encoding/xml cannot decode correctly what was encoded: - - see https://play.golang.org/p/224V_nyhMS - func main() { - fmt.Println("Hello, playground") - v := []interface{}{"hello", 1, true, nil, time.Now()} - s, err := xml.Marshal(v) - fmt.Printf("err: %v, \ns: %s\n", err, s) - var v2 []interface{} - err = xml.Unmarshal(s, &v2) - fmt.Printf("err: %v, \nv2: %v\n", err, v2) - type T struct { - V []interface{} - } - v3 := T{V: v} - s, err = xml.Marshal(v3) - fmt.Printf("err: %v, \ns: %s\n", err, s) - var v4 T - err = xml.Unmarshal(s, &v4) - fmt.Printf("err: %v, \nv4: %v\n", err, v4) - } - Output: - err: , - s: hello1true - err: , - v2: [] - err: , - s: hello1true2009-11-10T23:00:00Z - err: , - v4: {[ ]} -- -*/ - -// ----------- PARSER ------------------- - -type xmlTokenType uint8 - -const ( - _ xmlTokenType = iota << 1 - xmlTokenElemStart - xmlTokenElemEnd - xmlTokenAttrKey - xmlTokenAttrVal - xmlTokenText -) - -type xmlToken struct { - Type xmlTokenType - Value string - Namespace string // blank for AttrVal and Text -} - -type xmlParser struct { - r decReader - toks []xmlToken // list of tokens. - ptr int // ptr into the toks slice - done bool // nothing else to parse. r now returns EOF. -} - -func (x *xmlParser) next() (t *xmlToken) { - // once x.done, or x.ptr == len(x.toks) == 0, then return nil (to signify finish) - if !x.done && len(x.toks) == 0 { - x.nextTag() - } - // parses one element at a time (into possible many tokens) - if x.ptr < len(x.toks) { - t = &(x.toks[x.ptr]) - x.ptr++ - if x.ptr == len(x.toks) { - x.ptr = 0 - x.toks = x.toks[:0] - } - } - return -} - -// nextTag will parses the next element and fill up toks. -// It set done flag if/once EOF is reached. -func (x *xmlParser) nextTag() { - // TODO: implement. -} - -// ----------- ENCODER ------------------- - -type xmlEncDriver struct { - e *Encoder - w encWriter - h *XMLHandle - b [64]byte // scratch - bs []byte // scratch - // s jsonStack - noBuiltInTypes -} - -// ----------- DECODER ------------------- - -type xmlDecDriver struct { - d *Decoder - h *XMLHandle - r decReader // *bytesDecReader decReader - ct valueType // container type. one of unset, array or map. - bstr [8]byte // scratch used for string \UXXX parsing - b [64]byte // scratch - - // wsSkipped bool // whitespace skipped - - // s jsonStack - - noBuiltInTypes -} - -// DecodeNaked will decode into an XMLNode - -// XMLName is a value object representing a namespace-aware NAME -type XMLName struct { - Local string - Space string -} - -// XMLNode represents a "union" of the different types of XML Nodes. -// Only one of fields (Text or *Element) is set. -type XMLNode struct { - Element *Element - Text string -} - -// XMLElement is a value object representing an fully-parsed XML element. -type XMLElement struct { - Name Name - Attrs map[XMLName]string - // Children is a list of child nodes, each being a *XMLElement or string - Children []XMLNode -} - -// ----------- HANDLE ------------------- - -type XMLHandle struct { - BasicHandle - textEncodingType - - DefaultNS string - NS map[string]string // ns URI to key, for encoding - Entities map[string]string // entity representation to string, for encoding. -} - -func (h *XMLHandle) newEncDriver(e *Encoder) encDriver { - return &xmlEncDriver{e: e, w: e.w, h: h} -} - -func (h *XMLHandle) newDecDriver(d *Decoder) decDriver { - // d := xmlDecDriver{r: r.(*bytesDecReader), h: h} - hd := xmlDecDriver{d: d, r: d.r, h: h} - hd.n.bytes = d.b[:] - return &hd -} - -func (h *XMLHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { - return h.SetExt(rt, tag, &extWrapper{bytesExtFailer{}, ext}) -} - -var _ decDriver = (*xmlDecDriver)(nil) -var _ encDriver = (*xmlEncDriver)(nil) diff --git a/vendor/github.com/urfave/negroni/.gitignore b/vendor/github.com/urfave/negroni/.gitignore new file mode 100644 index 000000000000..3f2bc47416e7 --- /dev/null +++ b/vendor/github.com/urfave/negroni/.gitignore @@ -0,0 +1 @@ +/coverage.txt diff --git a/vendor/github.com/urfave/negroni/CHANGELOG.md b/vendor/github.com/urfave/negroni/CHANGELOG.md new file mode 100644 index 000000000000..f41043188bdd --- /dev/null +++ b/vendor/github.com/urfave/negroni/CHANGELOG.md @@ -0,0 +1,64 @@ +# Change Log + +**ATTN**: This project uses [semantic versioning](http://semver.org/). + +## [Unreleased] - + +## [0.3.0] - 2017-11-11 +### Added +- `With()` helper for building a new `Negroni` struct chaining handlers from + existing `Negroni` structs +- Format log output in `Logger` middleware via a configurable `text/template` + string injectable via `.SetFormat`. Added `LoggerDefaultFormat` and + `LoggerDefaultDateFormat` to configure the default template and date format + used by the `Logger` middleware. +- Support for HTTP/2 pusher support via `http.Pusher` interface for Go 1.8+. +- `WrapFunc` to convert `http.HandlerFunc` into a `negroni.Handler` +- `Formatter` field added to `Recovery` middleware to allow configuring how + `panic`s are output. Default of `TextFormatter` (how it was output in + `0.2.0`) used. `HTMLPanicFormatter` also added to allow easy outputing of + `panic`s as HTML. + +### Fixed +- `Written()` correct returns `false` if no response header has been written +- Only implement `http.CloseNotifier` with the `negroni.ResponseWriter` if the + underlying `http.ResponseWriter` implements it (previously would always + implement it and panic if the underlying `http.ResponseWriter` did not. + +### Changed +- Set default status to `0` in the case that no handler writes status -- was + previously `200` (in 0.2.0, before that it was `0` so this reestablishes that + behavior) +- Catch `panic`s thrown by callbacks provided to the `Recovery` handler +- Recovery middleware will set `text/plain` content-type if none is set +- `ALogger` interface to allow custom logger outputs to be used with the + `Logger` middleware. Changes embeded field in `negroni.Logger` from `Logger` + to `ALogger`. +- Default `Logger` middleware output changed to be more structure and verbose + (also now configurable, see `Added`) +- Automatically bind to port specified in `$PORT` in `.Run()` if an address is + not passed in. Fall back to binding to `:8080` if no address specified + (configuable via `DefaultAddress`). +- `PanicHandlerFunc` added to `Recovery` middleware to enhance custom handling + of `panic`s by providing additional information to the handler including the + stack and the `http.Request`. `Recovery.ErrorHandlerFunc` was also added, but + deprecated in favor of the new `PanicHandlerFunc`. + +## [0.2.0] - 2016-05-10 +### Added +- Support for variadic handlers in `New()` +- Added `Negroni.Handlers()` to fetch all of the handlers for a given chain +- Allowed size in `Recovery` handler was bumped to 8k +- `Negroni.UseFunc` to push another handler onto the chain + +### Changed +- Set the status before calling `beforeFuncs` so the information is available to them +- Set default status to `200` in the case that no handler writes status -- was previously `0` +- Panic if `nil` handler is given to `negroni.Use` + +## 0.1.0 - 2013-07-22 +### Added +- Initial implementation. + +[Unreleased]: https://github.com/urfave/negroni/compare/v0.2.0...HEAD +[0.2.0]: https://github.com/urfave/negroni/compare/v0.1.0...v0.2.0 diff --git a/vendor/github.com/urfave/negroni/README.md b/vendor/github.com/urfave/negroni/README.md new file mode 100644 index 000000000000..c1db0aa48e1e --- /dev/null +++ b/vendor/github.com/urfave/negroni/README.md @@ -0,0 +1,547 @@ +# Negroni +[![GoDoc](https://godoc.org/github.com/urfave/negroni?status.svg)](http://godoc.org/github.com/urfave/negroni) +[![Build Status](https://travis-ci.org/urfave/negroni.svg?branch=master)](https://travis-ci.org/urfave/negroni) +[![codebeat](https://codebeat.co/badges/47d320b1-209e-45e8-bd99-9094bc5111e2)](https://codebeat.co/projects/github-com-urfave-negroni) +[![codecov](https://codecov.io/gh/urfave/negroni/branch/master/graph/badge.svg)](https://codecov.io/gh/urfave/negroni) + +**Notice:** This is the library formerly known as +`github.com/codegangsta/negroni` -- Github will automatically redirect requests +to this repository, but we recommend updating your references for clarity. + +Negroni is an idiomatic approach to web middleware in Go. It is tiny, +non-intrusive, and encourages use of `net/http` Handlers. + +If you like the idea of [Martini](https://github.com/go-martini/martini), but +you think it contains too much magic, then Negroni is a great fit. + +Language Translations: +* [Deutsch (de_DE)](translations/README_de_de.md) +* [Português Brasileiro (pt_BR)](translations/README_pt_br.md) +* [简体中文 (zh_CN)](translations/README_zh_CN.md) +* [繁體中文 (zh_TW)](translations/README_zh_tw.md) +* [日本語 (ja_JP)](translations/README_ja_JP.md) +* [Français (fr_FR)](translations/README_fr_FR.md) + +## Getting Started + +After installing Go and setting up your +[GOPATH](http://golang.org/doc/code.html#GOPATH), create your first `.go` file. +We'll call it `server.go`. + + +``` go +package main + +import ( + "fmt" + "net/http" + + "github.com/urfave/negroni" +) + +func main() { + mux := http.NewServeMux() + mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { + fmt.Fprintf(w, "Welcome to the home page!") + }) + + n := negroni.Classic() // Includes some default middlewares + n.UseHandler(mux) + + http.ListenAndServe(":3000", n) +} +``` + +Then install the Negroni package (**NOTE**: >= **go 1.1** is required): + +``` +go get github.com/urfave/negroni +``` + +Then run your server: + +``` +go run server.go +``` + +You will now have a Go `net/http` webserver running on `localhost:3000`. + +### Packaging + +If you are on Debian, `negroni` is also available as [a +package](https://packages.debian.org/sid/golang-github-urfave-negroni-dev) that +you can install via `apt install golang-github-urfave-negroni-dev` (at the time +of writing, it is in the `sid` repositories). + +## Is Negroni a Framework? + +Negroni is **not** a framework. It is a middleware-focused library that is +designed to work directly with `net/http`. + +## Routing? + +Negroni is BYOR (Bring your own Router). The Go community already has a number +of great http routers available, and Negroni tries to play well with all of them +by fully supporting `net/http`. For instance, integrating with [Gorilla Mux] +looks like so: + +``` go +router := mux.NewRouter() +router.HandleFunc("/", HomeHandler) + +n := negroni.New(Middleware1, Middleware2) +// Or use a middleware with the Use() function +n.Use(Middleware3) +// router goes last +n.UseHandler(router) + +http.ListenAndServe(":3001", n) +``` + +## `negroni.Classic()` + +`negroni.Classic()` provides some default middleware that is useful for most +applications: + +* [`negroni.Recovery`](#recovery) - Panic Recovery Middleware. +* [`negroni.Logger`](#logger) - Request/Response Logger Middleware. +* [`negroni.Static`](#static) - Static File serving under the "public" + directory. + +This makes it really easy to get started with some useful features from Negroni. + +## Handlers + +Negroni provides a bidirectional middleware flow. This is done through the +`negroni.Handler` interface: + +``` go +type Handler interface { + ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) +} +``` + +If a middleware hasn't already written to the `ResponseWriter`, it should call +the next `http.HandlerFunc` in the chain to yield to the next middleware +handler. This can be used for great good: + +``` go +func MyMiddleware(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) { + // do some stuff before + next(rw, r) + // do some stuff after +} +``` + +And you can map it to the handler chain with the `Use` function: + +``` go +n := negroni.New() +n.Use(negroni.HandlerFunc(MyMiddleware)) +``` + +You can also map plain old `http.Handler`s: + +``` go +n := negroni.New() + +mux := http.NewServeMux() +// map your routes + +n.UseHandler(mux) + +http.ListenAndServe(":3000", n) +``` + +## `With()` + +Negroni has a convenience function called `With`. `With` takes one or more +`Handler` instances and returns a new `Negroni` with the combination of the +receiver's handlers and the new handlers. + +```go +// middleware we want to reuse +common := negroni.New() +common.Use(MyMiddleware1) +common.Use(MyMiddleware2) + +// `specific` is a new negroni with the handlers from `common` combined with the +// the handlers passed in +specific := common.With( + SpecificMiddleware1, + SpecificMiddleware2 +) +``` + +## `Run()` + +Negroni has a convenience function called `Run`. `Run` takes an addr string +identical to [`http.ListenAndServe`](https://godoc.org/net/http#ListenAndServe). + + +``` go +package main + +import ( + "github.com/urfave/negroni" +) + +func main() { + n := negroni.Classic() + n.Run(":8080") +} +``` +If no address is provided, the `PORT` environment variable is used instead. +If the `PORT` environment variable is not defined, the default address will be used. +See [Run](https://godoc.org/github.com/urfave/negroni#Negroni.Run) for a complete description. + +In general, you will want to use `net/http` methods and pass `negroni` as a +`Handler`, as this is more flexible, e.g.: + + +``` go +package main + +import ( + "fmt" + "log" + "net/http" + "time" + + "github.com/urfave/negroni" +) + +func main() { + mux := http.NewServeMux() + mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { + fmt.Fprintf(w, "Welcome to the home page!") + }) + + n := negroni.Classic() // Includes some default middlewares + n.UseHandler(mux) + + s := &http.Server{ + Addr: ":8080", + Handler: n, + ReadTimeout: 10 * time.Second, + WriteTimeout: 10 * time.Second, + MaxHeaderBytes: 1 << 20, + } + log.Fatal(s.ListenAndServe()) +} +``` + +## Route Specific Middleware + +If you have a route group of routes that need specific middleware to be +executed, you can simply create a new Negroni instance and use it as your route +handler. + +``` go +router := mux.NewRouter() +adminRoutes := mux.NewRouter() +// add admin routes here + +// Create a new negroni for the admin middleware +router.PathPrefix("/admin").Handler(negroni.New( + Middleware1, + Middleware2, + negroni.Wrap(adminRoutes), +)) +``` + +If you are using [Gorilla Mux], here is an example using a subrouter: + +``` go +router := mux.NewRouter() +subRouter := mux.NewRouter().PathPrefix("/subpath").Subrouter().StrictSlash(true) +subRouter.HandleFunc("/", someSubpathHandler) // "/subpath/" +subRouter.HandleFunc("/:id", someSubpathHandler) // "/subpath/:id" + +// "/subpath" is necessary to ensure the subRouter and main router linkup +router.PathPrefix("/subpath").Handler(negroni.New( + Middleware1, + Middleware2, + negroni.Wrap(subRouter), +)) +``` + +`With()` can be used to eliminate redundancy for middlewares shared across +routes. + +``` go +router := mux.NewRouter() +apiRoutes := mux.NewRouter() +// add api routes here +webRoutes := mux.NewRouter() +// add web routes here + +// create common middleware to be shared across routes +common := negroni.New( + Middleware1, + Middleware2, +) + +// create a new negroni for the api middleware +// using the common middleware as a base +router.PathPrefix("/api").Handler(common.With( + APIMiddleware1, + negroni.Wrap(apiRoutes), +)) +// create a new negroni for the web middleware +// using the common middleware as a base +router.PathPrefix("/web").Handler(common.With( + WebMiddleware1, + negroni.Wrap(webRoutes), +)) +``` + +## Bundled Middleware + +### Static + +This middleware will serve files on the filesystem. If the files do not exist, +it proxies the request to the next middleware. If you want the requests for +non-existent files to return a `404 File Not Found` to the user you should look +at using [http.FileServer](https://golang.org/pkg/net/http/#FileServer) as +a handler. + +Example: + + +``` go +package main + +import ( + "fmt" + "net/http" + + "github.com/urfave/negroni" +) + +func main() { + mux := http.NewServeMux() + mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { + fmt.Fprintf(w, "Welcome to the home page!") + }) + + // Example of using a http.FileServer if you want "server-like" rather than "middleware" behavior + // mux.Handle("/public", http.FileServer(http.Dir("/home/public"))) + + n := negroni.New() + n.Use(negroni.NewStatic(http.Dir("/tmp"))) + n.UseHandler(mux) + + http.ListenAndServe(":3002", n) +} +``` + +Will serve files from the `/tmp` directory first, but proxy calls to the next +handler if the request does not match a file on the filesystem. + +### Recovery + +This middleware catches `panic`s and responds with a `500` response code. If +any other middleware has written a response code or body, this middleware will +fail to properly send a 500 to the client, as the client has already received +the HTTP response code. Additionally, an `PanicHandlerFunc` can be attached +to report 500's to an error reporting service such as Sentry or Airbrake. + +Example: + + +``` go +package main + +import ( + "net/http" + + "github.com/urfave/negroni" +) + +func main() { + mux := http.NewServeMux() + mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { + panic("oh no") + }) + + n := negroni.New() + n.Use(negroni.NewRecovery()) + n.UseHandler(mux) + + http.ListenAndServe(":3003", n) +} +``` + +Will return a `500 Internal Server Error` to each request. It will also log the +stack traces as well as print the stack trace to the requester if `PrintStack` +is set to `true` (the default). + +Example with error handler: + +``` go +package main + +import ( + "net/http" + + "github.com/urfave/negroni" +) + +func main() { + mux := http.NewServeMux() + mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { + panic("oh no") + }) + + n := negroni.New() + recovery := negroni.NewRecovery() + recovery.PanicHandlerFunc = reportToSentry + n.Use(recovery) + n.UseHandler(mux) + + http.ListenAndServe(":3003", n) +} + +func reportToSentry(info *negroni.PanicInformation) { + // write code here to report error to Sentry +} +``` + +The middleware simply output the informations on STDOUT by default. +You can customize the output process by using the `SetFormatter()` function. + +You can use also the `HTMLPanicFormatter` to display a pretty HTML when a crash occurs. + + +``` go +package main + +import ( + "net/http" + + "github.com/urfave/negroni" +) + +func main() { + mux := http.NewServeMux() + mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { + panic("oh no") + }) + + n := negroni.New() + recovery := negroni.NewRecovery() + recovery.Formatter = &negroni.HTMLPanicFormatter{} + n.Use(recovery) + n.UseHandler(mux) + + http.ListenAndServe(":3003", n) +} +``` + +## Logger + +This middleware logs each incoming request and response. + +Example: + + +``` go +package main + +import ( + "fmt" + "net/http" + + "github.com/urfave/negroni" +) + +func main() { + mux := http.NewServeMux() + mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { + fmt.Fprintf(w, "Welcome to the home page!") + }) + + n := negroni.New() + n.Use(negroni.NewLogger()) + n.UseHandler(mux) + + http.ListenAndServe(":3004", n) +} +``` + +Will print a log similar to: + +``` +[negroni] 2017-10-04T14:56:25+02:00 | 200 | 378µs | localhost:3004 | GET / +``` + +on each request. + +You can also set your own log format by calling the `SetFormat` function. The format is a template string with fields as mentioned in the `LoggerEntry` struct. So, as an example - + +```go +l.SetFormat("[{{.Status}} {{.Duration}}] - {{.Request.UserAgent}}") +``` + +will show something like - `[200 18.263µs] - Go-User-Agent/1.1 ` + +## Third Party Middleware + +Here is a current list of Negroni compatible middlware. Feel free to put up a PR +linking your middleware if you have built one: + +| Middleware | Author | Description | +| -----------|--------|-------------| +| [authz](https://github.com/casbin/negroni-authz) | [Yang Luo](https://github.com/hsluoyz) | ACL, RBAC, ABAC Authorization middlware based on [Casbin](https://github.com/casbin/casbin) | +| [binding](https://github.com/mholt/binding) | [Matt Holt](https://github.com/mholt) | Data binding from HTTP requests into structs | +| [cloudwatch](https://github.com/cvillecsteele/negroni-cloudwatch) | [Colin Steele](https://github.com/cvillecsteele) | AWS cloudwatch metrics middleware | +| [cors](https://github.com/rs/cors) | [Olivier Poitrey](https://github.com/rs) | [Cross Origin Resource Sharing](http://www.w3.org/TR/cors/) (CORS) support | +| [csp](https://github.com/awakenetworks/csp) | [Awake Networks](https://github.com/awakenetworks) | [Content Security Policy](https://www.w3.org/TR/CSP2/) (CSP) support | +| [delay](https://github.com/jeffbmartinez/delay) | [Jeff Martinez](https://github.com/jeffbmartinez) | Add delays/latency to endpoints. Useful when testing effects of high latency | +| [New Relic Go Agent](https://github.com/yadvendar/negroni-newrelic-go-agent) | [Yadvendar Champawat](https://github.com/yadvendar) | Official [New Relic Go Agent](https://github.com/newrelic/go-agent) (currently in beta) | +| [gorelic](https://github.com/jingweno/negroni-gorelic) | [Jingwen Owen Ou](https://github.com/jingweno) | New Relic agent for Go runtime | +| [Graceful](https://github.com/tylerb/graceful) | [Tyler Bunnell](https://github.com/tylerb) | Graceful HTTP Shutdown | +| [gzip](https://github.com/phyber/negroni-gzip) | [phyber](https://github.com/phyber) | GZIP response compression | +| [JWT Middleware](https://github.com/auth0/go-jwt-middleware) | [Auth0](https://github.com/auth0) | Middleware checks for a JWT on the `Authorization` header on incoming requests and decodes it| +| [logrus](https://github.com/meatballhat/negroni-logrus) | [Dan Buch](https://github.com/meatballhat) | Logrus-based logger | +| [oauth2](https://github.com/goincremental/negroni-oauth2) | [David Bochenski](https://github.com/bochenski) | oAuth2 middleware | +| [onthefly](https://github.com/xyproto/onthefly) | [Alexander Rødseth](https://github.com/xyproto) | Generate TinySVG, HTML and CSS on the fly | +| [permissions2](https://github.com/xyproto/permissions2) | [Alexander Rødseth](https://github.com/xyproto) | Cookies, users and permissions | +| [prometheus](https://github.com/zbindenren/negroni-prometheus) | [Rene Zbinden](https://github.com/zbindenren) | Easily create metrics endpoint for the [prometheus](http://prometheus.io) instrumentation tool | +| [render](https://github.com/unrolled/render) | [Cory Jacobsen](https://github.com/unrolled) | Render JSON, XML and HTML templates | +| [RestGate](https://github.com/pjebs/restgate) | [Prasanga Siripala](https://github.com/pjebs) | Secure authentication for REST API endpoints | +| [secure](https://github.com/unrolled/secure) | [Cory Jacobsen](https://github.com/unrolled) | Middleware that implements a few quick security wins | +| [sessions](https://github.com/goincremental/negroni-sessions) | [David Bochenski](https://github.com/bochenski) | Session Management | +| [stats](https://github.com/thoas/stats) | [Florent Messa](https://github.com/thoas) | Store information about your web application (response time, etc.) | +| [VanGoH](https://github.com/auroratechnologies/vangoh) | [Taylor Wrobel](https://github.com/twrobel3) | Configurable [AWS-Style](http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) HMAC authentication middleware | +| [xrequestid](https://github.com/pilu/xrequestid) | [Andrea Franz](https://github.com/pilu) | Middleware that assigns a random X-Request-Id header to each request | +| [mgo session](https://github.com/joeljames/nigroni-mgo-session) | [Joel James](https://github.com/joeljames) | Middleware that handles creating and closing mgo sessions per request | +| [digits](https://github.com/bamarni/digits) | [Bilal Amarni](https://github.com/bamarni) | Middleware that handles [Twitter Digits](https://get.digits.com/) authentication | +| [stats](https://github.com/guptachirag/stats) | [Chirag Gupta](https://github.com/guptachirag/stats) | Middleware that manages qps and latency stats for your endpoints and asynchronously flushes them to influx db | + +## Examples + +[Alexander Rødseth](https://github.com/xyproto) created +[mooseware](https://github.com/xyproto/mooseware), a skeleton for writing a +Negroni middleware handler. + +[Prasanga Siripala](https://github.com/pjebs) created an effective skeleton structure for web-based Go/Negroni projects: [Go-Skeleton](https://github.com/pjebs/go-skeleton) + +## Live code reload? + +[gin](https://github.com/codegangsta/gin) and +[fresh](https://github.com/pilu/fresh) both live reload negroni apps. + +## Essential Reading for Beginners of Go & Negroni + +* [Using a Context to pass information from middleware to end handler](http://elithrar.github.io/article/map-string-interface/) +* [Understanding middleware](https://mattstauffer.co/blog/laravel-5.0-middleware-filter-style) + +## About + +Negroni is obsessively designed by none other than the [Code +Gangsta](https://codegangsta.io/) + +[Gorilla Mux]: https://github.com/gorilla/mux +[`http.FileSystem`]: https://godoc.org/net/http#FileSystem diff --git a/vendor/github.com/valyala/bytebufferpool/README.md b/vendor/github.com/valyala/bytebufferpool/README.md new file mode 100644 index 000000000000..061357e833d9 --- /dev/null +++ b/vendor/github.com/valyala/bytebufferpool/README.md @@ -0,0 +1,21 @@ +[![Build Status](https://travis-ci.org/valyala/bytebufferpool.svg)](https://travis-ci.org/valyala/bytebufferpool) +[![GoDoc](https://godoc.org/github.com/valyala/bytebufferpool?status.svg)](http://godoc.org/github.com/valyala/bytebufferpool) +[![Go Report](http://goreportcard.com/badge/valyala/bytebufferpool)](http://goreportcard.com/report/valyala/bytebufferpool) + +# bytebufferpool + +An implementation of a pool of byte buffers with anti-memory-waste protection. + +The pool may waste limited amount of memory due to fragmentation. +This amount equals to the maximum total size of the byte buffers +in concurrent use. + +# Benchmark results +Currently bytebufferpool is fastest and most effective buffer pool written in Go. + +You can find results [here](https://omgnull.github.io/go-benchmark/buffer/). + +# bytebufferpool users + +* [fasthttp](https://github.com/valyala/fasthttp) +* [quicktemplate](https://github.com/valyala/quicktemplate) diff --git a/vendor/github.com/valyala/fasttemplate/README.md b/vendor/github.com/valyala/fasttemplate/README.md new file mode 100644 index 000000000000..3a4d56cee33f --- /dev/null +++ b/vendor/github.com/valyala/fasttemplate/README.md @@ -0,0 +1,85 @@ +fasttemplate +============ + +Simple and fast template engine for Go. + +Fasttemplate peforms only a single task - it substitutes template placeholders +with user-defined values. At high speed :) + +Take a look at [quicktemplate](https://github.com/valyala/quicktemplate) if you need fast yet powerful html template engine. + +*Please note that fasttemplate doesn't do any escaping on template values +unlike [html/template](http://golang.org/pkg/html/template/) do. So values +must be properly escaped before passing them to fasttemplate.* + +Fasttemplate is faster than [text/template](http://golang.org/pkg/text/template/), +[strings.Replace](http://golang.org/pkg/strings/#Replace), +[strings.Replacer](http://golang.org/pkg/strings/#Replacer) +and [fmt.Fprintf](https://golang.org/pkg/fmt/#Fprintf) on placeholders' substitution. + +Below are benchmark results comparing fasttemplate performance to text/template, +strings.Replace, strings.Replacer and fmt.Fprintf: + +``` +$ go test -bench=. -benchmem +PASS +BenchmarkFmtFprintf-4 2000000 790 ns/op 0 B/op 0 allocs/op +BenchmarkStringsReplace-4 500000 3474 ns/op 2112 B/op 14 allocs/op +BenchmarkStringsReplacer-4 500000 2657 ns/op 2256 B/op 23 allocs/op +BenchmarkTextTemplate-4 500000 3333 ns/op 336 B/op 19 allocs/op +BenchmarkFastTemplateExecuteFunc-4 5000000 349 ns/op 0 B/op 0 allocs/op +BenchmarkFastTemplateExecute-4 3000000 383 ns/op 0 B/op 0 allocs/op +BenchmarkFastTemplateExecuteFuncString-4 3000000 549 ns/op 144 B/op 1 allocs/op +BenchmarkFastTemplateExecuteString-4 3000000 572 ns/op 144 B/op 1 allocs/op +BenchmarkFastTemplateExecuteTagFunc-4 2000000 743 ns/op 144 B/op 3 allocs/op +``` + + +Docs +==== + +See http://godoc.org/github.com/valyala/fasttemplate . + + +Usage +===== + +```go + template := "http://{{host}}/?q={{query}}&foo={{bar}}{{bar}}" + t := fasttemplate.New(template, "{{", "}}") + s := t.ExecuteString(map[string]interface{}{ + "host": "google.com", + "query": url.QueryEscape("hello=world"), + "bar": "foobar", + }) + fmt.Printf("%s", s) + + // Output: + // http://google.com/?q=hello%3Dworld&foo=foobarfoobar +``` + + +Advanced usage +============== + +```go + template := "Hello, [user]! You won [prize]!!! [foobar]" + t, err := fasttemplate.NewTemplate(template, "[", "]") + if err != nil { + log.Fatalf("unexpected error when parsing template: %s", err) + } + s := t.ExecuteFuncString(func(w io.Writer, tag string) (int, error) { + switch tag { + case "user": + return w.Write([]byte("John")) + case "prize": + return w.Write([]byte("$100500")) + default: + return w.Write([]byte(fmt.Sprintf("[unknown tag %q]", tag))) + } + }) + fmt.Printf("%s", s) + + // Output: + // Hello, John! You won $100500!!! [unknown tag "foobar"] +``` diff --git a/vendor/github.com/viki-org/dnscache/readme.md b/vendor/github.com/viki-org/dnscache/readme.md new file mode 100644 index 000000000000..8c737aac35df --- /dev/null +++ b/vendor/github.com/viki-org/dnscache/readme.md @@ -0,0 +1,38 @@ +### A DNS cache for Go +CGO is used to lookup domain names. Given enough concurrent requests and the slightest hiccup in name resolution, it's quite easy to end up with blocked/leaking goroutines. + +The issue is documented at + +The Go team's singleflight solution (which isn't in stable yet) is rather elegant. However, it only eliminates concurrent lookups (thundering herd problems). Many systems can live with slightly stale resolve names, which means we can cacne DNS lookups and refresh them in the background. + +### Installation +Install using the "go get" command: + + go get github.com/viki-org/dnscache + +### Usage +The cache is thread safe. Create a new instance by specifying how long each entry should be cached (in seconds). Items will be refreshed in the background. + + //refresh items every 5 minutes + resolver := dnscache.New(time.Minute * 5) + + //get an array of net.IP + ips, _ := resolver.Fetch("api.viki.io") + + //get the first net.IP + ip, _ := resolver.FetchOne("api.viki.io") + + //get the first net.IP as string + ip, _ := resolver.FetchOneString("api.viki.io") + +If you are using an `http.Transport`, you can use this cache by speficifying a +`Dial` function: + + transport := &http.Transport { + MaxIdleConnsPerHost: 64, + Dial: func(network string, address string) (net.Conn, error) { + separator := strings.LastIndex(address, ":") + ip, _ := dnscache.FetchString(address[:separator]) + return net.Dial("tcp", ip + address[separator:]) + }, + } diff --git a/vendor/github.com/zyedidia/highlight/README.md b/vendor/github.com/zyedidia/highlight/README.md new file mode 100644 index 000000000000..5750ddbf590d --- /dev/null +++ b/vendor/github.com/zyedidia/highlight/README.md @@ -0,0 +1,127 @@ +# Highlight +[![Go Report Card](https://goreportcard.com/badge/github.com/zyedidia/highlight)](https://goreportcard.com/report/github.com/zyedidia/highlight) +[![GoDoc](https://godoc.org/github.com/zyedidia/highlight?status.svg)](http://godoc.org/github.com/zyedidia/highlight) +[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/zyedidia/highlight/blob/master/LICENSE) + +This is a package for syntax highlighting a large number of different languages. To see the list of +languages currently supported, see the [`syntax_files`](./syntax_files) directory. + +Highlight allows you to pass in a string and get back all the information you need to syntax highlight +that string well. + +This project is still a work in progress and more features and documentation will be coming later. + +# Installation + +``` +go get github.com/zyedidia/highlight +``` + +# Usage + +Here is how to use this package to highlight a string. We will also be using `github.com/fatih/color` to actually +colorize the output to the console. + +```go +package main + +import ( + "fmt" + "io/ioutil" + "strings" + + "github.com/fatih/color" + "github.com/zyedidia/highlight" +) + +func main() { + // Here is the go code we will highlight + inputString := `package main + +import "fmt" + +// A hello world program +func main() { + fmt.Println("Hello world") +}` + + // Load the go syntax file + // Make sure that the syntax_files directory is in the current directory + syntaxFile, _ := ioutil.ReadFile("highlight/syntax_files/go.yaml") + + // Parse it into a `*highlight.Def` + syntaxDef, err := highlight.ParseDef(syntaxFile) + if err != nil { + fmt.Println(err) + return + } + + // Make a new highlighter from the definition + h := highlight.NewHighlighter(syntaxDef) + // Highlight the string + // Matches is an array of maps which point to groups + // matches[lineNum][colNum] will give you the change in group at that line and column number + // Note that there is only a group at a line and column number if the syntax highlighting changed at that position + matches := h.HighlightString(inputString) + + // We split the string into a bunch of lines + // Now we will print the string + lines := strings.Split(inputString, "\n") + for lineN, l := range lines { + for colN, c := range l { + // Check if the group changed at the current position + if group, ok := matches[lineN][colN]; ok { + // Check the group name and set the color accordingly (the colors chosen are arbitrary) + if group == highlight.Groups["statement"] { + color.Set(color.FgGreen) + } else if group == highlight.Groups["preproc"] { + color.Set(color.FgHiRed) + } else if group == highlight.Groups["special"] { + color.Set(color.FgBlue) + } else if group == highlight.Groups["constant.string"] { + color.Set(color.FgCyan) + } else if group == highlight.Groups["constant.specialChar"] { + color.Set(color.FgHiMagenta) + } else if group == highlight.Groups["type"] { + color.Set(color.FgYellow) + } else if group == highlight.Groups["constant.number"] { + color.Set(color.FgCyan) + } else if group == highlight.Groups["comment"] { + color.Set(color.FgHiGreen) + } else { + color.Unset() + } + } + // Print the character + fmt.Print(string(c)) + } + // This is at a newline, but highlighting might have been turned off at the very end of the line so we should check that. + if group, ok := matches[lineN][len(l)]; ok { + if group == highlight.Groups["default"] || group == highlight.Groups[""] { + color.Unset() + } + } + + fmt.Print("\n") + } +} +``` + +If you would like to automatically detect the filetype of a file based on the filename, and have the appropriate definition returned, +you can use the `DetectFiletype` function: + +```go +// Name of the file +filename := ... +// The first line of the file (needed to check the filetype by header: e.g. `#!/bin/bash` means shell) +firstLine := ... + +// Parse all the syntax files in an array with type []*highlight.Def +var defs []*highlight.Def +... + +def := highlight.DetectFiletype(defs, filename, firstLine) +fmt.Println("Filetype is", def.FileType) +``` + +For a full example, see the [`syncat`](./examples) example which acts like cat but will syntax highlight the output (if highlight recognizes the filetype). diff --git a/vendor/golang.org/x/net/html/atom/gen.go b/vendor/golang.org/x/net/html/atom/gen.go deleted file mode 100644 index 5d052781bcea..000000000000 --- a/vendor/golang.org/x/net/html/atom/gen.go +++ /dev/null @@ -1,712 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -//go:generate go run gen.go -//go:generate go run gen.go -test - -package main - -import ( - "bytes" - "flag" - "fmt" - "go/format" - "io/ioutil" - "math/rand" - "os" - "sort" - "strings" -) - -// identifier converts s to a Go exported identifier. -// It converts "div" to "Div" and "accept-charset" to "AcceptCharset". -func identifier(s string) string { - b := make([]byte, 0, len(s)) - cap := true - for _, c := range s { - if c == '-' { - cap = true - continue - } - if cap && 'a' <= c && c <= 'z' { - c -= 'a' - 'A' - } - cap = false - b = append(b, byte(c)) - } - return string(b) -} - -var test = flag.Bool("test", false, "generate table_test.go") - -func genFile(name string, buf *bytes.Buffer) { - b, err := format.Source(buf.Bytes()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - if err := ioutil.WriteFile(name, b, 0644); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } -} - -func main() { - flag.Parse() - - var all []string - all = append(all, elements...) - all = append(all, attributes...) - all = append(all, eventHandlers...) - all = append(all, extra...) - sort.Strings(all) - - // uniq - lists have dups - w := 0 - for _, s := range all { - if w == 0 || all[w-1] != s { - all[w] = s - w++ - } - } - all = all[:w] - - if *test { - var buf bytes.Buffer - fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") - fmt.Fprintln(&buf, "//go:generate go run gen.go -test\n") - fmt.Fprintln(&buf, "package atom\n") - fmt.Fprintln(&buf, "var testAtomList = []string{") - for _, s := range all { - fmt.Fprintf(&buf, "\t%q,\n", s) - } - fmt.Fprintln(&buf, "}") - - genFile("table_test.go", &buf) - return - } - - // Find hash that minimizes table size. - var best *table - for i := 0; i < 1000000; i++ { - if best != nil && 1<<(best.k-1) < len(all) { - break - } - h := rand.Uint32() - for k := uint(0); k <= 16; k++ { - if best != nil && k >= best.k { - break - } - var t table - if t.init(h, k, all) { - best = &t - break - } - } - } - if best == nil { - fmt.Fprintf(os.Stderr, "failed to construct string table\n") - os.Exit(1) - } - - // Lay out strings, using overlaps when possible. - layout := append([]string{}, all...) - - // Remove strings that are substrings of other strings - for changed := true; changed; { - changed = false - for i, s := range layout { - if s == "" { - continue - } - for j, t := range layout { - if i != j && t != "" && strings.Contains(s, t) { - changed = true - layout[j] = "" - } - } - } - } - - // Join strings where one suffix matches another prefix. - for { - // Find best i, j, k such that layout[i][len-k:] == layout[j][:k], - // maximizing overlap length k. - besti := -1 - bestj := -1 - bestk := 0 - for i, s := range layout { - if s == "" { - continue - } - for j, t := range layout { - if i == j { - continue - } - for k := bestk + 1; k <= len(s) && k <= len(t); k++ { - if s[len(s)-k:] == t[:k] { - besti = i - bestj = j - bestk = k - } - } - } - } - if bestk > 0 { - layout[besti] += layout[bestj][bestk:] - layout[bestj] = "" - continue - } - break - } - - text := strings.Join(layout, "") - - atom := map[string]uint32{} - for _, s := range all { - off := strings.Index(text, s) - if off < 0 { - panic("lost string " + s) - } - atom[s] = uint32(off<<8 | len(s)) - } - - var buf bytes.Buffer - // Generate the Go code. - fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") - fmt.Fprintln(&buf, "//go:generate go run gen.go\n") - fmt.Fprintln(&buf, "package atom\n\nconst (") - - // compute max len - maxLen := 0 - for _, s := range all { - if maxLen < len(s) { - maxLen = len(s) - } - fmt.Fprintf(&buf, "\t%s Atom = %#x\n", identifier(s), atom[s]) - } - fmt.Fprintln(&buf, ")\n") - - fmt.Fprintf(&buf, "const hash0 = %#x\n\n", best.h0) - fmt.Fprintf(&buf, "const maxAtomLen = %d\n\n", maxLen) - - fmt.Fprintf(&buf, "var table = [1<<%d]Atom{\n", best.k) - for i, s := range best.tab { - if s == "" { - continue - } - fmt.Fprintf(&buf, "\t%#x: %#x, // %s\n", i, atom[s], s) - } - fmt.Fprintf(&buf, "}\n") - datasize := (1 << best.k) * 4 - - fmt.Fprintln(&buf, "const atomText =") - textsize := len(text) - for len(text) > 60 { - fmt.Fprintf(&buf, "\t%q +\n", text[:60]) - text = text[60:] - } - fmt.Fprintf(&buf, "\t%q\n\n", text) - - genFile("table.go", &buf) - - fmt.Fprintf(os.Stdout, "%d atoms; %d string bytes + %d tables = %d total data\n", len(all), textsize, datasize, textsize+datasize) -} - -type byLen []string - -func (x byLen) Less(i, j int) bool { return len(x[i]) > len(x[j]) } -func (x byLen) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x byLen) Len() int { return len(x) } - -// fnv computes the FNV hash with an arbitrary starting value h. -func fnv(h uint32, s string) uint32 { - for i := 0; i < len(s); i++ { - h ^= uint32(s[i]) - h *= 16777619 - } - return h -} - -// A table represents an attempt at constructing the lookup table. -// The lookup table uses cuckoo hashing, meaning that each string -// can be found in one of two positions. -type table struct { - h0 uint32 - k uint - mask uint32 - tab []string -} - -// hash returns the two hashes for s. -func (t *table) hash(s string) (h1, h2 uint32) { - h := fnv(t.h0, s) - h1 = h & t.mask - h2 = (h >> 16) & t.mask - return -} - -// init initializes the table with the given parameters. -// h0 is the initial hash value, -// k is the number of bits of hash value to use, and -// x is the list of strings to store in the table. -// init returns false if the table cannot be constructed. -func (t *table) init(h0 uint32, k uint, x []string) bool { - t.h0 = h0 - t.k = k - t.tab = make([]string, 1< len(t.tab) { - return false - } - s := t.tab[i] - h1, h2 := t.hash(s) - j := h1 + h2 - i - if t.tab[j] != "" && !t.push(j, depth+1) { - return false - } - t.tab[j] = s - return true -} - -// The lists of element names and attribute keys were taken from -// https://html.spec.whatwg.org/multipage/indices.html#index -// as of the "HTML Living Standard - Last Updated 16 April 2018" version. - -// "command", "keygen" and "menuitem" have been removed from the spec, -// but are kept here for backwards compatibility. -var elements = []string{ - "a", - "abbr", - "address", - "area", - "article", - "aside", - "audio", - "b", - "base", - "bdi", - "bdo", - "blockquote", - "body", - "br", - "button", - "canvas", - "caption", - "cite", - "code", - "col", - "colgroup", - "command", - "data", - "datalist", - "dd", - "del", - "details", - "dfn", - "dialog", - "div", - "dl", - "dt", - "em", - "embed", - "fieldset", - "figcaption", - "figure", - "footer", - "form", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "head", - "header", - "hgroup", - "hr", - "html", - "i", - "iframe", - "img", - "input", - "ins", - "kbd", - "keygen", - "label", - "legend", - "li", - "link", - "main", - "map", - "mark", - "menu", - "menuitem", - "meta", - "meter", - "nav", - "noscript", - "object", - "ol", - "optgroup", - "option", - "output", - "p", - "param", - "picture", - "pre", - "progress", - "q", - "rp", - "rt", - "ruby", - "s", - "samp", - "script", - "section", - "select", - "slot", - "small", - "source", - "span", - "strong", - "style", - "sub", - "summary", - "sup", - "table", - "tbody", - "td", - "template", - "textarea", - "tfoot", - "th", - "thead", - "time", - "title", - "tr", - "track", - "u", - "ul", - "var", - "video", - "wbr", -} - -// https://html.spec.whatwg.org/multipage/indices.html#attributes-3 -// -// "challenge", "command", "contextmenu", "dropzone", "icon", "keytype", "mediagroup", -// "radiogroup", "spellcheck", "scoped", "seamless", "sortable" and "sorted" have been removed from the spec, -// but are kept here for backwards compatibility. -var attributes = []string{ - "abbr", - "accept", - "accept-charset", - "accesskey", - "action", - "allowfullscreen", - "allowpaymentrequest", - "allowusermedia", - "alt", - "as", - "async", - "autocomplete", - "autofocus", - "autoplay", - "challenge", - "charset", - "checked", - "cite", - "class", - "color", - "cols", - "colspan", - "command", - "content", - "contenteditable", - "contextmenu", - "controls", - "coords", - "crossorigin", - "data", - "datetime", - "default", - "defer", - "dir", - "dirname", - "disabled", - "download", - "draggable", - "dropzone", - "enctype", - "for", - "form", - "formaction", - "formenctype", - "formmethod", - "formnovalidate", - "formtarget", - "headers", - "height", - "hidden", - "high", - "href", - "hreflang", - "http-equiv", - "icon", - "id", - "inputmode", - "integrity", - "is", - "ismap", - "itemid", - "itemprop", - "itemref", - "itemscope", - "itemtype", - "keytype", - "kind", - "label", - "lang", - "list", - "loop", - "low", - "manifest", - "max", - "maxlength", - "media", - "mediagroup", - "method", - "min", - "minlength", - "multiple", - "muted", - "name", - "nomodule", - "nonce", - "novalidate", - "open", - "optimum", - "pattern", - "ping", - "placeholder", - "playsinline", - "poster", - "preload", - "radiogroup", - "readonly", - "referrerpolicy", - "rel", - "required", - "reversed", - "rows", - "rowspan", - "sandbox", - "spellcheck", - "scope", - "scoped", - "seamless", - "selected", - "shape", - "size", - "sizes", - "sortable", - "sorted", - "slot", - "span", - "spellcheck", - "src", - "srcdoc", - "srclang", - "srcset", - "start", - "step", - "style", - "tabindex", - "target", - "title", - "translate", - "type", - "typemustmatch", - "updateviacache", - "usemap", - "value", - "width", - "workertype", - "wrap", -} - -// "onautocomplete", "onautocompleteerror", "onmousewheel", -// "onshow" and "onsort" have been removed from the spec, -// but are kept here for backwards compatibility. -var eventHandlers = []string{ - "onabort", - "onautocomplete", - "onautocompleteerror", - "onauxclick", - "onafterprint", - "onbeforeprint", - "onbeforeunload", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncopy", - "oncuechange", - "oncut", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragexit", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "onhashchange", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onlanguagechange", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadend", - "onloadstart", - "onmessage", - "onmessageerror", - "onmousedown", - "onmouseenter", - "onmouseleave", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onwheel", - "onoffline", - "ononline", - "onpagehide", - "onpageshow", - "onpaste", - "onpause", - "onplay", - "onplaying", - "onpopstate", - "onprogress", - "onratechange", - "onreset", - "onresize", - "onrejectionhandled", - "onscroll", - "onsecuritypolicyviolation", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onsort", - "onstalled", - "onstorage", - "onsubmit", - "onsuspend", - "ontimeupdate", - "ontoggle", - "onunhandledrejection", - "onunload", - "onvolumechange", - "onwaiting", -} - -// extra are ad-hoc values not covered by any of the lists above. -var extra = []string{ - "acronym", - "align", - "annotation", - "annotation-xml", - "applet", - "basefont", - "bgsound", - "big", - "blink", - "center", - "color", - "desc", - "face", - "font", - "foreignObject", // HTML is case-insensitive, but SVG-embedded-in-HTML is case-sensitive. - "foreignobject", - "frame", - "frameset", - "image", - "isindex", - "listing", - "malignmark", - "marquee", - "math", - "mglyph", - "mi", - "mn", - "mo", - "ms", - "mtext", - "nobr", - "noembed", - "noframes", - "plaintext", - "prompt", - "public", - "rb", - "rtc", - "spacer", - "strike", - "svg", - "system", - "tt", - "xmp", -} diff --git a/vendor/golang.org/x/net/http2/.gitignore b/vendor/golang.org/x/net/http2/.gitignore new file mode 100644 index 000000000000..190f12234adf --- /dev/null +++ b/vendor/golang.org/x/net/http2/.gitignore @@ -0,0 +1,2 @@ +*~ +h2i/h2i diff --git a/vendor/golang.org/x/net/http2/Dockerfile b/vendor/golang.org/x/net/http2/Dockerfile new file mode 100644 index 000000000000..53fc52579744 --- /dev/null +++ b/vendor/golang.org/x/net/http2/Dockerfile @@ -0,0 +1,51 @@ +# +# This Dockerfile builds a recent curl with HTTP/2 client support, using +# a recent nghttp2 build. +# +# See the Makefile for how to tag it. If Docker and that image is found, the +# Go tests use this curl binary for integration tests. +# + +FROM ubuntu:trusty + +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y git-core build-essential wget + +RUN apt-get install -y --no-install-recommends \ + autotools-dev libtool pkg-config zlib1g-dev \ + libcunit1-dev libssl-dev libxml2-dev libevent-dev \ + automake autoconf + +# The list of packages nghttp2 recommends for h2load: +RUN apt-get install -y --no-install-recommends make binutils \ + autoconf automake autotools-dev \ + libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev \ + libev-dev libevent-dev libjansson-dev libjemalloc-dev \ + cython python3.4-dev python-setuptools + +# Note: setting NGHTTP2_VER before the git clone, so an old git clone isn't cached: +ENV NGHTTP2_VER 895da9a +RUN cd /root && git clone https://github.com/tatsuhiro-t/nghttp2.git + +WORKDIR /root/nghttp2 +RUN git reset --hard $NGHTTP2_VER +RUN autoreconf -i +RUN automake +RUN autoconf +RUN ./configure +RUN make +RUN make install + +WORKDIR /root +RUN wget http://curl.haxx.se/download/curl-7.45.0.tar.gz +RUN tar -zxvf curl-7.45.0.tar.gz +WORKDIR /root/curl-7.45.0 +RUN ./configure --with-ssl --with-nghttp2=/usr/local +RUN make +RUN make install +RUN ldconfig + +CMD ["-h"] +ENTRYPOINT ["/usr/local/bin/curl"] + diff --git a/vendor/golang.org/x/net/http2/README b/vendor/golang.org/x/net/http2/README new file mode 100644 index 000000000000..360d5aa37905 --- /dev/null +++ b/vendor/golang.org/x/net/http2/README @@ -0,0 +1,20 @@ +This is a work-in-progress HTTP/2 implementation for Go. + +It will eventually live in the Go standard library and won't require +any changes to your code to use. It will just be automatic. + +Status: + +* The server support is pretty good. A few things are missing + but are being worked on. +* The client work has just started but shares a lot of code + is coming along much quicker. + +Docs are at https://godoc.org/golang.org/x/net/http2 + +Demo test server at https://http2.golang.org/ + +Help & bug reports welcome! + +Contributing: https://golang.org/doc/contribute.html +Bugs: https://golang.org/issue/new?title=x/net/http2:+ diff --git a/vendor/golang.org/x/sys/unix/.gitignore b/vendor/golang.org/x/sys/unix/.gitignore new file mode 100644 index 000000000000..e3e0fc6f896a --- /dev/null +++ b/vendor/golang.org/x/sys/unix/.gitignore @@ -0,0 +1,2 @@ +_obj/ +unix.test diff --git a/vendor/golang.org/x/sys/unix/README.md b/vendor/golang.org/x/sys/unix/README.md new file mode 100644 index 000000000000..bc6f6031f1b7 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/README.md @@ -0,0 +1,173 @@ +# Building `sys/unix` + +The sys/unix package provides access to the raw system call interface of the +underlying operating system. See: https://godoc.org/golang.org/x/sys/unix + +Porting Go to a new architecture/OS combination or adding syscalls, types, or +constants to an existing architecture/OS pair requires some manual effort; +however, there are tools that automate much of the process. + +## Build Systems + +There are currently two ways we generate the necessary files. We are currently +migrating the build system to use containers so the builds are reproducible. +This is being done on an OS-by-OS basis. Please update this documentation as +components of the build system change. + +### Old Build System (currently for `GOOS != "Linux" || GOARCH == "sparc64"`) + +The old build system generates the Go files based on the C header files +present on your system. This means that files +for a given GOOS/GOARCH pair must be generated on a system with that OS and +architecture. This also means that the generated code can differ from system +to system, based on differences in the header files. + +To avoid this, if you are using the old build system, only generate the Go +files on an installation with unmodified header files. It is also important to +keep track of which version of the OS the files were generated from (ex. +Darwin 14 vs Darwin 15). This makes it easier to track the progress of changes +and have each OS upgrade correspond to a single change. + +To build the files for your current OS and architecture, make sure GOOS and +GOARCH are set correctly and run `mkall.sh`. This will generate the files for +your specific system. Running `mkall.sh -n` shows the commands that will be run. + +Requirements: bash, perl, go + +### New Build System (currently for `GOOS == "Linux" && GOARCH != "sparc64"`) + +The new build system uses a Docker container to generate the go files directly +from source checkouts of the kernel and various system libraries. This means +that on any platform that supports Docker, all the files using the new build +system can be generated at once, and generated files will not change based on +what the person running the scripts has installed on their computer. + +The OS specific files for the new build system are located in the `${GOOS}` +directory, and the build is coordinated by the `${GOOS}/mkall.go` program. When +the kernel or system library updates, modify the Dockerfile at +`${GOOS}/Dockerfile` to checkout the new release of the source. + +To build all the files under the new build system, you must be on an amd64/Linux +system and have your GOOS and GOARCH set accordingly. Running `mkall.sh` will +then generate all of the files for all of the GOOS/GOARCH pairs in the new build +system. Running `mkall.sh -n` shows the commands that will be run. + +Requirements: bash, perl, go, docker + +## Component files + +This section describes the various files used in the code generation process. +It also contains instructions on how to modify these files to add a new +architecture/OS or to add additional syscalls, types, or constants. Note that +if you are using the new build system, the scripts cannot be called normally. +They must be called from within the docker container. + +### asm files + +The hand-written assembly file at `asm_${GOOS}_${GOARCH}.s` implements system +call dispatch. There are three entry points: +``` + func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) + func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) + func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) +``` +The first and second are the standard ones; they differ only in how many +arguments can be passed to the kernel. The third is for low-level use by the +ForkExec wrapper. Unlike the first two, it does not call into the scheduler to +let it know that a system call is running. + +When porting Go to an new architecture/OS, this file must be implemented for +each GOOS/GOARCH pair. + +### mksysnum + +Mksysnum is a script located at `${GOOS}/mksysnum.pl` (or `mksysnum_${GOOS}.pl` +for the old system). This script takes in a list of header files containing the +syscall number declarations and parses them to produce the corresponding list of +Go numeric constants. See `zsysnum_${GOOS}_${GOARCH}.go` for the generated +constants. + +Adding new syscall numbers is mostly done by running the build on a sufficiently +new installation of the target OS (or updating the source checkouts for the +new build system). However, depending on the OS, you make need to update the +parsing in mksysnum. + +### mksyscall.pl + +The `syscall.go`, `syscall_${GOOS}.go`, `syscall_${GOOS}_${GOARCH}.go` are +hand-written Go files which implement system calls (for unix, the specific OS, +or the specific OS/Architecture pair respectively) that need special handling +and list `//sys` comments giving prototypes for ones that can be generated. + +The mksyscall.pl script takes the `//sys` and `//sysnb` comments and converts +them into syscalls. This requires the name of the prototype in the comment to +match a syscall number in the `zsysnum_${GOOS}_${GOARCH}.go` file. The function +prototype can be exported (capitalized) or not. + +Adding a new syscall often just requires adding a new `//sys` function prototype +with the desired arguments and a capitalized name so it is exported. However, if +you want the interface to the syscall to be different, often one will make an +unexported `//sys` prototype, an then write a custom wrapper in +`syscall_${GOOS}.go`. + +### types files + +For each OS, there is a hand-written Go file at `${GOOS}/types.go` (or +`types_${GOOS}.go` on the old system). This file includes standard C headers and +creates Go type aliases to the corresponding C types. The file is then fed +through godef to get the Go compatible definitions. Finally, the generated code +is fed though mkpost.go to format the code correctly and remove any hidden or +private identifiers. This cleaned-up code is written to +`ztypes_${GOOS}_${GOARCH}.go`. + +The hardest part about preparing this file is figuring out which headers to +include and which symbols need to be `#define`d to get the actual data +structures that pass through to the kernel system calls. Some C libraries +preset alternate versions for binary compatibility and translate them on the +way in and out of system calls, but there is almost always a `#define` that can +get the real ones. +See `types_darwin.go` and `linux/types.go` for examples. + +To add a new type, add in the necessary include statement at the top of the +file (if it is not already there) and add in a type alias line. Note that if +your type is significantly different on different architectures, you may need +some `#if/#elif` macros in your include statements. + +### mkerrors.sh + +This script is used to generate the system's various constants. This doesn't +just include the error numbers and error strings, but also the signal numbers +an a wide variety of miscellaneous constants. The constants come from the list +of include files in the `includes_${uname}` variable. A regex then picks out +the desired `#define` statements, and generates the corresponding Go constants. +The error numbers and strings are generated from `#include `, and the +signal numbers and strings are generated from `#include `. All of +these constants are written to `zerrors_${GOOS}_${GOARCH}.go` via a C program, +`_errors.c`, which prints out all the constants. + +To add a constant, add the header that includes it to the appropriate variable. +Then, edit the regex (if necessary) to match the desired constant. Avoid making +the regex too broad to avoid matching unintended constants. + + +## Generated files + +### `zerror_${GOOS}_${GOARCH}.go` + +A file containing all of the system's generated error numbers, error strings, +signal numbers, and constants. Generated by `mkerrors.sh` (see above). + +### `zsyscall_${GOOS}_${GOARCH}.go` + +A file containing all the generated syscalls for a specific GOOS and GOARCH. +Generated by `mksyscall.pl` (see above). + +### `zsysnum_${GOOS}_${GOARCH}.go` + +A list of numeric constants for all the syscall number of the specific GOOS +and GOARCH. Generated by mksysnum (see above). + +### `ztypes_${GOOS}_${GOARCH}.go` + +A file containing Go types for passing into (or returning from) syscalls. +Generated by godefs and the types file (see above). diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh new file mode 100644 index 000000000000..1715122bd4b1 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/mkall.sh @@ -0,0 +1,188 @@ +#!/usr/bin/env bash +# Copyright 2009 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# This script runs or (given -n) prints suggested commands to generate files for +# the Architecture/OS specified by the GOARCH and GOOS environment variables. +# See README.md for more information about how the build system works. + +GOOSARCH="${GOOS}_${GOARCH}" + +# defaults +mksyscall="./mksyscall.pl" +mkerrors="./mkerrors.sh" +zerrors="zerrors_$GOOSARCH.go" +mksysctl="" +zsysctl="zsysctl_$GOOSARCH.go" +mksysnum= +mktypes= +run="sh" +cmd="" + +case "$1" in +-syscalls) + for i in zsyscall*go + do + # Run the command line that appears in the first line + # of the generated file to regenerate it. + sed 1q $i | sed 's;^// ;;' | sh > _$i && gofmt < _$i > $i + rm _$i + done + exit 0 + ;; +-n) + run="cat" + cmd="echo" + shift +esac + +case "$#" in +0) + ;; +*) + echo 'usage: mkall.sh [-n]' 1>&2 + exit 2 +esac + +if [[ "$GOOS" = "linux" ]] && [[ "$GOARCH" != "sparc64" ]]; then + # Use then new build system + # Files generated through docker (use $cmd so you can Ctl-C the build or run) + $cmd docker build --tag generate:$GOOS $GOOS + $cmd docker run --interactive --tty --volume $(dirname "$(readlink -f "$0")"):/build generate:$GOOS + exit +fi + +GOOSARCH_in=syscall_$GOOSARCH.go +case "$GOOSARCH" in +_* | *_ | _) + echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2 + exit 1 + ;; +darwin_386) + mkerrors="$mkerrors -m32" + mksyscall="./mksyscall.pl -l32" + mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +darwin_amd64) + mkerrors="$mkerrors -m64" + mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +darwin_arm) + mkerrors="$mkerrors" + mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +darwin_arm64) + mkerrors="$mkerrors -m64" + mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +dragonfly_amd64) + mkerrors="$mkerrors -m64" + mksyscall="./mksyscall.pl -dragonfly" + mksysnum="curl -s 'http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master' | ./mksysnum_dragonfly.pl" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +freebsd_386) + mkerrors="$mkerrors -m32" + mksyscall="./mksyscall.pl -l32" + mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +freebsd_amd64) + mkerrors="$mkerrors -m64" + mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +freebsd_arm) + mkerrors="$mkerrors" + mksyscall="./mksyscall.pl -l32 -arm" + mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl" + # Let the type of C char be signed for making the bare syscall + # API consistent across platforms. + mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" + ;; +linux_sparc64) + GOOSARCH_in=syscall_linux_sparc64.go + unistd_h=/usr/include/sparc64-linux-gnu/asm/unistd.h + mkerrors="$mkerrors -m64" + mksysnum="./mksysnum_linux.pl $unistd_h" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +netbsd_386) + mkerrors="$mkerrors -m32" + mksyscall="./mksyscall.pl -l32 -netbsd" + mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +netbsd_amd64) + mkerrors="$mkerrors -m64" + mksyscall="./mksyscall.pl -netbsd" + mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +netbsd_arm) + mkerrors="$mkerrors" + mksyscall="./mksyscall.pl -l32 -netbsd -arm" + mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl" + # Let the type of C char be signed for making the bare syscall + # API consistent across platforms. + mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" + ;; +openbsd_386) + mkerrors="$mkerrors -m32" + mksyscall="./mksyscall.pl -l32 -openbsd" + mksysctl="./mksysctl_openbsd.pl" + mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +openbsd_amd64) + mkerrors="$mkerrors -m64" + mksyscall="./mksyscall.pl -openbsd" + mksysctl="./mksysctl_openbsd.pl" + mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +openbsd_arm) + mkerrors="$mkerrors" + mksyscall="./mksyscall.pl -l32 -openbsd -arm" + mksysctl="./mksysctl_openbsd.pl" + mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl" + # Let the type of C char be signed for making the bare syscall + # API consistent across platforms. + mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" + ;; +solaris_amd64) + mksyscall="./mksyscall_solaris.pl" + mkerrors="$mkerrors -m64" + mksysnum= + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +*) + echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2 + exit 1 + ;; +esac + +( + if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >$zerrors"; fi + case "$GOOS" in + *) + syscall_goos="syscall_$GOOS.go" + case "$GOOS" in + darwin | dragonfly | freebsd | netbsd | openbsd) + syscall_goos="syscall_bsd.go $syscall_goos" + ;; + esac + if [ -n "$mksyscall" ]; then echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go"; fi + ;; + esac + if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi + if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi + if [ -n "$mktypes" ]; then + echo "$mktypes types_$GOOS.go | go run mkpost.go > ztypes_$GOOSARCH.go"; + fi +) | $run diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh new file mode 100644 index 000000000000..3b5e2c07b393 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -0,0 +1,581 @@ +#!/usr/bin/env bash +# Copyright 2009 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# Generate Go code listing errors and other #defined constant +# values (ENAMETOOLONG etc.), by asking the preprocessor +# about the definitions. + +unset LANG +export LC_ALL=C +export LC_CTYPE=C + +if test -z "$GOARCH" -o -z "$GOOS"; then + echo 1>&2 "GOARCH or GOOS not defined in environment" + exit 1 +fi + +# Check that we are using the new build system if we should +if [[ "$GOOS" = "linux" ]] && [[ "$GOARCH" != "sparc64" ]]; then + if [[ "$GOLANG_SYS_BUILD" != "docker" ]]; then + echo 1>&2 "In the new build system, mkerrors should not be called directly." + echo 1>&2 "See README.md" + exit 1 + fi +fi + +CC=${CC:-cc} + +if [[ "$GOOS" = "solaris" ]]; then + # Assumes GNU versions of utilities in PATH. + export PATH=/usr/gnu/bin:$PATH +fi + +uname=$(uname) + +includes_Darwin=' +#define _DARWIN_C_SOURCE +#define KERNEL +#define _DARWIN_USE_64_BIT_INODE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +' + +includes_DragonFly=' +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +' + +includes_FreeBSD=' +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if __FreeBSD__ >= 10 +#define IFT_CARP 0xf8 // IFT_CARP is deprecated in FreeBSD 10 +#undef SIOCAIFADDR +#define SIOCAIFADDR _IOW(105, 26, struct oifaliasreq) // ifaliasreq contains if_data +#undef SIOCSIFPHYADDR +#define SIOCSIFPHYADDR _IOW(105, 70, struct oifaliasreq) // ifaliasreq contains if_data +#endif +' + +includes_Linux=' +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE +#ifndef __LP64__ +#define _FILE_OFFSET_BITS 64 +#endif +#define _GNU_SOURCE + +// is broken on powerpc64, as it fails to include definitions of +// these structures. We just include them copied from . +#if defined(__powerpc__) +struct sgttyb { + char sg_ispeed; + char sg_ospeed; + char sg_erase; + char sg_kill; + short sg_flags; +}; + +struct tchars { + char t_intrc; + char t_quitc; + char t_startc; + char t_stopc; + char t_eofc; + char t_brkc; +}; + +struct ltchars { + char t_suspc; + char t_dsuspc; + char t_rprntc; + char t_flushc; + char t_werasc; + char t_lnextc; +}; +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef MSG_FASTOPEN +#define MSG_FASTOPEN 0x20000000 +#endif + +#ifndef PTRACE_GETREGS +#define PTRACE_GETREGS 0xc +#endif + +#ifndef PTRACE_SETREGS +#define PTRACE_SETREGS 0xd +#endif + +#ifndef SOL_NETLINK +#define SOL_NETLINK 270 +#endif + +#ifdef SOL_BLUETOOTH +// SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h +// but it is already in bluetooth_linux.go +#undef SOL_BLUETOOTH +#endif + +// Certain constants are missing from the fs/crypto UAPI +#define FS_KEY_DESC_PREFIX "fscrypt:" +#define FS_KEY_DESC_PREFIX_SIZE 8 +#define FS_MAX_KEY_SIZE 64 +' + +includes_NetBSD=' +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Needed since refers to it... +#define schedppq 1 +' + +includes_OpenBSD=' +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// We keep some constants not supported in OpenBSD 5.5 and beyond for +// the promise of compatibility. +#define EMUL_ENABLED 0x1 +#define EMUL_NATIVE 0x2 +#define IPV6_FAITH 0x1d +#define IPV6_OPTIONS 0x1 +#define IPV6_RTHDR_STRICT 0x1 +#define IPV6_SOCKOPT_RESERVED1 0x3 +#define SIOCGIFGENERIC 0xc020693a +#define SIOCSIFGENERIC 0x80206939 +#define WALTSIG 0x4 +' + +includes_SunOS=' +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +' + + +includes=' +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +' +ccflags="$@" + +# Write go tool cgo -godefs input. +( + echo package unix + echo + echo '/*' + indirect="includes_$(uname)" + echo "${!indirect} $includes" + echo '*/' + echo 'import "C"' + echo 'import "syscall"' + echo + echo 'const (' + + # The gcc command line prints all the #defines + # it encounters while processing the input + echo "${!indirect} $includes" | $CC -x c - -E -dM $ccflags | + awk ' + $1 != "#define" || $2 ~ /\(/ || $3 == "" {next} + + $2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers + $2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next} + $2 ~ /^(SCM_SRCRT)$/ {next} + $2 ~ /^(MAP_FAILED)$/ {next} + $2 ~ /^ELF_.*$/ {next}# contains ELF_ARCH, etc. + + $2 ~ /^EXTATTR_NAMESPACE_NAMES/ || + $2 ~ /^EXTATTR_NAMESPACE_[A-Z]+_STRING/ {next} + + $2 !~ /^ETH_/ && + $2 !~ /^EPROC_/ && + $2 !~ /^EQUIV_/ && + $2 !~ /^EXPR_/ && + $2 ~ /^E[A-Z0-9_]+$/ || + $2 ~ /^B[0-9_]+$/ || + $2 ~ /^(OLD|NEW)DEV$/ || + $2 == "BOTHER" || + $2 ~ /^CI?BAUD(EX)?$/ || + $2 == "IBSHIFT" || + $2 ~ /^V[A-Z0-9]+$/ || + $2 ~ /^CS[A-Z0-9]/ || + $2 ~ /^I(SIG|CANON|CRNL|UCLC|EXTEN|MAXBEL|STRIP|UTF8)$/ || + $2 ~ /^IGN/ || + $2 ~ /^IX(ON|ANY|OFF)$/ || + $2 ~ /^IN(LCR|PCK)$/ || + $2 !~ "X86_CR3_PCID_NOFLUSH" && + $2 ~ /(^FLU?SH)|(FLU?SH$)/ || + $2 ~ /^C(LOCAL|READ|MSPAR|RTSCTS)$/ || + $2 == "BRKINT" || + $2 == "HUPCL" || + $2 == "PENDIN" || + $2 == "TOSTOP" || + $2 == "XCASE" || + $2 == "ALTWERASE" || + $2 == "NOKERNINFO" || + $2 ~ /^PAR/ || + $2 ~ /^SIG[^_]/ || + $2 ~ /^O[CNPFPL][A-Z]+[^_][A-Z]+$/ || + $2 ~ /^(NL|CR|TAB|BS|VT|FF)DLY$/ || + $2 ~ /^(NL|CR|TAB|BS|VT|FF)[0-9]$/ || + $2 ~ /^O?XTABS$/ || + $2 ~ /^TC[IO](ON|OFF)$/ || + $2 ~ /^IN_/ || + $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || + $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ || + $2 ~ /^FALLOC_/ || + $2 == "ICMPV6_FILTER" || + $2 == "SOMAXCONN" || + $2 == "NAME_MAX" || + $2 == "IFNAMSIZ" || + $2 ~ /^CTL_(HW|KERN|MAXNAME|NET|QUERY)$/ || + $2 ~ /^KERN_(HOSTNAME|OS(RELEASE|TYPE)|VERSION)$/ || + $2 ~ /^HW_MACHINE$/ || + $2 ~ /^SYSCTL_VERS/ || + $2 ~ /^(MS|MNT|UMOUNT)_/ || + $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || + $2 ~ /^(O|F|E?FD|NAME|S|PTRACE|PT)_/ || + $2 ~ /^LINUX_REBOOT_CMD_/ || + $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ || + $2 !~ "NLA_TYPE_MASK" && + $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P)_/ || + $2 ~ /^SIOC/ || + $2 ~ /^TIOC/ || + $2 ~ /^TCGET/ || + $2 ~ /^TCSET/ || + $2 ~ /^TC(FLSH|SBRKP?|XONC)$/ || + $2 !~ "RTF_BITS" && + $2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ || + $2 ~ /^BIOC/ || + $2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ || + $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ || + $2 ~ /^PRIO_(PROCESS|PGRP|USER)/ || + $2 ~ /^CLONE_[A-Z_]+/ || + $2 !~ /^(BPF_TIMEVAL)$/ && + $2 ~ /^(BPF|DLT)_/ || + $2 ~ /^CLOCK_/ || + $2 ~ /^CAN_/ || + $2 ~ /^CAP_/ || + $2 ~ /^ALG_/ || + $2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE|IOC_(GET|SET)_ENCRYPTION)/ || + $2 ~ /^GRND_/ || + $2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ || + $2 ~ /^KEYCTL_/ || + $2 ~ /^PERF_EVENT_IOC_/ || + $2 ~ /^SECCOMP_MODE_/ || + $2 ~ /^SPLICE_/ || + $2 ~ /^(VM|VMADDR)_/ || + $2 ~ /^IOCTL_VM_SOCKETS_/ || + $2 ~ /^(TASKSTATS|TS)_/ || + $2 ~ /^CGROUPSTATS_/ || + $2 ~ /^GENL_/ || + $2 ~ /^STATX_/ || + $2 ~ /^UTIME_/ || + $2 ~ /^XATTR_(CREATE|REPLACE)/ || + $2 ~ /^ATTR_(BIT_MAP_COUNT|(CMN|VOL|FILE)_)/ || + $2 ~ /^FSOPT_/ || + $2 ~ /^WDIOC_/ || + $2 !~ "WMESGLEN" && + $2 ~ /^W[A-Z0-9]+$/ || + $2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)} + $2 ~ /^__WCOREFLAG$/ {next} + $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)} + + {next} + ' | sort + + echo ')' +) >_const.go + +# Pull out the error names for later. +errors=$( + echo '#include ' | $CC -x c - -E -dM $ccflags | + awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' | + sort +) + +# Pull out the signal names for later. +signals=$( + echo '#include ' | $CC -x c - -E -dM $ccflags | + awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' | + egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' | + sort +) + +# Again, writing regexps to a file. +echo '#include ' | $CC -x c - -E -dM $ccflags | + awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print "^\t" $2 "[ \t]*=" }' | + sort >_error.grep +echo '#include ' | $CC -x c - -E -dM $ccflags | + awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' | + egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' | + sort >_signal.grep + +echo '// mkerrors.sh' "$@" +echo '// Code generated by the command above; see README.md. DO NOT EDIT.' +echo +echo "// +build ${GOARCH},${GOOS}" +echo +go tool cgo -godefs -- "$@" _const.go >_error.out +cat _error.out | grep -vf _error.grep | grep -vf _signal.grep +echo +echo '// Errors' +echo 'const (' +cat _error.out | grep -f _error.grep | sed 's/=\(.*\)/= syscall.Errno(\1)/' +echo ')' + +echo +echo '// Signals' +echo 'const (' +cat _error.out | grep -f _signal.grep | sed 's/=\(.*\)/= syscall.Signal(\1)/' +echo ')' + +# Run C program to print error and syscall strings. +( + echo -E " +#include +#include +#include +#include +#include +#include + +#define nelem(x) (sizeof(x)/sizeof((x)[0])) + +enum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below + +int errors[] = { +" + for i in $errors + do + echo -E ' '$i, + done + + echo -E " +}; + +int signals[] = { +" + for i in $signals + do + echo -E ' '$i, + done + + # Use -E because on some systems bash builtin interprets \n itself. + echo -E ' +}; + +static int +intcmp(const void *a, const void *b) +{ + return *(int*)a - *(int*)b; +} + +int +main(void) +{ + int i, e; + char buf[1024], *p; + + printf("\n\n// Error table\n"); + printf("var errors = [...]string {\n"); + qsort(errors, nelem(errors), sizeof errors[0], intcmp); + for(i=0; i 0 && errors[i-1] == e) + continue; + strcpy(buf, strerror(e)); + // lowercase first letter: Bad -> bad, but STREAM -> STREAM. + if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) + buf[0] += a - A; + printf("\t%d: \"%s\",\n", e, buf); + } + printf("}\n\n"); + + printf("\n\n// Signal table\n"); + printf("var signals = [...]string {\n"); + qsort(signals, nelem(signals), sizeof signals[0], intcmp); + for(i=0; i 0 && signals[i-1] == e) + continue; + strcpy(buf, strsignal(e)); + // lowercase first letter: Bad -> bad, but STREAM -> STREAM. + if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) + buf[0] += a - A; + // cut trailing : number. + p = strrchr(buf, ":"[0]); + if(p) + *p = '\0'; + printf("\t%d: \"%s\",\n", e, buf); + } + printf("}\n\n"); + + return 0; +} + +' +) >_errors.c + +$CC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _signal.grep _error.out diff --git a/vendor/golang.org/x/sys/unix/mkpost.go b/vendor/golang.org/x/sys/unix/mkpost.go deleted file mode 100644 index 23590bda366c..000000000000 --- a/vendor/golang.org/x/sys/unix/mkpost.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// mkpost processes the output of cgo -godefs to -// modify the generated types. It is used to clean up -// the sys API in an architecture specific manner. -// -// mkpost is run after cgo -godefs; see README.md. -package main - -import ( - "bytes" - "fmt" - "go/format" - "io/ioutil" - "log" - "os" - "regexp" -) - -func main() { - // Get the OS and architecture (using GOARCH_TARGET if it exists) - goos := os.Getenv("GOOS") - goarch := os.Getenv("GOARCH_TARGET") - if goarch == "" { - goarch = os.Getenv("GOARCH") - } - // Check that we are using the new build system if we should be. - if goos == "linux" && goarch != "sparc64" { - if os.Getenv("GOLANG_SYS_BUILD") != "docker" { - os.Stderr.WriteString("In the new build system, mkpost should not be called directly.\n") - os.Stderr.WriteString("See README.md\n") - os.Exit(1) - } - } - - b, err := ioutil.ReadAll(os.Stdin) - if err != nil { - log.Fatal(err) - } - - // If we have empty Ptrace structs, we should delete them. Only s390x emits - // nonempty Ptrace structs. - ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`) - b = ptraceRexexp.ReplaceAll(b, nil) - - // Replace the control_regs union with a blank identifier for now. - controlRegsRegex := regexp.MustCompile(`(Control_regs)\s+\[0\]uint64`) - b = controlRegsRegex.ReplaceAll(b, []byte("_ [0]uint64")) - - // Remove fields that are added by glibc - // Note that this is unstable as the identifers are private. - removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`) - b = removeFieldsRegex.ReplaceAll(b, []byte("_")) - - // Convert [65]int8 to [65]byte in Utsname members to simplify - // conversion to string; see golang.org/issue/20753 - convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`) - b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte")) - - // Remove spare fields (e.g. in Statx_t) - spareFieldsRegex := regexp.MustCompile(`X__spare\S*`) - b = spareFieldsRegex.ReplaceAll(b, []byte("_")) - - // Remove cgo padding fields - removePaddingFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`) - b = removePaddingFieldsRegex.ReplaceAll(b, []byte("_")) - - // We refuse to export private fields on s390x - if goarch == "s390x" && goos == "linux" { - // Remove padding, hidden, or unused fields - removeFieldsRegex = regexp.MustCompile(`\bX_\S+`) - b = removeFieldsRegex.ReplaceAll(b, []byte("_")) - } - - // Remove the first line of warning from cgo - b = b[bytes.IndexByte(b, '\n')+1:] - // Modify the command in the header to include: - // mkpost, our own warning, and a build tag. - replacement := fmt.Sprintf(`$1 | go run mkpost.go -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s,%s`, goarch, goos) - cgoCommandRegex := regexp.MustCompile(`(cgo -godefs .*)`) - b = cgoCommandRegex.ReplaceAll(b, []byte(replacement)) - - // gofmt - b, err = format.Source(b) - if err != nil { - log.Fatal(err) - } - - os.Stdout.Write(b) -} diff --git a/vendor/golang.org/x/sys/unix/mksyscall.pl b/vendor/golang.org/x/sys/unix/mksyscall.pl new file mode 100644 index 000000000000..1f6b926f8c64 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/mksyscall.pl @@ -0,0 +1,341 @@ +#!/usr/bin/env perl +# Copyright 2009 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# This program reads a file containing function prototypes +# (like syscall_darwin.go) and generates system call bodies. +# The prototypes are marked by lines beginning with "//sys" +# and read like func declarations if //sys is replaced by func, but: +# * The parameter lists must give a name for each argument. +# This includes return parameters. +# * The parameter lists must give a type for each argument: +# the (x, y, z int) shorthand is not allowed. +# * If the return parameter is an error number, it must be named errno. + +# A line beginning with //sysnb is like //sys, except that the +# goroutine will not be suspended during the execution of the system +# call. This must only be used for system calls which can never +# block, as otherwise the system call could cause all goroutines to +# hang. + +use strict; + +my $cmdline = "mksyscall.pl " . join(' ', @ARGV); +my $errors = 0; +my $_32bit = ""; +my $plan9 = 0; +my $openbsd = 0; +my $netbsd = 0; +my $dragonfly = 0; +my $arm = 0; # 64-bit value should use (even, odd)-pair +my $tags = ""; # build tags + +if($ARGV[0] eq "-b32") { + $_32bit = "big-endian"; + shift; +} elsif($ARGV[0] eq "-l32") { + $_32bit = "little-endian"; + shift; +} +if($ARGV[0] eq "-plan9") { + $plan9 = 1; + shift; +} +if($ARGV[0] eq "-openbsd") { + $openbsd = 1; + shift; +} +if($ARGV[0] eq "-netbsd") { + $netbsd = 1; + shift; +} +if($ARGV[0] eq "-dragonfly") { + $dragonfly = 1; + shift; +} +if($ARGV[0] eq "-arm") { + $arm = 1; + shift; +} +if($ARGV[0] eq "-tags") { + shift; + $tags = $ARGV[0]; + shift; +} + +if($ARGV[0] =~ /^-/) { + print STDERR "usage: mksyscall.pl [-b32 | -l32] [-tags x,y] [file ...]\n"; + exit 1; +} + +# Check that we are using the new build system if we should +if($ENV{'GOOS'} eq "linux" && $ENV{'GOARCH'} ne "sparc64") { + if($ENV{'GOLANG_SYS_BUILD'} ne "docker") { + print STDERR "In the new build system, mksyscall should not be called directly.\n"; + print STDERR "See README.md\n"; + exit 1; + } +} + + +sub parseparamlist($) { + my ($list) = @_; + $list =~ s/^\s*//; + $list =~ s/\s*$//; + if($list eq "") { + return (); + } + return split(/\s*,\s*/, $list); +} + +sub parseparam($) { + my ($p) = @_; + if($p !~ /^(\S*) (\S*)$/) { + print STDERR "$ARGV:$.: malformed parameter: $p\n"; + $errors = 1; + return ("xx", "int"); + } + return ($1, $2); +} + +my $text = ""; +while(<>) { + chomp; + s/\s+/ /g; + s/^\s+//; + s/\s+$//; + my $nonblock = /^\/\/sysnb /; + next if !/^\/\/sys / && !$nonblock; + + # Line must be of the form + # func Open(path string, mode int, perm int) (fd int, errno error) + # Split into name, in params, out params. + if(!/^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*((?i)SYS_[A-Z0-9_]+))?$/) { + print STDERR "$ARGV:$.: malformed //sys declaration\n"; + $errors = 1; + next; + } + my ($func, $in, $out, $sysname) = ($2, $3, $4, $5); + + # Split argument lists on comma. + my @in = parseparamlist($in); + my @out = parseparamlist($out); + + # Try in vain to keep people from editing this file. + # The theory is that they jump into the middle of the file + # without reading the header. + $text .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"; + + # Go function header. + my $out_decl = @out ? sprintf(" (%s)", join(', ', @out)) : ""; + $text .= sprintf "func %s(%s)%s {\n", $func, join(', ', @in), $out_decl; + + # Check if err return available + my $errvar = ""; + foreach my $p (@out) { + my ($name, $type) = parseparam($p); + if($type eq "error") { + $errvar = $name; + last; + } + } + + # Prepare arguments to Syscall. + my @args = (); + my $n = 0; + foreach my $p (@in) { + my ($name, $type) = parseparam($p); + if($type =~ /^\*/) { + push @args, "uintptr(unsafe.Pointer($name))"; + } elsif($type eq "string" && $errvar ne "") { + $text .= "\tvar _p$n *byte\n"; + $text .= "\t_p$n, $errvar = BytePtrFromString($name)\n"; + $text .= "\tif $errvar != nil {\n\t\treturn\n\t}\n"; + push @args, "uintptr(unsafe.Pointer(_p$n))"; + $n++; + } elsif($type eq "string") { + print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n"; + $text .= "\tvar _p$n *byte\n"; + $text .= "\t_p$n, _ = BytePtrFromString($name)\n"; + push @args, "uintptr(unsafe.Pointer(_p$n))"; + $n++; + } elsif($type =~ /^\[\](.*)/) { + # Convert slice into pointer, length. + # Have to be careful not to take address of &a[0] if len == 0: + # pass dummy pointer in that case. + # Used to pass nil, but some OSes or simulators reject write(fd, nil, 0). + $text .= "\tvar _p$n unsafe.Pointer\n"; + $text .= "\tif len($name) > 0 {\n\t\t_p$n = unsafe.Pointer(\&${name}[0])\n\t}"; + $text .= " else {\n\t\t_p$n = unsafe.Pointer(&_zero)\n\t}"; + $text .= "\n"; + push @args, "uintptr(_p$n)", "uintptr(len($name))"; + $n++; + } elsif($type eq "int64" && ($openbsd || $netbsd)) { + push @args, "0"; + if($_32bit eq "big-endian") { + push @args, "uintptr($name>>32)", "uintptr($name)"; + } elsif($_32bit eq "little-endian") { + push @args, "uintptr($name)", "uintptr($name>>32)"; + } else { + push @args, "uintptr($name)"; + } + } elsif($type eq "int64" && $dragonfly) { + if ($func !~ /^extp(read|write)/i) { + push @args, "0"; + } + if($_32bit eq "big-endian") { + push @args, "uintptr($name>>32)", "uintptr($name)"; + } elsif($_32bit eq "little-endian") { + push @args, "uintptr($name)", "uintptr($name>>32)"; + } else { + push @args, "uintptr($name)"; + } + } elsif($type eq "int64" && $_32bit ne "") { + if(@args % 2 && $arm) { + # arm abi specifies 64-bit argument uses + # (even, odd) pair + push @args, "0" + } + if($_32bit eq "big-endian") { + push @args, "uintptr($name>>32)", "uintptr($name)"; + } else { + push @args, "uintptr($name)", "uintptr($name>>32)"; + } + } else { + push @args, "uintptr($name)"; + } + } + + # Determine which form to use; pad args with zeros. + my $asm = "Syscall"; + if ($nonblock) { + if ($errvar eq "" && $ENV{'GOOS'} eq "linux") { + $asm = "RawSyscallNoError"; + } else { + $asm = "RawSyscall"; + } + } else { + if ($errvar eq "" && $ENV{'GOOS'} eq "linux") { + $asm = "SyscallNoError"; + } + } + if(@args <= 3) { + while(@args < 3) { + push @args, "0"; + } + } elsif(@args <= 6) { + $asm .= "6"; + while(@args < 6) { + push @args, "0"; + } + } elsif(@args <= 9) { + $asm .= "9"; + while(@args < 9) { + push @args, "0"; + } + } else { + print STDERR "$ARGV:$.: too many arguments to system call\n"; + } + + # System call number. + if($sysname eq "") { + $sysname = "SYS_$func"; + $sysname =~ s/([a-z])([A-Z])/${1}_$2/g; # turn FooBar into Foo_Bar + $sysname =~ y/a-z/A-Z/; + } + + # Actual call. + my $args = join(', ', @args); + my $call = "$asm($sysname, $args)"; + + # Assign return values. + my $body = ""; + my @ret = ("_", "_", "_"); + my $do_errno = 0; + for(my $i=0; $i<@out; $i++) { + my $p = $out[$i]; + my ($name, $type) = parseparam($p); + my $reg = ""; + if($name eq "err" && !$plan9) { + $reg = "e1"; + $ret[2] = $reg; + $do_errno = 1; + } elsif($name eq "err" && $plan9) { + $ret[0] = "r0"; + $ret[2] = "e1"; + next; + } else { + $reg = sprintf("r%d", $i); + $ret[$i] = $reg; + } + if($type eq "bool") { + $reg = "$reg != 0"; + } + if($type eq "int64" && $_32bit ne "") { + # 64-bit number in r1:r0 or r0:r1. + if($i+2 > @out) { + print STDERR "$ARGV:$.: not enough registers for int64 return\n"; + } + if($_32bit eq "big-endian") { + $reg = sprintf("int64(r%d)<<32 | int64(r%d)", $i, $i+1); + } else { + $reg = sprintf("int64(r%d)<<32 | int64(r%d)", $i+1, $i); + } + $ret[$i] = sprintf("r%d", $i); + $ret[$i+1] = sprintf("r%d", $i+1); + } + if($reg ne "e1" || $plan9) { + $body .= "\t$name = $type($reg)\n"; + } + } + if ($ret[0] eq "_" && $ret[1] eq "_" && $ret[2] eq "_") { + $text .= "\t$call\n"; + } else { + if ($errvar eq "" && $ENV{'GOOS'} eq "linux") { + # raw syscall without error on Linux, see golang.org/issue/22924 + $text .= "\t$ret[0], $ret[1] := $call\n"; + } else { + $text .= "\t$ret[0], $ret[1], $ret[2] := $call\n"; + } + } + $text .= $body; + + if ($plan9 && $ret[2] eq "e1") { + $text .= "\tif int32(r0) == -1 {\n"; + $text .= "\t\terr = e1\n"; + $text .= "\t}\n"; + } elsif ($do_errno) { + $text .= "\tif e1 != 0 {\n"; + $text .= "\t\terr = errnoErr(e1)\n"; + $text .= "\t}\n"; + } + $text .= "\treturn\n"; + $text .= "}\n\n"; +} + +chomp $text; +chomp $text; + +if($errors) { + exit 1; +} + +print <) { + chomp; + s/\s+/ /g; + s/^\s+//; + s/\s+$//; + $package = $1 if !$package && /^package (\S+)$/; + my $nonblock = /^\/\/sysnb /; + next if !/^\/\/sys / && !$nonblock; + + # Line must be of the form + # func Open(path string, mode int, perm int) (fd int, err error) + # Split into name, in params, out params. + if(!/^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$/) { + print STDERR "$ARGV:$.: malformed //sys declaration\n"; + $errors = 1; + next; + } + my ($nb, $func, $in, $out, $modname, $sysname) = ($1, $2, $3, $4, $5, $6); + + # Split argument lists on comma. + my @in = parseparamlist($in); + my @out = parseparamlist($out); + + # So file name. + if($modname eq "") { + $modname = "libc"; + } + + # System call name. + if($sysname eq "") { + $sysname = "$func"; + } + + # System call pointer variable name. + my $sysvarname = "proc$sysname"; + + my $strconvfunc = "BytePtrFromString"; + my $strconvtype = "*byte"; + + $sysname =~ y/A-Z/a-z/; # All libc functions are lowercase. + + # Runtime import of function to allow cross-platform builds. + $dynimports .= "//go:cgo_import_dynamic libc_${sysname} ${sysname} \"$modname.so\"\n"; + # Link symbol to proc address variable. + $linknames .= "//go:linkname ${sysvarname} libc_${sysname}\n"; + # Library proc address variable. + push @vars, $sysvarname; + + # Go function header. + $out = join(', ', @out); + if($out ne "") { + $out = " ($out)"; + } + if($text ne "") { + $text .= "\n" + } + $text .= sprintf "func %s(%s)%s {\n", $func, join(', ', @in), $out; + + # Check if err return available + my $errvar = ""; + foreach my $p (@out) { + my ($name, $type) = parseparam($p); + if($type eq "error") { + $errvar = $name; + last; + } + } + + # Prepare arguments to Syscall. + my @args = (); + my $n = 0; + foreach my $p (@in) { + my ($name, $type) = parseparam($p); + if($type =~ /^\*/) { + push @args, "uintptr(unsafe.Pointer($name))"; + } elsif($type eq "string" && $errvar ne "") { + $text .= "\tvar _p$n $strconvtype\n"; + $text .= "\t_p$n, $errvar = $strconvfunc($name)\n"; + $text .= "\tif $errvar != nil {\n\t\treturn\n\t}\n"; + push @args, "uintptr(unsafe.Pointer(_p$n))"; + $n++; + } elsif($type eq "string") { + print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n"; + $text .= "\tvar _p$n $strconvtype\n"; + $text .= "\t_p$n, _ = $strconvfunc($name)\n"; + push @args, "uintptr(unsafe.Pointer(_p$n))"; + $n++; + } elsif($type =~ /^\[\](.*)/) { + # Convert slice into pointer, length. + # Have to be careful not to take address of &a[0] if len == 0: + # pass nil in that case. + $text .= "\tvar _p$n *$1\n"; + $text .= "\tif len($name) > 0 {\n\t\t_p$n = \&$name\[0]\n\t}\n"; + push @args, "uintptr(unsafe.Pointer(_p$n))", "uintptr(len($name))"; + $n++; + } elsif($type eq "int64" && $_32bit ne "") { + if($_32bit eq "big-endian") { + push @args, "uintptr($name >> 32)", "uintptr($name)"; + } else { + push @args, "uintptr($name)", "uintptr($name >> 32)"; + } + } elsif($type eq "bool") { + $text .= "\tvar _p$n uint32\n"; + $text .= "\tif $name {\n\t\t_p$n = 1\n\t} else {\n\t\t_p$n = 0\n\t}\n"; + push @args, "uintptr(_p$n)"; + $n++; + } else { + push @args, "uintptr($name)"; + } + } + my $nargs = @args; + + # Determine which form to use; pad args with zeros. + my $asm = "sysvicall6"; + if ($nonblock) { + $asm = "rawSysvicall6"; + } + if(@args <= 6) { + while(@args < 6) { + push @args, "0"; + } + } else { + print STDERR "$ARGV:$.: too many arguments to system call\n"; + } + + # Actual call. + my $args = join(', ', @args); + my $call = "$asm(uintptr(unsafe.Pointer(&$sysvarname)), $nargs, $args)"; + + # Assign return values. + my $body = ""; + my $failexpr = ""; + my @ret = ("_", "_", "_"); + my @pout= (); + my $do_errno = 0; + for(my $i=0; $i<@out; $i++) { + my $p = $out[$i]; + my ($name, $type) = parseparam($p); + my $reg = ""; + if($name eq "err") { + $reg = "e1"; + $ret[2] = $reg; + $do_errno = 1; + } else { + $reg = sprintf("r%d", $i); + $ret[$i] = $reg; + } + if($type eq "bool") { + $reg = "$reg != 0"; + } + if($type eq "int64" && $_32bit ne "") { + # 64-bit number in r1:r0 or r0:r1. + if($i+2 > @out) { + print STDERR "$ARGV:$.: not enough registers for int64 return\n"; + } + if($_32bit eq "big-endian") { + $reg = sprintf("int64(r%d)<<32 | int64(r%d)", $i, $i+1); + } else { + $reg = sprintf("int64(r%d)<<32 | int64(r%d)", $i+1, $i); + } + $ret[$i] = sprintf("r%d", $i); + $ret[$i+1] = sprintf("r%d", $i+1); + } + if($reg ne "e1") { + $body .= "\t$name = $type($reg)\n"; + } + } + if ($ret[0] eq "_" && $ret[1] eq "_" && $ret[2] eq "_") { + $text .= "\t$call\n"; + } else { + $text .= "\t$ret[0], $ret[1], $ret[2] := $call\n"; + } + $text .= $body; + + if ($do_errno) { + $text .= "\tif e1 != 0 {\n"; + $text .= "\t\terr = e1\n"; + $text .= "\t}\n"; + } + $text .= "\treturn\n"; + $text .= "}\n"; +} + +if($errors) { + exit 1; +} + +print < "net.inet", + "net.inet.ipproto" => "net.inet", + "net.inet6.ipv6proto" => "net.inet6", + "net.inet6.ipv6" => "net.inet6.ip6", + "net.inet.icmpv6" => "net.inet6.icmp6", + "net.inet6.divert6" => "net.inet6.divert", + "net.inet6.tcp6" => "net.inet.tcp", + "net.inet6.udp6" => "net.inet.udp", + "mpls" => "net.mpls", + "swpenc" => "vm.swapencrypt" +); + +# Node mappings +my %node_map = ( + "net.inet.ip.ifq" => "net.ifq", + "net.inet.pfsync" => "net.pfsync", + "net.mpls.ifq" => "net.ifq" +); + +my $ctlname; +my %mib = (); +my %sysctl = (); +my $node; + +sub debug() { + print STDERR "$_[0]\n" if $debug; +} + +# Walk the MIB and build a sysctl name to OID mapping. +sub build_sysctl() { + my ($node, $name, $oid) = @_; + my %node = %{$node}; + my @oid = @{$oid}; + + foreach my $key (sort keys %node) { + my @node = @{$node{$key}}; + my $nodename = $name.($name ne '' ? '.' : '').$key; + my @nodeoid = (@oid, $node[0]); + if ($node[1] eq 'CTLTYPE_NODE') { + if (exists $node_map{$nodename}) { + $node = \%mib; + $ctlname = $node_map{$nodename}; + foreach my $part (split /\./, $ctlname) { + $node = \%{@{$$node{$part}}[2]}; + } + } else { + $node = $node[2]; + } + &build_sysctl($node, $nodename, \@nodeoid); + } elsif ($node[1] ne '') { + $sysctl{$nodename} = \@nodeoid; + } + } +} + +foreach my $ctl (@ctls) { + $ctls{$ctl} = $ctl; +} + +# Build MIB +foreach my $header (@headers) { + &debug("Processing $header..."); + open HEADER, "/usr/include/$header" || + print STDERR "Failed to open $header\n"; + while (
) { + if ($_ =~ /^#define\s+(CTL_NAMES)\s+{/ || + $_ =~ /^#define\s+(CTL_(.*)_NAMES)\s+{/ || + $_ =~ /^#define\s+((.*)CTL_NAMES)\s+{/) { + if ($1 eq 'CTL_NAMES') { + # Top level. + $node = \%mib; + } else { + # Node. + my $nodename = lc($2); + if ($header =~ /^netinet\//) { + $ctlname = "net.inet.$nodename"; + } elsif ($header =~ /^netinet6\//) { + $ctlname = "net.inet6.$nodename"; + } elsif ($header =~ /^net\//) { + $ctlname = "net.$nodename"; + } else { + $ctlname = "$nodename"; + $ctlname =~ s/^(fs|net|kern)_/$1\./; + } + if (exists $ctl_map{$ctlname}) { + $ctlname = $ctl_map{$ctlname}; + } + if (not exists $ctls{$ctlname}) { + &debug("Ignoring $ctlname..."); + next; + } + + # Walk down from the top of the MIB. + $node = \%mib; + foreach my $part (split /\./, $ctlname) { + if (not exists $$node{$part}) { + &debug("Missing node $part"); + $$node{$part} = [ 0, '', {} ]; + } + $node = \%{@{$$node{$part}}[2]}; + } + } + + # Populate current node with entries. + my $i = -1; + while (defined($_) && $_ !~ /^}/) { + $_ =
; + $i++ if $_ =~ /{.*}/; + next if $_ !~ /{\s+"(\w+)",\s+(CTLTYPE_[A-Z]+)\s+}/; + $$node{$1} = [ $i, $2, {} ]; + } + } + } + close HEADER; +} + +&build_sysctl(\%mib, "", []); + +print <){ + if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ + my $name = $1; + my $num = $2; + $name =~ y/a-z/A-Z/; + print " SYS_$name = $num;" + } +} + +print <){ + if(/^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$/){ + my $num = $1; + my $proto = $2; + my $name = "SYS_$3"; + $name =~ y/a-z/A-Z/; + + # There are multiple entries for enosys and nosys, so comment them out. + if($name =~ /^SYS_E?NOSYS$/){ + $name = "// $name"; + } + if($name eq 'SYS_SYS_EXIT'){ + $name = 'SYS_EXIT'; + } + + print " $name = $num; // $proto\n"; + } +} + +print <){ + if(/^([0-9]+)\s+\S+\s+STD\s+({ \S+\s+(\w+).*)$/){ + my $num = $1; + my $proto = $2; + my $name = "SYS_$3"; + $name =~ y/a-z/A-Z/; + + # There are multiple entries for enosys and nosys, so comment them out. + if($name =~ /^SYS_E?NOSYS$/){ + $name = "// $name"; + } + if($name eq 'SYS_SYS_EXIT'){ + $name = 'SYS_EXIT'; + } + + print " $name = $num; // $proto\n"; + } +} + +print <){ + if($line =~ /^(.*)\\$/) { + # Handle continuation + $line = $1; + $_ =~ s/^\s+//; + $line .= $_; + } else { + # New line + $line = $_; + } + next if $line =~ /\\$/; + if($line =~ /^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$/) { + my $num = $1; + my $proto = $6; + my $compat = $8; + my $name = "$7_$9"; + + $name = "$7_$11" if $11 ne ''; + $name =~ y/a-z/A-Z/; + + if($compat eq '' || $compat eq '13' || $compat eq '30' || $compat eq '50') { + print " $name = $num; // $proto\n"; + } + } +} + +print <){ + if(/^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$/){ + my $num = $1; + my $proto = $3; + my $name = $4; + $name =~ y/a-z/A-Z/; + + # There are multiple entries for enosys and nosys, so comment them out. + if($name =~ /^SYS_E?NOSYS$/){ + $name = "// $name"; + } + if($name eq 'SYS_SYS_EXIT'){ + $name = 'SYS_EXIT'; + } + + print " $name = $num; // $proto\n"; + } +} + +print < -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -type Timeval32 C.struct_timeval32 - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat64 - -type Statfs_t C.struct_statfs64 - -type Flock_t C.struct_flock - -type Fstore_t C.struct_fstore - -type Radvisory_t C.struct_radvisory - -type Fbootstraptransfer_t C.struct_fbootstraptransfer - -type Log2phys_t C.struct_log2phys - -type Fsid C.struct_fsid - -type Dirent C.struct_dirent - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet4Pktinfo C.struct_in_pktinfo - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfmaMsghdr2 = C.sizeof_struct_ifma_msghdr2 - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfmaMsghdr2 C.struct_ifma_msghdr2 - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// uname - -type Utsname C.struct_utsname diff --git a/vendor/golang.org/x/sys/unix/types_dragonfly.go b/vendor/golang.org/x/sys/unix/types_dragonfly.go deleted file mode 100644 index 0c6330483918..000000000000 --- a/vendor/golang.org/x/sys/unix/types_dragonfly.go +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( // Directory mode bits - S_IFMT = C.S_IFMT - S_IFIFO = C.S_IFIFO - S_IFCHR = C.S_IFCHR - S_IFDIR = C.S_IFDIR - S_IFBLK = C.S_IFBLK - S_IFREG = C.S_IFREG - S_IFLNK = C.S_IFLNK - S_IFSOCK = C.S_IFSOCK - S_ISUID = C.S_ISUID - S_ISGID = C.S_ISGID - S_ISVTX = C.S_ISVTX - S_IRUSR = C.S_IRUSR - S_IWUSR = C.S_IWUSR - S_IXUSR = C.S_IXUSR -) - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.struct_fsid - -// File system limits - -const ( - PathMax = C.PATH_MAX -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// Uname - -type Utsname C.struct_utsname diff --git a/vendor/golang.org/x/sys/unix/types_freebsd.go b/vendor/golang.org/x/sys/unix/types_freebsd.go deleted file mode 100644 index 4eb02cd4daaf..000000000000 --- a/vendor/golang.org/x/sys/unix/types_freebsd.go +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -// This structure is a duplicate of stat on FreeBSD 8-STABLE. -// See /usr/include/sys/stat.h. -struct stat8 { -#undef st_atimespec st_atim -#undef st_mtimespec st_mtim -#undef st_ctimespec st_ctim -#undef st_birthtimespec st_birthtim - __dev_t st_dev; - ino_t st_ino; - mode_t st_mode; - nlink_t st_nlink; - uid_t st_uid; - gid_t st_gid; - __dev_t st_rdev; -#if __BSD_VISIBLE - struct timespec st_atimespec; - struct timespec st_mtimespec; - struct timespec st_ctimespec; -#else - time_t st_atime; - long __st_atimensec; - time_t st_mtime; - long __st_mtimensec; - time_t st_ctime; - long __st_ctimensec; -#endif - off_t st_size; - blkcnt_t st_blocks; - blksize_t st_blksize; - fflags_t st_flags; - __uint32_t st_gen; - __int32_t st_lspare; -#if __BSD_VISIBLE - struct timespec st_birthtimespec; - unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); - unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); -#else - time_t st_birthtime; - long st_birthtimensec; - unsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec)); - unsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec)); -#endif -}; - -// This structure is a duplicate of if_data on FreeBSD 8-STABLE. -// See /usr/include/net/if.h. -struct if_data8 { - u_char ifi_type; - u_char ifi_physical; - u_char ifi_addrlen; - u_char ifi_hdrlen; - u_char ifi_link_state; - u_char ifi_spare_char1; - u_char ifi_spare_char2; - u_char ifi_datalen; - u_long ifi_mtu; - u_long ifi_metric; - u_long ifi_baudrate; - u_long ifi_ipackets; - u_long ifi_ierrors; - u_long ifi_opackets; - u_long ifi_oerrors; - u_long ifi_collisions; - u_long ifi_ibytes; - u_long ifi_obytes; - u_long ifi_imcasts; - u_long ifi_omcasts; - u_long ifi_iqdrops; - u_long ifi_noproto; - u_long ifi_hwassist; -// FIXME: these are now unions, so maybe need to change definitions? -#undef ifi_epoch - time_t ifi_epoch; -#undef ifi_lastchange - struct timeval ifi_lastchange; -}; - -// This structure is a duplicate of if_msghdr on FreeBSD 8-STABLE. -// See /usr/include/net/if.h. -struct if_msghdr8 { - u_short ifm_msglen; - u_char ifm_version; - u_char ifm_type; - int ifm_addrs; - int ifm_flags; - u_short ifm_index; - struct if_data8 ifm_data; -}; -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( // Directory mode bits - S_IFMT = C.S_IFMT - S_IFIFO = C.S_IFIFO - S_IFCHR = C.S_IFCHR - S_IFDIR = C.S_IFDIR - S_IFBLK = C.S_IFBLK - S_IFREG = C.S_IFREG - S_IFLNK = C.S_IFLNK - S_IFSOCK = C.S_IFSOCK - S_ISUID = C.S_ISUID - S_ISGID = C.S_ISGID - S_ISVTX = C.S_ISVTX - S_IRUSR = C.S_IRUSR - S_IWUSR = C.S_IWUSR - S_IXUSR = C.S_IXUSR -) - -type Stat_t C.struct_stat8 - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.struct_fsid - -// File system limits - -const ( - PathMax = C.PATH_MAX -) - -// Advice to Fadvise - -const ( - FADV_NORMAL = C.POSIX_FADV_NORMAL - FADV_RANDOM = C.POSIX_FADV_RANDOM - FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL - FADV_WILLNEED = C.POSIX_FADV_WILLNEED - FADV_DONTNEED = C.POSIX_FADV_DONTNEED - FADV_NOREUSE = C.POSIX_FADV_NOREUSE -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPMreqn C.struct_ip_mreqn - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPMreqn = C.sizeof_struct_ip_mreqn - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - sizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfMsghdr = C.sizeof_struct_if_msghdr8 - sizeofIfData = C.sizeof_struct_if_data - SizeofIfData = C.sizeof_struct_if_data8 - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type ifMsghdr C.struct_if_msghdr - -type IfMsghdr C.struct_if_msghdr8 - -type ifData C.struct_if_data - -type IfData C.struct_if_data8 - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfZbuf = C.sizeof_struct_bpf_zbuf - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr - SizeofBpfZbufHeader = C.sizeof_struct_bpf_zbuf_header -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfZbuf C.struct_bpf_zbuf - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfZbufHeader C.struct_bpf_zbuf_header - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLINIGNEOF = C.POLLINIGNEOF - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// Capabilities - -type CapRights C.struct_cap_rights - -// Uname - -type Utsname C.struct_utsname diff --git a/vendor/golang.org/x/sys/unix/types_netbsd.go b/vendor/golang.org/x/sys/unix/types_netbsd.go deleted file mode 100644 index 10aa9b3a4f3f..000000000000 --- a/vendor/golang.org/x/sys/unix/types_netbsd.go +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.fsid_t - -// File system limits - -const ( - PathMax = C.PATH_MAX -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -type Mclpool C.struct_mclpool - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfTimeval C.struct_bpf_timeval - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// Sysctl - -type Sysctlnode C.struct_sysctlnode - -// Uname - -type Utsname C.struct_utsname diff --git a/vendor/golang.org/x/sys/unix/types_openbsd.go b/vendor/golang.org/x/sys/unix/types_openbsd.go deleted file mode 100644 index 649e55998f4d..000000000000 --- a/vendor/golang.org/x/sys/unix/types_openbsd.go +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( // Directory mode bits - S_IFMT = C.S_IFMT - S_IFIFO = C.S_IFIFO - S_IFCHR = C.S_IFCHR - S_IFDIR = C.S_IFDIR - S_IFBLK = C.S_IFBLK - S_IFREG = C.S_IFREG - S_IFLNK = C.S_IFLNK - S_IFSOCK = C.S_IFSOCK - S_ISUID = C.S_ISUID - S_ISGID = C.S_ISGID - S_ISVTX = C.S_ISVTX - S_IRUSR = C.S_IRUSR - S_IWUSR = C.S_IWUSR - S_IXUSR = C.S_IXUSR -) - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.fsid_t - -// File system limits - -const ( - PathMax = C.PATH_MAX -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -type Mclpool C.struct_mclpool - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfTimeval C.struct_bpf_timeval - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// Uname - -type Utsname C.struct_utsname diff --git a/vendor/golang.org/x/sys/unix/types_solaris.go b/vendor/golang.org/x/sys/unix/types_solaris.go deleted file mode 100644 index f77715544254..000000000000 --- a/vendor/golang.org/x/sys/unix/types_solaris.go +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -// These defines ensure that builds done on newer versions of Solaris are -// backwards-compatible with older versions of Solaris and -// OpenSolaris-based derivatives. -#define __USE_SUNOS_SOCKETS__ // msghdr -#define __USE_LEGACY_PROTOTYPES__ // iovec -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong - PathMax = C.PATH_MAX - MaxHostNameLen = C.MAXHOSTNAMELEN -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -type Timeval32 C.struct_timeval32 - -type Tms C.struct_tms - -type Utimbuf C.struct_utimbuf - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( // Directory mode bits - S_IFMT = C.S_IFMT - S_IFIFO = C.S_IFIFO - S_IFCHR = C.S_IFCHR - S_IFDIR = C.S_IFDIR - S_IFBLK = C.S_IFBLK - S_IFREG = C.S_IFREG - S_IFLNK = C.S_IFLNK - S_IFSOCK = C.S_IFSOCK - S_ISUID = C.S_ISUID - S_ISGID = C.S_ISGID - S_ISVTX = C.S_ISVTX - S_IRUSR = C.S_IRUSR - S_IWUSR = C.S_IWUSR - S_IXUSR = C.S_IXUSR -) - -type Stat_t C.struct_stat - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -// Filesystems - -type _Fsblkcnt_t C.fsblkcnt_t - -type Statvfs_t C.struct_statvfs - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Select - -type FdSet C.fd_set - -// Misc - -type Utsname C.struct_utsname - -type Ustat_t C.struct_ustat - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_EACCESS = C.AT_EACCESS -) - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfTimeval C.struct_bpf_timeval - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios - -type Termio C.struct_termio - -type Winsize C.struct_winsize - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) diff --git a/vendor/golang.org/x/text/cases/gen.go b/vendor/golang.org/x/text/cases/gen.go deleted file mode 100644 index 1cfe1c0201f7..000000000000 --- a/vendor/golang.org/x/text/cases/gen.go +++ /dev/null @@ -1,839 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// This program generates the trie for casing operations. The Unicode casing -// algorithm requires the lookup of various properties and mappings for each -// rune. The table generated by this generator combines several of the most -// frequently used of these into a single trie so that they can be accessed -// with a single lookup. -package main - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "log" - "reflect" - "strconv" - "strings" - "unicode" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/triegen" - "golang.org/x/text/internal/ucd" - "golang.org/x/text/unicode/norm" -) - -func main() { - gen.Init() - genTables() - genTablesTest() - gen.Repackage("gen_trieval.go", "trieval.go", "cases") -} - -// runeInfo contains all information for a rune that we care about for casing -// operations. -type runeInfo struct { - Rune rune - - entry info // trie value for this rune. - - CaseMode info - - // Simple case mappings. - Simple [1 + maxCaseMode][]rune - - // Special casing - HasSpecial bool - Conditional bool - Special [1 + maxCaseMode][]rune - - // Folding - FoldSimple rune - FoldSpecial rune - FoldFull []rune - - // TODO: FC_NFKC, or equivalent data. - - // Properties - SoftDotted bool - CaseIgnorable bool - Cased bool - DecomposeGreek bool - BreakType string - BreakCat breakCategory - - // We care mostly about 0, Above, and IotaSubscript. - CCC byte -} - -type breakCategory int - -const ( - breakBreak breakCategory = iota - breakLetter - breakMid -) - -// mapping returns the case mapping for the given case type. -func (r *runeInfo) mapping(c info) string { - if r.HasSpecial { - return string(r.Special[c]) - } - if len(r.Simple[c]) != 0 { - return string(r.Simple[c]) - } - return string(r.Rune) -} - -func parse(file string, f func(p *ucd.Parser)) { - ucd.Parse(gen.OpenUCDFile(file), f) -} - -func parseUCD() []runeInfo { - chars := make([]runeInfo, unicode.MaxRune) - - get := func(r rune) *runeInfo { - c := &chars[r] - c.Rune = r - return c - } - - parse("UnicodeData.txt", func(p *ucd.Parser) { - ri := get(p.Rune(0)) - ri.CCC = byte(p.Int(ucd.CanonicalCombiningClass)) - ri.Simple[cLower] = p.Runes(ucd.SimpleLowercaseMapping) - ri.Simple[cUpper] = p.Runes(ucd.SimpleUppercaseMapping) - ri.Simple[cTitle] = p.Runes(ucd.SimpleTitlecaseMapping) - if p.String(ucd.GeneralCategory) == "Lt" { - ri.CaseMode = cTitle - } - }) - - // ; - parse("PropList.txt", func(p *ucd.Parser) { - if p.String(1) == "Soft_Dotted" { - chars[p.Rune(0)].SoftDotted = true - } - }) - - // ; - parse("DerivedCoreProperties.txt", func(p *ucd.Parser) { - ri := get(p.Rune(0)) - switch p.String(1) { - case "Case_Ignorable": - ri.CaseIgnorable = true - case "Cased": - ri.Cased = true - case "Lowercase": - ri.CaseMode = cLower - case "Uppercase": - ri.CaseMode = cUpper - } - }) - - // ; ; ; <upper> ; (<condition_list> ;)? - parse("SpecialCasing.txt", func(p *ucd.Parser) { - // We drop all conditional special casing and deal with them manually in - // the language-specific case mappers. Rune 0x03A3 is the only one with - // a conditional formatting that is not language-specific. However, - // dealing with this letter is tricky, especially in a streaming - // context, so we deal with it in the Caser for Greek specifically. - ri := get(p.Rune(0)) - if p.String(4) == "" { - ri.HasSpecial = true - ri.Special[cLower] = p.Runes(1) - ri.Special[cTitle] = p.Runes(2) - ri.Special[cUpper] = p.Runes(3) - } else { - ri.Conditional = true - } - }) - - // TODO: Use text breaking according to UAX #29. - // <code>; <word break type> - parse("auxiliary/WordBreakProperty.txt", func(p *ucd.Parser) { - ri := get(p.Rune(0)) - ri.BreakType = p.String(1) - - // We collapse the word breaking properties onto the categories we need. - switch p.String(1) { // TODO: officially we need to canonicalize. - case "MidLetter", "MidNumLet", "Single_Quote": - ri.BreakCat = breakMid - if !ri.CaseIgnorable { - // finalSigma relies on the fact that all breakMid runes are - // also a Case_Ignorable. Revisit this code when this changes. - log.Fatalf("Rune %U, which has a break category mid, is not a case ignorable", ri) - } - case "ALetter", "Hebrew_Letter", "Numeric", "Extend", "ExtendNumLet", "Format", "ZWJ": - ri.BreakCat = breakLetter - } - }) - - // <code>; <type>; <mapping> - parse("CaseFolding.txt", func(p *ucd.Parser) { - ri := get(p.Rune(0)) - switch p.String(1) { - case "C": - ri.FoldSimple = p.Rune(2) - ri.FoldFull = p.Runes(2) - case "S": - ri.FoldSimple = p.Rune(2) - case "T": - ri.FoldSpecial = p.Rune(2) - case "F": - ri.FoldFull = p.Runes(2) - default: - log.Fatalf("%U: unknown type: %s", p.Rune(0), p.String(1)) - } - }) - - return chars -} - -func genTables() { - chars := parseUCD() - verifyProperties(chars) - - t := triegen.NewTrie("case") - for i := range chars { - c := &chars[i] - makeEntry(c) - t.Insert(rune(i), uint64(c.entry)) - } - - w := gen.NewCodeWriter() - defer w.WriteVersionedGoFile("tables.go", "cases") - - gen.WriteUnicodeVersion(w) - - // TODO: write CLDR version after adding a mechanism to detect that the - // tables on which the manually created locale-sensitive casing code is - // based hasn't changed. - - w.WriteVar("xorData", string(xorData)) - w.WriteVar("exceptions", string(exceptionData)) - - sz, err := t.Gen(w, triegen.Compact(&sparseCompacter{})) - if err != nil { - log.Fatal(err) - } - w.Size += sz -} - -func makeEntry(ri *runeInfo) { - if ri.CaseIgnorable { - if ri.Cased { - ri.entry = cIgnorableCased - } else { - ri.entry = cIgnorableUncased - } - } else { - ri.entry = ri.CaseMode - } - - // TODO: handle soft-dotted. - - ccc := cccOther - switch ri.CCC { - case 0: // Not_Reordered - ccc = cccZero - case above: // Above - ccc = cccAbove - } - switch ri.BreakCat { - case breakBreak: - ccc = cccBreak - case breakMid: - ri.entry |= isMidBit - } - - ri.entry |= ccc - - if ri.CaseMode == cUncased { - return - } - - // Need to do something special. - if ri.CaseMode == cTitle || ri.HasSpecial || ri.mapping(cTitle) != ri.mapping(cUpper) { - makeException(ri) - return - } - if f := string(ri.FoldFull); len(f) > 0 && f != ri.mapping(cUpper) && f != ri.mapping(cLower) { - makeException(ri) - return - } - - // Rune is either lowercase or uppercase. - - orig := string(ri.Rune) - mapped := "" - if ri.CaseMode == cUpper { - mapped = ri.mapping(cLower) - } else { - mapped = ri.mapping(cUpper) - } - - if len(orig) != len(mapped) { - makeException(ri) - return - } - - if string(ri.FoldFull) == ri.mapping(cUpper) { - ri.entry |= inverseFoldBit - } - - n := len(orig) - - // Create per-byte XOR mask. - var b []byte - for i := 0; i < n; i++ { - b = append(b, orig[i]^mapped[i]) - } - - // Remove leading 0 bytes, but keep at least one byte. - for ; len(b) > 1 && b[0] == 0; b = b[1:] { - } - - if len(b) == 1 && b[0]&0xc0 == 0 { - ri.entry |= info(b[0]) << xorShift - return - } - - key := string(b) - x, ok := xorCache[key] - if !ok { - xorData = append(xorData, 0) // for detecting start of sequence - xorData = append(xorData, b...) - - x = len(xorData) - 1 - xorCache[key] = x - } - ri.entry |= info(x<<xorShift) | xorIndexBit -} - -var xorCache = map[string]int{} - -// xorData contains byte-wise XOR data for the least significant bytes of a -// UTF-8 encoded rune. An index points to the last byte. The sequence starts -// with a zero terminator. -var xorData = []byte{} - -// See the comments in gen_trieval.go re "the exceptions slice". -var exceptionData = []byte{0} - -// makeException encodes case mappings that cannot be expressed in a simple -// XOR diff. -func makeException(ri *runeInfo) { - ccc := ri.entry & cccMask - // Set exception bit and retain case type. - ri.entry &= 0x0007 - ri.entry |= exceptionBit - - if len(exceptionData) >= 1<<numExceptionBits { - log.Fatalf("%U:exceptionData too large %x > %d bits", ri.Rune, len(exceptionData), numExceptionBits) - } - - // Set the offset in the exceptionData array. - ri.entry |= info(len(exceptionData) << exceptionShift) - - orig := string(ri.Rune) - tc := ri.mapping(cTitle) - uc := ri.mapping(cUpper) - lc := ri.mapping(cLower) - ff := string(ri.FoldFull) - - // addString sets the length of a string and adds it to the expansions array. - addString := func(s string, b *byte) { - if len(s) == 0 { - // Zero-length mappings exist, but only for conditional casing, - // which we are representing outside of this table. - log.Fatalf("%U: has zero-length mapping.", ri.Rune) - } - *b <<= 3 - if s != orig { - n := len(s) - if n > 7 { - log.Fatalf("%U: mapping larger than 7 (%d)", ri.Rune, n) - } - *b |= byte(n) - exceptionData = append(exceptionData, s...) - } - } - - // byte 0: - exceptionData = append(exceptionData, byte(ccc)|byte(len(ff))) - - // byte 1: - p := len(exceptionData) - exceptionData = append(exceptionData, 0) - - if len(ff) > 7 { // May be zero-length. - log.Fatalf("%U: fold string larger than 7 (%d)", ri.Rune, len(ff)) - } - exceptionData = append(exceptionData, ff...) - ct := ri.CaseMode - if ct != cLower { - addString(lc, &exceptionData[p]) - } - if ct != cUpper { - addString(uc, &exceptionData[p]) - } - if ct != cTitle { - // If title is the same as upper, we set it to the original string so - // that it will be marked as not present. This implies title case is - // the same as upper case. - if tc == uc { - tc = orig - } - addString(tc, &exceptionData[p]) - } -} - -// sparseCompacter is a trie value block Compacter. There are many cases where -// successive runes alternate between lower- and upper-case. This Compacter -// exploits this by adding a special case type where the case value is obtained -// from or-ing it with the least-significant bit of the rune, creating large -// ranges of equal case values that compress well. -type sparseCompacter struct { - sparseBlocks [][]uint16 - sparseOffsets []uint16 - sparseCount int -} - -// makeSparse returns the number of elements that compact block would contain -// as well as the modified values. -func makeSparse(vals []uint64) ([]uint16, int) { - // Copy the values. - values := make([]uint16, len(vals)) - for i, v := range vals { - values[i] = uint16(v) - } - - alt := func(i int, v uint16) uint16 { - if cm := info(v & fullCasedMask); cm == cUpper || cm == cLower { - // Convert cLower or cUpper to cXORCase value, which has the form 11x. - xor := v - xor &^= 1 - xor |= uint16(i&1) ^ (v & 1) - xor |= 0x4 - return xor - } - return v - } - - var count int - var previous uint16 - for i, v := range values { - if v != 0 { - // Try if the unmodified value is equal to the previous. - if v == previous { - continue - } - - // Try if the xor-ed value is equal to the previous value. - a := alt(i, v) - if a == previous { - values[i] = a - continue - } - - // This is a new value. - count++ - - // Use the xor-ed value if it will be identical to the next value. - if p := i + 1; p < len(values) && alt(p, values[p]) == a { - values[i] = a - v = a - } - } - previous = v - } - return values, count -} - -func (s *sparseCompacter) Size(v []uint64) (int, bool) { - _, n := makeSparse(v) - - // We limit using this method to having 16 entries. - if n > 16 { - return 0, false - } - - return 2 + int(reflect.TypeOf(valueRange{}).Size())*n, true -} - -func (s *sparseCompacter) Store(v []uint64) uint32 { - h := uint32(len(s.sparseOffsets)) - values, sz := makeSparse(v) - s.sparseBlocks = append(s.sparseBlocks, values) - s.sparseOffsets = append(s.sparseOffsets, uint16(s.sparseCount)) - s.sparseCount += sz - return h -} - -func (s *sparseCompacter) Handler() string { - // The sparse global variable and its lookup method is defined in gen_trieval.go. - return "sparse.lookup" -} - -func (s *sparseCompacter) Print(w io.Writer) (retErr error) { - p := func(format string, args ...interface{}) { - _, err := fmt.Fprintf(w, format, args...) - if retErr == nil && err != nil { - retErr = err - } - } - - ls := len(s.sparseBlocks) - if ls == len(s.sparseOffsets) { - s.sparseOffsets = append(s.sparseOffsets, uint16(s.sparseCount)) - } - p("// sparseOffsets: %d entries, %d bytes\n", ls+1, (ls+1)*2) - p("var sparseOffsets = %#v\n\n", s.sparseOffsets) - - ns := s.sparseCount - p("// sparseValues: %d entries, %d bytes\n", ns, ns*4) - p("var sparseValues = [%d]valueRange {", ns) - for i, values := range s.sparseBlocks { - p("\n// Block %#x, offset %#x", i, s.sparseOffsets[i]) - var v uint16 - for i, nv := range values { - if nv != v { - if v != 0 { - p(",hi:%#02x},", 0x80+i-1) - } - if nv != 0 { - p("\n{value:%#04x,lo:%#02x", nv, 0x80+i) - } - } - v = nv - } - if v != 0 { - p(",hi:%#02x},", 0x80+len(values)-1) - } - } - p("\n}\n\n") - return -} - -// verifyProperties that properties of the runes that are relied upon in the -// implementation. Each property is marked with an identifier that is referred -// to in the places where it is used. -func verifyProperties(chars []runeInfo) { - for i, c := range chars { - r := rune(i) - - // Rune properties. - - // A.1: modifier never changes on lowercase. [ltLower] - if c.CCC > 0 && unicode.ToLower(r) != r { - log.Fatalf("%U: non-starter changes when lowercased", r) - } - - // A.2: properties of decompositions starting with I or J. [ltLower] - d := norm.NFD.PropertiesString(string(r)).Decomposition() - if len(d) > 0 { - if d[0] == 'I' || d[0] == 'J' { - // A.2.1: we expect at least an ASCII character and a modifier. - if len(d) < 3 { - log.Fatalf("%U: length of decomposition was %d; want >= 3", r, len(d)) - } - - // All subsequent runes are modifiers and all have the same CCC. - runes := []rune(string(d[1:])) - ccc := chars[runes[0]].CCC - - for _, mr := range runes[1:] { - mc := chars[mr] - - // A.2.2: all modifiers have a CCC of Above or less. - if ccc == 0 || ccc > above { - log.Fatalf("%U: CCC of successive rune (%U) was %d; want (0,230]", r, mr, ccc) - } - - // A.2.3: a sequence of modifiers all have the same CCC. - if mc.CCC != ccc { - log.Fatalf("%U: CCC of follow-up modifier (%U) was %d; want %d", r, mr, mc.CCC, ccc) - } - - // A.2.4: for each trailing r, r in [0x300, 0x311] <=> CCC == Above. - if (ccc == above) != (0x300 <= mr && mr <= 0x311) { - log.Fatalf("%U: modifier %U in [U+0300, U+0311] != ccc(%U) == 230", r, mr, mr) - } - - if i += len(string(mr)); i >= len(d) { - break - } - } - } - } - - // A.3: no U+0307 in decomposition of Soft-Dotted rune. [ltUpper] - if unicode.Is(unicode.Soft_Dotted, r) && strings.Contains(string(d), "\u0307") { - log.Fatalf("%U: decomposition of soft-dotted rune may not contain U+0307", r) - } - - // A.4: only rune U+0345 may be of CCC Iota_Subscript. [elUpper] - if c.CCC == iotaSubscript && r != 0x0345 { - log.Fatalf("%U: only rune U+0345 may have CCC Iota_Subscript", r) - } - - // A.5: soft-dotted runes do not have exceptions. - if c.SoftDotted && c.entry&exceptionBit != 0 { - log.Fatalf("%U: soft-dotted has exception", r) - } - - // A.6: Greek decomposition. [elUpper] - if unicode.Is(unicode.Greek, r) { - if b := norm.NFD.PropertiesString(string(r)).Decomposition(); b != nil { - runes := []rune(string(b)) - // A.6.1: If a Greek rune decomposes and the first rune of the - // decomposition is greater than U+00FF, the rune is always - // great and not a modifier. - if f := runes[0]; unicode.IsMark(f) || f > 0xFF && !unicode.Is(unicode.Greek, f) { - log.Fatalf("%U: expected first rune of Greek decomposition to be letter, found %U", r, f) - } - // A.6.2: Any follow-up rune in a Greek decomposition is a - // modifier of which the first should be gobbled in - // decomposition. - for _, m := range runes[1:] { - switch m { - case 0x0313, 0x0314, 0x0301, 0x0300, 0x0306, 0x0342, 0x0308, 0x0304, 0x345: - default: - log.Fatalf("%U: modifier %U is outside of expected Greek modifier set", r, m) - } - } - } - } - - // Breaking properties. - - // B.1: all runes with CCC > 0 are of break type Extend. - if c.CCC > 0 && c.BreakType != "Extend" { - log.Fatalf("%U: CCC == %d, but got break type %s; want Extend", r, c.CCC, c.BreakType) - } - - // B.2: all cased runes with c.CCC == 0 are of break type ALetter. - if c.CCC == 0 && c.Cased && c.BreakType != "ALetter" { - log.Fatalf("%U: cased, but got break type %s; want ALetter", r, c.BreakType) - } - - // B.3: letter category. - if c.CCC == 0 && c.BreakCat != breakBreak && !c.CaseIgnorable { - if c.BreakCat != breakLetter { - log.Fatalf("%U: check for letter break type gave %d; want %d", r, c.BreakCat, breakLetter) - } - } - } -} - -func genTablesTest() { - w := &bytes.Buffer{} - - fmt.Fprintln(w, "var (") - printProperties(w, "DerivedCoreProperties.txt", "Case_Ignorable", verifyIgnore) - - // We discard the output as we know we have perfect functions. We run them - // just to verify the properties are correct. - n := printProperties(ioutil.Discard, "DerivedCoreProperties.txt", "Cased", verifyCased) - n += printProperties(ioutil.Discard, "DerivedCoreProperties.txt", "Lowercase", verifyLower) - n += printProperties(ioutil.Discard, "DerivedCoreProperties.txt", "Uppercase", verifyUpper) - if n > 0 { - log.Fatalf("One of the discarded properties does not have a perfect filter.") - } - - // <code>; <lower> ; <title> ; <upper> ; (<condition_list> ;)? - fmt.Fprintln(w, "\tspecial = map[rune]struct{ toLower, toTitle, toUpper string }{") - parse("SpecialCasing.txt", func(p *ucd.Parser) { - // Skip conditional entries. - if p.String(4) != "" { - return - } - r := p.Rune(0) - fmt.Fprintf(w, "\t\t0x%04x: {%q, %q, %q},\n", - r, string(p.Runes(1)), string(p.Runes(2)), string(p.Runes(3))) - }) - fmt.Fprint(w, "\t}\n\n") - - // <code>; <type>; <runes> - table := map[rune]struct{ simple, full, special string }{} - parse("CaseFolding.txt", func(p *ucd.Parser) { - r := p.Rune(0) - t := p.String(1) - v := string(p.Runes(2)) - if t != "T" && v == string(unicode.ToLower(r)) { - return - } - x := table[r] - switch t { - case "C": - x.full = v - x.simple = v - case "S": - x.simple = v - case "F": - x.full = v - case "T": - x.special = v - } - table[r] = x - }) - fmt.Fprintln(w, "\tfoldMap = map[rune]struct{ simple, full, special string }{") - for r := rune(0); r < 0x10FFFF; r++ { - x, ok := table[r] - if !ok { - continue - } - fmt.Fprintf(w, "\t\t0x%04x: {%q, %q, %q},\n", r, x.simple, x.full, x.special) - } - fmt.Fprint(w, "\t}\n\n") - - // Break property - notBreak := map[rune]bool{} - parse("auxiliary/WordBreakProperty.txt", func(p *ucd.Parser) { - switch p.String(1) { - case "Extend", "Format", "MidLetter", "MidNumLet", "Single_Quote", - "ALetter", "Hebrew_Letter", "Numeric", "ExtendNumLet", "ZWJ": - notBreak[p.Rune(0)] = true - } - }) - - fmt.Fprintln(w, "\tbreakProp = []struct{ lo, hi rune }{") - inBreak := false - for r := rune(0); r <= lastRuneForTesting; r++ { - if isBreak := !notBreak[r]; isBreak != inBreak { - if isBreak { - fmt.Fprintf(w, "\t\t{0x%x, ", r) - } else { - fmt.Fprintf(w, "0x%x},\n", r-1) - } - inBreak = isBreak - } - } - if inBreak { - fmt.Fprintf(w, "0x%x},\n", lastRuneForTesting) - } - fmt.Fprint(w, "\t}\n\n") - - // Word break test - // Filter out all samples that do not contain cased characters. - cased := map[rune]bool{} - parse("DerivedCoreProperties.txt", func(p *ucd.Parser) { - if p.String(1) == "Cased" { - cased[p.Rune(0)] = true - } - }) - - fmt.Fprintln(w, "\tbreakTest = []string{") - parse("auxiliary/WordBreakTest.txt", func(p *ucd.Parser) { - c := strings.Split(p.String(0), " ") - - const sep = '|' - numCased := 0 - test := "" - for ; len(c) >= 2; c = c[2:] { - if c[0] == "÷" && test != "" { - test += string(sep) - } - i, err := strconv.ParseUint(c[1], 16, 32) - r := rune(i) - if err != nil { - log.Fatalf("Invalid rune %q.", c[1]) - } - if r == sep { - log.Fatalf("Separator %q not allowed in test data. Pick another one.", sep) - } - if cased[r] { - numCased++ - } - test += string(r) - } - if numCased > 1 { - fmt.Fprintf(w, "\t\t%q,\n", test) - } - }) - fmt.Fprintln(w, "\t}") - - fmt.Fprintln(w, ")") - - gen.WriteVersionedGoFile("tables_test.go", "cases", w.Bytes()) -} - -// These functions are just used for verification that their definition have not -// changed in the Unicode Standard. - -func verifyCased(r rune) bool { - return verifyLower(r) || verifyUpper(r) || unicode.IsTitle(r) -} - -func verifyLower(r rune) bool { - return unicode.IsLower(r) || unicode.Is(unicode.Other_Lowercase, r) -} - -func verifyUpper(r rune) bool { - return unicode.IsUpper(r) || unicode.Is(unicode.Other_Uppercase, r) -} - -// verifyIgnore is an approximation of the Case_Ignorable property using the -// core unicode package. It is used to reduce the size of the test data. -func verifyIgnore(r rune) bool { - props := []*unicode.RangeTable{ - unicode.Mn, - unicode.Me, - unicode.Cf, - unicode.Lm, - unicode.Sk, - } - for _, p := range props { - if unicode.Is(p, r) { - return true - } - } - return false -} - -// printProperties prints tables of rune properties from the given UCD file. -// A filter func f can be given to exclude certain values. A rune r will have -// the indicated property if it is in the generated table or if f(r). -func printProperties(w io.Writer, file, property string, f func(r rune) bool) int { - verify := map[rune]bool{} - n := 0 - varNameParts := strings.Split(property, "_") - varNameParts[0] = strings.ToLower(varNameParts[0]) - fmt.Fprintf(w, "\t%s = map[rune]bool{\n", strings.Join(varNameParts, "")) - parse(file, func(p *ucd.Parser) { - if p.String(1) == property { - r := p.Rune(0) - verify[r] = true - if !f(r) { - n++ - fmt.Fprintf(w, "\t\t0x%.4x: true,\n", r) - } - } - }) - fmt.Fprint(w, "\t}\n\n") - - // Verify that f is correct, that is, it represents a subset of the property. - for r := rune(0); r <= lastRuneForTesting; r++ { - if !verify[r] && f(r) { - log.Fatalf("Incorrect filter func for property %q.", property) - } - } - return n -} - -// The newCaseTrie, sparseValues and sparseOffsets definitions below are -// placeholders referred to by gen_trieval.go. The real definitions are -// generated by this program and written to tables.go. - -func newCaseTrie(int) int { return 0 } - -var ( - sparseValues [0]valueRange - sparseOffsets [0]uint16 -) diff --git a/vendor/golang.org/x/text/cases/gen_trieval.go b/vendor/golang.org/x/text/cases/gen_trieval.go deleted file mode 100644 index 376d22c8f9d5..000000000000 --- a/vendor/golang.org/x/text/cases/gen_trieval.go +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This file contains definitions for interpreting the trie value of the case -// trie generated by "go run gen*.go". It is shared by both the generator -// program and the resultant package. Sharing is achieved by the generator -// copying gen_trieval.go to trieval.go and changing what's above this comment. - -// info holds case information for a single rune. It is the value returned -// by a trie lookup. Most mapping information can be stored in a single 16-bit -// value. If not, for example when a rune is mapped to multiple runes, the value -// stores some basic case data and an index into an array with additional data. -// -// The per-rune values have the following format: -// -// if (exception) { -// 15..5 unsigned exception index -// 4 unused -// } else { -// 15..8 XOR pattern or index to XOR pattern for case mapping -// Only 13..8 are used for XOR patterns. -// 7 inverseFold (fold to upper, not to lower) -// 6 index: interpret the XOR pattern as an index -// or isMid if case mode is cIgnorableUncased. -// 5..4 CCC: zero (normal or break), above or other -// } -// 3 exception: interpret this value as an exception index -// (TODO: is this bit necessary? Probably implied from case mode.) -// 2..0 case mode -// -// For the non-exceptional cases, a rune must be either uncased, lowercase or -// uppercase. If the rune is cased, the XOR pattern maps either a lowercase -// rune to uppercase or an uppercase rune to lowercase (applied to the 10 -// least-significant bits of the rune). -// -// See the definitions below for a more detailed description of the various -// bits. -type info uint16 - -const ( - casedMask = 0x0003 - fullCasedMask = 0x0007 - ignorableMask = 0x0006 - ignorableValue = 0x0004 - - inverseFoldBit = 1 << 7 - isMidBit = 1 << 6 - - exceptionBit = 1 << 3 - exceptionShift = 5 - numExceptionBits = 11 - - xorIndexBit = 1 << 6 - xorShift = 8 - - // There is no mapping if all xor bits and the exception bit are zero. - hasMappingMask = 0xff80 | exceptionBit -) - -// The case mode bits encodes the case type of a rune. This includes uncased, -// title, upper and lower case and case ignorable. (For a definition of these -// terms see Chapter 3 of The Unicode Standard Core Specification.) In some rare -// cases, a rune can be both cased and case-ignorable. This is encoded by -// cIgnorableCased. A rune of this type is always lower case. Some runes are -// cased while not having a mapping. -// -// A common pattern for scripts in the Unicode standard is for upper and lower -// case runes to alternate for increasing rune values (e.g. the accented Latin -// ranges starting from U+0100 and U+1E00 among others and some Cyrillic -// characters). We use this property by defining a cXORCase mode, where the case -// mode (always upper or lower case) is derived from the rune value. As the XOR -// pattern for case mappings is often identical for successive runes, using -// cXORCase can result in large series of identical trie values. This, in turn, -// allows us to better compress the trie blocks. -const ( - cUncased info = iota // 000 - cTitle // 001 - cLower // 010 - cUpper // 011 - cIgnorableUncased // 100 - cIgnorableCased // 101 // lower case if mappings exist - cXORCase // 11x // case is cLower | ((rune&1) ^ x) - - maxCaseMode = cUpper -) - -func (c info) isCased() bool { - return c&casedMask != 0 -} - -func (c info) isCaseIgnorable() bool { - return c&ignorableMask == ignorableValue -} - -func (c info) isNotCasedAndNotCaseIgnorable() bool { - return c&fullCasedMask == 0 -} - -func (c info) isCaseIgnorableAndNotCased() bool { - return c&fullCasedMask == cIgnorableUncased -} - -func (c info) isMid() bool { - return c&(fullCasedMask|isMidBit) == isMidBit|cIgnorableUncased -} - -// The case mapping implementation will need to know about various Canonical -// Combining Class (CCC) values. We encode two of these in the trie value: -// cccZero (0) and cccAbove (230). If the value is cccOther, it means that -// CCC(r) > 0, but not 230. A value of cccBreak means that CCC(r) == 0 and that -// the rune also has the break category Break (see below). -const ( - cccBreak info = iota << 4 - cccZero - cccAbove - cccOther - - cccMask = cccBreak | cccZero | cccAbove | cccOther -) - -const ( - starter = 0 - above = 230 - iotaSubscript = 240 -) - -// The exceptions slice holds data that does not fit in a normal info entry. -// The entry is pointed to by the exception index in an entry. It has the -// following format: -// -// Header -// byte 0: -// 7..6 unused -// 5..4 CCC type (same bits as entry) -// 3 unused -// 2..0 length of fold -// -// byte 1: -// 7..6 unused -// 5..3 length of 1st mapping of case type -// 2..0 length of 2nd mapping of case type -// -// case 1st 2nd -// lower -> upper, title -// upper -> lower, title -// title -> lower, upper -// -// Lengths with the value 0x7 indicate no value and implies no change. -// A length of 0 indicates a mapping to zero-length string. -// -// Body bytes: -// case folding bytes -// lowercase mapping bytes -// uppercase mapping bytes -// titlecase mapping bytes -// closure mapping bytes (for NFKC_Casefold). (TODO) -// -// Fallbacks: -// missing fold -> lower -// missing title -> upper -// all missing -> original rune -// -// exceptions starts with a dummy byte to enforce that there is no zero index -// value. -const ( - lengthMask = 0x07 - lengthBits = 3 - noChange = 0 -) - -// References to generated trie. - -var trie = newCaseTrie(0) - -var sparse = sparseBlocks{ - values: sparseValues[:], - offsets: sparseOffsets[:], -} - -// Sparse block lookup code. - -// valueRange is an entry in a sparse block. -type valueRange struct { - value uint16 - lo, hi byte -} - -type sparseBlocks struct { - values []valueRange - offsets []uint16 -} - -// lookup returns the value from values block n for byte b using binary search. -func (s *sparseBlocks) lookup(n uint32, b byte) uint16 { - lo := s.offsets[n] - hi := s.offsets[n+1] - for lo < hi { - m := lo + (hi-lo)/2 - r := s.values[m] - if r.lo <= b && b <= r.hi { - return r.value - } - if b < r.lo { - hi = m - } else { - lo = m + 1 - } - } - return 0 -} - -// lastRuneForTesting is the last rune used for testing. Everything after this -// is boring. -const lastRuneForTesting = rune(0x1FFFF) diff --git a/vendor/golang.org/x/text/collate/build/builder.go b/vendor/golang.org/x/text/collate/build/builder.go deleted file mode 100644 index 11042841b110..000000000000 --- a/vendor/golang.org/x/text/collate/build/builder.go +++ /dev/null @@ -1,702 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package build // import "golang.org/x/text/collate/build" - -import ( - "fmt" - "io" - "log" - "sort" - "strings" - "unicode/utf8" - - "golang.org/x/text/internal/colltab" - "golang.org/x/text/language" - "golang.org/x/text/unicode/norm" -) - -// TODO: optimizations: -// - expandElem is currently 20K. By putting unique colElems in a separate -// table and having a byte array of indexes into this table, we can reduce -// the total size to about 7K. By also factoring out the length bytes, we -// can reduce this to about 6K. -// - trie valueBlocks are currently 100K. There are a lot of sparse blocks -// and many consecutive values with the same stride. This can be further -// compacted. -// - Compress secondary weights into 8 bits. -// - Some LDML specs specify a context element. Currently we simply concatenate -// those. Context can be implemented using the contraction trie. If Builder -// could analyze and detect when using a context makes sense, there is no -// need to expose this construct in the API. - -// A Builder builds a root collation table. The user must specify the -// collation elements for each entry. A common use will be to base the weights -// on those specified in the allkeys* file as provided by the UCA or CLDR. -type Builder struct { - index *trieBuilder - root ordering - locale []*Tailoring - t *table - err error - built bool - - minNonVar int // lowest primary recorded for a variable - varTop int // highest primary recorded for a non-variable - - // indexes used for reusing expansions and contractions - expIndex map[string]int // positions of expansions keyed by their string representation - ctHandle map[string]ctHandle // contraction handles keyed by a concatenation of the suffixes - ctElem map[string]int // contraction elements keyed by their string representation -} - -// A Tailoring builds a collation table based on another collation table. -// The table is defined by specifying tailorings to the underlying table. -// See http://unicode.org/reports/tr35/ for an overview of tailoring -// collation tables. The CLDR contains pre-defined tailorings for a variety -// of languages (See http://www.unicode.org/Public/cldr/<version>/core.zip.) -type Tailoring struct { - id string - builder *Builder - index *ordering - - anchor *entry - before bool -} - -// NewBuilder returns a new Builder. -func NewBuilder() *Builder { - return &Builder{ - index: newTrieBuilder(), - root: makeRootOrdering(), - expIndex: make(map[string]int), - ctHandle: make(map[string]ctHandle), - ctElem: make(map[string]int), - } -} - -// Tailoring returns a Tailoring for the given locale. One should -// have completed all calls to Add before calling Tailoring. -func (b *Builder) Tailoring(loc language.Tag) *Tailoring { - t := &Tailoring{ - id: loc.String(), - builder: b, - index: b.root.clone(), - } - t.index.id = t.id - b.locale = append(b.locale, t) - return t -} - -// Add adds an entry to the collation element table, mapping -// a slice of runes to a sequence of collation elements. -// A collation element is specified as list of weights: []int{primary, secondary, ...}. -// The entries are typically obtained from a collation element table -// as defined in http://www.unicode.org/reports/tr10/#Data_Table_Format. -// Note that the collation elements specified by colelems are only used -// as a guide. The actual weights generated by Builder may differ. -// The argument variables is a list of indices into colelems that should contain -// a value for each colelem that is a variable. (See the reference above.) -func (b *Builder) Add(runes []rune, colelems [][]int, variables []int) error { - str := string(runes) - elems := make([]rawCE, len(colelems)) - for i, ce := range colelems { - if len(ce) == 0 { - break - } - elems[i] = makeRawCE(ce, 0) - if len(ce) == 1 { - elems[i].w[1] = defaultSecondary - } - if len(ce) <= 2 { - elems[i].w[2] = defaultTertiary - } - if len(ce) <= 3 { - elems[i].w[3] = ce[0] - } - } - for i, ce := range elems { - p := ce.w[0] - isvar := false - for _, j := range variables { - if i == j { - isvar = true - } - } - if isvar { - if p >= b.minNonVar && b.minNonVar > 0 { - return fmt.Errorf("primary value %X of variable is larger than the smallest non-variable %X", p, b.minNonVar) - } - if p > b.varTop { - b.varTop = p - } - } else if p > 1 { // 1 is a special primary value reserved for FFFE - if p <= b.varTop { - return fmt.Errorf("primary value %X of non-variable is smaller than the highest variable %X", p, b.varTop) - } - if b.minNonVar == 0 || p < b.minNonVar { - b.minNonVar = p - } - } - } - elems, err := convertLargeWeights(elems) - if err != nil { - return err - } - cccs := []uint8{} - nfd := norm.NFD.String(str) - for i := range nfd { - cccs = append(cccs, norm.NFD.PropertiesString(nfd[i:]).CCC()) - } - if len(cccs) < len(elems) { - if len(cccs) > 2 { - return fmt.Errorf("number of decomposed characters should be greater or equal to the number of collation elements for len(colelems) > 3 (%d < %d)", len(cccs), len(elems)) - } - p := len(elems) - 1 - for ; p > 0 && elems[p].w[0] == 0; p-- { - elems[p].ccc = cccs[len(cccs)-1] - } - for ; p >= 0; p-- { - elems[p].ccc = cccs[0] - } - } else { - for i := range elems { - elems[i].ccc = cccs[i] - } - } - // doNorm in collate.go assumes that the following conditions hold. - if len(elems) > 1 && len(cccs) > 1 && cccs[0] != 0 && cccs[0] != cccs[len(cccs)-1] { - return fmt.Errorf("incompatible CCC values for expansion %X (%d)", runes, cccs) - } - b.root.newEntry(str, elems) - return nil -} - -func (t *Tailoring) setAnchor(anchor string) error { - anchor = norm.NFC.String(anchor) - a := t.index.find(anchor) - if a == nil { - a = t.index.newEntry(anchor, nil) - a.implicit = true - a.modified = true - for _, r := range []rune(anchor) { - e := t.index.find(string(r)) - e.lock = true - } - } - t.anchor = a - return nil -} - -// SetAnchor sets the point after which elements passed in subsequent calls to -// Insert will be inserted. It is equivalent to the reset directive in an LDML -// specification. See Insert for an example. -// SetAnchor supports the following logical reset positions: -// <first_tertiary_ignorable/>, <last_teriary_ignorable/>, <first_primary_ignorable/>, -// and <last_non_ignorable/>. -func (t *Tailoring) SetAnchor(anchor string) error { - if err := t.setAnchor(anchor); err != nil { - return err - } - t.before = false - return nil -} - -// SetAnchorBefore is similar to SetAnchor, except that subsequent calls to -// Insert will insert entries before the anchor. -func (t *Tailoring) SetAnchorBefore(anchor string) error { - if err := t.setAnchor(anchor); err != nil { - return err - } - t.before = true - return nil -} - -// Insert sets the ordering of str relative to the entry set by the previous -// call to SetAnchor or Insert. The argument extend corresponds -// to the extend elements as defined in LDML. A non-empty value for extend -// will cause the collation elements corresponding to extend to be appended -// to the collation elements generated for the entry added by Insert. -// This has the same net effect as sorting str after the string anchor+extend. -// See http://www.unicode.org/reports/tr10/#Tailoring_Example for details -// on parametric tailoring and http://unicode.org/reports/tr35/#Collation_Elements -// for full details on LDML. -// -// Examples: create a tailoring for Swedish, where "ä" is ordered after "z" -// at the primary sorting level: -// t := b.Tailoring("se") -// t.SetAnchor("z") -// t.Insert(colltab.Primary, "ä", "") -// Order "ü" after "ue" at the secondary sorting level: -// t.SetAnchor("ue") -// t.Insert(colltab.Secondary, "ü","") -// or -// t.SetAnchor("u") -// t.Insert(colltab.Secondary, "ü", "e") -// Order "q" afer "ab" at the secondary level and "Q" after "q" -// at the tertiary level: -// t.SetAnchor("ab") -// t.Insert(colltab.Secondary, "q", "") -// t.Insert(colltab.Tertiary, "Q", "") -// Order "b" before "a": -// t.SetAnchorBefore("a") -// t.Insert(colltab.Primary, "b", "") -// Order "0" after the last primary ignorable: -// t.SetAnchor("<last_primary_ignorable/>") -// t.Insert(colltab.Primary, "0", "") -func (t *Tailoring) Insert(level colltab.Level, str, extend string) error { - if t.anchor == nil { - return fmt.Errorf("%s:Insert: no anchor point set for tailoring of %s", t.id, str) - } - str = norm.NFC.String(str) - e := t.index.find(str) - if e == nil { - e = t.index.newEntry(str, nil) - } else if e.logical != noAnchor { - return fmt.Errorf("%s:Insert: cannot reinsert logical reset position %q", t.id, e.str) - } - if e.lock { - return fmt.Errorf("%s:Insert: cannot reinsert element %q", t.id, e.str) - } - a := t.anchor - // Find the first element after the anchor which differs at a level smaller or - // equal to the given level. Then insert at this position. - // See http://unicode.org/reports/tr35/#Collation_Elements, Section 5.14.5 for details. - e.before = t.before - if t.before { - t.before = false - if a.prev == nil { - a.insertBefore(e) - } else { - for a = a.prev; a.level > level; a = a.prev { - } - a.insertAfter(e) - } - e.level = level - } else { - for ; a.level > level; a = a.next { - } - e.level = a.level - if a != e { - a.insertAfter(e) - a.level = level - } else { - // We don't set a to prev itself. This has the effect of the entry - // getting new collation elements that are an increment of itself. - // This is intentional. - a.prev.level = level - } - } - e.extend = norm.NFD.String(extend) - e.exclude = false - e.modified = true - e.elems = nil - t.anchor = e - return nil -} - -func (o *ordering) getWeight(e *entry) []rawCE { - if len(e.elems) == 0 && e.logical == noAnchor { - if e.implicit { - for _, r := range e.runes { - e.elems = append(e.elems, o.getWeight(o.find(string(r)))...) - } - } else if e.before { - count := [colltab.Identity + 1]int{} - a := e - for ; a.elems == nil && !a.implicit; a = a.next { - count[a.level]++ - } - e.elems = []rawCE{makeRawCE(a.elems[0].w, a.elems[0].ccc)} - for i := colltab.Primary; i < colltab.Quaternary; i++ { - if count[i] != 0 { - e.elems[0].w[i] -= count[i] - break - } - } - if e.prev != nil { - o.verifyWeights(e.prev, e, e.prev.level) - } - } else { - prev := e.prev - e.elems = nextWeight(prev.level, o.getWeight(prev)) - o.verifyWeights(e, e.next, e.level) - } - } - return e.elems -} - -func (o *ordering) addExtension(e *entry) { - if ex := o.find(e.extend); ex != nil { - e.elems = append(e.elems, ex.elems...) - } else { - for _, r := range []rune(e.extend) { - e.elems = append(e.elems, o.find(string(r)).elems...) - } - } - e.extend = "" -} - -func (o *ordering) verifyWeights(a, b *entry, level colltab.Level) error { - if level == colltab.Identity || b == nil || b.elems == nil || a.elems == nil { - return nil - } - for i := colltab.Primary; i < level; i++ { - if a.elems[0].w[i] < b.elems[0].w[i] { - return nil - } - } - if a.elems[0].w[level] >= b.elems[0].w[level] { - err := fmt.Errorf("%s:overflow: collation elements of %q (%X) overflows those of %q (%X) at level %d (%X >= %X)", o.id, a.str, a.runes, b.str, b.runes, level, a.elems, b.elems) - log.Println(err) - // TODO: return the error instead, or better, fix the conflicting entry by making room. - } - return nil -} - -func (b *Builder) error(e error) { - if e != nil { - b.err = e - } -} - -func (b *Builder) errorID(locale string, e error) { - if e != nil { - b.err = fmt.Errorf("%s:%v", locale, e) - } -} - -// patchNorm ensures that NFC and NFD counterparts are consistent. -func (o *ordering) patchNorm() { - // Insert the NFD counterparts, if necessary. - for _, e := range o.ordered { - nfd := norm.NFD.String(e.str) - if nfd != e.str { - if e0 := o.find(nfd); e0 != nil && !e0.modified { - e0.elems = e.elems - } else if e.modified && !equalCEArrays(o.genColElems(nfd), e.elems) { - e := o.newEntry(nfd, e.elems) - e.modified = true - } - } - } - // Update unchanged composed forms if one of their parts changed. - for _, e := range o.ordered { - nfd := norm.NFD.String(e.str) - if e.modified || nfd == e.str { - continue - } - if e0 := o.find(nfd); e0 != nil { - e.elems = e0.elems - } else { - e.elems = o.genColElems(nfd) - if norm.NFD.LastBoundary([]byte(nfd)) == 0 { - r := []rune(nfd) - head := string(r[0]) - tail := "" - for i := 1; i < len(r); i++ { - s := norm.NFC.String(head + string(r[i])) - if e0 := o.find(s); e0 != nil && e0.modified { - head = s - } else { - tail += string(r[i]) - } - } - e.elems = append(o.genColElems(head), o.genColElems(tail)...) - } - } - } - // Exclude entries for which the individual runes generate the same collation elements. - for _, e := range o.ordered { - if len(e.runes) > 1 && equalCEArrays(o.genColElems(e.str), e.elems) { - e.exclude = true - } - } -} - -func (b *Builder) buildOrdering(o *ordering) { - for _, e := range o.ordered { - o.getWeight(e) - } - for _, e := range o.ordered { - o.addExtension(e) - } - o.patchNorm() - o.sort() - simplify(o) - b.processExpansions(o) // requires simplify - b.processContractions(o) // requires simplify - - t := newNode() - for e := o.front(); e != nil; e, _ = e.nextIndexed() { - if !e.skip() { - ce, err := e.encode() - b.errorID(o.id, err) - t.insert(e.runes[0], ce) - } - } - o.handle = b.index.addTrie(t) -} - -func (b *Builder) build() (*table, error) { - if b.built { - return b.t, b.err - } - b.built = true - b.t = &table{ - Table: colltab.Table{ - MaxContractLen: utf8.UTFMax, - VariableTop: uint32(b.varTop), - }, - } - - b.buildOrdering(&b.root) - b.t.root = b.root.handle - for _, t := range b.locale { - b.buildOrdering(t.index) - if b.err != nil { - break - } - } - i, err := b.index.generate() - b.t.trie = *i - b.t.Index = colltab.Trie{ - Index: i.index, - Values: i.values, - Index0: i.index[blockSize*b.t.root.lookupStart:], - Values0: i.values[blockSize*b.t.root.valueStart:], - } - b.error(err) - return b.t, b.err -} - -// Build builds the root Collator. -func (b *Builder) Build() (colltab.Weighter, error) { - table, err := b.build() - if err != nil { - return nil, err - } - return table, nil -} - -// Build builds a Collator for Tailoring t. -func (t *Tailoring) Build() (colltab.Weighter, error) { - // TODO: implement. - return nil, nil -} - -// Print prints the tables for b and all its Tailorings as a Go file -// that can be included in the Collate package. -func (b *Builder) Print(w io.Writer) (n int, err error) { - p := func(nn int, e error) { - n += nn - if err == nil { - err = e - } - } - t, err := b.build() - if err != nil { - return 0, err - } - p(fmt.Fprintf(w, `var availableLocales = "und`)) - for _, loc := range b.locale { - if loc.id != "und" { - p(fmt.Fprintf(w, ",%s", loc.id)) - } - } - p(fmt.Fprint(w, "\"\n\n")) - p(fmt.Fprintf(w, "const varTop = 0x%x\n\n", b.varTop)) - p(fmt.Fprintln(w, "var locales = [...]tableIndex{")) - for _, loc := range b.locale { - if loc.id == "und" { - p(t.fprintIndex(w, loc.index.handle, loc.id)) - } - } - for _, loc := range b.locale { - if loc.id != "und" { - p(t.fprintIndex(w, loc.index.handle, loc.id)) - } - } - p(fmt.Fprint(w, "}\n\n")) - n, _, err = t.fprint(w, "main") - return -} - -// reproducibleFromNFKD checks whether the given expansion could be generated -// from an NFKD expansion. -func reproducibleFromNFKD(e *entry, exp, nfkd []rawCE) bool { - // Length must be equal. - if len(exp) != len(nfkd) { - return false - } - for i, ce := range exp { - // Primary and secondary values should be equal. - if ce.w[0] != nfkd[i].w[0] || ce.w[1] != nfkd[i].w[1] { - return false - } - // Tertiary values should be equal to maxTertiary for third element onwards. - // TODO: there seem to be a lot of cases in CLDR (e.g. ㏭ in zh.xml) that can - // simply be dropped. Try this out by dropping the following code. - if i >= 2 && ce.w[2] != maxTertiary { - return false - } - if _, err := makeCE(ce); err != nil { - // Simply return false. The error will be caught elsewhere. - return false - } - } - return true -} - -func simplify(o *ordering) { - // Runes that are a starter of a contraction should not be removed. - // (To date, there is only Kannada character 0CCA.) - keep := make(map[rune]bool) - for e := o.front(); e != nil; e, _ = e.nextIndexed() { - if len(e.runes) > 1 { - keep[e.runes[0]] = true - } - } - // Tag entries for which the runes NFKD decompose to identical values. - for e := o.front(); e != nil; e, _ = e.nextIndexed() { - s := e.str - nfkd := norm.NFKD.String(s) - nfd := norm.NFD.String(s) - if e.decompose || len(e.runes) > 1 || len(e.elems) == 1 || keep[e.runes[0]] || nfkd == nfd { - continue - } - if reproducibleFromNFKD(e, e.elems, o.genColElems(nfkd)) { - e.decompose = true - } - } -} - -// appendExpansion converts the given collation sequence to -// collation elements and adds them to the expansion table. -// It returns an index to the expansion table. -func (b *Builder) appendExpansion(e *entry) int { - t := b.t - i := len(t.ExpandElem) - ce := uint32(len(e.elems)) - t.ExpandElem = append(t.ExpandElem, ce) - for _, w := range e.elems { - ce, err := makeCE(w) - if err != nil { - b.error(err) - return -1 - } - t.ExpandElem = append(t.ExpandElem, ce) - } - return i -} - -// processExpansions extracts data necessary to generate -// the extraction tables. -func (b *Builder) processExpansions(o *ordering) { - for e := o.front(); e != nil; e, _ = e.nextIndexed() { - if !e.expansion() { - continue - } - key := fmt.Sprintf("%v", e.elems) - i, ok := b.expIndex[key] - if !ok { - i = b.appendExpansion(e) - b.expIndex[key] = i - } - e.expansionIndex = i - } -} - -func (b *Builder) processContractions(o *ordering) { - // Collate contractions per starter rune. - starters := []rune{} - cm := make(map[rune][]*entry) - for e := o.front(); e != nil; e, _ = e.nextIndexed() { - if e.contraction() { - if len(e.str) > b.t.MaxContractLen { - b.t.MaxContractLen = len(e.str) - } - r := e.runes[0] - if _, ok := cm[r]; !ok { - starters = append(starters, r) - } - cm[r] = append(cm[r], e) - } - } - // Add entries of single runes that are at a start of a contraction. - for e := o.front(); e != nil; e, _ = e.nextIndexed() { - if !e.contraction() { - r := e.runes[0] - if _, ok := cm[r]; ok { - cm[r] = append(cm[r], e) - } - } - } - // Build the tries for the contractions. - t := b.t - for _, r := range starters { - l := cm[r] - // Compute suffix strings. There are 31 different contraction suffix - // sets for 715 contractions and 82 contraction starter runes as of - // version 6.0.0. - sufx := []string{} - hasSingle := false - for _, e := range l { - if len(e.runes) > 1 { - sufx = append(sufx, string(e.runes[1:])) - } else { - hasSingle = true - } - } - if !hasSingle { - b.error(fmt.Errorf("no single entry for starter rune %U found", r)) - continue - } - // Unique the suffix set. - sort.Strings(sufx) - key := strings.Join(sufx, "\n") - handle, ok := b.ctHandle[key] - if !ok { - var err error - handle, err = appendTrie(&t.ContractTries, sufx) - if err != nil { - b.error(err) - } - b.ctHandle[key] = handle - } - // Bucket sort entries in index order. - es := make([]*entry, len(l)) - for _, e := range l { - var p, sn int - if len(e.runes) > 1 { - str := []byte(string(e.runes[1:])) - p, sn = lookup(&t.ContractTries, handle, str) - if sn != len(str) { - log.Fatalf("%s: processContractions: unexpected length for '%X'; len=%d; want %d", o.id, e.runes, sn, len(str)) - } - } - if es[p] != nil { - log.Fatalf("%s: multiple contractions for position %d for rune %U", o.id, p, e.runes[0]) - } - es[p] = e - } - // Create collation elements for contractions. - elems := []uint32{} - for _, e := range es { - ce, err := e.encodeBase() - b.errorID(o.id, err) - elems = append(elems, ce) - } - key = fmt.Sprintf("%v", elems) - i, ok := b.ctElem[key] - if !ok { - i = len(t.ContractElem) - b.ctElem[key] = i - t.ContractElem = append(t.ContractElem, elems...) - } - // Store info in entry for starter rune. - es[0].contractionIndex = i - es[0].contractionHandle = handle - } -} diff --git a/vendor/golang.org/x/text/collate/build/colelem.go b/vendor/golang.org/x/text/collate/build/colelem.go deleted file mode 100644 index 726fe5427a8c..000000000000 --- a/vendor/golang.org/x/text/collate/build/colelem.go +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package build - -import ( - "fmt" - "unicode" - - "golang.org/x/text/internal/colltab" -) - -const ( - defaultSecondary = 0x20 - defaultTertiary = 0x2 - maxTertiary = 0x1F -) - -type rawCE struct { - w []int - ccc uint8 -} - -func makeRawCE(w []int, ccc uint8) rawCE { - ce := rawCE{w: make([]int, 4), ccc: ccc} - copy(ce.w, w) - return ce -} - -// A collation element is represented as an uint32. -// In the typical case, a rune maps to a single collation element. If a rune -// can be the start of a contraction or expands into multiple collation elements, -// then the collation element that is associated with a rune will have a special -// form to represent such m to n mappings. Such special collation elements -// have a value >= 0x80000000. - -const ( - maxPrimaryBits = 21 - maxSecondaryBits = 12 - maxTertiaryBits = 8 -) - -func makeCE(ce rawCE) (uint32, error) { - v, e := colltab.MakeElem(ce.w[0], ce.w[1], ce.w[2], ce.ccc) - return uint32(v), e -} - -// For contractions, collation elements are of the form -// 110bbbbb bbbbbbbb iiiiiiii iiiinnnn, where -// - n* is the size of the first node in the contraction trie. -// - i* is the index of the first node in the contraction trie. -// - b* is the offset into the contraction collation element table. -// See contract.go for details on the contraction trie. -const ( - contractID = 0xC0000000 - maxNBits = 4 - maxTrieIndexBits = 12 - maxContractOffsetBits = 13 -) - -func makeContractIndex(h ctHandle, offset int) (uint32, error) { - if h.n >= 1<<maxNBits { - return 0, fmt.Errorf("size of contraction trie node too large: %d >= %d", h.n, 1<<maxNBits) - } - if h.index >= 1<<maxTrieIndexBits { - return 0, fmt.Errorf("size of contraction trie offset too large: %d >= %d", h.index, 1<<maxTrieIndexBits) - } - if offset >= 1<<maxContractOffsetBits { - return 0, fmt.Errorf("contraction offset out of bounds: %x >= %x", offset, 1<<maxContractOffsetBits) - } - ce := uint32(contractID) - ce += uint32(offset << (maxNBits + maxTrieIndexBits)) - ce += uint32(h.index << maxNBits) - ce += uint32(h.n) - return ce, nil -} - -// For expansions, collation elements are of the form -// 11100000 00000000 bbbbbbbb bbbbbbbb, -// where b* is the index into the expansion sequence table. -const ( - expandID = 0xE0000000 - maxExpandIndexBits = 16 -) - -func makeExpandIndex(index int) (uint32, error) { - if index >= 1<<maxExpandIndexBits { - return 0, fmt.Errorf("expansion index out of bounds: %x >= %x", index, 1<<maxExpandIndexBits) - } - return expandID + uint32(index), nil -} - -// Each list of collation elements corresponding to an expansion starts with -// a header indicating the length of the sequence. -func makeExpansionHeader(n int) (uint32, error) { - return uint32(n), nil -} - -// Some runes can be expanded using NFKD decomposition. Instead of storing the full -// sequence of collation elements, we decompose the rune and lookup the collation -// elements for each rune in the decomposition and modify the tertiary weights. -// The collation element, in this case, is of the form -// 11110000 00000000 wwwwwwww vvvvvvvv, where -// - v* is the replacement tertiary weight for the first rune, -// - w* is the replacement tertiary weight for the second rune, -// Tertiary weights of subsequent runes should be replaced with maxTertiary. -// See http://www.unicode.org/reports/tr10/#Compatibility_Decompositions for more details. -const ( - decompID = 0xF0000000 -) - -func makeDecompose(t1, t2 int) (uint32, error) { - if t1 >= 256 || t1 < 0 { - return 0, fmt.Errorf("first tertiary weight out of bounds: %d >= 256", t1) - } - if t2 >= 256 || t2 < 0 { - return 0, fmt.Errorf("second tertiary weight out of bounds: %d >= 256", t2) - } - return uint32(t2<<8+t1) + decompID, nil -} - -const ( - // These constants were taken from http://www.unicode.org/versions/Unicode6.0.0/ch12.pdf. - minUnified rune = 0x4E00 - maxUnified = 0x9FFF - minCompatibility = 0xF900 - maxCompatibility = 0xFAFF - minRare = 0x3400 - maxRare = 0x4DBF -) -const ( - commonUnifiedOffset = 0x10000 - rareUnifiedOffset = 0x20000 // largest rune in common is U+FAFF - otherOffset = 0x50000 // largest rune in rare is U+2FA1D - illegalOffset = otherOffset + int(unicode.MaxRune) - maxPrimary = illegalOffset + 1 -) - -// implicitPrimary returns the primary weight for the a rune -// for which there is no entry for the rune in the collation table. -// We take a different approach from the one specified in -// http://unicode.org/reports/tr10/#Implicit_Weights, -// but preserve the resulting relative ordering of the runes. -func implicitPrimary(r rune) int { - if unicode.Is(unicode.Ideographic, r) { - if r >= minUnified && r <= maxUnified { - // The most common case for CJK. - return int(r) + commonUnifiedOffset - } - if r >= minCompatibility && r <= maxCompatibility { - // This will typically not hit. The DUCET explicitly specifies mappings - // for all characters that do not decompose. - return int(r) + commonUnifiedOffset - } - return int(r) + rareUnifiedOffset - } - return int(r) + otherOffset -} - -// convertLargeWeights converts collation elements with large -// primaries (either double primaries or for illegal runes) -// to our own representation. -// A CJK character C is represented in the DUCET as -// [.FBxx.0020.0002.C][.BBBB.0000.0000.C] -// We will rewrite these characters to a single CE. -// We assume the CJK values start at 0x8000. -// See http://unicode.org/reports/tr10/#Implicit_Weights -func convertLargeWeights(elems []rawCE) (res []rawCE, err error) { - const ( - cjkPrimaryStart = 0xFB40 - rarePrimaryStart = 0xFB80 - otherPrimaryStart = 0xFBC0 - illegalPrimary = 0xFFFE - highBitsMask = 0x3F - lowBitsMask = 0x7FFF - lowBitsFlag = 0x8000 - shiftBits = 15 - ) - for i := 0; i < len(elems); i++ { - ce := elems[i].w - p := ce[0] - if p < cjkPrimaryStart { - continue - } - if p > 0xFFFF { - return elems, fmt.Errorf("found primary weight %X; should be <= 0xFFFF", p) - } - if p >= illegalPrimary { - ce[0] = illegalOffset + p - illegalPrimary - } else { - if i+1 >= len(elems) { - return elems, fmt.Errorf("second part of double primary weight missing: %v", elems) - } - if elems[i+1].w[0]&lowBitsFlag == 0 { - return elems, fmt.Errorf("malformed second part of double primary weight: %v", elems) - } - np := ((p & highBitsMask) << shiftBits) + elems[i+1].w[0]&lowBitsMask - switch { - case p < rarePrimaryStart: - np += commonUnifiedOffset - case p < otherPrimaryStart: - np += rareUnifiedOffset - default: - p += otherOffset - } - ce[0] = np - for j := i + 1; j+1 < len(elems); j++ { - elems[j] = elems[j+1] - } - elems = elems[:len(elems)-1] - } - } - return elems, nil -} - -// nextWeight computes the first possible collation weights following elems -// for the given level. -func nextWeight(level colltab.Level, elems []rawCE) []rawCE { - if level == colltab.Identity { - next := make([]rawCE, len(elems)) - copy(next, elems) - return next - } - next := []rawCE{makeRawCE(elems[0].w, elems[0].ccc)} - next[0].w[level]++ - if level < colltab.Secondary { - next[0].w[colltab.Secondary] = defaultSecondary - } - if level < colltab.Tertiary { - next[0].w[colltab.Tertiary] = defaultTertiary - } - // Filter entries that cannot influence ordering. - for _, ce := range elems[1:] { - skip := true - for i := colltab.Primary; i < level; i++ { - skip = skip && ce.w[i] == 0 - } - if !skip { - next = append(next, ce) - } - } - return next -} - -func nextVal(elems []rawCE, i int, level colltab.Level) (index, value int) { - for ; i < len(elems) && elems[i].w[level] == 0; i++ { - } - if i < len(elems) { - return i, elems[i].w[level] - } - return i, 0 -} - -// compareWeights returns -1 if a < b, 1 if a > b, or 0 otherwise. -// It also returns the collation level at which the difference is found. -func compareWeights(a, b []rawCE) (result int, level colltab.Level) { - for level := colltab.Primary; level < colltab.Identity; level++ { - var va, vb int - for ia, ib := 0, 0; ia < len(a) || ib < len(b); ia, ib = ia+1, ib+1 { - ia, va = nextVal(a, ia, level) - ib, vb = nextVal(b, ib, level) - if va != vb { - if va < vb { - return -1, level - } else { - return 1, level - } - } - } - } - return 0, colltab.Identity -} - -func equalCE(a, b rawCE) bool { - for i := 0; i < 3; i++ { - if b.w[i] != a.w[i] { - return false - } - } - return true -} - -func equalCEArrays(a, b []rawCE) bool { - if len(a) != len(b) { - return false - } - for i := range a { - if !equalCE(a[i], b[i]) { - return false - } - } - return true -} diff --git a/vendor/golang.org/x/text/collate/build/contract.go b/vendor/golang.org/x/text/collate/build/contract.go deleted file mode 100644 index a6a7e01f8d5d..000000000000 --- a/vendor/golang.org/x/text/collate/build/contract.go +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package build - -import ( - "fmt" - "io" - "reflect" - "sort" - "strings" - - "golang.org/x/text/internal/colltab" -) - -// This file contains code for detecting contractions and generating -// the necessary tables. -// Any Unicode Collation Algorithm (UCA) table entry that has more than -// one rune one the left-hand side is called a contraction. -// See http://www.unicode.org/reports/tr10/#Contractions for more details. -// -// We define the following terms: -// initial: a rune that appears as the first rune in a contraction. -// suffix: a sequence of runes succeeding the initial rune -// in a given contraction. -// non-initial: a rune that appears in a suffix. -// -// A rune may be both an initial and a non-initial and may be so in -// many contractions. An initial may typically also appear by itself. -// In case of ambiguities, the UCA requires we match the longest -// contraction. -// -// Many contraction rules share the same set of possible suffixes. -// We store sets of suffixes in a trie that associates an index with -// each suffix in the set. This index can be used to look up a -// collation element associated with the (starter rune, suffix) pair. -// -// The trie is defined on a UTF-8 byte sequence. -// The overall trie is represented as an array of ctEntries. Each node of the trie -// is represented as a subsequence of ctEntries, where each entry corresponds to -// a possible match of a next character in the search string. An entry -// also includes the length and offset to the next sequence of entries -// to check in case of a match. - -const ( - final = 0 - noIndex = 0xFF -) - -// ctEntry associates to a matching byte an offset and/or next sequence of -// bytes to check. A ctEntry c is called final if a match means that the -// longest suffix has been found. An entry c is final if c.N == 0. -// A single final entry can match a range of characters to an offset. -// A non-final entry always matches a single byte. Note that a non-final -// entry might still resemble a completed suffix. -// Examples: -// The suffix strings "ab" and "ac" can be represented as: -// []ctEntry{ -// {'a', 1, 1, noIndex}, // 'a' by itself does not match, so i is 0xFF. -// {'b', 'c', 0, 1}, // "ab" -> 1, "ac" -> 2 -// } -// -// The suffix strings "ab", "abc", "abd", and "abcd" can be represented as: -// []ctEntry{ -// {'a', 1, 1, noIndex}, // 'a' must be followed by 'b'. -// {'b', 1, 2, 1}, // "ab" -> 1, may be followed by 'c' or 'd'. -// {'d', 'd', final, 3}, // "abd" -> 3 -// {'c', 4, 1, 2}, // "abc" -> 2, may be followed by 'd'. -// {'d', 'd', final, 4}, // "abcd" -> 4 -// } -// See genStateTests in contract_test.go for more examples. -type ctEntry struct { - L uint8 // non-final: byte value to match; final: lowest match in range. - H uint8 // non-final: relative index to next block; final: highest match in range. - N uint8 // non-final: length of next block; final: final - I uint8 // result offset. Will be noIndex if more bytes are needed to complete. -} - -// contractTrieSet holds a set of contraction tries. The tries are stored -// consecutively in the entry field. -type contractTrieSet []struct{ l, h, n, i uint8 } - -// ctHandle is used to identify a trie in the trie set, consisting in an offset -// in the array and the size of the first node. -type ctHandle struct { - index, n int -} - -// appendTrie adds a new trie for the given suffixes to the trie set and returns -// a handle to it. The handle will be invalid on error. -func appendTrie(ct *colltab.ContractTrieSet, suffixes []string) (ctHandle, error) { - es := make([]stridx, len(suffixes)) - for i, s := range suffixes { - es[i].str = s - } - sort.Sort(offsetSort(es)) - for i := range es { - es[i].index = i + 1 - } - sort.Sort(genidxSort(es)) - i := len(*ct) - n, err := genStates(ct, es) - if err != nil { - *ct = (*ct)[:i] - return ctHandle{}, err - } - return ctHandle{i, n}, nil -} - -// genStates generates ctEntries for a given suffix set and returns -// the number of entries for the first node. -func genStates(ct *colltab.ContractTrieSet, sis []stridx) (int, error) { - if len(sis) == 0 { - return 0, fmt.Errorf("genStates: list of suffices must be non-empty") - } - start := len(*ct) - // create entries for differing first bytes. - for _, si := range sis { - s := si.str - if len(s) == 0 { - continue - } - added := false - c := s[0] - if len(s) > 1 { - for j := len(*ct) - 1; j >= start; j-- { - if (*ct)[j].L == c { - added = true - break - } - } - if !added { - *ct = append(*ct, ctEntry{L: c, I: noIndex}) - } - } else { - for j := len(*ct) - 1; j >= start; j-- { - // Update the offset for longer suffixes with the same byte. - if (*ct)[j].L == c { - (*ct)[j].I = uint8(si.index) - added = true - } - // Extend range of final ctEntry, if possible. - if (*ct)[j].H+1 == c { - (*ct)[j].H = c - added = true - } - } - if !added { - *ct = append(*ct, ctEntry{L: c, H: c, N: final, I: uint8(si.index)}) - } - } - } - n := len(*ct) - start - // Append nodes for the remainder of the suffixes for each ctEntry. - sp := 0 - for i, end := start, len(*ct); i < end; i++ { - fe := (*ct)[i] - if fe.H == 0 { // uninitialized non-final - ln := len(*ct) - start - n - if ln > 0xFF { - return 0, fmt.Errorf("genStates: relative block offset too large: %d > 255", ln) - } - fe.H = uint8(ln) - // Find first non-final strings with same byte as current entry. - for ; sis[sp].str[0] != fe.L; sp++ { - } - se := sp + 1 - for ; se < len(sis) && len(sis[se].str) > 1 && sis[se].str[0] == fe.L; se++ { - } - sl := sis[sp:se] - sp = se - for i, si := range sl { - sl[i].str = si.str[1:] - } - nn, err := genStates(ct, sl) - if err != nil { - return 0, err - } - fe.N = uint8(nn) - (*ct)[i] = fe - } - } - sort.Sort(entrySort((*ct)[start : start+n])) - return n, nil -} - -// There may be both a final and non-final entry for a byte if the byte -// is implied in a range of matches in the final entry. -// We need to ensure that the non-final entry comes first in that case. -type entrySort colltab.ContractTrieSet - -func (fe entrySort) Len() int { return len(fe) } -func (fe entrySort) Swap(i, j int) { fe[i], fe[j] = fe[j], fe[i] } -func (fe entrySort) Less(i, j int) bool { - return fe[i].L > fe[j].L -} - -// stridx is used for sorting suffixes and their associated offsets. -type stridx struct { - str string - index int -} - -// For computing the offsets, we first sort by size, and then by string. -// This ensures that strings that only differ in the last byte by 1 -// are sorted consecutively in increasing order such that they can -// be packed as a range in a final ctEntry. -type offsetSort []stridx - -func (si offsetSort) Len() int { return len(si) } -func (si offsetSort) Swap(i, j int) { si[i], si[j] = si[j], si[i] } -func (si offsetSort) Less(i, j int) bool { - if len(si[i].str) != len(si[j].str) { - return len(si[i].str) > len(si[j].str) - } - return si[i].str < si[j].str -} - -// For indexing, we want to ensure that strings are sorted in string order, where -// for strings with the same prefix, we put longer strings before shorter ones. -type genidxSort []stridx - -func (si genidxSort) Len() int { return len(si) } -func (si genidxSort) Swap(i, j int) { si[i], si[j] = si[j], si[i] } -func (si genidxSort) Less(i, j int) bool { - if strings.HasPrefix(si[j].str, si[i].str) { - return false - } - if strings.HasPrefix(si[i].str, si[j].str) { - return true - } - return si[i].str < si[j].str -} - -// lookup matches the longest suffix in str and returns the associated offset -// and the number of bytes consumed. -func lookup(ct *colltab.ContractTrieSet, h ctHandle, str []byte) (index, ns int) { - states := (*ct)[h.index:] - p := 0 - n := h.n - for i := 0; i < n && p < len(str); { - e := states[i] - c := str[p] - if c >= e.L { - if e.L == c { - p++ - if e.I != noIndex { - index, ns = int(e.I), p - } - if e.N != final { - // set to new state - i, states, n = 0, states[int(e.H)+n:], int(e.N) - } else { - return - } - continue - } else if e.N == final && c <= e.H { - p++ - return int(c-e.L) + int(e.I), p - } - } - i++ - } - return -} - -// print writes the contractTrieSet t as compilable Go code to w. It returns -// the total number of bytes written and the size of the resulting data structure in bytes. -func print(t *colltab.ContractTrieSet, w io.Writer, name string) (n, size int, err error) { - update3 := func(nn, sz int, e error) { - n += nn - if err == nil { - err = e - } - size += sz - } - update2 := func(nn int, e error) { update3(nn, 0, e) } - - update3(printArray(*t, w, name)) - update2(fmt.Fprintf(w, "var %sContractTrieSet = ", name)) - update3(printStruct(*t, w, name)) - update2(fmt.Fprintln(w)) - return -} - -func printArray(ct colltab.ContractTrieSet, w io.Writer, name string) (n, size int, err error) { - p := func(f string, a ...interface{}) { - nn, e := fmt.Fprintf(w, f, a...) - n += nn - if err == nil { - err = e - } - } - size = len(ct) * 4 - p("// %sCTEntries: %d entries, %d bytes\n", name, len(ct), size) - p("var %sCTEntries = [%d]struct{L,H,N,I uint8}{\n", name, len(ct)) - for _, fe := range ct { - p("\t{0x%X, 0x%X, %d, %d},\n", fe.L, fe.H, fe.N, fe.I) - } - p("}\n") - return -} - -func printStruct(ct colltab.ContractTrieSet, w io.Writer, name string) (n, size int, err error) { - n, err = fmt.Fprintf(w, "colltab.ContractTrieSet( %sCTEntries[:] )", name) - size = int(reflect.TypeOf(ct).Size()) - return -} diff --git a/vendor/golang.org/x/text/collate/build/order.go b/vendor/golang.org/x/text/collate/build/order.go deleted file mode 100644 index 2c568dbba3c5..000000000000 --- a/vendor/golang.org/x/text/collate/build/order.go +++ /dev/null @@ -1,393 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package build - -import ( - "fmt" - "log" - "sort" - "strings" - "unicode" - - "golang.org/x/text/internal/colltab" - "golang.org/x/text/unicode/norm" -) - -type logicalAnchor int - -const ( - firstAnchor logicalAnchor = -1 - noAnchor = 0 - lastAnchor = 1 -) - -// entry is used to keep track of a single entry in the collation element table -// during building. Examples of entries can be found in the Default Unicode -// Collation Element Table. -// See http://www.unicode.org/Public/UCA/6.0.0/allkeys.txt. -type entry struct { - str string // same as string(runes) - runes []rune - elems []rawCE // the collation elements - extend string // weights of extend to be appended to elems - before bool // weights relative to next instead of previous. - lock bool // entry is used in extension and can no longer be moved. - - // prev, next, and level are used to keep track of tailorings. - prev, next *entry - level colltab.Level // next differs at this level - skipRemove bool // do not unlink when removed - - decompose bool // can use NFKD decomposition to generate elems - exclude bool // do not include in table - implicit bool // derived, is not included in the list - modified bool // entry was modified in tailoring - logical logicalAnchor - - expansionIndex int // used to store index into expansion table - contractionHandle ctHandle - contractionIndex int // index into contraction elements -} - -func (e *entry) String() string { - return fmt.Sprintf("%X (%q) -> %X (ch:%x; ci:%d, ei:%d)", - e.runes, e.str, e.elems, e.contractionHandle, e.contractionIndex, e.expansionIndex) -} - -func (e *entry) skip() bool { - return e.contraction() -} - -func (e *entry) expansion() bool { - return !e.decompose && len(e.elems) > 1 -} - -func (e *entry) contraction() bool { - return len(e.runes) > 1 -} - -func (e *entry) contractionStarter() bool { - return e.contractionHandle.n != 0 -} - -// nextIndexed gets the next entry that needs to be stored in the table. -// It returns the entry and the collation level at which the next entry differs -// from the current entry. -// Entries that can be explicitly derived and logical reset positions are -// examples of entries that will not be indexed. -func (e *entry) nextIndexed() (*entry, colltab.Level) { - level := e.level - for e = e.next; e != nil && (e.exclude || len(e.elems) == 0); e = e.next { - if e.level < level { - level = e.level - } - } - return e, level -} - -// remove unlinks entry e from the sorted chain and clears the collation -// elements. e may not be at the front or end of the list. This should always -// be the case, as the front and end of the list are always logical anchors, -// which may not be removed. -func (e *entry) remove() { - if e.logical != noAnchor { - log.Fatalf("may not remove anchor %q", e.str) - } - // TODO: need to set e.prev.level to e.level if e.level is smaller? - e.elems = nil - if !e.skipRemove { - if e.prev != nil { - e.prev.next = e.next - } - if e.next != nil { - e.next.prev = e.prev - } - } - e.skipRemove = false -} - -// insertAfter inserts n after e. -func (e *entry) insertAfter(n *entry) { - if e == n { - panic("e == anchor") - } - if e == nil { - panic("unexpected nil anchor") - } - n.remove() - n.decompose = false // redo decomposition test - - n.next = e.next - n.prev = e - if e.next != nil { - e.next.prev = n - } - e.next = n -} - -// insertBefore inserts n before e. -func (e *entry) insertBefore(n *entry) { - if e == n { - panic("e == anchor") - } - if e == nil { - panic("unexpected nil anchor") - } - n.remove() - n.decompose = false // redo decomposition test - - n.prev = e.prev - n.next = e - if e.prev != nil { - e.prev.next = n - } - e.prev = n -} - -func (e *entry) encodeBase() (ce uint32, err error) { - switch { - case e.expansion(): - ce, err = makeExpandIndex(e.expansionIndex) - default: - if e.decompose { - log.Fatal("decompose should be handled elsewhere") - } - ce, err = makeCE(e.elems[0]) - } - return -} - -func (e *entry) encode() (ce uint32, err error) { - if e.skip() { - log.Fatal("cannot build colElem for entry that should be skipped") - } - switch { - case e.decompose: - t1 := e.elems[0].w[2] - t2 := 0 - if len(e.elems) > 1 { - t2 = e.elems[1].w[2] - } - ce, err = makeDecompose(t1, t2) - case e.contractionStarter(): - ce, err = makeContractIndex(e.contractionHandle, e.contractionIndex) - default: - if len(e.runes) > 1 { - log.Fatal("colElem: contractions are handled in contraction trie") - } - ce, err = e.encodeBase() - } - return -} - -// entryLess returns true if a sorts before b and false otherwise. -func entryLess(a, b *entry) bool { - if res, _ := compareWeights(a.elems, b.elems); res != 0 { - return res == -1 - } - if a.logical != noAnchor { - return a.logical == firstAnchor - } - if b.logical != noAnchor { - return b.logical == lastAnchor - } - return a.str < b.str -} - -type sortedEntries []*entry - -func (s sortedEntries) Len() int { - return len(s) -} - -func (s sortedEntries) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} - -func (s sortedEntries) Less(i, j int) bool { - return entryLess(s[i], s[j]) -} - -type ordering struct { - id string - entryMap map[string]*entry - ordered []*entry - handle *trieHandle -} - -// insert inserts e into both entryMap and ordered. -// Note that insert simply appends e to ordered. To reattain a sorted -// order, o.sort() should be called. -func (o *ordering) insert(e *entry) { - if e.logical == noAnchor { - o.entryMap[e.str] = e - } else { - // Use key format as used in UCA rules. - o.entryMap[fmt.Sprintf("[%s]", e.str)] = e - // Also add index entry for XML format. - o.entryMap[fmt.Sprintf("<%s/>", strings.Replace(e.str, " ", "_", -1))] = e - } - o.ordered = append(o.ordered, e) -} - -// newEntry creates a new entry for the given info and inserts it into -// the index. -func (o *ordering) newEntry(s string, ces []rawCE) *entry { - e := &entry{ - runes: []rune(s), - elems: ces, - str: s, - } - o.insert(e) - return e -} - -// find looks up and returns the entry for the given string. -// It returns nil if str is not in the index and if an implicit value -// cannot be derived, that is, if str represents more than one rune. -func (o *ordering) find(str string) *entry { - e := o.entryMap[str] - if e == nil { - r := []rune(str) - if len(r) == 1 { - const ( - firstHangul = 0xAC00 - lastHangul = 0xD7A3 - ) - if r[0] >= firstHangul && r[0] <= lastHangul { - ce := []rawCE{} - nfd := norm.NFD.String(str) - for _, r := range nfd { - ce = append(ce, o.find(string(r)).elems...) - } - e = o.newEntry(nfd, ce) - } else { - e = o.newEntry(string(r[0]), []rawCE{ - {w: []int{ - implicitPrimary(r[0]), - defaultSecondary, - defaultTertiary, - int(r[0]), - }, - }, - }) - e.modified = true - } - e.exclude = true // do not index implicits - } - } - return e -} - -// makeRootOrdering returns a newly initialized ordering value and populates -// it with a set of logical reset points that can be used as anchors. -// The anchors first_tertiary_ignorable and __END__ will always sort at -// the beginning and end, respectively. This means that prev and next are non-nil -// for any indexed entry. -func makeRootOrdering() ordering { - const max = unicode.MaxRune - o := ordering{ - entryMap: make(map[string]*entry), - } - insert := func(typ logicalAnchor, s string, ce []int) { - e := &entry{ - elems: []rawCE{{w: ce}}, - str: s, - exclude: true, - logical: typ, - } - o.insert(e) - } - insert(firstAnchor, "first tertiary ignorable", []int{0, 0, 0, 0}) - insert(lastAnchor, "last tertiary ignorable", []int{0, 0, 0, max}) - insert(lastAnchor, "last primary ignorable", []int{0, defaultSecondary, defaultTertiary, max}) - insert(lastAnchor, "last non ignorable", []int{maxPrimary, defaultSecondary, defaultTertiary, max}) - insert(lastAnchor, "__END__", []int{1 << maxPrimaryBits, defaultSecondary, defaultTertiary, max}) - return o -} - -// patchForInsert eleminates entries from the list with more than one collation element. -// The next and prev fields of the eliminated entries still point to appropriate -// values in the newly created list. -// It requires that sort has been called. -func (o *ordering) patchForInsert() { - for i := 0; i < len(o.ordered)-1; { - e := o.ordered[i] - lev := e.level - n := e.next - for ; n != nil && len(n.elems) > 1; n = n.next { - if n.level < lev { - lev = n.level - } - n.skipRemove = true - } - for ; o.ordered[i] != n; i++ { - o.ordered[i].level = lev - o.ordered[i].next = n - o.ordered[i+1].prev = e - } - } -} - -// clone copies all ordering of es into a new ordering value. -func (o *ordering) clone() *ordering { - o.sort() - oo := ordering{ - entryMap: make(map[string]*entry), - } - for _, e := range o.ordered { - ne := &entry{ - runes: e.runes, - elems: e.elems, - str: e.str, - decompose: e.decompose, - exclude: e.exclude, - logical: e.logical, - } - oo.insert(ne) - } - oo.sort() // link all ordering. - oo.patchForInsert() - return &oo -} - -// front returns the first entry to be indexed. -// It assumes that sort() has been called. -func (o *ordering) front() *entry { - e := o.ordered[0] - if e.prev != nil { - log.Panicf("unexpected first entry: %v", e) - } - // The first entry is always a logical position, which should not be indexed. - e, _ = e.nextIndexed() - return e -} - -// sort sorts all ordering based on their collation elements and initializes -// the prev, next, and level fields accordingly. -func (o *ordering) sort() { - sort.Sort(sortedEntries(o.ordered)) - l := o.ordered - for i := 1; i < len(l); i++ { - k := i - 1 - l[k].next = l[i] - _, l[k].level = compareWeights(l[k].elems, l[i].elems) - l[i].prev = l[k] - } -} - -// genColElems generates a collation element array from the runes in str. This -// assumes that all collation elements have already been added to the Builder. -func (o *ordering) genColElems(str string) []rawCE { - elems := []rawCE{} - for _, r := range []rune(str) { - for _, ce := range o.find(string(r)).elems { - if ce.w[0] != 0 || ce.w[1] != 0 || ce.w[2] != 0 { - elems = append(elems, ce) - } - } - } - return elems -} diff --git a/vendor/golang.org/x/text/collate/build/table.go b/vendor/golang.org/x/text/collate/build/table.go deleted file mode 100644 index 7eea7a63f44c..000000000000 --- a/vendor/golang.org/x/text/collate/build/table.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package build - -import ( - "fmt" - "io" - "reflect" - - "golang.org/x/text/internal/colltab" -) - -// table is an intermediate structure that roughly resembles the table in collate. -type table struct { - colltab.Table - trie trie - root *trieHandle -} - -// print writes the table as Go compilable code to w. It prefixes the -// variable names with name. It returns the number of bytes written -// and the size of the resulting table. -func (t *table) fprint(w io.Writer, name string) (n, size int, err error) { - update := func(nn, sz int, e error) { - n += nn - if err == nil { - err = e - } - size += sz - } - // Write arrays needed for the structure. - update(printColElems(w, t.ExpandElem, name+"ExpandElem")) - update(printColElems(w, t.ContractElem, name+"ContractElem")) - update(t.trie.printArrays(w, name)) - update(printArray(t.ContractTries, w, name)) - - nn, e := fmt.Fprintf(w, "// Total size of %sTable is %d bytes\n", name, size) - update(nn, 0, e) - return -} - -func (t *table) fprintIndex(w io.Writer, h *trieHandle, id string) (n int, err error) { - p := func(f string, a ...interface{}) { - nn, e := fmt.Fprintf(w, f, a...) - n += nn - if err == nil { - err = e - } - } - p("\t{ // %s\n", id) - p("\t\tlookupOffset: 0x%x,\n", h.lookupStart) - p("\t\tvaluesOffset: 0x%x,\n", h.valueStart) - p("\t},\n") - return -} - -func printColElems(w io.Writer, a []uint32, name string) (n, sz int, err error) { - p := func(f string, a ...interface{}) { - nn, e := fmt.Fprintf(w, f, a...) - n += nn - if err == nil { - err = e - } - } - sz = len(a) * int(reflect.TypeOf(uint32(0)).Size()) - p("// %s: %d entries, %d bytes\n", name, len(a), sz) - p("var %s = [%d]uint32 {", name, len(a)) - for i, c := range a { - switch { - case i%64 == 0: - p("\n\t// Block %d, offset 0x%x\n", i/64, i) - case (i%64)%6 == 0: - p("\n\t") - } - p("0x%.8X, ", c) - } - p("\n}\n\n") - return -} diff --git a/vendor/golang.org/x/text/collate/build/trie.go b/vendor/golang.org/x/text/collate/build/trie.go deleted file mode 100644 index 9404a3465bf4..000000000000 --- a/vendor/golang.org/x/text/collate/build/trie.go +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// The trie in this file is used to associate the first full character -// in a UTF-8 string to a collation element. -// All but the last byte in a UTF-8 byte sequence are -// used to look up offsets in the index table to be used for the next byte. -// The last byte is used to index into a table of collation elements. -// This file contains the code for the generation of the trie. - -package build - -import ( - "fmt" - "hash/fnv" - "io" - "reflect" -) - -const ( - blockSize = 64 - blockOffset = 2 // Subtract 2 blocks to compensate for the 0x80 added to continuation bytes. -) - -type trieHandle struct { - lookupStart uint16 // offset in table for first byte - valueStart uint16 // offset in table for first byte -} - -type trie struct { - index []uint16 - values []uint32 -} - -// trieNode is the intermediate trie structure used for generating a trie. -type trieNode struct { - index []*trieNode - value []uint32 - b byte - refValue uint16 - refIndex uint16 -} - -func newNode() *trieNode { - return &trieNode{ - index: make([]*trieNode, 64), - value: make([]uint32, 128), // root node size is 128 instead of 64 - } -} - -func (n *trieNode) isInternal() bool { - return n.value != nil -} - -func (n *trieNode) insert(r rune, value uint32) { - const maskx = 0x3F // mask out two most-significant bits - str := string(r) - if len(str) == 1 { - n.value[str[0]] = value - return - } - for i := 0; i < len(str)-1; i++ { - b := str[i] & maskx - if n.index == nil { - n.index = make([]*trieNode, blockSize) - } - nn := n.index[b] - if nn == nil { - nn = &trieNode{} - nn.b = b - n.index[b] = nn - } - n = nn - } - if n.value == nil { - n.value = make([]uint32, blockSize) - } - b := str[len(str)-1] & maskx - n.value[b] = value -} - -type trieBuilder struct { - t *trie - - roots []*trieHandle - - lookupBlocks []*trieNode - valueBlocks []*trieNode - - lookupBlockIdx map[uint32]*trieNode - valueBlockIdx map[uint32]*trieNode -} - -func newTrieBuilder() *trieBuilder { - index := &trieBuilder{} - index.lookupBlocks = make([]*trieNode, 0) - index.valueBlocks = make([]*trieNode, 0) - index.lookupBlockIdx = make(map[uint32]*trieNode) - index.valueBlockIdx = make(map[uint32]*trieNode) - // The third nil is the default null block. The other two blocks - // are used to guarantee an offset of at least 3 for each block. - index.lookupBlocks = append(index.lookupBlocks, nil, nil, nil) - index.t = &trie{} - return index -} - -func (b *trieBuilder) computeOffsets(n *trieNode) *trieNode { - hasher := fnv.New32() - if n.index != nil { - for i, nn := range n.index { - var vi, vv uint16 - if nn != nil { - nn = b.computeOffsets(nn) - n.index[i] = nn - vi = nn.refIndex - vv = nn.refValue - } - hasher.Write([]byte{byte(vi >> 8), byte(vi)}) - hasher.Write([]byte{byte(vv >> 8), byte(vv)}) - } - h := hasher.Sum32() - nn, ok := b.lookupBlockIdx[h] - if !ok { - n.refIndex = uint16(len(b.lookupBlocks)) - blockOffset - b.lookupBlocks = append(b.lookupBlocks, n) - b.lookupBlockIdx[h] = n - } else { - n = nn - } - } else { - for _, v := range n.value { - hasher.Write([]byte{byte(v >> 24), byte(v >> 16), byte(v >> 8), byte(v)}) - } - h := hasher.Sum32() - nn, ok := b.valueBlockIdx[h] - if !ok { - n.refValue = uint16(len(b.valueBlocks)) - blockOffset - n.refIndex = n.refValue - b.valueBlocks = append(b.valueBlocks, n) - b.valueBlockIdx[h] = n - } else { - n = nn - } - } - return n -} - -func (b *trieBuilder) addStartValueBlock(n *trieNode) uint16 { - hasher := fnv.New32() - for _, v := range n.value[:2*blockSize] { - hasher.Write([]byte{byte(v >> 24), byte(v >> 16), byte(v >> 8), byte(v)}) - } - h := hasher.Sum32() - nn, ok := b.valueBlockIdx[h] - if !ok { - n.refValue = uint16(len(b.valueBlocks)) - n.refIndex = n.refValue - b.valueBlocks = append(b.valueBlocks, n) - // Add a dummy block to accommodate the double block size. - b.valueBlocks = append(b.valueBlocks, nil) - b.valueBlockIdx[h] = n - } else { - n = nn - } - return n.refValue -} - -func genValueBlock(t *trie, n *trieNode) { - if n != nil { - for _, v := range n.value { - t.values = append(t.values, v) - } - } -} - -func genLookupBlock(t *trie, n *trieNode) { - for _, nn := range n.index { - v := uint16(0) - if nn != nil { - if n.index != nil { - v = nn.refIndex - } else { - v = nn.refValue - } - } - t.index = append(t.index, v) - } -} - -func (b *trieBuilder) addTrie(n *trieNode) *trieHandle { - h := &trieHandle{} - b.roots = append(b.roots, h) - h.valueStart = b.addStartValueBlock(n) - if len(b.roots) == 1 { - // We insert a null block after the first start value block. - // This ensures that continuation bytes UTF-8 sequences of length - // greater than 2 will automatically hit a null block if there - // was an undefined entry. - b.valueBlocks = append(b.valueBlocks, nil) - } - n = b.computeOffsets(n) - // Offset by one extra block as the first byte starts at 0xC0 instead of 0x80. - h.lookupStart = n.refIndex - 1 - return h -} - -// generate generates and returns the trie for n. -func (b *trieBuilder) generate() (t *trie, err error) { - t = b.t - if len(b.valueBlocks) >= 1<<16 { - return nil, fmt.Errorf("maximum number of value blocks exceeded (%d > %d)", len(b.valueBlocks), 1<<16) - } - if len(b.lookupBlocks) >= 1<<16 { - return nil, fmt.Errorf("maximum number of lookup blocks exceeded (%d > %d)", len(b.lookupBlocks), 1<<16) - } - genValueBlock(t, b.valueBlocks[0]) - genValueBlock(t, &trieNode{value: make([]uint32, 64)}) - for i := 2; i < len(b.valueBlocks); i++ { - genValueBlock(t, b.valueBlocks[i]) - } - n := &trieNode{index: make([]*trieNode, 64)} - genLookupBlock(t, n) - genLookupBlock(t, n) - genLookupBlock(t, n) - for i := 3; i < len(b.lookupBlocks); i++ { - genLookupBlock(t, b.lookupBlocks[i]) - } - return b.t, nil -} - -func (t *trie) printArrays(w io.Writer, name string) (n, size int, err error) { - p := func(f string, a ...interface{}) { - nn, e := fmt.Fprintf(w, f, a...) - n += nn - if err == nil { - err = e - } - } - nv := len(t.values) - p("// %sValues: %d entries, %d bytes\n", name, nv, nv*4) - p("// Block 2 is the null block.\n") - p("var %sValues = [%d]uint32 {", name, nv) - var printnewline bool - for i, v := range t.values { - if i%blockSize == 0 { - p("\n\t// Block %#x, offset %#x", i/blockSize, i) - } - if i%4 == 0 { - printnewline = true - } - if v != 0 { - if printnewline { - p("\n\t") - printnewline = false - } - p("%#04x:%#08x, ", i, v) - } - } - p("\n}\n\n") - ni := len(t.index) - p("// %sLookup: %d entries, %d bytes\n", name, ni, ni*2) - p("// Block 0 is the null block.\n") - p("var %sLookup = [%d]uint16 {", name, ni) - printnewline = false - for i, v := range t.index { - if i%blockSize == 0 { - p("\n\t// Block %#x, offset %#x", i/blockSize, i) - } - if i%8 == 0 { - printnewline = true - } - if v != 0 { - if printnewline { - p("\n\t") - printnewline = false - } - p("%#03x:%#02x, ", i, v) - } - } - p("\n}\n\n") - return n, nv*4 + ni*2, err -} - -func (t *trie) printStruct(w io.Writer, handle *trieHandle, name string) (n, sz int, err error) { - const msg = "trie{ %sLookup[%d:], %sValues[%d:], %sLookup[:], %sValues[:]}" - n, err = fmt.Fprintf(w, msg, name, handle.lookupStart*blockSize, name, handle.valueStart*blockSize, name, name) - sz += int(reflect.TypeOf(trie{}).Size()) - return -} diff --git a/vendor/golang.org/x/text/collate/maketables.go b/vendor/golang.org/x/text/collate/maketables.go deleted file mode 100644 index b4c835ed4d99..000000000000 --- a/vendor/golang.org/x/text/collate/maketables.go +++ /dev/null @@ -1,553 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Collation table generator. -// Data read from the web. - -package main - -import ( - "archive/zip" - "bufio" - "bytes" - "flag" - "fmt" - "io" - "io/ioutil" - "log" - "os" - "regexp" - "sort" - "strconv" - "strings" - "unicode/utf8" - - "golang.org/x/text/collate" - "golang.org/x/text/collate/build" - "golang.org/x/text/internal/colltab" - "golang.org/x/text/internal/gen" - "golang.org/x/text/language" - "golang.org/x/text/unicode/cldr" -) - -var ( - test = flag.Bool("test", false, - "test existing tables; can be used to compare web data with package data.") - short = flag.Bool("short", false, `Use "short" alternatives, when available.`) - draft = flag.Bool("draft", false, `Use draft versions, when available.`) - tags = flag.String("tags", "", "build tags to be included after +build directive") - pkg = flag.String("package", "collate", - "the name of the package in which the generated file is to be included") - - tables = flagStringSetAllowAll("tables", "collate", "collate,chars", - "comma-spearated list of tables to generate.") - exclude = flagStringSet("exclude", "zh2", "", - "comma-separated list of languages to exclude.") - include = flagStringSet("include", "", "", - "comma-separated list of languages to include. Include trumps exclude.") - // TODO: Not included: unihan gb2312han zhuyin big5han (for size reasons) - // TODO: Not included: traditional (buggy for Bengali) - types = flagStringSetAllowAll("types", "standard,phonebook,phonetic,reformed,pinyin,stroke", "", - "comma-separated list of types that should be included.") -) - -// stringSet implements an ordered set based on a list. It implements flag.Value -// to allow a set to be specified as a comma-separated list. -type stringSet struct { - s []string - allowed *stringSet - dirty bool // needs compaction if true - all bool - allowAll bool -} - -func flagStringSet(name, def, allowed, usage string) *stringSet { - ss := &stringSet{} - if allowed != "" { - usage += fmt.Sprintf(" (allowed values: any of %s)", allowed) - ss.allowed = &stringSet{} - failOnError(ss.allowed.Set(allowed)) - } - ss.Set(def) - flag.Var(ss, name, usage) - return ss -} - -func flagStringSetAllowAll(name, def, allowed, usage string) *stringSet { - ss := &stringSet{allowAll: true} - if allowed == "" { - flag.Var(ss, name, usage+fmt.Sprintf(` Use "all" to select all.`)) - } else { - ss.allowed = &stringSet{} - failOnError(ss.allowed.Set(allowed)) - flag.Var(ss, name, usage+fmt.Sprintf(` (allowed values: "all" or any of %s)`, allowed)) - } - ss.Set(def) - return ss -} - -func (ss stringSet) Len() int { - return len(ss.s) -} - -func (ss stringSet) String() string { - return strings.Join(ss.s, ",") -} - -func (ss *stringSet) Set(s string) error { - if ss.allowAll && s == "all" { - ss.s = nil - ss.all = true - return nil - } - ss.s = ss.s[:0] - for _, s := range strings.Split(s, ",") { - if s := strings.TrimSpace(s); s != "" { - if ss.allowed != nil && !ss.allowed.contains(s) { - return fmt.Errorf("unsupported value %q; must be one of %s", s, ss.allowed) - } - ss.add(s) - } - } - ss.compact() - return nil -} - -func (ss *stringSet) add(s string) { - ss.s = append(ss.s, s) - ss.dirty = true -} - -func (ss *stringSet) values() []string { - ss.compact() - return ss.s -} - -func (ss *stringSet) contains(s string) bool { - if ss.all { - return true - } - for _, v := range ss.s { - if v == s { - return true - } - } - return false -} - -func (ss *stringSet) compact() { - if !ss.dirty { - return - } - a := ss.s - sort.Strings(a) - k := 0 - for i := 1; i < len(a); i++ { - if a[k] != a[i] { - a[k+1] = a[i] - k++ - } - } - ss.s = a[:k+1] - ss.dirty = false -} - -func skipLang(l string) bool { - if include.Len() > 0 { - return !include.contains(l) - } - return exclude.contains(l) -} - -// altInclude returns a list of alternatives (for the LDML alt attribute) -// in order of preference. An empty string in this list indicates the -// default entry. -func altInclude() []string { - l := []string{} - if *short { - l = append(l, "short") - } - l = append(l, "") - // TODO: handle draft using cldr.SetDraftLevel - if *draft { - l = append(l, "proposed") - } - return l -} - -func failOnError(e error) { - if e != nil { - log.Panic(e) - } -} - -func openArchive() *zip.Reader { - f := gen.OpenCLDRCoreZip() - buffer, err := ioutil.ReadAll(f) - f.Close() - failOnError(err) - archive, err := zip.NewReader(bytes.NewReader(buffer), int64(len(buffer))) - failOnError(err) - return archive -} - -// parseUCA parses a Default Unicode Collation Element Table of the format -// specified in http://www.unicode.org/reports/tr10/#File_Format. -// It returns the variable top. -func parseUCA(builder *build.Builder) { - var r io.ReadCloser - var err error - for _, f := range openArchive().File { - if strings.HasSuffix(f.Name, "allkeys_CLDR.txt") { - r, err = f.Open() - } - } - if r == nil { - log.Fatal("File allkeys_CLDR.txt not found in archive.") - } - failOnError(err) - defer r.Close() - scanner := bufio.NewScanner(r) - colelem := regexp.MustCompile(`\[([.*])([0-9A-F.]+)\]`) - for i := 1; scanner.Scan(); i++ { - line := scanner.Text() - if len(line) == 0 || line[0] == '#' { - continue - } - if line[0] == '@' { - // parse properties - switch { - case strings.HasPrefix(line[1:], "version "): - a := strings.Split(line[1:], " ") - if a[1] != gen.UnicodeVersion() { - log.Fatalf("incompatible version %s; want %s", a[1], gen.UnicodeVersion()) - } - case strings.HasPrefix(line[1:], "backwards "): - log.Fatalf("%d: unsupported option backwards", i) - default: - log.Printf("%d: unknown option %s", i, line[1:]) - } - } else { - // parse entries - part := strings.Split(line, " ; ") - if len(part) != 2 { - log.Fatalf("%d: production rule without ';': %v", i, line) - } - lhs := []rune{} - for _, v := range strings.Split(part[0], " ") { - if v == "" { - continue - } - lhs = append(lhs, rune(convHex(i, v))) - } - var n int - var vars []int - rhs := [][]int{} - for i, m := range colelem.FindAllStringSubmatch(part[1], -1) { - n += len(m[0]) - elem := []int{} - for _, h := range strings.Split(m[2], ".") { - elem = append(elem, convHex(i, h)) - } - if m[1] == "*" { - vars = append(vars, i) - } - rhs = append(rhs, elem) - } - if len(part[1]) < n+3 || part[1][n+1] != '#' { - log.Fatalf("%d: expected comment; found %s", i, part[1][n:]) - } - if *test { - testInput.add(string(lhs)) - } - failOnError(builder.Add(lhs, rhs, vars)) - } - } - if scanner.Err() != nil { - log.Fatal(scanner.Err()) - } -} - -func convHex(line int, s string) int { - r, e := strconv.ParseInt(s, 16, 32) - if e != nil { - log.Fatalf("%d: %v", line, e) - } - return int(r) -} - -var testInput = stringSet{} - -var charRe = regexp.MustCompile(`&#x([0-9A-F]*);`) -var tagRe = regexp.MustCompile(`<([a-z_]*) */>`) - -var mainLocales = []string{} - -// charsets holds a list of exemplar characters per category. -type charSets map[string][]string - -func (p charSets) fprint(w io.Writer) { - fmt.Fprintln(w, "[exN]string{") - for i, k := range []string{"", "contractions", "punctuation", "auxiliary", "currencySymbol", "index"} { - if set := p[k]; len(set) != 0 { - fmt.Fprintf(w, "\t\t%d: %q,\n", i, strings.Join(set, " ")) - } - } - fmt.Fprintln(w, "\t},") -} - -var localeChars = make(map[string]charSets) - -const exemplarHeader = ` -type exemplarType int -const ( - exCharacters exemplarType = iota - exContractions - exPunctuation - exAuxiliary - exCurrency - exIndex - exN -) -` - -func printExemplarCharacters(w io.Writer) { - fmt.Fprintln(w, exemplarHeader) - fmt.Fprintln(w, "var exemplarCharacters = map[string][exN]string{") - for _, loc := range mainLocales { - fmt.Fprintf(w, "\t%q: ", loc) - localeChars[loc].fprint(w) - } - fmt.Fprintln(w, "}") -} - -func decodeCLDR(d *cldr.Decoder) *cldr.CLDR { - r := gen.OpenCLDRCoreZip() - data, err := d.DecodeZip(r) - failOnError(err) - return data -} - -// parseMain parses XML files in the main directory of the CLDR core.zip file. -func parseMain() { - d := &cldr.Decoder{} - d.SetDirFilter("main") - d.SetSectionFilter("characters") - data := decodeCLDR(d) - for _, loc := range data.Locales() { - x := data.RawLDML(loc) - if skipLang(x.Identity.Language.Type) { - continue - } - if x.Characters != nil { - x, _ = data.LDML(loc) - loc = language.Make(loc).String() - for _, ec := range x.Characters.ExemplarCharacters { - if ec.Draft != "" { - continue - } - if _, ok := localeChars[loc]; !ok { - mainLocales = append(mainLocales, loc) - localeChars[loc] = make(charSets) - } - localeChars[loc][ec.Type] = parseCharacters(ec.Data()) - } - } - } -} - -func parseCharacters(chars string) []string { - parseSingle := func(s string) (r rune, tail string, escaped bool) { - if s[0] == '\\' { - return rune(s[1]), s[2:], true - } - r, sz := utf8.DecodeRuneInString(s) - return r, s[sz:], false - } - chars = strings.TrimSpace(chars) - if n := len(chars) - 1; chars[n] == ']' && chars[0] == '[' { - chars = chars[1:n] - } - list := []string{} - var r, last, end rune - for len(chars) > 0 { - if chars[0] == '{' { // character sequence - buf := []rune{} - for chars = chars[1:]; len(chars) > 0; { - r, chars, _ = parseSingle(chars) - if r == '}' { - break - } - if r == ' ' { - log.Fatalf("space not supported in sequence %q", chars) - } - buf = append(buf, r) - } - list = append(list, string(buf)) - last = 0 - } else { // single character - escaped := false - r, chars, escaped = parseSingle(chars) - if r != ' ' { - if r == '-' && !escaped { - if last == 0 { - log.Fatal("'-' should be preceded by a character") - } - end, chars, _ = parseSingle(chars) - for ; last <= end; last++ { - list = append(list, string(last)) - } - last = 0 - } else { - list = append(list, string(r)) - last = r - } - } - } - } - return list -} - -var fileRe = regexp.MustCompile(`.*/collation/(.*)\.xml`) - -// typeMap translates legacy type keys to their BCP47 equivalent. -var typeMap = map[string]string{ - "phonebook": "phonebk", - "traditional": "trad", -} - -// parseCollation parses XML files in the collation directory of the CLDR core.zip file. -func parseCollation(b *build.Builder) { - d := &cldr.Decoder{} - d.SetDirFilter("collation") - data := decodeCLDR(d) - for _, loc := range data.Locales() { - x, err := data.LDML(loc) - failOnError(err) - if skipLang(x.Identity.Language.Type) { - continue - } - cs := x.Collations.Collation - sl := cldr.MakeSlice(&cs) - if len(types.s) == 0 { - sl.SelectAnyOf("type", x.Collations.Default()) - } else if !types.all { - sl.SelectAnyOf("type", types.s...) - } - sl.SelectOnePerGroup("alt", altInclude()) - - for _, c := range cs { - id, err := language.Parse(loc) - if err != nil { - fmt.Fprintf(os.Stderr, "invalid locale: %q", err) - continue - } - // Support both old- and new-style defaults. - d := c.Type - if x.Collations.DefaultCollation == nil { - d = x.Collations.Default() - } else { - d = x.Collations.DefaultCollation.Data() - } - // We assume tables are being built either for search or collation, - // but not both. For search the default is always "search". - if d != c.Type && c.Type != "search" { - typ := c.Type - if len(c.Type) > 8 { - typ = typeMap[c.Type] - } - id, err = id.SetTypeForKey("co", typ) - failOnError(err) - } - t := b.Tailoring(id) - c.Process(processor{t}) - } - } -} - -type processor struct { - t *build.Tailoring -} - -func (p processor) Reset(anchor string, before int) (err error) { - if before != 0 { - err = p.t.SetAnchorBefore(anchor) - } else { - err = p.t.SetAnchor(anchor) - } - failOnError(err) - return nil -} - -func (p processor) Insert(level int, str, context, extend string) error { - str = context + str - if *test { - testInput.add(str) - } - // TODO: mimic bug in old maketables: remove. - err := p.t.Insert(colltab.Level(level-1), str, context+extend) - failOnError(err) - return nil -} - -func (p processor) Index(id string) { -} - -func testCollator(c *collate.Collator) { - c0 := collate.New(language.Und) - - // iterator over all characters for all locales and check - // whether Key is equal. - buf := collate.Buffer{} - - // Add all common and not too uncommon runes to the test set. - for i := rune(0); i < 0x30000; i++ { - testInput.add(string(i)) - } - for i := rune(0xE0000); i < 0xF0000; i++ { - testInput.add(string(i)) - } - for _, str := range testInput.values() { - k0 := c0.KeyFromString(&buf, str) - k := c.KeyFromString(&buf, str) - if !bytes.Equal(k0, k) { - failOnError(fmt.Errorf("test:%U: keys differ (%x vs %x)", []rune(str), k0, k)) - } - buf.Reset() - } - fmt.Println("PASS") -} - -func main() { - gen.Init() - b := build.NewBuilder() - parseUCA(b) - if tables.contains("chars") { - parseMain() - } - parseCollation(b) - - c, err := b.Build() - failOnError(err) - - if *test { - testCollator(collate.NewFromTable(c)) - } else { - w := &bytes.Buffer{} - - gen.WriteUnicodeVersion(w) - gen.WriteCLDRVersion(w) - - if tables.contains("collate") { - _, err = b.Print(w) - failOnError(err) - } - if tables.contains("chars") { - printExemplarCharacters(w) - } - gen.WriteGoFile("tables.go", *pkg, w.Bytes()) - } -} diff --git a/vendor/golang.org/x/text/internal/gen.go b/vendor/golang.org/x/text/internal/gen.go deleted file mode 100644 index 1d678af57405..000000000000 --- a/vendor/golang.org/x/text/internal/gen.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "log" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/language" - "golang.org/x/text/unicode/cldr" -) - -func main() { - r := gen.OpenCLDRCoreZip() - defer r.Close() - - d := &cldr.Decoder{} - data, err := d.DecodeZip(r) - if err != nil { - log.Fatalf("DecodeZip: %v", err) - } - - w := gen.NewCodeWriter() - defer w.WriteGoFile("tables.go", "internal") - - // Create parents table. - parents := make([]uint16, language.NumCompactTags) - for _, loc := range data.Locales() { - tag := language.MustParse(loc) - index, ok := language.CompactIndex(tag) - if !ok { - continue - } - parentIndex := 0 // und - for p := tag.Parent(); p != language.Und; p = p.Parent() { - if x, ok := language.CompactIndex(p); ok { - parentIndex = x - break - } - } - parents[index] = uint16(parentIndex) - } - - w.WriteComment(` - Parent maps a compact index of a tag to the compact index of the parent of - this tag.`) - w.WriteVar("Parent", parents) -} diff --git a/vendor/golang.org/x/text/internal/gen/code.go b/vendor/golang.org/x/text/internal/gen/code.go deleted file mode 100644 index 0389509f2c4f..000000000000 --- a/vendor/golang.org/x/text/internal/gen/code.go +++ /dev/null @@ -1,369 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gen - -import ( - "bytes" - "encoding/gob" - "fmt" - "hash" - "hash/fnv" - "io" - "log" - "os" - "reflect" - "strings" - "unicode" - "unicode/utf8" -) - -// This file contains utilities for generating code. - -// TODO: other write methods like: -// - slices, maps, types, etc. - -// CodeWriter is a utility for writing structured code. It computes the content -// hash and size of written content. It ensures there are newlines between -// written code blocks. -type CodeWriter struct { - buf bytes.Buffer - Size int - Hash hash.Hash32 // content hash - gob *gob.Encoder - // For comments we skip the usual one-line separator if they are followed by - // a code block. - skipSep bool -} - -func (w *CodeWriter) Write(p []byte) (n int, err error) { - return w.buf.Write(p) -} - -// NewCodeWriter returns a new CodeWriter. -func NewCodeWriter() *CodeWriter { - h := fnv.New32() - return &CodeWriter{Hash: h, gob: gob.NewEncoder(h)} -} - -// WriteGoFile appends the buffer with the total size of all created structures -// and writes it as a Go file to the the given file with the given package name. -func (w *CodeWriter) WriteGoFile(filename, pkg string) { - f, err := os.Create(filename) - if err != nil { - log.Fatalf("Could not create file %s: %v", filename, err) - } - defer f.Close() - if _, err = w.WriteGo(f, pkg, ""); err != nil { - log.Fatalf("Error writing file %s: %v", filename, err) - } -} - -// WriteVersionedGoFile appends the buffer with the total size of all created -// structures and writes it as a Go file to the the given file with the given -// package name and build tags for the current Unicode version, -func (w *CodeWriter) WriteVersionedGoFile(filename, pkg string) { - tags := buildTags() - if tags != "" { - filename = insertVersion(filename, UnicodeVersion()) - } - f, err := os.Create(filename) - if err != nil { - log.Fatalf("Could not create file %s: %v", filename, err) - } - defer f.Close() - if _, err = w.WriteGo(f, pkg, tags); err != nil { - log.Fatalf("Error writing file %s: %v", filename, err) - } -} - -// WriteGo appends the buffer with the total size of all created structures and -// writes it as a Go file to the the given writer with the given package name. -func (w *CodeWriter) WriteGo(out io.Writer, pkg, tags string) (n int, err error) { - sz := w.Size - w.WriteComment("Total table size %d bytes (%dKiB); checksum: %X\n", sz, sz/1024, w.Hash.Sum32()) - defer w.buf.Reset() - return WriteGo(out, pkg, tags, w.buf.Bytes()) -} - -func (w *CodeWriter) printf(f string, x ...interface{}) { - fmt.Fprintf(w, f, x...) -} - -func (w *CodeWriter) insertSep() { - if w.skipSep { - w.skipSep = false - return - } - // Use at least two newlines to ensure a blank space between the previous - // block. WriteGoFile will remove extraneous newlines. - w.printf("\n\n") -} - -// WriteComment writes a comment block. All line starts are prefixed with "//". -// Initial empty lines are gobbled. The indentation for the first line is -// stripped from consecutive lines. -func (w *CodeWriter) WriteComment(comment string, args ...interface{}) { - s := fmt.Sprintf(comment, args...) - s = strings.Trim(s, "\n") - - // Use at least two newlines to ensure a blank space between the previous - // block. WriteGoFile will remove extraneous newlines. - w.printf("\n\n// ") - w.skipSep = true - - // strip first indent level. - sep := "\n" - for ; len(s) > 0 && (s[0] == '\t' || s[0] == ' '); s = s[1:] { - sep += s[:1] - } - - strings.NewReplacer(sep, "\n// ", "\n", "\n// ").WriteString(w, s) - - w.printf("\n") -} - -func (w *CodeWriter) writeSizeInfo(size int) { - w.printf("// Size: %d bytes\n", size) -} - -// WriteConst writes a constant of the given name and value. -func (w *CodeWriter) WriteConst(name string, x interface{}) { - w.insertSep() - v := reflect.ValueOf(x) - - switch v.Type().Kind() { - case reflect.String: - w.printf("const %s %s = ", name, typeName(x)) - w.WriteString(v.String()) - w.printf("\n") - default: - w.printf("const %s = %#v\n", name, x) - } -} - -// WriteVar writes a variable of the given name and value. -func (w *CodeWriter) WriteVar(name string, x interface{}) { - w.insertSep() - v := reflect.ValueOf(x) - oldSize := w.Size - sz := int(v.Type().Size()) - w.Size += sz - - switch v.Type().Kind() { - case reflect.String: - w.printf("var %s %s = ", name, typeName(x)) - w.WriteString(v.String()) - case reflect.Struct: - w.gob.Encode(x) - fallthrough - case reflect.Slice, reflect.Array: - w.printf("var %s = ", name) - w.writeValue(v) - w.writeSizeInfo(w.Size - oldSize) - default: - w.printf("var %s %s = ", name, typeName(x)) - w.gob.Encode(x) - w.writeValue(v) - w.writeSizeInfo(w.Size - oldSize) - } - w.printf("\n") -} - -func (w *CodeWriter) writeValue(v reflect.Value) { - x := v.Interface() - switch v.Kind() { - case reflect.String: - w.WriteString(v.String()) - case reflect.Array: - // Don't double count: callers of WriteArray count on the size being - // added, so we need to discount it here. - w.Size -= int(v.Type().Size()) - w.writeSlice(x, true) - case reflect.Slice: - w.writeSlice(x, false) - case reflect.Struct: - w.printf("%s{\n", typeName(v.Interface())) - t := v.Type() - for i := 0; i < v.NumField(); i++ { - w.printf("%s: ", t.Field(i).Name) - w.writeValue(v.Field(i)) - w.printf(",\n") - } - w.printf("}") - default: - w.printf("%#v", x) - } -} - -// WriteString writes a string literal. -func (w *CodeWriter) WriteString(s string) { - s = strings.Replace(s, `\`, `\\`, -1) - io.WriteString(w.Hash, s) // content hash - w.Size += len(s) - - const maxInline = 40 - if len(s) <= maxInline { - w.printf("%q", s) - return - } - - // We will render the string as a multi-line string. - const maxWidth = 80 - 4 - len(`"`) - len(`" +`) - - // When starting on its own line, go fmt indents line 2+ an extra level. - n, max := maxWidth, maxWidth-4 - - // As per https://golang.org/issue/18078, the compiler has trouble - // compiling the concatenation of many strings, s0 + s1 + s2 + ... + sN, - // for large N. We insert redundant, explicit parentheses to work around - // that, lowering the N at any given step: (s0 + s1 + ... + s63) + (s64 + - // ... + s127) + etc + (etc + ... + sN). - explicitParens, extraComment := len(s) > 128*1024, "" - if explicitParens { - w.printf(`(`) - extraComment = "; the redundant, explicit parens are for https://golang.org/issue/18078" - } - - // Print "" +\n, if a string does not start on its own line. - b := w.buf.Bytes() - if p := len(bytes.TrimRight(b, " \t")); p > 0 && b[p-1] != '\n' { - w.printf("\"\" + // Size: %d bytes%s\n", len(s), extraComment) - n, max = maxWidth, maxWidth - } - - w.printf(`"`) - - for sz, p, nLines := 0, 0, 0; p < len(s); { - var r rune - r, sz = utf8.DecodeRuneInString(s[p:]) - out := s[p : p+sz] - chars := 1 - if !unicode.IsPrint(r) || r == utf8.RuneError || r == '"' { - switch sz { - case 1: - out = fmt.Sprintf("\\x%02x", s[p]) - case 2, 3: - out = fmt.Sprintf("\\u%04x", r) - case 4: - out = fmt.Sprintf("\\U%08x", r) - } - chars = len(out) - } - if n -= chars; n < 0 { - nLines++ - if explicitParens && nLines&63 == 63 { - w.printf("\") + (\"") - } - w.printf("\" +\n\"") - n = max - len(out) - } - w.printf("%s", out) - p += sz - } - w.printf(`"`) - if explicitParens { - w.printf(`)`) - } -} - -// WriteSlice writes a slice value. -func (w *CodeWriter) WriteSlice(x interface{}) { - w.writeSlice(x, false) -} - -// WriteArray writes an array value. -func (w *CodeWriter) WriteArray(x interface{}) { - w.writeSlice(x, true) -} - -func (w *CodeWriter) writeSlice(x interface{}, isArray bool) { - v := reflect.ValueOf(x) - w.gob.Encode(v.Len()) - w.Size += v.Len() * int(v.Type().Elem().Size()) - name := typeName(x) - if isArray { - name = fmt.Sprintf("[%d]%s", v.Len(), name[strings.Index(name, "]")+1:]) - } - if isArray { - w.printf("%s{\n", name) - } else { - w.printf("%s{ // %d elements\n", name, v.Len()) - } - - switch kind := v.Type().Elem().Kind(); kind { - case reflect.String: - for _, s := range x.([]string) { - w.WriteString(s) - w.printf(",\n") - } - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - // nLine and nBlock are the number of elements per line and block. - nLine, nBlock, format := 8, 64, "%d," - switch kind { - case reflect.Uint8: - format = "%#02x," - case reflect.Uint16: - format = "%#04x," - case reflect.Uint32: - nLine, nBlock, format = 4, 32, "%#08x," - case reflect.Uint, reflect.Uint64: - nLine, nBlock, format = 4, 32, "%#016x," - case reflect.Int8: - nLine = 16 - } - n := nLine - for i := 0; i < v.Len(); i++ { - if i%nBlock == 0 && v.Len() > nBlock { - w.printf("// Entry %X - %X\n", i, i+nBlock-1) - } - x := v.Index(i).Interface() - w.gob.Encode(x) - w.printf(format, x) - if n--; n == 0 { - n = nLine - w.printf("\n") - } - } - w.printf("\n") - case reflect.Struct: - zero := reflect.Zero(v.Type().Elem()).Interface() - for i := 0; i < v.Len(); i++ { - x := v.Index(i).Interface() - w.gob.EncodeValue(v) - if !reflect.DeepEqual(zero, x) { - line := fmt.Sprintf("%#v,\n", x) - line = line[strings.IndexByte(line, '{'):] - w.printf("%d: ", i) - w.printf(line) - } - } - case reflect.Array: - for i := 0; i < v.Len(); i++ { - w.printf("%d: %#v,\n", i, v.Index(i).Interface()) - } - default: - panic("gen: slice elem type not supported") - } - w.printf("}") -} - -// WriteType writes a definition of the type of the given value and returns the -// type name. -func (w *CodeWriter) WriteType(x interface{}) string { - t := reflect.TypeOf(x) - w.printf("type %s struct {\n", t.Name()) - for i := 0; i < t.NumField(); i++ { - w.printf("\t%s %s\n", t.Field(i).Name, t.Field(i).Type) - } - w.printf("}\n") - return t.Name() -} - -// typeName returns the name of the go type of x. -func typeName(x interface{}) string { - t := reflect.ValueOf(x).Type() - return strings.Replace(fmt.Sprint(t), "main.", "", 1) -} diff --git a/vendor/golang.org/x/text/internal/gen/gen.go b/vendor/golang.org/x/text/internal/gen/gen.go deleted file mode 100644 index 4c3f7606896d..000000000000 --- a/vendor/golang.org/x/text/internal/gen/gen.go +++ /dev/null @@ -1,333 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gen contains common code for the various code generation tools in the -// text repository. Its usage ensures consistency between tools. -// -// This package defines command line flags that are common to most generation -// tools. The flags allow for specifying specific Unicode and CLDR versions -// in the public Unicode data repository (http://www.unicode.org/Public). -// -// A local Unicode data mirror can be set through the flag -local or the -// environment variable UNICODE_DIR. The former takes precedence. The local -// directory should follow the same structure as the public repository. -// -// IANA data can also optionally be mirrored by putting it in the iana directory -// rooted at the top of the local mirror. Beware, though, that IANA data is not -// versioned. So it is up to the developer to use the right version. -package gen // import "golang.org/x/text/internal/gen" - -import ( - "bytes" - "flag" - "fmt" - "go/build" - "go/format" - "io" - "io/ioutil" - "log" - "net/http" - "os" - "path" - "path/filepath" - "strings" - "sync" - "unicode" - - "golang.org/x/text/unicode/cldr" -) - -var ( - url = flag.String("url", - "http://www.unicode.org/Public", - "URL of Unicode database directory") - iana = flag.String("iana", - "http://www.iana.org", - "URL of the IANA repository") - unicodeVersion = flag.String("unicode", - getEnv("UNICODE_VERSION", unicode.Version), - "unicode version to use") - cldrVersion = flag.String("cldr", - getEnv("CLDR_VERSION", cldr.Version), - "cldr version to use") -) - -func getEnv(name, def string) string { - if v := os.Getenv(name); v != "" { - return v - } - return def -} - -// Init performs common initialization for a gen command. It parses the flags -// and sets up the standard logging parameters. -func Init() { - log.SetPrefix("") - log.SetFlags(log.Lshortfile) - flag.Parse() -} - -const header = `// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -` - -// UnicodeVersion reports the requested Unicode version. -func UnicodeVersion() string { - return *unicodeVersion -} - -// CLDRVersion reports the requested CLDR version. -func CLDRVersion() string { - return *cldrVersion -} - -var tags = []struct{ version, buildTags string }{ - {"10.0.0", "go1.10"}, - {"", "!go1.10"}, -} - -// buildTags reports the build tags used for the current Unicode version. -func buildTags() string { - v := UnicodeVersion() - for _, x := range tags { - // We should do a numeric comparison, but including the collate package - // would create an import cycle. We approximate it by assuming that - // longer version strings are later. - if len(x.version) <= len(v) { - return x.buildTags - } - if len(x.version) == len(v) && x.version <= v { - return x.buildTags - } - } - return tags[0].buildTags -} - -// IsLocal reports whether data files are available locally. -func IsLocal() bool { - dir, err := localReadmeFile() - if err != nil { - return false - } - if _, err = os.Stat(dir); err != nil { - return false - } - return true -} - -// OpenUCDFile opens the requested UCD file. The file is specified relative to -// the public Unicode root directory. It will call log.Fatal if there are any -// errors. -func OpenUCDFile(file string) io.ReadCloser { - return openUnicode(path.Join(*unicodeVersion, "ucd", file)) -} - -// OpenCLDRCoreZip opens the CLDR core zip file. It will call log.Fatal if there -// are any errors. -func OpenCLDRCoreZip() io.ReadCloser { - return OpenUnicodeFile("cldr", *cldrVersion, "core.zip") -} - -// OpenUnicodeFile opens the requested file of the requested category from the -// root of the Unicode data archive. The file is specified relative to the -// public Unicode root directory. If version is "", it will use the default -// Unicode version. It will call log.Fatal if there are any errors. -func OpenUnicodeFile(category, version, file string) io.ReadCloser { - if version == "" { - version = UnicodeVersion() - } - return openUnicode(path.Join(category, version, file)) -} - -// OpenIANAFile opens the requested IANA file. The file is specified relative -// to the IANA root, which is typically either http://www.iana.org or the -// iana directory in the local mirror. It will call log.Fatal if there are any -// errors. -func OpenIANAFile(path string) io.ReadCloser { - return Open(*iana, "iana", path) -} - -var ( - dirMutex sync.Mutex - localDir string -) - -const permissions = 0755 - -func localReadmeFile() (string, error) { - p, err := build.Import("golang.org/x/text", "", build.FindOnly) - if err != nil { - return "", fmt.Errorf("Could not locate package: %v", err) - } - return filepath.Join(p.Dir, "DATA", "README"), nil -} - -func getLocalDir() string { - dirMutex.Lock() - defer dirMutex.Unlock() - - readme, err := localReadmeFile() - if err != nil { - log.Fatal(err) - } - dir := filepath.Dir(readme) - if _, err := os.Stat(readme); err != nil { - if err := os.MkdirAll(dir, permissions); err != nil { - log.Fatalf("Could not create directory: %v", err) - } - ioutil.WriteFile(readme, []byte(readmeTxt), permissions) - } - return dir -} - -const readmeTxt = `Generated by golang.org/x/text/internal/gen. DO NOT EDIT. - -This directory contains downloaded files used to generate the various tables -in the golang.org/x/text subrepo. - -Note that the language subtag repo (iana/assignments/language-subtag-registry) -and all other times in the iana subdirectory are not versioned and will need -to be periodically manually updated. The easiest way to do this is to remove -the entire iana directory. This is mostly of concern when updating the language -package. -` - -// Open opens subdir/path if a local directory is specified and the file exists, -// where subdir is a directory relative to the local root, or fetches it from -// urlRoot/path otherwise. It will call log.Fatal if there are any errors. -func Open(urlRoot, subdir, path string) io.ReadCloser { - file := filepath.Join(getLocalDir(), subdir, filepath.FromSlash(path)) - return open(file, urlRoot, path) -} - -func openUnicode(path string) io.ReadCloser { - file := filepath.Join(getLocalDir(), filepath.FromSlash(path)) - return open(file, *url, path) -} - -// TODO: automatically periodically update non-versioned files. - -func open(file, urlRoot, path string) io.ReadCloser { - if f, err := os.Open(file); err == nil { - return f - } - r := get(urlRoot, path) - defer r.Close() - b, err := ioutil.ReadAll(r) - if err != nil { - log.Fatalf("Could not download file: %v", err) - } - os.MkdirAll(filepath.Dir(file), permissions) - if err := ioutil.WriteFile(file, b, permissions); err != nil { - log.Fatalf("Could not create file: %v", err) - } - return ioutil.NopCloser(bytes.NewReader(b)) -} - -func get(root, path string) io.ReadCloser { - url := root + "/" + path - fmt.Printf("Fetching %s...", url) - defer fmt.Println(" done.") - resp, err := http.Get(url) - if err != nil { - log.Fatalf("HTTP GET: %v", err) - } - if resp.StatusCode != 200 { - log.Fatalf("Bad GET status for %q: %q", url, resp.Status) - } - return resp.Body -} - -// TODO: use Write*Version in all applicable packages. - -// WriteUnicodeVersion writes a constant for the Unicode version from which the -// tables are generated. -func WriteUnicodeVersion(w io.Writer) { - fmt.Fprintf(w, "// UnicodeVersion is the Unicode version from which the tables in this package are derived.\n") - fmt.Fprintf(w, "const UnicodeVersion = %q\n\n", UnicodeVersion()) -} - -// WriteCLDRVersion writes a constant for the CLDR version from which the -// tables are generated. -func WriteCLDRVersion(w io.Writer) { - fmt.Fprintf(w, "// CLDRVersion is the CLDR version from which the tables in this package are derived.\n") - fmt.Fprintf(w, "const CLDRVersion = %q\n\n", CLDRVersion()) -} - -// WriteGoFile prepends a standard file comment and package statement to the -// given bytes, applies gofmt, and writes them to a file with the given name. -// It will call log.Fatal if there are any errors. -func WriteGoFile(filename, pkg string, b []byte) { - w, err := os.Create(filename) - if err != nil { - log.Fatalf("Could not create file %s: %v", filename, err) - } - defer w.Close() - if _, err = WriteGo(w, pkg, "", b); err != nil { - log.Fatalf("Error writing file %s: %v", filename, err) - } -} - -func insertVersion(filename, version string) string { - suffix := ".go" - if strings.HasSuffix(filename, "_test.go") { - suffix = "_test.go" - } - return fmt.Sprint(filename[:len(filename)-len(suffix)], version, suffix) -} - -// WriteVersionedGoFile prepends a standard file comment, adds build tags to -// version the file for the current Unicode version, and package statement to -// the given bytes, applies gofmt, and writes them to a file with the given -// name. It will call log.Fatal if there are any errors. -func WriteVersionedGoFile(filename, pkg string, b []byte) { - tags := buildTags() - if tags != "" { - filename = insertVersion(filename, UnicodeVersion()) - } - w, err := os.Create(filename) - if err != nil { - log.Fatalf("Could not create file %s: %v", filename, err) - } - defer w.Close() - if _, err = WriteGo(w, pkg, tags, b); err != nil { - log.Fatalf("Error writing file %s: %v", filename, err) - } -} - -// WriteGo prepends a standard file comment and package statement to the given -// bytes, applies gofmt, and writes them to w. -func WriteGo(w io.Writer, pkg, tags string, b []byte) (n int, err error) { - src := []byte(header) - if tags != "" { - src = append(src, fmt.Sprintf("// +build %s\n\n", tags)...) - } - src = append(src, fmt.Sprintf("package %s\n\n", pkg)...) - src = append(src, b...) - formatted, err := format.Source(src) - if err != nil { - // Print the generated code even in case of an error so that the - // returned error can be meaningfully interpreted. - n, _ = w.Write(src) - return n, err - } - return w.Write(formatted) -} - -// Repackage rewrites a Go file from belonging to package main to belonging to -// the given package. -func Repackage(inFile, outFile, pkg string) { - src, err := ioutil.ReadFile(inFile) - if err != nil { - log.Fatalf("reading %s: %v", inFile, err) - } - const toDelete = "package main\n\n" - i := bytes.Index(src, []byte(toDelete)) - if i < 0 { - log.Fatalf("Could not find %q in %s.", toDelete, inFile) - } - w := &bytes.Buffer{} - w.Write(src[i+len(toDelete):]) - WriteGoFile(outFile, pkg, w.Bytes()) -} diff --git a/vendor/golang.org/x/text/internal/triegen/compact.go b/vendor/golang.org/x/text/internal/triegen/compact.go deleted file mode 100644 index 397b975c1b71..000000000000 --- a/vendor/golang.org/x/text/internal/triegen/compact.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package triegen - -// This file defines Compacter and its implementations. - -import "io" - -// A Compacter generates an alternative, more space-efficient way to store a -// trie value block. A trie value block holds all possible values for the last -// byte of a UTF-8 encoded rune. Excluding ASCII characters, a trie value block -// always has 64 values, as a UTF-8 encoding ends with a byte in [0x80, 0xC0). -type Compacter interface { - // Size returns whether the Compacter could encode the given block as well - // as its size in case it can. len(v) is always 64. - Size(v []uint64) (sz int, ok bool) - - // Store stores the block using the Compacter's compression method. - // It returns a handle with which the block can be retrieved. - // len(v) is always 64. - Store(v []uint64) uint32 - - // Print writes the data structures associated to the given store to w. - Print(w io.Writer) error - - // Handler returns the name of a function that gets called during trie - // lookup for blocks generated by the Compacter. The function should be of - // the form func (n uint32, b byte) uint64, where n is the index returned by - // the Compacter's Store method and b is the last byte of the UTF-8 - // encoding, where 0x80 <= b < 0xC0, for which to do the lookup in the - // block. - Handler() string -} - -// simpleCompacter is the default Compacter used by builder. It implements a -// normal trie block. -type simpleCompacter builder - -func (b *simpleCompacter) Size([]uint64) (sz int, ok bool) { - return blockSize * b.ValueSize, true -} - -func (b *simpleCompacter) Store(v []uint64) uint32 { - h := uint32(len(b.ValueBlocks) - blockOffset) - b.ValueBlocks = append(b.ValueBlocks, v) - return h -} - -func (b *simpleCompacter) Print(io.Writer) error { - // Structures are printed in print.go. - return nil -} - -func (b *simpleCompacter) Handler() string { - panic("Handler should be special-cased for this Compacter") -} diff --git a/vendor/golang.org/x/text/internal/triegen/print.go b/vendor/golang.org/x/text/internal/triegen/print.go deleted file mode 100644 index 8d9f120bcdf0..000000000000 --- a/vendor/golang.org/x/text/internal/triegen/print.go +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package triegen - -import ( - "bytes" - "fmt" - "io" - "strings" - "text/template" -) - -// print writes all the data structures as well as the code necessary to use the -// trie to w. -func (b *builder) print(w io.Writer) error { - b.Stats.NValueEntries = len(b.ValueBlocks) * blockSize - b.Stats.NValueBytes = len(b.ValueBlocks) * blockSize * b.ValueSize - b.Stats.NIndexEntries = len(b.IndexBlocks) * blockSize - b.Stats.NIndexBytes = len(b.IndexBlocks) * blockSize * b.IndexSize - b.Stats.NHandleBytes = len(b.Trie) * 2 * b.IndexSize - - // If we only have one root trie, all starter blocks are at position 0 and - // we can access the arrays directly. - if len(b.Trie) == 1 { - // At this point we cannot refer to the generated tables directly. - b.ASCIIBlock = b.Name + "Values" - b.StarterBlock = b.Name + "Index" - } else { - // Otherwise we need to have explicit starter indexes in the trie - // structure. - b.ASCIIBlock = "t.ascii" - b.StarterBlock = "t.utf8Start" - } - - b.SourceType = "[]byte" - if err := lookupGen.Execute(w, b); err != nil { - return err - } - - b.SourceType = "string" - if err := lookupGen.Execute(w, b); err != nil { - return err - } - - if err := trieGen.Execute(w, b); err != nil { - return err - } - - for _, c := range b.Compactions { - if err := c.c.Print(w); err != nil { - return err - } - } - - return nil -} - -func printValues(n int, values []uint64) string { - w := &bytes.Buffer{} - boff := n * blockSize - fmt.Fprintf(w, "\t// Block %#x, offset %#x", n, boff) - var newline bool - for i, v := range values { - if i%6 == 0 { - newline = true - } - if v != 0 { - if newline { - fmt.Fprintf(w, "\n") - newline = false - } - fmt.Fprintf(w, "\t%#02x:%#04x, ", boff+i, v) - } - } - return w.String() -} - -func printIndex(b *builder, nr int, n *node) string { - w := &bytes.Buffer{} - boff := nr * blockSize - fmt.Fprintf(w, "\t// Block %#x, offset %#x", nr, boff) - var newline bool - for i, c := range n.children { - if i%8 == 0 { - newline = true - } - if c != nil { - v := b.Compactions[c.index.compaction].Offset + uint32(c.index.index) - if v != 0 { - if newline { - fmt.Fprintf(w, "\n") - newline = false - } - fmt.Fprintf(w, "\t%#02x:%#02x, ", boff+i, v) - } - } - } - return w.String() -} - -var ( - trieGen = template.Must(template.New("trie").Funcs(template.FuncMap{ - "printValues": printValues, - "printIndex": printIndex, - "title": strings.Title, - "dec": func(x int) int { return x - 1 }, - "psize": func(n int) string { - return fmt.Sprintf("%d bytes (%.2f KiB)", n, float64(n)/1024) - }, - }).Parse(trieTemplate)) - lookupGen = template.Must(template.New("lookup").Parse(lookupTemplate)) -) - -// TODO: consider the return type of lookup. It could be uint64, even if the -// internal value type is smaller. We will have to verify this with the -// performance of unicode/norm, which is very sensitive to such changes. -const trieTemplate = `{{$b := .}}{{$multi := gt (len .Trie) 1}} -// {{.Name}}Trie. Total size: {{psize .Size}}. Checksum: {{printf "%08x" .Checksum}}. -type {{.Name}}Trie struct { {{if $multi}} - ascii []{{.ValueType}} // index for ASCII bytes - utf8Start []{{.IndexType}} // index for UTF-8 bytes >= 0xC0 -{{end}}} - -func new{{title .Name}}Trie(i int) *{{.Name}}Trie { {{if $multi}} - h := {{.Name}}TrieHandles[i] - return &{{.Name}}Trie{ {{.Name}}Values[uint32(h.ascii)<<6:], {{.Name}}Index[uint32(h.multi)<<6:] } -} - -type {{.Name}}TrieHandle struct { - ascii, multi {{.IndexType}} -} - -// {{.Name}}TrieHandles: {{len .Trie}} handles, {{.Stats.NHandleBytes}} bytes -var {{.Name}}TrieHandles = [{{len .Trie}}]{{.Name}}TrieHandle{ -{{range .Trie}} { {{.ASCIIIndex}}, {{.StarterIndex}} }, // {{printf "%08x" .Checksum}}: {{.Name}} -{{end}}}{{else}} - return &{{.Name}}Trie{} -} -{{end}} -// lookupValue determines the type of block n and looks up the value for b. -func (t *{{.Name}}Trie) lookupValue(n uint32, b byte) {{.ValueType}}{{$last := dec (len .Compactions)}} { - switch { {{range $i, $c := .Compactions}} - {{if eq $i $last}}default{{else}}case n < {{$c.Cutoff}}{{end}}:{{if ne $i 0}} - n -= {{$c.Offset}}{{end}} - return {{print $b.ValueType}}({{$c.Handler}}){{end}} - } -} - -// {{.Name}}Values: {{len .ValueBlocks}} blocks, {{.Stats.NValueEntries}} entries, {{.Stats.NValueBytes}} bytes -// The third block is the zero block. -var {{.Name}}Values = [{{.Stats.NValueEntries}}]{{.ValueType}} { -{{range $i, $v := .ValueBlocks}}{{printValues $i $v}} -{{end}}} - -// {{.Name}}Index: {{len .IndexBlocks}} blocks, {{.Stats.NIndexEntries}} entries, {{.Stats.NIndexBytes}} bytes -// Block 0 is the zero block. -var {{.Name}}Index = [{{.Stats.NIndexEntries}}]{{.IndexType}} { -{{range $i, $v := .IndexBlocks}}{{printIndex $b $i $v}} -{{end}}} -` - -// TODO: consider allowing zero-length strings after evaluating performance with -// unicode/norm. -const lookupTemplate = ` -// lookup{{if eq .SourceType "string"}}String{{end}} returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *{{.Name}}Trie) lookup{{if eq .SourceType "string"}}String{{end}}(s {{.SourceType}}) (v {{.ValueType}}, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return {{.ASCIIBlock}}[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := {{.StarterBlock}}[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := {{.StarterBlock}}[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = {{.Name}}Index[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := {{.StarterBlock}}[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = {{.Name}}Index[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = {{.Name}}Index[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookup{{if eq .SourceType "string"}}String{{end}}Unsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *{{.Name}}Trie) lookup{{if eq .SourceType "string"}}String{{end}}Unsafe(s {{.SourceType}}) {{.ValueType}} { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return {{.ASCIIBlock}}[c0] - } - i := {{.StarterBlock}}[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = {{.Name}}Index[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = {{.Name}}Index[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} -` diff --git a/vendor/golang.org/x/text/internal/triegen/triegen.go b/vendor/golang.org/x/text/internal/triegen/triegen.go deleted file mode 100644 index adb01081247b..000000000000 --- a/vendor/golang.org/x/text/internal/triegen/triegen.go +++ /dev/null @@ -1,494 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package triegen implements a code generator for a trie for associating -// unsigned integer values with UTF-8 encoded runes. -// -// Many of the go.text packages use tries for storing per-rune information. A -// trie is especially useful if many of the runes have the same value. If this -// is the case, many blocks can be expected to be shared allowing for -// information on many runes to be stored in little space. -// -// As most of the lookups are done directly on []byte slices, the tries use the -// UTF-8 bytes directly for the lookup. This saves a conversion from UTF-8 to -// runes and contributes a little bit to better performance. It also naturally -// provides a fast path for ASCII. -// -// Space is also an issue. There are many code points defined in Unicode and as -// a result tables can get quite large. So every byte counts. The triegen -// package automatically chooses the smallest integer values to represent the -// tables. Compacters allow further compression of the trie by allowing for -// alternative representations of individual trie blocks. -// -// triegen allows generating multiple tries as a single structure. This is -// useful when, for example, one wants to generate tries for several languages -// that have a lot of values in common. Some existing libraries for -// internationalization store all per-language data as a dynamically loadable -// chunk. The go.text packages are designed with the assumption that the user -// typically wants to compile in support for all supported languages, in line -// with the approach common to Go to create a single standalone binary. The -// multi-root trie approach can give significant storage savings in this -// scenario. -// -// triegen generates both tables and code. The code is optimized to use the -// automatically chosen data types. The following code is generated for a Trie -// or multiple Tries named "foo": -// - type fooTrie -// The trie type. -// -// - func newFooTrie(x int) *fooTrie -// Trie constructor, where x is the index of the trie passed to Gen. -// -// - func (t *fooTrie) lookup(s []byte) (v uintX, sz int) -// The lookup method, where uintX is automatically chosen. -// -// - func lookupString, lookupUnsafe and lookupStringUnsafe -// Variants of the above. -// -// - var fooValues and fooIndex and any tables generated by Compacters. -// The core trie data. -// -// - var fooTrieHandles -// Indexes of starter blocks in case of multiple trie roots. -// -// It is recommended that users test the generated trie by checking the returned -// value for every rune. Such exhaustive tests are possible as the the number of -// runes in Unicode is limited. -package triegen // import "golang.org/x/text/internal/triegen" - -// TODO: Arguably, the internally optimized data types would not have to be -// exposed in the generated API. We could also investigate not generating the -// code, but using it through a package. We would have to investigate the impact -// on performance of making such change, though. For packages like unicode/norm, -// small changes like this could tank performance. - -import ( - "encoding/binary" - "fmt" - "hash/crc64" - "io" - "log" - "unicode/utf8" -) - -// builder builds a set of tries for associating values with runes. The set of -// tries can share common index and value blocks. -type builder struct { - Name string - - // ValueType is the type of the trie values looked up. - ValueType string - - // ValueSize is the byte size of the ValueType. - ValueSize int - - // IndexType is the type of trie index values used for all UTF-8 bytes of - // a rune except the last one. - IndexType string - - // IndexSize is the byte size of the IndexType. - IndexSize int - - // SourceType is used when generating the lookup functions. If the user - // requests StringSupport, all lookup functions will be generated for - // string input as well. - SourceType string - - Trie []*Trie - - IndexBlocks []*node - ValueBlocks [][]uint64 - Compactions []compaction - Checksum uint64 - - ASCIIBlock string - StarterBlock string - - indexBlockIdx map[uint64]int - valueBlockIdx map[uint64]nodeIndex - asciiBlockIdx map[uint64]int - - // Stats are used to fill out the template. - Stats struct { - NValueEntries int - NValueBytes int - NIndexEntries int - NIndexBytes int - NHandleBytes int - } - - err error -} - -// A nodeIndex encodes the index of a node, which is defined by the compaction -// which stores it and an index within the compaction. For internal nodes, the -// compaction is always 0. -type nodeIndex struct { - compaction int - index int -} - -// compaction keeps track of stats used for the compaction. -type compaction struct { - c Compacter - blocks []*node - maxHandle uint32 - totalSize int - - // Used by template-based generator and thus exported. - Cutoff uint32 - Offset uint32 - Handler string -} - -func (b *builder) setError(err error) { - if b.err == nil { - b.err = err - } -} - -// An Option can be passed to Gen. -type Option func(b *builder) error - -// Compact configures the trie generator to use the given Compacter. -func Compact(c Compacter) Option { - return func(b *builder) error { - b.Compactions = append(b.Compactions, compaction{ - c: c, - Handler: c.Handler() + "(n, b)"}) - return nil - } -} - -// Gen writes Go code for a shared trie lookup structure to w for the given -// Tries. The generated trie type will be called nameTrie. newNameTrie(x) will -// return the *nameTrie for tries[x]. A value can be looked up by using one of -// the various lookup methods defined on nameTrie. It returns the table size of -// the generated trie. -func Gen(w io.Writer, name string, tries []*Trie, opts ...Option) (sz int, err error) { - // The index contains two dummy blocks, followed by the zero block. The zero - // block is at offset 0x80, so that the offset for the zero block for - // continuation bytes is 0. - b := &builder{ - Name: name, - Trie: tries, - IndexBlocks: []*node{{}, {}, {}}, - Compactions: []compaction{{ - Handler: name + "Values[n<<6+uint32(b)]", - }}, - // The 0 key in indexBlockIdx and valueBlockIdx is the hash of the zero - // block. - indexBlockIdx: map[uint64]int{0: 0}, - valueBlockIdx: map[uint64]nodeIndex{0: {}}, - asciiBlockIdx: map[uint64]int{}, - } - b.Compactions[0].c = (*simpleCompacter)(b) - - for _, f := range opts { - if err := f(b); err != nil { - return 0, err - } - } - b.build() - if b.err != nil { - return 0, b.err - } - if err = b.print(w); err != nil { - return 0, err - } - return b.Size(), nil -} - -// A Trie represents a single root node of a trie. A builder may build several -// overlapping tries at once. -type Trie struct { - root *node - - hiddenTrie -} - -// hiddenTrie contains values we want to be visible to the template generator, -// but hidden from the API documentation. -type hiddenTrie struct { - Name string - Checksum uint64 - ASCIIIndex int - StarterIndex int -} - -// NewTrie returns a new trie root. -func NewTrie(name string) *Trie { - return &Trie{ - &node{ - children: make([]*node, blockSize), - values: make([]uint64, utf8.RuneSelf), - }, - hiddenTrie{Name: name}, - } -} - -// Gen is a convenience wrapper around the Gen func passing t as the only trie -// and uses the name passed to NewTrie. It returns the size of the generated -// tables. -func (t *Trie) Gen(w io.Writer, opts ...Option) (sz int, err error) { - return Gen(w, t.Name, []*Trie{t}, opts...) -} - -// node is a node of the intermediate trie structure. -type node struct { - // children holds this node's children. It is always of length 64. - // A child node may be nil. - children []*node - - // values contains the values of this node. If it is non-nil, this node is - // either a root or leaf node: - // For root nodes, len(values) == 128 and it maps the bytes in [0x00, 0x7F]. - // For leaf nodes, len(values) == 64 and it maps the bytes in [0x80, 0xBF]. - values []uint64 - - index nodeIndex -} - -// Insert associates value with the given rune. Insert will panic if a non-zero -// value is passed for an invalid rune. -func (t *Trie) Insert(r rune, value uint64) { - if value == 0 { - return - } - s := string(r) - if []rune(s)[0] != r && value != 0 { - // Note: The UCD tables will always assign what amounts to a zero value - // to a surrogate. Allowing a zero value for an illegal rune allows - // users to iterate over [0..MaxRune] without having to explicitly - // exclude surrogates, which would be tedious. - panic(fmt.Sprintf("triegen: non-zero value for invalid rune %U", r)) - } - if len(s) == 1 { - // It is a root node value (ASCII). - t.root.values[s[0]] = value - return - } - - n := t.root - for ; len(s) > 1; s = s[1:] { - if n.children == nil { - n.children = make([]*node, blockSize) - } - p := s[0] % blockSize - c := n.children[p] - if c == nil { - c = &node{} - n.children[p] = c - } - if len(s) > 2 && c.values != nil { - log.Fatalf("triegen: insert(%U): found internal node with values", r) - } - n = c - } - if n.values == nil { - n.values = make([]uint64, blockSize) - } - if n.children != nil { - log.Fatalf("triegen: insert(%U): found leaf node that also has child nodes", r) - } - n.values[s[0]-0x80] = value -} - -// Size returns the number of bytes the generated trie will take to store. It -// needs to be exported as it is used in the templates. -func (b *builder) Size() int { - // Index blocks. - sz := len(b.IndexBlocks) * blockSize * b.IndexSize - - // Skip the first compaction, which represents the normal value blocks, as - // its totalSize does not account for the ASCII blocks, which are managed - // separately. - sz += len(b.ValueBlocks) * blockSize * b.ValueSize - for _, c := range b.Compactions[1:] { - sz += c.totalSize - } - - // TODO: this computation does not account for the fixed overhead of a using - // a compaction, either code or data. As for data, though, the typical - // overhead of data is in the order of bytes (2 bytes for cases). Further, - // the savings of using a compaction should anyway be substantial for it to - // be worth it. - - // For multi-root tries, we also need to account for the handles. - if len(b.Trie) > 1 { - sz += 2 * b.IndexSize * len(b.Trie) - } - return sz -} - -func (b *builder) build() { - // Compute the sizes of the values. - var vmax uint64 - for _, t := range b.Trie { - vmax = maxValue(t.root, vmax) - } - b.ValueType, b.ValueSize = getIntType(vmax) - - // Compute all block allocations. - // TODO: first compute the ASCII blocks for all tries and then the other - // nodes. ASCII blocks are more restricted in placement, as they require two - // blocks to be placed consecutively. Processing them first may improve - // sharing (at least one zero block can be expected to be saved.) - for _, t := range b.Trie { - b.Checksum += b.buildTrie(t) - } - - // Compute the offsets for all the Compacters. - offset := uint32(0) - for i := range b.Compactions { - c := &b.Compactions[i] - c.Offset = offset - offset += c.maxHandle + 1 - c.Cutoff = offset - } - - // Compute the sizes of indexes. - // TODO: different byte positions could have different sizes. So far we have - // not found a case where this is beneficial. - imax := uint64(b.Compactions[len(b.Compactions)-1].Cutoff) - for _, ib := range b.IndexBlocks { - if x := uint64(ib.index.index); x > imax { - imax = x - } - } - b.IndexType, b.IndexSize = getIntType(imax) -} - -func maxValue(n *node, max uint64) uint64 { - if n == nil { - return max - } - for _, c := range n.children { - max = maxValue(c, max) - } - for _, v := range n.values { - if max < v { - max = v - } - } - return max -} - -func getIntType(v uint64) (string, int) { - switch { - case v < 1<<8: - return "uint8", 1 - case v < 1<<16: - return "uint16", 2 - case v < 1<<32: - return "uint32", 4 - } - return "uint64", 8 -} - -const ( - blockSize = 64 - - // Subtract two blocks to offset 0x80, the first continuation byte. - blockOffset = 2 - - // Subtract three blocks to offset 0xC0, the first non-ASCII starter. - rootBlockOffset = 3 -) - -var crcTable = crc64.MakeTable(crc64.ISO) - -func (b *builder) buildTrie(t *Trie) uint64 { - n := t.root - - // Get the ASCII offset. For the first trie, the ASCII block will be at - // position 0. - hasher := crc64.New(crcTable) - binary.Write(hasher, binary.BigEndian, n.values) - hash := hasher.Sum64() - - v, ok := b.asciiBlockIdx[hash] - if !ok { - v = len(b.ValueBlocks) - b.asciiBlockIdx[hash] = v - - b.ValueBlocks = append(b.ValueBlocks, n.values[:blockSize], n.values[blockSize:]) - if v == 0 { - // Add the zero block at position 2 so that it will be assigned a - // zero reference in the lookup blocks. - // TODO: always do this? This would allow us to remove a check from - // the trie lookup, but at the expense of extra space. Analyze - // performance for unicode/norm. - b.ValueBlocks = append(b.ValueBlocks, make([]uint64, blockSize)) - } - } - t.ASCIIIndex = v - - // Compute remaining offsets. - t.Checksum = b.computeOffsets(n, true) - // We already subtracted the normal blockOffset from the index. Subtract the - // difference for starter bytes. - t.StarterIndex = n.index.index - (rootBlockOffset - blockOffset) - return t.Checksum -} - -func (b *builder) computeOffsets(n *node, root bool) uint64 { - // For the first trie, the root lookup block will be at position 3, which is - // the offset for UTF-8 non-ASCII starter bytes. - first := len(b.IndexBlocks) == rootBlockOffset - if first { - b.IndexBlocks = append(b.IndexBlocks, n) - } - - // We special-case the cases where all values recursively are 0. This allows - // for the use of a zero block to which all such values can be directed. - hash := uint64(0) - if n.children != nil || n.values != nil { - hasher := crc64.New(crcTable) - for _, c := range n.children { - var v uint64 - if c != nil { - v = b.computeOffsets(c, false) - } - binary.Write(hasher, binary.BigEndian, v) - } - binary.Write(hasher, binary.BigEndian, n.values) - hash = hasher.Sum64() - } - - if first { - b.indexBlockIdx[hash] = rootBlockOffset - blockOffset - } - - // Compacters don't apply to internal nodes. - if n.children != nil { - v, ok := b.indexBlockIdx[hash] - if !ok { - v = len(b.IndexBlocks) - blockOffset - b.IndexBlocks = append(b.IndexBlocks, n) - b.indexBlockIdx[hash] = v - } - n.index = nodeIndex{0, v} - } else { - h, ok := b.valueBlockIdx[hash] - if !ok { - bestI, bestSize := 0, blockSize*b.ValueSize - for i, c := range b.Compactions[1:] { - if sz, ok := c.c.Size(n.values); ok && bestSize > sz { - bestI, bestSize = i+1, sz - } - } - c := &b.Compactions[bestI] - c.totalSize += bestSize - v := c.c.Store(n.values) - if c.maxHandle < v { - c.maxHandle = v - } - h = nodeIndex{bestI, int(v)} - b.valueBlockIdx[hash] = h - } - n.index = h - } - return hash -} diff --git a/vendor/golang.org/x/text/internal/ucd/ucd.go b/vendor/golang.org/x/text/internal/ucd/ucd.go deleted file mode 100644 index 8c45b5f3d026..000000000000 --- a/vendor/golang.org/x/text/internal/ucd/ucd.go +++ /dev/null @@ -1,371 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ucd provides a parser for Unicode Character Database files, the -// format of which is defined in http://www.unicode.org/reports/tr44/. See -// http://www.unicode.org/Public/UCD/latest/ucd/ for example files. -// -// It currently does not support substitutions of missing fields. -package ucd // import "golang.org/x/text/internal/ucd" - -import ( - "bufio" - "errors" - "fmt" - "io" - "log" - "regexp" - "strconv" - "strings" -) - -// UnicodeData.txt fields. -const ( - CodePoint = iota - Name - GeneralCategory - CanonicalCombiningClass - BidiClass - DecompMapping - DecimalValue - DigitValue - NumericValue - BidiMirrored - Unicode1Name - ISOComment - SimpleUppercaseMapping - SimpleLowercaseMapping - SimpleTitlecaseMapping -) - -// Parse calls f for each entry in the given reader of a UCD file. It will close -// the reader upon return. It will call log.Fatal if any error occurred. -// -// This implements the most common usage pattern of using Parser. -func Parse(r io.ReadCloser, f func(p *Parser)) { - defer r.Close() - - p := New(r) - for p.Next() { - f(p) - } - if err := p.Err(); err != nil { - r.Close() // os.Exit will cause defers not to be called. - log.Fatal(err) - } -} - -// An Option is used to configure a Parser. -type Option func(p *Parser) - -func keepRanges(p *Parser) { - p.keepRanges = true -} - -var ( - // KeepRanges prevents the expansion of ranges. The raw ranges can be - // obtained by calling Range(0) on the parser. - KeepRanges Option = keepRanges -) - -// The Part option register a handler for lines starting with a '@'. The text -// after a '@' is available as the first field. Comments are handled as usual. -func Part(f func(p *Parser)) Option { - return func(p *Parser) { - p.partHandler = f - } -} - -// The CommentHandler option passes comments that are on a line by itself to -// a given handler. -func CommentHandler(f func(s string)) Option { - return func(p *Parser) { - p.commentHandler = f - } -} - -// A Parser parses Unicode Character Database (UCD) files. -type Parser struct { - scanner *bufio.Scanner - - keepRanges bool // Don't expand rune ranges in field 0. - - err error - comment string - field []string - // parsedRange is needed in case Range(0) is called more than once for one - // field. In some cases this requires scanning ahead. - line int - parsedRange bool - rangeStart, rangeEnd rune - - partHandler func(p *Parser) - commentHandler func(s string) -} - -func (p *Parser) setError(err error, msg string) { - if p.err == nil && err != nil { - if msg == "" { - p.err = fmt.Errorf("ucd:line:%d: %v", p.line, err) - } else { - p.err = fmt.Errorf("ucd:line:%d:%s: %v", p.line, msg, err) - } - } -} - -func (p *Parser) getField(i int) string { - if i >= len(p.field) { - return "" - } - return p.field[i] -} - -// Err returns a non-nil error if any error occurred during parsing. -func (p *Parser) Err() error { - return p.err -} - -// New returns a Parser for the given Reader. -func New(r io.Reader, o ...Option) *Parser { - p := &Parser{ - scanner: bufio.NewScanner(r), - } - for _, f := range o { - f(p) - } - return p -} - -// Next parses the next line in the file. It returns true if a line was parsed -// and false if it reached the end of the file. -func (p *Parser) Next() bool { - if !p.keepRanges && p.rangeStart < p.rangeEnd { - p.rangeStart++ - return true - } - p.comment = "" - p.field = p.field[:0] - p.parsedRange = false - - for p.scanner.Scan() && p.err == nil { - p.line++ - s := p.scanner.Text() - if s == "" { - continue - } - if s[0] == '#' { - if p.commentHandler != nil { - p.commentHandler(strings.TrimSpace(s[1:])) - } - continue - } - - // Parse line - if i := strings.IndexByte(s, '#'); i != -1 { - p.comment = strings.TrimSpace(s[i+1:]) - s = s[:i] - } - if s[0] == '@' { - if p.partHandler != nil { - p.field = append(p.field, strings.TrimSpace(s[1:])) - p.partHandler(p) - p.field = p.field[:0] - } - p.comment = "" - continue - } - for { - i := strings.IndexByte(s, ';') - if i == -1 { - p.field = append(p.field, strings.TrimSpace(s)) - break - } - p.field = append(p.field, strings.TrimSpace(s[:i])) - s = s[i+1:] - } - if !p.keepRanges { - p.rangeStart, p.rangeEnd = p.getRange(0) - } - return true - } - p.setError(p.scanner.Err(), "scanner failed") - return false -} - -func parseRune(b string) (rune, error) { - if len(b) > 2 && b[0] == 'U' && b[1] == '+' { - b = b[2:] - } - x, err := strconv.ParseUint(b, 16, 32) - return rune(x), err -} - -func (p *Parser) parseRune(s string) rune { - x, err := parseRune(s) - p.setError(err, "failed to parse rune") - return x -} - -// Rune parses and returns field i as a rune. -func (p *Parser) Rune(i int) rune { - if i > 0 || p.keepRanges { - return p.parseRune(p.getField(i)) - } - return p.rangeStart -} - -// Runes interprets and returns field i as a sequence of runes. -func (p *Parser) Runes(i int) (runes []rune) { - add := func(s string) { - if s = strings.TrimSpace(s); len(s) > 0 { - runes = append(runes, p.parseRune(s)) - } - } - for b := p.getField(i); ; { - i := strings.IndexByte(b, ' ') - if i == -1 { - add(b) - break - } - add(b[:i]) - b = b[i+1:] - } - return -} - -var ( - errIncorrectLegacyRange = errors.New("ucd: unmatched <* First>") - - // reRange matches one line of a legacy rune range. - reRange = regexp.MustCompile("^([0-9A-F]*);<([^,]*), ([^>]*)>(.*)$") -) - -// Range parses and returns field i as a rune range. A range is inclusive at -// both ends. If the field only has one rune, first and last will be identical. -// It supports the legacy format for ranges used in UnicodeData.txt. -func (p *Parser) Range(i int) (first, last rune) { - if !p.keepRanges { - return p.rangeStart, p.rangeStart - } - return p.getRange(i) -} - -func (p *Parser) getRange(i int) (first, last rune) { - b := p.getField(i) - if k := strings.Index(b, ".."); k != -1 { - return p.parseRune(b[:k]), p.parseRune(b[k+2:]) - } - // The first field may not be a rune, in which case we may ignore any error - // and set the range as 0..0. - x, err := parseRune(b) - if err != nil { - // Disable range parsing henceforth. This ensures that an error will be - // returned if the user subsequently will try to parse this field as - // a Rune. - p.keepRanges = true - } - // Special case for UnicodeData that was retained for backwards compatibility. - if i == 0 && len(p.field) > 1 && strings.HasSuffix(p.field[1], "First>") { - if p.parsedRange { - return p.rangeStart, p.rangeEnd - } - mf := reRange.FindStringSubmatch(p.scanner.Text()) - p.line++ - if mf == nil || !p.scanner.Scan() { - p.setError(errIncorrectLegacyRange, "") - return x, x - } - // Using Bytes would be more efficient here, but Text is a lot easier - // and this is not a frequent case. - ml := reRange.FindStringSubmatch(p.scanner.Text()) - if ml == nil || mf[2] != ml[2] || ml[3] != "Last" || mf[4] != ml[4] { - p.setError(errIncorrectLegacyRange, "") - return x, x - } - p.rangeStart, p.rangeEnd = x, p.parseRune(p.scanner.Text()[:len(ml[1])]) - p.parsedRange = true - return p.rangeStart, p.rangeEnd - } - return x, x -} - -// bools recognizes all valid UCD boolean values. -var bools = map[string]bool{ - "": false, - "N": false, - "No": false, - "F": false, - "False": false, - "Y": true, - "Yes": true, - "T": true, - "True": true, -} - -// Bool parses and returns field i as a boolean value. -func (p *Parser) Bool(i int) bool { - f := p.getField(i) - for s, v := range bools { - if f == s { - return v - } - } - p.setError(strconv.ErrSyntax, "error parsing bool") - return false -} - -// Int parses and returns field i as an integer value. -func (p *Parser) Int(i int) int { - x, err := strconv.ParseInt(string(p.getField(i)), 10, 64) - p.setError(err, "error parsing int") - return int(x) -} - -// Uint parses and returns field i as an unsigned integer value. -func (p *Parser) Uint(i int) uint { - x, err := strconv.ParseUint(string(p.getField(i)), 10, 64) - p.setError(err, "error parsing uint") - return uint(x) -} - -// Float parses and returns field i as a decimal value. -func (p *Parser) Float(i int) float64 { - x, err := strconv.ParseFloat(string(p.getField(i)), 64) - p.setError(err, "error parsing float") - return x -} - -// String parses and returns field i as a string value. -func (p *Parser) String(i int) string { - return string(p.getField(i)) -} - -// Strings parses and returns field i as a space-separated list of strings. -func (p *Parser) Strings(i int) []string { - ss := strings.Split(string(p.getField(i)), " ") - for i, s := range ss { - ss[i] = strings.TrimSpace(s) - } - return ss -} - -// Comment returns the comments for the current line. -func (p *Parser) Comment() string { - return string(p.comment) -} - -var errUndefinedEnum = errors.New("ucd: undefined enum value") - -// Enum interprets and returns field i as a value that must be one of the values -// in enum. -func (p *Parser) Enum(i int, enum ...string) string { - f := p.getField(i) - for _, s := range enum { - if f == s { - return s - } - } - p.setError(errUndefinedEnum, "error parsing enum") - return "" -} diff --git a/vendor/golang.org/x/text/language/gen.go b/vendor/golang.org/x/text/language/gen.go deleted file mode 100644 index 302f1940aaf4..000000000000 --- a/vendor/golang.org/x/text/language/gen.go +++ /dev/null @@ -1,1712 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Language tag table generator. -// Data read from the web. - -package main - -import ( - "bufio" - "flag" - "fmt" - "io" - "io/ioutil" - "log" - "math" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/tag" - "golang.org/x/text/unicode/cldr" -) - -var ( - test = flag.Bool("test", - false, - "test existing tables; can be used to compare web data with package data.") - outputFile = flag.String("output", - "tables.go", - "output file for generated tables") -) - -var comment = []string{ - ` -lang holds an alphabetically sorted list of ISO-639 language identifiers. -All entries are 4 bytes. The index of the identifier (divided by 4) is the language tag. -For 2-byte language identifiers, the two successive bytes have the following meaning: - - if the first letter of the 2- and 3-letter ISO codes are the same: - the second and third letter of the 3-letter ISO code. - - otherwise: a 0 and a by 2 bits right-shifted index into altLangISO3. -For 3-byte language identifiers the 4th byte is 0.`, - ` -langNoIndex is a bit vector of all 3-letter language codes that are not used as an index -in lookup tables. The language ids for these language codes are derived directly -from the letters and are not consecutive.`, - ` -altLangISO3 holds an alphabetically sorted list of 3-letter language code alternatives -to 2-letter language codes that cannot be derived using the method described above. -Each 3-letter code is followed by its 1-byte langID.`, - ` -altLangIndex is used to convert indexes in altLangISO3 to langIDs.`, - ` -langAliasMap maps langIDs to their suggested replacements.`, - ` -script is an alphabetically sorted list of ISO 15924 codes. The index -of the script in the string, divided by 4, is the internal scriptID.`, - ` -isoRegionOffset needs to be added to the index of regionISO to obtain the regionID -for 2-letter ISO codes. (The first isoRegionOffset regionIDs are reserved for -the UN.M49 codes used for groups.)`, - ` -regionISO holds a list of alphabetically sorted 2-letter ISO region codes. -Each 2-letter codes is followed by two bytes with the following meaning: - - [A-Z}{2}: the first letter of the 2-letter code plus these two - letters form the 3-letter ISO code. - - 0, n: index into altRegionISO3.`, - ` -regionTypes defines the status of a region for various standards.`, - ` -m49 maps regionIDs to UN.M49 codes. The first isoRegionOffset entries are -codes indicating collections of regions.`, - ` -m49Index gives indexes into fromM49 based on the three most significant bits -of a 10-bit UN.M49 code. To search an UN.M49 code in fromM49, search in - fromM49[m49Index[msb39(code)]:m49Index[msb3(code)+1]] -for an entry where the first 7 bits match the 7 lsb of the UN.M49 code. -The region code is stored in the 9 lsb of the indexed value.`, - ` -fromM49 contains entries to map UN.M49 codes to regions. See m49Index for details.`, - ` -altRegionISO3 holds a list of 3-letter region codes that cannot be -mapped to 2-letter codes using the default algorithm. This is a short list.`, - ` -altRegionIDs holds a list of regionIDs the positions of which match those -of the 3-letter ISO codes in altRegionISO3.`, - ` -variantNumSpecialized is the number of specialized variants in variants.`, - ` -suppressScript is an index from langID to the dominant script for that language, -if it exists. If a script is given, it should be suppressed from the language tag.`, - ` -likelyLang is a lookup table, indexed by langID, for the most likely -scripts and regions given incomplete information. If more entries exist for a -given language, region and script are the index and size respectively -of the list in likelyLangList.`, - ` -likelyLangList holds lists info associated with likelyLang.`, - ` -likelyRegion is a lookup table, indexed by regionID, for the most likely -languages and scripts given incomplete information. If more entries exist -for a given regionID, lang and script are the index and size respectively -of the list in likelyRegionList. -TODO: exclude containers and user-definable regions from the list.`, - ` -likelyRegionList holds lists info associated with likelyRegion.`, - ` -likelyScript is a lookup table, indexed by scriptID, for the most likely -languages and regions given a script.`, - ` -matchLang holds pairs of langIDs of base languages that are typically -mutually intelligible. Each pair is associated with a confidence and -whether the intelligibility goes one or both ways.`, - ` -matchScript holds pairs of scriptIDs where readers of one script -can typically also read the other. Each is associated with a confidence.`, - ` -nRegionGroups is the number of region groups.`, - ` -regionInclusion maps region identifiers to sets of regions in regionInclusionBits, -where each set holds all groupings that are directly connected in a region -containment graph.`, - ` -regionInclusionBits is an array of bit vectors where every vector represents -a set of region groupings. These sets are used to compute the distance -between two regions for the purpose of language matching.`, - ` -regionInclusionNext marks, for each entry in regionInclusionBits, the set of -all groups that are reachable from the groups set in the respective entry.`, -} - -// TODO: consider changing some of these structures to tries. This can reduce -// memory, but may increase the need for memory allocations. This could be -// mitigated if we can piggyback on language tags for common cases. - -func failOnError(e error) { - if e != nil { - log.Panic(e) - } -} - -type setType int - -const ( - Indexed setType = 1 + iota // all elements must be of same size - Linear -) - -type stringSet struct { - s []string - sorted, frozen bool - - // We often need to update values after the creation of an index is completed. - // We include a convenience map for keeping track of this. - update map[string]string - typ setType // used for checking. -} - -func (ss *stringSet) clone() stringSet { - c := *ss - c.s = append([]string(nil), c.s...) - return c -} - -func (ss *stringSet) setType(t setType) { - if ss.typ != t && ss.typ != 0 { - log.Panicf("type %d cannot be assigned as it was already %d", t, ss.typ) - } -} - -// parse parses a whitespace-separated string and initializes ss with its -// components. -func (ss *stringSet) parse(s string) { - scan := bufio.NewScanner(strings.NewReader(s)) - scan.Split(bufio.ScanWords) - for scan.Scan() { - ss.add(scan.Text()) - } -} - -func (ss *stringSet) assertChangeable() { - if ss.frozen { - log.Panic("attempt to modify a frozen stringSet") - } -} - -func (ss *stringSet) add(s string) { - ss.assertChangeable() - ss.s = append(ss.s, s) - ss.sorted = ss.frozen -} - -func (ss *stringSet) freeze() { - ss.compact() - ss.frozen = true -} - -func (ss *stringSet) compact() { - if ss.sorted { - return - } - a := ss.s - sort.Strings(a) - k := 0 - for i := 1; i < len(a); i++ { - if a[k] != a[i] { - a[k+1] = a[i] - k++ - } - } - ss.s = a[:k+1] - ss.sorted = ss.frozen -} - -type funcSorter struct { - fn func(a, b string) bool - sort.StringSlice -} - -func (s funcSorter) Less(i, j int) bool { - return s.fn(s.StringSlice[i], s.StringSlice[j]) -} - -func (ss *stringSet) sortFunc(f func(a, b string) bool) { - ss.compact() - sort.Sort(funcSorter{f, sort.StringSlice(ss.s)}) -} - -func (ss *stringSet) remove(s string) { - ss.assertChangeable() - if i, ok := ss.find(s); ok { - copy(ss.s[i:], ss.s[i+1:]) - ss.s = ss.s[:len(ss.s)-1] - } -} - -func (ss *stringSet) replace(ol, nu string) { - ss.s[ss.index(ol)] = nu - ss.sorted = ss.frozen -} - -func (ss *stringSet) index(s string) int { - ss.setType(Indexed) - i, ok := ss.find(s) - if !ok { - if i < len(ss.s) { - log.Panicf("find: item %q is not in list. Closest match is %q.", s, ss.s[i]) - } - log.Panicf("find: item %q is not in list", s) - - } - return i -} - -func (ss *stringSet) find(s string) (int, bool) { - ss.compact() - i := sort.SearchStrings(ss.s, s) - return i, i != len(ss.s) && ss.s[i] == s -} - -func (ss *stringSet) slice() []string { - ss.compact() - return ss.s -} - -func (ss *stringSet) updateLater(v, key string) { - if ss.update == nil { - ss.update = map[string]string{} - } - ss.update[v] = key -} - -// join joins the string and ensures that all entries are of the same length. -func (ss *stringSet) join() string { - ss.setType(Indexed) - n := len(ss.s[0]) - for _, s := range ss.s { - if len(s) != n { - log.Panicf("join: not all entries are of the same length: %q", s) - } - } - ss.s = append(ss.s, strings.Repeat("\xff", n)) - return strings.Join(ss.s, "") -} - -// ianaEntry holds information for an entry in the IANA Language Subtag Repository. -// All types use the same entry. -// See http://tools.ietf.org/html/bcp47#section-5.1 for a description of the various -// fields. -type ianaEntry struct { - typ string - description []string - scope string - added string - preferred string - deprecated string - suppressScript string - macro string - prefix []string -} - -type builder struct { - w *gen.CodeWriter - hw io.Writer // MultiWriter for w and w.Hash - data *cldr.CLDR - supp *cldr.SupplementalData - - // indices - locale stringSet // common locales - lang stringSet // canonical language ids (2 or 3 letter ISO codes) with data - langNoIndex stringSet // 3-letter ISO codes with no associated data - script stringSet // 4-letter ISO codes - region stringSet // 2-letter ISO or 3-digit UN M49 codes - variant stringSet // 4-8-alphanumeric variant code. - - // Region codes that are groups with their corresponding group IDs. - groups map[int]index - - // langInfo - registry map[string]*ianaEntry -} - -type index uint - -func newBuilder(w *gen.CodeWriter) *builder { - r := gen.OpenCLDRCoreZip() - defer r.Close() - d := &cldr.Decoder{} - data, err := d.DecodeZip(r) - failOnError(err) - b := builder{ - w: w, - hw: io.MultiWriter(w, w.Hash), - data: data, - supp: data.Supplemental(), - } - b.parseRegistry() - return &b -} - -func (b *builder) parseRegistry() { - r := gen.OpenIANAFile("assignments/language-subtag-registry") - defer r.Close() - b.registry = make(map[string]*ianaEntry) - - scan := bufio.NewScanner(r) - scan.Split(bufio.ScanWords) - var record *ianaEntry - for more := scan.Scan(); more; { - key := scan.Text() - more = scan.Scan() - value := scan.Text() - switch key { - case "Type:": - record = &ianaEntry{typ: value} - case "Subtag:", "Tag:": - if s := strings.SplitN(value, "..", 2); len(s) > 1 { - for a := s[0]; a <= s[1]; a = inc(a) { - b.addToRegistry(a, record) - } - } else { - b.addToRegistry(value, record) - } - case "Suppress-Script:": - record.suppressScript = value - case "Added:": - record.added = value - case "Deprecated:": - record.deprecated = value - case "Macrolanguage:": - record.macro = value - case "Preferred-Value:": - record.preferred = value - case "Prefix:": - record.prefix = append(record.prefix, value) - case "Scope:": - record.scope = value - case "Description:": - buf := []byte(value) - for more = scan.Scan(); more; more = scan.Scan() { - b := scan.Bytes() - if b[0] == '%' || b[len(b)-1] == ':' { - break - } - buf = append(buf, ' ') - buf = append(buf, b...) - } - record.description = append(record.description, string(buf)) - continue - default: - continue - } - more = scan.Scan() - } - if scan.Err() != nil { - log.Panic(scan.Err()) - } -} - -func (b *builder) addToRegistry(key string, entry *ianaEntry) { - if info, ok := b.registry[key]; ok { - if info.typ != "language" || entry.typ != "extlang" { - log.Fatalf("parseRegistry: tag %q already exists", key) - } - } else { - b.registry[key] = entry - } -} - -var commentIndex = make(map[string]string) - -func init() { - for _, s := range comment { - key := strings.TrimSpace(strings.SplitN(s, " ", 2)[0]) - commentIndex[key] = s - } -} - -func (b *builder) comment(name string) { - if s := commentIndex[name]; len(s) > 0 { - b.w.WriteComment(s) - } else { - fmt.Fprintln(b.w) - } -} - -func (b *builder) pf(f string, x ...interface{}) { - fmt.Fprintf(b.hw, f, x...) - fmt.Fprint(b.hw, "\n") -} - -func (b *builder) p(x ...interface{}) { - fmt.Fprintln(b.hw, x...) -} - -func (b *builder) addSize(s int) { - b.w.Size += s - b.pf("// Size: %d bytes", s) -} - -func (b *builder) writeConst(name string, x interface{}) { - b.comment(name) - b.w.WriteConst(name, x) -} - -// writeConsts computes f(v) for all v in values and writes the results -// as constants named _v to a single constant block. -func (b *builder) writeConsts(f func(string) int, values ...string) { - b.pf("const (") - for _, v := range values { - b.pf("\t_%s = %v", v, f(v)) - } - b.pf(")") -} - -// writeType writes the type of the given value, which must be a struct. -func (b *builder) writeType(value interface{}) { - b.comment(reflect.TypeOf(value).Name()) - b.w.WriteType(value) -} - -func (b *builder) writeSlice(name string, ss interface{}) { - b.writeSliceAddSize(name, 0, ss) -} - -func (b *builder) writeSliceAddSize(name string, extraSize int, ss interface{}) { - b.comment(name) - b.w.Size += extraSize - v := reflect.ValueOf(ss) - t := v.Type().Elem() - b.pf("// Size: %d bytes, %d elements", v.Len()*int(t.Size())+extraSize, v.Len()) - - fmt.Fprintf(b.w, "var %s = ", name) - b.w.WriteArray(ss) - b.p() -} - -type fromTo struct { - from, to uint16 -} - -func (b *builder) writeSortedMap(name string, ss *stringSet, index func(s string) uint16) { - ss.sortFunc(func(a, b string) bool { - return index(a) < index(b) - }) - m := []fromTo{} - for _, s := range ss.s { - m = append(m, fromTo{index(s), index(ss.update[s])}) - } - b.writeSlice(name, m) -} - -const base = 'z' - 'a' + 1 - -func strToInt(s string) uint { - v := uint(0) - for i := 0; i < len(s); i++ { - v *= base - v += uint(s[i] - 'a') - } - return v -} - -// converts the given integer to the original ASCII string passed to strToInt. -// len(s) must match the number of characters obtained. -func intToStr(v uint, s []byte) { - for i := len(s) - 1; i >= 0; i-- { - s[i] = byte(v%base) + 'a' - v /= base - } -} - -func (b *builder) writeBitVector(name string, ss []string) { - vec := make([]uint8, int(math.Ceil(math.Pow(base, float64(len(ss[0])))/8))) - for _, s := range ss { - v := strToInt(s) - vec[v/8] |= 1 << (v % 8) - } - b.writeSlice(name, vec) -} - -// TODO: convert this type into a list or two-stage trie. -func (b *builder) writeMapFunc(name string, m map[string]string, f func(string) uint16) { - b.comment(name) - v := reflect.ValueOf(m) - sz := v.Len() * (2 + int(v.Type().Key().Size())) - for _, k := range m { - sz += len(k) - } - b.addSize(sz) - keys := []string{} - b.pf(`var %s = map[string]uint16{`, name) - for k := range m { - keys = append(keys, k) - } - sort.Strings(keys) - for _, k := range keys { - b.pf("\t%q: %v,", k, f(m[k])) - } - b.p("}") -} - -func (b *builder) writeMap(name string, m interface{}) { - b.comment(name) - v := reflect.ValueOf(m) - sz := v.Len() * (2 + int(v.Type().Key().Size()) + int(v.Type().Elem().Size())) - b.addSize(sz) - f := strings.FieldsFunc(fmt.Sprintf("%#v", m), func(r rune) bool { - return strings.IndexRune("{}, ", r) != -1 - }) - sort.Strings(f[1:]) - b.pf(`var %s = %s{`, name, f[0]) - for _, kv := range f[1:] { - b.pf("\t%s,", kv) - } - b.p("}") -} - -func (b *builder) langIndex(s string) uint16 { - if s == "und" { - return 0 - } - if i, ok := b.lang.find(s); ok { - return uint16(i) - } - return uint16(strToInt(s)) + uint16(len(b.lang.s)) -} - -// inc advances the string to its lexicographical successor. -func inc(s string) string { - const maxTagLength = 4 - var buf [maxTagLength]byte - intToStr(strToInt(strings.ToLower(s))+1, buf[:len(s)]) - for i := 0; i < len(s); i++ { - if s[i] <= 'Z' { - buf[i] -= 'a' - 'A' - } - } - return string(buf[:len(s)]) -} - -func (b *builder) parseIndices() { - meta := b.supp.Metadata - - for k, v := range b.registry { - var ss *stringSet - switch v.typ { - case "language": - if len(k) == 2 || v.suppressScript != "" || v.scope == "special" { - b.lang.add(k) - continue - } else { - ss = &b.langNoIndex - } - case "region": - ss = &b.region - case "script": - ss = &b.script - case "variant": - ss = &b.variant - default: - continue - } - ss.add(k) - } - // Include any language for which there is data. - for _, lang := range b.data.Locales() { - if x := b.data.RawLDML(lang); false || - x.LocaleDisplayNames != nil || - x.Characters != nil || - x.Delimiters != nil || - x.Measurement != nil || - x.Dates != nil || - x.Numbers != nil || - x.Units != nil || - x.ListPatterns != nil || - x.Collations != nil || - x.Segmentations != nil || - x.Rbnf != nil || - x.Annotations != nil || - x.Metadata != nil { - - from := strings.Split(lang, "_") - if lang := from[0]; lang != "root" { - b.lang.add(lang) - } - } - } - // Include locales for plural rules, which uses a different structure. - for _, plurals := range b.data.Supplemental().Plurals { - for _, rules := range plurals.PluralRules { - for _, lang := range strings.Split(rules.Locales, " ") { - if lang = strings.Split(lang, "_")[0]; lang != "root" { - b.lang.add(lang) - } - } - } - } - // Include languages in likely subtags. - for _, m := range b.supp.LikelySubtags.LikelySubtag { - from := strings.Split(m.From, "_") - b.lang.add(from[0]) - } - // Include ISO-639 alpha-3 bibliographic entries. - for _, a := range meta.Alias.LanguageAlias { - if a.Reason == "bibliographic" { - b.langNoIndex.add(a.Type) - } - } - // Include regions in territoryAlias (not all are in the IANA registry!) - for _, reg := range b.supp.Metadata.Alias.TerritoryAlias { - if len(reg.Type) == 2 { - b.region.add(reg.Type) - } - } - - for _, s := range b.lang.s { - if len(s) == 3 { - b.langNoIndex.remove(s) - } - } - b.writeConst("numLanguages", len(b.lang.slice())+len(b.langNoIndex.slice())) - b.writeConst("numScripts", len(b.script.slice())) - b.writeConst("numRegions", len(b.region.slice())) - - // Add dummy codes at the start of each list to represent "unspecified". - b.lang.add("---") - b.script.add("----") - b.region.add("---") - - // common locales - b.locale.parse(meta.DefaultContent.Locales) -} - -// TODO: region inclusion data will probably not be use used in future matchers. - -func (b *builder) computeRegionGroups() { - b.groups = make(map[int]index) - - // Create group indices. - for i := 1; b.region.s[i][0] < 'A'; i++ { // Base M49 indices on regionID. - b.groups[i] = index(len(b.groups)) - } - for _, g := range b.supp.TerritoryContainment.Group { - // Skip UN and EURO zone as they are flattening the containment - // relationship. - if g.Type == "EZ" || g.Type == "UN" { - continue - } - group := b.region.index(g.Type) - if _, ok := b.groups[group]; !ok { - b.groups[group] = index(len(b.groups)) - } - } - if len(b.groups) > 64 { - log.Fatalf("only 64 groups supported, found %d", len(b.groups)) - } - b.writeConst("nRegionGroups", len(b.groups)) -} - -var langConsts = []string{ - "af", "am", "ar", "az", "bg", "bn", "ca", "cs", "da", "de", "el", "en", "es", - "et", "fa", "fi", "fil", "fr", "gu", "he", "hi", "hr", "hu", "hy", "id", "is", - "it", "ja", "ka", "kk", "km", "kn", "ko", "ky", "lo", "lt", "lv", "mk", "ml", - "mn", "mo", "mr", "ms", "mul", "my", "nb", "ne", "nl", "no", "pa", "pl", "pt", - "ro", "ru", "sh", "si", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", - "tl", "tn", "tr", "uk", "ur", "uz", "vi", "zh", "zu", - - // constants for grandfathered tags (if not already defined) - "jbo", "ami", "bnn", "hak", "tlh", "lb", "nv", "pwn", "tao", "tay", "tsu", - "nn", "sfb", "vgt", "sgg", "cmn", "nan", "hsn", -} - -// writeLanguage generates all tables needed for language canonicalization. -func (b *builder) writeLanguage() { - meta := b.supp.Metadata - - b.writeConst("nonCanonicalUnd", b.lang.index("und")) - b.writeConsts(func(s string) int { return int(b.langIndex(s)) }, langConsts...) - b.writeConst("langPrivateStart", b.langIndex("qaa")) - b.writeConst("langPrivateEnd", b.langIndex("qtz")) - - // Get language codes that need to be mapped (overlong 3-letter codes, - // deprecated 2-letter codes, legacy and grandfathered tags.) - langAliasMap := stringSet{} - aliasTypeMap := map[string]langAliasType{} - - // altLangISO3 get the alternative ISO3 names that need to be mapped. - altLangISO3 := stringSet{} - // Add dummy start to avoid the use of index 0. - altLangISO3.add("---") - altLangISO3.updateLater("---", "aa") - - lang := b.lang.clone() - for _, a := range meta.Alias.LanguageAlias { - if a.Replacement == "" { - a.Replacement = "und" - } - // TODO: support mapping to tags - repl := strings.SplitN(a.Replacement, "_", 2)[0] - if a.Reason == "overlong" { - if len(a.Replacement) == 2 && len(a.Type) == 3 { - lang.updateLater(a.Replacement, a.Type) - } - } else if len(a.Type) <= 3 { - switch a.Reason { - case "macrolanguage": - aliasTypeMap[a.Type] = langMacro - case "deprecated": - // handled elsewhere - continue - case "bibliographic", "legacy": - if a.Type == "no" { - continue - } - aliasTypeMap[a.Type] = langLegacy - default: - log.Fatalf("new %s alias: %s", a.Reason, a.Type) - } - langAliasMap.add(a.Type) - langAliasMap.updateLater(a.Type, repl) - } - } - // Manually add the mapping of "nb" (Norwegian) to its macro language. - // This can be removed if CLDR adopts this change. - langAliasMap.add("nb") - langAliasMap.updateLater("nb", "no") - aliasTypeMap["nb"] = langMacro - - for k, v := range b.registry { - // Also add deprecated values for 3-letter ISO codes, which CLDR omits. - if v.typ == "language" && v.deprecated != "" && v.preferred != "" { - langAliasMap.add(k) - langAliasMap.updateLater(k, v.preferred) - aliasTypeMap[k] = langDeprecated - } - } - // Fix CLDR mappings. - lang.updateLater("tl", "tgl") - lang.updateLater("sh", "hbs") - lang.updateLater("mo", "mol") - lang.updateLater("no", "nor") - lang.updateLater("tw", "twi") - lang.updateLater("nb", "nob") - lang.updateLater("ak", "aka") - lang.updateLater("bh", "bih") - - // Ensure that each 2-letter code is matched with a 3-letter code. - for _, v := range lang.s[1:] { - s, ok := lang.update[v] - if !ok { - if s, ok = lang.update[langAliasMap.update[v]]; !ok { - continue - } - lang.update[v] = s - } - if v[0] != s[0] { - altLangISO3.add(s) - altLangISO3.updateLater(s, v) - } - } - - // Complete canonicalized language tags. - lang.freeze() - for i, v := range lang.s { - // We can avoid these manual entries by using the IANA registry directly. - // Seems easier to update the list manually, as changes are rare. - // The panic in this loop will trigger if we miss an entry. - add := "" - if s, ok := lang.update[v]; ok { - if s[0] == v[0] { - add = s[1:] - } else { - add = string([]byte{0, byte(altLangISO3.index(s))}) - } - } else if len(v) == 3 { - add = "\x00" - } else { - log.Panicf("no data for long form of %q", v) - } - lang.s[i] += add - } - b.writeConst("lang", tag.Index(lang.join())) - - b.writeConst("langNoIndexOffset", len(b.lang.s)) - - // space of all valid 3-letter language identifiers. - b.writeBitVector("langNoIndex", b.langNoIndex.slice()) - - altLangIndex := []uint16{} - for i, s := range altLangISO3.slice() { - altLangISO3.s[i] += string([]byte{byte(len(altLangIndex))}) - if i > 0 { - idx := b.lang.index(altLangISO3.update[s]) - altLangIndex = append(altLangIndex, uint16(idx)) - } - } - b.writeConst("altLangISO3", tag.Index(altLangISO3.join())) - b.writeSlice("altLangIndex", altLangIndex) - - b.writeSortedMap("langAliasMap", &langAliasMap, b.langIndex) - types := make([]langAliasType, len(langAliasMap.s)) - for i, s := range langAliasMap.s { - types[i] = aliasTypeMap[s] - } - b.writeSlice("langAliasTypes", types) -} - -var scriptConsts = []string{ - "Latn", "Hani", "Hans", "Hant", "Qaaa", "Qaai", "Qabx", "Zinh", "Zyyy", - "Zzzz", -} - -func (b *builder) writeScript() { - b.writeConsts(b.script.index, scriptConsts...) - b.writeConst("script", tag.Index(b.script.join())) - - supp := make([]uint8, len(b.lang.slice())) - for i, v := range b.lang.slice()[1:] { - if sc := b.registry[v].suppressScript; sc != "" { - supp[i+1] = uint8(b.script.index(sc)) - } - } - b.writeSlice("suppressScript", supp) - - // There is only one deprecated script in CLDR. This value is hard-coded. - // We check here if the code must be updated. - for _, a := range b.supp.Metadata.Alias.ScriptAlias { - if a.Type != "Qaai" { - log.Panicf("unexpected deprecated stript %q", a.Type) - } - } -} - -func parseM49(s string) int16 { - if len(s) == 0 { - return 0 - } - v, err := strconv.ParseUint(s, 10, 10) - failOnError(err) - return int16(v) -} - -var regionConsts = []string{ - "001", "419", "BR", "CA", "ES", "GB", "MD", "PT", "UK", "US", - "ZZ", "XA", "XC", "XK", // Unofficial tag for Kosovo. -} - -func (b *builder) writeRegion() { - b.writeConsts(b.region.index, regionConsts...) - - isoOffset := b.region.index("AA") - m49map := make([]int16, len(b.region.slice())) - fromM49map := make(map[int16]int) - altRegionISO3 := "" - altRegionIDs := []uint16{} - - b.writeConst("isoRegionOffset", isoOffset) - - // 2-letter region lookup and mapping to numeric codes. - regionISO := b.region.clone() - regionISO.s = regionISO.s[isoOffset:] - regionISO.sorted = false - - regionTypes := make([]byte, len(b.region.s)) - - // Is the region valid BCP 47? - for s, e := range b.registry { - if len(s) == 2 && s == strings.ToUpper(s) { - i := b.region.index(s) - for _, d := range e.description { - if strings.Contains(d, "Private use") { - regionTypes[i] = iso3166UserAssigned - } - } - regionTypes[i] |= bcp47Region - } - } - - // Is the region a valid ccTLD? - r := gen.OpenIANAFile("domains/root/db") - defer r.Close() - - buf, err := ioutil.ReadAll(r) - failOnError(err) - re := regexp.MustCompile(`"/domains/root/db/([a-z]{2}).html"`) - for _, m := range re.FindAllSubmatch(buf, -1) { - i := b.region.index(strings.ToUpper(string(m[1]))) - regionTypes[i] |= ccTLD - } - - b.writeSlice("regionTypes", regionTypes) - - iso3Set := make(map[string]int) - update := func(iso2, iso3 string) { - i := regionISO.index(iso2) - if j, ok := iso3Set[iso3]; !ok && iso3[0] == iso2[0] { - regionISO.s[i] += iso3[1:] - iso3Set[iso3] = -1 - } else { - if ok && j >= 0 { - regionISO.s[i] += string([]byte{0, byte(j)}) - } else { - iso3Set[iso3] = len(altRegionISO3) - regionISO.s[i] += string([]byte{0, byte(len(altRegionISO3))}) - altRegionISO3 += iso3 - altRegionIDs = append(altRegionIDs, uint16(isoOffset+i)) - } - } - } - for _, tc := range b.supp.CodeMappings.TerritoryCodes { - i := regionISO.index(tc.Type) + isoOffset - if d := m49map[i]; d != 0 { - log.Panicf("%s found as a duplicate UN.M49 code of %03d", tc.Numeric, d) - } - m49 := parseM49(tc.Numeric) - m49map[i] = m49 - if r := fromM49map[m49]; r == 0 { - fromM49map[m49] = i - } else if r != i { - dep := b.registry[regionISO.s[r-isoOffset]].deprecated - if t := b.registry[tc.Type]; t != nil && dep != "" && (t.deprecated == "" || t.deprecated > dep) { - fromM49map[m49] = i - } - } - } - for _, ta := range b.supp.Metadata.Alias.TerritoryAlias { - if len(ta.Type) == 3 && ta.Type[0] <= '9' && len(ta.Replacement) == 2 { - from := parseM49(ta.Type) - if r := fromM49map[from]; r == 0 { - fromM49map[from] = regionISO.index(ta.Replacement) + isoOffset - } - } - } - for _, tc := range b.supp.CodeMappings.TerritoryCodes { - if len(tc.Alpha3) == 3 { - update(tc.Type, tc.Alpha3) - } - } - // This entries are not included in territoryCodes. Mostly 3-letter variants - // of deleted codes and an entry for QU. - for _, m := range []struct{ iso2, iso3 string }{ - {"CT", "CTE"}, - {"DY", "DHY"}, - {"HV", "HVO"}, - {"JT", "JTN"}, - {"MI", "MID"}, - {"NH", "NHB"}, - {"NQ", "ATN"}, - {"PC", "PCI"}, - {"PU", "PUS"}, - {"PZ", "PCZ"}, - {"RH", "RHO"}, - {"VD", "VDR"}, - {"WK", "WAK"}, - // These three-letter codes are used for others as well. - {"FQ", "ATF"}, - } { - update(m.iso2, m.iso3) - } - for i, s := range regionISO.s { - if len(s) != 4 { - regionISO.s[i] = s + " " - } - } - b.writeConst("regionISO", tag.Index(regionISO.join())) - b.writeConst("altRegionISO3", altRegionISO3) - b.writeSlice("altRegionIDs", altRegionIDs) - - // Create list of deprecated regions. - // TODO: consider inserting SF -> FI. Not included by CLDR, but is the only - // Transitionally-reserved mapping not included. - regionOldMap := stringSet{} - // Include regions in territoryAlias (not all are in the IANA registry!) - for _, reg := range b.supp.Metadata.Alias.TerritoryAlias { - if len(reg.Type) == 2 && reg.Reason == "deprecated" && len(reg.Replacement) == 2 { - regionOldMap.add(reg.Type) - regionOldMap.updateLater(reg.Type, reg.Replacement) - i, _ := regionISO.find(reg.Type) - j, _ := regionISO.find(reg.Replacement) - if k := m49map[i+isoOffset]; k == 0 { - m49map[i+isoOffset] = m49map[j+isoOffset] - } - } - } - b.writeSortedMap("regionOldMap", ®ionOldMap, func(s string) uint16 { - return uint16(b.region.index(s)) - }) - // 3-digit region lookup, groupings. - for i := 1; i < isoOffset; i++ { - m := parseM49(b.region.s[i]) - m49map[i] = m - fromM49map[m] = i - } - b.writeSlice("m49", m49map) - - const ( - searchBits = 7 - regionBits = 9 - ) - if len(m49map) >= 1<<regionBits { - log.Fatalf("Maximum number of regions exceeded: %d > %d", len(m49map), 1<<regionBits) - } - m49Index := [9]int16{} - fromM49 := []uint16{} - m49 := []int{} - for k, _ := range fromM49map { - m49 = append(m49, int(k)) - } - sort.Ints(m49) - for _, k := range m49[1:] { - val := (k & (1<<searchBits - 1)) << regionBits - fromM49 = append(fromM49, uint16(val|fromM49map[int16(k)])) - m49Index[1:][k>>searchBits] = int16(len(fromM49)) - } - b.writeSlice("m49Index", m49Index) - b.writeSlice("fromM49", fromM49) -} - -const ( - // TODO: put these lists in regionTypes as user data? Could be used for - // various optimizations and refinements and could be exposed in the API. - iso3166Except = "AC CP DG EA EU FX IC SU TA UK" - iso3166Trans = "AN BU CS NT TP YU ZR" // SF is not in our set of Regions. - // DY and RH are actually not deleted, but indeterminately reserved. - iso3166DelCLDR = "CT DD DY FQ HV JT MI NH NQ PC PU PZ RH VD WK YD" -) - -const ( - iso3166UserAssigned = 1 << iota - ccTLD - bcp47Region -) - -func find(list []string, s string) int { - for i, t := range list { - if t == s { - return i - } - } - return -1 -} - -// writeVariants generates per-variant information and creates a map from variant -// name to index value. We assign index values such that sorting multiple -// variants by index value will result in the correct order. -// There are two types of variants: specialized and general. Specialized variants -// are only applicable to certain language or language-script pairs. Generalized -// variants apply to any language. Generalized variants always sort after -// specialized variants. We will therefore always assign a higher index value -// to a generalized variant than any other variant. Generalized variants are -// sorted alphabetically among themselves. -// Specialized variants may also sort after other specialized variants. Such -// variants will be ordered after any of the variants they may follow. -// We assume that if a variant x is followed by a variant y, then for any prefix -// p of x, p-x is a prefix of y. This allows us to order tags based on the -// maximum of the length of any of its prefixes. -// TODO: it is possible to define a set of Prefix values on variants such that -// a total order cannot be defined to the point that this algorithm breaks. -// In other words, we cannot guarantee the same order of variants for the -// future using the same algorithm or for non-compliant combinations of -// variants. For this reason, consider using simple alphabetic sorting -// of variants and ignore Prefix restrictions altogether. -func (b *builder) writeVariant() { - generalized := stringSet{} - specialized := stringSet{} - specializedExtend := stringSet{} - // Collate the variants by type and check assumptions. - for _, v := range b.variant.slice() { - e := b.registry[v] - if len(e.prefix) == 0 { - generalized.add(v) - continue - } - c := strings.Split(e.prefix[0], "-") - hasScriptOrRegion := false - if len(c) > 1 { - _, hasScriptOrRegion = b.script.find(c[1]) - if !hasScriptOrRegion { - _, hasScriptOrRegion = b.region.find(c[1]) - - } - } - if len(c) == 1 || len(c) == 2 && hasScriptOrRegion { - // Variant is preceded by a language. - specialized.add(v) - continue - } - // Variant is preceded by another variant. - specializedExtend.add(v) - prefix := c[0] + "-" - if hasScriptOrRegion { - prefix += c[1] - } - for _, p := range e.prefix { - // Verify that the prefix minus the last element is a prefix of the - // predecessor element. - i := strings.LastIndex(p, "-") - pred := b.registry[p[i+1:]] - if find(pred.prefix, p[:i]) < 0 { - log.Fatalf("prefix %q for variant %q not consistent with predecessor spec", p, v) - } - // The sorting used below does not work in the general case. It works - // if we assume that variants that may be followed by others only have - // prefixes of the same length. Verify this. - count := strings.Count(p[:i], "-") - for _, q := range pred.prefix { - if c := strings.Count(q, "-"); c != count { - log.Fatalf("variant %q preceding %q has a prefix %q of size %d; want %d", p[i+1:], v, q, c, count) - } - } - if !strings.HasPrefix(p, prefix) { - log.Fatalf("prefix %q of variant %q should start with %q", p, v, prefix) - } - } - } - - // Sort extended variants. - a := specializedExtend.s - less := func(v, w string) bool { - // Sort by the maximum number of elements. - maxCount := func(s string) (max int) { - for _, p := range b.registry[s].prefix { - if c := strings.Count(p, "-"); c > max { - max = c - } - } - return - } - if cv, cw := maxCount(v), maxCount(w); cv != cw { - return cv < cw - } - // Sort by name as tie breaker. - return v < w - } - sort.Sort(funcSorter{less, sort.StringSlice(a)}) - specializedExtend.frozen = true - - // Create index from variant name to index. - variantIndex := make(map[string]uint8) - add := func(s []string) { - for _, v := range s { - variantIndex[v] = uint8(len(variantIndex)) - } - } - add(specialized.slice()) - add(specializedExtend.s) - numSpecialized := len(variantIndex) - add(generalized.slice()) - if n := len(variantIndex); n > 255 { - log.Fatalf("maximum number of variants exceeded: was %d; want <= 255", n) - } - b.writeMap("variantIndex", variantIndex) - b.writeConst("variantNumSpecialized", numSpecialized) -} - -func (b *builder) writeLanguageInfo() { -} - -// writeLikelyData writes tables that are used both for finding parent relations and for -// language matching. Each entry contains additional bits to indicate the status of the -// data to know when it cannot be used for parent relations. -func (b *builder) writeLikelyData() { - const ( - isList = 1 << iota - scriptInFrom - regionInFrom - ) - type ( // generated types - likelyScriptRegion struct { - region uint16 - script uint8 - flags uint8 - } - likelyLangScript struct { - lang uint16 - script uint8 - flags uint8 - } - likelyLangRegion struct { - lang uint16 - region uint16 - } - // likelyTag is used for getting likely tags for group regions, where - // the likely region might be a region contained in the group. - likelyTag struct { - lang uint16 - region uint16 - script uint8 - } - ) - var ( // generated variables - likelyRegionGroup = make([]likelyTag, len(b.groups)) - likelyLang = make([]likelyScriptRegion, len(b.lang.s)) - likelyRegion = make([]likelyLangScript, len(b.region.s)) - likelyScript = make([]likelyLangRegion, len(b.script.s)) - likelyLangList = []likelyScriptRegion{} - likelyRegionList = []likelyLangScript{} - ) - type fromTo struct { - from, to []string - } - langToOther := map[int][]fromTo{} - regionToOther := map[int][]fromTo{} - for _, m := range b.supp.LikelySubtags.LikelySubtag { - from := strings.Split(m.From, "_") - to := strings.Split(m.To, "_") - if len(to) != 3 { - log.Fatalf("invalid number of subtags in %q: found %d, want 3", m.To, len(to)) - } - if len(from) > 3 { - log.Fatalf("invalid number of subtags: found %d, want 1-3", len(from)) - } - if from[0] != to[0] && from[0] != "und" { - log.Fatalf("unexpected language change in expansion: %s -> %s", from, to) - } - if len(from) == 3 { - if from[2] != to[2] { - log.Fatalf("unexpected region change in expansion: %s -> %s", from, to) - } - if from[0] != "und" { - log.Fatalf("unexpected fully specified from tag: %s -> %s", from, to) - } - } - if len(from) == 1 || from[0] != "und" { - id := 0 - if from[0] != "und" { - id = b.lang.index(from[0]) - } - langToOther[id] = append(langToOther[id], fromTo{from, to}) - } else if len(from) == 2 && len(from[1]) == 4 { - sid := b.script.index(from[1]) - likelyScript[sid].lang = uint16(b.langIndex(to[0])) - likelyScript[sid].region = uint16(b.region.index(to[2])) - } else { - r := b.region.index(from[len(from)-1]) - if id, ok := b.groups[r]; ok { - if from[0] != "und" { - log.Fatalf("region changed unexpectedly: %s -> %s", from, to) - } - likelyRegionGroup[id].lang = uint16(b.langIndex(to[0])) - likelyRegionGroup[id].script = uint8(b.script.index(to[1])) - likelyRegionGroup[id].region = uint16(b.region.index(to[2])) - } else { - regionToOther[r] = append(regionToOther[r], fromTo{from, to}) - } - } - } - b.writeType(likelyLangRegion{}) - b.writeSlice("likelyScript", likelyScript) - - for id := range b.lang.s { - list := langToOther[id] - if len(list) == 1 { - likelyLang[id].region = uint16(b.region.index(list[0].to[2])) - likelyLang[id].script = uint8(b.script.index(list[0].to[1])) - } else if len(list) > 1 { - likelyLang[id].flags = isList - likelyLang[id].region = uint16(len(likelyLangList)) - likelyLang[id].script = uint8(len(list)) - for _, x := range list { - flags := uint8(0) - if len(x.from) > 1 { - if x.from[1] == x.to[2] { - flags = regionInFrom - } else { - flags = scriptInFrom - } - } - likelyLangList = append(likelyLangList, likelyScriptRegion{ - region: uint16(b.region.index(x.to[2])), - script: uint8(b.script.index(x.to[1])), - flags: flags, - }) - } - } - } - // TODO: merge suppressScript data with this table. - b.writeType(likelyScriptRegion{}) - b.writeSlice("likelyLang", likelyLang) - b.writeSlice("likelyLangList", likelyLangList) - - for id := range b.region.s { - list := regionToOther[id] - if len(list) == 1 { - likelyRegion[id].lang = uint16(b.langIndex(list[0].to[0])) - likelyRegion[id].script = uint8(b.script.index(list[0].to[1])) - if len(list[0].from) > 2 { - likelyRegion[id].flags = scriptInFrom - } - } else if len(list) > 1 { - likelyRegion[id].flags = isList - likelyRegion[id].lang = uint16(len(likelyRegionList)) - likelyRegion[id].script = uint8(len(list)) - for i, x := range list { - if len(x.from) == 2 && i != 0 || i > 0 && len(x.from) != 3 { - log.Fatalf("unspecified script must be first in list: %v at %d", x.from, i) - } - x := likelyLangScript{ - lang: uint16(b.langIndex(x.to[0])), - script: uint8(b.script.index(x.to[1])), - } - if len(list[0].from) > 2 { - x.flags = scriptInFrom - } - likelyRegionList = append(likelyRegionList, x) - } - } - } - b.writeType(likelyLangScript{}) - b.writeSlice("likelyRegion", likelyRegion) - b.writeSlice("likelyRegionList", likelyRegionList) - - b.writeType(likelyTag{}) - b.writeSlice("likelyRegionGroup", likelyRegionGroup) -} - -type mutualIntelligibility struct { - want, have uint16 - distance uint8 - oneway bool -} - -type scriptIntelligibility struct { - wantLang, haveLang uint16 - wantScript, haveScript uint8 - distance uint8 - // Always oneway -} - -type regionIntelligibility struct { - lang uint16 // compact language id - script uint8 // 0 means any - group uint8 // 0 means any; if bit 7 is set it means inverse - distance uint8 - // Always twoway. -} - -// writeMatchData writes tables with languages and scripts for which there is -// mutual intelligibility. The data is based on CLDR's languageMatching data. -// Note that we use a different algorithm than the one defined by CLDR and that -// we slightly modify the data. For example, we convert scores to confidence levels. -// We also drop all region-related data as we use a different algorithm to -// determine region equivalence. -func (b *builder) writeMatchData() { - lm := b.supp.LanguageMatching.LanguageMatches - cldr.MakeSlice(&lm).SelectAnyOf("type", "written_new") - - regionHierarchy := map[string][]string{} - for _, g := range b.supp.TerritoryContainment.Group { - regions := strings.Split(g.Contains, " ") - regionHierarchy[g.Type] = append(regionHierarchy[g.Type], regions...) - } - regionToGroups := make([]uint8, len(b.region.s)) - - idToIndex := map[string]uint8{} - for i, mv := range lm[0].MatchVariable { - if i > 6 { - log.Fatalf("Too many groups: %d", i) - } - idToIndex[mv.Id] = uint8(i + 1) - // TODO: also handle '-' - for _, r := range strings.Split(mv.Value, "+") { - todo := []string{r} - for k := 0; k < len(todo); k++ { - r := todo[k] - regionToGroups[b.region.index(r)] |= 1 << uint8(i) - todo = append(todo, regionHierarchy[r]...) - } - } - } - b.writeSlice("regionToGroups", regionToGroups) - - // maps language id to in- and out-of-group region. - paradigmLocales := [][3]uint16{} - locales := strings.Split(lm[0].ParadigmLocales[0].Locales, " ") - for i := 0; i < len(locales); i += 2 { - x := [3]uint16{} - for j := 0; j < 2; j++ { - pc := strings.SplitN(locales[i+j], "-", 2) - x[0] = b.langIndex(pc[0]) - if len(pc) == 2 { - x[1+j] = uint16(b.region.index(pc[1])) - } - } - paradigmLocales = append(paradigmLocales, x) - } - b.writeSlice("paradigmLocales", paradigmLocales) - - b.writeType(mutualIntelligibility{}) - b.writeType(scriptIntelligibility{}) - b.writeType(regionIntelligibility{}) - - matchLang := []mutualIntelligibility{} - matchScript := []scriptIntelligibility{} - matchRegion := []regionIntelligibility{} - // Convert the languageMatch entries in lists keyed by desired language. - for _, m := range lm[0].LanguageMatch { - // Different versions of CLDR use different separators. - desired := strings.Replace(m.Desired, "-", "_", -1) - supported := strings.Replace(m.Supported, "-", "_", -1) - d := strings.Split(desired, "_") - s := strings.Split(supported, "_") - if len(d) != len(s) { - log.Fatalf("not supported: desired=%q; supported=%q", desired, supported) - continue - } - distance, _ := strconv.ParseInt(m.Distance, 10, 8) - switch len(d) { - case 2: - if desired == supported && desired == "*_*" { - continue - } - // language-script pair. - matchScript = append(matchScript, scriptIntelligibility{ - wantLang: uint16(b.langIndex(d[0])), - haveLang: uint16(b.langIndex(s[0])), - wantScript: uint8(b.script.index(d[1])), - haveScript: uint8(b.script.index(s[1])), - distance: uint8(distance), - }) - if m.Oneway != "true" { - matchScript = append(matchScript, scriptIntelligibility{ - wantLang: uint16(b.langIndex(s[0])), - haveLang: uint16(b.langIndex(d[0])), - wantScript: uint8(b.script.index(s[1])), - haveScript: uint8(b.script.index(d[1])), - distance: uint8(distance), - }) - } - case 1: - if desired == supported && desired == "*" { - continue - } - if distance == 1 { - // nb == no is already handled by macro mapping. Check there - // really is only this case. - if d[0] != "no" || s[0] != "nb" { - log.Fatalf("unhandled equivalence %s == %s", s[0], d[0]) - } - continue - } - // TODO: consider dropping oneway field and just doubling the entry. - matchLang = append(matchLang, mutualIntelligibility{ - want: uint16(b.langIndex(d[0])), - have: uint16(b.langIndex(s[0])), - distance: uint8(distance), - oneway: m.Oneway == "true", - }) - case 3: - if desired == supported && desired == "*_*_*" { - continue - } - if desired != supported { - // This is now supported by CLDR, but only one case, which - // should already be covered by paradigm locales. For instance, - // test case "und, en, en-GU, en-IN, en-GB ; en-ZA ; en-GB" in - // testdata/CLDRLocaleMatcherTest.txt tests this. - if supported != "en_*_GB" { - log.Fatalf("not supported: desired=%q; supported=%q", desired, supported) - } - continue - } - ri := regionIntelligibility{ - lang: b.langIndex(d[0]), - distance: uint8(distance), - } - if d[1] != "*" { - ri.script = uint8(b.script.index(d[1])) - } - switch { - case d[2] == "*": - ri.group = 0x80 // not contained in anything - case strings.HasPrefix(d[2], "$!"): - ri.group = 0x80 - d[2] = "$" + d[2][len("$!"):] - fallthrough - case strings.HasPrefix(d[2], "$"): - ri.group |= idToIndex[d[2]] - } - matchRegion = append(matchRegion, ri) - default: - log.Fatalf("not supported: desired=%q; supported=%q", desired, supported) - } - } - sort.SliceStable(matchLang, func(i, j int) bool { - return matchLang[i].distance < matchLang[j].distance - }) - b.writeSlice("matchLang", matchLang) - - sort.SliceStable(matchScript, func(i, j int) bool { - return matchScript[i].distance < matchScript[j].distance - }) - b.writeSlice("matchScript", matchScript) - - sort.SliceStable(matchRegion, func(i, j int) bool { - return matchRegion[i].distance < matchRegion[j].distance - }) - b.writeSlice("matchRegion", matchRegion) -} - -func (b *builder) writeRegionInclusionData() { - var ( - // mm holds for each group the set of groups with a distance of 1. - mm = make(map[int][]index) - - // containment holds for each group the transitive closure of - // containment of other groups. - containment = make(map[index][]index) - ) - for _, g := range b.supp.TerritoryContainment.Group { - // Skip UN and EURO zone as they are flattening the containment - // relationship. - if g.Type == "EZ" || g.Type == "UN" { - continue - } - group := b.region.index(g.Type) - groupIdx := b.groups[group] - for _, mem := range strings.Split(g.Contains, " ") { - r := b.region.index(mem) - mm[r] = append(mm[r], groupIdx) - if g, ok := b.groups[r]; ok { - mm[group] = append(mm[group], g) - containment[groupIdx] = append(containment[groupIdx], g) - } - } - } - - regionContainment := make([]uint64, len(b.groups)) - for _, g := range b.groups { - l := containment[g] - - // Compute the transitive closure of containment. - for i := 0; i < len(l); i++ { - l = append(l, containment[l[i]]...) - } - - // Compute the bitmask. - regionContainment[g] = 1 << g - for _, v := range l { - regionContainment[g] |= 1 << v - } - } - b.writeSlice("regionContainment", regionContainment) - - regionInclusion := make([]uint8, len(b.region.s)) - bvs := make(map[uint64]index) - // Make the first bitvector positions correspond with the groups. - for r, i := range b.groups { - bv := uint64(1 << i) - for _, g := range mm[r] { - bv |= 1 << g - } - bvs[bv] = i - regionInclusion[r] = uint8(bvs[bv]) - } - for r := 1; r < len(b.region.s); r++ { - if _, ok := b.groups[r]; !ok { - bv := uint64(0) - for _, g := range mm[r] { - bv |= 1 << g - } - if bv == 0 { - // Pick the world for unspecified regions. - bv = 1 << b.groups[b.region.index("001")] - } - if _, ok := bvs[bv]; !ok { - bvs[bv] = index(len(bvs)) - } - regionInclusion[r] = uint8(bvs[bv]) - } - } - b.writeSlice("regionInclusion", regionInclusion) - regionInclusionBits := make([]uint64, len(bvs)) - for k, v := range bvs { - regionInclusionBits[v] = uint64(k) - } - // Add bit vectors for increasingly large distances until a fixed point is reached. - regionInclusionNext := []uint8{} - for i := 0; i < len(regionInclusionBits); i++ { - bits := regionInclusionBits[i] - next := bits - for i := uint(0); i < uint(len(b.groups)); i++ { - if bits&(1<<i) != 0 { - next |= regionInclusionBits[i] - } - } - if _, ok := bvs[next]; !ok { - bvs[next] = index(len(bvs)) - regionInclusionBits = append(regionInclusionBits, next) - } - regionInclusionNext = append(regionInclusionNext, uint8(bvs[next])) - } - b.writeSlice("regionInclusionBits", regionInclusionBits) - b.writeSlice("regionInclusionNext", regionInclusionNext) -} - -type parentRel struct { - lang uint16 - script uint8 - maxScript uint8 - toRegion uint16 - fromRegion []uint16 -} - -func (b *builder) writeParents() { - b.writeType(parentRel{}) - - parents := []parentRel{} - - // Construct parent overrides. - n := 0 - for _, p := range b.data.Supplemental().ParentLocales.ParentLocale { - // Skipping non-standard scripts to root is implemented using addTags. - if p.Parent == "root" { - continue - } - - sub := strings.Split(p.Parent, "_") - parent := parentRel{lang: b.langIndex(sub[0])} - if len(sub) == 2 { - // TODO: check that all undefined scripts are indeed Latn in these - // cases. - parent.maxScript = uint8(b.script.index("Latn")) - parent.toRegion = uint16(b.region.index(sub[1])) - } else { - parent.script = uint8(b.script.index(sub[1])) - parent.maxScript = parent.script - parent.toRegion = uint16(b.region.index(sub[2])) - } - for _, c := range strings.Split(p.Locales, " ") { - region := b.region.index(c[strings.LastIndex(c, "_")+1:]) - parent.fromRegion = append(parent.fromRegion, uint16(region)) - } - parents = append(parents, parent) - n += len(parent.fromRegion) - } - b.writeSliceAddSize("parents", n*2, parents) -} - -func main() { - gen.Init() - - gen.Repackage("gen_common.go", "common.go", "language") - - w := gen.NewCodeWriter() - defer w.WriteGoFile("tables.go", "language") - - fmt.Fprintln(w, `import "golang.org/x/text/internal/tag"`) - - b := newBuilder(w) - gen.WriteCLDRVersion(w) - - b.parseIndices() - b.writeType(fromTo{}) - b.writeLanguage() - b.writeScript() - b.writeRegion() - b.writeVariant() - // TODO: b.writeLocale() - b.computeRegionGroups() - b.writeLikelyData() - b.writeMatchData() - b.writeRegionInclusionData() - b.writeParents() -} diff --git a/vendor/golang.org/x/text/language/gen_common.go b/vendor/golang.org/x/text/language/gen_common.go deleted file mode 100644 index 83ce18013329..000000000000 --- a/vendor/golang.org/x/text/language/gen_common.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This file contains code common to the maketables.go and the package code. - -// langAliasType is the type of an alias in langAliasMap. -type langAliasType int8 - -const ( - langDeprecated langAliasType = iota - langMacro - langLegacy - - langAliasTypeUnknown langAliasType = -1 -) diff --git a/vendor/golang.org/x/text/language/gen_index.go b/vendor/golang.org/x/text/language/gen_index.go deleted file mode 100644 index 5ca9bccac52b..000000000000 --- a/vendor/golang.org/x/text/language/gen_index.go +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This file generates derivative tables based on the language package itself. - -import ( - "bytes" - "flag" - "fmt" - "io/ioutil" - "log" - "reflect" - "sort" - "strings" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/language" - "golang.org/x/text/unicode/cldr" -) - -var ( - test = flag.Bool("test", false, - "test existing tables; can be used to compare web data with package data.") - - draft = flag.String("draft", - "contributed", - `Minimal draft requirements (approved, contributed, provisional, unconfirmed).`) -) - -func main() { - gen.Init() - - // Read the CLDR zip file. - r := gen.OpenCLDRCoreZip() - defer r.Close() - - d := &cldr.Decoder{} - data, err := d.DecodeZip(r) - if err != nil { - log.Fatalf("DecodeZip: %v", err) - } - - w := gen.NewCodeWriter() - defer func() { - buf := &bytes.Buffer{} - - if _, err = w.WriteGo(buf, "language", ""); err != nil { - log.Fatalf("Error formatting file index.go: %v", err) - } - - // Since we're generating a table for our own package we need to rewrite - // doing the equivalent of go fmt -r 'language.b -> b'. Using - // bytes.Replace will do. - out := bytes.Replace(buf.Bytes(), []byte("language."), nil, -1) - if err := ioutil.WriteFile("index.go", out, 0600); err != nil { - log.Fatalf("Could not create file index.go: %v", err) - } - }() - - m := map[language.Tag]bool{} - for _, lang := range data.Locales() { - // We include all locales unconditionally to be consistent with en_US. - // We want en_US, even though it has no data associated with it. - - // TODO: put any of the languages for which no data exists at the end - // of the index. This allows all components based on ICU to use that - // as the cutoff point. - // if x := data.RawLDML(lang); false || - // x.LocaleDisplayNames != nil || - // x.Characters != nil || - // x.Delimiters != nil || - // x.Measurement != nil || - // x.Dates != nil || - // x.Numbers != nil || - // x.Units != nil || - // x.ListPatterns != nil || - // x.Collations != nil || - // x.Segmentations != nil || - // x.Rbnf != nil || - // x.Annotations != nil || - // x.Metadata != nil { - - // TODO: support POSIX natively, albeit non-standard. - tag := language.Make(strings.Replace(lang, "_POSIX", "-u-va-posix", 1)) - m[tag] = true - // } - } - // Include locales for plural rules, which uses a different structure. - for _, plurals := range data.Supplemental().Plurals { - for _, rules := range plurals.PluralRules { - for _, lang := range strings.Split(rules.Locales, " ") { - m[language.Make(lang)] = true - } - } - } - - var core, special []language.Tag - - for t := range m { - if x := t.Extensions(); len(x) != 0 && fmt.Sprint(x) != "[u-va-posix]" { - log.Fatalf("Unexpected extension %v in %v", x, t) - } - if len(t.Variants()) == 0 && len(t.Extensions()) == 0 { - core = append(core, t) - } else { - special = append(special, t) - } - } - - w.WriteComment(` - NumCompactTags is the number of common tags. The maximum tag is - NumCompactTags-1.`) - w.WriteConst("NumCompactTags", len(core)+len(special)) - - sort.Sort(byAlpha(special)) - w.WriteVar("specialTags", special) - - // TODO: order by frequency? - sort.Sort(byAlpha(core)) - - // Size computations are just an estimate. - w.Size += int(reflect.TypeOf(map[uint32]uint16{}).Size()) - w.Size += len(core) * 6 // size of uint32 and uint16 - - fmt.Fprintln(w) - fmt.Fprintln(w, "var coreTags = map[uint32]uint16{") - fmt.Fprintln(w, "0x0: 0, // und") - i := len(special) + 1 // Und and special tags already written. - for _, t := range core { - if t == language.Und { - continue - } - fmt.Fprint(w.Hash, t, i) - b, s, r := t.Raw() - fmt.Fprintf(w, "0x%s%s%s: %d, // %s\n", - getIndex(b, 3), // 3 is enough as it is guaranteed to be a compact number - getIndex(s, 2), - getIndex(r, 3), - i, t) - i++ - } - fmt.Fprintln(w, "}") -} - -// getIndex prints the subtag type and extracts its index of size nibble. -// If the index is less than n nibbles, the result is prefixed with 0s. -func getIndex(x interface{}, n int) string { - s := fmt.Sprintf("%#v", x) // s is of form Type{typeID: 0x00} - s = s[strings.Index(s, "0x")+2 : len(s)-1] - return strings.Repeat("0", n-len(s)) + s -} - -type byAlpha []language.Tag - -func (a byAlpha) Len() int { return len(a) } -func (a byAlpha) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a byAlpha) Less(i, j int) bool { return a[i].String() < a[j].String() } diff --git a/vendor/golang.org/x/text/unicode/bidi/gen.go b/vendor/golang.org/x/text/unicode/bidi/gen.go deleted file mode 100644 index 4e1c7ba0bf4d..000000000000 --- a/vendor/golang.org/x/text/unicode/bidi/gen.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "flag" - "log" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/triegen" - "golang.org/x/text/internal/ucd" -) - -var outputFile = flag.String("out", "tables.go", "output file") - -func main() { - gen.Init() - gen.Repackage("gen_trieval.go", "trieval.go", "bidi") - gen.Repackage("gen_ranges.go", "ranges_test.go", "bidi") - - genTables() -} - -// bidiClass names and codes taken from class "bc" in -// http://www.unicode.org/Public/8.0.0/ucd/PropertyValueAliases.txt -var bidiClass = map[string]Class{ - "AL": AL, // ArabicLetter - "AN": AN, // ArabicNumber - "B": B, // ParagraphSeparator - "BN": BN, // BoundaryNeutral - "CS": CS, // CommonSeparator - "EN": EN, // EuropeanNumber - "ES": ES, // EuropeanSeparator - "ET": ET, // EuropeanTerminator - "L": L, // LeftToRight - "NSM": NSM, // NonspacingMark - "ON": ON, // OtherNeutral - "R": R, // RightToLeft - "S": S, // SegmentSeparator - "WS": WS, // WhiteSpace - - "FSI": Control, - "PDF": Control, - "PDI": Control, - "LRE": Control, - "LRI": Control, - "LRO": Control, - "RLE": Control, - "RLI": Control, - "RLO": Control, -} - -func genTables() { - if numClass > 0x0F { - log.Fatalf("Too many Class constants (%#x > 0x0F).", numClass) - } - w := gen.NewCodeWriter() - defer w.WriteVersionedGoFile(*outputFile, "bidi") - - gen.WriteUnicodeVersion(w) - - t := triegen.NewTrie("bidi") - - // Build data about bracket mapping. These bits need to be or-ed with - // any other bits. - orMask := map[rune]uint64{} - - xorMap := map[rune]int{} - xorMasks := []rune{0} // First value is no-op. - - ucd.Parse(gen.OpenUCDFile("BidiBrackets.txt"), func(p *ucd.Parser) { - r1 := p.Rune(0) - r2 := p.Rune(1) - xor := r1 ^ r2 - if _, ok := xorMap[xor]; !ok { - xorMap[xor] = len(xorMasks) - xorMasks = append(xorMasks, xor) - } - entry := uint64(xorMap[xor]) << xorMaskShift - switch p.String(2) { - case "o": - entry |= openMask - case "c", "n": - default: - log.Fatalf("Unknown bracket class %q.", p.String(2)) - } - orMask[r1] = entry - }) - - w.WriteComment(` - xorMasks contains masks to be xor-ed with brackets to get the reverse - version.`) - w.WriteVar("xorMasks", xorMasks) - - done := map[rune]bool{} - - insert := func(r rune, c Class) { - if !done[r] { - t.Insert(r, orMask[r]|uint64(c)) - done[r] = true - } - } - - // Insert the derived BiDi properties. - ucd.Parse(gen.OpenUCDFile("extracted/DerivedBidiClass.txt"), func(p *ucd.Parser) { - r := p.Rune(0) - class, ok := bidiClass[p.String(1)] - if !ok { - log.Fatalf("%U: Unknown BiDi class %q", r, p.String(1)) - } - insert(r, class) - }) - visitDefaults(insert) - - // TODO: use sparse blocks. This would reduce table size considerably - // from the looks of it. - - sz, err := t.Gen(w) - if err != nil { - log.Fatal(err) - } - w.Size += sz -} - -// dummy values to make methods in gen_common compile. The real versions -// will be generated by this file to tables.go. -var ( - xorMasks []rune -) diff --git a/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go b/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go deleted file mode 100644 index 51bd68fa7f38..000000000000 --- a/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "unicode" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/ucd" - "golang.org/x/text/unicode/rangetable" -) - -// These tables are hand-extracted from: -// http://www.unicode.org/Public/8.0.0/ucd/extracted/DerivedBidiClass.txt -func visitDefaults(fn func(r rune, c Class)) { - // first write default values for ranges listed above. - visitRunes(fn, AL, []rune{ - 0x0600, 0x07BF, // Arabic - 0x08A0, 0x08FF, // Arabic Extended-A - 0xFB50, 0xFDCF, // Arabic Presentation Forms - 0xFDF0, 0xFDFF, - 0xFE70, 0xFEFF, - 0x0001EE00, 0x0001EEFF, // Arabic Mathematical Alpha Symbols - }) - visitRunes(fn, R, []rune{ - 0x0590, 0x05FF, // Hebrew - 0x07C0, 0x089F, // Nko et al. - 0xFB1D, 0xFB4F, - 0x00010800, 0x00010FFF, // Cypriot Syllabary et. al. - 0x0001E800, 0x0001EDFF, - 0x0001EF00, 0x0001EFFF, - }) - visitRunes(fn, ET, []rune{ // European Terminator - 0x20A0, 0x20Cf, // Currency symbols - }) - rangetable.Visit(unicode.Noncharacter_Code_Point, func(r rune) { - fn(r, BN) // Boundary Neutral - }) - ucd.Parse(gen.OpenUCDFile("DerivedCoreProperties.txt"), func(p *ucd.Parser) { - if p.String(1) == "Default_Ignorable_Code_Point" { - fn(p.Rune(0), BN) // Boundary Neutral - } - }) -} - -func visitRunes(fn func(r rune, c Class), c Class, runes []rune) { - for i := 0; i < len(runes); i += 2 { - lo, hi := runes[i], runes[i+1] - for j := lo; j <= hi; j++ { - fn(j, c) - } - } -} diff --git a/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go b/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go deleted file mode 100644 index 9cb994289492..000000000000 --- a/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// Class is the Unicode BiDi class. Each rune has a single class. -type Class uint - -const ( - L Class = iota // LeftToRight - R // RightToLeft - EN // EuropeanNumber - ES // EuropeanSeparator - ET // EuropeanTerminator - AN // ArabicNumber - CS // CommonSeparator - B // ParagraphSeparator - S // SegmentSeparator - WS // WhiteSpace - ON // OtherNeutral - BN // BoundaryNeutral - NSM // NonspacingMark - AL // ArabicLetter - Control // Control LRO - PDI - - numClass - - LRO // LeftToRightOverride - RLO // RightToLeftOverride - LRE // LeftToRightEmbedding - RLE // RightToLeftEmbedding - PDF // PopDirectionalFormat - LRI // LeftToRightIsolate - RLI // RightToLeftIsolate - FSI // FirstStrongIsolate - PDI // PopDirectionalIsolate - - unknownClass = ^Class(0) -) - -var controlToClass = map[rune]Class{ - 0x202D: LRO, // LeftToRightOverride, - 0x202E: RLO, // RightToLeftOverride, - 0x202A: LRE, // LeftToRightEmbedding, - 0x202B: RLE, // RightToLeftEmbedding, - 0x202C: PDF, // PopDirectionalFormat, - 0x2066: LRI, // LeftToRightIsolate, - 0x2067: RLI, // RightToLeftIsolate, - 0x2068: FSI, // FirstStrongIsolate, - 0x2069: PDI, // PopDirectionalIsolate, -} - -// A trie entry has the following bits: -// 7..5 XOR mask for brackets -// 4 1: Bracket open, 0: Bracket close -// 3..0 Class type - -const ( - openMask = 0x10 - xorMaskShift = 5 -) diff --git a/vendor/golang.org/x/text/unicode/cldr/base.go b/vendor/golang.org/x/text/unicode/cldr/base.go deleted file mode 100644 index 63cdc16c6130..000000000000 --- a/vendor/golang.org/x/text/unicode/cldr/base.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cldr - -import ( - "encoding/xml" - "regexp" - "strconv" -) - -// Elem is implemented by every XML element. -type Elem interface { - setEnclosing(Elem) - setName(string) - enclosing() Elem - - GetCommon() *Common -} - -type hidden struct { - CharData string `xml:",chardata"` - Alias *struct { - Common - Source string `xml:"source,attr"` - Path string `xml:"path,attr"` - } `xml:"alias"` - Def *struct { - Common - Choice string `xml:"choice,attr,omitempty"` - Type string `xml:"type,attr,omitempty"` - } `xml:"default"` -} - -// Common holds several of the most common attributes and sub elements -// of an XML element. -type Common struct { - XMLName xml.Name - name string - enclElem Elem - Type string `xml:"type,attr,omitempty"` - Reference string `xml:"reference,attr,omitempty"` - Alt string `xml:"alt,attr,omitempty"` - ValidSubLocales string `xml:"validSubLocales,attr,omitempty"` - Draft string `xml:"draft,attr,omitempty"` - hidden -} - -// Default returns the default type to select from the enclosed list -// or "" if no default value is specified. -func (e *Common) Default() string { - if e.Def == nil { - return "" - } - if e.Def.Choice != "" { - return e.Def.Choice - } else if e.Def.Type != "" { - // Type is still used by the default element in collation. - return e.Def.Type - } - return "" -} - -// Element returns the XML element name. -func (e *Common) Element() string { - return e.name -} - -// GetCommon returns e. It is provided such that Common implements Elem. -func (e *Common) GetCommon() *Common { - return e -} - -// Data returns the character data accumulated for this element. -func (e *Common) Data() string { - e.CharData = charRe.ReplaceAllStringFunc(e.CharData, replaceUnicode) - return e.CharData -} - -func (e *Common) setName(s string) { - e.name = s -} - -func (e *Common) enclosing() Elem { - return e.enclElem -} - -func (e *Common) setEnclosing(en Elem) { - e.enclElem = en -} - -// Escape characters that can be escaped without further escaping the string. -var charRe = regexp.MustCompile(`&#x[0-9a-fA-F]*;|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|\\x[0-9a-fA-F]{2}|\\[0-7]{3}|\\[abtnvfr]`) - -// replaceUnicode converts hexadecimal Unicode codepoint notations to a one-rune string. -// It assumes the input string is correctly formatted. -func replaceUnicode(s string) string { - if s[1] == '#' { - r, _ := strconv.ParseInt(s[3:len(s)-1], 16, 32) - return string(r) - } - r, _, _, _ := strconv.UnquoteChar(s, 0) - return string(r) -} diff --git a/vendor/golang.org/x/text/unicode/cldr/cldr.go b/vendor/golang.org/x/text/unicode/cldr/cldr.go deleted file mode 100644 index 2197f8ac268e..000000000000 --- a/vendor/golang.org/x/text/unicode/cldr/cldr.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate go run makexml.go -output xml.go - -// Package cldr provides a parser for LDML and related XML formats. -// This package is intended to be used by the table generation tools -// for the various internationalization-related packages. -// As the XML types are generated from the CLDR DTD, and as the CLDR standard -// is periodically amended, this package may change considerably over time. -// This mostly means that data may appear and disappear between versions. -// That is, old code should keep compiling for newer versions, but data -// may have moved or changed. -// CLDR version 22 is the first version supported by this package. -// Older versions may not work. -package cldr // import "golang.org/x/text/unicode/cldr" - -import ( - "fmt" - "sort" -) - -// CLDR provides access to parsed data of the Unicode Common Locale Data Repository. -type CLDR struct { - parent map[string][]string - locale map[string]*LDML - resolved map[string]*LDML - bcp47 *LDMLBCP47 - supp *SupplementalData -} - -func makeCLDR() *CLDR { - return &CLDR{ - parent: make(map[string][]string), - locale: make(map[string]*LDML), - resolved: make(map[string]*LDML), - bcp47: &LDMLBCP47{}, - supp: &SupplementalData{}, - } -} - -// BCP47 returns the parsed BCP47 LDML data. If no such data was parsed, nil is returned. -func (cldr *CLDR) BCP47() *LDMLBCP47 { - return nil -} - -// Draft indicates the draft level of an element. -type Draft int - -const ( - Approved Draft = iota - Contributed - Provisional - Unconfirmed -) - -var drafts = []string{"unconfirmed", "provisional", "contributed", "approved", ""} - -// ParseDraft returns the Draft value corresponding to the given string. The -// empty string corresponds to Approved. -func ParseDraft(level string) (Draft, error) { - if level == "" { - return Approved, nil - } - for i, s := range drafts { - if level == s { - return Unconfirmed - Draft(i), nil - } - } - return Approved, fmt.Errorf("cldr: unknown draft level %q", level) -} - -func (d Draft) String() string { - return drafts[len(drafts)-1-int(d)] -} - -// SetDraftLevel sets which draft levels to include in the evaluated LDML. -// Any draft element for which the draft level is higher than lev will be excluded. -// If multiple draft levels are available for a single element, the one with the -// lowest draft level will be selected, unless preferDraft is true, in which case -// the highest draft will be chosen. -// It is assumed that the underlying LDML is canonicalized. -func (cldr *CLDR) SetDraftLevel(lev Draft, preferDraft bool) { - // TODO: implement - cldr.resolved = make(map[string]*LDML) -} - -// RawLDML returns the LDML XML for id in unresolved form. -// id must be one of the strings returned by Locales. -func (cldr *CLDR) RawLDML(loc string) *LDML { - return cldr.locale[loc] -} - -// LDML returns the fully resolved LDML XML for loc, which must be one of -// the strings returned by Locales. -func (cldr *CLDR) LDML(loc string) (*LDML, error) { - return cldr.resolve(loc) -} - -// Supplemental returns the parsed supplemental data. If no such data was parsed, -// nil is returned. -func (cldr *CLDR) Supplemental() *SupplementalData { - return cldr.supp -} - -// Locales returns the locales for which there exist files. -// Valid sublocales for which there is no file are not included. -// The root locale is always sorted first. -func (cldr *CLDR) Locales() []string { - loc := []string{"root"} - hasRoot := false - for l, _ := range cldr.locale { - if l == "root" { - hasRoot = true - continue - } - loc = append(loc, l) - } - sort.Strings(loc[1:]) - if !hasRoot { - return loc[1:] - } - return loc -} - -// Get fills in the fields of x based on the XPath path. -func Get(e Elem, path string) (res Elem, err error) { - return walkXPath(e, path) -} diff --git a/vendor/golang.org/x/text/unicode/cldr/collate.go b/vendor/golang.org/x/text/unicode/cldr/collate.go deleted file mode 100644 index 80ee28d795e3..000000000000 --- a/vendor/golang.org/x/text/unicode/cldr/collate.go +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cldr - -import ( - "bufio" - "encoding/xml" - "errors" - "fmt" - "strconv" - "strings" - "unicode" - "unicode/utf8" -) - -// RuleProcessor can be passed to Collator's Process method, which -// parses the rules and calls the respective method for each rule found. -type RuleProcessor interface { - Reset(anchor string, before int) error - Insert(level int, str, context, extend string) error - Index(id string) -} - -const ( - // cldrIndex is a Unicode-reserved sentinel value used to mark the start - // of a grouping within an index. - // We ignore any rule that starts with this rune. - // See http://unicode.org/reports/tr35/#Collation_Elements for details. - cldrIndex = "\uFDD0" - - // specialAnchor is the format in which to represent logical reset positions, - // such as "first tertiary ignorable". - specialAnchor = "<%s/>" -) - -// Process parses the rules for the tailorings of this collation -// and calls the respective methods of p for each rule found. -func (c Collation) Process(p RuleProcessor) (err error) { - if len(c.Cr) > 0 { - if len(c.Cr) > 1 { - return fmt.Errorf("multiple cr elements, want 0 or 1") - } - return processRules(p, c.Cr[0].Data()) - } - if c.Rules.Any != nil { - return c.processXML(p) - } - return errors.New("no tailoring data") -} - -// processRules parses rules in the Collation Rule Syntax defined in -// http://www.unicode.org/reports/tr35/tr35-collation.html#Collation_Tailorings. -func processRules(p RuleProcessor, s string) (err error) { - chk := func(s string, e error) string { - if err == nil { - err = e - } - return s - } - i := 0 // Save the line number for use after the loop. - scanner := bufio.NewScanner(strings.NewReader(s)) - for ; scanner.Scan() && err == nil; i++ { - for s := skipSpace(scanner.Text()); s != "" && s[0] != '#'; s = skipSpace(s) { - level := 5 - var ch byte - switch ch, s = s[0], s[1:]; ch { - case '&': // followed by <anchor> or '[' <key> ']' - if s = skipSpace(s); consume(&s, '[') { - s = chk(parseSpecialAnchor(p, s)) - } else { - s = chk(parseAnchor(p, 0, s)) - } - case '<': // sort relation '<'{1,4}, optionally followed by '*'. - for level = 1; consume(&s, '<'); level++ { - } - if level > 4 { - err = fmt.Errorf("level %d > 4", level) - } - fallthrough - case '=': // identity relation, optionally followed by *. - if consume(&s, '*') { - s = chk(parseSequence(p, level, s)) - } else { - s = chk(parseOrder(p, level, s)) - } - default: - chk("", fmt.Errorf("illegal operator %q", ch)) - break - } - } - } - if chk("", scanner.Err()); err != nil { - return fmt.Errorf("%d: %v", i, err) - } - return nil -} - -// parseSpecialAnchor parses the anchor syntax which is either of the form -// ['before' <level>] <anchor> -// or -// [<label>] -// The starting should already be consumed. -func parseSpecialAnchor(p RuleProcessor, s string) (tail string, err error) { - i := strings.IndexByte(s, ']') - if i == -1 { - return "", errors.New("unmatched bracket") - } - a := strings.TrimSpace(s[:i]) - s = s[i+1:] - if strings.HasPrefix(a, "before ") { - l, err := strconv.ParseUint(skipSpace(a[len("before "):]), 10, 3) - if err != nil { - return s, err - } - return parseAnchor(p, int(l), s) - } - return s, p.Reset(fmt.Sprintf(specialAnchor, a), 0) -} - -func parseAnchor(p RuleProcessor, level int, s string) (tail string, err error) { - anchor, s, err := scanString(s) - if err != nil { - return s, err - } - return s, p.Reset(anchor, level) -} - -func parseOrder(p RuleProcessor, level int, s string) (tail string, err error) { - var value, context, extend string - if value, s, err = scanString(s); err != nil { - return s, err - } - if strings.HasPrefix(value, cldrIndex) { - p.Index(value[len(cldrIndex):]) - return - } - if consume(&s, '|') { - if context, s, err = scanString(s); err != nil { - return s, errors.New("missing string after context") - } - } - if consume(&s, '/') { - if extend, s, err = scanString(s); err != nil { - return s, errors.New("missing string after extension") - } - } - return s, p.Insert(level, value, context, extend) -} - -// scanString scans a single input string. -func scanString(s string) (str, tail string, err error) { - if s = skipSpace(s); s == "" { - return s, s, errors.New("missing string") - } - buf := [16]byte{} // small but enough to hold most cases. - value := buf[:0] - for s != "" { - if consume(&s, '\'') { - i := strings.IndexByte(s, '\'') - if i == -1 { - return "", "", errors.New(`unmatched single quote`) - } - if i == 0 { - value = append(value, '\'') - } else { - value = append(value, s[:i]...) - } - s = s[i+1:] - continue - } - r, sz := utf8.DecodeRuneInString(s) - if unicode.IsSpace(r) || strings.ContainsRune("&<=#", r) { - break - } - value = append(value, s[:sz]...) - s = s[sz:] - } - return string(value), skipSpace(s), nil -} - -func parseSequence(p RuleProcessor, level int, s string) (tail string, err error) { - if s = skipSpace(s); s == "" { - return s, errors.New("empty sequence") - } - last := rune(0) - for s != "" { - r, sz := utf8.DecodeRuneInString(s) - s = s[sz:] - - if r == '-' { - // We have a range. The first element was already written. - if last == 0 { - return s, errors.New("range without starter value") - } - r, sz = utf8.DecodeRuneInString(s) - s = s[sz:] - if r == utf8.RuneError || r < last { - return s, fmt.Errorf("invalid range %q-%q", last, r) - } - for i := last + 1; i <= r; i++ { - if err := p.Insert(level, string(i), "", ""); err != nil { - return s, err - } - } - last = 0 - continue - } - - if unicode.IsSpace(r) || unicode.IsPunct(r) { - break - } - - // normal case - if err := p.Insert(level, string(r), "", ""); err != nil { - return s, err - } - last = r - } - return s, nil -} - -func skipSpace(s string) string { - return strings.TrimLeftFunc(s, unicode.IsSpace) -} - -// consumes returns whether the next byte is ch. If so, it gobbles it by -// updating s. -func consume(s *string, ch byte) (ok bool) { - if *s == "" || (*s)[0] != ch { - return false - } - *s = (*s)[1:] - return true -} - -// The following code parses Collation rules of CLDR version 24 and before. - -var lmap = map[byte]int{ - 'p': 1, - 's': 2, - 't': 3, - 'i': 5, -} - -type rulesElem struct { - Rules struct { - Common - Any []*struct { - XMLName xml.Name - rule - } `xml:",any"` - } `xml:"rules"` -} - -type rule struct { - Value string `xml:",chardata"` - Before string `xml:"before,attr"` - Any []*struct { - XMLName xml.Name - rule - } `xml:",any"` -} - -var emptyValueError = errors.New("cldr: empty rule value") - -func (r *rule) value() (string, error) { - // Convert hexadecimal Unicode codepoint notation to a string. - s := charRe.ReplaceAllStringFunc(r.Value, replaceUnicode) - r.Value = s - if s == "" { - if len(r.Any) != 1 { - return "", emptyValueError - } - r.Value = fmt.Sprintf(specialAnchor, r.Any[0].XMLName.Local) - r.Any = nil - } else if len(r.Any) != 0 { - return "", fmt.Errorf("cldr: XML elements found in collation rule: %v", r.Any) - } - return r.Value, nil -} - -func (r rule) process(p RuleProcessor, name, context, extend string) error { - v, err := r.value() - if err != nil { - return err - } - switch name { - case "p", "s", "t", "i": - if strings.HasPrefix(v, cldrIndex) { - p.Index(v[len(cldrIndex):]) - return nil - } - if err := p.Insert(lmap[name[0]], v, context, extend); err != nil { - return err - } - case "pc", "sc", "tc", "ic": - level := lmap[name[0]] - for _, s := range v { - if err := p.Insert(level, string(s), context, extend); err != nil { - return err - } - } - default: - return fmt.Errorf("cldr: unsupported tag: %q", name) - } - return nil -} - -// processXML parses the format of CLDR versions 24 and older. -func (c Collation) processXML(p RuleProcessor) (err error) { - // Collation is generated and defined in xml.go. - var v string - for _, r := range c.Rules.Any { - switch r.XMLName.Local { - case "reset": - level := 0 - switch r.Before { - case "primary", "1": - level = 1 - case "secondary", "2": - level = 2 - case "tertiary", "3": - level = 3 - case "": - default: - return fmt.Errorf("cldr: unknown level %q", r.Before) - } - v, err = r.value() - if err == nil { - err = p.Reset(v, level) - } - case "x": - var context, extend string - for _, r1 := range r.Any { - v, err = r1.value() - switch r1.XMLName.Local { - case "context": - context = v - case "extend": - extend = v - } - } - for _, r1 := range r.Any { - if t := r1.XMLName.Local; t == "context" || t == "extend" { - continue - } - r1.rule.process(p, r1.XMLName.Local, context, extend) - } - default: - err = r.rule.process(p, r.XMLName.Local, "", "") - } - if err != nil { - return err - } - } - return nil -} diff --git a/vendor/golang.org/x/text/unicode/cldr/decode.go b/vendor/golang.org/x/text/unicode/cldr/decode.go deleted file mode 100644 index 094d43139dde..000000000000 --- a/vendor/golang.org/x/text/unicode/cldr/decode.go +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cldr - -import ( - "archive/zip" - "bytes" - "encoding/xml" - "fmt" - "io" - "io/ioutil" - "log" - "os" - "path/filepath" - "regexp" -) - -// A Decoder loads an archive of CLDR data. -type Decoder struct { - dirFilter []string - sectionFilter []string - loader Loader - cldr *CLDR - curLocale string -} - -// SetSectionFilter takes a list top-level LDML element names to which -// evaluation of LDML should be limited. It automatically calls SetDirFilter. -func (d *Decoder) SetSectionFilter(filter ...string) { - d.sectionFilter = filter - // TODO: automatically set dir filter -} - -// SetDirFilter limits the loading of LDML XML files of the specied directories. -// Note that sections may be split across directories differently for different CLDR versions. -// For more robust code, use SetSectionFilter. -func (d *Decoder) SetDirFilter(dir ...string) { - d.dirFilter = dir -} - -// A Loader provides access to the files of a CLDR archive. -type Loader interface { - Len() int - Path(i int) string - Reader(i int) (io.ReadCloser, error) -} - -var fileRe = regexp.MustCompile(`.*[/\\](.*)[/\\](.*)\.xml`) - -// Decode loads and decodes the files represented by l. -func (d *Decoder) Decode(l Loader) (cldr *CLDR, err error) { - d.cldr = makeCLDR() - for i := 0; i < l.Len(); i++ { - fname := l.Path(i) - if m := fileRe.FindStringSubmatch(fname); m != nil { - if len(d.dirFilter) > 0 && !in(d.dirFilter, m[1]) { - continue - } - var r io.Reader - if r, err = l.Reader(i); err == nil { - err = d.decode(m[1], m[2], r) - } - if err != nil { - return nil, err - } - } - } - d.cldr.finalize(d.sectionFilter) - return d.cldr, nil -} - -func (d *Decoder) decode(dir, id string, r io.Reader) error { - var v interface{} - var l *LDML - cldr := d.cldr - switch { - case dir == "supplemental": - v = cldr.supp - case dir == "transforms": - return nil - case dir == "bcp47": - v = cldr.bcp47 - case dir == "validity": - return nil - default: - ok := false - if v, ok = cldr.locale[id]; !ok { - l = &LDML{} - v, cldr.locale[id] = l, l - } - } - x := xml.NewDecoder(r) - if err := x.Decode(v); err != nil { - log.Printf("%s/%s: %v", dir, id, err) - return err - } - if l != nil { - if l.Identity == nil { - return fmt.Errorf("%s/%s: missing identity element", dir, id) - } - // TODO: verify when CLDR bug http://unicode.org/cldr/trac/ticket/8970 - // is resolved. - // path := strings.Split(id, "_") - // if lang := l.Identity.Language.Type; lang != path[0] { - // return fmt.Errorf("%s/%s: language was %s; want %s", dir, id, lang, path[0]) - // } - } - return nil -} - -type pathLoader []string - -func makePathLoader(path string) (pl pathLoader, err error) { - err = filepath.Walk(path, func(path string, _ os.FileInfo, err error) error { - pl = append(pl, path) - return err - }) - return pl, err -} - -func (pl pathLoader) Len() int { - return len(pl) -} - -func (pl pathLoader) Path(i int) string { - return pl[i] -} - -func (pl pathLoader) Reader(i int) (io.ReadCloser, error) { - return os.Open(pl[i]) -} - -// DecodePath loads CLDR data from the given path. -func (d *Decoder) DecodePath(path string) (cldr *CLDR, err error) { - loader, err := makePathLoader(path) - if err != nil { - return nil, err - } - return d.Decode(loader) -} - -type zipLoader struct { - r *zip.Reader -} - -func (zl zipLoader) Len() int { - return len(zl.r.File) -} - -func (zl zipLoader) Path(i int) string { - return zl.r.File[i].Name -} - -func (zl zipLoader) Reader(i int) (io.ReadCloser, error) { - return zl.r.File[i].Open() -} - -// DecodeZip loads CLDR data from the zip archive for which r is the source. -func (d *Decoder) DecodeZip(r io.Reader) (cldr *CLDR, err error) { - buffer, err := ioutil.ReadAll(r) - if err != nil { - return nil, err - } - archive, err := zip.NewReader(bytes.NewReader(buffer), int64(len(buffer))) - if err != nil { - return nil, err - } - return d.Decode(zipLoader{archive}) -} diff --git a/vendor/golang.org/x/text/unicode/cldr/makexml.go b/vendor/golang.org/x/text/unicode/cldr/makexml.go deleted file mode 100644 index 6114d01cbce5..000000000000 --- a/vendor/golang.org/x/text/unicode/cldr/makexml.go +++ /dev/null @@ -1,400 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// This tool generates types for the various XML formats of CLDR. -package main - -import ( - "archive/zip" - "bytes" - "encoding/xml" - "flag" - "fmt" - "io" - "io/ioutil" - "log" - "os" - "regexp" - "strings" - - "golang.org/x/text/internal/gen" -) - -var outputFile = flag.String("output", "xml.go", "output file name") - -func main() { - flag.Parse() - - r := gen.OpenCLDRCoreZip() - buffer, err := ioutil.ReadAll(r) - if err != nil { - log.Fatal("Could not read zip file") - } - r.Close() - z, err := zip.NewReader(bytes.NewReader(buffer), int64(len(buffer))) - if err != nil { - log.Fatalf("Could not read zip archive: %v", err) - } - - var buf bytes.Buffer - - version := gen.CLDRVersion() - - for _, dtd := range files { - for _, f := range z.File { - if strings.HasSuffix(f.Name, dtd.file+".dtd") { - r, err := f.Open() - failOnError(err) - - b := makeBuilder(&buf, dtd) - b.parseDTD(r) - b.resolve(b.index[dtd.top[0]]) - b.write() - if b.version != "" && version != b.version { - println(f.Name) - log.Fatalf("main: inconsistent versions: found %s; want %s", b.version, version) - } - break - } - } - } - fmt.Fprintln(&buf, "// Version is the version of CLDR from which the XML definitions are generated.") - fmt.Fprintf(&buf, "const Version = %q\n", version) - - gen.WriteGoFile(*outputFile, "cldr", buf.Bytes()) -} - -func failOnError(err error) { - if err != nil { - log.New(os.Stderr, "", log.Lshortfile).Output(2, err.Error()) - os.Exit(1) - } -} - -// configuration data per DTD type -type dtd struct { - file string // base file name - root string // Go name of the root XML element - top []string // create a different type for this section - - skipElem []string // hard-coded or deprecated elements - skipAttr []string // attributes to exclude - predefined []string // hard-coded elements exist of the form <name>Elem - forceRepeat []string // elements to make slices despite DTD -} - -var files = []dtd{ - { - file: "ldmlBCP47", - root: "LDMLBCP47", - top: []string{"ldmlBCP47"}, - skipElem: []string{ - "cldrVersion", // deprecated, not used - }, - }, - { - file: "ldmlSupplemental", - root: "SupplementalData", - top: []string{"supplementalData"}, - skipElem: []string{ - "cldrVersion", // deprecated, not used - }, - forceRepeat: []string{ - "plurals", // data defined in plurals.xml and ordinals.xml - }, - }, - { - file: "ldml", - root: "LDML", - top: []string{ - "ldml", "collation", "calendar", "timeZoneNames", "localeDisplayNames", "numbers", - }, - skipElem: []string{ - "cp", // not used anywhere - "special", // not used anywhere - "fallback", // deprecated, not used - "alias", // in Common - "default", // in Common - }, - skipAttr: []string{ - "hiraganaQuarternary", // typo in DTD, correct version included as well - }, - predefined: []string{"rules"}, - }, -} - -var comments = map[string]string{ - "ldmlBCP47": ` -// LDMLBCP47 holds information on allowable values for various variables in LDML. -`, - "supplementalData": ` -// SupplementalData holds information relevant for internationalization -// and proper use of CLDR, but that is not contained in the locale hierarchy. -`, - "ldml": ` -// LDML is the top-level type for locale-specific data. -`, - "collation": ` -// Collation contains rules that specify a certain sort-order, -// as a tailoring of the root order. -// The parsed rules are obtained by passing a RuleProcessor to Collation's -// Process method. -`, - "calendar": ` -// Calendar specifies the fields used for formatting and parsing dates and times. -// The month and quarter names are identified numerically, starting at 1. -// The day (of the week) names are identified with short strings, since there is -// no universally-accepted numeric designation. -`, - "dates": ` -// Dates contains information regarding the format and parsing of dates and times. -`, - "localeDisplayNames": ` -// LocaleDisplayNames specifies localized display names for for scripts, languages, -// countries, currencies, and variants. -`, - "numbers": ` -// Numbers supplies information for formatting and parsing numbers and currencies. -`, -} - -type element struct { - name string // XML element name - category string // elements contained by this element - signature string // category + attrKey* - - attr []*attribute // attributes supported by this element. - sub []struct { // parsed and evaluated sub elements of this element. - e *element - repeat bool // true if the element needs to be a slice - } - - resolved bool // prevent multiple resolutions of this element. -} - -type attribute struct { - name string - key string - list []string - - tag string // Go tag -} - -var ( - reHead = regexp.MustCompile(` *(\w+) +([\w\-]+)`) - reAttr = regexp.MustCompile(` *(\w+) *(?:(\w+)|\(([\w\- \|]+)\)) *(?:#([A-Z]*) *(?:\"([\.\d+])\")?)? *("[\w\-:]*")?`) - reElem = regexp.MustCompile(`^ *(EMPTY|ANY|\(.*\)[\*\+\?]?) *$`) - reToken = regexp.MustCompile(`\w\-`) -) - -// builder is used to read in the DTD files from CLDR and generate Go code -// to be used with the encoding/xml package. -type builder struct { - w io.Writer - index map[string]*element - elem []*element - info dtd - version string -} - -func makeBuilder(w io.Writer, d dtd) builder { - return builder{ - w: w, - index: make(map[string]*element), - elem: []*element{}, - info: d, - } -} - -// parseDTD parses a DTD file. -func (b *builder) parseDTD(r io.Reader) { - for d := xml.NewDecoder(r); ; { - t, err := d.Token() - if t == nil { - break - } - failOnError(err) - dir, ok := t.(xml.Directive) - if !ok { - continue - } - m := reHead.FindSubmatch(dir) - dir = dir[len(m[0]):] - ename := string(m[2]) - el, elementFound := b.index[ename] - switch string(m[1]) { - case "ELEMENT": - if elementFound { - log.Fatal("parseDTD: duplicate entry for element %q", ename) - } - m := reElem.FindSubmatch(dir) - if m == nil { - log.Fatalf("parseDTD: invalid element %q", string(dir)) - } - if len(m[0]) != len(dir) { - log.Fatal("parseDTD: invalid element %q", string(dir), len(dir), len(m[0]), string(m[0])) - } - s := string(m[1]) - el = &element{ - name: ename, - category: s, - } - b.index[ename] = el - case "ATTLIST": - if !elementFound { - log.Fatalf("parseDTD: unknown element %q", ename) - } - s := string(dir) - m := reAttr.FindStringSubmatch(s) - if m == nil { - log.Fatal(fmt.Errorf("parseDTD: invalid attribute %q", string(dir))) - } - if m[4] == "FIXED" { - b.version = m[5] - } else { - switch m[1] { - case "draft", "references", "alt", "validSubLocales", "standard" /* in Common */ : - case "type", "choice": - default: - el.attr = append(el.attr, &attribute{ - name: m[1], - key: s, - list: reToken.FindAllString(m[3], -1), - }) - el.signature = fmt.Sprintf("%s=%s+%s", el.signature, m[1], m[2]) - } - } - } - } -} - -var reCat = regexp.MustCompile(`[ ,\|]*(?:(\(|\)|\#?[\w_-]+)([\*\+\?]?))?`) - -// resolve takes a parsed element and converts it into structured data -// that can be used to generate the XML code. -func (b *builder) resolve(e *element) { - if e.resolved { - return - } - b.elem = append(b.elem, e) - e.resolved = true - s := e.category - found := make(map[string]bool) - sequenceStart := []int{} - for len(s) > 0 { - m := reCat.FindStringSubmatch(s) - if m == nil { - log.Fatalf("%s: invalid category string %q", e.name, s) - } - repeat := m[2] == "*" || m[2] == "+" || in(b.info.forceRepeat, m[1]) - switch m[1] { - case "": - case "(": - sequenceStart = append(sequenceStart, len(e.sub)) - case ")": - if len(sequenceStart) == 0 { - log.Fatalf("%s: unmatched closing parenthesis", e.name) - } - for i := sequenceStart[len(sequenceStart)-1]; i < len(e.sub); i++ { - e.sub[i].repeat = e.sub[i].repeat || repeat - } - sequenceStart = sequenceStart[:len(sequenceStart)-1] - default: - if in(b.info.skipElem, m[1]) { - } else if sub, ok := b.index[m[1]]; ok { - if !found[sub.name] { - e.sub = append(e.sub, struct { - e *element - repeat bool - }{sub, repeat}) - found[sub.name] = true - b.resolve(sub) - } - } else if m[1] == "#PCDATA" || m[1] == "ANY" { - } else if m[1] != "EMPTY" { - log.Fatalf("resolve:%s: element %q not found", e.name, m[1]) - } - } - s = s[len(m[0]):] - } -} - -// return true if s is contained in set. -func in(set []string, s string) bool { - for _, v := range set { - if v == s { - return true - } - } - return false -} - -var repl = strings.NewReplacer("-", " ", "_", " ") - -// title puts the first character or each character following '_' in title case and -// removes all occurrences of '_'. -func title(s string) string { - return strings.Replace(strings.Title(repl.Replace(s)), " ", "", -1) -} - -// writeElem generates Go code for a single element, recursively. -func (b *builder) writeElem(tab int, e *element) { - p := func(f string, x ...interface{}) { - f = strings.Replace(f, "\n", "\n"+strings.Repeat("\t", tab), -1) - fmt.Fprintf(b.w, f, x...) - } - if len(e.sub) == 0 && len(e.attr) == 0 { - p("Common") - return - } - p("struct {") - tab++ - p("\nCommon") - for _, attr := range e.attr { - if !in(b.info.skipAttr, attr.name) { - p("\n%s string `xml:\"%s,attr\"`", title(attr.name), attr.name) - } - } - for _, sub := range e.sub { - if in(b.info.predefined, sub.e.name) { - p("\n%sElem", sub.e.name) - continue - } - if in(b.info.skipElem, sub.e.name) { - continue - } - p("\n%s ", title(sub.e.name)) - if sub.repeat { - p("[]") - } - p("*") - if in(b.info.top, sub.e.name) { - p(title(sub.e.name)) - } else { - b.writeElem(tab, sub.e) - } - p(" `xml:\"%s\"`", sub.e.name) - } - tab-- - p("\n}") -} - -// write generates the Go XML code. -func (b *builder) write() { - for i, name := range b.info.top { - e := b.index[name] - if e != nil { - fmt.Fprintf(b.w, comments[name]) - name := title(e.name) - if i == 0 { - name = b.info.root - } - fmt.Fprintf(b.w, "type %s ", name) - b.writeElem(0, e) - fmt.Fprint(b.w, "\n") - } - } -} diff --git a/vendor/golang.org/x/text/unicode/cldr/resolve.go b/vendor/golang.org/x/text/unicode/cldr/resolve.go deleted file mode 100644 index 691b5903fe49..000000000000 --- a/vendor/golang.org/x/text/unicode/cldr/resolve.go +++ /dev/null @@ -1,602 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cldr - -// This file implements the various inheritance constructs defined by LDML. -// See http://www.unicode.org/reports/tr35/#Inheritance_and_Validity -// for more details. - -import ( - "fmt" - "log" - "reflect" - "regexp" - "sort" - "strings" -) - -// fieldIter iterates over fields in a struct. It includes -// fields of embedded structs. -type fieldIter struct { - v reflect.Value - index, n []int -} - -func iter(v reflect.Value) fieldIter { - if v.Kind() != reflect.Struct { - log.Panicf("value %v must be a struct", v) - } - i := fieldIter{ - v: v, - index: []int{0}, - n: []int{v.NumField()}, - } - i.descent() - return i -} - -func (i *fieldIter) descent() { - for f := i.field(); f.Anonymous && f.Type.NumField() > 0; f = i.field() { - i.index = append(i.index, 0) - i.n = append(i.n, f.Type.NumField()) - } -} - -func (i *fieldIter) done() bool { - return len(i.index) == 1 && i.index[0] >= i.n[0] -} - -func skip(f reflect.StructField) bool { - return !f.Anonymous && (f.Name[0] < 'A' || f.Name[0] > 'Z') -} - -func (i *fieldIter) next() { - for { - k := len(i.index) - 1 - i.index[k]++ - if i.index[k] < i.n[k] { - if !skip(i.field()) { - break - } - } else { - if k == 0 { - return - } - i.index = i.index[:k] - i.n = i.n[:k] - } - } - i.descent() -} - -func (i *fieldIter) value() reflect.Value { - return i.v.FieldByIndex(i.index) -} - -func (i *fieldIter) field() reflect.StructField { - return i.v.Type().FieldByIndex(i.index) -} - -type visitor func(v reflect.Value) error - -var stopDescent = fmt.Errorf("do not recurse") - -func (f visitor) visit(x interface{}) error { - return f.visitRec(reflect.ValueOf(x)) -} - -// visit recursively calls f on all nodes in v. -func (f visitor) visitRec(v reflect.Value) error { - if v.Kind() == reflect.Ptr { - if v.IsNil() { - return nil - } - return f.visitRec(v.Elem()) - } - if err := f(v); err != nil { - if err == stopDescent { - return nil - } - return err - } - switch v.Kind() { - case reflect.Struct: - for i := iter(v); !i.done(); i.next() { - if err := f.visitRec(i.value()); err != nil { - return err - } - } - case reflect.Slice: - for i := 0; i < v.Len(); i++ { - if err := f.visitRec(v.Index(i)); err != nil { - return err - } - } - } - return nil -} - -// getPath is used for error reporting purposes only. -func getPath(e Elem) string { - if e == nil { - return "<nil>" - } - if e.enclosing() == nil { - return e.GetCommon().name - } - if e.GetCommon().Type == "" { - return fmt.Sprintf("%s.%s", getPath(e.enclosing()), e.GetCommon().name) - } - return fmt.Sprintf("%s.%s[type=%s]", getPath(e.enclosing()), e.GetCommon().name, e.GetCommon().Type) -} - -// xmlName returns the xml name of the element or attribute -func xmlName(f reflect.StructField) (name string, attr bool) { - tags := strings.Split(f.Tag.Get("xml"), ",") - for _, s := range tags { - attr = attr || s == "attr" - } - return tags[0], attr -} - -func findField(v reflect.Value, key string) (reflect.Value, error) { - v = reflect.Indirect(v) - for i := iter(v); !i.done(); i.next() { - if n, _ := xmlName(i.field()); n == key { - return i.value(), nil - } - } - return reflect.Value{}, fmt.Errorf("cldr: no field %q in element %#v", key, v.Interface()) -} - -var xpathPart = regexp.MustCompile(`(\pL+)(?:\[@(\pL+)='([\w-]+)'\])?`) - -func walkXPath(e Elem, path string) (res Elem, err error) { - for _, c := range strings.Split(path, "/") { - if c == ".." { - if e = e.enclosing(); e == nil { - panic("path ..") - return nil, fmt.Errorf(`cldr: ".." moves past root in path %q`, path) - } - continue - } else if c == "" { - continue - } - m := xpathPart.FindStringSubmatch(c) - if len(m) == 0 || len(m[0]) != len(c) { - return nil, fmt.Errorf("cldr: syntax error in path component %q", c) - } - v, err := findField(reflect.ValueOf(e), m[1]) - if err != nil { - return nil, err - } - switch v.Kind() { - case reflect.Slice: - i := 0 - if m[2] != "" || v.Len() > 1 { - if m[2] == "" { - m[2] = "type" - if m[3] = e.GetCommon().Default(); m[3] == "" { - return nil, fmt.Errorf("cldr: type selector or default value needed for element %s", m[1]) - } - } - for ; i < v.Len(); i++ { - vi := v.Index(i) - key, err := findField(vi.Elem(), m[2]) - if err != nil { - return nil, err - } - key = reflect.Indirect(key) - if key.Kind() == reflect.String && key.String() == m[3] { - break - } - } - } - if i == v.Len() || v.Index(i).IsNil() { - return nil, fmt.Errorf("no %s found with %s==%s", m[1], m[2], m[3]) - } - e = v.Index(i).Interface().(Elem) - case reflect.Ptr: - if v.IsNil() { - return nil, fmt.Errorf("cldr: element %q not found within element %q", m[1], e.GetCommon().name) - } - var ok bool - if e, ok = v.Interface().(Elem); !ok { - return nil, fmt.Errorf("cldr: %q is not an XML element", m[1]) - } else if m[2] != "" || m[3] != "" { - return nil, fmt.Errorf("cldr: no type selector allowed for element %s", m[1]) - } - default: - return nil, fmt.Errorf("cldr: %q is not an XML element", m[1]) - } - } - return e, nil -} - -const absPrefix = "//ldml/" - -func (cldr *CLDR) resolveAlias(e Elem, src, path string) (res Elem, err error) { - if src != "locale" { - if !strings.HasPrefix(path, absPrefix) { - return nil, fmt.Errorf("cldr: expected absolute path, found %q", path) - } - path = path[len(absPrefix):] - if e, err = cldr.resolve(src); err != nil { - return nil, err - } - } - return walkXPath(e, path) -} - -func (cldr *CLDR) resolveAndMergeAlias(e Elem) error { - alias := e.GetCommon().Alias - if alias == nil { - return nil - } - a, err := cldr.resolveAlias(e, alias.Source, alias.Path) - if err != nil { - return fmt.Errorf("%v: error evaluating path %q: %v", getPath(e), alias.Path, err) - } - // Ensure alias node was already evaluated. TODO: avoid double evaluation. - err = cldr.resolveAndMergeAlias(a) - v := reflect.ValueOf(e).Elem() - for i := iter(reflect.ValueOf(a).Elem()); !i.done(); i.next() { - if vv := i.value(); vv.Kind() != reflect.Ptr || !vv.IsNil() { - if _, attr := xmlName(i.field()); !attr { - v.FieldByIndex(i.index).Set(vv) - } - } - } - return err -} - -func (cldr *CLDR) aliasResolver() visitor { - return func(v reflect.Value) (err error) { - if e, ok := v.Addr().Interface().(Elem); ok { - err = cldr.resolveAndMergeAlias(e) - if err == nil && blocking[e.GetCommon().name] { - return stopDescent - } - } - return err - } -} - -// elements within blocking elements do not inherit. -// Taken from CLDR's supplementalMetaData.xml. -var blocking = map[string]bool{ - "identity": true, - "supplementalData": true, - "cldrTest": true, - "collation": true, - "transform": true, -} - -// Distinguishing attributes affect inheritance; two elements with different -// distinguishing attributes are treated as different for purposes of inheritance, -// except when such attributes occur in the indicated elements. -// Taken from CLDR's supplementalMetaData.xml. -var distinguishing = map[string][]string{ - "key": nil, - "request_id": nil, - "id": nil, - "registry": nil, - "alt": nil, - "iso4217": nil, - "iso3166": nil, - "mzone": nil, - "from": nil, - "to": nil, - "type": []string{ - "abbreviationFallback", - "default", - "mapping", - "measurementSystem", - "preferenceOrdering", - }, - "numberSystem": nil, -} - -func in(set []string, s string) bool { - for _, v := range set { - if v == s { - return true - } - } - return false -} - -// attrKey computes a key based on the distinguishable attributes of -// an element and it's values. -func attrKey(v reflect.Value, exclude ...string) string { - parts := []string{} - ename := v.Interface().(Elem).GetCommon().name - v = v.Elem() - for i := iter(v); !i.done(); i.next() { - if name, attr := xmlName(i.field()); attr { - if except, ok := distinguishing[name]; ok && !in(exclude, name) && !in(except, ename) { - v := i.value() - if v.Kind() == reflect.Ptr { - v = v.Elem() - } - if v.IsValid() { - parts = append(parts, fmt.Sprintf("%s=%s", name, v.String())) - } - } - } - } - sort.Strings(parts) - return strings.Join(parts, ";") -} - -// Key returns a key for e derived from all distinguishing attributes -// except those specified by exclude. -func Key(e Elem, exclude ...string) string { - return attrKey(reflect.ValueOf(e), exclude...) -} - -// linkEnclosing sets the enclosing element as well as the name -// for all sub-elements of child, recursively. -func linkEnclosing(parent, child Elem) { - child.setEnclosing(parent) - v := reflect.ValueOf(child).Elem() - for i := iter(v); !i.done(); i.next() { - vf := i.value() - if vf.Kind() == reflect.Slice { - for j := 0; j < vf.Len(); j++ { - linkEnclosing(child, vf.Index(j).Interface().(Elem)) - } - } else if vf.Kind() == reflect.Ptr && !vf.IsNil() && vf.Elem().Kind() == reflect.Struct { - linkEnclosing(child, vf.Interface().(Elem)) - } - } -} - -func setNames(e Elem, name string) { - e.setName(name) - v := reflect.ValueOf(e).Elem() - for i := iter(v); !i.done(); i.next() { - vf := i.value() - name, _ = xmlName(i.field()) - if vf.Kind() == reflect.Slice { - for j := 0; j < vf.Len(); j++ { - setNames(vf.Index(j).Interface().(Elem), name) - } - } else if vf.Kind() == reflect.Ptr && !vf.IsNil() && vf.Elem().Kind() == reflect.Struct { - setNames(vf.Interface().(Elem), name) - } - } -} - -// deepCopy copies elements of v recursively. All elements of v that may -// be modified by inheritance are explicitly copied. -func deepCopy(v reflect.Value) reflect.Value { - switch v.Kind() { - case reflect.Ptr: - if v.IsNil() || v.Elem().Kind() != reflect.Struct { - return v - } - nv := reflect.New(v.Elem().Type()) - nv.Elem().Set(v.Elem()) - deepCopyRec(nv.Elem(), v.Elem()) - return nv - case reflect.Slice: - nv := reflect.MakeSlice(v.Type(), v.Len(), v.Len()) - for i := 0; i < v.Len(); i++ { - deepCopyRec(nv.Index(i), v.Index(i)) - } - return nv - } - panic("deepCopy: must be called with pointer or slice") -} - -// deepCopyRec is only called by deepCopy. -func deepCopyRec(nv, v reflect.Value) { - if v.Kind() == reflect.Struct { - t := v.Type() - for i := 0; i < v.NumField(); i++ { - if name, attr := xmlName(t.Field(i)); name != "" && !attr { - deepCopyRec(nv.Field(i), v.Field(i)) - } - } - } else { - nv.Set(deepCopy(v)) - } -} - -// newNode is used to insert a missing node during inheritance. -func (cldr *CLDR) newNode(v, enc reflect.Value) reflect.Value { - n := reflect.New(v.Type()) - for i := iter(v); !i.done(); i.next() { - if name, attr := xmlName(i.field()); name == "" || attr { - n.Elem().FieldByIndex(i.index).Set(i.value()) - } - } - n.Interface().(Elem).GetCommon().setEnclosing(enc.Addr().Interface().(Elem)) - return n -} - -// v, parent must be pointers to struct -func (cldr *CLDR) inheritFields(v, parent reflect.Value) (res reflect.Value, err error) { - t := v.Type() - nv := reflect.New(t) - nv.Elem().Set(v) - for i := iter(v); !i.done(); i.next() { - vf := i.value() - f := i.field() - name, attr := xmlName(f) - if name == "" || attr { - continue - } - pf := parent.FieldByIndex(i.index) - if blocking[name] { - if vf.IsNil() { - vf = pf - } - nv.Elem().FieldByIndex(i.index).Set(deepCopy(vf)) - continue - } - switch f.Type.Kind() { - case reflect.Ptr: - if f.Type.Elem().Kind() == reflect.Struct { - if !vf.IsNil() { - if vf, err = cldr.inheritStructPtr(vf, pf); err != nil { - return reflect.Value{}, err - } - vf.Interface().(Elem).setEnclosing(nv.Interface().(Elem)) - nv.Elem().FieldByIndex(i.index).Set(vf) - } else if !pf.IsNil() { - n := cldr.newNode(pf.Elem(), v) - if vf, err = cldr.inheritStructPtr(n, pf); err != nil { - return reflect.Value{}, err - } - vf.Interface().(Elem).setEnclosing(nv.Interface().(Elem)) - nv.Elem().FieldByIndex(i.index).Set(vf) - } - } - case reflect.Slice: - vf, err := cldr.inheritSlice(nv.Elem(), vf, pf) - if err != nil { - return reflect.Zero(t), err - } - nv.Elem().FieldByIndex(i.index).Set(vf) - } - } - return nv, nil -} - -func root(e Elem) *LDML { - for ; e.enclosing() != nil; e = e.enclosing() { - } - return e.(*LDML) -} - -// inheritStructPtr first merges possible aliases in with v and then inherits -// any underspecified elements from parent. -func (cldr *CLDR) inheritStructPtr(v, parent reflect.Value) (r reflect.Value, err error) { - if !v.IsNil() { - e := v.Interface().(Elem).GetCommon() - alias := e.Alias - if alias == nil && !parent.IsNil() { - alias = parent.Interface().(Elem).GetCommon().Alias - } - if alias != nil { - a, err := cldr.resolveAlias(v.Interface().(Elem), alias.Source, alias.Path) - if a != nil { - if v, err = cldr.inheritFields(v.Elem(), reflect.ValueOf(a).Elem()); err != nil { - return reflect.Value{}, err - } - } - } - if !parent.IsNil() { - return cldr.inheritFields(v.Elem(), parent.Elem()) - } - } else if parent.IsNil() { - panic("should not reach here") - } - return v, nil -} - -// Must be slice of struct pointers. -func (cldr *CLDR) inheritSlice(enc, v, parent reflect.Value) (res reflect.Value, err error) { - t := v.Type() - index := make(map[string]reflect.Value) - if !v.IsNil() { - for i := 0; i < v.Len(); i++ { - vi := v.Index(i) - key := attrKey(vi) - index[key] = vi - } - } - if !parent.IsNil() { - for i := 0; i < parent.Len(); i++ { - vi := parent.Index(i) - key := attrKey(vi) - if w, ok := index[key]; ok { - index[key], err = cldr.inheritStructPtr(w, vi) - } else { - n := cldr.newNode(vi.Elem(), enc) - index[key], err = cldr.inheritStructPtr(n, vi) - } - index[key].Interface().(Elem).setEnclosing(enc.Addr().Interface().(Elem)) - if err != nil { - return v, err - } - } - } - keys := make([]string, 0, len(index)) - for k, _ := range index { - keys = append(keys, k) - } - sort.Strings(keys) - sl := reflect.MakeSlice(t, len(index), len(index)) - for i, k := range keys { - sl.Index(i).Set(index[k]) - } - return sl, nil -} - -func parentLocale(loc string) string { - parts := strings.Split(loc, "_") - if len(parts) == 1 { - return "root" - } - parts = parts[:len(parts)-1] - key := strings.Join(parts, "_") - return key -} - -func (cldr *CLDR) resolve(loc string) (res *LDML, err error) { - if r := cldr.resolved[loc]; r != nil { - return r, nil - } - x := cldr.RawLDML(loc) - if x == nil { - return nil, fmt.Errorf("cldr: unknown locale %q", loc) - } - var v reflect.Value - if loc == "root" { - x = deepCopy(reflect.ValueOf(x)).Interface().(*LDML) - linkEnclosing(nil, x) - err = cldr.aliasResolver().visit(x) - } else { - key := parentLocale(loc) - var parent *LDML - for ; cldr.locale[key] == nil; key = parentLocale(key) { - } - if parent, err = cldr.resolve(key); err != nil { - return nil, err - } - v, err = cldr.inheritFields(reflect.ValueOf(x).Elem(), reflect.ValueOf(parent).Elem()) - x = v.Interface().(*LDML) - linkEnclosing(nil, x) - } - if err != nil { - return nil, err - } - cldr.resolved[loc] = x - return x, err -} - -// finalize finalizes the initialization of the raw LDML structs. It also -// removed unwanted fields, as specified by filter, so that they will not -// be unnecessarily evaluated. -func (cldr *CLDR) finalize(filter []string) { - for _, x := range cldr.locale { - if filter != nil { - v := reflect.ValueOf(x).Elem() - t := v.Type() - for i := 0; i < v.NumField(); i++ { - f := t.Field(i) - name, _ := xmlName(f) - if name != "" && name != "identity" && !in(filter, name) { - v.Field(i).Set(reflect.Zero(f.Type)) - } - } - } - linkEnclosing(nil, x) // for resolving aliases and paths - setNames(x, "ldml") - } -} diff --git a/vendor/golang.org/x/text/unicode/cldr/slice.go b/vendor/golang.org/x/text/unicode/cldr/slice.go deleted file mode 100644 index 388c983ff133..000000000000 --- a/vendor/golang.org/x/text/unicode/cldr/slice.go +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cldr - -import ( - "fmt" - "reflect" - "sort" -) - -// Slice provides utilities for modifying slices of elements. -// It can be wrapped around any slice of which the element type implements -// interface Elem. -type Slice struct { - ptr reflect.Value - typ reflect.Type -} - -// Value returns the reflect.Value of the underlying slice. -func (s *Slice) Value() reflect.Value { - return s.ptr.Elem() -} - -// MakeSlice wraps a pointer to a slice of Elems. -// It replaces the array pointed to by the slice so that subsequent modifications -// do not alter the data in a CLDR type. -// It panics if an incorrect type is passed. -func MakeSlice(slicePtr interface{}) Slice { - ptr := reflect.ValueOf(slicePtr) - if ptr.Kind() != reflect.Ptr { - panic(fmt.Sprintf("MakeSlice: argument must be pointer to slice, found %v", ptr.Type())) - } - sl := ptr.Elem() - if sl.Kind() != reflect.Slice { - panic(fmt.Sprintf("MakeSlice: argument must point to a slice, found %v", sl.Type())) - } - intf := reflect.TypeOf((*Elem)(nil)).Elem() - if !sl.Type().Elem().Implements(intf) { - panic(fmt.Sprintf("MakeSlice: element type of slice (%v) does not implement Elem", sl.Type().Elem())) - } - nsl := reflect.MakeSlice(sl.Type(), sl.Len(), sl.Len()) - reflect.Copy(nsl, sl) - sl.Set(nsl) - return Slice{ - ptr: ptr, - typ: sl.Type().Elem().Elem(), - } -} - -func (s Slice) indexForAttr(a string) []int { - for i := iter(reflect.Zero(s.typ)); !i.done(); i.next() { - if n, _ := xmlName(i.field()); n == a { - return i.index - } - } - panic(fmt.Sprintf("MakeSlice: no attribute %q for type %v", a, s.typ)) -} - -// Filter filters s to only include elements for which fn returns true. -func (s Slice) Filter(fn func(e Elem) bool) { - k := 0 - sl := s.Value() - for i := 0; i < sl.Len(); i++ { - vi := sl.Index(i) - if fn(vi.Interface().(Elem)) { - sl.Index(k).Set(vi) - k++ - } - } - sl.Set(sl.Slice(0, k)) -} - -// Group finds elements in s for which fn returns the same value and groups -// them in a new Slice. -func (s Slice) Group(fn func(e Elem) string) []Slice { - m := make(map[string][]reflect.Value) - sl := s.Value() - for i := 0; i < sl.Len(); i++ { - vi := sl.Index(i) - key := fn(vi.Interface().(Elem)) - m[key] = append(m[key], vi) - } - keys := []string{} - for k, _ := range m { - keys = append(keys, k) - } - sort.Strings(keys) - res := []Slice{} - for _, k := range keys { - nsl := reflect.New(sl.Type()) - nsl.Elem().Set(reflect.Append(nsl.Elem(), m[k]...)) - res = append(res, MakeSlice(nsl.Interface())) - } - return res -} - -// SelectAnyOf filters s to contain only elements for which attr matches -// any of the values. -func (s Slice) SelectAnyOf(attr string, values ...string) { - index := s.indexForAttr(attr) - s.Filter(func(e Elem) bool { - vf := reflect.ValueOf(e).Elem().FieldByIndex(index) - return in(values, vf.String()) - }) -} - -// SelectOnePerGroup filters s to include at most one element e per group of -// elements matching Key(attr), where e has an attribute a that matches any -// the values in v. -// If more than one element in a group matches a value in v preference -// is given to the element that matches the first value in v. -func (s Slice) SelectOnePerGroup(a string, v []string) { - index := s.indexForAttr(a) - grouped := s.Group(func(e Elem) string { return Key(e, a) }) - sl := s.Value() - sl.Set(sl.Slice(0, 0)) - for _, g := range grouped { - e := reflect.Value{} - found := len(v) - gsl := g.Value() - for i := 0; i < gsl.Len(); i++ { - vi := gsl.Index(i).Elem().FieldByIndex(index) - j := 0 - for ; j < len(v) && v[j] != vi.String(); j++ { - } - if j < found { - found = j - e = gsl.Index(i) - } - } - if found < len(v) { - sl.Set(reflect.Append(sl, e)) - } - } -} - -// SelectDraft drops all elements from the list with a draft level smaller than d -// and selects the highest draft level of the remaining. -// This method assumes that the input CLDR is canonicalized. -func (s Slice) SelectDraft(d Draft) { - s.SelectOnePerGroup("draft", drafts[len(drafts)-2-int(d):]) -} diff --git a/vendor/golang.org/x/text/unicode/cldr/xml.go b/vendor/golang.org/x/text/unicode/cldr/xml.go deleted file mode 100644 index f847663b1445..000000000000 --- a/vendor/golang.org/x/text/unicode/cldr/xml.go +++ /dev/null @@ -1,1494 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -package cldr - -// LDMLBCP47 holds information on allowable values for various variables in LDML. -type LDMLBCP47 struct { - Common - Version *struct { - Common - Number string `xml:"number,attr"` - } `xml:"version"` - Generation *struct { - Common - Date string `xml:"date,attr"` - } `xml:"generation"` - Keyword []*struct { - Common - Key []*struct { - Common - Extension string `xml:"extension,attr"` - Name string `xml:"name,attr"` - Description string `xml:"description,attr"` - Deprecated string `xml:"deprecated,attr"` - Preferred string `xml:"preferred,attr"` - Alias string `xml:"alias,attr"` - ValueType string `xml:"valueType,attr"` - Since string `xml:"since,attr"` - Type []*struct { - Common - Name string `xml:"name,attr"` - Description string `xml:"description,attr"` - Deprecated string `xml:"deprecated,attr"` - Preferred string `xml:"preferred,attr"` - Alias string `xml:"alias,attr"` - Since string `xml:"since,attr"` - } `xml:"type"` - } `xml:"key"` - } `xml:"keyword"` - Attribute []*struct { - Common - Name string `xml:"name,attr"` - Description string `xml:"description,attr"` - Deprecated string `xml:"deprecated,attr"` - Preferred string `xml:"preferred,attr"` - Since string `xml:"since,attr"` - } `xml:"attribute"` -} - -// SupplementalData holds information relevant for internationalization -// and proper use of CLDR, but that is not contained in the locale hierarchy. -type SupplementalData struct { - Common - Version *struct { - Common - Number string `xml:"number,attr"` - } `xml:"version"` - Generation *struct { - Common - Date string `xml:"date,attr"` - } `xml:"generation"` - CurrencyData *struct { - Common - Fractions []*struct { - Common - Info []*struct { - Common - Iso4217 string `xml:"iso4217,attr"` - Digits string `xml:"digits,attr"` - Rounding string `xml:"rounding,attr"` - CashDigits string `xml:"cashDigits,attr"` - CashRounding string `xml:"cashRounding,attr"` - } `xml:"info"` - } `xml:"fractions"` - Region []*struct { - Common - Iso3166 string `xml:"iso3166,attr"` - Currency []*struct { - Common - Before string `xml:"before,attr"` - From string `xml:"from,attr"` - To string `xml:"to,attr"` - Iso4217 string `xml:"iso4217,attr"` - Digits string `xml:"digits,attr"` - Rounding string `xml:"rounding,attr"` - CashRounding string `xml:"cashRounding,attr"` - Tender string `xml:"tender,attr"` - Alternate []*struct { - Common - Iso4217 string `xml:"iso4217,attr"` - } `xml:"alternate"` - } `xml:"currency"` - } `xml:"region"` - } `xml:"currencyData"` - TerritoryContainment *struct { - Common - Group []*struct { - Common - Contains string `xml:"contains,attr"` - Grouping string `xml:"grouping,attr"` - Status string `xml:"status,attr"` - } `xml:"group"` - } `xml:"territoryContainment"` - SubdivisionContainment *struct { - Common - Subgroup []*struct { - Common - Subtype string `xml:"subtype,attr"` - Contains string `xml:"contains,attr"` - } `xml:"subgroup"` - } `xml:"subdivisionContainment"` - LanguageData *struct { - Common - Language []*struct { - Common - Scripts string `xml:"scripts,attr"` - Territories string `xml:"territories,attr"` - Variants string `xml:"variants,attr"` - } `xml:"language"` - } `xml:"languageData"` - TerritoryInfo *struct { - Common - Territory []*struct { - Common - Gdp string `xml:"gdp,attr"` - LiteracyPercent string `xml:"literacyPercent,attr"` - Population string `xml:"population,attr"` - LanguagePopulation []*struct { - Common - LiteracyPercent string `xml:"literacyPercent,attr"` - WritingPercent string `xml:"writingPercent,attr"` - PopulationPercent string `xml:"populationPercent,attr"` - OfficialStatus string `xml:"officialStatus,attr"` - } `xml:"languagePopulation"` - } `xml:"territory"` - } `xml:"territoryInfo"` - PostalCodeData *struct { - Common - PostCodeRegex []*struct { - Common - TerritoryId string `xml:"territoryId,attr"` - } `xml:"postCodeRegex"` - } `xml:"postalCodeData"` - CalendarData *struct { - Common - Calendar []*struct { - Common - Territories string `xml:"territories,attr"` - CalendarSystem *Common `xml:"calendarSystem"` - Eras *struct { - Common - Era []*struct { - Common - Start string `xml:"start,attr"` - End string `xml:"end,attr"` - } `xml:"era"` - } `xml:"eras"` - } `xml:"calendar"` - } `xml:"calendarData"` - CalendarPreferenceData *struct { - Common - CalendarPreference []*struct { - Common - Territories string `xml:"territories,attr"` - Ordering string `xml:"ordering,attr"` - } `xml:"calendarPreference"` - } `xml:"calendarPreferenceData"` - WeekData *struct { - Common - MinDays []*struct { - Common - Count string `xml:"count,attr"` - Territories string `xml:"territories,attr"` - } `xml:"minDays"` - FirstDay []*struct { - Common - Day string `xml:"day,attr"` - Territories string `xml:"territories,attr"` - } `xml:"firstDay"` - WeekendStart []*struct { - Common - Day string `xml:"day,attr"` - Territories string `xml:"territories,attr"` - } `xml:"weekendStart"` - WeekendEnd []*struct { - Common - Day string `xml:"day,attr"` - Territories string `xml:"territories,attr"` - } `xml:"weekendEnd"` - WeekOfPreference []*struct { - Common - Locales string `xml:"locales,attr"` - Ordering string `xml:"ordering,attr"` - } `xml:"weekOfPreference"` - } `xml:"weekData"` - TimeData *struct { - Common - Hours []*struct { - Common - Allowed string `xml:"allowed,attr"` - Preferred string `xml:"preferred,attr"` - Regions string `xml:"regions,attr"` - } `xml:"hours"` - } `xml:"timeData"` - MeasurementData *struct { - Common - MeasurementSystem []*struct { - Common - Category string `xml:"category,attr"` - Territories string `xml:"territories,attr"` - } `xml:"measurementSystem"` - PaperSize []*struct { - Common - Territories string `xml:"territories,attr"` - } `xml:"paperSize"` - } `xml:"measurementData"` - UnitPreferenceData *struct { - Common - UnitPreferences []*struct { - Common - Category string `xml:"category,attr"` - Usage string `xml:"usage,attr"` - Scope string `xml:"scope,attr"` - UnitPreference []*struct { - Common - Regions string `xml:"regions,attr"` - } `xml:"unitPreference"` - } `xml:"unitPreferences"` - } `xml:"unitPreferenceData"` - TimezoneData *struct { - Common - MapTimezones []*struct { - Common - OtherVersion string `xml:"otherVersion,attr"` - TypeVersion string `xml:"typeVersion,attr"` - MapZone []*struct { - Common - Other string `xml:"other,attr"` - Territory string `xml:"territory,attr"` - } `xml:"mapZone"` - } `xml:"mapTimezones"` - ZoneFormatting []*struct { - Common - Multizone string `xml:"multizone,attr"` - TzidVersion string `xml:"tzidVersion,attr"` - ZoneItem []*struct { - Common - Territory string `xml:"territory,attr"` - Aliases string `xml:"aliases,attr"` - } `xml:"zoneItem"` - } `xml:"zoneFormatting"` - } `xml:"timezoneData"` - Characters *struct { - Common - CharacterFallback []*struct { - Common - Character []*struct { - Common - Value string `xml:"value,attr"` - Substitute []*Common `xml:"substitute"` - } `xml:"character"` - } `xml:"character-fallback"` - } `xml:"characters"` - Transforms *struct { - Common - Transform []*struct { - Common - Source string `xml:"source,attr"` - Target string `xml:"target,attr"` - Variant string `xml:"variant,attr"` - Direction string `xml:"direction,attr"` - Alias string `xml:"alias,attr"` - BackwardAlias string `xml:"backwardAlias,attr"` - Visibility string `xml:"visibility,attr"` - Comment []*Common `xml:"comment"` - TRule []*Common `xml:"tRule"` - } `xml:"transform"` - } `xml:"transforms"` - Metadata *struct { - Common - AttributeOrder *Common `xml:"attributeOrder"` - ElementOrder *Common `xml:"elementOrder"` - SerialElements *Common `xml:"serialElements"` - Suppress *struct { - Common - Attributes []*struct { - Common - Element string `xml:"element,attr"` - Attribute string `xml:"attribute,attr"` - AttributeValue string `xml:"attributeValue,attr"` - } `xml:"attributes"` - } `xml:"suppress"` - Validity *struct { - Common - Variable []*struct { - Common - Id string `xml:"id,attr"` - } `xml:"variable"` - AttributeValues []*struct { - Common - Dtds string `xml:"dtds,attr"` - Elements string `xml:"elements,attr"` - Attributes string `xml:"attributes,attr"` - Order string `xml:"order,attr"` - } `xml:"attributeValues"` - } `xml:"validity"` - Alias *struct { - Common - LanguageAlias []*struct { - Common - Replacement string `xml:"replacement,attr"` - Reason string `xml:"reason,attr"` - } `xml:"languageAlias"` - ScriptAlias []*struct { - Common - Replacement string `xml:"replacement,attr"` - Reason string `xml:"reason,attr"` - } `xml:"scriptAlias"` - TerritoryAlias []*struct { - Common - Replacement string `xml:"replacement,attr"` - Reason string `xml:"reason,attr"` - } `xml:"territoryAlias"` - SubdivisionAlias []*struct { - Common - Replacement string `xml:"replacement,attr"` - Reason string `xml:"reason,attr"` - } `xml:"subdivisionAlias"` - VariantAlias []*struct { - Common - Replacement string `xml:"replacement,attr"` - Reason string `xml:"reason,attr"` - } `xml:"variantAlias"` - ZoneAlias []*struct { - Common - Replacement string `xml:"replacement,attr"` - Reason string `xml:"reason,attr"` - } `xml:"zoneAlias"` - } `xml:"alias"` - Deprecated *struct { - Common - DeprecatedItems []*struct { - Common - Elements string `xml:"elements,attr"` - Attributes string `xml:"attributes,attr"` - Values string `xml:"values,attr"` - } `xml:"deprecatedItems"` - } `xml:"deprecated"` - Distinguishing *struct { - Common - DistinguishingItems []*struct { - Common - Exclude string `xml:"exclude,attr"` - Elements string `xml:"elements,attr"` - Attributes string `xml:"attributes,attr"` - } `xml:"distinguishingItems"` - } `xml:"distinguishing"` - Blocking *struct { - Common - BlockingItems []*struct { - Common - Elements string `xml:"elements,attr"` - } `xml:"blockingItems"` - } `xml:"blocking"` - CoverageAdditions *struct { - Common - LanguageCoverage []*struct { - Common - Values string `xml:"values,attr"` - } `xml:"languageCoverage"` - ScriptCoverage []*struct { - Common - Values string `xml:"values,attr"` - } `xml:"scriptCoverage"` - TerritoryCoverage []*struct { - Common - Values string `xml:"values,attr"` - } `xml:"territoryCoverage"` - CurrencyCoverage []*struct { - Common - Values string `xml:"values,attr"` - } `xml:"currencyCoverage"` - TimezoneCoverage []*struct { - Common - Values string `xml:"values,attr"` - } `xml:"timezoneCoverage"` - } `xml:"coverageAdditions"` - SkipDefaultLocale *struct { - Common - Services string `xml:"services,attr"` - } `xml:"skipDefaultLocale"` - DefaultContent *struct { - Common - Locales string `xml:"locales,attr"` - } `xml:"defaultContent"` - } `xml:"metadata"` - CodeMappings *struct { - Common - LanguageCodes []*struct { - Common - Alpha3 string `xml:"alpha3,attr"` - } `xml:"languageCodes"` - TerritoryCodes []*struct { - Common - Numeric string `xml:"numeric,attr"` - Alpha3 string `xml:"alpha3,attr"` - Fips10 string `xml:"fips10,attr"` - Internet string `xml:"internet,attr"` - } `xml:"territoryCodes"` - CurrencyCodes []*struct { - Common - Numeric string `xml:"numeric,attr"` - } `xml:"currencyCodes"` - } `xml:"codeMappings"` - ParentLocales *struct { - Common - ParentLocale []*struct { - Common - Parent string `xml:"parent,attr"` - Locales string `xml:"locales,attr"` - } `xml:"parentLocale"` - } `xml:"parentLocales"` - LikelySubtags *struct { - Common - LikelySubtag []*struct { - Common - From string `xml:"from,attr"` - To string `xml:"to,attr"` - } `xml:"likelySubtag"` - } `xml:"likelySubtags"` - MetazoneInfo *struct { - Common - Timezone []*struct { - Common - UsesMetazone []*struct { - Common - From string `xml:"from,attr"` - To string `xml:"to,attr"` - Mzone string `xml:"mzone,attr"` - } `xml:"usesMetazone"` - } `xml:"timezone"` - } `xml:"metazoneInfo"` - Plurals []*struct { - Common - PluralRules []*struct { - Common - Locales string `xml:"locales,attr"` - PluralRule []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"pluralRule"` - } `xml:"pluralRules"` - PluralRanges []*struct { - Common - Locales string `xml:"locales,attr"` - PluralRange []*struct { - Common - Start string `xml:"start,attr"` - End string `xml:"end,attr"` - Result string `xml:"result,attr"` - } `xml:"pluralRange"` - } `xml:"pluralRanges"` - } `xml:"plurals"` - TelephoneCodeData *struct { - Common - CodesByTerritory []*struct { - Common - Territory string `xml:"territory,attr"` - TelephoneCountryCode []*struct { - Common - Code string `xml:"code,attr"` - From string `xml:"from,attr"` - To string `xml:"to,attr"` - } `xml:"telephoneCountryCode"` - } `xml:"codesByTerritory"` - } `xml:"telephoneCodeData"` - NumberingSystems *struct { - Common - NumberingSystem []*struct { - Common - Id string `xml:"id,attr"` - Radix string `xml:"radix,attr"` - Digits string `xml:"digits,attr"` - Rules string `xml:"rules,attr"` - } `xml:"numberingSystem"` - } `xml:"numberingSystems"` - Bcp47KeywordMappings *struct { - Common - MapKeys *struct { - Common - KeyMap []*struct { - Common - Bcp47 string `xml:"bcp47,attr"` - } `xml:"keyMap"` - } `xml:"mapKeys"` - MapTypes []*struct { - Common - TypeMap []*struct { - Common - Bcp47 string `xml:"bcp47,attr"` - } `xml:"typeMap"` - } `xml:"mapTypes"` - } `xml:"bcp47KeywordMappings"` - Gender *struct { - Common - PersonList []*struct { - Common - Locales string `xml:"locales,attr"` - } `xml:"personList"` - } `xml:"gender"` - References *struct { - Common - Reference []*struct { - Common - Uri string `xml:"uri,attr"` - } `xml:"reference"` - } `xml:"references"` - LanguageMatching *struct { - Common - LanguageMatches []*struct { - Common - ParadigmLocales []*struct { - Common - Locales string `xml:"locales,attr"` - } `xml:"paradigmLocales"` - MatchVariable []*struct { - Common - Id string `xml:"id,attr"` - Value string `xml:"value,attr"` - } `xml:"matchVariable"` - LanguageMatch []*struct { - Common - Desired string `xml:"desired,attr"` - Supported string `xml:"supported,attr"` - Percent string `xml:"percent,attr"` - Distance string `xml:"distance,attr"` - Oneway string `xml:"oneway,attr"` - } `xml:"languageMatch"` - } `xml:"languageMatches"` - } `xml:"languageMatching"` - DayPeriodRuleSet []*struct { - Common - DayPeriodRules []*struct { - Common - Locales string `xml:"locales,attr"` - DayPeriodRule []*struct { - Common - At string `xml:"at,attr"` - After string `xml:"after,attr"` - Before string `xml:"before,attr"` - From string `xml:"from,attr"` - To string `xml:"to,attr"` - } `xml:"dayPeriodRule"` - } `xml:"dayPeriodRules"` - } `xml:"dayPeriodRuleSet"` - MetaZones *struct { - Common - MetazoneInfo *struct { - Common - Timezone []*struct { - Common - UsesMetazone []*struct { - Common - From string `xml:"from,attr"` - To string `xml:"to,attr"` - Mzone string `xml:"mzone,attr"` - } `xml:"usesMetazone"` - } `xml:"timezone"` - } `xml:"metazoneInfo"` - MapTimezones *struct { - Common - OtherVersion string `xml:"otherVersion,attr"` - TypeVersion string `xml:"typeVersion,attr"` - MapZone []*struct { - Common - Other string `xml:"other,attr"` - Territory string `xml:"territory,attr"` - } `xml:"mapZone"` - } `xml:"mapTimezones"` - } `xml:"metaZones"` - PrimaryZones *struct { - Common - PrimaryZone []*struct { - Common - Iso3166 string `xml:"iso3166,attr"` - } `xml:"primaryZone"` - } `xml:"primaryZones"` - WindowsZones *struct { - Common - MapTimezones *struct { - Common - OtherVersion string `xml:"otherVersion,attr"` - TypeVersion string `xml:"typeVersion,attr"` - MapZone []*struct { - Common - Other string `xml:"other,attr"` - Territory string `xml:"territory,attr"` - } `xml:"mapZone"` - } `xml:"mapTimezones"` - } `xml:"windowsZones"` - CoverageLevels *struct { - Common - ApprovalRequirements *struct { - Common - ApprovalRequirement []*struct { - Common - Votes string `xml:"votes,attr"` - Locales string `xml:"locales,attr"` - Paths string `xml:"paths,attr"` - } `xml:"approvalRequirement"` - } `xml:"approvalRequirements"` - CoverageVariable []*struct { - Common - Key string `xml:"key,attr"` - Value string `xml:"value,attr"` - } `xml:"coverageVariable"` - CoverageLevel []*struct { - Common - InLanguage string `xml:"inLanguage,attr"` - InScript string `xml:"inScript,attr"` - InTerritory string `xml:"inTerritory,attr"` - Value string `xml:"value,attr"` - Match string `xml:"match,attr"` - } `xml:"coverageLevel"` - } `xml:"coverageLevels"` - IdValidity *struct { - Common - Id []*struct { - Common - IdStatus string `xml:"idStatus,attr"` - } `xml:"id"` - } `xml:"idValidity"` - RgScope *struct { - Common - RgPath []*struct { - Common - Path string `xml:"path,attr"` - } `xml:"rgPath"` - } `xml:"rgScope"` - LanguageGroups *struct { - Common - LanguageGroup []*struct { - Common - Parent string `xml:"parent,attr"` - } `xml:"languageGroup"` - } `xml:"languageGroups"` -} - -// LDML is the top-level type for locale-specific data. -type LDML struct { - Common - Version string `xml:"version,attr"` - Identity *struct { - Common - Version *struct { - Common - Number string `xml:"number,attr"` - } `xml:"version"` - Generation *struct { - Common - Date string `xml:"date,attr"` - } `xml:"generation"` - Language *Common `xml:"language"` - Script *Common `xml:"script"` - Territory *Common `xml:"territory"` - Variant *Common `xml:"variant"` - } `xml:"identity"` - LocaleDisplayNames *LocaleDisplayNames `xml:"localeDisplayNames"` - Layout *struct { - Common - Orientation []*struct { - Common - Characters string `xml:"characters,attr"` - Lines string `xml:"lines,attr"` - CharacterOrder []*Common `xml:"characterOrder"` - LineOrder []*Common `xml:"lineOrder"` - } `xml:"orientation"` - InList []*struct { - Common - Casing string `xml:"casing,attr"` - } `xml:"inList"` - InText []*Common `xml:"inText"` - } `xml:"layout"` - ContextTransforms *struct { - Common - ContextTransformUsage []*struct { - Common - ContextTransform []*Common `xml:"contextTransform"` - } `xml:"contextTransformUsage"` - } `xml:"contextTransforms"` - Characters *struct { - Common - ExemplarCharacters []*Common `xml:"exemplarCharacters"` - Ellipsis []*Common `xml:"ellipsis"` - MoreInformation []*Common `xml:"moreInformation"` - Stopwords []*struct { - Common - StopwordList []*Common `xml:"stopwordList"` - } `xml:"stopwords"` - IndexLabels []*struct { - Common - IndexSeparator []*Common `xml:"indexSeparator"` - CompressedIndexSeparator []*Common `xml:"compressedIndexSeparator"` - IndexRangePattern []*Common `xml:"indexRangePattern"` - IndexLabelBefore []*Common `xml:"indexLabelBefore"` - IndexLabelAfter []*Common `xml:"indexLabelAfter"` - IndexLabel []*struct { - Common - IndexSource string `xml:"indexSource,attr"` - Priority string `xml:"priority,attr"` - } `xml:"indexLabel"` - } `xml:"indexLabels"` - Mapping []*struct { - Common - Registry string `xml:"registry,attr"` - } `xml:"mapping"` - ParseLenients []*struct { - Common - Scope string `xml:"scope,attr"` - Level string `xml:"level,attr"` - ParseLenient []*struct { - Common - Sample string `xml:"sample,attr"` - } `xml:"parseLenient"` - } `xml:"parseLenients"` - } `xml:"characters"` - Delimiters *struct { - Common - QuotationStart []*Common `xml:"quotationStart"` - QuotationEnd []*Common `xml:"quotationEnd"` - AlternateQuotationStart []*Common `xml:"alternateQuotationStart"` - AlternateQuotationEnd []*Common `xml:"alternateQuotationEnd"` - } `xml:"delimiters"` - Measurement *struct { - Common - MeasurementSystem []*Common `xml:"measurementSystem"` - PaperSize []*struct { - Common - Height []*Common `xml:"height"` - Width []*Common `xml:"width"` - } `xml:"paperSize"` - } `xml:"measurement"` - Dates *struct { - Common - LocalizedPatternChars []*Common `xml:"localizedPatternChars"` - DateRangePattern []*Common `xml:"dateRangePattern"` - Calendars *struct { - Common - Calendar []*Calendar `xml:"calendar"` - } `xml:"calendars"` - Fields *struct { - Common - Field []*struct { - Common - DisplayName []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"displayName"` - Relative []*Common `xml:"relative"` - RelativeTime []*struct { - Common - RelativeTimePattern []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"relativeTimePattern"` - } `xml:"relativeTime"` - RelativePeriod []*Common `xml:"relativePeriod"` - } `xml:"field"` - } `xml:"fields"` - TimeZoneNames *TimeZoneNames `xml:"timeZoneNames"` - } `xml:"dates"` - Numbers *Numbers `xml:"numbers"` - Units *struct { - Common - Unit []*struct { - Common - DisplayName []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"displayName"` - UnitPattern []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"unitPattern"` - PerUnitPattern []*Common `xml:"perUnitPattern"` - } `xml:"unit"` - UnitLength []*struct { - Common - CompoundUnit []*struct { - Common - CompoundUnitPattern []*Common `xml:"compoundUnitPattern"` - } `xml:"compoundUnit"` - Unit []*struct { - Common - DisplayName []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"displayName"` - UnitPattern []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"unitPattern"` - PerUnitPattern []*Common `xml:"perUnitPattern"` - } `xml:"unit"` - CoordinateUnit []*struct { - Common - CoordinateUnitPattern []*Common `xml:"coordinateUnitPattern"` - } `xml:"coordinateUnit"` - } `xml:"unitLength"` - DurationUnit []*struct { - Common - DurationUnitPattern []*Common `xml:"durationUnitPattern"` - } `xml:"durationUnit"` - } `xml:"units"` - ListPatterns *struct { - Common - ListPattern []*struct { - Common - ListPatternPart []*Common `xml:"listPatternPart"` - } `xml:"listPattern"` - } `xml:"listPatterns"` - Collations *struct { - Common - Version string `xml:"version,attr"` - DefaultCollation *Common `xml:"defaultCollation"` - Collation []*Collation `xml:"collation"` - } `xml:"collations"` - Posix *struct { - Common - Messages []*struct { - Common - Yesstr []*Common `xml:"yesstr"` - Nostr []*Common `xml:"nostr"` - Yesexpr []*Common `xml:"yesexpr"` - Noexpr []*Common `xml:"noexpr"` - } `xml:"messages"` - } `xml:"posix"` - CharacterLabels *struct { - Common - CharacterLabelPattern []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"characterLabelPattern"` - CharacterLabel []*Common `xml:"characterLabel"` - } `xml:"characterLabels"` - Segmentations *struct { - Common - Segmentation []*struct { - Common - Variables *struct { - Common - Variable []*struct { - Common - Id string `xml:"id,attr"` - } `xml:"variable"` - } `xml:"variables"` - SegmentRules *struct { - Common - Rule []*struct { - Common - Id string `xml:"id,attr"` - } `xml:"rule"` - } `xml:"segmentRules"` - Exceptions *struct { - Common - Exception []*Common `xml:"exception"` - } `xml:"exceptions"` - Suppressions *struct { - Common - Suppression []*Common `xml:"suppression"` - } `xml:"suppressions"` - } `xml:"segmentation"` - } `xml:"segmentations"` - Rbnf *struct { - Common - RulesetGrouping []*struct { - Common - Ruleset []*struct { - Common - Access string `xml:"access,attr"` - AllowsParsing string `xml:"allowsParsing,attr"` - Rbnfrule []*struct { - Common - Value string `xml:"value,attr"` - Radix string `xml:"radix,attr"` - Decexp string `xml:"decexp,attr"` - } `xml:"rbnfrule"` - } `xml:"ruleset"` - } `xml:"rulesetGrouping"` - } `xml:"rbnf"` - Annotations *struct { - Common - Annotation []*struct { - Common - Cp string `xml:"cp,attr"` - Tts string `xml:"tts,attr"` - } `xml:"annotation"` - } `xml:"annotations"` - Metadata *struct { - Common - CasingData *struct { - Common - CasingItem []*struct { - Common - Override string `xml:"override,attr"` - ForceError string `xml:"forceError,attr"` - } `xml:"casingItem"` - } `xml:"casingData"` - } `xml:"metadata"` - References *struct { - Common - Reference []*struct { - Common - Uri string `xml:"uri,attr"` - } `xml:"reference"` - } `xml:"references"` -} - -// Collation contains rules that specify a certain sort-order, -// as a tailoring of the root order. -// The parsed rules are obtained by passing a RuleProcessor to Collation's -// Process method. -type Collation struct { - Common - Visibility string `xml:"visibility,attr"` - Base *Common `xml:"base"` - Import []*struct { - Common - Source string `xml:"source,attr"` - } `xml:"import"` - Settings *struct { - Common - Strength string `xml:"strength,attr"` - Alternate string `xml:"alternate,attr"` - Backwards string `xml:"backwards,attr"` - Normalization string `xml:"normalization,attr"` - CaseLevel string `xml:"caseLevel,attr"` - CaseFirst string `xml:"caseFirst,attr"` - HiraganaQuaternary string `xml:"hiraganaQuaternary,attr"` - MaxVariable string `xml:"maxVariable,attr"` - Numeric string `xml:"numeric,attr"` - Private string `xml:"private,attr"` - VariableTop string `xml:"variableTop,attr"` - Reorder string `xml:"reorder,attr"` - } `xml:"settings"` - SuppressContractions *Common `xml:"suppress_contractions"` - Optimize *Common `xml:"optimize"` - Cr []*Common `xml:"cr"` - rulesElem -} - -// Calendar specifies the fields used for formatting and parsing dates and times. -// The month and quarter names are identified numerically, starting at 1. -// The day (of the week) names are identified with short strings, since there is -// no universally-accepted numeric designation. -type Calendar struct { - Common - Months *struct { - Common - MonthContext []*struct { - Common - MonthWidth []*struct { - Common - Month []*struct { - Common - Yeartype string `xml:"yeartype,attr"` - } `xml:"month"` - } `xml:"monthWidth"` - } `xml:"monthContext"` - } `xml:"months"` - MonthNames *struct { - Common - Month []*struct { - Common - Yeartype string `xml:"yeartype,attr"` - } `xml:"month"` - } `xml:"monthNames"` - MonthAbbr *struct { - Common - Month []*struct { - Common - Yeartype string `xml:"yeartype,attr"` - } `xml:"month"` - } `xml:"monthAbbr"` - MonthPatterns *struct { - Common - MonthPatternContext []*struct { - Common - MonthPatternWidth []*struct { - Common - MonthPattern []*Common `xml:"monthPattern"` - } `xml:"monthPatternWidth"` - } `xml:"monthPatternContext"` - } `xml:"monthPatterns"` - Days *struct { - Common - DayContext []*struct { - Common - DayWidth []*struct { - Common - Day []*Common `xml:"day"` - } `xml:"dayWidth"` - } `xml:"dayContext"` - } `xml:"days"` - DayNames *struct { - Common - Day []*Common `xml:"day"` - } `xml:"dayNames"` - DayAbbr *struct { - Common - Day []*Common `xml:"day"` - } `xml:"dayAbbr"` - Quarters *struct { - Common - QuarterContext []*struct { - Common - QuarterWidth []*struct { - Common - Quarter []*Common `xml:"quarter"` - } `xml:"quarterWidth"` - } `xml:"quarterContext"` - } `xml:"quarters"` - Week *struct { - Common - MinDays []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"minDays"` - FirstDay []*struct { - Common - Day string `xml:"day,attr"` - } `xml:"firstDay"` - WeekendStart []*struct { - Common - Day string `xml:"day,attr"` - Time string `xml:"time,attr"` - } `xml:"weekendStart"` - WeekendEnd []*struct { - Common - Day string `xml:"day,attr"` - Time string `xml:"time,attr"` - } `xml:"weekendEnd"` - } `xml:"week"` - Am []*Common `xml:"am"` - Pm []*Common `xml:"pm"` - DayPeriods *struct { - Common - DayPeriodContext []*struct { - Common - DayPeriodWidth []*struct { - Common - DayPeriod []*Common `xml:"dayPeriod"` - } `xml:"dayPeriodWidth"` - } `xml:"dayPeriodContext"` - } `xml:"dayPeriods"` - Eras *struct { - Common - EraNames *struct { - Common - Era []*Common `xml:"era"` - } `xml:"eraNames"` - EraAbbr *struct { - Common - Era []*Common `xml:"era"` - } `xml:"eraAbbr"` - EraNarrow *struct { - Common - Era []*Common `xml:"era"` - } `xml:"eraNarrow"` - } `xml:"eras"` - CyclicNameSets *struct { - Common - CyclicNameSet []*struct { - Common - CyclicNameContext []*struct { - Common - CyclicNameWidth []*struct { - Common - CyclicName []*Common `xml:"cyclicName"` - } `xml:"cyclicNameWidth"` - } `xml:"cyclicNameContext"` - } `xml:"cyclicNameSet"` - } `xml:"cyclicNameSets"` - DateFormats *struct { - Common - DateFormatLength []*struct { - Common - DateFormat []*struct { - Common - Pattern []*struct { - Common - Numbers string `xml:"numbers,attr"` - Count string `xml:"count,attr"` - } `xml:"pattern"` - DisplayName []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"displayName"` - } `xml:"dateFormat"` - } `xml:"dateFormatLength"` - } `xml:"dateFormats"` - TimeFormats *struct { - Common - TimeFormatLength []*struct { - Common - TimeFormat []*struct { - Common - Pattern []*struct { - Common - Numbers string `xml:"numbers,attr"` - Count string `xml:"count,attr"` - } `xml:"pattern"` - DisplayName []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"displayName"` - } `xml:"timeFormat"` - } `xml:"timeFormatLength"` - } `xml:"timeFormats"` - DateTimeFormats *struct { - Common - DateTimeFormatLength []*struct { - Common - DateTimeFormat []*struct { - Common - Pattern []*struct { - Common - Numbers string `xml:"numbers,attr"` - Count string `xml:"count,attr"` - } `xml:"pattern"` - DisplayName []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"displayName"` - } `xml:"dateTimeFormat"` - } `xml:"dateTimeFormatLength"` - AvailableFormats []*struct { - Common - DateFormatItem []*struct { - Common - Id string `xml:"id,attr"` - Count string `xml:"count,attr"` - } `xml:"dateFormatItem"` - } `xml:"availableFormats"` - AppendItems []*struct { - Common - AppendItem []*struct { - Common - Request string `xml:"request,attr"` - } `xml:"appendItem"` - } `xml:"appendItems"` - IntervalFormats []*struct { - Common - IntervalFormatFallback []*Common `xml:"intervalFormatFallback"` - IntervalFormatItem []*struct { - Common - Id string `xml:"id,attr"` - GreatestDifference []*struct { - Common - Id string `xml:"id,attr"` - } `xml:"greatestDifference"` - } `xml:"intervalFormatItem"` - } `xml:"intervalFormats"` - } `xml:"dateTimeFormats"` - Fields []*struct { - Common - Field []*struct { - Common - DisplayName []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"displayName"` - Relative []*Common `xml:"relative"` - RelativeTime []*struct { - Common - RelativeTimePattern []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"relativeTimePattern"` - } `xml:"relativeTime"` - RelativePeriod []*Common `xml:"relativePeriod"` - } `xml:"field"` - } `xml:"fields"` -} -type TimeZoneNames struct { - Common - HourFormat []*Common `xml:"hourFormat"` - HoursFormat []*Common `xml:"hoursFormat"` - GmtFormat []*Common `xml:"gmtFormat"` - GmtZeroFormat []*Common `xml:"gmtZeroFormat"` - RegionFormat []*Common `xml:"regionFormat"` - FallbackFormat []*Common `xml:"fallbackFormat"` - FallbackRegionFormat []*Common `xml:"fallbackRegionFormat"` - AbbreviationFallback []*Common `xml:"abbreviationFallback"` - PreferenceOrdering []*Common `xml:"preferenceOrdering"` - SingleCountries []*struct { - Common - List string `xml:"list,attr"` - } `xml:"singleCountries"` - Zone []*struct { - Common - Long []*struct { - Common - Generic []*Common `xml:"generic"` - Standard []*Common `xml:"standard"` - Daylight []*Common `xml:"daylight"` - } `xml:"long"` - Short []*struct { - Common - Generic []*Common `xml:"generic"` - Standard []*Common `xml:"standard"` - Daylight []*Common `xml:"daylight"` - } `xml:"short"` - CommonlyUsed []*struct { - Common - Used string `xml:"used,attr"` - } `xml:"commonlyUsed"` - ExemplarCity []*Common `xml:"exemplarCity"` - } `xml:"zone"` - Metazone []*struct { - Common - Long []*struct { - Common - Generic []*Common `xml:"generic"` - Standard []*Common `xml:"standard"` - Daylight []*Common `xml:"daylight"` - } `xml:"long"` - Short []*struct { - Common - Generic []*Common `xml:"generic"` - Standard []*Common `xml:"standard"` - Daylight []*Common `xml:"daylight"` - } `xml:"short"` - CommonlyUsed []*struct { - Common - Used string `xml:"used,attr"` - } `xml:"commonlyUsed"` - } `xml:"metazone"` -} - -// LocaleDisplayNames specifies localized display names for for scripts, languages, -// countries, currencies, and variants. -type LocaleDisplayNames struct { - Common - LocaleDisplayPattern *struct { - Common - LocalePattern []*Common `xml:"localePattern"` - LocaleSeparator []*Common `xml:"localeSeparator"` - LocaleKeyTypePattern []*Common `xml:"localeKeyTypePattern"` - } `xml:"localeDisplayPattern"` - Languages *struct { - Common - Language []*Common `xml:"language"` - } `xml:"languages"` - Scripts *struct { - Common - Script []*Common `xml:"script"` - } `xml:"scripts"` - Territories *struct { - Common - Territory []*Common `xml:"territory"` - } `xml:"territories"` - Subdivisions *struct { - Common - Subdivision []*Common `xml:"subdivision"` - } `xml:"subdivisions"` - Variants *struct { - Common - Variant []*Common `xml:"variant"` - } `xml:"variants"` - Keys *struct { - Common - Key []*Common `xml:"key"` - } `xml:"keys"` - Types *struct { - Common - Type []*struct { - Common - Key string `xml:"key,attr"` - } `xml:"type"` - } `xml:"types"` - TransformNames *struct { - Common - TransformName []*Common `xml:"transformName"` - } `xml:"transformNames"` - MeasurementSystemNames *struct { - Common - MeasurementSystemName []*Common `xml:"measurementSystemName"` - } `xml:"measurementSystemNames"` - CodePatterns *struct { - Common - CodePattern []*Common `xml:"codePattern"` - } `xml:"codePatterns"` -} - -// Numbers supplies information for formatting and parsing numbers and currencies. -type Numbers struct { - Common - DefaultNumberingSystem []*Common `xml:"defaultNumberingSystem"` - OtherNumberingSystems []*struct { - Common - Native []*Common `xml:"native"` - Traditional []*Common `xml:"traditional"` - Finance []*Common `xml:"finance"` - } `xml:"otherNumberingSystems"` - MinimumGroupingDigits []*Common `xml:"minimumGroupingDigits"` - Symbols []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - Decimal []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"decimal"` - Group []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"group"` - List []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"list"` - PercentSign []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"percentSign"` - NativeZeroDigit []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"nativeZeroDigit"` - PatternDigit []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"patternDigit"` - PlusSign []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"plusSign"` - MinusSign []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"minusSign"` - Exponential []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"exponential"` - SuperscriptingExponent []*Common `xml:"superscriptingExponent"` - PerMille []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"perMille"` - Infinity []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"infinity"` - Nan []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"nan"` - CurrencyDecimal []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"currencyDecimal"` - CurrencyGroup []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"currencyGroup"` - TimeSeparator []*Common `xml:"timeSeparator"` - } `xml:"symbols"` - DecimalFormats []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - DecimalFormatLength []*struct { - Common - DecimalFormat []*struct { - Common - Pattern []*struct { - Common - Numbers string `xml:"numbers,attr"` - Count string `xml:"count,attr"` - } `xml:"pattern"` - } `xml:"decimalFormat"` - } `xml:"decimalFormatLength"` - } `xml:"decimalFormats"` - ScientificFormats []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - ScientificFormatLength []*struct { - Common - ScientificFormat []*struct { - Common - Pattern []*struct { - Common - Numbers string `xml:"numbers,attr"` - Count string `xml:"count,attr"` - } `xml:"pattern"` - } `xml:"scientificFormat"` - } `xml:"scientificFormatLength"` - } `xml:"scientificFormats"` - PercentFormats []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - PercentFormatLength []*struct { - Common - PercentFormat []*struct { - Common - Pattern []*struct { - Common - Numbers string `xml:"numbers,attr"` - Count string `xml:"count,attr"` - } `xml:"pattern"` - } `xml:"percentFormat"` - } `xml:"percentFormatLength"` - } `xml:"percentFormats"` - CurrencyFormats []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - CurrencySpacing []*struct { - Common - BeforeCurrency []*struct { - Common - CurrencyMatch []*Common `xml:"currencyMatch"` - SurroundingMatch []*Common `xml:"surroundingMatch"` - InsertBetween []*Common `xml:"insertBetween"` - } `xml:"beforeCurrency"` - AfterCurrency []*struct { - Common - CurrencyMatch []*Common `xml:"currencyMatch"` - SurroundingMatch []*Common `xml:"surroundingMatch"` - InsertBetween []*Common `xml:"insertBetween"` - } `xml:"afterCurrency"` - } `xml:"currencySpacing"` - CurrencyFormatLength []*struct { - Common - CurrencyFormat []*struct { - Common - Pattern []*struct { - Common - Numbers string `xml:"numbers,attr"` - Count string `xml:"count,attr"` - } `xml:"pattern"` - } `xml:"currencyFormat"` - } `xml:"currencyFormatLength"` - UnitPattern []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"unitPattern"` - } `xml:"currencyFormats"` - Currencies *struct { - Common - Currency []*struct { - Common - Pattern []*struct { - Common - Numbers string `xml:"numbers,attr"` - Count string `xml:"count,attr"` - } `xml:"pattern"` - DisplayName []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"displayName"` - Symbol []*Common `xml:"symbol"` - Decimal []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"decimal"` - Group []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - } `xml:"group"` - } `xml:"currency"` - } `xml:"currencies"` - MiscPatterns []*struct { - Common - NumberSystem string `xml:"numberSystem,attr"` - Pattern []*struct { - Common - Numbers string `xml:"numbers,attr"` - Count string `xml:"count,attr"` - } `xml:"pattern"` - } `xml:"miscPatterns"` - MinimalPairs []*struct { - Common - PluralMinimalPairs []*struct { - Common - Count string `xml:"count,attr"` - } `xml:"pluralMinimalPairs"` - OrdinalMinimalPairs []*struct { - Common - Ordinal string `xml:"ordinal,attr"` - } `xml:"ordinalMinimalPairs"` - } `xml:"minimalPairs"` -} - -// Version is the version of CLDR from which the XML definitions are generated. -const Version = "32" diff --git a/vendor/golang.org/x/text/unicode/norm/maketables.go b/vendor/golang.org/x/text/unicode/norm/maketables.go deleted file mode 100644 index 338c395ee6f8..000000000000 --- a/vendor/golang.org/x/text/unicode/norm/maketables.go +++ /dev/null @@ -1,976 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Normalization table generator. -// Data read from the web. -// See forminfo.go for a description of the trie values associated with each rune. - -package main - -import ( - "bytes" - "flag" - "fmt" - "io" - "log" - "sort" - "strconv" - "strings" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/triegen" - "golang.org/x/text/internal/ucd" -) - -func main() { - gen.Init() - loadUnicodeData() - compactCCC() - loadCompositionExclusions() - completeCharFields(FCanonical) - completeCharFields(FCompatibility) - computeNonStarterCounts() - verifyComputed() - printChars() - testDerived() - printTestdata() - makeTables() -} - -var ( - tablelist = flag.String("tables", - "all", - "comma-separated list of which tables to generate; "+ - "can be 'decomp', 'recomp', 'info' and 'all'") - test = flag.Bool("test", - false, - "test existing tables against DerivedNormalizationProps and generate test data for regression testing") - verbose = flag.Bool("verbose", - false, - "write data to stdout as it is parsed") -) - -const MaxChar = 0x10FFFF // anything above this shouldn't exist - -// Quick Check properties of runes allow us to quickly -// determine whether a rune may occur in a normal form. -// For a given normal form, a rune may be guaranteed to occur -// verbatim (QC=Yes), may or may not combine with another -// rune (QC=Maybe), or may not occur (QC=No). -type QCResult int - -const ( - QCUnknown QCResult = iota - QCYes - QCNo - QCMaybe -) - -func (r QCResult) String() string { - switch r { - case QCYes: - return "Yes" - case QCNo: - return "No" - case QCMaybe: - return "Maybe" - } - return "***UNKNOWN***" -} - -const ( - FCanonical = iota // NFC or NFD - FCompatibility // NFKC or NFKD - FNumberOfFormTypes -) - -const ( - MComposed = iota // NFC or NFKC - MDecomposed // NFD or NFKD - MNumberOfModes -) - -// This contains only the properties we're interested in. -type Char struct { - name string - codePoint rune // if zero, this index is not a valid code point. - ccc uint8 // canonical combining class - origCCC uint8 - excludeInComp bool // from CompositionExclusions.txt - compatDecomp bool // it has a compatibility expansion - - nTrailingNonStarters uint8 - nLeadingNonStarters uint8 // must be equal to trailing if non-zero - - forms [FNumberOfFormTypes]FormInfo // For FCanonical and FCompatibility - - state State -} - -var chars = make([]Char, MaxChar+1) -var cccMap = make(map[uint8]uint8) - -func (c Char) String() string { - buf := new(bytes.Buffer) - - fmt.Fprintf(buf, "%U [%s]:\n", c.codePoint, c.name) - fmt.Fprintf(buf, " ccc: %v\n", c.ccc) - fmt.Fprintf(buf, " excludeInComp: %v\n", c.excludeInComp) - fmt.Fprintf(buf, " compatDecomp: %v\n", c.compatDecomp) - fmt.Fprintf(buf, " state: %v\n", c.state) - fmt.Fprintf(buf, " NFC:\n") - fmt.Fprint(buf, c.forms[FCanonical]) - fmt.Fprintf(buf, " NFKC:\n") - fmt.Fprint(buf, c.forms[FCompatibility]) - - return buf.String() -} - -// In UnicodeData.txt, some ranges are marked like this: -// 3400;<CJK Ideograph Extension A, First>;Lo;0;L;;;;;N;;;;; -// 4DB5;<CJK Ideograph Extension A, Last>;Lo;0;L;;;;;N;;;;; -// parseCharacter keeps a state variable indicating the weirdness. -type State int - -const ( - SNormal State = iota // known to be zero for the type - SFirst - SLast - SMissing -) - -var lastChar = rune('\u0000') - -func (c Char) isValid() bool { - return c.codePoint != 0 && c.state != SMissing -} - -type FormInfo struct { - quickCheck [MNumberOfModes]QCResult // index: MComposed or MDecomposed - verified [MNumberOfModes]bool // index: MComposed or MDecomposed - - combinesForward bool // May combine with rune on the right - combinesBackward bool // May combine with rune on the left - isOneWay bool // Never appears in result - inDecomp bool // Some decompositions result in this char. - decomp Decomposition - expandedDecomp Decomposition -} - -func (f FormInfo) String() string { - buf := bytes.NewBuffer(make([]byte, 0)) - - fmt.Fprintf(buf, " quickCheck[C]: %v\n", f.quickCheck[MComposed]) - fmt.Fprintf(buf, " quickCheck[D]: %v\n", f.quickCheck[MDecomposed]) - fmt.Fprintf(buf, " cmbForward: %v\n", f.combinesForward) - fmt.Fprintf(buf, " cmbBackward: %v\n", f.combinesBackward) - fmt.Fprintf(buf, " isOneWay: %v\n", f.isOneWay) - fmt.Fprintf(buf, " inDecomp: %v\n", f.inDecomp) - fmt.Fprintf(buf, " decomposition: %X\n", f.decomp) - fmt.Fprintf(buf, " expandedDecomp: %X\n", f.expandedDecomp) - - return buf.String() -} - -type Decomposition []rune - -func parseDecomposition(s string, skipfirst bool) (a []rune, err error) { - decomp := strings.Split(s, " ") - if len(decomp) > 0 && skipfirst { - decomp = decomp[1:] - } - for _, d := range decomp { - point, err := strconv.ParseUint(d, 16, 64) - if err != nil { - return a, err - } - a = append(a, rune(point)) - } - return a, nil -} - -func loadUnicodeData() { - f := gen.OpenUCDFile("UnicodeData.txt") - defer f.Close() - p := ucd.New(f) - for p.Next() { - r := p.Rune(ucd.CodePoint) - char := &chars[r] - - char.ccc = uint8(p.Uint(ucd.CanonicalCombiningClass)) - decmap := p.String(ucd.DecompMapping) - - exp, err := parseDecomposition(decmap, false) - isCompat := false - if err != nil { - if len(decmap) > 0 { - exp, err = parseDecomposition(decmap, true) - if err != nil { - log.Fatalf(`%U: bad decomp |%v|: "%s"`, r, decmap, err) - } - isCompat = true - } - } - - char.name = p.String(ucd.Name) - char.codePoint = r - char.forms[FCompatibility].decomp = exp - if !isCompat { - char.forms[FCanonical].decomp = exp - } else { - char.compatDecomp = true - } - if len(decmap) > 0 { - char.forms[FCompatibility].decomp = exp - } - } - if err := p.Err(); err != nil { - log.Fatal(err) - } -} - -// compactCCC converts the sparse set of CCC values to a continguous one, -// reducing the number of bits needed from 8 to 6. -func compactCCC() { - m := make(map[uint8]uint8) - for i := range chars { - c := &chars[i] - m[c.ccc] = 0 - } - cccs := []int{} - for v, _ := range m { - cccs = append(cccs, int(v)) - } - sort.Ints(cccs) - for i, c := range cccs { - cccMap[uint8(i)] = uint8(c) - m[uint8(c)] = uint8(i) - } - for i := range chars { - c := &chars[i] - c.origCCC = c.ccc - c.ccc = m[c.ccc] - } - if len(m) >= 1<<6 { - log.Fatalf("too many difference CCC values: %d >= 64", len(m)) - } -} - -// CompositionExclusions.txt has form: -// 0958 # ... -// See http://unicode.org/reports/tr44/ for full explanation -func loadCompositionExclusions() { - f := gen.OpenUCDFile("CompositionExclusions.txt") - defer f.Close() - p := ucd.New(f) - for p.Next() { - c := &chars[p.Rune(0)] - if c.excludeInComp { - log.Fatalf("%U: Duplicate entry in exclusions.", c.codePoint) - } - c.excludeInComp = true - } - if e := p.Err(); e != nil { - log.Fatal(e) - } -} - -// hasCompatDecomp returns true if any of the recursive -// decompositions contains a compatibility expansion. -// In this case, the character may not occur in NFK*. -func hasCompatDecomp(r rune) bool { - c := &chars[r] - if c.compatDecomp { - return true - } - for _, d := range c.forms[FCompatibility].decomp { - if hasCompatDecomp(d) { - return true - } - } - return false -} - -// Hangul related constants. -const ( - HangulBase = 0xAC00 - HangulEnd = 0xD7A4 // hangulBase + Jamo combinations (19 * 21 * 28) - - JamoLBase = 0x1100 - JamoLEnd = 0x1113 - JamoVBase = 0x1161 - JamoVEnd = 0x1176 - JamoTBase = 0x11A8 - JamoTEnd = 0x11C3 - - JamoLVTCount = 19 * 21 * 28 - JamoTCount = 28 -) - -func isHangul(r rune) bool { - return HangulBase <= r && r < HangulEnd -} - -func isHangulWithoutJamoT(r rune) bool { - if !isHangul(r) { - return false - } - r -= HangulBase - return r < JamoLVTCount && r%JamoTCount == 0 -} - -func ccc(r rune) uint8 { - return chars[r].ccc -} - -// Insert a rune in a buffer, ordered by Canonical Combining Class. -func insertOrdered(b Decomposition, r rune) Decomposition { - n := len(b) - b = append(b, 0) - cc := ccc(r) - if cc > 0 { - // Use bubble sort. - for ; n > 0; n-- { - if ccc(b[n-1]) <= cc { - break - } - b[n] = b[n-1] - } - } - b[n] = r - return b -} - -// Recursively decompose. -func decomposeRecursive(form int, r rune, d Decomposition) Decomposition { - dcomp := chars[r].forms[form].decomp - if len(dcomp) == 0 { - return insertOrdered(d, r) - } - for _, c := range dcomp { - d = decomposeRecursive(form, c, d) - } - return d -} - -func completeCharFields(form int) { - // Phase 0: pre-expand decomposition. - for i := range chars { - f := &chars[i].forms[form] - if len(f.decomp) == 0 { - continue - } - exp := make(Decomposition, 0) - for _, c := range f.decomp { - exp = decomposeRecursive(form, c, exp) - } - f.expandedDecomp = exp - } - - // Phase 1: composition exclusion, mark decomposition. - for i := range chars { - c := &chars[i] - f := &c.forms[form] - - // Marks script-specific exclusions and version restricted. - f.isOneWay = c.excludeInComp - - // Singletons - f.isOneWay = f.isOneWay || len(f.decomp) == 1 - - // Non-starter decompositions - if len(f.decomp) > 1 { - chk := c.ccc != 0 || chars[f.decomp[0]].ccc != 0 - f.isOneWay = f.isOneWay || chk - } - - // Runes that decompose into more than two runes. - f.isOneWay = f.isOneWay || len(f.decomp) > 2 - - if form == FCompatibility { - f.isOneWay = f.isOneWay || hasCompatDecomp(c.codePoint) - } - - for _, r := range f.decomp { - chars[r].forms[form].inDecomp = true - } - } - - // Phase 2: forward and backward combining. - for i := range chars { - c := &chars[i] - f := &c.forms[form] - - if !f.isOneWay && len(f.decomp) == 2 { - f0 := &chars[f.decomp[0]].forms[form] - f1 := &chars[f.decomp[1]].forms[form] - if !f0.isOneWay { - f0.combinesForward = true - } - if !f1.isOneWay { - f1.combinesBackward = true - } - } - if isHangulWithoutJamoT(rune(i)) { - f.combinesForward = true - } - } - - // Phase 3: quick check values. - for i := range chars { - c := &chars[i] - f := &c.forms[form] - - switch { - case len(f.decomp) > 0: - f.quickCheck[MDecomposed] = QCNo - case isHangul(rune(i)): - f.quickCheck[MDecomposed] = QCNo - default: - f.quickCheck[MDecomposed] = QCYes - } - switch { - case f.isOneWay: - f.quickCheck[MComposed] = QCNo - case (i & 0xffff00) == JamoLBase: - f.quickCheck[MComposed] = QCYes - if JamoLBase <= i && i < JamoLEnd { - f.combinesForward = true - } - if JamoVBase <= i && i < JamoVEnd { - f.quickCheck[MComposed] = QCMaybe - f.combinesBackward = true - f.combinesForward = true - } - if JamoTBase <= i && i < JamoTEnd { - f.quickCheck[MComposed] = QCMaybe - f.combinesBackward = true - } - case !f.combinesBackward: - f.quickCheck[MComposed] = QCYes - default: - f.quickCheck[MComposed] = QCMaybe - } - } -} - -func computeNonStarterCounts() { - // Phase 4: leading and trailing non-starter count - for i := range chars { - c := &chars[i] - - runes := []rune{rune(i)} - // We always use FCompatibility so that the CGJ insertion points do not - // change for repeated normalizations with different forms. - if exp := c.forms[FCompatibility].expandedDecomp; len(exp) > 0 { - runes = exp - } - // We consider runes that combine backwards to be non-starters for the - // purpose of Stream-Safe Text Processing. - for _, r := range runes { - if cr := &chars[r]; cr.ccc == 0 && !cr.forms[FCompatibility].combinesBackward { - break - } - c.nLeadingNonStarters++ - } - for i := len(runes) - 1; i >= 0; i-- { - if cr := &chars[runes[i]]; cr.ccc == 0 && !cr.forms[FCompatibility].combinesBackward { - break - } - c.nTrailingNonStarters++ - } - if c.nTrailingNonStarters > 3 { - log.Fatalf("%U: Decomposition with more than 3 (%d) trailing modifiers (%U)", i, c.nTrailingNonStarters, runes) - } - - if isHangul(rune(i)) { - c.nTrailingNonStarters = 2 - if isHangulWithoutJamoT(rune(i)) { - c.nTrailingNonStarters = 1 - } - } - - if l, t := c.nLeadingNonStarters, c.nTrailingNonStarters; l > 0 && l != t { - log.Fatalf("%U: number of leading and trailing non-starters should be equal (%d vs %d)", i, l, t) - } - if t := c.nTrailingNonStarters; t > 3 { - log.Fatalf("%U: number of trailing non-starters is %d > 3", t) - } - } -} - -func printBytes(w io.Writer, b []byte, name string) { - fmt.Fprintf(w, "// %s: %d bytes\n", name, len(b)) - fmt.Fprintf(w, "var %s = [...]byte {", name) - for i, c := range b { - switch { - case i%64 == 0: - fmt.Fprintf(w, "\n// Bytes %x - %x\n", i, i+63) - case i%8 == 0: - fmt.Fprintf(w, "\n") - } - fmt.Fprintf(w, "0x%.2X, ", c) - } - fmt.Fprint(w, "\n}\n\n") -} - -// See forminfo.go for format. -func makeEntry(f *FormInfo, c *Char) uint16 { - e := uint16(0) - if r := c.codePoint; HangulBase <= r && r < HangulEnd { - e |= 0x40 - } - if f.combinesForward { - e |= 0x20 - } - if f.quickCheck[MDecomposed] == QCNo { - e |= 0x4 - } - switch f.quickCheck[MComposed] { - case QCYes: - case QCNo: - e |= 0x10 - case QCMaybe: - e |= 0x18 - default: - log.Fatalf("Illegal quickcheck value %v.", f.quickCheck[MComposed]) - } - e |= uint16(c.nTrailingNonStarters) - return e -} - -// decompSet keeps track of unique decompositions, grouped by whether -// the decomposition is followed by a trailing and/or leading CCC. -type decompSet [7]map[string]bool - -const ( - normalDecomp = iota - firstMulti - firstCCC - endMulti - firstLeadingCCC - firstCCCZeroExcept - firstStarterWithNLead - lastDecomp -) - -var cname = []string{"firstMulti", "firstCCC", "endMulti", "firstLeadingCCC", "firstCCCZeroExcept", "firstStarterWithNLead", "lastDecomp"} - -func makeDecompSet() decompSet { - m := decompSet{} - for i := range m { - m[i] = make(map[string]bool) - } - return m -} -func (m *decompSet) insert(key int, s string) { - m[key][s] = true -} - -func printCharInfoTables(w io.Writer) int { - mkstr := func(r rune, f *FormInfo) (int, string) { - d := f.expandedDecomp - s := string([]rune(d)) - if max := 1 << 6; len(s) >= max { - const msg = "%U: too many bytes in decomposition: %d >= %d" - log.Fatalf(msg, r, len(s), max) - } - head := uint8(len(s)) - if f.quickCheck[MComposed] != QCYes { - head |= 0x40 - } - if f.combinesForward { - head |= 0x80 - } - s = string([]byte{head}) + s - - lccc := ccc(d[0]) - tccc := ccc(d[len(d)-1]) - cc := ccc(r) - if cc != 0 && lccc == 0 && tccc == 0 { - log.Fatalf("%U: trailing and leading ccc are 0 for non-zero ccc %d", r, cc) - } - if tccc < lccc && lccc != 0 { - const msg = "%U: lccc (%d) must be <= tcc (%d)" - log.Fatalf(msg, r, lccc, tccc) - } - index := normalDecomp - nTrail := chars[r].nTrailingNonStarters - nLead := chars[r].nLeadingNonStarters - if tccc > 0 || lccc > 0 || nTrail > 0 { - tccc <<= 2 - tccc |= nTrail - s += string([]byte{tccc}) - index = endMulti - for _, r := range d[1:] { - if ccc(r) == 0 { - index = firstCCC - } - } - if lccc > 0 || nLead > 0 { - s += string([]byte{lccc}) - if index == firstCCC { - log.Fatalf("%U: multi-segment decomposition not supported for decompositions with leading CCC != 0", r) - } - index = firstLeadingCCC - } - if cc != lccc { - if cc != 0 { - log.Fatalf("%U: for lccc != ccc, expected ccc to be 0; was %d", r, cc) - } - index = firstCCCZeroExcept - } - } else if len(d) > 1 { - index = firstMulti - } - return index, s - } - - decompSet := makeDecompSet() - const nLeadStr = "\x00\x01" // 0-byte length and tccc with nTrail. - decompSet.insert(firstStarterWithNLead, nLeadStr) - - // Store the uniqued decompositions in a byte buffer, - // preceded by their byte length. - for _, c := range chars { - for _, f := range c.forms { - if len(f.expandedDecomp) == 0 { - continue - } - if f.combinesBackward { - log.Fatalf("%U: combinesBackward and decompose", c.codePoint) - } - index, s := mkstr(c.codePoint, &f) - decompSet.insert(index, s) - } - } - - decompositions := bytes.NewBuffer(make([]byte, 0, 10000)) - size := 0 - positionMap := make(map[string]uint16) - decompositions.WriteString("\000") - fmt.Fprintln(w, "const (") - for i, m := range decompSet { - sa := []string{} - for s := range m { - sa = append(sa, s) - } - sort.Strings(sa) - for _, s := range sa { - p := decompositions.Len() - decompositions.WriteString(s) - positionMap[s] = uint16(p) - } - if cname[i] != "" { - fmt.Fprintf(w, "%s = 0x%X\n", cname[i], decompositions.Len()) - } - } - fmt.Fprintln(w, "maxDecomp = 0x8000") - fmt.Fprintln(w, ")") - b := decompositions.Bytes() - printBytes(w, b, "decomps") - size += len(b) - - varnames := []string{"nfc", "nfkc"} - for i := 0; i < FNumberOfFormTypes; i++ { - trie := triegen.NewTrie(varnames[i]) - - for r, c := range chars { - f := c.forms[i] - d := f.expandedDecomp - if len(d) != 0 { - _, key := mkstr(c.codePoint, &f) - trie.Insert(rune(r), uint64(positionMap[key])) - if c.ccc != ccc(d[0]) { - // We assume the lead ccc of a decomposition !=0 in this case. - if ccc(d[0]) == 0 { - log.Fatalf("Expected leading CCC to be non-zero; ccc is %d", c.ccc) - } - } - } else if c.nLeadingNonStarters > 0 && len(f.expandedDecomp) == 0 && c.ccc == 0 && !f.combinesBackward { - // Handle cases where it can't be detected that the nLead should be equal - // to nTrail. - trie.Insert(c.codePoint, uint64(positionMap[nLeadStr])) - } else if v := makeEntry(&f, &c)<<8 | uint16(c.ccc); v != 0 { - trie.Insert(c.codePoint, uint64(0x8000|v)) - } - } - sz, err := trie.Gen(w, triegen.Compact(&normCompacter{name: varnames[i]})) - if err != nil { - log.Fatal(err) - } - size += sz - } - return size -} - -func contains(sa []string, s string) bool { - for _, a := range sa { - if a == s { - return true - } - } - return false -} - -func makeTables() { - w := &bytes.Buffer{} - - size := 0 - if *tablelist == "" { - return - } - list := strings.Split(*tablelist, ",") - if *tablelist == "all" { - list = []string{"recomp", "info"} - } - - // Compute maximum decomposition size. - max := 0 - for _, c := range chars { - if n := len(string(c.forms[FCompatibility].expandedDecomp)); n > max { - max = n - } - } - - fmt.Fprintln(w, "const (") - fmt.Fprintln(w, "\t// Version is the Unicode edition from which the tables are derived.") - fmt.Fprintf(w, "\tVersion = %q\n", gen.UnicodeVersion()) - fmt.Fprintln(w) - fmt.Fprintln(w, "\t// MaxTransformChunkSize indicates the maximum number of bytes that Transform") - fmt.Fprintln(w, "\t// may need to write atomically for any Form. Making a destination buffer at") - fmt.Fprintln(w, "\t// least this size ensures that Transform can always make progress and that") - fmt.Fprintln(w, "\t// the user does not need to grow the buffer on an ErrShortDst.") - fmt.Fprintf(w, "\tMaxTransformChunkSize = %d+maxNonStarters*4\n", len(string(0x034F))+max) - fmt.Fprintln(w, ")\n") - - // Print the CCC remap table. - size += len(cccMap) - fmt.Fprintf(w, "var ccc = [%d]uint8{", len(cccMap)) - for i := 0; i < len(cccMap); i++ { - if i%8 == 0 { - fmt.Fprintln(w) - } - fmt.Fprintf(w, "%3d, ", cccMap[uint8(i)]) - } - fmt.Fprintln(w, "\n}\n") - - if contains(list, "info") { - size += printCharInfoTables(w) - } - - if contains(list, "recomp") { - // Note that we use 32 bit keys, instead of 64 bit. - // This clips the bits of three entries, but we know - // this won't cause a collision. The compiler will catch - // any changes made to UnicodeData.txt that introduces - // a collision. - // Note that the recomposition map for NFC and NFKC - // are identical. - - // Recomposition map - nrentries := 0 - for _, c := range chars { - f := c.forms[FCanonical] - if !f.isOneWay && len(f.decomp) > 0 { - nrentries++ - } - } - sz := nrentries * 8 - size += sz - fmt.Fprintf(w, "// recompMap: %d bytes (entries only)\n", sz) - fmt.Fprintln(w, "var recompMap = map[uint32]rune{") - for i, c := range chars { - f := c.forms[FCanonical] - d := f.decomp - if !f.isOneWay && len(d) > 0 { - key := uint32(uint16(d[0]))<<16 + uint32(uint16(d[1])) - fmt.Fprintf(w, "0x%.8X: 0x%.4X,\n", key, i) - } - } - fmt.Fprintf(w, "}\n\n") - } - - fmt.Fprintf(w, "// Total size of tables: %dKB (%d bytes)\n", (size+512)/1024, size) - gen.WriteVersionedGoFile("tables.go", "norm", w.Bytes()) -} - -func printChars() { - if *verbose { - for _, c := range chars { - if !c.isValid() || c.state == SMissing { - continue - } - fmt.Println(c) - } - } -} - -// verifyComputed does various consistency tests. -func verifyComputed() { - for i, c := range chars { - for _, f := range c.forms { - isNo := (f.quickCheck[MDecomposed] == QCNo) - if (len(f.decomp) > 0) != isNo && !isHangul(rune(i)) { - log.Fatalf("%U: NF*D QC must be No if rune decomposes", i) - } - - isMaybe := f.quickCheck[MComposed] == QCMaybe - if f.combinesBackward != isMaybe { - log.Fatalf("%U: NF*C QC must be Maybe if combinesBackward", i) - } - if len(f.decomp) > 0 && f.combinesForward && isMaybe { - log.Fatalf("%U: NF*C QC must be Yes or No if combinesForward and decomposes", i) - } - - if len(f.expandedDecomp) != 0 { - continue - } - if a, b := c.nLeadingNonStarters > 0, (c.ccc > 0 || f.combinesBackward); a != b { - // We accept these runes to be treated differently (it only affects - // segment breaking in iteration, most likely on improper use), but - // reconsider if more characters are added. - // U+FF9E HALFWIDTH KATAKANA VOICED SOUND MARK;Lm;0;L;<narrow> 3099;;;;N;;;;; - // U+FF9F HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK;Lm;0;L;<narrow> 309A;;;;N;;;;; - // U+3133 HANGUL LETTER KIYEOK-SIOS;Lo;0;L;<compat> 11AA;;;;N;HANGUL LETTER GIYEOG SIOS;;;; - // U+318E HANGUL LETTER ARAEAE;Lo;0;L;<compat> 11A1;;;;N;HANGUL LETTER ALAE AE;;;; - // U+FFA3 HALFWIDTH HANGUL LETTER KIYEOK-SIOS;Lo;0;L;<narrow> 3133;;;;N;HALFWIDTH HANGUL LETTER GIYEOG SIOS;;;; - // U+FFDC HALFWIDTH HANGUL LETTER I;Lo;0;L;<narrow> 3163;;;;N;;;;; - if i != 0xFF9E && i != 0xFF9F && !(0x3133 <= i && i <= 0x318E) && !(0xFFA3 <= i && i <= 0xFFDC) { - log.Fatalf("%U: nLead was %v; want %v", i, a, b) - } - } - } - nfc := c.forms[FCanonical] - nfkc := c.forms[FCompatibility] - if nfc.combinesBackward != nfkc.combinesBackward { - log.Fatalf("%U: Cannot combine combinesBackward\n", c.codePoint) - } - } -} - -// Use values in DerivedNormalizationProps.txt to compare against the -// values we computed. -// DerivedNormalizationProps.txt has form: -// 00C0..00C5 ; NFD_QC; N # ... -// 0374 ; NFD_QC; N # ... -// See http://unicode.org/reports/tr44/ for full explanation -func testDerived() { - f := gen.OpenUCDFile("DerivedNormalizationProps.txt") - defer f.Close() - p := ucd.New(f) - for p.Next() { - r := p.Rune(0) - c := &chars[r] - - var ftype, mode int - qt := p.String(1) - switch qt { - case "NFC_QC": - ftype, mode = FCanonical, MComposed - case "NFD_QC": - ftype, mode = FCanonical, MDecomposed - case "NFKC_QC": - ftype, mode = FCompatibility, MComposed - case "NFKD_QC": - ftype, mode = FCompatibility, MDecomposed - default: - continue - } - var qr QCResult - switch p.String(2) { - case "Y": - qr = QCYes - case "N": - qr = QCNo - case "M": - qr = QCMaybe - default: - log.Fatalf(`Unexpected quick check value "%s"`, p.String(2)) - } - if got := c.forms[ftype].quickCheck[mode]; got != qr { - log.Printf("%U: FAILED %s (was %v need %v)\n", r, qt, got, qr) - } - c.forms[ftype].verified[mode] = true - } - if err := p.Err(); err != nil { - log.Fatal(err) - } - // Any unspecified value must be QCYes. Verify this. - for i, c := range chars { - for j, fd := range c.forms { - for k, qr := range fd.quickCheck { - if !fd.verified[k] && qr != QCYes { - m := "%U: FAIL F:%d M:%d (was %v need Yes) %s\n" - log.Printf(m, i, j, k, qr, c.name) - } - } - } - } -} - -var testHeader = `const ( - Yes = iota - No - Maybe -) - -type formData struct { - qc uint8 - combinesForward bool - decomposition string -} - -type runeData struct { - r rune - ccc uint8 - nLead uint8 - nTrail uint8 - f [2]formData // 0: canonical; 1: compatibility -} - -func f(qc uint8, cf bool, dec string) [2]formData { - return [2]formData{{qc, cf, dec}, {qc, cf, dec}} -} - -func g(qc, qck uint8, cf, cfk bool, d, dk string) [2]formData { - return [2]formData{{qc, cf, d}, {qck, cfk, dk}} -} - -var testData = []runeData{ -` - -func printTestdata() { - type lastInfo struct { - ccc uint8 - nLead uint8 - nTrail uint8 - f string - } - - last := lastInfo{} - w := &bytes.Buffer{} - fmt.Fprintf(w, testHeader) - for r, c := range chars { - f := c.forms[FCanonical] - qc, cf, d := f.quickCheck[MComposed], f.combinesForward, string(f.expandedDecomp) - f = c.forms[FCompatibility] - qck, cfk, dk := f.quickCheck[MComposed], f.combinesForward, string(f.expandedDecomp) - s := "" - if d == dk && qc == qck && cf == cfk { - s = fmt.Sprintf("f(%s, %v, %q)", qc, cf, d) - } else { - s = fmt.Sprintf("g(%s, %s, %v, %v, %q, %q)", qc, qck, cf, cfk, d, dk) - } - current := lastInfo{c.ccc, c.nLeadingNonStarters, c.nTrailingNonStarters, s} - if last != current { - fmt.Fprintf(w, "\t{0x%x, %d, %d, %d, %s},\n", r, c.origCCC, c.nLeadingNonStarters, c.nTrailingNonStarters, s) - last = current - } - } - fmt.Fprintln(w, "}") - gen.WriteVersionedGoFile("data_test.go", "norm", w.Bytes()) -} diff --git a/vendor/golang.org/x/text/unicode/norm/triegen.go b/vendor/golang.org/x/text/unicode/norm/triegen.go deleted file mode 100644 index 45d711900d14..000000000000 --- a/vendor/golang.org/x/text/unicode/norm/triegen.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Trie table generator. -// Used by make*tables tools to generate a go file with trie data structures -// for mapping UTF-8 to a 16-bit value. All but the last byte in a UTF-8 byte -// sequence are used to lookup offsets in the index table to be used for the -// next byte. The last byte is used to index into a table with 16-bit values. - -package main - -import ( - "fmt" - "io" -) - -const maxSparseEntries = 16 - -type normCompacter struct { - sparseBlocks [][]uint64 - sparseOffset []uint16 - sparseCount int - name string -} - -func mostFrequentStride(a []uint64) int { - counts := make(map[int]int) - var v int - for _, x := range a { - if stride := int(x) - v; v != 0 && stride >= 0 { - counts[stride]++ - } - v = int(x) - } - var maxs, maxc int - for stride, cnt := range counts { - if cnt > maxc || (cnt == maxc && stride < maxs) { - maxs, maxc = stride, cnt - } - } - return maxs -} - -func countSparseEntries(a []uint64) int { - stride := mostFrequentStride(a) - var v, count int - for _, tv := range a { - if int(tv)-v != stride { - if tv != 0 { - count++ - } - } - v = int(tv) - } - return count -} - -func (c *normCompacter) Size(v []uint64) (sz int, ok bool) { - if n := countSparseEntries(v); n <= maxSparseEntries { - return (n+1)*4 + 2, true - } - return 0, false -} - -func (c *normCompacter) Store(v []uint64) uint32 { - h := uint32(len(c.sparseOffset)) - c.sparseBlocks = append(c.sparseBlocks, v) - c.sparseOffset = append(c.sparseOffset, uint16(c.sparseCount)) - c.sparseCount += countSparseEntries(v) + 1 - return h -} - -func (c *normCompacter) Handler() string { - return c.name + "Sparse.lookup" -} - -func (c *normCompacter) Print(w io.Writer) (retErr error) { - p := func(f string, x ...interface{}) { - if _, err := fmt.Fprintf(w, f, x...); retErr == nil && err != nil { - retErr = err - } - } - - ls := len(c.sparseBlocks) - p("// %sSparseOffset: %d entries, %d bytes\n", c.name, ls, ls*2) - p("var %sSparseOffset = %#v\n\n", c.name, c.sparseOffset) - - ns := c.sparseCount - p("// %sSparseValues: %d entries, %d bytes\n", c.name, ns, ns*4) - p("var %sSparseValues = [%d]valueRange {", c.name, ns) - for i, b := range c.sparseBlocks { - p("\n// Block %#x, offset %#x", i, c.sparseOffset[i]) - var v int - stride := mostFrequentStride(b) - n := countSparseEntries(b) - p("\n{value:%#04x,lo:%#02x},", stride, uint8(n)) - for i, nv := range b { - if int(nv)-v != stride { - if v != 0 { - p(",hi:%#02x},", 0x80+i-1) - } - if nv != 0 { - p("\n{value:%#04x,lo:%#02x", nv, 0x80+i) - } - } - v = int(nv) - } - if v != 0 { - p(",hi:%#02x},", 0x80+len(b)-1) - } - } - p("\n}\n\n") - return -} diff --git a/vendor/golang.org/x/text/unicode/rangetable/gen.go b/vendor/golang.org/x/text/unicode/rangetable/gen.go deleted file mode 100644 index 5b5f828a169e..000000000000 --- a/vendor/golang.org/x/text/unicode/rangetable/gen.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "bytes" - "flag" - "fmt" - "io" - "log" - "reflect" - "strings" - "unicode" - - "golang.org/x/text/collate" - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/ucd" - "golang.org/x/text/language" - "golang.org/x/text/unicode/rangetable" -) - -var versionList = flag.String("versions", "", - "list of versions for which to generate RangeTables") - -const bootstrapMessage = `No versions specified. -To bootstrap the code generation, run: - go run gen.go --versions=4.1.0,5.0.0,6.0.0,6.1.0,6.2.0,6.3.0,7.0.0 - -and ensure that the latest versions are included by checking: - http://www.unicode.org/Public/` - -func getVersions() []string { - if *versionList == "" { - log.Fatal(bootstrapMessage) - } - - c := collate.New(language.Und, collate.Numeric) - versions := strings.Split(*versionList, ",") - c.SortStrings(versions) - - // Ensure that at least the current version is included. - for _, v := range versions { - if v == gen.UnicodeVersion() { - return versions - } - } - - versions = append(versions, gen.UnicodeVersion()) - c.SortStrings(versions) - return versions -} - -func main() { - gen.Init() - - versions := getVersions() - - w := &bytes.Buffer{} - - fmt.Fprintf(w, "//go:generate go run gen.go --versions=%s\n\n", strings.Join(versions, ",")) - fmt.Fprintf(w, "import \"unicode\"\n\n") - - vstr := func(s string) string { return strings.Replace(s, ".", "_", -1) } - - fmt.Fprintf(w, "var assigned = map[string]*unicode.RangeTable{\n") - for _, v := range versions { - fmt.Fprintf(w, "\t%q: assigned%s,\n", v, vstr(v)) - } - fmt.Fprintf(w, "}\n\n") - - var size int - for _, v := range versions { - assigned := []rune{} - - r := gen.Open("http://www.unicode.org/Public/", "", v+"/ucd/UnicodeData.txt") - ucd.Parse(r, func(p *ucd.Parser) { - assigned = append(assigned, p.Rune(0)) - }) - - rt := rangetable.New(assigned...) - sz := int(reflect.TypeOf(unicode.RangeTable{}).Size()) - sz += int(reflect.TypeOf(unicode.Range16{}).Size()) * len(rt.R16) - sz += int(reflect.TypeOf(unicode.Range32{}).Size()) * len(rt.R32) - - fmt.Fprintf(w, "// size %d bytes (%d KiB)\n", sz, sz/1024) - fmt.Fprintf(w, "var assigned%s = ", vstr(v)) - print(w, rt) - - size += sz - } - - fmt.Fprintf(w, "// Total size %d bytes (%d KiB)\n", size, size/1024) - - gen.WriteVersionedGoFile("tables.go", "rangetable", w.Bytes()) -} - -func print(w io.Writer, rt *unicode.RangeTable) { - fmt.Fprintln(w, "&unicode.RangeTable{") - fmt.Fprintln(w, "\tR16: []unicode.Range16{") - for _, r := range rt.R16 { - fmt.Fprintf(w, "\t\t{%#04x, %#04x, %d},\n", r.Lo, r.Hi, r.Stride) - } - fmt.Fprintln(w, "\t},") - fmt.Fprintln(w, "\tR32: []unicode.Range32{") - for _, r := range rt.R32 { - fmt.Fprintf(w, "\t\t{%#08x, %#08x, %d},\n", r.Lo, r.Hi, r.Stride) - } - fmt.Fprintln(w, "\t},") - fmt.Fprintf(w, "\tLatinOffset: %d,\n", rt.LatinOffset) - fmt.Fprintf(w, "}\n\n") -} diff --git a/vendor/golang.org/x/text/unicode/rangetable/merge.go b/vendor/golang.org/x/text/unicode/rangetable/merge.go deleted file mode 100644 index ea2a0803efe9..000000000000 --- a/vendor/golang.org/x/text/unicode/rangetable/merge.go +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package rangetable - -import ( - "unicode" -) - -// atEnd is used to mark a completed iteration. -const atEnd = unicode.MaxRune + 1 - -// Merge returns a new RangeTable that is the union of the given tables. -// It can also be used to compact user-created RangeTables. The entries in -// R16 and R32 for any given RangeTable should be sorted and non-overlapping. -// -// A lookup in the resulting table can be several times faster than using In -// directly on the ranges. Merge is an expensive operation, however, and only -// makes sense if one intends to use the result for more than a couple of -// hundred lookups. -func Merge(ranges ...*unicode.RangeTable) *unicode.RangeTable { - rt := &unicode.RangeTable{} - if len(ranges) == 0 { - return rt - } - - iter := tablesIter(make([]tableIndex, len(ranges))) - - for i, t := range ranges { - iter[i] = tableIndex{t, 0, atEnd} - if len(t.R16) > 0 { - iter[i].next = rune(t.R16[0].Lo) - } - } - - if r0 := iter.next16(); r0.Stride != 0 { - for { - r1 := iter.next16() - if r1.Stride == 0 { - rt.R16 = append(rt.R16, r0) - break - } - stride := r1.Lo - r0.Hi - if (r1.Lo == r1.Hi || stride == r1.Stride) && (r0.Lo == r0.Hi || stride == r0.Stride) { - // Fully merge the next range into the previous one. - r0.Hi, r0.Stride = r1.Hi, stride - continue - } else if stride == r0.Stride { - // Move the first element of r1 to r0. This may eliminate an - // entry. - r0.Hi = r1.Lo - r0.Stride = stride - r1.Lo = r1.Lo + r1.Stride - if r1.Lo > r1.Hi { - continue - } - } - rt.R16 = append(rt.R16, r0) - r0 = r1 - } - } - - for i, t := range ranges { - iter[i] = tableIndex{t, 0, atEnd} - if len(t.R32) > 0 { - iter[i].next = rune(t.R32[0].Lo) - } - } - - if r0 := iter.next32(); r0.Stride != 0 { - for { - r1 := iter.next32() - if r1.Stride == 0 { - rt.R32 = append(rt.R32, r0) - break - } - stride := r1.Lo - r0.Hi - if (r1.Lo == r1.Hi || stride == r1.Stride) && (r0.Lo == r0.Hi || stride == r0.Stride) { - // Fully merge the next range into the previous one. - r0.Hi, r0.Stride = r1.Hi, stride - continue - } else if stride == r0.Stride { - // Move the first element of r1 to r0. This may eliminate an - // entry. - r0.Hi = r1.Lo - r1.Lo = r1.Lo + r1.Stride - if r1.Lo > r1.Hi { - continue - } - } - rt.R32 = append(rt.R32, r0) - r0 = r1 - } - } - - for i := 0; i < len(rt.R16) && rt.R16[i].Hi <= unicode.MaxLatin1; i++ { - rt.LatinOffset = i + 1 - } - - return rt -} - -type tableIndex struct { - t *unicode.RangeTable - p uint32 - next rune -} - -type tablesIter []tableIndex - -// sortIter does an insertion sort using the next field of tableIndex. Insertion -// sort is a good sorting algorithm for this case. -func sortIter(t []tableIndex) { - for i := range t { - for j := i; j > 0 && t[j-1].next > t[j].next; j-- { - t[j], t[j-1] = t[j-1], t[j] - } - } -} - -// next16 finds the ranged to be added to the table. If ranges overlap between -// multiple tables it clips the result to a non-overlapping range if the -// elements are not fully subsumed. It returns a zero range if there are no more -// ranges. -func (ti tablesIter) next16() unicode.Range16 { - sortIter(ti) - - t0 := ti[0] - if t0.next == atEnd { - return unicode.Range16{} - } - r0 := t0.t.R16[t0.p] - r0.Lo = uint16(t0.next) - - // We restrict the Hi of the current range if it overlaps with another range. - for i := range ti { - tn := ti[i] - // Since our tableIndices are sorted by next, we can break if the there - // is no overlap. The first value of a next range can always be merged - // into the current one, so we can break in case of equality as well. - if rune(r0.Hi) <= tn.next { - break - } - rn := tn.t.R16[tn.p] - rn.Lo = uint16(tn.next) - - // Limit r0.Hi based on next ranges in list, but allow it to overlap - // with ranges as long as it subsumes it. - m := (rn.Lo - r0.Lo) % r0.Stride - if m == 0 && (rn.Stride == r0.Stride || rn.Lo == rn.Hi) { - // Overlap, take the min of the two Hi values: for simplicity's sake - // we only process one range at a time. - if r0.Hi > rn.Hi { - r0.Hi = rn.Hi - } - } else { - // Not a compatible stride. Set to the last possible value before - // rn.Lo, but ensure there is at least one value. - if x := rn.Lo - m; r0.Lo <= x { - r0.Hi = x - } - break - } - } - - // Update the next values for each table. - for i := range ti { - tn := &ti[i] - if rune(r0.Hi) < tn.next { - break - } - rn := tn.t.R16[tn.p] - stride := rune(rn.Stride) - tn.next += stride * (1 + ((rune(r0.Hi) - tn.next) / stride)) - if rune(rn.Hi) < tn.next { - if tn.p++; int(tn.p) == len(tn.t.R16) { - tn.next = atEnd - } else { - tn.next = rune(tn.t.R16[tn.p].Lo) - } - } - } - - if r0.Lo == r0.Hi { - r0.Stride = 1 - } - - return r0 -} - -// next32 finds the ranged to be added to the table. If ranges overlap between -// multiple tables it clips the result to a non-overlapping range if the -// elements are not fully subsumed. It returns a zero range if there are no more -// ranges. -func (ti tablesIter) next32() unicode.Range32 { - sortIter(ti) - - t0 := ti[0] - if t0.next == atEnd { - return unicode.Range32{} - } - r0 := t0.t.R32[t0.p] - r0.Lo = uint32(t0.next) - - // We restrict the Hi of the current range if it overlaps with another range. - for i := range ti { - tn := ti[i] - // Since our tableIndices are sorted by next, we can break if the there - // is no overlap. The first value of a next range can always be merged - // into the current one, so we can break in case of equality as well. - if rune(r0.Hi) <= tn.next { - break - } - rn := tn.t.R32[tn.p] - rn.Lo = uint32(tn.next) - - // Limit r0.Hi based on next ranges in list, but allow it to overlap - // with ranges as long as it subsumes it. - m := (rn.Lo - r0.Lo) % r0.Stride - if m == 0 && (rn.Stride == r0.Stride || rn.Lo == rn.Hi) { - // Overlap, take the min of the two Hi values: for simplicity's sake - // we only process one range at a time. - if r0.Hi > rn.Hi { - r0.Hi = rn.Hi - } - } else { - // Not a compatible stride. Set to the last possible value before - // rn.Lo, but ensure there is at least one value. - if x := rn.Lo - m; r0.Lo <= x { - r0.Hi = x - } - break - } - } - - // Update the next values for each table. - for i := range ti { - tn := &ti[i] - if rune(r0.Hi) < tn.next { - break - } - rn := tn.t.R32[tn.p] - stride := rune(rn.Stride) - tn.next += stride * (1 + ((rune(r0.Hi) - tn.next) / stride)) - if rune(rn.Hi) < tn.next { - if tn.p++; int(tn.p) == len(tn.t.R32) { - tn.next = atEnd - } else { - tn.next = rune(tn.t.R32[tn.p].Lo) - } - } - } - - if r0.Lo == r0.Hi { - r0.Stride = 1 - } - - return r0 -} diff --git a/vendor/golang.org/x/text/unicode/rangetable/rangetable.go b/vendor/golang.org/x/text/unicode/rangetable/rangetable.go deleted file mode 100644 index 187882cc3528..000000000000 --- a/vendor/golang.org/x/text/unicode/rangetable/rangetable.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package rangetable provides utilities for creating and inspecting -// unicode.RangeTables. -package rangetable - -import ( - "sort" - "unicode" -) - -// New creates a RangeTable from the given runes, which may contain duplicates. -func New(r ...rune) *unicode.RangeTable { - if len(r) == 0 { - return &unicode.RangeTable{} - } - - sort.Sort(byRune(r)) - - // Remove duplicates. - k := 1 - for i := 1; i < len(r); i++ { - if r[k-1] != r[i] { - r[k] = r[i] - k++ - } - } - - var rt unicode.RangeTable - for _, r := range r[:k] { - if r <= 0xFFFF { - rt.R16 = append(rt.R16, unicode.Range16{Lo: uint16(r), Hi: uint16(r), Stride: 1}) - } else { - rt.R32 = append(rt.R32, unicode.Range32{Lo: uint32(r), Hi: uint32(r), Stride: 1}) - } - } - - // Optimize RangeTable. - return Merge(&rt) -} - -type byRune []rune - -func (r byRune) Len() int { return len(r) } -func (r byRune) Swap(i, j int) { r[i], r[j] = r[j], r[i] } -func (r byRune) Less(i, j int) bool { return r[i] < r[j] } - -// Visit visits all runes in the given RangeTable in order, calling fn for each. -func Visit(rt *unicode.RangeTable, fn func(rune)) { - for _, r16 := range rt.R16 { - for r := rune(r16.Lo); r <= rune(r16.Hi); r += rune(r16.Stride) { - fn(r) - } - } - for _, r32 := range rt.R32 { - for r := rune(r32.Lo); r <= rune(r32.Hi); r += rune(r32.Stride) { - fn(r) - } - } -} - -// Assigned returns a RangeTable with all assigned code points for a given -// Unicode version. This includes graphic, format, control, and private-use -// characters. It returns nil if the data for the given version is not -// available. -func Assigned(version string) *unicode.RangeTable { - return assigned[version] -} diff --git a/vendor/golang.org/x/text/unicode/rangetable/tables10.0.0.go b/vendor/golang.org/x/text/unicode/rangetable/tables10.0.0.go deleted file mode 100644 index f15a873ac03c..000000000000 --- a/vendor/golang.org/x/text/unicode/rangetable/tables10.0.0.go +++ /dev/null @@ -1,6378 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -// +build go1.10 - -package rangetable - -//go:generate go run gen.go --versions=4.1.0,5.1.0,5.2.0,5.0.0,6.1.0,6.2.0,6.3.0,6.0.0,7.0.0,8.0.0,9.0.0,10.0.0 - -import "unicode" - -var assigned = map[string]*unicode.RangeTable{ - "4.1.0": assigned4_1_0, - "5.1.0": assigned5_1_0, - "5.2.0": assigned5_2_0, - "5.0.0": assigned5_0_0, - "6.1.0": assigned6_1_0, - "6.2.0": assigned6_2_0, - "6.3.0": assigned6_3_0, - "6.0.0": assigned6_0_0, - "7.0.0": assigned7_0_0, - "8.0.0": assigned8_0_0, - "9.0.0": assigned9_0_0, - "10.0.0": assigned10_0_0, -} - -// size 2924 bytes (2 KiB) -var assigned4_1_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0241, 1}, - {0x0250, 0x036f, 1}, - {0x0374, 0x0375, 1}, - {0x037a, 0x037e, 4}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x03ce, 1}, - {0x03d0, 0x0486, 1}, - {0x0488, 0x04ce, 1}, - {0x04d0, 0x04f9, 1}, - {0x0500, 0x050f, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x0591, 0x05b9, 1}, - {0x05bb, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0603, 1}, - {0x060b, 0x0615, 1}, - {0x061b, 0x061e, 3}, - {0x061f, 0x0621, 2}, - {0x0622, 0x063a, 1}, - {0x0640, 0x065e, 1}, - {0x0660, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x076d, 1}, - {0x0780, 0x07b1, 1}, - {0x0901, 0x0939, 1}, - {0x093c, 0x094d, 1}, - {0x0950, 0x0954, 1}, - {0x0958, 0x0970, 1}, - {0x097d, 0x0981, 4}, - {0x0982, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fa, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a59, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a74, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0aef, 1}, - {0x0af1, 0x0b01, 16}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b43, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b61, 1}, - {0x0b66, 0x0b71, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd7, 0x0be6, 15}, - {0x0be7, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3e, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c60, 0x0c61, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce6, 5}, - {0x0ce7, 0x0cef, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d28, 1}, - {0x0d2a, 0x0d39, 1}, - {0x0d3e, 0x0d43, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4d, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d66, 5}, - {0x0d67, 0x0d6f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edd, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6a, 1}, - {0x0f71, 0x0f8b, 1}, - {0x0f90, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fcf, 0x0fd1, 1}, - {0x1000, 0x1021, 1}, - {0x1023, 0x1027, 1}, - {0x1029, 0x102a, 1}, - {0x102c, 0x1032, 1}, - {0x1036, 0x1039, 1}, - {0x1040, 0x1059, 1}, - {0x10a0, 0x10c5, 1}, - {0x10d0, 0x10fc, 1}, - {0x1100, 0x1159, 1}, - {0x115f, 0x11a2, 1}, - {0x11a8, 0x11f9, 1}, - {0x1200, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135f, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1401, 0x1676, 1}, - {0x1680, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18a9, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19a9, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19d9, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a1f, 1}, - {0x1d00, 0x1dc3, 1}, - {0x1e00, 0x1e9b, 1}, - {0x1ea0, 0x1ef9, 1}, - {0x1f00, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2063, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x2094, 1}, - {0x20a0, 0x20b5, 1}, - {0x20d0, 0x20eb, 1}, - {0x2100, 0x214c, 1}, - {0x2153, 0x2183, 1}, - {0x2190, 0x23db, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x269c, 1}, - {0x26a0, 0x26b1, 1}, - {0x2701, 0x2704, 1}, - {0x2706, 0x2709, 1}, - {0x270c, 0x2727, 1}, - {0x2729, 0x274b, 1}, - {0x274d, 0x274f, 2}, - {0x2750, 0x2752, 1}, - {0x2756, 0x2758, 2}, - {0x2759, 0x275e, 1}, - {0x2761, 0x2794, 1}, - {0x2798, 0x27af, 1}, - {0x27b1, 0x27be, 1}, - {0x27c0, 0x27c6, 1}, - {0x27d0, 0x27eb, 1}, - {0x27f0, 0x2b13, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c80, 0x2cea, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d30, 0x2d65, 1}, - {0x2d6f, 0x2d80, 17}, - {0x2d81, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2e00, 0x2e17, 1}, - {0x2e1c, 0x2e1d, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312c, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31b7, 1}, - {0x31c0, 0x31cf, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x3243, 1}, - {0x3250, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fbb, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa700, 0xa716, 1}, - {0xa800, 0xa82b, 1}, - {0xac00, 0xd7a3, 1}, - {0xd800, 0xfa2d, 1}, - {0xfa30, 0xfa6a, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbb1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe23, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010a00, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d12a, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7c9, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 3152 bytes (3 KiB) -var assigned5_1_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x0523, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0603, 1}, - {0x0606, 0x061b, 1}, - {0x061e, 0x061f, 1}, - {0x0621, 0x065e, 1}, - {0x0660, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0901, 0x0939, 1}, - {0x093c, 0x094d, 1}, - {0x0950, 0x0954, 1}, - {0x0958, 0x0972, 1}, - {0x097b, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fa, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0aef, 1}, - {0x0af1, 0x0b01, 16}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b71, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d28, 1}, - {0x0d2a, 0x0d39, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4d, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edd, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f8b, 1}, - {0x0f90, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fd4, 1}, - {0x1000, 0x1099, 1}, - {0x109e, 0x10c5, 1}, - {0x10d0, 0x10fc, 1}, - {0x1100, 0x1159, 1}, - {0x115f, 0x11a2, 1}, - {0x11a8, 0x11f9, 1}, - {0x1200, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135f, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1401, 0x1676, 1}, - {0x1680, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19a9, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19d9, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a1f, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1baa, 1}, - {0x1bae, 0x1bb9, 1}, - {0x1c00, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1d00, 0x1de6, 1}, - {0x1dfe, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x2094, 1}, - {0x20a0, 0x20b5, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x214f, 1}, - {0x2153, 0x2188, 1}, - {0x2190, 0x23e7, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x269d, 1}, - {0x26a0, 0x26bc, 1}, - {0x26c0, 0x26c3, 1}, - {0x2701, 0x2704, 1}, - {0x2706, 0x2709, 1}, - {0x270c, 0x2727, 1}, - {0x2729, 0x274b, 1}, - {0x274d, 0x274f, 2}, - {0x2750, 0x2752, 1}, - {0x2756, 0x2758, 2}, - {0x2759, 0x275e, 1}, - {0x2761, 0x2794, 1}, - {0x2798, 0x27af, 1}, - {0x27b1, 0x27be, 1}, - {0x27c0, 0x27ca, 1}, - {0x27cc, 0x27d0, 4}, - {0x27d1, 0x2b4c, 1}, - {0x2b50, 0x2b54, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2c6f, 1}, - {0x2c71, 0x2c7d, 1}, - {0x2c80, 0x2cea, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d30, 0x2d65, 1}, - {0x2d6f, 0x2d80, 17}, - {0x2d81, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e30, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31b7, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x3243, 1}, - {0x3250, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fc3, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa500, 0xa62b, 1}, - {0xa640, 0xa65f, 1}, - {0xa662, 0xa673, 1}, - {0xa67c, 0xa697, 1}, - {0xa700, 0xa78c, 1}, - {0xa7fb, 0xa82b, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xaa00, 161}, - {0xaa01, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaa5f, 1}, - {0xac00, 0xd7a3, 1}, - {0xd800, 0xfa2d, 1}, - {0xfa30, 0xfa6a, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbb1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe26, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101d0, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010900, 0x00010919, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010a00, 193}, - {0x00010a01, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 3518 bytes (3 KiB) -var assigned5_2_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x0525, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0603, 1}, - {0x0606, 0x061b, 1}, - {0x061e, 0x061f, 1}, - {0x0621, 0x065e, 1}, - {0x0660, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0900, 0x0939, 1}, - {0x093c, 0x094e, 1}, - {0x0950, 0x0955, 1}, - {0x0958, 0x0972, 1}, - {0x0979, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0aef, 1}, - {0x0af1, 0x0b01, 16}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b71, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d28, 1}, - {0x0d2a, 0x0d39, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4d, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edd, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f8b, 1}, - {0x0f90, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fd8, 1}, - {0x1000, 0x10c5, 1}, - {0x10d0, 0x10fc, 1}, - {0x1100, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135f, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1baa, 1}, - {0x1bae, 0x1bb9, 1}, - {0x1c00, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cd0, 0x1cf2, 1}, - {0x1d00, 0x1de6, 1}, - {0x1dfd, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x2094, 1}, - {0x20a0, 0x20b8, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x2189, 1}, - {0x2190, 0x23e8, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x26cd, 1}, - {0x26cf, 0x26e1, 1}, - {0x26e3, 0x26e8, 5}, - {0x26e9, 0x26ff, 1}, - {0x2701, 0x2704, 1}, - {0x2706, 0x2709, 1}, - {0x270c, 0x2727, 1}, - {0x2729, 0x274b, 1}, - {0x274d, 0x274f, 2}, - {0x2750, 0x2752, 1}, - {0x2756, 0x275e, 1}, - {0x2761, 0x2794, 1}, - {0x2798, 0x27af, 1}, - {0x27b1, 0x27be, 1}, - {0x27c0, 0x27ca, 1}, - {0x27cc, 0x27d0, 4}, - {0x27d1, 0x2b4c, 1}, - {0x2b50, 0x2b59, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf1, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d30, 0x2d65, 1}, - {0x2d6f, 0x2d80, 17}, - {0x2d81, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e31, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31b7, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fcb, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa65f, 1}, - {0xa662, 0xa673, 1}, - {0xa67c, 0xa697, 1}, - {0xa6a0, 0xa6f7, 1}, - {0xa700, 0xa78c, 1}, - {0xa7fb, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fb, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9df, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaa7b, 1}, - {0xaa80, 0xaac2, 1}, - {0xaadb, 0xaadf, 1}, - {0xabc0, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa2d, 1}, - {0xfa30, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbb1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe26, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101d0, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001085f, 1}, - {0x00010900, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010a00, 193}, - {0x00010a01, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a7f, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b7f, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011080, 0x000110c1, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x00013000, 0x0001342e, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f100, 0x0001f10a, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f131, 0x0001f13d, 12}, - {0x0001f13f, 0x0001f142, 3}, - {0x0001f146, 0x0001f14a, 4}, - {0x0001f14b, 0x0001f14e, 1}, - {0x0001f157, 0x0001f15f, 8}, - {0x0001f179, 0x0001f17b, 2}, - {0x0001f17c, 0x0001f17f, 3}, - {0x0001f18a, 0x0001f18d, 1}, - {0x0001f190, 0x0001f200, 112}, - {0x0001f210, 0x0001f231, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 3026 bytes (2 KiB) -var assigned5_0_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x036f, 1}, - {0x0374, 0x0375, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x03ce, 1}, - {0x03d0, 0x0486, 1}, - {0x0488, 0x0513, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0603, 1}, - {0x060b, 0x0615, 1}, - {0x061b, 0x061e, 3}, - {0x061f, 0x0621, 2}, - {0x0622, 0x063a, 1}, - {0x0640, 0x065e, 1}, - {0x0660, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x076d, 1}, - {0x0780, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0901, 0x0939, 1}, - {0x093c, 0x094d, 1}, - {0x0950, 0x0954, 1}, - {0x0958, 0x0970, 1}, - {0x097b, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fa, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a59, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a74, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0aef, 1}, - {0x0af1, 0x0b01, 16}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b43, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b61, 1}, - {0x0b66, 0x0b71, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd7, 0x0be6, 15}, - {0x0be7, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3e, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c60, 0x0c61, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d28, 1}, - {0x0d2a, 0x0d39, 1}, - {0x0d3e, 0x0d43, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4d, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d66, 5}, - {0x0d67, 0x0d6f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edd, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6a, 1}, - {0x0f71, 0x0f8b, 1}, - {0x0f90, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fcf, 0x0fd1, 1}, - {0x1000, 0x1021, 1}, - {0x1023, 0x1027, 1}, - {0x1029, 0x102a, 1}, - {0x102c, 0x1032, 1}, - {0x1036, 0x1039, 1}, - {0x1040, 0x1059, 1}, - {0x10a0, 0x10c5, 1}, - {0x10d0, 0x10fc, 1}, - {0x1100, 0x1159, 1}, - {0x115f, 0x11a2, 1}, - {0x11a8, 0x11f9, 1}, - {0x1200, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135f, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1401, 0x1676, 1}, - {0x1680, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18a9, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19a9, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19d9, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a1f, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1d00, 0x1dca, 1}, - {0x1dfe, 0x1e9b, 1}, - {0x1ea0, 0x1ef9, 1}, - {0x1f00, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2063, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x2094, 1}, - {0x20a0, 0x20b5, 1}, - {0x20d0, 0x20ef, 1}, - {0x2100, 0x214e, 1}, - {0x2153, 0x2184, 1}, - {0x2190, 0x23e7, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x269c, 1}, - {0x26a0, 0x26b2, 1}, - {0x2701, 0x2704, 1}, - {0x2706, 0x2709, 1}, - {0x270c, 0x2727, 1}, - {0x2729, 0x274b, 1}, - {0x274d, 0x274f, 2}, - {0x2750, 0x2752, 1}, - {0x2756, 0x2758, 2}, - {0x2759, 0x275e, 1}, - {0x2761, 0x2794, 1}, - {0x2798, 0x27af, 1}, - {0x27b1, 0x27be, 1}, - {0x27c0, 0x27ca, 1}, - {0x27d0, 0x27eb, 1}, - {0x27f0, 0x2b1a, 1}, - {0x2b20, 0x2b23, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2c6c, 1}, - {0x2c74, 0x2c77, 1}, - {0x2c80, 0x2cea, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d30, 0x2d65, 1}, - {0x2d6f, 0x2d80, 17}, - {0x2d81, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2e00, 0x2e17, 1}, - {0x2e1c, 0x2e1d, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312c, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31b7, 1}, - {0x31c0, 0x31cf, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x3243, 1}, - {0x3250, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fbb, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa700, 0xa71a, 1}, - {0xa720, 0xa721, 1}, - {0xa800, 0xa82b, 1}, - {0xa840, 0xa877, 1}, - {0xac00, 0xd7a3, 1}, - {0xd800, 0xfa2d, 1}, - {0xfa30, 0xfa6a, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbb1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe23, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010900, 0x00010919, 1}, - {0x0001091f, 0x00010a00, 225}, - {0x00010a01, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d12a, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 4160 bytes (4 KiB) -var assigned6_1_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x0527, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x058f, 0x0591, 2}, - {0x0592, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0604, 1}, - {0x0606, 0x061b, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x08a0, 66}, - {0x08a2, 0x08ac, 1}, - {0x08e4, 0x08fe, 1}, - {0x0900, 0x0977, 1}, - {0x0979, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0af1, 1}, - {0x0b01, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4e, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edf, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10c7, 0x10cd, 6}, - {0x10d0, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cc0, 0x1cc7, 1}, - {0x1cd0, 0x1cf6, 1}, - {0x1d00, 0x1de6, 1}, - {0x1dfc, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20b9, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x2189, 1}, - {0x2190, 0x23f3, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x26ff, 1}, - {0x2701, 0x2b4c, 1}, - {0x2b50, 0x2b59, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf3, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d27, 0x2d2d, 6}, - {0x2d30, 0x2d67, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e3b, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fcc, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa697, 1}, - {0xa69f, 0xa6f7, 1}, - {0xa700, 0xa78e, 1}, - {0xa790, 0xa793, 1}, - {0xa7a0, 0xa7aa, 1}, - {0xa7f8, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fb, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9df, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaa7b, 1}, - {0xaa80, 0xaac2, 1}, - {0xaadb, 0xaaf6, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xabc0, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe26, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101d0, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001085f, 1}, - {0x00010900, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010980, 65}, - {0x00010981, 0x000109b7, 1}, - {0x000109be, 0x000109bf, 1}, - {0x00010a00, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a7f, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b7f, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x00011080, 0x000110c1, 1}, - {0x000110d0, 0x000110e8, 1}, - {0x000110f0, 0x000110f9, 1}, - {0x00011100, 0x00011134, 1}, - {0x00011136, 0x00011143, 1}, - {0x00011180, 0x000111c8, 1}, - {0x000111d0, 0x000111d9, 1}, - {0x00011680, 0x000116b7, 1}, - {0x000116c0, 0x000116c9, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00016800, 0x00016a38, 1}, - {0x00016f00, 0x00016f44, 1}, - {0x00016f50, 0x00016f7e, 1}, - {0x00016f8f, 0x00016f9f, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001ee00, 0x0001ee03, 1}, - {0x0001ee05, 0x0001ee1f, 1}, - {0x0001ee21, 0x0001ee22, 1}, - {0x0001ee24, 0x0001ee27, 3}, - {0x0001ee29, 0x0001ee32, 1}, - {0x0001ee34, 0x0001ee37, 1}, - {0x0001ee39, 0x0001ee3b, 2}, - {0x0001ee42, 0x0001ee47, 5}, - {0x0001ee49, 0x0001ee4d, 2}, - {0x0001ee4e, 0x0001ee4f, 1}, - {0x0001ee51, 0x0001ee52, 1}, - {0x0001ee54, 0x0001ee57, 3}, - {0x0001ee59, 0x0001ee61, 2}, - {0x0001ee62, 0x0001ee64, 2}, - {0x0001ee67, 0x0001ee6a, 1}, - {0x0001ee6c, 0x0001ee72, 1}, - {0x0001ee74, 0x0001ee77, 1}, - {0x0001ee79, 0x0001ee7c, 1}, - {0x0001ee7e, 0x0001ee80, 2}, - {0x0001ee81, 0x0001ee89, 1}, - {0x0001ee8b, 0x0001ee9b, 1}, - {0x0001eea1, 0x0001eea3, 1}, - {0x0001eea5, 0x0001eea9, 1}, - {0x0001eeab, 0x0001eebb, 1}, - {0x0001eef0, 0x0001eef1, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0be, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0df, 1}, - {0x0001f100, 0x0001f10a, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f16b, 1}, - {0x0001f170, 0x0001f19a, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23a, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f320, 1}, - {0x0001f330, 0x0001f335, 1}, - {0x0001f337, 0x0001f37c, 1}, - {0x0001f380, 0x0001f393, 1}, - {0x0001f3a0, 0x0001f3c4, 1}, - {0x0001f3c6, 0x0001f3ca, 1}, - {0x0001f3e0, 0x0001f3f0, 1}, - {0x0001f400, 0x0001f43e, 1}, - {0x0001f440, 0x0001f442, 2}, - {0x0001f443, 0x0001f4f7, 1}, - {0x0001f4f9, 0x0001f4fc, 1}, - {0x0001f500, 0x0001f53d, 1}, - {0x0001f540, 0x0001f543, 1}, - {0x0001f550, 0x0001f567, 1}, - {0x0001f5fb, 0x0001f640, 1}, - {0x0001f645, 0x0001f64f, 1}, - {0x0001f680, 0x0001f6c5, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 4160 bytes (4 KiB) -var assigned6_2_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x0527, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x058f, 0x0591, 2}, - {0x0592, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0604, 1}, - {0x0606, 0x061b, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x08a0, 66}, - {0x08a2, 0x08ac, 1}, - {0x08e4, 0x08fe, 1}, - {0x0900, 0x0977, 1}, - {0x0979, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0af1, 1}, - {0x0b01, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4e, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edf, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10c7, 0x10cd, 6}, - {0x10d0, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cc0, 0x1cc7, 1}, - {0x1cd0, 0x1cf6, 1}, - {0x1d00, 0x1de6, 1}, - {0x1dfc, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20ba, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x2189, 1}, - {0x2190, 0x23f3, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x26ff, 1}, - {0x2701, 0x2b4c, 1}, - {0x2b50, 0x2b59, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf3, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d27, 0x2d2d, 6}, - {0x2d30, 0x2d67, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e3b, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fcc, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa697, 1}, - {0xa69f, 0xa6f7, 1}, - {0xa700, 0xa78e, 1}, - {0xa790, 0xa793, 1}, - {0xa7a0, 0xa7aa, 1}, - {0xa7f8, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fb, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9df, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaa7b, 1}, - {0xaa80, 0xaac2, 1}, - {0xaadb, 0xaaf6, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xabc0, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe26, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101d0, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001085f, 1}, - {0x00010900, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010980, 65}, - {0x00010981, 0x000109b7, 1}, - {0x000109be, 0x000109bf, 1}, - {0x00010a00, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a7f, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b7f, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x00011080, 0x000110c1, 1}, - {0x000110d0, 0x000110e8, 1}, - {0x000110f0, 0x000110f9, 1}, - {0x00011100, 0x00011134, 1}, - {0x00011136, 0x00011143, 1}, - {0x00011180, 0x000111c8, 1}, - {0x000111d0, 0x000111d9, 1}, - {0x00011680, 0x000116b7, 1}, - {0x000116c0, 0x000116c9, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00016800, 0x00016a38, 1}, - {0x00016f00, 0x00016f44, 1}, - {0x00016f50, 0x00016f7e, 1}, - {0x00016f8f, 0x00016f9f, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001ee00, 0x0001ee03, 1}, - {0x0001ee05, 0x0001ee1f, 1}, - {0x0001ee21, 0x0001ee22, 1}, - {0x0001ee24, 0x0001ee27, 3}, - {0x0001ee29, 0x0001ee32, 1}, - {0x0001ee34, 0x0001ee37, 1}, - {0x0001ee39, 0x0001ee3b, 2}, - {0x0001ee42, 0x0001ee47, 5}, - {0x0001ee49, 0x0001ee4d, 2}, - {0x0001ee4e, 0x0001ee4f, 1}, - {0x0001ee51, 0x0001ee52, 1}, - {0x0001ee54, 0x0001ee57, 3}, - {0x0001ee59, 0x0001ee61, 2}, - {0x0001ee62, 0x0001ee64, 2}, - {0x0001ee67, 0x0001ee6a, 1}, - {0x0001ee6c, 0x0001ee72, 1}, - {0x0001ee74, 0x0001ee77, 1}, - {0x0001ee79, 0x0001ee7c, 1}, - {0x0001ee7e, 0x0001ee80, 2}, - {0x0001ee81, 0x0001ee89, 1}, - {0x0001ee8b, 0x0001ee9b, 1}, - {0x0001eea1, 0x0001eea3, 1}, - {0x0001eea5, 0x0001eea9, 1}, - {0x0001eeab, 0x0001eebb, 1}, - {0x0001eef0, 0x0001eef1, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0be, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0df, 1}, - {0x0001f100, 0x0001f10a, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f16b, 1}, - {0x0001f170, 0x0001f19a, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23a, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f320, 1}, - {0x0001f330, 0x0001f335, 1}, - {0x0001f337, 0x0001f37c, 1}, - {0x0001f380, 0x0001f393, 1}, - {0x0001f3a0, 0x0001f3c4, 1}, - {0x0001f3c6, 0x0001f3ca, 1}, - {0x0001f3e0, 0x0001f3f0, 1}, - {0x0001f400, 0x0001f43e, 1}, - {0x0001f440, 0x0001f442, 2}, - {0x0001f443, 0x0001f4f7, 1}, - {0x0001f4f9, 0x0001f4fc, 1}, - {0x0001f500, 0x0001f53d, 1}, - {0x0001f540, 0x0001f543, 1}, - {0x0001f550, 0x0001f567, 1}, - {0x0001f5fb, 0x0001f640, 1}, - {0x0001f645, 0x0001f64f, 1}, - {0x0001f680, 0x0001f6c5, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 4160 bytes (4 KiB) -var assigned6_3_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x0527, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x058f, 0x0591, 2}, - {0x0592, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0604, 1}, - {0x0606, 0x061c, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x08a0, 66}, - {0x08a2, 0x08ac, 1}, - {0x08e4, 0x08fe, 1}, - {0x0900, 0x0977, 1}, - {0x0979, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0af1, 1}, - {0x0b01, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4e, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edf, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10c7, 0x10cd, 6}, - {0x10d0, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cc0, 0x1cc7, 1}, - {0x1cd0, 0x1cf6, 1}, - {0x1d00, 0x1de6, 1}, - {0x1dfc, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x2066, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20ba, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x2189, 1}, - {0x2190, 0x23f3, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x26ff, 1}, - {0x2701, 0x2b4c, 1}, - {0x2b50, 0x2b59, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf3, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d27, 0x2d2d, 6}, - {0x2d30, 0x2d67, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e3b, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fcc, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa697, 1}, - {0xa69f, 0xa6f7, 1}, - {0xa700, 0xa78e, 1}, - {0xa790, 0xa793, 1}, - {0xa7a0, 0xa7aa, 1}, - {0xa7f8, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fb, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9df, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaa7b, 1}, - {0xaa80, 0xaac2, 1}, - {0xaadb, 0xaaf6, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xabc0, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe26, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101d0, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001085f, 1}, - {0x00010900, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010980, 65}, - {0x00010981, 0x000109b7, 1}, - {0x000109be, 0x000109bf, 1}, - {0x00010a00, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a7f, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b7f, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x00011080, 0x000110c1, 1}, - {0x000110d0, 0x000110e8, 1}, - {0x000110f0, 0x000110f9, 1}, - {0x00011100, 0x00011134, 1}, - {0x00011136, 0x00011143, 1}, - {0x00011180, 0x000111c8, 1}, - {0x000111d0, 0x000111d9, 1}, - {0x00011680, 0x000116b7, 1}, - {0x000116c0, 0x000116c9, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00016800, 0x00016a38, 1}, - {0x00016f00, 0x00016f44, 1}, - {0x00016f50, 0x00016f7e, 1}, - {0x00016f8f, 0x00016f9f, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001ee00, 0x0001ee03, 1}, - {0x0001ee05, 0x0001ee1f, 1}, - {0x0001ee21, 0x0001ee22, 1}, - {0x0001ee24, 0x0001ee27, 3}, - {0x0001ee29, 0x0001ee32, 1}, - {0x0001ee34, 0x0001ee37, 1}, - {0x0001ee39, 0x0001ee3b, 2}, - {0x0001ee42, 0x0001ee47, 5}, - {0x0001ee49, 0x0001ee4d, 2}, - {0x0001ee4e, 0x0001ee4f, 1}, - {0x0001ee51, 0x0001ee52, 1}, - {0x0001ee54, 0x0001ee57, 3}, - {0x0001ee59, 0x0001ee61, 2}, - {0x0001ee62, 0x0001ee64, 2}, - {0x0001ee67, 0x0001ee6a, 1}, - {0x0001ee6c, 0x0001ee72, 1}, - {0x0001ee74, 0x0001ee77, 1}, - {0x0001ee79, 0x0001ee7c, 1}, - {0x0001ee7e, 0x0001ee80, 2}, - {0x0001ee81, 0x0001ee89, 1}, - {0x0001ee8b, 0x0001ee9b, 1}, - {0x0001eea1, 0x0001eea3, 1}, - {0x0001eea5, 0x0001eea9, 1}, - {0x0001eeab, 0x0001eebb, 1}, - {0x0001eef0, 0x0001eef1, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0be, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0df, 1}, - {0x0001f100, 0x0001f10a, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f16b, 1}, - {0x0001f170, 0x0001f19a, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23a, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f320, 1}, - {0x0001f330, 0x0001f335, 1}, - {0x0001f337, 0x0001f37c, 1}, - {0x0001f380, 0x0001f393, 1}, - {0x0001f3a0, 0x0001f3c4, 1}, - {0x0001f3c6, 0x0001f3ca, 1}, - {0x0001f3e0, 0x0001f3f0, 1}, - {0x0001f400, 0x0001f43e, 1}, - {0x0001f440, 0x0001f442, 2}, - {0x0001f443, 0x0001f4f7, 1}, - {0x0001f4f9, 0x0001f4fc, 1}, - {0x0001f500, 0x0001f53d, 1}, - {0x0001f540, 0x0001f543, 1}, - {0x0001f550, 0x0001f567, 1}, - {0x0001f5fb, 0x0001f640, 1}, - {0x0001f645, 0x0001f64f, 1}, - {0x0001f680, 0x0001f6c5, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 3812 bytes (3 KiB) -var assigned6_0_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x0527, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0603, 1}, - {0x0606, 0x061b, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x0900, 162}, - {0x0901, 0x0977, 1}, - {0x0979, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0aef, 1}, - {0x0af1, 0x0b01, 16}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4e, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edd, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10d0, 0x10fc, 1}, - {0x1100, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1baa, 1}, - {0x1bae, 0x1bb9, 1}, - {0x1bc0, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cd0, 0x1cf2, 1}, - {0x1d00, 0x1de6, 1}, - {0x1dfc, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20b9, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x2189, 1}, - {0x2190, 0x23f3, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x26ff, 1}, - {0x2701, 0x27ca, 1}, - {0x27cc, 0x27ce, 2}, - {0x27cf, 0x2b4c, 1}, - {0x2b50, 0x2b59, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf1, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d30, 0x2d65, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e31, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fcb, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa673, 1}, - {0xa67c, 0xa697, 1}, - {0xa6a0, 0xa6f7, 1}, - {0xa700, 0xa78e, 1}, - {0xa790, 0xa791, 1}, - {0xa7a0, 0xa7a9, 1}, - {0xa7fa, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fb, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9df, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaa7b, 1}, - {0xaa80, 0xaac2, 1}, - {0xaadb, 0xaadf, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xabc0, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa2d, 1}, - {0xfa30, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe26, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101d0, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001085f, 1}, - {0x00010900, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010a00, 193}, - {0x00010a01, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a7f, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b7f, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x00011080, 0x000110c1, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00016800, 0x00016a38, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0be, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0df, 1}, - {0x0001f100, 0x0001f10a, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f169, 1}, - {0x0001f170, 0x0001f19a, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23a, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f320, 1}, - {0x0001f330, 0x0001f335, 1}, - {0x0001f337, 0x0001f37c, 1}, - {0x0001f380, 0x0001f393, 1}, - {0x0001f3a0, 0x0001f3c4, 1}, - {0x0001f3c6, 0x0001f3ca, 1}, - {0x0001f3e0, 0x0001f3f0, 1}, - {0x0001f400, 0x0001f43e, 1}, - {0x0001f440, 0x0001f442, 2}, - {0x0001f443, 0x0001f4f7, 1}, - {0x0001f4f9, 0x0001f4fc, 1}, - {0x0001f500, 0x0001f53d, 1}, - {0x0001f550, 0x0001f567, 1}, - {0x0001f5fb, 0x0001f5ff, 1}, - {0x0001f601, 0x0001f610, 1}, - {0x0001f612, 0x0001f614, 1}, - {0x0001f616, 0x0001f61c, 2}, - {0x0001f61d, 0x0001f61e, 1}, - {0x0001f620, 0x0001f625, 1}, - {0x0001f628, 0x0001f62b, 1}, - {0x0001f62d, 0x0001f630, 3}, - {0x0001f631, 0x0001f633, 1}, - {0x0001f635, 0x0001f640, 1}, - {0x0001f645, 0x0001f64f, 1}, - {0x0001f680, 0x0001f6c5, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 4898 bytes (4 KiB) -var assigned7_0_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037f, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x052f, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x058d, 0x058f, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x061c, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x08a0, 66}, - {0x08a1, 0x08b2, 1}, - {0x08e4, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0af1, 1}, - {0x0b01, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c00, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c81, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d01, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4e, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0de6, 0x0def, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edf, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10c7, 0x10cd, 6}, - {0x10d0, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f8, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191e, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1ab0, 0x1abe, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cc0, 0x1cc7, 1}, - {0x1cd0, 0x1cf6, 1}, - {0x1cf8, 0x1cf9, 1}, - {0x1d00, 0x1df5, 1}, - {0x1dfc, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x2066, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20bd, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x2189, 1}, - {0x2190, 0x23fa, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x2b73, 1}, - {0x2b76, 0x2b95, 1}, - {0x2b98, 0x2bb9, 1}, - {0x2bbd, 0x2bc8, 1}, - {0x2bca, 0x2bd1, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf3, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d27, 0x2d2d, 6}, - {0x2d30, 0x2d67, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e42, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fcc, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa69d, 1}, - {0xa69f, 0xa6f7, 1}, - {0xa700, 0xa78e, 1}, - {0xa790, 0xa7ad, 1}, - {0xa7b0, 0xa7b1, 1}, - {0xa7f7, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fb, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9fe, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaac2, 1}, - {0xaadb, 0xaaf6, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xab30, 0xab5f, 1}, - {0xab64, 0xab65, 1}, - {0xabc0, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe2d, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018c, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101a0, 0x000101d0, 48}, - {0x000101d1, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x000102e0, 0x000102fb, 1}, - {0x00010300, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010350, 0x0001037a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010500, 0x00010527, 1}, - {0x00010530, 0x00010563, 1}, - {0x0001056f, 0x00010600, 145}, - {0x00010601, 0x00010736, 1}, - {0x00010740, 0x00010755, 1}, - {0x00010760, 0x00010767, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001089e, 1}, - {0x000108a7, 0x000108af, 1}, - {0x00010900, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010980, 65}, - {0x00010981, 0x000109b7, 1}, - {0x000109be, 0x000109bf, 1}, - {0x00010a00, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a9f, 1}, - {0x00010ac0, 0x00010ae6, 1}, - {0x00010aeb, 0x00010af6, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b91, 1}, - {0x00010b99, 0x00010b9c, 1}, - {0x00010ba9, 0x00010baf, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x0001107f, 0x000110c1, 1}, - {0x000110d0, 0x000110e8, 1}, - {0x000110f0, 0x000110f9, 1}, - {0x00011100, 0x00011134, 1}, - {0x00011136, 0x00011143, 1}, - {0x00011150, 0x00011176, 1}, - {0x00011180, 0x000111c8, 1}, - {0x000111cd, 0x000111d0, 3}, - {0x000111d1, 0x000111da, 1}, - {0x000111e1, 0x000111f4, 1}, - {0x00011200, 0x00011211, 1}, - {0x00011213, 0x0001123d, 1}, - {0x000112b0, 0x000112ea, 1}, - {0x000112f0, 0x000112f9, 1}, - {0x00011301, 0x00011303, 1}, - {0x00011305, 0x0001130c, 1}, - {0x0001130f, 0x00011310, 1}, - {0x00011313, 0x00011328, 1}, - {0x0001132a, 0x00011330, 1}, - {0x00011332, 0x00011333, 1}, - {0x00011335, 0x00011339, 1}, - {0x0001133c, 0x00011344, 1}, - {0x00011347, 0x00011348, 1}, - {0x0001134b, 0x0001134d, 1}, - {0x00011357, 0x0001135d, 6}, - {0x0001135e, 0x00011363, 1}, - {0x00011366, 0x0001136c, 1}, - {0x00011370, 0x00011374, 1}, - {0x00011480, 0x000114c7, 1}, - {0x000114d0, 0x000114d9, 1}, - {0x00011580, 0x000115b5, 1}, - {0x000115b8, 0x000115c9, 1}, - {0x00011600, 0x00011644, 1}, - {0x00011650, 0x00011659, 1}, - {0x00011680, 0x000116b7, 1}, - {0x000116c0, 0x000116c9, 1}, - {0x000118a0, 0x000118f2, 1}, - {0x000118ff, 0x00011ac0, 449}, - {0x00011ac1, 0x00011af8, 1}, - {0x00012000, 0x00012398, 1}, - {0x00012400, 0x0001246e, 1}, - {0x00012470, 0x00012474, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00016800, 0x00016a38, 1}, - {0x00016a40, 0x00016a5e, 1}, - {0x00016a60, 0x00016a69, 1}, - {0x00016a6e, 0x00016a6f, 1}, - {0x00016ad0, 0x00016aed, 1}, - {0x00016af0, 0x00016af5, 1}, - {0x00016b00, 0x00016b45, 1}, - {0x00016b50, 0x00016b59, 1}, - {0x00016b5b, 0x00016b61, 1}, - {0x00016b63, 0x00016b77, 1}, - {0x00016b7d, 0x00016b8f, 1}, - {0x00016f00, 0x00016f44, 1}, - {0x00016f50, 0x00016f7e, 1}, - {0x00016f8f, 0x00016f9f, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001bc00, 0x0001bc6a, 1}, - {0x0001bc70, 0x0001bc7c, 1}, - {0x0001bc80, 0x0001bc88, 1}, - {0x0001bc90, 0x0001bc99, 1}, - {0x0001bc9c, 0x0001bca3, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001e800, 0x0001e8c4, 1}, - {0x0001e8c7, 0x0001e8d6, 1}, - {0x0001ee00, 0x0001ee03, 1}, - {0x0001ee05, 0x0001ee1f, 1}, - {0x0001ee21, 0x0001ee22, 1}, - {0x0001ee24, 0x0001ee27, 3}, - {0x0001ee29, 0x0001ee32, 1}, - {0x0001ee34, 0x0001ee37, 1}, - {0x0001ee39, 0x0001ee3b, 2}, - {0x0001ee42, 0x0001ee47, 5}, - {0x0001ee49, 0x0001ee4d, 2}, - {0x0001ee4e, 0x0001ee4f, 1}, - {0x0001ee51, 0x0001ee52, 1}, - {0x0001ee54, 0x0001ee57, 3}, - {0x0001ee59, 0x0001ee61, 2}, - {0x0001ee62, 0x0001ee64, 2}, - {0x0001ee67, 0x0001ee6a, 1}, - {0x0001ee6c, 0x0001ee72, 1}, - {0x0001ee74, 0x0001ee77, 1}, - {0x0001ee79, 0x0001ee7c, 1}, - {0x0001ee7e, 0x0001ee80, 2}, - {0x0001ee81, 0x0001ee89, 1}, - {0x0001ee8b, 0x0001ee9b, 1}, - {0x0001eea1, 0x0001eea3, 1}, - {0x0001eea5, 0x0001eea9, 1}, - {0x0001eeab, 0x0001eebb, 1}, - {0x0001eef0, 0x0001eef1, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0bf, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0f5, 1}, - {0x0001f100, 0x0001f10c, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f16b, 1}, - {0x0001f170, 0x0001f19a, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23a, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f32c, 1}, - {0x0001f330, 0x0001f37d, 1}, - {0x0001f380, 0x0001f3ce, 1}, - {0x0001f3d4, 0x0001f3f7, 1}, - {0x0001f400, 0x0001f4fe, 1}, - {0x0001f500, 0x0001f54a, 1}, - {0x0001f550, 0x0001f579, 1}, - {0x0001f57b, 0x0001f5a3, 1}, - {0x0001f5a5, 0x0001f642, 1}, - {0x0001f645, 0x0001f6cf, 1}, - {0x0001f6e0, 0x0001f6ec, 1}, - {0x0001f6f0, 0x0001f6f3, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x0001f780, 0x0001f7d4, 1}, - {0x0001f800, 0x0001f80b, 1}, - {0x0001f810, 0x0001f847, 1}, - {0x0001f850, 0x0001f859, 1}, - {0x0001f860, 0x0001f887, 1}, - {0x0001f890, 0x0001f8ad, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 5048 bytes (4 KiB) -var assigned8_0_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037f, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x052f, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x058d, 0x058f, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x061c, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x08a0, 66}, - {0x08a1, 0x08b4, 1}, - {0x08e3, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0af1, 1}, - {0x0af9, 0x0b01, 8}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c00, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c5a, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c81, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d01, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4e, 1}, - {0x0d57, 0x0d5f, 8}, - {0x0d60, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0de6, 0x0def, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edf, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10c7, 0x10cd, 6}, - {0x10d0, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f5, 1}, - {0x13f8, 0x13fd, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f8, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191e, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1ab0, 0x1abe, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cc0, 0x1cc7, 1}, - {0x1cd0, 0x1cf6, 1}, - {0x1cf8, 0x1cf9, 1}, - {0x1d00, 0x1df5, 1}, - {0x1dfc, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x2066, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20be, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x218b, 1}, - {0x2190, 0x23fa, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x2b73, 1}, - {0x2b76, 0x2b95, 1}, - {0x2b98, 0x2bb9, 1}, - {0x2bbd, 0x2bc8, 1}, - {0x2bca, 0x2bd1, 1}, - {0x2bec, 0x2bef, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf3, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d27, 0x2d2d, 6}, - {0x2d30, 0x2d67, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e42, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fd5, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa6f7, 1}, - {0xa700, 0xa7ad, 1}, - {0xa7b0, 0xa7b7, 1}, - {0xa7f7, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fd, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9fe, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaac2, 1}, - {0xaadb, 0xaaf6, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xab30, 0xab65, 1}, - {0xab70, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018c, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101a0, 0x000101d0, 48}, - {0x000101d1, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x000102e0, 0x000102fb, 1}, - {0x00010300, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010350, 0x0001037a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010500, 0x00010527, 1}, - {0x00010530, 0x00010563, 1}, - {0x0001056f, 0x00010600, 145}, - {0x00010601, 0x00010736, 1}, - {0x00010740, 0x00010755, 1}, - {0x00010760, 0x00010767, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001089e, 1}, - {0x000108a7, 0x000108af, 1}, - {0x000108e0, 0x000108f2, 1}, - {0x000108f4, 0x000108f5, 1}, - {0x000108fb, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010980, 65}, - {0x00010981, 0x000109b7, 1}, - {0x000109bc, 0x000109cf, 1}, - {0x000109d2, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a9f, 1}, - {0x00010ac0, 0x00010ae6, 1}, - {0x00010aeb, 0x00010af6, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b91, 1}, - {0x00010b99, 0x00010b9c, 1}, - {0x00010ba9, 0x00010baf, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010c80, 0x00010cb2, 1}, - {0x00010cc0, 0x00010cf2, 1}, - {0x00010cfa, 0x00010cff, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x0001107f, 0x000110c1, 1}, - {0x000110d0, 0x000110e8, 1}, - {0x000110f0, 0x000110f9, 1}, - {0x00011100, 0x00011134, 1}, - {0x00011136, 0x00011143, 1}, - {0x00011150, 0x00011176, 1}, - {0x00011180, 0x000111cd, 1}, - {0x000111d0, 0x000111df, 1}, - {0x000111e1, 0x000111f4, 1}, - {0x00011200, 0x00011211, 1}, - {0x00011213, 0x0001123d, 1}, - {0x00011280, 0x00011286, 1}, - {0x00011288, 0x0001128a, 2}, - {0x0001128b, 0x0001128d, 1}, - {0x0001128f, 0x0001129d, 1}, - {0x0001129f, 0x000112a9, 1}, - {0x000112b0, 0x000112ea, 1}, - {0x000112f0, 0x000112f9, 1}, - {0x00011300, 0x00011303, 1}, - {0x00011305, 0x0001130c, 1}, - {0x0001130f, 0x00011310, 1}, - {0x00011313, 0x00011328, 1}, - {0x0001132a, 0x00011330, 1}, - {0x00011332, 0x00011333, 1}, - {0x00011335, 0x00011339, 1}, - {0x0001133c, 0x00011344, 1}, - {0x00011347, 0x00011348, 1}, - {0x0001134b, 0x0001134d, 1}, - {0x00011350, 0x00011357, 7}, - {0x0001135d, 0x00011363, 1}, - {0x00011366, 0x0001136c, 1}, - {0x00011370, 0x00011374, 1}, - {0x00011480, 0x000114c7, 1}, - {0x000114d0, 0x000114d9, 1}, - {0x00011580, 0x000115b5, 1}, - {0x000115b8, 0x000115dd, 1}, - {0x00011600, 0x00011644, 1}, - {0x00011650, 0x00011659, 1}, - {0x00011680, 0x000116b7, 1}, - {0x000116c0, 0x000116c9, 1}, - {0x00011700, 0x00011719, 1}, - {0x0001171d, 0x0001172b, 1}, - {0x00011730, 0x0001173f, 1}, - {0x000118a0, 0x000118f2, 1}, - {0x000118ff, 0x00011ac0, 449}, - {0x00011ac1, 0x00011af8, 1}, - {0x00012000, 0x00012399, 1}, - {0x00012400, 0x0001246e, 1}, - {0x00012470, 0x00012474, 1}, - {0x00012480, 0x00012543, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00014400, 0x00014646, 1}, - {0x00016800, 0x00016a38, 1}, - {0x00016a40, 0x00016a5e, 1}, - {0x00016a60, 0x00016a69, 1}, - {0x00016a6e, 0x00016a6f, 1}, - {0x00016ad0, 0x00016aed, 1}, - {0x00016af0, 0x00016af5, 1}, - {0x00016b00, 0x00016b45, 1}, - {0x00016b50, 0x00016b59, 1}, - {0x00016b5b, 0x00016b61, 1}, - {0x00016b63, 0x00016b77, 1}, - {0x00016b7d, 0x00016b8f, 1}, - {0x00016f00, 0x00016f44, 1}, - {0x00016f50, 0x00016f7e, 1}, - {0x00016f8f, 0x00016f9f, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001bc00, 0x0001bc6a, 1}, - {0x0001bc70, 0x0001bc7c, 1}, - {0x0001bc80, 0x0001bc88, 1}, - {0x0001bc90, 0x0001bc99, 1}, - {0x0001bc9c, 0x0001bca3, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1e8, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001da8b, 1}, - {0x0001da9b, 0x0001da9f, 1}, - {0x0001daa1, 0x0001daaf, 1}, - {0x0001e800, 0x0001e8c4, 1}, - {0x0001e8c7, 0x0001e8d6, 1}, - {0x0001ee00, 0x0001ee03, 1}, - {0x0001ee05, 0x0001ee1f, 1}, - {0x0001ee21, 0x0001ee22, 1}, - {0x0001ee24, 0x0001ee27, 3}, - {0x0001ee29, 0x0001ee32, 1}, - {0x0001ee34, 0x0001ee37, 1}, - {0x0001ee39, 0x0001ee3b, 2}, - {0x0001ee42, 0x0001ee47, 5}, - {0x0001ee49, 0x0001ee4d, 2}, - {0x0001ee4e, 0x0001ee4f, 1}, - {0x0001ee51, 0x0001ee52, 1}, - {0x0001ee54, 0x0001ee57, 3}, - {0x0001ee59, 0x0001ee61, 2}, - {0x0001ee62, 0x0001ee64, 2}, - {0x0001ee67, 0x0001ee6a, 1}, - {0x0001ee6c, 0x0001ee72, 1}, - {0x0001ee74, 0x0001ee77, 1}, - {0x0001ee79, 0x0001ee7c, 1}, - {0x0001ee7e, 0x0001ee80, 2}, - {0x0001ee81, 0x0001ee89, 1}, - {0x0001ee8b, 0x0001ee9b, 1}, - {0x0001eea1, 0x0001eea3, 1}, - {0x0001eea5, 0x0001eea9, 1}, - {0x0001eeab, 0x0001eebb, 1}, - {0x0001eef0, 0x0001eef1, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0bf, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0f5, 1}, - {0x0001f100, 0x0001f10c, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f16b, 1}, - {0x0001f170, 0x0001f19a, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23a, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f579, 1}, - {0x0001f57b, 0x0001f5a3, 1}, - {0x0001f5a5, 0x0001f6d0, 1}, - {0x0001f6e0, 0x0001f6ec, 1}, - {0x0001f6f0, 0x0001f6f3, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x0001f780, 0x0001f7d4, 1}, - {0x0001f800, 0x0001f80b, 1}, - {0x0001f810, 0x0001f847, 1}, - {0x0001f850, 0x0001f859, 1}, - {0x0001f860, 0x0001f887, 1}, - {0x0001f890, 0x0001f8ad, 1}, - {0x0001f910, 0x0001f918, 1}, - {0x0001f980, 0x0001f984, 1}, - {0x0001f9c0, 0x00020000, 1600}, - {0x00020001, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002b820, 0x0002cea1, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 5348 bytes (5 KiB) -var assigned9_0_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037f, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x052f, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x058d, 0x058f, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x061c, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x08a0, 66}, - {0x08a1, 0x08b4, 1}, - {0x08b6, 0x08bd, 1}, - {0x08d4, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0af1, 1}, - {0x0af9, 0x0b01, 8}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c00, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c5a, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d01, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4f, 1}, - {0x0d54, 0x0d63, 1}, - {0x0d66, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0de6, 0x0def, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edf, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10c7, 0x10cd, 6}, - {0x10d0, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f5, 1}, - {0x13f8, 0x13fd, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f8, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191e, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1ab0, 0x1abe, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c88, 1}, - {0x1cc0, 0x1cc7, 1}, - {0x1cd0, 0x1cf6, 1}, - {0x1cf8, 0x1cf9, 1}, - {0x1d00, 0x1df5, 1}, - {0x1dfb, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x2066, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20be, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x218b, 1}, - {0x2190, 0x23fe, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x2b73, 1}, - {0x2b76, 0x2b95, 1}, - {0x2b98, 0x2bb9, 1}, - {0x2bbd, 0x2bc8, 1}, - {0x2bca, 0x2bd1, 1}, - {0x2bec, 0x2bef, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf3, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d27, 0x2d2d, 6}, - {0x2d30, 0x2d67, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e44, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fd5, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa6f7, 1}, - {0xa700, 0xa7ae, 1}, - {0xa7b0, 0xa7b7, 1}, - {0xa7f7, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c5, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fd, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9fe, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaac2, 1}, - {0xaadb, 0xaaf6, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xab30, 0xab65, 1}, - {0xab70, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018e, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101a0, 0x000101d0, 48}, - {0x000101d1, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x000102e0, 0x000102fb, 1}, - {0x00010300, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010350, 0x0001037a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x000104b0, 0x000104d3, 1}, - {0x000104d8, 0x000104fb, 1}, - {0x00010500, 0x00010527, 1}, - {0x00010530, 0x00010563, 1}, - {0x0001056f, 0x00010600, 145}, - {0x00010601, 0x00010736, 1}, - {0x00010740, 0x00010755, 1}, - {0x00010760, 0x00010767, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001089e, 1}, - {0x000108a7, 0x000108af, 1}, - {0x000108e0, 0x000108f2, 1}, - {0x000108f4, 0x000108f5, 1}, - {0x000108fb, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010980, 65}, - {0x00010981, 0x000109b7, 1}, - {0x000109bc, 0x000109cf, 1}, - {0x000109d2, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a9f, 1}, - {0x00010ac0, 0x00010ae6, 1}, - {0x00010aeb, 0x00010af6, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b91, 1}, - {0x00010b99, 0x00010b9c, 1}, - {0x00010ba9, 0x00010baf, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010c80, 0x00010cb2, 1}, - {0x00010cc0, 0x00010cf2, 1}, - {0x00010cfa, 0x00010cff, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x0001107f, 0x000110c1, 1}, - {0x000110d0, 0x000110e8, 1}, - {0x000110f0, 0x000110f9, 1}, - {0x00011100, 0x00011134, 1}, - {0x00011136, 0x00011143, 1}, - {0x00011150, 0x00011176, 1}, - {0x00011180, 0x000111cd, 1}, - {0x000111d0, 0x000111df, 1}, - {0x000111e1, 0x000111f4, 1}, - {0x00011200, 0x00011211, 1}, - {0x00011213, 0x0001123e, 1}, - {0x00011280, 0x00011286, 1}, - {0x00011288, 0x0001128a, 2}, - {0x0001128b, 0x0001128d, 1}, - {0x0001128f, 0x0001129d, 1}, - {0x0001129f, 0x000112a9, 1}, - {0x000112b0, 0x000112ea, 1}, - {0x000112f0, 0x000112f9, 1}, - {0x00011300, 0x00011303, 1}, - {0x00011305, 0x0001130c, 1}, - {0x0001130f, 0x00011310, 1}, - {0x00011313, 0x00011328, 1}, - {0x0001132a, 0x00011330, 1}, - {0x00011332, 0x00011333, 1}, - {0x00011335, 0x00011339, 1}, - {0x0001133c, 0x00011344, 1}, - {0x00011347, 0x00011348, 1}, - {0x0001134b, 0x0001134d, 1}, - {0x00011350, 0x00011357, 7}, - {0x0001135d, 0x00011363, 1}, - {0x00011366, 0x0001136c, 1}, - {0x00011370, 0x00011374, 1}, - {0x00011400, 0x00011459, 1}, - {0x0001145b, 0x0001145d, 2}, - {0x00011480, 0x000114c7, 1}, - {0x000114d0, 0x000114d9, 1}, - {0x00011580, 0x000115b5, 1}, - {0x000115b8, 0x000115dd, 1}, - {0x00011600, 0x00011644, 1}, - {0x00011650, 0x00011659, 1}, - {0x00011660, 0x0001166c, 1}, - {0x00011680, 0x000116b7, 1}, - {0x000116c0, 0x000116c9, 1}, - {0x00011700, 0x00011719, 1}, - {0x0001171d, 0x0001172b, 1}, - {0x00011730, 0x0001173f, 1}, - {0x000118a0, 0x000118f2, 1}, - {0x000118ff, 0x00011ac0, 449}, - {0x00011ac1, 0x00011af8, 1}, - {0x00011c00, 0x00011c08, 1}, - {0x00011c0a, 0x00011c36, 1}, - {0x00011c38, 0x00011c45, 1}, - {0x00011c50, 0x00011c6c, 1}, - {0x00011c70, 0x00011c8f, 1}, - {0x00011c92, 0x00011ca7, 1}, - {0x00011ca9, 0x00011cb6, 1}, - {0x00012000, 0x00012399, 1}, - {0x00012400, 0x0001246e, 1}, - {0x00012470, 0x00012474, 1}, - {0x00012480, 0x00012543, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00014400, 0x00014646, 1}, - {0x00016800, 0x00016a38, 1}, - {0x00016a40, 0x00016a5e, 1}, - {0x00016a60, 0x00016a69, 1}, - {0x00016a6e, 0x00016a6f, 1}, - {0x00016ad0, 0x00016aed, 1}, - {0x00016af0, 0x00016af5, 1}, - {0x00016b00, 0x00016b45, 1}, - {0x00016b50, 0x00016b59, 1}, - {0x00016b5b, 0x00016b61, 1}, - {0x00016b63, 0x00016b77, 1}, - {0x00016b7d, 0x00016b8f, 1}, - {0x00016f00, 0x00016f44, 1}, - {0x00016f50, 0x00016f7e, 1}, - {0x00016f8f, 0x00016f9f, 1}, - {0x00016fe0, 0x00017000, 32}, - {0x00017001, 0x000187ec, 1}, - {0x00018800, 0x00018af2, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001bc00, 0x0001bc6a, 1}, - {0x0001bc70, 0x0001bc7c, 1}, - {0x0001bc80, 0x0001bc88, 1}, - {0x0001bc90, 0x0001bc99, 1}, - {0x0001bc9c, 0x0001bca3, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1e8, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001da8b, 1}, - {0x0001da9b, 0x0001da9f, 1}, - {0x0001daa1, 0x0001daaf, 1}, - {0x0001e000, 0x0001e006, 1}, - {0x0001e008, 0x0001e018, 1}, - {0x0001e01b, 0x0001e021, 1}, - {0x0001e023, 0x0001e024, 1}, - {0x0001e026, 0x0001e02a, 1}, - {0x0001e800, 0x0001e8c4, 1}, - {0x0001e8c7, 0x0001e8d6, 1}, - {0x0001e900, 0x0001e94a, 1}, - {0x0001e950, 0x0001e959, 1}, - {0x0001e95e, 0x0001e95f, 1}, - {0x0001ee00, 0x0001ee03, 1}, - {0x0001ee05, 0x0001ee1f, 1}, - {0x0001ee21, 0x0001ee22, 1}, - {0x0001ee24, 0x0001ee27, 3}, - {0x0001ee29, 0x0001ee32, 1}, - {0x0001ee34, 0x0001ee37, 1}, - {0x0001ee39, 0x0001ee3b, 2}, - {0x0001ee42, 0x0001ee47, 5}, - {0x0001ee49, 0x0001ee4d, 2}, - {0x0001ee4e, 0x0001ee4f, 1}, - {0x0001ee51, 0x0001ee52, 1}, - {0x0001ee54, 0x0001ee57, 3}, - {0x0001ee59, 0x0001ee61, 2}, - {0x0001ee62, 0x0001ee64, 2}, - {0x0001ee67, 0x0001ee6a, 1}, - {0x0001ee6c, 0x0001ee72, 1}, - {0x0001ee74, 0x0001ee77, 1}, - {0x0001ee79, 0x0001ee7c, 1}, - {0x0001ee7e, 0x0001ee80, 2}, - {0x0001ee81, 0x0001ee89, 1}, - {0x0001ee8b, 0x0001ee9b, 1}, - {0x0001eea1, 0x0001eea3, 1}, - {0x0001eea5, 0x0001eea9, 1}, - {0x0001eeab, 0x0001eebb, 1}, - {0x0001eef0, 0x0001eef1, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0bf, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0f5, 1}, - {0x0001f100, 0x0001f10c, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f16b, 1}, - {0x0001f170, 0x0001f1ac, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23b, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f6d2, 1}, - {0x0001f6e0, 0x0001f6ec, 1}, - {0x0001f6f0, 0x0001f6f6, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x0001f780, 0x0001f7d4, 1}, - {0x0001f800, 0x0001f80b, 1}, - {0x0001f810, 0x0001f847, 1}, - {0x0001f850, 0x0001f859, 1}, - {0x0001f860, 0x0001f887, 1}, - {0x0001f890, 0x0001f8ad, 1}, - {0x0001f910, 0x0001f91e, 1}, - {0x0001f920, 0x0001f927, 1}, - {0x0001f930, 0x0001f933, 3}, - {0x0001f934, 0x0001f93e, 1}, - {0x0001f940, 0x0001f94b, 1}, - {0x0001f950, 0x0001f95e, 1}, - {0x0001f980, 0x0001f991, 1}, - {0x0001f9c0, 0x00020000, 1600}, - {0x00020001, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002b820, 0x0002cea1, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 5492 bytes (5 KiB) -var assigned10_0_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037f, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x052f, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x058d, 0x058f, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x061c, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x0860, 2}, - {0x0861, 0x086a, 1}, - {0x08a0, 0x08b4, 1}, - {0x08b6, 0x08bd, 1}, - {0x08d4, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fd, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0af1, 1}, - {0x0af9, 0x0aff, 1}, - {0x0b01, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c00, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c5a, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d00, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4f, 1}, - {0x0d54, 0x0d63, 1}, - {0x0d66, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0de6, 0x0def, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edf, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10c7, 0x10cd, 6}, - {0x10d0, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f5, 1}, - {0x13f8, 0x13fd, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f8, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191e, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1ab0, 0x1abe, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c88, 1}, - {0x1cc0, 0x1cc7, 1}, - {0x1cd0, 0x1cf9, 1}, - {0x1d00, 0x1df9, 1}, - {0x1dfb, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x2066, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20bf, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x218b, 1}, - {0x2190, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x2b73, 1}, - {0x2b76, 0x2b95, 1}, - {0x2b98, 0x2bb9, 1}, - {0x2bbd, 0x2bc8, 1}, - {0x2bca, 0x2bd2, 1}, - {0x2bec, 0x2bef, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf3, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d27, 0x2d2d, 6}, - {0x2d30, 0x2d67, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e49, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312e, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fea, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa6f7, 1}, - {0xa700, 0xa7ae, 1}, - {0xa7b0, 0xa7b7, 1}, - {0xa7f7, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c5, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fd, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9fe, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaac2, 1}, - {0xaadb, 0xaaf6, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xab30, 0xab65, 1}, - {0xab70, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018e, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101a0, 0x000101d0, 48}, - {0x000101d1, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x000102e0, 0x000102fb, 1}, - {0x00010300, 0x00010323, 1}, - {0x0001032d, 0x0001034a, 1}, - {0x00010350, 0x0001037a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x000104b0, 0x000104d3, 1}, - {0x000104d8, 0x000104fb, 1}, - {0x00010500, 0x00010527, 1}, - {0x00010530, 0x00010563, 1}, - {0x0001056f, 0x00010600, 145}, - {0x00010601, 0x00010736, 1}, - {0x00010740, 0x00010755, 1}, - {0x00010760, 0x00010767, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001089e, 1}, - {0x000108a7, 0x000108af, 1}, - {0x000108e0, 0x000108f2, 1}, - {0x000108f4, 0x000108f5, 1}, - {0x000108fb, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010980, 65}, - {0x00010981, 0x000109b7, 1}, - {0x000109bc, 0x000109cf, 1}, - {0x000109d2, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a9f, 1}, - {0x00010ac0, 0x00010ae6, 1}, - {0x00010aeb, 0x00010af6, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b91, 1}, - {0x00010b99, 0x00010b9c, 1}, - {0x00010ba9, 0x00010baf, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010c80, 0x00010cb2, 1}, - {0x00010cc0, 0x00010cf2, 1}, - {0x00010cfa, 0x00010cff, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x0001107f, 0x000110c1, 1}, - {0x000110d0, 0x000110e8, 1}, - {0x000110f0, 0x000110f9, 1}, - {0x00011100, 0x00011134, 1}, - {0x00011136, 0x00011143, 1}, - {0x00011150, 0x00011176, 1}, - {0x00011180, 0x000111cd, 1}, - {0x000111d0, 0x000111df, 1}, - {0x000111e1, 0x000111f4, 1}, - {0x00011200, 0x00011211, 1}, - {0x00011213, 0x0001123e, 1}, - {0x00011280, 0x00011286, 1}, - {0x00011288, 0x0001128a, 2}, - {0x0001128b, 0x0001128d, 1}, - {0x0001128f, 0x0001129d, 1}, - {0x0001129f, 0x000112a9, 1}, - {0x000112b0, 0x000112ea, 1}, - {0x000112f0, 0x000112f9, 1}, - {0x00011300, 0x00011303, 1}, - {0x00011305, 0x0001130c, 1}, - {0x0001130f, 0x00011310, 1}, - {0x00011313, 0x00011328, 1}, - {0x0001132a, 0x00011330, 1}, - {0x00011332, 0x00011333, 1}, - {0x00011335, 0x00011339, 1}, - {0x0001133c, 0x00011344, 1}, - {0x00011347, 0x00011348, 1}, - {0x0001134b, 0x0001134d, 1}, - {0x00011350, 0x00011357, 7}, - {0x0001135d, 0x00011363, 1}, - {0x00011366, 0x0001136c, 1}, - {0x00011370, 0x00011374, 1}, - {0x00011400, 0x00011459, 1}, - {0x0001145b, 0x0001145d, 2}, - {0x00011480, 0x000114c7, 1}, - {0x000114d0, 0x000114d9, 1}, - {0x00011580, 0x000115b5, 1}, - {0x000115b8, 0x000115dd, 1}, - {0x00011600, 0x00011644, 1}, - {0x00011650, 0x00011659, 1}, - {0x00011660, 0x0001166c, 1}, - {0x00011680, 0x000116b7, 1}, - {0x000116c0, 0x000116c9, 1}, - {0x00011700, 0x00011719, 1}, - {0x0001171d, 0x0001172b, 1}, - {0x00011730, 0x0001173f, 1}, - {0x000118a0, 0x000118f2, 1}, - {0x000118ff, 0x00011a00, 257}, - {0x00011a01, 0x00011a47, 1}, - {0x00011a50, 0x00011a83, 1}, - {0x00011a86, 0x00011a9c, 1}, - {0x00011a9e, 0x00011aa2, 1}, - {0x00011ac0, 0x00011af8, 1}, - {0x00011c00, 0x00011c08, 1}, - {0x00011c0a, 0x00011c36, 1}, - {0x00011c38, 0x00011c45, 1}, - {0x00011c50, 0x00011c6c, 1}, - {0x00011c70, 0x00011c8f, 1}, - {0x00011c92, 0x00011ca7, 1}, - {0x00011ca9, 0x00011cb6, 1}, - {0x00011d00, 0x00011d06, 1}, - {0x00011d08, 0x00011d09, 1}, - {0x00011d0b, 0x00011d36, 1}, - {0x00011d3a, 0x00011d3c, 2}, - {0x00011d3d, 0x00011d3f, 2}, - {0x00011d40, 0x00011d47, 1}, - {0x00011d50, 0x00011d59, 1}, - {0x00012000, 0x00012399, 1}, - {0x00012400, 0x0001246e, 1}, - {0x00012470, 0x00012474, 1}, - {0x00012480, 0x00012543, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00014400, 0x00014646, 1}, - {0x00016800, 0x00016a38, 1}, - {0x00016a40, 0x00016a5e, 1}, - {0x00016a60, 0x00016a69, 1}, - {0x00016a6e, 0x00016a6f, 1}, - {0x00016ad0, 0x00016aed, 1}, - {0x00016af0, 0x00016af5, 1}, - {0x00016b00, 0x00016b45, 1}, - {0x00016b50, 0x00016b59, 1}, - {0x00016b5b, 0x00016b61, 1}, - {0x00016b63, 0x00016b77, 1}, - {0x00016b7d, 0x00016b8f, 1}, - {0x00016f00, 0x00016f44, 1}, - {0x00016f50, 0x00016f7e, 1}, - {0x00016f8f, 0x00016f9f, 1}, - {0x00016fe0, 0x00016fe1, 1}, - {0x00017000, 0x000187ec, 1}, - {0x00018800, 0x00018af2, 1}, - {0x0001b000, 0x0001b11e, 1}, - {0x0001b170, 0x0001b2fb, 1}, - {0x0001bc00, 0x0001bc6a, 1}, - {0x0001bc70, 0x0001bc7c, 1}, - {0x0001bc80, 0x0001bc88, 1}, - {0x0001bc90, 0x0001bc99, 1}, - {0x0001bc9c, 0x0001bca3, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1e8, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001da8b, 1}, - {0x0001da9b, 0x0001da9f, 1}, - {0x0001daa1, 0x0001daaf, 1}, - {0x0001e000, 0x0001e006, 1}, - {0x0001e008, 0x0001e018, 1}, - {0x0001e01b, 0x0001e021, 1}, - {0x0001e023, 0x0001e024, 1}, - {0x0001e026, 0x0001e02a, 1}, - {0x0001e800, 0x0001e8c4, 1}, - {0x0001e8c7, 0x0001e8d6, 1}, - {0x0001e900, 0x0001e94a, 1}, - {0x0001e950, 0x0001e959, 1}, - {0x0001e95e, 0x0001e95f, 1}, - {0x0001ee00, 0x0001ee03, 1}, - {0x0001ee05, 0x0001ee1f, 1}, - {0x0001ee21, 0x0001ee22, 1}, - {0x0001ee24, 0x0001ee27, 3}, - {0x0001ee29, 0x0001ee32, 1}, - {0x0001ee34, 0x0001ee37, 1}, - {0x0001ee39, 0x0001ee3b, 2}, - {0x0001ee42, 0x0001ee47, 5}, - {0x0001ee49, 0x0001ee4d, 2}, - {0x0001ee4e, 0x0001ee4f, 1}, - {0x0001ee51, 0x0001ee52, 1}, - {0x0001ee54, 0x0001ee57, 3}, - {0x0001ee59, 0x0001ee61, 2}, - {0x0001ee62, 0x0001ee64, 2}, - {0x0001ee67, 0x0001ee6a, 1}, - {0x0001ee6c, 0x0001ee72, 1}, - {0x0001ee74, 0x0001ee77, 1}, - {0x0001ee79, 0x0001ee7c, 1}, - {0x0001ee7e, 0x0001ee80, 2}, - {0x0001ee81, 0x0001ee89, 1}, - {0x0001ee8b, 0x0001ee9b, 1}, - {0x0001eea1, 0x0001eea3, 1}, - {0x0001eea5, 0x0001eea9, 1}, - {0x0001eeab, 0x0001eebb, 1}, - {0x0001eef0, 0x0001eef1, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0bf, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0f5, 1}, - {0x0001f100, 0x0001f10c, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f16b, 1}, - {0x0001f170, 0x0001f1ac, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23b, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f260, 0x0001f265, 1}, - {0x0001f300, 0x0001f6d4, 1}, - {0x0001f6e0, 0x0001f6ec, 1}, - {0x0001f6f0, 0x0001f6f8, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x0001f780, 0x0001f7d4, 1}, - {0x0001f800, 0x0001f80b, 1}, - {0x0001f810, 0x0001f847, 1}, - {0x0001f850, 0x0001f859, 1}, - {0x0001f860, 0x0001f887, 1}, - {0x0001f890, 0x0001f8ad, 1}, - {0x0001f900, 0x0001f90b, 1}, - {0x0001f910, 0x0001f93e, 1}, - {0x0001f940, 0x0001f94c, 1}, - {0x0001f950, 0x0001f96b, 1}, - {0x0001f980, 0x0001f997, 1}, - {0x0001f9c0, 0x0001f9d0, 16}, - {0x0001f9d1, 0x0001f9e6, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002b820, 0x0002cea1, 1}, - {0x0002ceb0, 0x0002ebe0, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// Total size 49698 bytes (48 KiB) diff --git a/vendor/golang.org/x/text/unicode/rangetable/tables9.0.0.go b/vendor/golang.org/x/text/unicode/rangetable/tables9.0.0.go deleted file mode 100644 index aef876d963f3..000000000000 --- a/vendor/golang.org/x/text/unicode/rangetable/tables9.0.0.go +++ /dev/null @@ -1,5737 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -// +build !go1.10 - -package rangetable - -//go:generate go run gen.go --versions=4.1.0,5.1.0,5.2.0,5.0.0,6.1.0,6.2.0,6.3.0,6.0.0,7.0.0,8.0.0,9.0.0 - -import "unicode" - -var assigned = map[string]*unicode.RangeTable{ - "4.1.0": assigned4_1_0, - "5.1.0": assigned5_1_0, - "5.2.0": assigned5_2_0, - "5.0.0": assigned5_0_0, - "6.1.0": assigned6_1_0, - "6.2.0": assigned6_2_0, - "6.3.0": assigned6_3_0, - "6.0.0": assigned6_0_0, - "7.0.0": assigned7_0_0, - "8.0.0": assigned8_0_0, - "9.0.0": assigned9_0_0, -} - -// size 2924 bytes (2 KiB) -var assigned4_1_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0241, 1}, - {0x0250, 0x036f, 1}, - {0x0374, 0x0375, 1}, - {0x037a, 0x037e, 4}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x03ce, 1}, - {0x03d0, 0x0486, 1}, - {0x0488, 0x04ce, 1}, - {0x04d0, 0x04f9, 1}, - {0x0500, 0x050f, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x0591, 0x05b9, 1}, - {0x05bb, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0603, 1}, - {0x060b, 0x0615, 1}, - {0x061b, 0x061e, 3}, - {0x061f, 0x0621, 2}, - {0x0622, 0x063a, 1}, - {0x0640, 0x065e, 1}, - {0x0660, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x076d, 1}, - {0x0780, 0x07b1, 1}, - {0x0901, 0x0939, 1}, - {0x093c, 0x094d, 1}, - {0x0950, 0x0954, 1}, - {0x0958, 0x0970, 1}, - {0x097d, 0x0981, 4}, - {0x0982, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fa, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a59, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a74, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0aef, 1}, - {0x0af1, 0x0b01, 16}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b43, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b61, 1}, - {0x0b66, 0x0b71, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd7, 0x0be6, 15}, - {0x0be7, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3e, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c60, 0x0c61, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce6, 5}, - {0x0ce7, 0x0cef, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d28, 1}, - {0x0d2a, 0x0d39, 1}, - {0x0d3e, 0x0d43, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4d, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d66, 5}, - {0x0d67, 0x0d6f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edd, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6a, 1}, - {0x0f71, 0x0f8b, 1}, - {0x0f90, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fcf, 0x0fd1, 1}, - {0x1000, 0x1021, 1}, - {0x1023, 0x1027, 1}, - {0x1029, 0x102a, 1}, - {0x102c, 0x1032, 1}, - {0x1036, 0x1039, 1}, - {0x1040, 0x1059, 1}, - {0x10a0, 0x10c5, 1}, - {0x10d0, 0x10fc, 1}, - {0x1100, 0x1159, 1}, - {0x115f, 0x11a2, 1}, - {0x11a8, 0x11f9, 1}, - {0x1200, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135f, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1401, 0x1676, 1}, - {0x1680, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18a9, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19a9, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19d9, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a1f, 1}, - {0x1d00, 0x1dc3, 1}, - {0x1e00, 0x1e9b, 1}, - {0x1ea0, 0x1ef9, 1}, - {0x1f00, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2063, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x2094, 1}, - {0x20a0, 0x20b5, 1}, - {0x20d0, 0x20eb, 1}, - {0x2100, 0x214c, 1}, - {0x2153, 0x2183, 1}, - {0x2190, 0x23db, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x269c, 1}, - {0x26a0, 0x26b1, 1}, - {0x2701, 0x2704, 1}, - {0x2706, 0x2709, 1}, - {0x270c, 0x2727, 1}, - {0x2729, 0x274b, 1}, - {0x274d, 0x274f, 2}, - {0x2750, 0x2752, 1}, - {0x2756, 0x2758, 2}, - {0x2759, 0x275e, 1}, - {0x2761, 0x2794, 1}, - {0x2798, 0x27af, 1}, - {0x27b1, 0x27be, 1}, - {0x27c0, 0x27c6, 1}, - {0x27d0, 0x27eb, 1}, - {0x27f0, 0x2b13, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c80, 0x2cea, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d30, 0x2d65, 1}, - {0x2d6f, 0x2d80, 17}, - {0x2d81, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2e00, 0x2e17, 1}, - {0x2e1c, 0x2e1d, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312c, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31b7, 1}, - {0x31c0, 0x31cf, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x3243, 1}, - {0x3250, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fbb, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa700, 0xa716, 1}, - {0xa800, 0xa82b, 1}, - {0xac00, 0xd7a3, 1}, - {0xd800, 0xfa2d, 1}, - {0xfa30, 0xfa6a, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbb1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe23, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010a00, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d12a, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7c9, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 3152 bytes (3 KiB) -var assigned5_1_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x0523, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0603, 1}, - {0x0606, 0x061b, 1}, - {0x061e, 0x061f, 1}, - {0x0621, 0x065e, 1}, - {0x0660, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0901, 0x0939, 1}, - {0x093c, 0x094d, 1}, - {0x0950, 0x0954, 1}, - {0x0958, 0x0972, 1}, - {0x097b, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fa, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0aef, 1}, - {0x0af1, 0x0b01, 16}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b71, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d28, 1}, - {0x0d2a, 0x0d39, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4d, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edd, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f8b, 1}, - {0x0f90, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fd4, 1}, - {0x1000, 0x1099, 1}, - {0x109e, 0x10c5, 1}, - {0x10d0, 0x10fc, 1}, - {0x1100, 0x1159, 1}, - {0x115f, 0x11a2, 1}, - {0x11a8, 0x11f9, 1}, - {0x1200, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135f, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1401, 0x1676, 1}, - {0x1680, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19a9, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19d9, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a1f, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1baa, 1}, - {0x1bae, 0x1bb9, 1}, - {0x1c00, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1d00, 0x1de6, 1}, - {0x1dfe, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x2094, 1}, - {0x20a0, 0x20b5, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x214f, 1}, - {0x2153, 0x2188, 1}, - {0x2190, 0x23e7, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x269d, 1}, - {0x26a0, 0x26bc, 1}, - {0x26c0, 0x26c3, 1}, - {0x2701, 0x2704, 1}, - {0x2706, 0x2709, 1}, - {0x270c, 0x2727, 1}, - {0x2729, 0x274b, 1}, - {0x274d, 0x274f, 2}, - {0x2750, 0x2752, 1}, - {0x2756, 0x2758, 2}, - {0x2759, 0x275e, 1}, - {0x2761, 0x2794, 1}, - {0x2798, 0x27af, 1}, - {0x27b1, 0x27be, 1}, - {0x27c0, 0x27ca, 1}, - {0x27cc, 0x27d0, 4}, - {0x27d1, 0x2b4c, 1}, - {0x2b50, 0x2b54, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2c6f, 1}, - {0x2c71, 0x2c7d, 1}, - {0x2c80, 0x2cea, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d30, 0x2d65, 1}, - {0x2d6f, 0x2d80, 17}, - {0x2d81, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e30, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31b7, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x3243, 1}, - {0x3250, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fc3, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa500, 0xa62b, 1}, - {0xa640, 0xa65f, 1}, - {0xa662, 0xa673, 1}, - {0xa67c, 0xa697, 1}, - {0xa700, 0xa78c, 1}, - {0xa7fb, 0xa82b, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xaa00, 161}, - {0xaa01, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaa5f, 1}, - {0xac00, 0xd7a3, 1}, - {0xd800, 0xfa2d, 1}, - {0xfa30, 0xfa6a, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbb1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe26, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101d0, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010900, 0x00010919, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010a00, 193}, - {0x00010a01, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 3518 bytes (3 KiB) -var assigned5_2_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x0525, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0603, 1}, - {0x0606, 0x061b, 1}, - {0x061e, 0x061f, 1}, - {0x0621, 0x065e, 1}, - {0x0660, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0900, 0x0939, 1}, - {0x093c, 0x094e, 1}, - {0x0950, 0x0955, 1}, - {0x0958, 0x0972, 1}, - {0x0979, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0aef, 1}, - {0x0af1, 0x0b01, 16}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b71, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d28, 1}, - {0x0d2a, 0x0d39, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4d, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edd, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f8b, 1}, - {0x0f90, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fd8, 1}, - {0x1000, 0x10c5, 1}, - {0x10d0, 0x10fc, 1}, - {0x1100, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135f, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1baa, 1}, - {0x1bae, 0x1bb9, 1}, - {0x1c00, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cd0, 0x1cf2, 1}, - {0x1d00, 0x1de6, 1}, - {0x1dfd, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x2094, 1}, - {0x20a0, 0x20b8, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x2189, 1}, - {0x2190, 0x23e8, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x26cd, 1}, - {0x26cf, 0x26e1, 1}, - {0x26e3, 0x26e8, 5}, - {0x26e9, 0x26ff, 1}, - {0x2701, 0x2704, 1}, - {0x2706, 0x2709, 1}, - {0x270c, 0x2727, 1}, - {0x2729, 0x274b, 1}, - {0x274d, 0x274f, 2}, - {0x2750, 0x2752, 1}, - {0x2756, 0x275e, 1}, - {0x2761, 0x2794, 1}, - {0x2798, 0x27af, 1}, - {0x27b1, 0x27be, 1}, - {0x27c0, 0x27ca, 1}, - {0x27cc, 0x27d0, 4}, - {0x27d1, 0x2b4c, 1}, - {0x2b50, 0x2b59, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf1, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d30, 0x2d65, 1}, - {0x2d6f, 0x2d80, 17}, - {0x2d81, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e31, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31b7, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fcb, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa65f, 1}, - {0xa662, 0xa673, 1}, - {0xa67c, 0xa697, 1}, - {0xa6a0, 0xa6f7, 1}, - {0xa700, 0xa78c, 1}, - {0xa7fb, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fb, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9df, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaa7b, 1}, - {0xaa80, 0xaac2, 1}, - {0xaadb, 0xaadf, 1}, - {0xabc0, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa2d, 1}, - {0xfa30, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbb1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe26, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101d0, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001085f, 1}, - {0x00010900, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010a00, 193}, - {0x00010a01, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a7f, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b7f, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011080, 0x000110c1, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x00013000, 0x0001342e, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f100, 0x0001f10a, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f131, 0x0001f13d, 12}, - {0x0001f13f, 0x0001f142, 3}, - {0x0001f146, 0x0001f14a, 4}, - {0x0001f14b, 0x0001f14e, 1}, - {0x0001f157, 0x0001f15f, 8}, - {0x0001f179, 0x0001f17b, 2}, - {0x0001f17c, 0x0001f17f, 3}, - {0x0001f18a, 0x0001f18d, 1}, - {0x0001f190, 0x0001f200, 112}, - {0x0001f210, 0x0001f231, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 3026 bytes (2 KiB) -var assigned5_0_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x036f, 1}, - {0x0374, 0x0375, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x03ce, 1}, - {0x03d0, 0x0486, 1}, - {0x0488, 0x0513, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0603, 1}, - {0x060b, 0x0615, 1}, - {0x061b, 0x061e, 3}, - {0x061f, 0x0621, 2}, - {0x0622, 0x063a, 1}, - {0x0640, 0x065e, 1}, - {0x0660, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x076d, 1}, - {0x0780, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0901, 0x0939, 1}, - {0x093c, 0x094d, 1}, - {0x0950, 0x0954, 1}, - {0x0958, 0x0970, 1}, - {0x097b, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fa, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a59, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a74, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0aef, 1}, - {0x0af1, 0x0b01, 16}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b43, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b61, 1}, - {0x0b66, 0x0b71, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd7, 0x0be6, 15}, - {0x0be7, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3e, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c60, 0x0c61, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d28, 1}, - {0x0d2a, 0x0d39, 1}, - {0x0d3e, 0x0d43, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4d, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d66, 5}, - {0x0d67, 0x0d6f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edd, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6a, 1}, - {0x0f71, 0x0f8b, 1}, - {0x0f90, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fcf, 0x0fd1, 1}, - {0x1000, 0x1021, 1}, - {0x1023, 0x1027, 1}, - {0x1029, 0x102a, 1}, - {0x102c, 0x1032, 1}, - {0x1036, 0x1039, 1}, - {0x1040, 0x1059, 1}, - {0x10a0, 0x10c5, 1}, - {0x10d0, 0x10fc, 1}, - {0x1100, 0x1159, 1}, - {0x115f, 0x11a2, 1}, - {0x11a8, 0x11f9, 1}, - {0x1200, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135f, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1401, 0x1676, 1}, - {0x1680, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18a9, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19a9, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19d9, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a1f, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1d00, 0x1dca, 1}, - {0x1dfe, 0x1e9b, 1}, - {0x1ea0, 0x1ef9, 1}, - {0x1f00, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2063, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x2094, 1}, - {0x20a0, 0x20b5, 1}, - {0x20d0, 0x20ef, 1}, - {0x2100, 0x214e, 1}, - {0x2153, 0x2184, 1}, - {0x2190, 0x23e7, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x269c, 1}, - {0x26a0, 0x26b2, 1}, - {0x2701, 0x2704, 1}, - {0x2706, 0x2709, 1}, - {0x270c, 0x2727, 1}, - {0x2729, 0x274b, 1}, - {0x274d, 0x274f, 2}, - {0x2750, 0x2752, 1}, - {0x2756, 0x2758, 2}, - {0x2759, 0x275e, 1}, - {0x2761, 0x2794, 1}, - {0x2798, 0x27af, 1}, - {0x27b1, 0x27be, 1}, - {0x27c0, 0x27ca, 1}, - {0x27d0, 0x27eb, 1}, - {0x27f0, 0x2b1a, 1}, - {0x2b20, 0x2b23, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2c6c, 1}, - {0x2c74, 0x2c77, 1}, - {0x2c80, 0x2cea, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d30, 0x2d65, 1}, - {0x2d6f, 0x2d80, 17}, - {0x2d81, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2e00, 0x2e17, 1}, - {0x2e1c, 0x2e1d, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312c, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31b7, 1}, - {0x31c0, 0x31cf, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x3243, 1}, - {0x3250, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fbb, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa700, 0xa71a, 1}, - {0xa720, 0xa721, 1}, - {0xa800, 0xa82b, 1}, - {0xa840, 0xa877, 1}, - {0xac00, 0xd7a3, 1}, - {0xd800, 0xfa2d, 1}, - {0xfa30, 0xfa6a, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbb1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe23, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010900, 0x00010919, 1}, - {0x0001091f, 0x00010a00, 225}, - {0x00010a01, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d12a, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 4160 bytes (4 KiB) -var assigned6_1_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x0527, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x058f, 0x0591, 2}, - {0x0592, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0604, 1}, - {0x0606, 0x061b, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x08a0, 66}, - {0x08a2, 0x08ac, 1}, - {0x08e4, 0x08fe, 1}, - {0x0900, 0x0977, 1}, - {0x0979, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0af1, 1}, - {0x0b01, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4e, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edf, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10c7, 0x10cd, 6}, - {0x10d0, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cc0, 0x1cc7, 1}, - {0x1cd0, 0x1cf6, 1}, - {0x1d00, 0x1de6, 1}, - {0x1dfc, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20b9, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x2189, 1}, - {0x2190, 0x23f3, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x26ff, 1}, - {0x2701, 0x2b4c, 1}, - {0x2b50, 0x2b59, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf3, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d27, 0x2d2d, 6}, - {0x2d30, 0x2d67, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e3b, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fcc, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa697, 1}, - {0xa69f, 0xa6f7, 1}, - {0xa700, 0xa78e, 1}, - {0xa790, 0xa793, 1}, - {0xa7a0, 0xa7aa, 1}, - {0xa7f8, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fb, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9df, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaa7b, 1}, - {0xaa80, 0xaac2, 1}, - {0xaadb, 0xaaf6, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xabc0, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe26, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101d0, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001085f, 1}, - {0x00010900, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010980, 65}, - {0x00010981, 0x000109b7, 1}, - {0x000109be, 0x000109bf, 1}, - {0x00010a00, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a7f, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b7f, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x00011080, 0x000110c1, 1}, - {0x000110d0, 0x000110e8, 1}, - {0x000110f0, 0x000110f9, 1}, - {0x00011100, 0x00011134, 1}, - {0x00011136, 0x00011143, 1}, - {0x00011180, 0x000111c8, 1}, - {0x000111d0, 0x000111d9, 1}, - {0x00011680, 0x000116b7, 1}, - {0x000116c0, 0x000116c9, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00016800, 0x00016a38, 1}, - {0x00016f00, 0x00016f44, 1}, - {0x00016f50, 0x00016f7e, 1}, - {0x00016f8f, 0x00016f9f, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001ee00, 0x0001ee03, 1}, - {0x0001ee05, 0x0001ee1f, 1}, - {0x0001ee21, 0x0001ee22, 1}, - {0x0001ee24, 0x0001ee27, 3}, - {0x0001ee29, 0x0001ee32, 1}, - {0x0001ee34, 0x0001ee37, 1}, - {0x0001ee39, 0x0001ee3b, 2}, - {0x0001ee42, 0x0001ee47, 5}, - {0x0001ee49, 0x0001ee4d, 2}, - {0x0001ee4e, 0x0001ee4f, 1}, - {0x0001ee51, 0x0001ee52, 1}, - {0x0001ee54, 0x0001ee57, 3}, - {0x0001ee59, 0x0001ee61, 2}, - {0x0001ee62, 0x0001ee64, 2}, - {0x0001ee67, 0x0001ee6a, 1}, - {0x0001ee6c, 0x0001ee72, 1}, - {0x0001ee74, 0x0001ee77, 1}, - {0x0001ee79, 0x0001ee7c, 1}, - {0x0001ee7e, 0x0001ee80, 2}, - {0x0001ee81, 0x0001ee89, 1}, - {0x0001ee8b, 0x0001ee9b, 1}, - {0x0001eea1, 0x0001eea3, 1}, - {0x0001eea5, 0x0001eea9, 1}, - {0x0001eeab, 0x0001eebb, 1}, - {0x0001eef0, 0x0001eef1, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0be, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0df, 1}, - {0x0001f100, 0x0001f10a, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f16b, 1}, - {0x0001f170, 0x0001f19a, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23a, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f320, 1}, - {0x0001f330, 0x0001f335, 1}, - {0x0001f337, 0x0001f37c, 1}, - {0x0001f380, 0x0001f393, 1}, - {0x0001f3a0, 0x0001f3c4, 1}, - {0x0001f3c6, 0x0001f3ca, 1}, - {0x0001f3e0, 0x0001f3f0, 1}, - {0x0001f400, 0x0001f43e, 1}, - {0x0001f440, 0x0001f442, 2}, - {0x0001f443, 0x0001f4f7, 1}, - {0x0001f4f9, 0x0001f4fc, 1}, - {0x0001f500, 0x0001f53d, 1}, - {0x0001f540, 0x0001f543, 1}, - {0x0001f550, 0x0001f567, 1}, - {0x0001f5fb, 0x0001f640, 1}, - {0x0001f645, 0x0001f64f, 1}, - {0x0001f680, 0x0001f6c5, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 4160 bytes (4 KiB) -var assigned6_2_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x0527, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x058f, 0x0591, 2}, - {0x0592, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0604, 1}, - {0x0606, 0x061b, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x08a0, 66}, - {0x08a2, 0x08ac, 1}, - {0x08e4, 0x08fe, 1}, - {0x0900, 0x0977, 1}, - {0x0979, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0af1, 1}, - {0x0b01, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4e, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edf, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10c7, 0x10cd, 6}, - {0x10d0, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cc0, 0x1cc7, 1}, - {0x1cd0, 0x1cf6, 1}, - {0x1d00, 0x1de6, 1}, - {0x1dfc, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20ba, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x2189, 1}, - {0x2190, 0x23f3, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x26ff, 1}, - {0x2701, 0x2b4c, 1}, - {0x2b50, 0x2b59, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf3, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d27, 0x2d2d, 6}, - {0x2d30, 0x2d67, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e3b, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fcc, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa697, 1}, - {0xa69f, 0xa6f7, 1}, - {0xa700, 0xa78e, 1}, - {0xa790, 0xa793, 1}, - {0xa7a0, 0xa7aa, 1}, - {0xa7f8, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fb, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9df, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaa7b, 1}, - {0xaa80, 0xaac2, 1}, - {0xaadb, 0xaaf6, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xabc0, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe26, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101d0, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001085f, 1}, - {0x00010900, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010980, 65}, - {0x00010981, 0x000109b7, 1}, - {0x000109be, 0x000109bf, 1}, - {0x00010a00, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a7f, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b7f, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x00011080, 0x000110c1, 1}, - {0x000110d0, 0x000110e8, 1}, - {0x000110f0, 0x000110f9, 1}, - {0x00011100, 0x00011134, 1}, - {0x00011136, 0x00011143, 1}, - {0x00011180, 0x000111c8, 1}, - {0x000111d0, 0x000111d9, 1}, - {0x00011680, 0x000116b7, 1}, - {0x000116c0, 0x000116c9, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00016800, 0x00016a38, 1}, - {0x00016f00, 0x00016f44, 1}, - {0x00016f50, 0x00016f7e, 1}, - {0x00016f8f, 0x00016f9f, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001ee00, 0x0001ee03, 1}, - {0x0001ee05, 0x0001ee1f, 1}, - {0x0001ee21, 0x0001ee22, 1}, - {0x0001ee24, 0x0001ee27, 3}, - {0x0001ee29, 0x0001ee32, 1}, - {0x0001ee34, 0x0001ee37, 1}, - {0x0001ee39, 0x0001ee3b, 2}, - {0x0001ee42, 0x0001ee47, 5}, - {0x0001ee49, 0x0001ee4d, 2}, - {0x0001ee4e, 0x0001ee4f, 1}, - {0x0001ee51, 0x0001ee52, 1}, - {0x0001ee54, 0x0001ee57, 3}, - {0x0001ee59, 0x0001ee61, 2}, - {0x0001ee62, 0x0001ee64, 2}, - {0x0001ee67, 0x0001ee6a, 1}, - {0x0001ee6c, 0x0001ee72, 1}, - {0x0001ee74, 0x0001ee77, 1}, - {0x0001ee79, 0x0001ee7c, 1}, - {0x0001ee7e, 0x0001ee80, 2}, - {0x0001ee81, 0x0001ee89, 1}, - {0x0001ee8b, 0x0001ee9b, 1}, - {0x0001eea1, 0x0001eea3, 1}, - {0x0001eea5, 0x0001eea9, 1}, - {0x0001eeab, 0x0001eebb, 1}, - {0x0001eef0, 0x0001eef1, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0be, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0df, 1}, - {0x0001f100, 0x0001f10a, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f16b, 1}, - {0x0001f170, 0x0001f19a, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23a, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f320, 1}, - {0x0001f330, 0x0001f335, 1}, - {0x0001f337, 0x0001f37c, 1}, - {0x0001f380, 0x0001f393, 1}, - {0x0001f3a0, 0x0001f3c4, 1}, - {0x0001f3c6, 0x0001f3ca, 1}, - {0x0001f3e0, 0x0001f3f0, 1}, - {0x0001f400, 0x0001f43e, 1}, - {0x0001f440, 0x0001f442, 2}, - {0x0001f443, 0x0001f4f7, 1}, - {0x0001f4f9, 0x0001f4fc, 1}, - {0x0001f500, 0x0001f53d, 1}, - {0x0001f540, 0x0001f543, 1}, - {0x0001f550, 0x0001f567, 1}, - {0x0001f5fb, 0x0001f640, 1}, - {0x0001f645, 0x0001f64f, 1}, - {0x0001f680, 0x0001f6c5, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 4160 bytes (4 KiB) -var assigned6_3_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x0527, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x058f, 0x0591, 2}, - {0x0592, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0604, 1}, - {0x0606, 0x061c, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x08a0, 66}, - {0x08a2, 0x08ac, 1}, - {0x08e4, 0x08fe, 1}, - {0x0900, 0x0977, 1}, - {0x0979, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0af1, 1}, - {0x0b01, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4e, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edf, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10c7, 0x10cd, 6}, - {0x10d0, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cc0, 0x1cc7, 1}, - {0x1cd0, 0x1cf6, 1}, - {0x1d00, 0x1de6, 1}, - {0x1dfc, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x2066, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20ba, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x2189, 1}, - {0x2190, 0x23f3, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x26ff, 1}, - {0x2701, 0x2b4c, 1}, - {0x2b50, 0x2b59, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf3, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d27, 0x2d2d, 6}, - {0x2d30, 0x2d67, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e3b, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fcc, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa697, 1}, - {0xa69f, 0xa6f7, 1}, - {0xa700, 0xa78e, 1}, - {0xa790, 0xa793, 1}, - {0xa7a0, 0xa7aa, 1}, - {0xa7f8, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fb, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9df, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaa7b, 1}, - {0xaa80, 0xaac2, 1}, - {0xaadb, 0xaaf6, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xabc0, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe26, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101d0, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001085f, 1}, - {0x00010900, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010980, 65}, - {0x00010981, 0x000109b7, 1}, - {0x000109be, 0x000109bf, 1}, - {0x00010a00, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a7f, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b7f, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x00011080, 0x000110c1, 1}, - {0x000110d0, 0x000110e8, 1}, - {0x000110f0, 0x000110f9, 1}, - {0x00011100, 0x00011134, 1}, - {0x00011136, 0x00011143, 1}, - {0x00011180, 0x000111c8, 1}, - {0x000111d0, 0x000111d9, 1}, - {0x00011680, 0x000116b7, 1}, - {0x000116c0, 0x000116c9, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00016800, 0x00016a38, 1}, - {0x00016f00, 0x00016f44, 1}, - {0x00016f50, 0x00016f7e, 1}, - {0x00016f8f, 0x00016f9f, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001ee00, 0x0001ee03, 1}, - {0x0001ee05, 0x0001ee1f, 1}, - {0x0001ee21, 0x0001ee22, 1}, - {0x0001ee24, 0x0001ee27, 3}, - {0x0001ee29, 0x0001ee32, 1}, - {0x0001ee34, 0x0001ee37, 1}, - {0x0001ee39, 0x0001ee3b, 2}, - {0x0001ee42, 0x0001ee47, 5}, - {0x0001ee49, 0x0001ee4d, 2}, - {0x0001ee4e, 0x0001ee4f, 1}, - {0x0001ee51, 0x0001ee52, 1}, - {0x0001ee54, 0x0001ee57, 3}, - {0x0001ee59, 0x0001ee61, 2}, - {0x0001ee62, 0x0001ee64, 2}, - {0x0001ee67, 0x0001ee6a, 1}, - {0x0001ee6c, 0x0001ee72, 1}, - {0x0001ee74, 0x0001ee77, 1}, - {0x0001ee79, 0x0001ee7c, 1}, - {0x0001ee7e, 0x0001ee80, 2}, - {0x0001ee81, 0x0001ee89, 1}, - {0x0001ee8b, 0x0001ee9b, 1}, - {0x0001eea1, 0x0001eea3, 1}, - {0x0001eea5, 0x0001eea9, 1}, - {0x0001eeab, 0x0001eebb, 1}, - {0x0001eef0, 0x0001eef1, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0be, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0df, 1}, - {0x0001f100, 0x0001f10a, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f16b, 1}, - {0x0001f170, 0x0001f19a, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23a, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f320, 1}, - {0x0001f330, 0x0001f335, 1}, - {0x0001f337, 0x0001f37c, 1}, - {0x0001f380, 0x0001f393, 1}, - {0x0001f3a0, 0x0001f3c4, 1}, - {0x0001f3c6, 0x0001f3ca, 1}, - {0x0001f3e0, 0x0001f3f0, 1}, - {0x0001f400, 0x0001f43e, 1}, - {0x0001f440, 0x0001f442, 2}, - {0x0001f443, 0x0001f4f7, 1}, - {0x0001f4f9, 0x0001f4fc, 1}, - {0x0001f500, 0x0001f53d, 1}, - {0x0001f540, 0x0001f543, 1}, - {0x0001f550, 0x0001f567, 1}, - {0x0001f5fb, 0x0001f640, 1}, - {0x0001f645, 0x0001f64f, 1}, - {0x0001f680, 0x0001f6c5, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 3812 bytes (3 KiB) -var assigned6_0_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037e, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x0527, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x0603, 1}, - {0x0606, 0x061b, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x0900, 162}, - {0x0901, 0x0977, 1}, - {0x0979, 0x097f, 1}, - {0x0981, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0aef, 1}, - {0x0af1, 0x0b01, 16}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c01, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c33, 1}, - {0x0c35, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c82, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d02, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4e, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edd, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10d0, 0x10fc, 1}, - {0x1100, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f0, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191c, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1baa, 1}, - {0x1bae, 0x1bb9, 1}, - {0x1bc0, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cd0, 0x1cf2, 1}, - {0x1d00, 0x1de6, 1}, - {0x1dfc, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x206a, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20b9, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x2189, 1}, - {0x2190, 0x23f3, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x26ff, 1}, - {0x2701, 0x27ca, 1}, - {0x27cc, 0x27ce, 2}, - {0x27cf, 0x2b4c, 1}, - {0x2b50, 0x2b59, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf1, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d30, 0x2d65, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e31, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fcb, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa673, 1}, - {0xa67c, 0xa697, 1}, - {0xa6a0, 0xa6f7, 1}, - {0xa700, 0xa78e, 1}, - {0xa790, 0xa791, 1}, - {0xa7a0, 0xa7a9, 1}, - {0xa7fa, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fb, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9df, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaa7b, 1}, - {0xaa80, 0xaac2, 1}, - {0xaadb, 0xaadf, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xabc0, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa2d, 1}, - {0xfa30, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe26, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018a, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101d0, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x00010300, 0x0001031e, 1}, - {0x00010320, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001085f, 1}, - {0x00010900, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010a00, 193}, - {0x00010a01, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a7f, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b7f, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x00011080, 0x000110c1, 1}, - {0x00012000, 0x0001236e, 1}, - {0x00012400, 0x00012462, 1}, - {0x00012470, 0x00012473, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00016800, 0x00016a38, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0be, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0df, 1}, - {0x0001f100, 0x0001f10a, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f169, 1}, - {0x0001f170, 0x0001f19a, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23a, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f320, 1}, - {0x0001f330, 0x0001f335, 1}, - {0x0001f337, 0x0001f37c, 1}, - {0x0001f380, 0x0001f393, 1}, - {0x0001f3a0, 0x0001f3c4, 1}, - {0x0001f3c6, 0x0001f3ca, 1}, - {0x0001f3e0, 0x0001f3f0, 1}, - {0x0001f400, 0x0001f43e, 1}, - {0x0001f440, 0x0001f442, 2}, - {0x0001f443, 0x0001f4f7, 1}, - {0x0001f4f9, 0x0001f4fc, 1}, - {0x0001f500, 0x0001f53d, 1}, - {0x0001f550, 0x0001f567, 1}, - {0x0001f5fb, 0x0001f5ff, 1}, - {0x0001f601, 0x0001f610, 1}, - {0x0001f612, 0x0001f614, 1}, - {0x0001f616, 0x0001f61c, 2}, - {0x0001f61d, 0x0001f61e, 1}, - {0x0001f620, 0x0001f625, 1}, - {0x0001f628, 0x0001f62b, 1}, - {0x0001f62d, 0x0001f630, 3}, - {0x0001f631, 0x0001f633, 1}, - {0x0001f635, 0x0001f640, 1}, - {0x0001f645, 0x0001f64f, 1}, - {0x0001f680, 0x0001f6c5, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 4898 bytes (4 KiB) -var assigned7_0_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037f, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x052f, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x058d, 0x058f, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x061c, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x08a0, 66}, - {0x08a1, 0x08b2, 1}, - {0x08e4, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0af1, 1}, - {0x0b01, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c00, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c59, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c81, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d01, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4e, 1}, - {0x0d57, 0x0d60, 9}, - {0x0d61, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0de6, 0x0def, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edf, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10c7, 0x10cd, 6}, - {0x10d0, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f4, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f8, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191e, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1ab0, 0x1abe, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cc0, 0x1cc7, 1}, - {0x1cd0, 0x1cf6, 1}, - {0x1cf8, 0x1cf9, 1}, - {0x1d00, 0x1df5, 1}, - {0x1dfc, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x2066, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20bd, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x2189, 1}, - {0x2190, 0x23fa, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x2b73, 1}, - {0x2b76, 0x2b95, 1}, - {0x2b98, 0x2bb9, 1}, - {0x2bbd, 0x2bc8, 1}, - {0x2bca, 0x2bd1, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf3, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d27, 0x2d2d, 6}, - {0x2d30, 0x2d67, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e42, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fcc, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa69d, 1}, - {0xa69f, 0xa6f7, 1}, - {0xa700, 0xa78e, 1}, - {0xa790, 0xa7ad, 1}, - {0xa7b0, 0xa7b1, 1}, - {0xa7f7, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fb, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9fe, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaac2, 1}, - {0xaadb, 0xaaf6, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xab30, 0xab5f, 1}, - {0xab64, 0xab65, 1}, - {0xabc0, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe2d, 1}, - {0xfe30, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018c, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101a0, 0x000101d0, 48}, - {0x000101d1, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x000102e0, 0x000102fb, 1}, - {0x00010300, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010350, 0x0001037a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010500, 0x00010527, 1}, - {0x00010530, 0x00010563, 1}, - {0x0001056f, 0x00010600, 145}, - {0x00010601, 0x00010736, 1}, - {0x00010740, 0x00010755, 1}, - {0x00010760, 0x00010767, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001089e, 1}, - {0x000108a7, 0x000108af, 1}, - {0x00010900, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010980, 65}, - {0x00010981, 0x000109b7, 1}, - {0x000109be, 0x000109bf, 1}, - {0x00010a00, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a9f, 1}, - {0x00010ac0, 0x00010ae6, 1}, - {0x00010aeb, 0x00010af6, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b91, 1}, - {0x00010b99, 0x00010b9c, 1}, - {0x00010ba9, 0x00010baf, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x0001107f, 0x000110c1, 1}, - {0x000110d0, 0x000110e8, 1}, - {0x000110f0, 0x000110f9, 1}, - {0x00011100, 0x00011134, 1}, - {0x00011136, 0x00011143, 1}, - {0x00011150, 0x00011176, 1}, - {0x00011180, 0x000111c8, 1}, - {0x000111cd, 0x000111d0, 3}, - {0x000111d1, 0x000111da, 1}, - {0x000111e1, 0x000111f4, 1}, - {0x00011200, 0x00011211, 1}, - {0x00011213, 0x0001123d, 1}, - {0x000112b0, 0x000112ea, 1}, - {0x000112f0, 0x000112f9, 1}, - {0x00011301, 0x00011303, 1}, - {0x00011305, 0x0001130c, 1}, - {0x0001130f, 0x00011310, 1}, - {0x00011313, 0x00011328, 1}, - {0x0001132a, 0x00011330, 1}, - {0x00011332, 0x00011333, 1}, - {0x00011335, 0x00011339, 1}, - {0x0001133c, 0x00011344, 1}, - {0x00011347, 0x00011348, 1}, - {0x0001134b, 0x0001134d, 1}, - {0x00011357, 0x0001135d, 6}, - {0x0001135e, 0x00011363, 1}, - {0x00011366, 0x0001136c, 1}, - {0x00011370, 0x00011374, 1}, - {0x00011480, 0x000114c7, 1}, - {0x000114d0, 0x000114d9, 1}, - {0x00011580, 0x000115b5, 1}, - {0x000115b8, 0x000115c9, 1}, - {0x00011600, 0x00011644, 1}, - {0x00011650, 0x00011659, 1}, - {0x00011680, 0x000116b7, 1}, - {0x000116c0, 0x000116c9, 1}, - {0x000118a0, 0x000118f2, 1}, - {0x000118ff, 0x00011ac0, 449}, - {0x00011ac1, 0x00011af8, 1}, - {0x00012000, 0x00012398, 1}, - {0x00012400, 0x0001246e, 1}, - {0x00012470, 0x00012474, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00016800, 0x00016a38, 1}, - {0x00016a40, 0x00016a5e, 1}, - {0x00016a60, 0x00016a69, 1}, - {0x00016a6e, 0x00016a6f, 1}, - {0x00016ad0, 0x00016aed, 1}, - {0x00016af0, 0x00016af5, 1}, - {0x00016b00, 0x00016b45, 1}, - {0x00016b50, 0x00016b59, 1}, - {0x00016b5b, 0x00016b61, 1}, - {0x00016b63, 0x00016b77, 1}, - {0x00016b7d, 0x00016b8f, 1}, - {0x00016f00, 0x00016f44, 1}, - {0x00016f50, 0x00016f7e, 1}, - {0x00016f8f, 0x00016f9f, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001bc00, 0x0001bc6a, 1}, - {0x0001bc70, 0x0001bc7c, 1}, - {0x0001bc80, 0x0001bc88, 1}, - {0x0001bc90, 0x0001bc99, 1}, - {0x0001bc9c, 0x0001bca3, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1dd, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001d7ff, 1}, - {0x0001e800, 0x0001e8c4, 1}, - {0x0001e8c7, 0x0001e8d6, 1}, - {0x0001ee00, 0x0001ee03, 1}, - {0x0001ee05, 0x0001ee1f, 1}, - {0x0001ee21, 0x0001ee22, 1}, - {0x0001ee24, 0x0001ee27, 3}, - {0x0001ee29, 0x0001ee32, 1}, - {0x0001ee34, 0x0001ee37, 1}, - {0x0001ee39, 0x0001ee3b, 2}, - {0x0001ee42, 0x0001ee47, 5}, - {0x0001ee49, 0x0001ee4d, 2}, - {0x0001ee4e, 0x0001ee4f, 1}, - {0x0001ee51, 0x0001ee52, 1}, - {0x0001ee54, 0x0001ee57, 3}, - {0x0001ee59, 0x0001ee61, 2}, - {0x0001ee62, 0x0001ee64, 2}, - {0x0001ee67, 0x0001ee6a, 1}, - {0x0001ee6c, 0x0001ee72, 1}, - {0x0001ee74, 0x0001ee77, 1}, - {0x0001ee79, 0x0001ee7c, 1}, - {0x0001ee7e, 0x0001ee80, 2}, - {0x0001ee81, 0x0001ee89, 1}, - {0x0001ee8b, 0x0001ee9b, 1}, - {0x0001eea1, 0x0001eea3, 1}, - {0x0001eea5, 0x0001eea9, 1}, - {0x0001eeab, 0x0001eebb, 1}, - {0x0001eef0, 0x0001eef1, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0bf, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0f5, 1}, - {0x0001f100, 0x0001f10c, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f16b, 1}, - {0x0001f170, 0x0001f19a, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23a, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f32c, 1}, - {0x0001f330, 0x0001f37d, 1}, - {0x0001f380, 0x0001f3ce, 1}, - {0x0001f3d4, 0x0001f3f7, 1}, - {0x0001f400, 0x0001f4fe, 1}, - {0x0001f500, 0x0001f54a, 1}, - {0x0001f550, 0x0001f579, 1}, - {0x0001f57b, 0x0001f5a3, 1}, - {0x0001f5a5, 0x0001f642, 1}, - {0x0001f645, 0x0001f6cf, 1}, - {0x0001f6e0, 0x0001f6ec, 1}, - {0x0001f6f0, 0x0001f6f3, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x0001f780, 0x0001f7d4, 1}, - {0x0001f800, 0x0001f80b, 1}, - {0x0001f810, 0x0001f847, 1}, - {0x0001f850, 0x0001f859, 1}, - {0x0001f860, 0x0001f887, 1}, - {0x0001f890, 0x0001f8ad, 1}, - {0x00020000, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 5048 bytes (4 KiB) -var assigned8_0_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037f, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x052f, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x058d, 0x058f, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x061c, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x08a0, 66}, - {0x08a1, 0x08b4, 1}, - {0x08e3, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0af1, 1}, - {0x0af9, 0x0b01, 8}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c00, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c5a, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c7f, 1}, - {0x0c81, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d01, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4e, 1}, - {0x0d57, 0x0d5f, 8}, - {0x0d60, 0x0d63, 1}, - {0x0d66, 0x0d75, 1}, - {0x0d79, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0de6, 0x0def, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edf, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10c7, 0x10cd, 6}, - {0x10d0, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f5, 1}, - {0x13f8, 0x13fd, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f8, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191e, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1ab0, 0x1abe, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c7f, 1}, - {0x1cc0, 0x1cc7, 1}, - {0x1cd0, 0x1cf6, 1}, - {0x1cf8, 0x1cf9, 1}, - {0x1d00, 0x1df5, 1}, - {0x1dfc, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x2066, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20be, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x218b, 1}, - {0x2190, 0x23fa, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x2b73, 1}, - {0x2b76, 0x2b95, 1}, - {0x2b98, 0x2bb9, 1}, - {0x2bbd, 0x2bc8, 1}, - {0x2bca, 0x2bd1, 1}, - {0x2bec, 0x2bef, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf3, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d27, 0x2d2d, 6}, - {0x2d30, 0x2d67, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e42, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fd5, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa6f7, 1}, - {0xa700, 0xa7ad, 1}, - {0xa7b0, 0xa7b7, 1}, - {0xa7f7, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c4, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fd, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9fe, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaac2, 1}, - {0xaadb, 0xaaf6, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xab30, 0xab65, 1}, - {0xab70, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018c, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101a0, 0x000101d0, 48}, - {0x000101d1, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x000102e0, 0x000102fb, 1}, - {0x00010300, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010350, 0x0001037a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x00010500, 0x00010527, 1}, - {0x00010530, 0x00010563, 1}, - {0x0001056f, 0x00010600, 145}, - {0x00010601, 0x00010736, 1}, - {0x00010740, 0x00010755, 1}, - {0x00010760, 0x00010767, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001089e, 1}, - {0x000108a7, 0x000108af, 1}, - {0x000108e0, 0x000108f2, 1}, - {0x000108f4, 0x000108f5, 1}, - {0x000108fb, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010980, 65}, - {0x00010981, 0x000109b7, 1}, - {0x000109bc, 0x000109cf, 1}, - {0x000109d2, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a9f, 1}, - {0x00010ac0, 0x00010ae6, 1}, - {0x00010aeb, 0x00010af6, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b91, 1}, - {0x00010b99, 0x00010b9c, 1}, - {0x00010ba9, 0x00010baf, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010c80, 0x00010cb2, 1}, - {0x00010cc0, 0x00010cf2, 1}, - {0x00010cfa, 0x00010cff, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x0001107f, 0x000110c1, 1}, - {0x000110d0, 0x000110e8, 1}, - {0x000110f0, 0x000110f9, 1}, - {0x00011100, 0x00011134, 1}, - {0x00011136, 0x00011143, 1}, - {0x00011150, 0x00011176, 1}, - {0x00011180, 0x000111cd, 1}, - {0x000111d0, 0x000111df, 1}, - {0x000111e1, 0x000111f4, 1}, - {0x00011200, 0x00011211, 1}, - {0x00011213, 0x0001123d, 1}, - {0x00011280, 0x00011286, 1}, - {0x00011288, 0x0001128a, 2}, - {0x0001128b, 0x0001128d, 1}, - {0x0001128f, 0x0001129d, 1}, - {0x0001129f, 0x000112a9, 1}, - {0x000112b0, 0x000112ea, 1}, - {0x000112f0, 0x000112f9, 1}, - {0x00011300, 0x00011303, 1}, - {0x00011305, 0x0001130c, 1}, - {0x0001130f, 0x00011310, 1}, - {0x00011313, 0x00011328, 1}, - {0x0001132a, 0x00011330, 1}, - {0x00011332, 0x00011333, 1}, - {0x00011335, 0x00011339, 1}, - {0x0001133c, 0x00011344, 1}, - {0x00011347, 0x00011348, 1}, - {0x0001134b, 0x0001134d, 1}, - {0x00011350, 0x00011357, 7}, - {0x0001135d, 0x00011363, 1}, - {0x00011366, 0x0001136c, 1}, - {0x00011370, 0x00011374, 1}, - {0x00011480, 0x000114c7, 1}, - {0x000114d0, 0x000114d9, 1}, - {0x00011580, 0x000115b5, 1}, - {0x000115b8, 0x000115dd, 1}, - {0x00011600, 0x00011644, 1}, - {0x00011650, 0x00011659, 1}, - {0x00011680, 0x000116b7, 1}, - {0x000116c0, 0x000116c9, 1}, - {0x00011700, 0x00011719, 1}, - {0x0001171d, 0x0001172b, 1}, - {0x00011730, 0x0001173f, 1}, - {0x000118a0, 0x000118f2, 1}, - {0x000118ff, 0x00011ac0, 449}, - {0x00011ac1, 0x00011af8, 1}, - {0x00012000, 0x00012399, 1}, - {0x00012400, 0x0001246e, 1}, - {0x00012470, 0x00012474, 1}, - {0x00012480, 0x00012543, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00014400, 0x00014646, 1}, - {0x00016800, 0x00016a38, 1}, - {0x00016a40, 0x00016a5e, 1}, - {0x00016a60, 0x00016a69, 1}, - {0x00016a6e, 0x00016a6f, 1}, - {0x00016ad0, 0x00016aed, 1}, - {0x00016af0, 0x00016af5, 1}, - {0x00016b00, 0x00016b45, 1}, - {0x00016b50, 0x00016b59, 1}, - {0x00016b5b, 0x00016b61, 1}, - {0x00016b63, 0x00016b77, 1}, - {0x00016b7d, 0x00016b8f, 1}, - {0x00016f00, 0x00016f44, 1}, - {0x00016f50, 0x00016f7e, 1}, - {0x00016f8f, 0x00016f9f, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001bc00, 0x0001bc6a, 1}, - {0x0001bc70, 0x0001bc7c, 1}, - {0x0001bc80, 0x0001bc88, 1}, - {0x0001bc90, 0x0001bc99, 1}, - {0x0001bc9c, 0x0001bca3, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1e8, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001da8b, 1}, - {0x0001da9b, 0x0001da9f, 1}, - {0x0001daa1, 0x0001daaf, 1}, - {0x0001e800, 0x0001e8c4, 1}, - {0x0001e8c7, 0x0001e8d6, 1}, - {0x0001ee00, 0x0001ee03, 1}, - {0x0001ee05, 0x0001ee1f, 1}, - {0x0001ee21, 0x0001ee22, 1}, - {0x0001ee24, 0x0001ee27, 3}, - {0x0001ee29, 0x0001ee32, 1}, - {0x0001ee34, 0x0001ee37, 1}, - {0x0001ee39, 0x0001ee3b, 2}, - {0x0001ee42, 0x0001ee47, 5}, - {0x0001ee49, 0x0001ee4d, 2}, - {0x0001ee4e, 0x0001ee4f, 1}, - {0x0001ee51, 0x0001ee52, 1}, - {0x0001ee54, 0x0001ee57, 3}, - {0x0001ee59, 0x0001ee61, 2}, - {0x0001ee62, 0x0001ee64, 2}, - {0x0001ee67, 0x0001ee6a, 1}, - {0x0001ee6c, 0x0001ee72, 1}, - {0x0001ee74, 0x0001ee77, 1}, - {0x0001ee79, 0x0001ee7c, 1}, - {0x0001ee7e, 0x0001ee80, 2}, - {0x0001ee81, 0x0001ee89, 1}, - {0x0001ee8b, 0x0001ee9b, 1}, - {0x0001eea1, 0x0001eea3, 1}, - {0x0001eea5, 0x0001eea9, 1}, - {0x0001eeab, 0x0001eebb, 1}, - {0x0001eef0, 0x0001eef1, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0bf, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0f5, 1}, - {0x0001f100, 0x0001f10c, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f16b, 1}, - {0x0001f170, 0x0001f19a, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23a, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f579, 1}, - {0x0001f57b, 0x0001f5a3, 1}, - {0x0001f5a5, 0x0001f6d0, 1}, - {0x0001f6e0, 0x0001f6ec, 1}, - {0x0001f6f0, 0x0001f6f3, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x0001f780, 0x0001f7d4, 1}, - {0x0001f800, 0x0001f80b, 1}, - {0x0001f810, 0x0001f847, 1}, - {0x0001f850, 0x0001f859, 1}, - {0x0001f860, 0x0001f887, 1}, - {0x0001f890, 0x0001f8ad, 1}, - {0x0001f910, 0x0001f918, 1}, - {0x0001f980, 0x0001f984, 1}, - {0x0001f9c0, 0x00020000, 1600}, - {0x00020001, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002b820, 0x0002cea1, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// size 5348 bytes (5 KiB) -var assigned9_0_0 = &unicode.RangeTable{ - R16: []unicode.Range16{ - {0x0000, 0x0377, 1}, - {0x037a, 0x037f, 1}, - {0x0384, 0x038a, 1}, - {0x038c, 0x038e, 2}, - {0x038f, 0x03a1, 1}, - {0x03a3, 0x052f, 1}, - {0x0531, 0x0556, 1}, - {0x0559, 0x055f, 1}, - {0x0561, 0x0587, 1}, - {0x0589, 0x058a, 1}, - {0x058d, 0x058f, 1}, - {0x0591, 0x05c7, 1}, - {0x05d0, 0x05ea, 1}, - {0x05f0, 0x05f4, 1}, - {0x0600, 0x061c, 1}, - {0x061e, 0x070d, 1}, - {0x070f, 0x074a, 1}, - {0x074d, 0x07b1, 1}, - {0x07c0, 0x07fa, 1}, - {0x0800, 0x082d, 1}, - {0x0830, 0x083e, 1}, - {0x0840, 0x085b, 1}, - {0x085e, 0x08a0, 66}, - {0x08a1, 0x08b4, 1}, - {0x08b6, 0x08bd, 1}, - {0x08d4, 0x0983, 1}, - {0x0985, 0x098c, 1}, - {0x098f, 0x0990, 1}, - {0x0993, 0x09a8, 1}, - {0x09aa, 0x09b0, 1}, - {0x09b2, 0x09b6, 4}, - {0x09b7, 0x09b9, 1}, - {0x09bc, 0x09c4, 1}, - {0x09c7, 0x09c8, 1}, - {0x09cb, 0x09ce, 1}, - {0x09d7, 0x09dc, 5}, - {0x09dd, 0x09df, 2}, - {0x09e0, 0x09e3, 1}, - {0x09e6, 0x09fb, 1}, - {0x0a01, 0x0a03, 1}, - {0x0a05, 0x0a0a, 1}, - {0x0a0f, 0x0a10, 1}, - {0x0a13, 0x0a28, 1}, - {0x0a2a, 0x0a30, 1}, - {0x0a32, 0x0a33, 1}, - {0x0a35, 0x0a36, 1}, - {0x0a38, 0x0a39, 1}, - {0x0a3c, 0x0a3e, 2}, - {0x0a3f, 0x0a42, 1}, - {0x0a47, 0x0a48, 1}, - {0x0a4b, 0x0a4d, 1}, - {0x0a51, 0x0a59, 8}, - {0x0a5a, 0x0a5c, 1}, - {0x0a5e, 0x0a66, 8}, - {0x0a67, 0x0a75, 1}, - {0x0a81, 0x0a83, 1}, - {0x0a85, 0x0a8d, 1}, - {0x0a8f, 0x0a91, 1}, - {0x0a93, 0x0aa8, 1}, - {0x0aaa, 0x0ab0, 1}, - {0x0ab2, 0x0ab3, 1}, - {0x0ab5, 0x0ab9, 1}, - {0x0abc, 0x0ac5, 1}, - {0x0ac7, 0x0ac9, 1}, - {0x0acb, 0x0acd, 1}, - {0x0ad0, 0x0ae0, 16}, - {0x0ae1, 0x0ae3, 1}, - {0x0ae6, 0x0af1, 1}, - {0x0af9, 0x0b01, 8}, - {0x0b02, 0x0b03, 1}, - {0x0b05, 0x0b0c, 1}, - {0x0b0f, 0x0b10, 1}, - {0x0b13, 0x0b28, 1}, - {0x0b2a, 0x0b30, 1}, - {0x0b32, 0x0b33, 1}, - {0x0b35, 0x0b39, 1}, - {0x0b3c, 0x0b44, 1}, - {0x0b47, 0x0b48, 1}, - {0x0b4b, 0x0b4d, 1}, - {0x0b56, 0x0b57, 1}, - {0x0b5c, 0x0b5d, 1}, - {0x0b5f, 0x0b63, 1}, - {0x0b66, 0x0b77, 1}, - {0x0b82, 0x0b83, 1}, - {0x0b85, 0x0b8a, 1}, - {0x0b8e, 0x0b90, 1}, - {0x0b92, 0x0b95, 1}, - {0x0b99, 0x0b9a, 1}, - {0x0b9c, 0x0b9e, 2}, - {0x0b9f, 0x0ba3, 4}, - {0x0ba4, 0x0ba8, 4}, - {0x0ba9, 0x0baa, 1}, - {0x0bae, 0x0bb9, 1}, - {0x0bbe, 0x0bc2, 1}, - {0x0bc6, 0x0bc8, 1}, - {0x0bca, 0x0bcd, 1}, - {0x0bd0, 0x0bd7, 7}, - {0x0be6, 0x0bfa, 1}, - {0x0c00, 0x0c03, 1}, - {0x0c05, 0x0c0c, 1}, - {0x0c0e, 0x0c10, 1}, - {0x0c12, 0x0c28, 1}, - {0x0c2a, 0x0c39, 1}, - {0x0c3d, 0x0c44, 1}, - {0x0c46, 0x0c48, 1}, - {0x0c4a, 0x0c4d, 1}, - {0x0c55, 0x0c56, 1}, - {0x0c58, 0x0c5a, 1}, - {0x0c60, 0x0c63, 1}, - {0x0c66, 0x0c6f, 1}, - {0x0c78, 0x0c83, 1}, - {0x0c85, 0x0c8c, 1}, - {0x0c8e, 0x0c90, 1}, - {0x0c92, 0x0ca8, 1}, - {0x0caa, 0x0cb3, 1}, - {0x0cb5, 0x0cb9, 1}, - {0x0cbc, 0x0cc4, 1}, - {0x0cc6, 0x0cc8, 1}, - {0x0cca, 0x0ccd, 1}, - {0x0cd5, 0x0cd6, 1}, - {0x0cde, 0x0ce0, 2}, - {0x0ce1, 0x0ce3, 1}, - {0x0ce6, 0x0cef, 1}, - {0x0cf1, 0x0cf2, 1}, - {0x0d01, 0x0d03, 1}, - {0x0d05, 0x0d0c, 1}, - {0x0d0e, 0x0d10, 1}, - {0x0d12, 0x0d3a, 1}, - {0x0d3d, 0x0d44, 1}, - {0x0d46, 0x0d48, 1}, - {0x0d4a, 0x0d4f, 1}, - {0x0d54, 0x0d63, 1}, - {0x0d66, 0x0d7f, 1}, - {0x0d82, 0x0d83, 1}, - {0x0d85, 0x0d96, 1}, - {0x0d9a, 0x0db1, 1}, - {0x0db3, 0x0dbb, 1}, - {0x0dbd, 0x0dc0, 3}, - {0x0dc1, 0x0dc6, 1}, - {0x0dca, 0x0dcf, 5}, - {0x0dd0, 0x0dd4, 1}, - {0x0dd6, 0x0dd8, 2}, - {0x0dd9, 0x0ddf, 1}, - {0x0de6, 0x0def, 1}, - {0x0df2, 0x0df4, 1}, - {0x0e01, 0x0e3a, 1}, - {0x0e3f, 0x0e5b, 1}, - {0x0e81, 0x0e82, 1}, - {0x0e84, 0x0e87, 3}, - {0x0e88, 0x0e8a, 2}, - {0x0e8d, 0x0e94, 7}, - {0x0e95, 0x0e97, 1}, - {0x0e99, 0x0e9f, 1}, - {0x0ea1, 0x0ea3, 1}, - {0x0ea5, 0x0ea7, 2}, - {0x0eaa, 0x0eab, 1}, - {0x0ead, 0x0eb9, 1}, - {0x0ebb, 0x0ebd, 1}, - {0x0ec0, 0x0ec4, 1}, - {0x0ec6, 0x0ec8, 2}, - {0x0ec9, 0x0ecd, 1}, - {0x0ed0, 0x0ed9, 1}, - {0x0edc, 0x0edf, 1}, - {0x0f00, 0x0f47, 1}, - {0x0f49, 0x0f6c, 1}, - {0x0f71, 0x0f97, 1}, - {0x0f99, 0x0fbc, 1}, - {0x0fbe, 0x0fcc, 1}, - {0x0fce, 0x0fda, 1}, - {0x1000, 0x10c5, 1}, - {0x10c7, 0x10cd, 6}, - {0x10d0, 0x1248, 1}, - {0x124a, 0x124d, 1}, - {0x1250, 0x1256, 1}, - {0x1258, 0x125a, 2}, - {0x125b, 0x125d, 1}, - {0x1260, 0x1288, 1}, - {0x128a, 0x128d, 1}, - {0x1290, 0x12b0, 1}, - {0x12b2, 0x12b5, 1}, - {0x12b8, 0x12be, 1}, - {0x12c0, 0x12c2, 2}, - {0x12c3, 0x12c5, 1}, - {0x12c8, 0x12d6, 1}, - {0x12d8, 0x1310, 1}, - {0x1312, 0x1315, 1}, - {0x1318, 0x135a, 1}, - {0x135d, 0x137c, 1}, - {0x1380, 0x1399, 1}, - {0x13a0, 0x13f5, 1}, - {0x13f8, 0x13fd, 1}, - {0x1400, 0x169c, 1}, - {0x16a0, 0x16f8, 1}, - {0x1700, 0x170c, 1}, - {0x170e, 0x1714, 1}, - {0x1720, 0x1736, 1}, - {0x1740, 0x1753, 1}, - {0x1760, 0x176c, 1}, - {0x176e, 0x1770, 1}, - {0x1772, 0x1773, 1}, - {0x1780, 0x17dd, 1}, - {0x17e0, 0x17e9, 1}, - {0x17f0, 0x17f9, 1}, - {0x1800, 0x180e, 1}, - {0x1810, 0x1819, 1}, - {0x1820, 0x1877, 1}, - {0x1880, 0x18aa, 1}, - {0x18b0, 0x18f5, 1}, - {0x1900, 0x191e, 1}, - {0x1920, 0x192b, 1}, - {0x1930, 0x193b, 1}, - {0x1940, 0x1944, 4}, - {0x1945, 0x196d, 1}, - {0x1970, 0x1974, 1}, - {0x1980, 0x19ab, 1}, - {0x19b0, 0x19c9, 1}, - {0x19d0, 0x19da, 1}, - {0x19de, 0x1a1b, 1}, - {0x1a1e, 0x1a5e, 1}, - {0x1a60, 0x1a7c, 1}, - {0x1a7f, 0x1a89, 1}, - {0x1a90, 0x1a99, 1}, - {0x1aa0, 0x1aad, 1}, - {0x1ab0, 0x1abe, 1}, - {0x1b00, 0x1b4b, 1}, - {0x1b50, 0x1b7c, 1}, - {0x1b80, 0x1bf3, 1}, - {0x1bfc, 0x1c37, 1}, - {0x1c3b, 0x1c49, 1}, - {0x1c4d, 0x1c88, 1}, - {0x1cc0, 0x1cc7, 1}, - {0x1cd0, 0x1cf6, 1}, - {0x1cf8, 0x1cf9, 1}, - {0x1d00, 0x1df5, 1}, - {0x1dfb, 0x1f15, 1}, - {0x1f18, 0x1f1d, 1}, - {0x1f20, 0x1f45, 1}, - {0x1f48, 0x1f4d, 1}, - {0x1f50, 0x1f57, 1}, - {0x1f59, 0x1f5f, 2}, - {0x1f60, 0x1f7d, 1}, - {0x1f80, 0x1fb4, 1}, - {0x1fb6, 0x1fc4, 1}, - {0x1fc6, 0x1fd3, 1}, - {0x1fd6, 0x1fdb, 1}, - {0x1fdd, 0x1fef, 1}, - {0x1ff2, 0x1ff4, 1}, - {0x1ff6, 0x1ffe, 1}, - {0x2000, 0x2064, 1}, - {0x2066, 0x2071, 1}, - {0x2074, 0x208e, 1}, - {0x2090, 0x209c, 1}, - {0x20a0, 0x20be, 1}, - {0x20d0, 0x20f0, 1}, - {0x2100, 0x218b, 1}, - {0x2190, 0x23fe, 1}, - {0x2400, 0x2426, 1}, - {0x2440, 0x244a, 1}, - {0x2460, 0x2b73, 1}, - {0x2b76, 0x2b95, 1}, - {0x2b98, 0x2bb9, 1}, - {0x2bbd, 0x2bc8, 1}, - {0x2bca, 0x2bd1, 1}, - {0x2bec, 0x2bef, 1}, - {0x2c00, 0x2c2e, 1}, - {0x2c30, 0x2c5e, 1}, - {0x2c60, 0x2cf3, 1}, - {0x2cf9, 0x2d25, 1}, - {0x2d27, 0x2d2d, 6}, - {0x2d30, 0x2d67, 1}, - {0x2d6f, 0x2d70, 1}, - {0x2d7f, 0x2d96, 1}, - {0x2da0, 0x2da6, 1}, - {0x2da8, 0x2dae, 1}, - {0x2db0, 0x2db6, 1}, - {0x2db8, 0x2dbe, 1}, - {0x2dc0, 0x2dc6, 1}, - {0x2dc8, 0x2dce, 1}, - {0x2dd0, 0x2dd6, 1}, - {0x2dd8, 0x2dde, 1}, - {0x2de0, 0x2e44, 1}, - {0x2e80, 0x2e99, 1}, - {0x2e9b, 0x2ef3, 1}, - {0x2f00, 0x2fd5, 1}, - {0x2ff0, 0x2ffb, 1}, - {0x3000, 0x303f, 1}, - {0x3041, 0x3096, 1}, - {0x3099, 0x30ff, 1}, - {0x3105, 0x312d, 1}, - {0x3131, 0x318e, 1}, - {0x3190, 0x31ba, 1}, - {0x31c0, 0x31e3, 1}, - {0x31f0, 0x321e, 1}, - {0x3220, 0x32fe, 1}, - {0x3300, 0x4db5, 1}, - {0x4dc0, 0x9fd5, 1}, - {0xa000, 0xa48c, 1}, - {0xa490, 0xa4c6, 1}, - {0xa4d0, 0xa62b, 1}, - {0xa640, 0xa6f7, 1}, - {0xa700, 0xa7ae, 1}, - {0xa7b0, 0xa7b7, 1}, - {0xa7f7, 0xa82b, 1}, - {0xa830, 0xa839, 1}, - {0xa840, 0xa877, 1}, - {0xa880, 0xa8c5, 1}, - {0xa8ce, 0xa8d9, 1}, - {0xa8e0, 0xa8fd, 1}, - {0xa900, 0xa953, 1}, - {0xa95f, 0xa97c, 1}, - {0xa980, 0xa9cd, 1}, - {0xa9cf, 0xa9d9, 1}, - {0xa9de, 0xa9fe, 1}, - {0xaa00, 0xaa36, 1}, - {0xaa40, 0xaa4d, 1}, - {0xaa50, 0xaa59, 1}, - {0xaa5c, 0xaac2, 1}, - {0xaadb, 0xaaf6, 1}, - {0xab01, 0xab06, 1}, - {0xab09, 0xab0e, 1}, - {0xab11, 0xab16, 1}, - {0xab20, 0xab26, 1}, - {0xab28, 0xab2e, 1}, - {0xab30, 0xab65, 1}, - {0xab70, 0xabed, 1}, - {0xabf0, 0xabf9, 1}, - {0xac00, 0xd7a3, 1}, - {0xd7b0, 0xd7c6, 1}, - {0xd7cb, 0xd7fb, 1}, - {0xd800, 0xfa6d, 1}, - {0xfa70, 0xfad9, 1}, - {0xfb00, 0xfb06, 1}, - {0xfb13, 0xfb17, 1}, - {0xfb1d, 0xfb36, 1}, - {0xfb38, 0xfb3c, 1}, - {0xfb3e, 0xfb40, 2}, - {0xfb41, 0xfb43, 2}, - {0xfb44, 0xfb46, 2}, - {0xfb47, 0xfbc1, 1}, - {0xfbd3, 0xfd3f, 1}, - {0xfd50, 0xfd8f, 1}, - {0xfd92, 0xfdc7, 1}, - {0xfdf0, 0xfdfd, 1}, - {0xfe00, 0xfe19, 1}, - {0xfe20, 0xfe52, 1}, - {0xfe54, 0xfe66, 1}, - {0xfe68, 0xfe6b, 1}, - {0xfe70, 0xfe74, 1}, - {0xfe76, 0xfefc, 1}, - {0xfeff, 0xff01, 2}, - {0xff02, 0xffbe, 1}, - {0xffc2, 0xffc7, 1}, - {0xffca, 0xffcf, 1}, - {0xffd2, 0xffd7, 1}, - {0xffda, 0xffdc, 1}, - {0xffe0, 0xffe6, 1}, - {0xffe8, 0xffee, 1}, - {0xfff9, 0xfffd, 1}, - }, - R32: []unicode.Range32{ - {0x00010000, 0x0001000b, 1}, - {0x0001000d, 0x00010026, 1}, - {0x00010028, 0x0001003a, 1}, - {0x0001003c, 0x0001003d, 1}, - {0x0001003f, 0x0001004d, 1}, - {0x00010050, 0x0001005d, 1}, - {0x00010080, 0x000100fa, 1}, - {0x00010100, 0x00010102, 1}, - {0x00010107, 0x00010133, 1}, - {0x00010137, 0x0001018e, 1}, - {0x00010190, 0x0001019b, 1}, - {0x000101a0, 0x000101d0, 48}, - {0x000101d1, 0x000101fd, 1}, - {0x00010280, 0x0001029c, 1}, - {0x000102a0, 0x000102d0, 1}, - {0x000102e0, 0x000102fb, 1}, - {0x00010300, 0x00010323, 1}, - {0x00010330, 0x0001034a, 1}, - {0x00010350, 0x0001037a, 1}, - {0x00010380, 0x0001039d, 1}, - {0x0001039f, 0x000103c3, 1}, - {0x000103c8, 0x000103d5, 1}, - {0x00010400, 0x0001049d, 1}, - {0x000104a0, 0x000104a9, 1}, - {0x000104b0, 0x000104d3, 1}, - {0x000104d8, 0x000104fb, 1}, - {0x00010500, 0x00010527, 1}, - {0x00010530, 0x00010563, 1}, - {0x0001056f, 0x00010600, 145}, - {0x00010601, 0x00010736, 1}, - {0x00010740, 0x00010755, 1}, - {0x00010760, 0x00010767, 1}, - {0x00010800, 0x00010805, 1}, - {0x00010808, 0x0001080a, 2}, - {0x0001080b, 0x00010835, 1}, - {0x00010837, 0x00010838, 1}, - {0x0001083c, 0x0001083f, 3}, - {0x00010840, 0x00010855, 1}, - {0x00010857, 0x0001089e, 1}, - {0x000108a7, 0x000108af, 1}, - {0x000108e0, 0x000108f2, 1}, - {0x000108f4, 0x000108f5, 1}, - {0x000108fb, 0x0001091b, 1}, - {0x0001091f, 0x00010939, 1}, - {0x0001093f, 0x00010980, 65}, - {0x00010981, 0x000109b7, 1}, - {0x000109bc, 0x000109cf, 1}, - {0x000109d2, 0x00010a03, 1}, - {0x00010a05, 0x00010a06, 1}, - {0x00010a0c, 0x00010a13, 1}, - {0x00010a15, 0x00010a17, 1}, - {0x00010a19, 0x00010a33, 1}, - {0x00010a38, 0x00010a3a, 1}, - {0x00010a3f, 0x00010a47, 1}, - {0x00010a50, 0x00010a58, 1}, - {0x00010a60, 0x00010a9f, 1}, - {0x00010ac0, 0x00010ae6, 1}, - {0x00010aeb, 0x00010af6, 1}, - {0x00010b00, 0x00010b35, 1}, - {0x00010b39, 0x00010b55, 1}, - {0x00010b58, 0x00010b72, 1}, - {0x00010b78, 0x00010b91, 1}, - {0x00010b99, 0x00010b9c, 1}, - {0x00010ba9, 0x00010baf, 1}, - {0x00010c00, 0x00010c48, 1}, - {0x00010c80, 0x00010cb2, 1}, - {0x00010cc0, 0x00010cf2, 1}, - {0x00010cfa, 0x00010cff, 1}, - {0x00010e60, 0x00010e7e, 1}, - {0x00011000, 0x0001104d, 1}, - {0x00011052, 0x0001106f, 1}, - {0x0001107f, 0x000110c1, 1}, - {0x000110d0, 0x000110e8, 1}, - {0x000110f0, 0x000110f9, 1}, - {0x00011100, 0x00011134, 1}, - {0x00011136, 0x00011143, 1}, - {0x00011150, 0x00011176, 1}, - {0x00011180, 0x000111cd, 1}, - {0x000111d0, 0x000111df, 1}, - {0x000111e1, 0x000111f4, 1}, - {0x00011200, 0x00011211, 1}, - {0x00011213, 0x0001123e, 1}, - {0x00011280, 0x00011286, 1}, - {0x00011288, 0x0001128a, 2}, - {0x0001128b, 0x0001128d, 1}, - {0x0001128f, 0x0001129d, 1}, - {0x0001129f, 0x000112a9, 1}, - {0x000112b0, 0x000112ea, 1}, - {0x000112f0, 0x000112f9, 1}, - {0x00011300, 0x00011303, 1}, - {0x00011305, 0x0001130c, 1}, - {0x0001130f, 0x00011310, 1}, - {0x00011313, 0x00011328, 1}, - {0x0001132a, 0x00011330, 1}, - {0x00011332, 0x00011333, 1}, - {0x00011335, 0x00011339, 1}, - {0x0001133c, 0x00011344, 1}, - {0x00011347, 0x00011348, 1}, - {0x0001134b, 0x0001134d, 1}, - {0x00011350, 0x00011357, 7}, - {0x0001135d, 0x00011363, 1}, - {0x00011366, 0x0001136c, 1}, - {0x00011370, 0x00011374, 1}, - {0x00011400, 0x00011459, 1}, - {0x0001145b, 0x0001145d, 2}, - {0x00011480, 0x000114c7, 1}, - {0x000114d0, 0x000114d9, 1}, - {0x00011580, 0x000115b5, 1}, - {0x000115b8, 0x000115dd, 1}, - {0x00011600, 0x00011644, 1}, - {0x00011650, 0x00011659, 1}, - {0x00011660, 0x0001166c, 1}, - {0x00011680, 0x000116b7, 1}, - {0x000116c0, 0x000116c9, 1}, - {0x00011700, 0x00011719, 1}, - {0x0001171d, 0x0001172b, 1}, - {0x00011730, 0x0001173f, 1}, - {0x000118a0, 0x000118f2, 1}, - {0x000118ff, 0x00011ac0, 449}, - {0x00011ac1, 0x00011af8, 1}, - {0x00011c00, 0x00011c08, 1}, - {0x00011c0a, 0x00011c36, 1}, - {0x00011c38, 0x00011c45, 1}, - {0x00011c50, 0x00011c6c, 1}, - {0x00011c70, 0x00011c8f, 1}, - {0x00011c92, 0x00011ca7, 1}, - {0x00011ca9, 0x00011cb6, 1}, - {0x00012000, 0x00012399, 1}, - {0x00012400, 0x0001246e, 1}, - {0x00012470, 0x00012474, 1}, - {0x00012480, 0x00012543, 1}, - {0x00013000, 0x0001342e, 1}, - {0x00014400, 0x00014646, 1}, - {0x00016800, 0x00016a38, 1}, - {0x00016a40, 0x00016a5e, 1}, - {0x00016a60, 0x00016a69, 1}, - {0x00016a6e, 0x00016a6f, 1}, - {0x00016ad0, 0x00016aed, 1}, - {0x00016af0, 0x00016af5, 1}, - {0x00016b00, 0x00016b45, 1}, - {0x00016b50, 0x00016b59, 1}, - {0x00016b5b, 0x00016b61, 1}, - {0x00016b63, 0x00016b77, 1}, - {0x00016b7d, 0x00016b8f, 1}, - {0x00016f00, 0x00016f44, 1}, - {0x00016f50, 0x00016f7e, 1}, - {0x00016f8f, 0x00016f9f, 1}, - {0x00016fe0, 0x00017000, 32}, - {0x00017001, 0x000187ec, 1}, - {0x00018800, 0x00018af2, 1}, - {0x0001b000, 0x0001b001, 1}, - {0x0001bc00, 0x0001bc6a, 1}, - {0x0001bc70, 0x0001bc7c, 1}, - {0x0001bc80, 0x0001bc88, 1}, - {0x0001bc90, 0x0001bc99, 1}, - {0x0001bc9c, 0x0001bca3, 1}, - {0x0001d000, 0x0001d0f5, 1}, - {0x0001d100, 0x0001d126, 1}, - {0x0001d129, 0x0001d1e8, 1}, - {0x0001d200, 0x0001d245, 1}, - {0x0001d300, 0x0001d356, 1}, - {0x0001d360, 0x0001d371, 1}, - {0x0001d400, 0x0001d454, 1}, - {0x0001d456, 0x0001d49c, 1}, - {0x0001d49e, 0x0001d49f, 1}, - {0x0001d4a2, 0x0001d4a5, 3}, - {0x0001d4a6, 0x0001d4a9, 3}, - {0x0001d4aa, 0x0001d4ac, 1}, - {0x0001d4ae, 0x0001d4b9, 1}, - {0x0001d4bb, 0x0001d4bd, 2}, - {0x0001d4be, 0x0001d4c3, 1}, - {0x0001d4c5, 0x0001d505, 1}, - {0x0001d507, 0x0001d50a, 1}, - {0x0001d50d, 0x0001d514, 1}, - {0x0001d516, 0x0001d51c, 1}, - {0x0001d51e, 0x0001d539, 1}, - {0x0001d53b, 0x0001d53e, 1}, - {0x0001d540, 0x0001d544, 1}, - {0x0001d546, 0x0001d54a, 4}, - {0x0001d54b, 0x0001d550, 1}, - {0x0001d552, 0x0001d6a5, 1}, - {0x0001d6a8, 0x0001d7cb, 1}, - {0x0001d7ce, 0x0001da8b, 1}, - {0x0001da9b, 0x0001da9f, 1}, - {0x0001daa1, 0x0001daaf, 1}, - {0x0001e000, 0x0001e006, 1}, - {0x0001e008, 0x0001e018, 1}, - {0x0001e01b, 0x0001e021, 1}, - {0x0001e023, 0x0001e024, 1}, - {0x0001e026, 0x0001e02a, 1}, - {0x0001e800, 0x0001e8c4, 1}, - {0x0001e8c7, 0x0001e8d6, 1}, - {0x0001e900, 0x0001e94a, 1}, - {0x0001e950, 0x0001e959, 1}, - {0x0001e95e, 0x0001e95f, 1}, - {0x0001ee00, 0x0001ee03, 1}, - {0x0001ee05, 0x0001ee1f, 1}, - {0x0001ee21, 0x0001ee22, 1}, - {0x0001ee24, 0x0001ee27, 3}, - {0x0001ee29, 0x0001ee32, 1}, - {0x0001ee34, 0x0001ee37, 1}, - {0x0001ee39, 0x0001ee3b, 2}, - {0x0001ee42, 0x0001ee47, 5}, - {0x0001ee49, 0x0001ee4d, 2}, - {0x0001ee4e, 0x0001ee4f, 1}, - {0x0001ee51, 0x0001ee52, 1}, - {0x0001ee54, 0x0001ee57, 3}, - {0x0001ee59, 0x0001ee61, 2}, - {0x0001ee62, 0x0001ee64, 2}, - {0x0001ee67, 0x0001ee6a, 1}, - {0x0001ee6c, 0x0001ee72, 1}, - {0x0001ee74, 0x0001ee77, 1}, - {0x0001ee79, 0x0001ee7c, 1}, - {0x0001ee7e, 0x0001ee80, 2}, - {0x0001ee81, 0x0001ee89, 1}, - {0x0001ee8b, 0x0001ee9b, 1}, - {0x0001eea1, 0x0001eea3, 1}, - {0x0001eea5, 0x0001eea9, 1}, - {0x0001eeab, 0x0001eebb, 1}, - {0x0001eef0, 0x0001eef1, 1}, - {0x0001f000, 0x0001f02b, 1}, - {0x0001f030, 0x0001f093, 1}, - {0x0001f0a0, 0x0001f0ae, 1}, - {0x0001f0b1, 0x0001f0bf, 1}, - {0x0001f0c1, 0x0001f0cf, 1}, - {0x0001f0d1, 0x0001f0f5, 1}, - {0x0001f100, 0x0001f10c, 1}, - {0x0001f110, 0x0001f12e, 1}, - {0x0001f130, 0x0001f16b, 1}, - {0x0001f170, 0x0001f1ac, 1}, - {0x0001f1e6, 0x0001f202, 1}, - {0x0001f210, 0x0001f23b, 1}, - {0x0001f240, 0x0001f248, 1}, - {0x0001f250, 0x0001f251, 1}, - {0x0001f300, 0x0001f6d2, 1}, - {0x0001f6e0, 0x0001f6ec, 1}, - {0x0001f6f0, 0x0001f6f6, 1}, - {0x0001f700, 0x0001f773, 1}, - {0x0001f780, 0x0001f7d4, 1}, - {0x0001f800, 0x0001f80b, 1}, - {0x0001f810, 0x0001f847, 1}, - {0x0001f850, 0x0001f859, 1}, - {0x0001f860, 0x0001f887, 1}, - {0x0001f890, 0x0001f8ad, 1}, - {0x0001f910, 0x0001f91e, 1}, - {0x0001f920, 0x0001f927, 1}, - {0x0001f930, 0x0001f933, 3}, - {0x0001f934, 0x0001f93e, 1}, - {0x0001f940, 0x0001f94b, 1}, - {0x0001f950, 0x0001f95e, 1}, - {0x0001f980, 0x0001f991, 1}, - {0x0001f9c0, 0x00020000, 1600}, - {0x00020001, 0x0002a6d6, 1}, - {0x0002a700, 0x0002b734, 1}, - {0x0002b740, 0x0002b81d, 1}, - {0x0002b820, 0x0002cea1, 1}, - {0x0002f800, 0x0002fa1d, 1}, - {0x000e0001, 0x000e0020, 31}, - {0x000e0021, 0x000e007f, 1}, - {0x000e0100, 0x000e01ef, 1}, - {0x000f0000, 0x000ffffd, 1}, - {0x00100000, 0x0010fffd, 1}, - }, - LatinOffset: 0, -} - -// Total size 44206 bytes (43 KiB) diff --git a/vendor/gopkg.in/go-playground/validator.v8/.gitignore b/vendor/gopkg.in/go-playground/validator.v8/.gitignore new file mode 100644 index 000000000000..792ca00d285a --- /dev/null +++ b/vendor/gopkg.in/go-playground/validator.v8/.gitignore @@ -0,0 +1,29 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof +*.test +*.out +*.txt +cover.html +README.html \ No newline at end of file diff --git a/vendor/gopkg.in/go-playground/validator.v8/README.md b/vendor/gopkg.in/go-playground/validator.v8/README.md new file mode 100644 index 000000000000..d3bd9b0f167a --- /dev/null +++ b/vendor/gopkg.in/go-playground/validator.v8/README.md @@ -0,0 +1,366 @@ +Package validator +================ +<img align="right" src="https://raw.githubusercontent.com/go-playground/validator/v8/logo.png">[![Join the chat at https://gitter.im/bluesuncorp/validator](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/go-playground/validator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +![Project status](https://img.shields.io/badge/version-8.18.2-green.svg) +[![Build Status](https://semaphoreci.com/api/v1/projects/ec20115f-ef1b-4c7d-9393-cc76aba74eb4/530054/badge.svg)](https://semaphoreci.com/joeybloggs/validator) +[![Coverage Status](https://coveralls.io/repos/go-playground/validator/badge.svg?branch=v8&service=github)](https://coveralls.io/github/go-playground/validator?branch=v8) +[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/validator)](https://goreportcard.com/report/github.com/go-playground/validator) +[![GoDoc](https://godoc.org/gopkg.in/go-playground/validator.v8?status.svg)](https://godoc.org/gopkg.in/go-playground/validator.v8) +![License](https://img.shields.io/dub/l/vibe-d.svg) + +Package validator implements value validations for structs and individual fields based on tags. + +It has the following **unique** features: + +- Cross Field and Cross Struct validations by using validation tags or custom validators. +- Slice, Array and Map diving, which allows any or all levels of a multidimensional field to be validated. +- Handles type interface by determining it's underlying type prior to validation. +- Handles custom field types such as sql driver Valuer see [Valuer](https://golang.org/src/database/sql/driver/types.go?s=1210:1293#L29) +- Alias validation tags, which allows for mapping of several validations to a single tag for easier defining of validations on structs +- Extraction of custom defined Field Name e.g. can specify to extract the JSON name while validating and have it available in the resulting FieldError + +Installation +------------ + +Use go get. + + go get gopkg.in/go-playground/validator.v8 + +or to update + + go get -u gopkg.in/go-playground/validator.v8 + +Then import the validator package into your own code. + + import "gopkg.in/go-playground/validator.v8" + +Error Return Value +------- + +Validation functions return type error + +They return type error to avoid the issue discussed in the following, where err is always != nil: + +* http://stackoverflow.com/a/29138676/3158232 +* https://github.com/go-playground/validator/issues/134 + +validator only returns nil or ValidationErrors as type error; so in you code all you need to do +is check if the error returned is not nil, and if it's not type cast it to type ValidationErrors +like so: + +```go +err := validate.Struct(mystruct) +validationErrors := err.(validator.ValidationErrors) + ``` + +Usage and documentation +------ + +Please see http://godoc.org/gopkg.in/go-playground/validator.v8 for detailed usage docs. + +##### Examples: + +Struct & Field validation +```go +package main + +import ( + "fmt" + + "gopkg.in/go-playground/validator.v8" +) + +// User contains user information +type User struct { + FirstName string `validate:"required"` + LastName string `validate:"required"` + Age uint8 `validate:"gte=0,lte=130"` + Email string `validate:"required,email"` + FavouriteColor string `validate:"hexcolor|rgb|rgba"` + Addresses []*Address `validate:"required,dive,required"` // a person can have a home and cottage... +} + +// Address houses a users address information +type Address struct { + Street string `validate:"required"` + City string `validate:"required"` + Planet string `validate:"required"` + Phone string `validate:"required"` +} + +var validate *validator.Validate + +func main() { + + config := &validator.Config{TagName: "validate"} + + validate = validator.New(config) + + validateStruct() + validateField() +} + +func validateStruct() { + + address := &Address{ + Street: "Eavesdown Docks", + Planet: "Persphone", + Phone: "none", + } + + user := &User{ + FirstName: "Badger", + LastName: "Smith", + Age: 135, + Email: "Badger.Smith@gmail.com", + FavouriteColor: "#000", + Addresses: []*Address{address}, + } + + // returns nil or ValidationErrors ( map[string]*FieldError ) + errs := validate.Struct(user) + + if errs != nil { + + fmt.Println(errs) // output: Key: "User.Age" Error:Field validation for "Age" failed on the "lte" tag + // Key: "User.Addresses[0].City" Error:Field validation for "City" failed on the "required" tag + err := errs.(validator.ValidationErrors)["User.Addresses[0].City"] + fmt.Println(err.Field) // output: City + fmt.Println(err.Tag) // output: required + fmt.Println(err.Kind) // output: string + fmt.Println(err.Type) // output: string + fmt.Println(err.Param) // output: + fmt.Println(err.Value) // output: + + // from here you can create your own error messages in whatever language you wish + return + } + + // save user to database +} + +func validateField() { + myEmail := "joeybloggs.gmail.com" + + errs := validate.Field(myEmail, "required,email") + + if errs != nil { + fmt.Println(errs) // output: Key: "" Error:Field validation for "" failed on the "email" tag + return + } + + // email ok, move on +} +``` + +Custom Field Type +```go +package main + +import ( + "database/sql" + "database/sql/driver" + "fmt" + "reflect" + + "gopkg.in/go-playground/validator.v8" +) + +// DbBackedUser User struct +type DbBackedUser struct { + Name sql.NullString `validate:"required"` + Age sql.NullInt64 `validate:"required"` +} + +func main() { + + config := &validator.Config{TagName: "validate"} + + validate := validator.New(config) + + // register all sql.Null* types to use the ValidateValuer CustomTypeFunc + validate.RegisterCustomTypeFunc(ValidateValuer, sql.NullString{}, sql.NullInt64{}, sql.NullBool{}, sql.NullFloat64{}) + + x := DbBackedUser{Name: sql.NullString{String: "", Valid: true}, Age: sql.NullInt64{Int64: 0, Valid: false}} + errs := validate.Struct(x) + + if len(errs.(validator.ValidationErrors)) > 0 { + fmt.Printf("Errs:\n%+v\n", errs) + } +} + +// ValidateValuer implements validator.CustomTypeFunc +func ValidateValuer(field reflect.Value) interface{} { + if valuer, ok := field.Interface().(driver.Valuer); ok { + val, err := valuer.Value() + if err == nil { + return val + } + // handle the error how you want + } + return nil +} +``` + +Struct Level Validation +```go +package main + +import ( + "fmt" + "reflect" + + "gopkg.in/go-playground/validator.v8" +) + +// User contains user information +type User struct { + FirstName string `json:"fname"` + LastName string `json:"lname"` + Age uint8 `validate:"gte=0,lte=130"` + Email string `validate:"required,email"` + FavouriteColor string `validate:"hexcolor|rgb|rgba"` + Addresses []*Address `validate:"required,dive,required"` // a person can have a home and cottage... +} + +// Address houses a users address information +type Address struct { + Street string `validate:"required"` + City string `validate:"required"` + Planet string `validate:"required"` + Phone string `validate:"required"` +} + +var validate *validator.Validate + +func main() { + + config := &validator.Config{TagName: "validate"} + + validate = validator.New(config) + validate.RegisterStructValidation(UserStructLevelValidation, User{}) + + validateStruct() +} + +// UserStructLevelValidation contains custom struct level validations that don't always +// make sense at the field validation level. For Example this function validates that either +// FirstName or LastName exist; could have done that with a custom field validation but then +// would have had to add it to both fields duplicating the logic + overhead, this way it's +// only validated once. +// +// NOTE: you may ask why wouldn't I just do this outside of validator, because doing this way +// hooks right into validator and you can combine with validation tags and still have a +// common error output format. +func UserStructLevelValidation(v *validator.Validate, structLevel *validator.StructLevel) { + + user := structLevel.CurrentStruct.Interface().(User) + + if len(user.FirstName) == 0 && len(user.LastName) == 0 { + structLevel.ReportError(reflect.ValueOf(user.FirstName), "FirstName", "fname", "fnameorlname") + structLevel.ReportError(reflect.ValueOf(user.LastName), "LastName", "lname", "fnameorlname") + } + + // plus can to more, even with different tag than "fnameorlname" +} + +func validateStruct() { + + address := &Address{ + Street: "Eavesdown Docks", + Planet: "Persphone", + Phone: "none", + City: "Unknown", + } + + user := &User{ + FirstName: "", + LastName: "", + Age: 45, + Email: "Badger.Smith@gmail.com", + FavouriteColor: "#000", + Addresses: []*Address{address}, + } + + // returns nil or ValidationErrors ( map[string]*FieldError ) + errs := validate.Struct(user) + + if errs != nil { + + fmt.Println(errs) // output: Key: 'User.LastName' Error:Field validation for 'LastName' failed on the 'fnameorlname' tag + // Key: 'User.FirstName' Error:Field validation for 'FirstName' failed on the 'fnameorlname' tag + err := errs.(validator.ValidationErrors)["User.FirstName"] + fmt.Println(err.Field) // output: FirstName + fmt.Println(err.Tag) // output: fnameorlname + fmt.Println(err.Kind) // output: string + fmt.Println(err.Type) // output: string + fmt.Println(err.Param) // output: + fmt.Println(err.Value) // output: + + // from here you can create your own error messages in whatever language you wish + return + } + + // save user to database +} +``` + +Benchmarks +------ +###### Run on MacBook Pro (Retina, 15-inch, Late 2013) 2.6 GHz Intel Core i7 16 GB 1600 MHz DDR3 using Go version go1.5.3 darwin/amd64 +```go +PASS +BenchmarkFieldSuccess-8 20000000 118 ns/op 0 B/op 0 allocs/op +BenchmarkFieldFailure-8 2000000 758 ns/op 432 B/op 4 allocs/op +BenchmarkFieldDiveSuccess-8 500000 2471 ns/op 464 B/op 28 allocs/op +BenchmarkFieldDiveFailure-8 500000 3172 ns/op 896 B/op 32 allocs/op +BenchmarkFieldCustomTypeSuccess-8 5000000 300 ns/op 32 B/op 2 allocs/op +BenchmarkFieldCustomTypeFailure-8 2000000 775 ns/op 432 B/op 4 allocs/op +BenchmarkFieldOrTagSuccess-8 1000000 1122 ns/op 4 B/op 1 allocs/op +BenchmarkFieldOrTagFailure-8 1000000 1167 ns/op 448 B/op 6 allocs/op +BenchmarkStructLevelValidationSuccess-8 3000000 548 ns/op 160 B/op 5 allocs/op +BenchmarkStructLevelValidationFailure-8 3000000 558 ns/op 160 B/op 5 allocs/op +BenchmarkStructSimpleCustomTypeSuccess-8 2000000 623 ns/op 36 B/op 3 allocs/op +BenchmarkStructSimpleCustomTypeFailure-8 1000000 1381 ns/op 640 B/op 9 allocs/op +BenchmarkStructPartialSuccess-8 1000000 1036 ns/op 272 B/op 9 allocs/op +BenchmarkStructPartialFailure-8 1000000 1734 ns/op 730 B/op 14 allocs/op +BenchmarkStructExceptSuccess-8 2000000 888 ns/op 250 B/op 7 allocs/op +BenchmarkStructExceptFailure-8 1000000 1036 ns/op 272 B/op 9 allocs/op +BenchmarkStructSimpleCrossFieldSuccess-8 2000000 773 ns/op 80 B/op 4 allocs/op +BenchmarkStructSimpleCrossFieldFailure-8 1000000 1487 ns/op 536 B/op 9 allocs/op +BenchmarkStructSimpleCrossStructCrossFieldSuccess-8 1000000 1261 ns/op 112 B/op 7 allocs/op +BenchmarkStructSimpleCrossStructCrossFieldFailure-8 1000000 2055 ns/op 576 B/op 12 allocs/op +BenchmarkStructSimpleSuccess-8 3000000 519 ns/op 4 B/op 1 allocs/op +BenchmarkStructSimpleFailure-8 1000000 1429 ns/op 640 B/op 9 allocs/op +BenchmarkStructSimpleSuccessParallel-8 10000000 146 ns/op 4 B/op 1 allocs/op +BenchmarkStructSimpleFailureParallel-8 2000000 551 ns/op 640 B/op 9 allocs/op +BenchmarkStructComplexSuccess-8 500000 3269 ns/op 244 B/op 15 allocs/op +BenchmarkStructComplexFailure-8 200000 8436 ns/op 3609 B/op 60 allocs/op +BenchmarkStructComplexSuccessParallel-8 1000000 1024 ns/op 244 B/op 15 allocs/op +BenchmarkStructComplexFailureParallel-8 500000 3536 ns/op 3609 B/op 60 allocs/op +``` + +Complimentary Software +---------------------- + +Here is a list of software that compliments using this library either pre or post validation. + +* [form](https://github.com/go-playground/form) - Decodes url.Values into Go value(s) and Encodes Go value(s) into url.Values. Dual Array and Full map support. +* [Conform](https://github.com/leebenson/conform) - Trims, sanitizes & scrubs data based on struct tags. + +How to Contribute +------ + +There will always be a development branch for each version i.e. `v1-development`. In order to contribute, +please make your pull requests against those branches. + +If the changes being proposed or requested are breaking changes, please create an issue, for discussion +or create a pull request against the highest development branch for example this package has a +v1 and v1-development branch however, there will also be a v2-development branch even though v2 doesn't exist yet. + +I strongly encourage everyone whom creates a custom validation function to contribute them and +help make this package even better. + +License +------ +Distributed under MIT License, please see license file in code for more details. diff --git a/vendor/gopkg.in/guregu/null.v3/.gitignore b/vendor/gopkg.in/guregu/null.v3/.gitignore new file mode 100644 index 000000000000..e9eb644a6871 --- /dev/null +++ b/vendor/gopkg.in/guregu/null.v3/.gitignore @@ -0,0 +1,2 @@ +coverage.out +.idea/ diff --git a/vendor/gopkg.in/guregu/null.v3/README.md b/vendor/gopkg.in/guregu/null.v3/README.md new file mode 100644 index 000000000000..7bd336e64984 --- /dev/null +++ b/vendor/gopkg.in/guregu/null.v3/README.md @@ -0,0 +1,75 @@ +## null [![GoDoc](https://godoc.org/github.com/guregu/null?status.svg)](https://godoc.org/github.com/guregu/null) [![CircleCI](https://circleci.com/gh/guregu/null.svg?style=svg)](https://circleci.com/gh/guregu/null) +`import "gopkg.in/guregu/null.v3"` + +null is a library with reasonable options for dealing with nullable SQL and JSON values + +There are two packages: `null` and its subpackage `zero`. + +Types in `null` will only be considered null on null input, and will JSON encode to `null`. If you need zero and null be considered separate values, use these. + +Types in `zero` are treated like zero values in Go: blank string input will produce a null `zero.String`, and null Strings will JSON encode to `""`. Zero values of these types will be considered null to SQL. If you need zero and null treated the same, use these. + +All types implement `sql.Scanner` and `driver.Valuer`, so you can use this library in place of `sql.NullXXX`. All types also implement: `encoding.TextMarshaler`, `encoding.TextUnmarshaler`, `json.Marshaler`, and `json.Unmarshaler`. + +### null package + +`import "gopkg.in/guregu/null.v3"` + +#### null.String +Nullable string. + +Marshals to JSON null if SQL source data is null. Zero (blank) input will not produce a null String. Can unmarshal from `sql.NullString` JSON input or string input. + +#### null.Int +Nullable int64. + +Marshals to JSON null if SQL source data is null. Zero input will not produce a null Int. Can unmarshal from `sql.NullInt64` JSON input. + +#### null.Float +Nullable float64. + +Marshals to JSON null if SQL source data is null. Zero input will not produce a null Float. Can unmarshal from `sql.NullFloat64` JSON input. + +#### null.Bool +Nullable bool. + +Marshals to JSON null if SQL source data is null. False input will not produce a null Bool. Can unmarshal from `sql.NullBool` JSON input. + +#### null.Time + +Marshals to JSON null if SQL source data is null. Uses `time.Time`'s marshaler. Can unmarshal from `pq.NullTime` and similar JSON input. + +### zero package + +`import "gopkg.in/guregu/null.v3/zero"` + +#### zero.String +Nullable string. + +Will marshal to a blank string if null. Blank string input produces a null String. Null values and zero values are considered equivalent. Can unmarshal from `sql.NullString` JSON input. + +#### zero.Int +Nullable int64. + +Will marshal to 0 if null. 0 produces a null Int. Null values and zero values are considered equivalent. Can unmarshal from `sql.NullInt64` JSON input. + +#### zero.Float +Nullable float64. + +Will marshal to 0 if null. 0.0 produces a null Float. Null values and zero values are considered equivalent. Can unmarshal from `sql.NullFloat64` JSON input. + +#### zero.Bool +Nullable bool. + +Will marshal to false if null. `false` produces a null Float. Null values and zero values are considered equivalent. Can unmarshal from `sql.NullBool` JSON input. + +#### zero.Time + +Will marshal to the zero time if null. Uses `time.Time`'s marshaler. Can unmarshal from `pq.NullTime` and similar JSON input. + + +### Bugs +`json`'s `",omitempty"` struct tag does not work correctly right now. It will never omit a null or empty String. This might be [fixed eventually](https://github.com/golang/go/issues/4357). + +### License +BSD diff --git a/vendor/gopkg.in/yaml.v2/README.md b/vendor/gopkg.in/yaml.v2/README.md new file mode 100644 index 000000000000..2ed3314c7393 --- /dev/null +++ b/vendor/gopkg.in/yaml.v2/README.md @@ -0,0 +1,135 @@ +# YAML support for the Go language + +Introduction +------------ + +The yaml package enables Go programs to comfortably encode and decode YAML +values. It was developed within [Canonical](https://www.canonical.com) as +part of the [juju](https://juju.ubuntu.com) project, and is based on a +pure Go port of the well-known [libyaml](http://pyyaml.org/wiki/LibYAML) +C library to parse and generate YAML data quickly and reliably. + +Compatibility +------------- + +The yaml package supports most of YAML 1.1 and 1.2, including support for +anchors, tags, map merging, etc. Multi-document unmarshalling is not yet +implemented, and base-60 floats from YAML 1.1 are purposefully not +supported since they're a poor design and are gone in YAML 1.2. + +Installation and usage +---------------------- + +The import path for the package is *gopkg.in/yaml.v2*. + +To install it, run: + + go get gopkg.in/yaml.v2 + +API documentation +----------------- + +If opened in a browser, the import path itself leads to the API documentation: + + * [https://gopkg.in/yaml.v2](https://gopkg.in/yaml.v2) + +API stability +------------- + +The package API for yaml v2 will remain stable as described in [gopkg.in](https://gopkg.in). + + +License +------- + +The yaml package is licensed under the Apache License 2.0. Please see the LICENSE file for details. + + +Example +------- + +Some more examples can be found in the "examples" folder. + +```Go +package main + +import ( + "fmt" + "log" + + "gopkg.in/yaml.v2" +) + +var data = ` +a: Easy! +b: + c: 2 + d: [3, 4] +` + +// Note: struct fields must be public in order for unmarshal to +// correctly populate the data. +type T struct { + A string + B struct { + RenamedC int `yaml:"c"` + D []int `yaml:",flow"` + } +} + +func main() { + t := T{} + + err := yaml.Unmarshal([]byte(data), &t) + if err != nil { + log.Fatalf("error: %v", err) + } + fmt.Printf("--- t:\n%v\n\n", t) + + d, err := yaml.Marshal(&t) + if err != nil { + log.Fatalf("error: %v", err) + } + fmt.Printf("--- t dump:\n%s\n\n", string(d)) + + m := make(map[interface{}]interface{}) + + err = yaml.Unmarshal([]byte(data), &m) + if err != nil { + log.Fatalf("error: %v", err) + } + fmt.Printf("--- m:\n%v\n\n", m) + + d, err = yaml.Marshal(&m) + if err != nil { + log.Fatalf("error: %v", err) + } + fmt.Printf("--- m dump:\n%s\n\n", string(d)) +} +``` + +This example will generate the following output: + +``` +--- t: +{Easy! {2 [3 4]}} + +--- t dump: +a: Easy! +b: + c: 2 + d: [3, 4] + + +--- m: +map[a:Easy! b:map[c:2 d:[3 4]]] + +--- m dump: +a: Easy! +b: + c: 2 + d: + - 3 + - 4 +``` + diff --git a/vendor/gopkg.in/yaml.v2/go.mod b/vendor/gopkg.in/yaml.v2/go.mod new file mode 100644 index 000000000000..1934e8769450 --- /dev/null +++ b/vendor/gopkg.in/yaml.v2/go.mod @@ -0,0 +1,5 @@ +module "gopkg.in/yaml.v2" + +require ( + "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 +)