diff --git a/go.mod b/go.mod
index 0f4125d4f..521eec710 100644
--- a/go.mod
+++ b/go.mod
@@ -24,8 +24,9 @@ require (
github.com/franela/goblin v0.0.0-20200512143142-b260c999b2d7
github.com/ghodss/yaml v1.0.0
github.com/gin-gonic/contrib v0.0.0-20191209060500-d6e26eeaa607
- github.com/gin-gonic/gin v1.6.3
- github.com/go-sql-driver/mysql v1.5.0
+ github.com/gin-gonic/gin v1.7.4
+ github.com/go-playground/validator/v10 v10.9.0 // indirect
+ github.com/go-sql-driver/mysql v1.6.0
github.com/gogits/go-gogs-client v0.0.0-20160212212711-d584b1e0fb4d
github.com/gogo/protobuf v1.3.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible
@@ -36,37 +37,38 @@ require (
github.com/hashicorp/go-version v1.3.0 // indirect
github.com/jackspirou/syscerts v0.0.0-20160531025014-b68f5469dff1
github.com/joho/godotenv v1.3.0
- github.com/kr/pretty v0.2.1
- github.com/kr/text v0.2.0 // indirect
+ github.com/json-iterator/go v1.1.12 // indirect
+ github.com/kr/pretty v0.3.0
github.com/lib/pq v1.5.2
+ github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-sqlite3 v2.0.3+incompatible
github.com/morikuni/aec v1.0.0 // indirect
github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450
- github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.1 // indirect
- github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.6.0
github.com/prometheus/common v0.10.0 // indirect
- github.com/rs/zerolog v1.18.0
- github.com/russross/meddler v1.0.0
- github.com/sirupsen/logrus v1.6.0
- github.com/stretchr/objx v0.2.0 // indirect
- github.com/stretchr/testify v1.5.1
+ github.com/rs/zerolog v1.25.0
+ github.com/russross/meddler v1.0.1
+ github.com/sirupsen/logrus v1.8.1
+ github.com/stretchr/objx v0.3.0 // indirect
+ github.com/stretchr/testify v1.7.0
github.com/tevino/abool v0.0.0-20170917061928-9b9efcf221b5
+ github.com/ugorji/go v1.2.6 // indirect
github.com/urfave/cli v1.22.4
github.com/woodpecker-ci/expr v0.0.0-20210628233344-164b8b3d0915
github.com/woodpecker-ci/togo v0.0.0-20180401185031-50a0e4726e74
- golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
+ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
golang.org/x/net v0.0.0-20210825183410-e898025ed96a
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
- golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
+ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
+ golang.org/x/sys v0.0.0-20210923061019-b8560ed6a9b7 // indirect
+ golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
google.golang.org/grpc v1.29.1
google.golang.org/protobuf v1.27.1 // indirect
- gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
- gopkg.in/yaml.v2 v2.3.0 // indirect
- gopkg.in/yaml.v3 v3.0.0-20200506231410-2ff61e1afc86
+ gopkg.in/yaml.v2 v2.4.0 // indirect
+ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
gotest.tools v2.2.0+incompatible // indirect
)
diff --git a/go.sum b/go.sum
index f87455c29..547fc7c30 100644
--- a/go.sum
+++ b/go.sum
@@ -29,7 +29,7 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
-github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
@@ -69,23 +69,27 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/contrib v0.0.0-20191209060500-d6e26eeaa607 h1:MrIm8EEPue08JS4eh+b08IOG+wd0WRWEHWnewNfWFX0=
github.com/gin-gonic/contrib v0.0.0-20191209060500-d6e26eeaa607/go.mod h1:iqneQ2Df3omzIVTkIfn7c1acsVnMGiSLn4XF5Blh3Yg=
-github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
-github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
+github.com/gin-gonic/gin v1.7.4 h1:QmUZXrvJ9qZ3GfWvQ+2wnW/1ePrTEJqPKMYEU3lD/DM=
+github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
-github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
-github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
+github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=
+github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
-github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
-github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
-github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
-github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho=
+github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
+github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
+github.com/go-playground/validator/v10 v10.9.0 h1:NgTtmN58D0m8+UuxtYmGztBJB7VnPgjj221I1QHci2A=
+github.com/go-playground/validator/v10 v10.9.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos=
+github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
+github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogits/go-gogs-client v0.0.0-20160212212711-d584b1e0fb4d h1:2sle18csjgDC8lnX5SHBwoyBlE1QLj8A8vgDxd2Mwbw=
github.com/gogits/go-gogs-client v0.0.0-20160212212711-d584b1e0fb4d/go.mod h1:cY2AIrMgHm6oOHmR7jY+9TtjzSjQ3iG7tURJG3Y6XH0=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
@@ -129,28 +133,31 @@ github.com/jackspirou/syscerts v0.0.0-20160531025014-b68f5469dff1/go.mod h1:zuHl
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
-github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
+github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
+github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
-github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
+github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
+github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
+github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
github.com/lib/pq v1.5.2 h1:yTSXVswvWUOQ3k1sd7vJfDrbSl8lKuscqFJRqjC0ifw=
github.com/lib/pq v1.5.2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
-github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
+github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
+github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
+github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
@@ -159,19 +166,19 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
-github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
+github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 h1:j2kD3MT1z4PXCiUllUJF9mWUESr9TWKS7iEKsQ/IipM=
github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450/go.mod h1:skjdDftzkFALcuGzYSklqYd8gvat6F1gZJ4YPVbkZpM=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
-github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
+github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@@ -195,35 +202,41 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.11 h1:DhHlBtkHWPYi8O2y31JkK0TF+DGM+51OopZjH/Ia5qI=
github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
-github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
-github.com/rs/zerolog v1.18.0 h1:CbAm3kP2Tptby1i9sYy2MGRg0uxIN9cyDb59Ys7W8z8=
-github.com/rs/zerolog v1.18.0/go.mod h1:9nvC1axdVrAHcu/s9taAVfBuIdTZLVQmKQyvrUjF5+I=
+github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
+github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
+github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
+github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
+github.com/rs/zerolog v1.25.0 h1:Rj7XygbUHKUlDPcVdoLyR91fJBsduXj5fRxyqIQj/II=
+github.com/rs/zerolog v1.25.0/go.mod h1:7KHcEGe0QZPOm2IE4Kpb5rTh6n1h2hIgS5OOnu1rUaI=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
-github.com/russross/meddler v1.0.0 h1:3HgwIot/NsCrLrmorjSO7JhzoshoSVfuqgFgZ0VTbro=
-github.com/russross/meddler v1.0.0/go.mod h1:j75NzzcOL4CGy+pPKykxZoT/At5Qj4ZnRRs1PXxweZI=
+github.com/russross/meddler v1.0.1 h1:JLR7Z4M4iGm1nr7DIURBq18UW8cTrm+qArUFgOhELo8=
+github.com/russross/meddler v1.0.1/go.mod h1:GzGDChbFHuzxlFwt8gnJMRRNyFSQDSudmy2kHh7GYnQ=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
-github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
-github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
+github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
+github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
-github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
+github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As=
+github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
-github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
+github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tevino/abool v0.0.0-20170917061928-9b9efcf221b5 h1:hNna6Fi0eP1f2sMBe/rJicDmaHmoXGe1Ta84FPYHLuE=
github.com/tevino/abool v0.0.0-20170917061928-9b9efcf221b5/go.mod h1:f1SCnEOt6sc3fOJfPQDRDzHOtSXuTtnz0ImG9kPRDV0=
-github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
-github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
+github.com/ugorji/go v1.2.6 h1:tGiWC9HENWE2tqYycIqFTNorMmFRVhNwCpDOpWqnk8E=
+github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0=
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
+github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ=
+github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw=
github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA=
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/woodpecker-ci/expr v0.0.0-20210628233344-164b8b3d0915 h1:9zBOoKSR9CBeYoKQv6LFIuImg8lorCjh8XzK72bJMRg=
@@ -231,17 +244,20 @@ github.com/woodpecker-ci/expr v0.0.0-20210628233344-164b8b3d0915/go.mod h1:PbzlZ
github.com/woodpecker-ci/togo v0.0.0-20180401185031-50a0e4726e74 h1:q/tWgA3hMWrAQqsS4yfhc0+w4RevBGr9ghem/bFFDRY=
github.com/woodpecker-ci/togo v0.0.0-20180401185031-50a0e4726e74/go.mod h1:lykh/ei/caPO6sv4NN+pqnDTo8kEKhZcnhafN8GhGNs=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
+github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw=
-golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
+golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -253,6 +269,8 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210825183410-e898025ed96a h1:bRuuGXV8wwSdGTB+CtJf+FjgO1APK1CoO39T4BN/XBw=
golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -263,8 +281,8 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o=
-golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
+golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -272,30 +290,40 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c=
+golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210923061019-b8560ed6a9b7 h1:c20P3CcPbopVp2f7099WLOqSNKURf30Z0uq66HpijZY=
+golang.org/x/sys v0.0.0-20210923061019-b8560ed6a9b7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
-golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
+golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-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=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc=
@@ -323,18 +351,21 @@ google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+Rur
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
-gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
+gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
-gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v3 v3.0.0-20200506231410-2ff61e1afc86 h1:OfFoIUYv/me30yv7XlMy4F9RJw8DEm8WQ6QG1Ph4bH0=
-gopkg.in/yaml.v3 v3.0.0-20200506231410-2ff61e1afc86/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
+gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
+gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/vendor/github.com/gin-gonic/gin/.travis.yml b/vendor/github.com/gin-gonic/gin/.travis.yml
index 6680a5b36..8ebae7123 100644
--- a/vendor/github.com/gin-gonic/gin/.travis.yml
+++ b/vendor/github.com/gin-gonic/gin/.travis.yml
@@ -3,18 +3,20 @@ language: go
matrix:
fast_finish: true
include:
- - go: 1.11.x
- env: GO111MODULE=on
- go: 1.12.x
env: GO111MODULE=on
- go: 1.13.x
- go: 1.13.x
- env:
+ env:
- TESTTAGS=nomsgpack
- go: 1.14.x
- go: 1.14.x
env:
- TESTTAGS=nomsgpack
+ - go: 1.15.x
+ - go: 1.15.x
+ env:
+ - TESTTAGS=nomsgpack
- go: master
git:
diff --git a/vendor/github.com/gin-gonic/gin/AUTHORS.md b/vendor/github.com/gin-gonic/gin/AUTHORS.md
index dda19bcf3..c634e6be0 100644
--- a/vendor/github.com/gin-gonic/gin/AUTHORS.md
+++ b/vendor/github.com/gin-gonic/gin/AUTHORS.md
@@ -156,7 +156,7 @@ People and companies, who have contributed, in alphabetical order.
- Fix variadic parameter in the flexible render API
- Fix Corrupted plain render
- Add Pluggable View Renderer Example
-
+
**@msemenistyi (Mykyta Semenistyi)**
- update Readme.md. Add code to String method
@@ -190,6 +190,8 @@ People and companies, who have contributed, in alphabetical order.
**@rogierlommers (Rogier Lommers)**
- Add updated static serve example
+**@rw-access (Ross Wolf)**
+- Added support to mix exact and param routes
**@se77en (Damon Zhao)**
- Improve color logging
diff --git a/vendor/github.com/gin-gonic/gin/BENCHMARKS.md b/vendor/github.com/gin-gonic/gin/BENCHMARKS.md
index e4ff4677e..c11ee99ae 100644
--- a/vendor/github.com/gin-gonic/gin/BENCHMARKS.md
+++ b/vendor/github.com/gin-gonic/gin/BENCHMARKS.md
@@ -1,693 +1,666 @@
-## Benchmark System
+# Benchmark System
-**VM HOST:** DigitalOcean
-**Machine:** 12 CPU, 24 GB RAM. Ubuntu 16.04.2 x64
-**Date:** Nov 26th, 2019
-**Go Version:** 1.13.4 linux/amd64
-**Source:** [Go HTTP Router Benchmark](https://github.com/julienschmidt/go-http-routing-benchmark)
-**Result:** [See the gist](https://gist.github.com/appleboy/b5f2ecfaf50824ae9c64dcfb9165ae5e)
+**VM HOST:** Travis
+**Machine:** Ubuntu 16.04.6 LTS x64
+**Date:** May 04th, 2020
+**Version:** Gin v1.6.3
+**Go Version:** 1.14.2 linux/amd64
+**Source:** [Go HTTP Router Benchmark](https://github.com/gin-gonic/go-http-routing-benchmark)
+**Result:** [See the gist](https://gist.github.com/appleboy/b5f2ecfaf50824ae9c64dcfb9165ae5e) or [Travis result](https://travis-ci.org/github/gin-gonic/go-http-routing-benchmark/jobs/682947061)
## Static Routes: 157
-```
-Gin: 34936 Bytes
+```sh
+Gin: 34936 Bytes
-HttpServeMux: 14512 Bytes
-Ace: 30648 Bytes
-Aero: 800696 Bytes
-Bear: 30664 Bytes
-Beego: 98456 Bytes
-Bone: 40224 Bytes
-Chi: 83608 Bytes
-CloudyKitRouter: 30448 Bytes
-Denco: 9928 Bytes
-Echo: 76584 Bytes
-GocraftWeb: 55496 Bytes
-Goji: 29744 Bytes
-Gojiv2: 105840 Bytes
-GoJsonRest: 137512 Bytes
-GoRestful: 816936 Bytes
-GorillaMux: 585632 Bytes
-GowwwRouter: 24968 Bytes
-HttpRouter: 21680 Bytes
-HttpTreeMux: 73448 Bytes
-Kocha: 115472 Bytes
-LARS: 30640 Bytes
-Macaron: 38592 Bytes
-Martini: 310864 Bytes
-Pat: 19696 Bytes
-Possum: 89920 Bytes
-R2router: 23712 Bytes
-Rivet: 24608 Bytes
-Tango: 28264 Bytes
-TigerTonic: 78768 Bytes
-Traffic: 538976 Bytes
-Vulcan: 369960 Bytes
+HttpServeMux: 14512 Bytes
+Ace: 30680 Bytes
+Aero: 34536 Bytes
+Bear: 30456 Bytes
+Beego: 98456 Bytes
+Bone: 40224 Bytes
+Chi: 83608 Bytes
+Denco: 10216 Bytes
+Echo: 80328 Bytes
+GocraftWeb: 55288 Bytes
+Goji: 29744 Bytes
+Gojiv2: 105840 Bytes
+GoJsonRest: 137496 Bytes
+GoRestful: 816936 Bytes
+GorillaMux: 585632 Bytes
+GowwwRouter: 24968 Bytes
+HttpRouter: 21712 Bytes
+HttpTreeMux: 73448 Bytes
+Kocha: 115472 Bytes
+LARS: 30640 Bytes
+Macaron: 38592 Bytes
+Martini: 310864 Bytes
+Pat: 19696 Bytes
+Possum: 89920 Bytes
+R2router: 23712 Bytes
+Rivet: 24608 Bytes
+Tango: 28264 Bytes
+TigerTonic: 78768 Bytes
+Traffic: 538976 Bytes
+Vulcan: 369960 Bytes
```
## GithubAPI Routes: 203
-```
-Gin: 58512 Bytes
+```sh
+Gin: 58512 Bytes
-Ace: 48640 Bytes
-Aero: 1386208 Bytes
-Bear: 82536 Bytes
-Beego: 150936 Bytes
-Bone: 100976 Bytes
-Chi: 95112 Bytes
-CloudyKitRouter: 93704 Bytes
-Denco: 36736 Bytes
-Echo: 96328 Bytes
-GocraftWeb: 95432 Bytes
-Goji: 51600 Bytes
-Gojiv2: 104704 Bytes
-GoJsonRest: 142024 Bytes
-GoRestful: 1241656 Bytes
-GorillaMux: 1322784 Bytes
-GowwwRouter: 80008 Bytes
-HttpRouter: 37096 Bytes
-HttpTreeMux: 78800 Bytes
-Kocha: 785408 Bytes
-LARS: 48600 Bytes
-Macaron: 93680 Bytes
-Martini: 485264 Bytes
-Pat: 21200 Bytes
-Possum: 85312 Bytes
-R2router: 47104 Bytes
-Rivet: 42840 Bytes
-Tango: 54840 Bytes
-TigerTonic: 96176 Bytes
-Traffic: 921744 Bytes
-Vulcan: 425368 Bytes
+Ace: 48688 Bytes
+Aero: 318568 Bytes
+Bear: 84248 Bytes
+Beego: 150936 Bytes
+Bone: 100976 Bytes
+Chi: 95112 Bytes
+Denco: 36736 Bytes
+Echo: 100296 Bytes
+GocraftWeb: 95432 Bytes
+Goji: 49680 Bytes
+Gojiv2: 104704 Bytes
+GoJsonRest: 141976 Bytes
+GoRestful: 1241656 Bytes
+GorillaMux: 1322784 Bytes
+GowwwRouter: 80008 Bytes
+HttpRouter: 37144 Bytes
+HttpTreeMux: 78800 Bytes
+Kocha: 785120 Bytes
+LARS: 48600 Bytes
+Macaron: 92784 Bytes
+Martini: 485264 Bytes
+Pat: 21200 Bytes
+Possum: 85312 Bytes
+R2router: 47104 Bytes
+Rivet: 42840 Bytes
+Tango: 54840 Bytes
+TigerTonic: 95264 Bytes
+Traffic: 921744 Bytes
+Vulcan: 425992 Bytes
```
## GPlusAPI Routes: 13
-```
-Gin: 4384 Bytes
+```sh
+Gin: 4384 Bytes
-Ace: 3 664 Bytes
-Aero: 88248 Bytes
-Bear: 7112 Bytes
-Beego: 10272 Bytes
-Bone: 6688 Bytes
-Chi: 8024 Bytes
-CloudyKitRouter: 6728 Bytes
-Denco: 3264 Bytes
-Echo: 9272 Bytes
-GocraftWeb: 7496 Bytes
-Goji: 3152 Bytes
-Gojiv2: 7376 Bytes
-GoJsonRest: 11416 Bytes
-GoRestful: 74328 Bytes
-GorillaMux: 66208 Bytes
-GowwwRouter: 5744 Bytes
-HttpRouter: 2760 Bytes
-HttpTreeMux: 7440 Bytes
-Kocha: 128880 Bytes
-LARS: 3656 Bytes
-Macaron: 8656 Bytes
-Martini: 23920 Bytes
-Pat: 1856 Bytes
-Possum: 7248 Bytes
-R2router: 3928 Bytes
-Rivet: 3064 Bytes
-Tango: 5168 Bytes
-TigerTonic: 9408 Bytes
-Traffic: 46400 Bytes
-Vulcan: 25544 Bytes
+Ace: 3712 Bytes
+Aero: 26056 Bytes
+Bear: 7112 Bytes
+Beego: 10272 Bytes
+Bone: 6688 Bytes
+Chi: 8024 Bytes
+Denco: 3264 Bytes
+Echo: 9688 Bytes
+GocraftWeb: 7496 Bytes
+Goji: 3152 Bytes
+Gojiv2: 7376 Bytes
+GoJsonRest: 11400 Bytes
+GoRestful: 74328 Bytes
+GorillaMux: 66208 Bytes
+GowwwRouter: 5744 Bytes
+HttpRouter: 2808 Bytes
+HttpTreeMux: 7440 Bytes
+Kocha: 128880 Bytes
+LARS: 3656 Bytes
+Macaron: 8656 Bytes
+Martini: 23920 Bytes
+Pat: 1856 Bytes
+Possum: 7248 Bytes
+R2router: 3928 Bytes
+Rivet: 3064 Bytes
+Tango: 5168 Bytes
+TigerTonic: 9408 Bytes
+Traffic: 46400 Bytes
+Vulcan: 25544 Bytes
```
## ParseAPI Routes: 26
-```
-Gin: 7776 Bytes
+```sh
+Gin: 7776 Bytes
-Ace: 6656 Bytes
-Aero: 163736 Bytes
-Bear: 12528 Bytes
-Beego: 19280 Bytes
-Bone: 11440 Bytes
-Chi: 9744 Bytes
-Denco: 4192 Bytes
-Echo: 11648 Bytes
-GocraftWeb: 12800 Bytes
-Goji: 5680 Bytes
-Gojiv2: 14464 Bytes
-GoJsonRest: 14424 Bytes
-GoRestful: 116264 Bytes
-GorillaMux: 105880 Bytes
-GowwwRouter: 9344 Bytes
-HttpRouter: 5024 Bytes
-HttpTreeMux: 7848 Bytes
-Kocha: 181712 Bytes
-LARS: 6632 Bytes
-Macaron: 13648 Bytes
-Martini: 45888 Bytes
-Pat: 2560 Bytes
-Possum: 9200 Bytes
-R2router: 7056 Bytes
-Rivet: 5680 Bytes
-Tango: 8920 Bytes
-TigerTonic: 9840 Bytes
-Traffic: 79096 Bytes
-Vulcan: 44504 Bytes
+Ace: 6704 Bytes
+Aero: 28488 Bytes
+Bear: 12320 Bytes
+Beego: 19280 Bytes
+Bone: 11440 Bytes
+Chi: 9744 Bytes
+Denco: 4192 Bytes
+Echo: 11664 Bytes
+GocraftWeb: 12800 Bytes
+Goji: 5680 Bytes
+Gojiv2: 14464 Bytes
+GoJsonRest: 14072 Bytes
+GoRestful: 116264 Bytes
+GorillaMux: 105880 Bytes
+GowwwRouter: 9344 Bytes
+HttpRouter: 5072 Bytes
+HttpTreeMux: 7848 Bytes
+Kocha: 181712 Bytes
+LARS: 6632 Bytes
+Macaron: 13648 Bytes
+Martini: 45888 Bytes
+Pat: 2560 Bytes
+Possum: 9200 Bytes
+R2router: 7056 Bytes
+Rivet: 5680 Bytes
+Tango: 8920 Bytes
+TigerTonic: 9840 Bytes
+Traffic: 79096 Bytes
+Vulcan: 44504 Bytes
```
## Static Routes
-```
-BenchmarkGin_StaticAll 25604 45487 ns/op 0 B/op 0 allocs/op
+```sh
+BenchmarkGin_StaticAll 62169 19319 ns/op 0 B/op 0 allocs/op
-BenchmarkAce_StaticAll 28402 42046 ns/op 0 B/op 0 allocs/op
-BenchmarkAero_StaticAll 38766 30333 ns/op 0 B/op 0 allocs/op
-BenchmarkHttpServeMux_StaticAll 25728 46511 ns/op 0 B/op 0 allocs/op
-BenchmarkBeego_StaticAll 5098 288527 ns/op 55264 B/op 471 allocs/op
-BenchmarkBear_StaticAll 10000 126323 ns/op 20272 B/op 469 allocs/op
-BenchmarkBone_StaticAll 9499 113631 ns/op 0 B/op 0 allocs/op
-BenchmarkChi_StaticAll 7912 237363 ns/op 67824 B/op 471 allocs/op
-BenchmarkCloudyKitRouter_StaticAll 41626 28668 ns/op 0 B/op 0 allocs/op
-BenchmarkDenco_StaticAll 95774 12221 ns/op 0 B/op 0 allocs/op
-BenchmarkEcho_StaticAll 26246 44603 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_StaticAll 10000 193337 ns/op 46312 B/op 785 allocs/op
-BenchmarkGoji_StaticAll 15886 75789 ns/op 0 B/op 0 allocs/op
-BenchmarkGojiv2_StaticAll 1886 597374 ns/op 205984 B/op 1570 allocs/op
-BenchmarkGoJsonRest_StaticAll 4700 307144 ns/op 51653 B/op 1727 allocs/op
-BenchmarkGoRestful_StaticAll 429 2880165 ns/op 613280 B/op 2053 allocs/op
-BenchmarkGorillaMux_StaticAll 754 1491761 ns/op 153233 B/op 1413 allocs/op
-BenchmarkGowwwRouter_StaticAll 28071 42629 ns/op 0 B/op 0 allocs/op
-BenchmarkHttpRouter_StaticAll 47672 24875 ns/op 0 B/op 0 allocs/op
-BenchmarkHttpTreeMux_StaticAll 46770 25100 ns/op 0 B/op 0 allocs/op
-BenchmarkKocha_StaticAll 61045 19494 ns/op 0 B/op 0 allocs/op
-BenchmarkLARS_StaticAll 36103 32700 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_StaticAll 4261 430131 ns/op 115552 B/op 1256 allocs/op
-BenchmarkMartini_StaticAll 481 2320157 ns/op 125444 B/op 1717 allocs/op
-BenchmarkPat_StaticAll 325 3739521 ns/op 602832 B/op 12559 allocs/op
-BenchmarkPossum_StaticAll 10000 203575 ns/op 65312 B/op 471 allocs/op
-BenchmarkR2router_StaticAll 10000 110536 ns/op 22608 B/op 628 allocs/op
-BenchmarkRivet_StaticAll 23344 51174 ns/op 0 B/op 0 allocs/op
-BenchmarkTango_StaticAll 3596 340045 ns/op 39209 B/op 1256 allocs/op
-BenchmarkTigerTonic_StaticAll 16784 71807 ns/op 7376 B/op 157 allocs/op
-BenchmarkTraffic_StaticAll 350 3435155 ns/op 754862 B/op 14601 allocs/op
-BenchmarkVulcan_StaticAll 5930 200284 ns/op 15386 B/op 471 allocs/op
+BenchmarkAce_StaticAll 65428 18313 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_StaticAll 121132 9632 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpServeMux_StaticAll 52626 22758 ns/op 0 B/op 0 allocs/op
+BenchmarkBeego_StaticAll 9962 179058 ns/op 55264 B/op 471 allocs/op
+BenchmarkBear_StaticAll 14894 80966 ns/op 20272 B/op 469 allocs/op
+BenchmarkBone_StaticAll 18718 64065 ns/op 0 B/op 0 allocs/op
+BenchmarkChi_StaticAll 10000 149827 ns/op 67824 B/op 471 allocs/op
+BenchmarkDenco_StaticAll 211393 5680 ns/op 0 B/op 0 allocs/op
+BenchmarkEcho_StaticAll 49341 24343 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_StaticAll 10000 126209 ns/op 46312 B/op 785 allocs/op
+BenchmarkGoji_StaticAll 27956 43174 ns/op 0 B/op 0 allocs/op
+BenchmarkGojiv2_StaticAll 3430 370718 ns/op 205984 B/op 1570 allocs/op
+BenchmarkGoJsonRest_StaticAll 9134 188888 ns/op 51653 B/op 1727 allocs/op
+BenchmarkGoRestful_StaticAll 706 1703330 ns/op 613280 B/op 2053 allocs/op
+BenchmarkGorillaMux_StaticAll 1268 924083 ns/op 153233 B/op 1413 allocs/op
+BenchmarkGowwwRouter_StaticAll 63374 18935 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpRouter_StaticAll 109938 10902 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_StaticAll 109166 10861 ns/op 0 B/op 0 allocs/op
+BenchmarkKocha_StaticAll 92258 12992 ns/op 0 B/op 0 allocs/op
+BenchmarkLARS_StaticAll 65200 18387 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_StaticAll 5671 291501 ns/op 115553 B/op 1256 allocs/op
+BenchmarkMartini_StaticAll 807 1460498 ns/op 125444 B/op 1717 allocs/op
+BenchmarkPat_StaticAll 513 2342396 ns/op 602832 B/op 12559 allocs/op
+BenchmarkPossum_StaticAll 10000 128270 ns/op 65312 B/op 471 allocs/op
+BenchmarkR2router_StaticAll 16726 71760 ns/op 22608 B/op 628 allocs/op
+BenchmarkRivet_StaticAll 41722 28723 ns/op 0 B/op 0 allocs/op
+BenchmarkTango_StaticAll 7606 205082 ns/op 39209 B/op 1256 allocs/op
+BenchmarkTigerTonic_StaticAll 26247 45806 ns/op 7376 B/op 157 allocs/op
+BenchmarkTraffic_StaticAll 550 2284518 ns/op 754864 B/op 14601 allocs/op
+BenchmarkVulcan_StaticAll 10000 131343 ns/op 15386 B/op 471 allocs/op
```
## Micro Benchmarks
-```
-BenchmarkGin_Param 8623915 139 ns/op 0 B/op 0 allocs/op
-
-BenchmarkAce_Param 3976539 290 ns/op 32 B/op 1 allocs/op
-BenchmarkAero_Param 8948976 133 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_Param 1000000 1277 ns/op 456 B/op 5 allocs/op
-BenchmarkBeego_Param 889404 1785 ns/op 352 B/op 3 allocs/op
-BenchmarkBone_Param 1000000 2219 ns/op 816 B/op 6 allocs/op
-BenchmarkChi_Param 1000000 1386 ns/op 432 B/op 3 allocs/op
-BenchmarkCloudyKitRouter_Param 18343244 61.2 ns/op 0 B/op 0 allocs/op
-BenchmarkDenco_Param 5637424 204 ns/op 32 B/op 1 allocs/op
-BenchmarkEcho_Param 9540910 122 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_Param 1000000 1939 ns/op 648 B/op 8 allocs/op
-BenchmarkGoji_Param 1283509 938 ns/op 336 B/op 2 allocs/op
-BenchmarkGojiv2_Param 331266 3554 ns/op 1328 B/op 11 allocs/op
-BenchmarkGoJsonRest_Param 908851 2158 ns/op 649 B/op 13 allocs/op
-BenchmarkGoRestful_Param 135781 9339 ns/op 4192 B/op 14 allocs/op
-BenchmarkGorillaMux_Param 308407 3893 ns/op 1280 B/op 10 allocs/op
-BenchmarkGowwwRouter_Param 1000000 1044 ns/op 432 B/op 3 allocs/op
-BenchmarkHttpRouter_Param 6653476 162 ns/op 32 B/op 1 allocs/op
-BenchmarkHttpTreeMux_Param 1361378 819 ns/op 352 B/op 3 allocs/op
-BenchmarkKocha_Param 3084330 353 ns/op 56 B/op 3 allocs/op
-BenchmarkLARS_Param 11502079 107 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_Param 439095 3750 ns/op 1072 B/op 10 allocs/op
-BenchmarkMartini_Param 177099 7479 ns/op 1072 B/op 10 allocs/op
-BenchmarkPat_Param 729747 2048 ns/op 536 B/op 11 allocs/op
-BenchmarkPossum_Param 995989 1705 ns/op 496 B/op 5 allocs/op
-BenchmarkR2router_Param 1000000 1037 ns/op 432 B/op 5 allocs/op
-BenchmarkRivet_Param 4057065 271 ns/op 48 B/op 1 allocs/op
-BenchmarkTango_Param 812029 1682 ns/op 248 B/op 8 allocs/op
-BenchmarkTigerTonic_Param 450592 3358 ns/op 776 B/op 16 allocs/op
-BenchmarkTraffic_Param 206390 5661 ns/op 1856 B/op 21 allocs/op
-BenchmarkVulcan_Param 1441147 792 ns/op 98 B/op 3 allocs/op
-
-BenchmarkAce_Param5 1891473 632 ns/op 160 B/op 1 allocs/op
-BenchmarkAero_Param5 5191258 227 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_Param5 988882 1734 ns/op 501 B/op 5 allocs/op
-BenchmarkBeego_Param5 625438 2132 ns/op 352 B/op 3 allocs/op
-BenchmarkBone_Param5 622030 3061 ns/op 864 B/op 6 allocs/op
-BenchmarkChi_Param5 1000000 1735 ns/op 432 B/op 3 allocs/op
-BenchmarkCloudyKitRouter_Param5 5167868 225 ns/op 0 B/op 0 allocs/op
-BenchmarkDenco_Param5 2174550 550 ns/op 160 B/op 1 allocs/op
-BenchmarkEcho_Param5 4272258 275 ns/op 0 B/op 0 allocs/op
-BenchmarkGin_Param5 4190391 275 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_Param5 623739 3107 ns/op 920 B/op 11 allocs/op
-BenchmarkGoji_Param5 1000000 1310 ns/op 336 B/op 2 allocs/op
-BenchmarkGojiv2_Param5 314694 3803 ns/op 1392 B/op 11 allocs/op
-BenchmarkGoJsonRest_Param5 308203 4108 ns/op 1097 B/op 16 allocs/op
-BenchmarkGoRestful_Param5 115048 9787 ns/op 4288 B/op 14 allocs/op
-BenchmarkGorillaMux_Param5 180812 5658 ns/op 1344 B/op 10 allocs/op
-BenchmarkGowwwRouter_Param5 1000000 1156 ns/op 432 B/op 3 allocs/op
-BenchmarkHttpRouter_Param5 2395767 502 ns/op 160 B/op 1 allocs/op
-BenchmarkHttpTreeMux_Param5 899263 2096 ns/op 576 B/op 6 allocs/op
-BenchmarkKocha_Param5 1000000 1639 ns/op 440 B/op 10 allocs/op
-BenchmarkLARS_Param5 5807994 203 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_Param5 272967 4087 ns/op 1072 B/op 10 allocs/op
-BenchmarkMartini_Param5 120735 8886 ns/op 1232 B/op 11 allocs/op
-BenchmarkPat_Param5 294714 4943 ns/op 888 B/op 29 allocs/op
-BenchmarkPossum_Param5 1000000 1689 ns/op 496 B/op 5 allocs/op
-BenchmarkR2router_Param5 1000000 1319 ns/op 432 B/op 5 allocs/op
-BenchmarkRivet_Param5 1347289 883 ns/op 240 B/op 1 allocs/op
-BenchmarkTango_Param5 617077 2091 ns/op 360 B/op 8 allocs/op
-BenchmarkTigerTonic_Param5 113659 11212 ns/op 2279 B/op 39 allocs/op
-BenchmarkTraffic_Param5 134148 9039 ns/op 2208 B/op 27 allocs/op
-BenchmarkVulcan_Param5 1000000 1095 ns/op 98 B/op 3 allocs/op
-
-BenchmarkAce_Param20 1000000 1838 ns/op 640 B/op 1 allocs/op
-BenchmarkAero_Param20 17120668 66.1 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_Param20 205585 5332 ns/op 1665 B/op 5 allocs/op
-BenchmarkBeego_Param20 230522 5382 ns/op 352 B/op 3 allocs/op
-BenchmarkBone_Param20 167190 8076 ns/op 2031 B/op 6 allocs/op
-BenchmarkChi_Param20 480528 3044 ns/op 432 B/op 3 allocs/op
-BenchmarkCloudyKitRouter_Param20 1347794 872 ns/op 0 B/op 0 allocs/op
-BenchmarkDenco_Param20 1000000 1867 ns/op 640 B/op 1 allocs/op
-BenchmarkEcho_Param20 1363526 897 ns/op 0 B/op 0 allocs/op
-BenchmarkGin_Param20 1607217 748 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_Param20 97314 11671 ns/op 3795 B/op 15 allocs/op
-BenchmarkGoji_Param20 289407 4220 ns/op 1246 B/op 2 allocs/op
-BenchmarkGojiv2_Param20 245186 4869 ns/op 1632 B/op 11 allocs/op
-BenchmarkGoJsonRest_Param20 78049 15725 ns/op 4485 B/op 20 allocs/op
-BenchmarkGoRestful_Param20 66907 18031 ns/op 6716 B/op 18 allocs/op
-BenchmarkGorillaMux_Param20 81866 12422 ns/op 3452 B/op 12 allocs/op
-BenchmarkGowwwRouter_Param20 955983 1688 ns/op 432 B/op 3 allocs/op
-BenchmarkHttpRouter_Param20 1000000 1629 ns/op 640 B/op 1 allocs/op
-BenchmarkHttpTreeMux_Param20 108940 10241 ns/op 3195 B/op 10 allocs/op
-BenchmarkKocha_Param20 197022 5488 ns/op 1808 B/op 27 allocs/op
-BenchmarkLARS_Param20 2451241 490 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_Param20 106770 10788 ns/op 2923 B/op 12 allocs/op
-BenchmarkMartini_Param20 69028 17112 ns/op 3596 B/op 13 allocs/op
-BenchmarkPat_Param20 56275 21535 ns/op 4424 B/op 93 allocs/op
-BenchmarkPossum_Param20 1000000 1705 ns/op 496 B/op 5 allocs/op
-BenchmarkR2router_Param20 172215 7099 ns/op 2283 B/op 7 allocs/op
-BenchmarkRivet_Param20 447265 2987 ns/op 1024 B/op 1 allocs/op
-BenchmarkTango_Param20 327494 3850 ns/op 856 B/op 8 allocs/op
-BenchmarkTigerTonic_Param20 27176 44571 ns/op 9871 B/op 119 allocs/op
-BenchmarkTraffic_Param20 38828 31025 ns/op 7856 B/op 47 allocs/op
-BenchmarkVulcan_Param20 560442 1807 ns/op 98 B/op 3 allocs/op
-
-BenchmarkAce_ParamWrite 2712150 442 ns/op 40 B/op 2 allocs/op
-BenchmarkAero_ParamWrite 6392880 189 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_ParamWrite 1000000 1338 ns/op 456 B/op 5 allocs/op
-BenchmarkBeego_ParamWrite 821431 1886 ns/op 360 B/op 4 allocs/op
-BenchmarkBone_ParamWrite 913227 2350 ns/op 816 B/op 6 allocs/op
-BenchmarkChi_ParamWrite 1000000 1427 ns/op 432 B/op 3 allocs/op
-BenchmarkCloudyKitRouter_ParamWrite 18645724 60.9 ns/op 0 B/op 0 allocs/op
-BenchmarkDenco_ParamWrite 4394764 264 ns/op 32 B/op 1 allocs/op
-BenchmarkEcho_ParamWrite 5288883 242 ns/op 8 B/op 1 allocs/op
-BenchmarkGin_ParamWrite 4584932 253 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_ParamWrite 866242 2094 ns/op 656 B/op 9 allocs/op
-BenchmarkGoji_ParamWrite 1201875 1004 ns/op 336 B/op 2 allocs/op
-BenchmarkGojiv2_ParamWrite 317766 3777 ns/op 1360 B/op 13 allocs/op
-BenchmarkGoJsonRest_ParamWrite 380242 3447 ns/op 1128 B/op 18 allocs/op
-BenchmarkGoRestful_ParamWrite 131046 9340 ns/op 4200 B/op 15 allocs/op
-BenchmarkGorillaMux_ParamWrite 298428 3970 ns/op 1280 B/op 10 allocs/op
-BenchmarkGowwwRouter_ParamWrite 655940 2744 ns/op 976 B/op 8 allocs/op
-BenchmarkHttpRouter_ParamWrite 5237014 219 ns/op 32 B/op 1 allocs/op
-BenchmarkHttpTreeMux_ParamWrite 1379904 853 ns/op 352 B/op 3 allocs/op
-BenchmarkKocha_ParamWrite 2939042 400 ns/op 56 B/op 3 allocs/op
-BenchmarkLARS_ParamWrite 6181642 199 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_ParamWrite 352497 4670 ns/op 1176 B/op 14 allocs/op
-BenchmarkMartini_ParamWrite 138259 8543 ns/op 1176 B/op 14 allocs/op
-BenchmarkPat_ParamWrite 552386 3262 ns/op 960 B/op 15 allocs/op
-BenchmarkPossum_ParamWrite 1000000 1711 ns/op 496 B/op 5 allocs/op
-BenchmarkR2router_ParamWrite 1000000 1085 ns/op 432 B/op 5 allocs/op
-BenchmarkRivet_ParamWrite 2374513 489 ns/op 112 B/op 2 allocs/op
-BenchmarkTango_ParamWrite 1443907 812 ns/op 136 B/op 4 allocs/op
-BenchmarkTigerTonic_ParamWrite 324264 4874 ns/op 1216 B/op 21 allocs/op
-BenchmarkTraffic_ParamWrite 170726 7155 ns/op 2280 B/op 25 allocs/op
-BenchmarkVulcan_ParamWrite 1498888 776 ns/op 98 B/op 3 allocs/op
+```sh
+BenchmarkGin_Param 18785022 63.9 ns/op 0 B/op 0 allocs/op
+BenchmarkAce_Param 14689765 81.5 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_Param 23094770 51.2 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_Param 1417045 845 ns/op 456 B/op 5 allocs/op
+BenchmarkBeego_Param 1000000 1080 ns/op 352 B/op 3 allocs/op
+BenchmarkBone_Param 1000000 1463 ns/op 816 B/op 6 allocs/op
+BenchmarkChi_Param 1378756 885 ns/op 432 B/op 3 allocs/op
+BenchmarkDenco_Param 8557899 143 ns/op 32 B/op 1 allocs/op
+BenchmarkEcho_Param 16433347 75.5 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_Param 1000000 1218 ns/op 648 B/op 8 allocs/op
+BenchmarkGoji_Param 1921248 617 ns/op 336 B/op 2 allocs/op
+BenchmarkGojiv2_Param 561848 2156 ns/op 1328 B/op 11 allocs/op
+BenchmarkGoJsonRest_Param 1000000 1358 ns/op 649 B/op 13 allocs/op
+BenchmarkGoRestful_Param 224857 5307 ns/op 4192 B/op 14 allocs/op
+BenchmarkGorillaMux_Param 498313 2459 ns/op 1280 B/op 10 allocs/op
+BenchmarkGowwwRouter_Param 1864354 654 ns/op 432 B/op 3 allocs/op
+BenchmarkHttpRouter_Param 26269074 47.7 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_Param 2109829 557 ns/op 352 B/op 3 allocs/op
+BenchmarkKocha_Param 5050216 243 ns/op 56 B/op 3 allocs/op
+BenchmarkLARS_Param 19811712 59.9 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_Param 662746 2329 ns/op 1072 B/op 10 allocs/op
+BenchmarkMartini_Param 279902 4260 ns/op 1072 B/op 10 allocs/op
+BenchmarkPat_Param 1000000 1382 ns/op 536 B/op 11 allocs/op
+BenchmarkPossum_Param 1000000 1014 ns/op 496 B/op 5 allocs/op
+BenchmarkR2router_Param 1712559 707 ns/op 432 B/op 5 allocs/op
+BenchmarkRivet_Param 6648086 182 ns/op 48 B/op 1 allocs/op
+BenchmarkTango_Param 1221504 994 ns/op 248 B/op 8 allocs/op
+BenchmarkTigerTonic_Param 891661 2261 ns/op 776 B/op 16 allocs/op
+BenchmarkTraffic_Param 350059 3598 ns/op 1856 B/op 21 allocs/op
+BenchmarkVulcan_Param 2517823 472 ns/op 98 B/op 3 allocs/op
+BenchmarkAce_Param5 9214365 130 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_Param5 15369013 77.9 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_Param5 1000000 1113 ns/op 501 B/op 5 allocs/op
+BenchmarkBeego_Param5 1000000 1269 ns/op 352 B/op 3 allocs/op
+BenchmarkBone_Param5 986820 1873 ns/op 864 B/op 6 allocs/op
+BenchmarkChi_Param5 1000000 1156 ns/op 432 B/op 3 allocs/op
+BenchmarkDenco_Param5 3036331 400 ns/op 160 B/op 1 allocs/op
+BenchmarkEcho_Param5 6447133 186 ns/op 0 B/op 0 allocs/op
+BenchmarkGin_Param5 10786068 110 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_Param5 844820 1944 ns/op 920 B/op 11 allocs/op
+BenchmarkGoji_Param5 1474965 827 ns/op 336 B/op 2 allocs/op
+BenchmarkGojiv2_Param5 442820 2516 ns/op 1392 B/op 11 allocs/op
+BenchmarkGoJsonRest_Param5 507555 2711 ns/op 1097 B/op 16 allocs/op
+BenchmarkGoRestful_Param5 216481 6093 ns/op 4288 B/op 14 allocs/op
+BenchmarkGorillaMux_Param5 314402 3628 ns/op 1344 B/op 10 allocs/op
+BenchmarkGowwwRouter_Param5 1624660 733 ns/op 432 B/op 3 allocs/op
+BenchmarkHttpRouter_Param5 13167324 92.0 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_Param5 1000000 1295 ns/op 576 B/op 6 allocs/op
+BenchmarkKocha_Param5 1000000 1138 ns/op 440 B/op 10 allocs/op
+BenchmarkLARS_Param5 11580613 105 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_Param5 473596 2755 ns/op 1072 B/op 10 allocs/op
+BenchmarkMartini_Param5 230756 5111 ns/op 1232 B/op 11 allocs/op
+BenchmarkPat_Param5 469190 3370 ns/op 888 B/op 29 allocs/op
+BenchmarkPossum_Param5 1000000 1002 ns/op 496 B/op 5 allocs/op
+BenchmarkR2router_Param5 1422129 844 ns/op 432 B/op 5 allocs/op
+BenchmarkRivet_Param5 2263789 539 ns/op 240 B/op 1 allocs/op
+BenchmarkTango_Param5 1000000 1256 ns/op 360 B/op 8 allocs/op
+BenchmarkTigerTonic_Param5 175500 7492 ns/op 2279 B/op 39 allocs/op
+BenchmarkTraffic_Param5 233631 5816 ns/op 2208 B/op 27 allocs/op
+BenchmarkVulcan_Param5 1923416 629 ns/op 98 B/op 3 allocs/op
+BenchmarkAce_Param20 4321266 281 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_Param20 31501641 35.2 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_Param20 335204 3489 ns/op 1665 B/op 5 allocs/op
+BenchmarkBeego_Param20 503674 2860 ns/op 352 B/op 3 allocs/op
+BenchmarkBone_Param20 298922 4741 ns/op 2031 B/op 6 allocs/op
+BenchmarkChi_Param20 878181 1957 ns/op 432 B/op 3 allocs/op
+BenchmarkDenco_Param20 1000000 1360 ns/op 640 B/op 1 allocs/op
+BenchmarkEcho_Param20 2104946 580 ns/op 0 B/op 0 allocs/op
+BenchmarkGin_Param20 4167204 290 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_Param20 173064 7514 ns/op 3796 B/op 15 allocs/op
+BenchmarkGoji_Param20 458778 2651 ns/op 1247 B/op 2 allocs/op
+BenchmarkGojiv2_Param20 364862 3178 ns/op 1632 B/op 11 allocs/op
+BenchmarkGoJsonRest_Param20 125514 9760 ns/op 4485 B/op 20 allocs/op
+BenchmarkGoRestful_Param20 101217 11964 ns/op 6715 B/op 18 allocs/op
+BenchmarkGorillaMux_Param20 147654 8132 ns/op 3452 B/op 12 allocs/op
+BenchmarkGowwwRouter_Param20 1000000 1225 ns/op 432 B/op 3 allocs/op
+BenchmarkHttpRouter_Param20 4920895 247 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_Param20 173202 6605 ns/op 3196 B/op 10 allocs/op
+BenchmarkKocha_Param20 345988 3620 ns/op 1808 B/op 27 allocs/op
+BenchmarkLARS_Param20 4592326 262 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_Param20 166492 7286 ns/op 2924 B/op 12 allocs/op
+BenchmarkMartini_Param20 122162 10653 ns/op 3595 B/op 13 allocs/op
+BenchmarkPat_Param20 78630 15239 ns/op 4424 B/op 93 allocs/op
+BenchmarkPossum_Param20 1000000 1008 ns/op 496 B/op 5 allocs/op
+BenchmarkR2router_Param20 294981 4587 ns/op 2284 B/op 7 allocs/op
+BenchmarkRivet_Param20 691798 2090 ns/op 1024 B/op 1 allocs/op
+BenchmarkTango_Param20 842440 2505 ns/op 856 B/op 8 allocs/op
+BenchmarkTigerTonic_Param20 38614 31509 ns/op 9870 B/op 119 allocs/op
+BenchmarkTraffic_Param20 57633 21107 ns/op 7853 B/op 47 allocs/op
+BenchmarkVulcan_Param20 1000000 1178 ns/op 98 B/op 3 allocs/op
+BenchmarkAce_ParamWrite 7330743 180 ns/op 8 B/op 1 allocs/op
+BenchmarkAero_ParamWrite 13833598 86.7 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_ParamWrite 1363321 867 ns/op 456 B/op 5 allocs/op
+BenchmarkBeego_ParamWrite 1000000 1104 ns/op 360 B/op 4 allocs/op
+BenchmarkBone_ParamWrite 1000000 1475 ns/op 816 B/op 6 allocs/op
+BenchmarkChi_ParamWrite 1320590 892 ns/op 432 B/op 3 allocs/op
+BenchmarkDenco_ParamWrite 7093605 172 ns/op 32 B/op 1 allocs/op
+BenchmarkEcho_ParamWrite 8434424 161 ns/op 8 B/op 1 allocs/op
+BenchmarkGin_ParamWrite 10377034 118 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_ParamWrite 1000000 1266 ns/op 656 B/op 9 allocs/op
+BenchmarkGoji_ParamWrite 1874168 654 ns/op 336 B/op 2 allocs/op
+BenchmarkGojiv2_ParamWrite 459032 2352 ns/op 1360 B/op 13 allocs/op
+BenchmarkGoJsonRest_ParamWrite 499434 2145 ns/op 1128 B/op 18 allocs/op
+BenchmarkGoRestful_ParamWrite 241087 5470 ns/op 4200 B/op 15 allocs/op
+BenchmarkGorillaMux_ParamWrite 425686 2522 ns/op 1280 B/op 10 allocs/op
+BenchmarkGowwwRouter_ParamWrite 922172 1778 ns/op 976 B/op 8 allocs/op
+BenchmarkHttpRouter_ParamWrite 15392049 77.7 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_ParamWrite 1973385 597 ns/op 352 B/op 3 allocs/op
+BenchmarkKocha_ParamWrite 4262500 281 ns/op 56 B/op 3 allocs/op
+BenchmarkLARS_ParamWrite 10764410 113 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_ParamWrite 486769 2726 ns/op 1176 B/op 14 allocs/op
+BenchmarkMartini_ParamWrite 264804 4842 ns/op 1176 B/op 14 allocs/op
+BenchmarkPat_ParamWrite 735116 2047 ns/op 960 B/op 15 allocs/op
+BenchmarkPossum_ParamWrite 1000000 1004 ns/op 496 B/op 5 allocs/op
+BenchmarkR2router_ParamWrite 1592136 768 ns/op 432 B/op 5 allocs/op
+BenchmarkRivet_ParamWrite 3582051 339 ns/op 112 B/op 2 allocs/op
+BenchmarkTango_ParamWrite 2237337 534 ns/op 136 B/op 4 allocs/op
+BenchmarkTigerTonic_ParamWrite 439608 3136 ns/op 1216 B/op 21 allocs/op
+BenchmarkTraffic_ParamWrite 306979 4328 ns/op 2280 B/op 25 allocs/op
+BenchmarkVulcan_ParamWrite 2529973 472 ns/op 98 B/op 3 allocs/op
```
## GitHub
-```
-BenchmarkGin_GithubStatic 5866748 194 ns/op 0 B/op 0 allocs/op
+```sh
+BenchmarkGin_GithubStatic 15629472 76.7 ns/op 0 B/op 0 allocs/op
-BenchmarkAce_GithubStatic 5815826 205 ns/op 0 B/op 0 allocs/op
-BenchmarkAero_GithubStatic 10822906 106 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_GithubStatic 1678065 707 ns/op 120 B/op 3 allocs/op
-BenchmarkBeego_GithubStatic 828814 1717 ns/op 352 B/op 3 allocs/op
-BenchmarkBone_GithubStatic 67484 18858 ns/op 2880 B/op 60 allocs/op
-BenchmarkCloudyKitRouter_GithubStatic 10219297 115 ns/op 0 B/op 0 allocs/op
-BenchmarkChi_GithubStatic 1000000 1348 ns/op 432 B/op 3 allocs/op
-BenchmarkDenco_GithubStatic 15220622 75.4 ns/op 0 B/op 0 allocs/op
-BenchmarkEcho_GithubStatic 7255897 158 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_GithubStatic 1000000 1198 ns/op 296 B/op 5 allocs/op
-BenchmarkGoji_GithubStatic 3659361 320 ns/op 0 B/op 0 allocs/op
-BenchmarkGojiv2_GithubStatic 402402 3384 ns/op 1312 B/op 10 allocs/op
-BenchmarkGoRestful_GithubStatic 54592 22045 ns/op 4256 B/op 13 allocs/op
-BenchmarkGoJsonRest_GithubStatic 801067 1673 ns/op 329 B/op 11 allocs/op
-BenchmarkGorillaMux_GithubStatic 169690 8171 ns/op 976 B/op 9 allocs/op
-BenchmarkGowwwRouter_GithubStatic 5372910 218 ns/op 0 B/op 0 allocs/op
-BenchmarkHttpRouter_GithubStatic 10965576 103 ns/op 0 B/op 0 allocs/op
-BenchmarkHttpTreeMux_GithubStatic 10505365 106 ns/op 0 B/op 0 allocs/op
-BenchmarkKocha_GithubStatic 14153763 81.9 ns/op 0 B/op 0 allocs/op
-BenchmarkLARS_GithubStatic 7874017 152 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_GithubStatic 696940 2678 ns/op 736 B/op 8 allocs/op
-BenchmarkMartini_GithubStatic 102384 12276 ns/op 768 B/op 9 allocs/op
-BenchmarkPat_GithubStatic 69907 17437 ns/op 3648 B/op 76 allocs/op
-BenchmarkPossum_GithubStatic 1000000 1262 ns/op 416 B/op 3 allocs/op
-BenchmarkR2router_GithubStatic 1981592 614 ns/op 144 B/op 4 allocs/op
-BenchmarkRivet_GithubStatic 6103872 196 ns/op 0 B/op 0 allocs/op
-BenchmarkTango_GithubStatic 629551 2023 ns/op 248 B/op 8 allocs/op
-BenchmarkTigerTonic_GithubStatic 2801569 424 ns/op 48 B/op 1 allocs/op
-BenchmarkTraffic_GithubStatic 63716 18009 ns/op 4664 B/op 90 allocs/op
-BenchmarkVulcan_GithubStatic 885640 1177 ns/op 98 B/op 3 allocs/op
-
-BenchmarkAce_GithubParam 2016942 582 ns/op 96 B/op 1 allocs/op
-BenchmarkAero_GithubParam 4009522 296 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_GithubParam 1000000 1575 ns/op 496 B/op 5 allocs/op
-BenchmarkBeego_GithubParam 796662 2038 ns/op 352 B/op 3 allocs/op
-BenchmarkBone_GithubParam 114823 10325 ns/op 1888 B/op 19 allocs/op
-BenchmarkChi_GithubParam 1000000 1783 ns/op 432 B/op 3 allocs/op
-BenchmarkCloudyKitRouter_GithubParam 3910996 303 ns/op 0 B/op 0 allocs/op
-BenchmarkDenco_GithubParam 2298172 521 ns/op 128 B/op 1 allocs/op
-BenchmarkEcho_GithubParam 3336364 357 ns/op 0 B/op 0 allocs/op
-BenchmarkGin_GithubParam 2729161 439 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_GithubParam 825784 2338 ns/op 712 B/op 9 allocs/op
-BenchmarkGoji_GithubParam 933397 1559 ns/op 336 B/op 2 allocs/op
-BenchmarkGojiv2_GithubParam 253884 4335 ns/op 1408 B/op 13 allocs/op
-BenchmarkGoJsonRest_GithubParam 575532 2967 ns/op 713 B/op 14 allocs/op
-BenchmarkGoRestful_GithubParam 38160 30638 ns/op 4352 B/op 16 allocs/op
-BenchmarkGorillaMux_GithubParam 94554 12035 ns/op 1296 B/op 10 allocs/op
-BenchmarkGowwwRouter_GithubParam 1000000 1223 ns/op 432 B/op 3 allocs/op
-BenchmarkHttpRouter_GithubParam 2562079 468 ns/op 96 B/op 1 allocs/op
-BenchmarkHttpTreeMux_GithubParam 1000000 1386 ns/op 384 B/op 4 allocs/op
-BenchmarkKocha_GithubParam 1573026 754 ns/op 128 B/op 5 allocs/op
-BenchmarkLARS_GithubParam 4203394 282 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_GithubParam 365078 4137 ns/op 1072 B/op 10 allocs/op
-BenchmarkMartini_GithubParam 71608 15811 ns/op 1152 B/op 11 allocs/op
-BenchmarkPat_GithubParam 92768 13297 ns/op 2408 B/op 48 allocs/op
-BenchmarkPossum_GithubParam 1000000 1704 ns/op 496 B/op 5 allocs/op
-BenchmarkR2router_GithubParam 1000000 1120 ns/op 432 B/op 5 allocs/op
-BenchmarkRivet_GithubParam 1642794 720 ns/op 96 B/op 1 allocs/op
-BenchmarkTango_GithubParam 574195 2345 ns/op 344 B/op 8 allocs/op
-BenchmarkTigerTonic_GithubParam 272430 5493 ns/op 1176 B/op 22 allocs/op
-BenchmarkTraffic_GithubParam 81914 15078 ns/op 2816 B/op 40 allocs/op
-BenchmarkVulcan_GithubParam 581272 1902 ns/op 98 B/op 3 allocs/op
-
-
-BenchmarkAce_GithubAll 10000 103571 ns/op 13792 B/op 167 allocs/op
-BenchmarkAero_GithubAll 21366 55615 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_GithubAll 5288 327648 ns/op 86448 B/op 943 allocs/op
-BenchmarkBeego_GithubAll 3974 413453 ns/op 71456 B/op 609 allocs/op
-BenchmarkBone_GithubAll 267 4450294 ns/op 720160 B/op 8620 allocs/op
-BenchmarkChi_GithubAll 5067 358773 ns/op 87696 B/op 609 allocs/op
-BenchmarkCloudyKitRouter_GithubAll 24210 49233 ns/op 0 B/op 0 allocs/op
-BenchmarkDenco_GithubAll 12508 95341 ns/op 20224 B/op 167 allocs/op
-BenchmarkEcho_GithubAll 16353 73267 ns/op 0 B/op 0 allocs/op
-BenchmarkGin_GithubAll 15516 77716 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_GithubAll 2908 466970 ns/op 131656 B/op 1686 allocs/op
-BenchmarkGoji_GithubAll 1746 691392 ns/op 56112 B/op 334 allocs/op
-BenchmarkGojiv2_GithubAll 954 1289604 ns/op 352720 B/op 4321 allocs/op
-BenchmarkGoJsonRest_GithubAll 2013 599088 ns/op 134371 B/op 2737 allocs/op
-BenchmarkGoRestful_GithubAll 223 5404307 ns/op 910144 B/op 2938 allocs/op
-BenchmarkGorillaMux_GithubAll 202 5943565 ns/op 251650 B/op 1994 allocs/op
-BenchmarkGowwwRouter_GithubAll 9009 227799 ns/op 72144 B/op 501 allocs/op
-BenchmarkHttpRouter_GithubAll 14570 78718 ns/op 13792 B/op 167 allocs/op
-BenchmarkHttpTreeMux_GithubAll 7226 242491 ns/op 65856 B/op 671 allocs/op
-BenchmarkKocha_GithubAll 8282 159873 ns/op 23304 B/op 843 allocs/op
-BenchmarkLARS_GithubAll 22711 52745 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_GithubAll 2067 563117 ns/op 149409 B/op 1624 allocs/op
-BenchmarkMartini_GithubAll 218 5455290 ns/op 226552 B/op 2325 allocs/op
-BenchmarkPat_GithubAll 174 6801582 ns/op 1483152 B/op 26963 allocs/op
-BenchmarkPossum_GithubAll 8113 263665 ns/op 84448 B/op 609 allocs/op
-BenchmarkR2router_GithubAll 7172 247198 ns/op 77328 B/op 979 allocs/op
-BenchmarkRivet_GithubAll 10000 128086 ns/op 16272 B/op 167 allocs/op
-BenchmarkTango_GithubAll 3316 472753 ns/op 63825 B/op 1618 allocs/op
-BenchmarkTigerTonic_GithubAll 1176 1041991 ns/op 193856 B/op 4474 allocs/op
-BenchmarkTraffic_GithubAll 226 5312082 ns/op 820742 B/op 14114 allocs/op
-BenchmarkVulcan_GithubAll 3904 304440 ns/op 19894 B/op 609 allocs/op
+BenchmarkAce_GithubStatic 15542612 75.9 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_GithubStatic 24777151 48.5 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_GithubStatic 2788894 435 ns/op 120 B/op 3 allocs/op
+BenchmarkBeego_GithubStatic 1000000 1064 ns/op 352 B/op 3 allocs/op
+BenchmarkBone_GithubStatic 93507 12838 ns/op 2880 B/op 60 allocs/op
+BenchmarkChi_GithubStatic 1387743 860 ns/op 432 B/op 3 allocs/op
+BenchmarkDenco_GithubStatic 39384996 30.4 ns/op 0 B/op 0 allocs/op
+BenchmarkEcho_GithubStatic 12076382 99.1 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_GithubStatic 1596495 756 ns/op 296 B/op 5 allocs/op
+BenchmarkGoji_GithubStatic 6364876 189 ns/op 0 B/op 0 allocs/op
+BenchmarkGojiv2_GithubStatic 550202 2098 ns/op 1312 B/op 10 allocs/op
+BenchmarkGoRestful_GithubStatic 102183 12552 ns/op 4256 B/op 13 allocs/op
+BenchmarkGoJsonRest_GithubStatic 1000000 1029 ns/op 329 B/op 11 allocs/op
+BenchmarkGorillaMux_GithubStatic 255552 5190 ns/op 976 B/op 9 allocs/op
+BenchmarkGowwwRouter_GithubStatic 15531916 77.1 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpRouter_GithubStatic 27920724 43.1 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_GithubStatic 21448953 55.8 ns/op 0 B/op 0 allocs/op
+BenchmarkKocha_GithubStatic 21405310 56.0 ns/op 0 B/op 0 allocs/op
+BenchmarkLARS_GithubStatic 13625156 89.0 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_GithubStatic 1000000 1747 ns/op 736 B/op 8 allocs/op
+BenchmarkMartini_GithubStatic 187186 7326 ns/op 768 B/op 9 allocs/op
+BenchmarkPat_GithubStatic 109143 11563 ns/op 3648 B/op 76 allocs/op
+BenchmarkPossum_GithubStatic 1575898 770 ns/op 416 B/op 3 allocs/op
+BenchmarkR2router_GithubStatic 3046231 404 ns/op 144 B/op 4 allocs/op
+BenchmarkRivet_GithubStatic 11484826 105 ns/op 0 B/op 0 allocs/op
+BenchmarkTango_GithubStatic 1000000 1153 ns/op 248 B/op 8 allocs/op
+BenchmarkTigerTonic_GithubStatic 4929780 249 ns/op 48 B/op 1 allocs/op
+BenchmarkTraffic_GithubStatic 106351 11819 ns/op 4664 B/op 90 allocs/op
+BenchmarkVulcan_GithubStatic 1613271 722 ns/op 98 B/op 3 allocs/op
+BenchmarkAce_GithubParam 8386032 143 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_GithubParam 11816200 102 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_GithubParam 1000000 1012 ns/op 496 B/op 5 allocs/op
+BenchmarkBeego_GithubParam 1000000 1157 ns/op 352 B/op 3 allocs/op
+BenchmarkBone_GithubParam 184653 6912 ns/op 1888 B/op 19 allocs/op
+BenchmarkChi_GithubParam 1000000 1102 ns/op 432 B/op 3 allocs/op
+BenchmarkDenco_GithubParam 3484798 352 ns/op 128 B/op 1 allocs/op
+BenchmarkEcho_GithubParam 6337380 189 ns/op 0 B/op 0 allocs/op
+BenchmarkGin_GithubParam 9132032 131 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_GithubParam 1000000 1446 ns/op 712 B/op 9 allocs/op
+BenchmarkGoji_GithubParam 1248640 977 ns/op 336 B/op 2 allocs/op
+BenchmarkGojiv2_GithubParam 383233 2784 ns/op 1408 B/op 13 allocs/op
+BenchmarkGoJsonRest_GithubParam 1000000 1991 ns/op 713 B/op 14 allocs/op
+BenchmarkGoRestful_GithubParam 76414 16015 ns/op 4352 B/op 16 allocs/op
+BenchmarkGorillaMux_GithubParam 150026 7663 ns/op 1296 B/op 10 allocs/op
+BenchmarkGowwwRouter_GithubParam 1592044 751 ns/op 432 B/op 3 allocs/op
+BenchmarkHttpRouter_GithubParam 10420628 115 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_GithubParam 1403755 835 ns/op 384 B/op 4 allocs/op
+BenchmarkKocha_GithubParam 2286170 533 ns/op 128 B/op 5 allocs/op
+BenchmarkLARS_GithubParam 9540374 129 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_GithubParam 533154 2742 ns/op 1072 B/op 10 allocs/op
+BenchmarkMartini_GithubParam 119397 9638 ns/op 1152 B/op 11 allocs/op
+BenchmarkPat_GithubParam 150675 8858 ns/op 2408 B/op 48 allocs/op
+BenchmarkPossum_GithubParam 1000000 1001 ns/op 496 B/op 5 allocs/op
+BenchmarkR2router_GithubParam 1602886 761 ns/op 432 B/op 5 allocs/op
+BenchmarkRivet_GithubParam 2986579 409 ns/op 96 B/op 1 allocs/op
+BenchmarkTango_GithubParam 1000000 1356 ns/op 344 B/op 8 allocs/op
+BenchmarkTigerTonic_GithubParam 388899 3429 ns/op 1176 B/op 22 allocs/op
+BenchmarkTraffic_GithubParam 123160 9734 ns/op 2816 B/op 40 allocs/op
+BenchmarkVulcan_GithubParam 1000000 1138 ns/op 98 B/op 3 allocs/op
+BenchmarkAce_GithubAll 40543 29670 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_GithubAll 57632 20648 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_GithubAll 9234 216179 ns/op 86448 B/op 943 allocs/op
+BenchmarkBeego_GithubAll 7407 243496 ns/op 71456 B/op 609 allocs/op
+BenchmarkBone_GithubAll 420 2922835 ns/op 720160 B/op 8620 allocs/op
+BenchmarkChi_GithubAll 7620 238331 ns/op 87696 B/op 609 allocs/op
+BenchmarkDenco_GithubAll 18355 64494 ns/op 20224 B/op 167 allocs/op
+BenchmarkEcho_GithubAll 31251 38479 ns/op 0 B/op 0 allocs/op
+BenchmarkGin_GithubAll 43550 27364 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_GithubAll 4117 300062 ns/op 131656 B/op 1686 allocs/op
+BenchmarkGoji_GithubAll 3274 416158 ns/op 56112 B/op 334 allocs/op
+BenchmarkGojiv2_GithubAll 1402 870518 ns/op 352720 B/op 4321 allocs/op
+BenchmarkGoJsonRest_GithubAll 2976 401507 ns/op 134371 B/op 2737 allocs/op
+BenchmarkGoRestful_GithubAll 410 2913158 ns/op 910144 B/op 2938 allocs/op
+BenchmarkGorillaMux_GithubAll 346 3384987 ns/op 251650 B/op 1994 allocs/op
+BenchmarkGowwwRouter_GithubAll 10000 143025 ns/op 72144 B/op 501 allocs/op
+BenchmarkHttpRouter_GithubAll 55938 21360 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_GithubAll 10000 153944 ns/op 65856 B/op 671 allocs/op
+BenchmarkKocha_GithubAll 10000 106315 ns/op 23304 B/op 843 allocs/op
+BenchmarkLARS_GithubAll 47779 25084 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_GithubAll 3266 371907 ns/op 149409 B/op 1624 allocs/op
+BenchmarkMartini_GithubAll 331 3444706 ns/op 226551 B/op 2325 allocs/op
+BenchmarkPat_GithubAll 273 4381818 ns/op 1483152 B/op 26963 allocs/op
+BenchmarkPossum_GithubAll 10000 164367 ns/op 84448 B/op 609 allocs/op
+BenchmarkR2router_GithubAll 10000 160220 ns/op 77328 B/op 979 allocs/op
+BenchmarkRivet_GithubAll 14625 82453 ns/op 16272 B/op 167 allocs/op
+BenchmarkTango_GithubAll 6255 279611 ns/op 63826 B/op 1618 allocs/op
+BenchmarkTigerTonic_GithubAll 2008 687874 ns/op 193856 B/op 4474 allocs/op
+BenchmarkTraffic_GithubAll 355 3478508 ns/op 820744 B/op 14114 allocs/op
+BenchmarkVulcan_GithubAll 6885 193333 ns/op 19894 B/op 609 allocs/op
```
## Google+
-```
-BenchmarkGin_GPlusStatic 9172405 124 ns/op 0 B/op 0 allocs/op
+```sh
+BenchmarkGin_GPlusStatic 19247326 62.2 ns/op 0 B/op 0 allocs/op
-BenchmarkAce_GPlusStatic 7784710 152 ns/op 0 B/op 0 allocs/op
-BenchmarkAero_GPlusStatic 12771894 89.2 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_GPlusStatic 2351325 512 ns/op 104 B/op 3 allocs/op
-BenchmarkBeego_GPlusStatic 1000000 1643 ns/op 352 B/op 3 allocs/op
-BenchmarkBone_GPlusStatic 4419217 263 ns/op 32 B/op 1 allocs/op
-BenchmarkChi_GPlusStatic 1000000 1282 ns/op 432 B/op 3 allocs/op
-BenchmarkCloudyKitRouter_GPlusStatic 17730754 61.9 ns/op 0 B/op 0 allocs/op
-BenchmarkDenco_GPlusStatic 29549895 38.3 ns/op 0 B/op 0 allocs/op
-BenchmarkEcho_GPlusStatic 10521789 111 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_GPlusStatic 1000000 1053 ns/op 280 B/op 5 allocs/op
-BenchmarkGoji_GPlusStatic 5209968 228 ns/op 0 B/op 0 allocs/op
-BenchmarkGojiv2_GPlusStatic 306363 3348 ns/op 1312 B/op 10 allocs/op
-BenchmarkGoJsonRest_GPlusStatic 1000000 1424 ns/op 329 B/op 11 allocs/op
-BenchmarkGoRestful_GPlusStatic 130754 8760 ns/op 3872 B/op 13 allocs/op
-BenchmarkGorillaMux_GPlusStatic 496250 2860 ns/op 976 B/op 9 allocs/op
-BenchmarkGowwwRouter_GPlusStatic 16401519 66.5 ns/op 0 B/op 0 allocs/op
-BenchmarkHttpRouter_GPlusStatic 21323139 50.3 ns/op 0 B/op 0 allocs/op
-BenchmarkHttpTreeMux_GPlusStatic 14877926 68.7 ns/op 0 B/op 0 allocs/op
-BenchmarkKocha_GPlusStatic 18375128 57.6 ns/op 0 B/op 0 allocs/op
-BenchmarkLARS_GPlusStatic 11153810 101 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_GPlusStatic 652598 2720 ns/op 736 B/op 8 allocs/op
-BenchmarkMartini_GPlusStatic 218824 6532 ns/op 768 B/op 9 allocs/op
-BenchmarkPat_GPlusStatic 2825560 428 ns/op 96 B/op 2 allocs/op
-BenchmarkPossum_GPlusStatic 1000000 1236 ns/op 416 B/op 3 allocs/op
-BenchmarkR2router_GPlusStatic 2222193 541 ns/op 144 B/op 4 allocs/op
-BenchmarkRivet_GPlusStatic 9802023 114 ns/op 0 B/op 0 allocs/op
-BenchmarkTango_GPlusStatic 980658 1465 ns/op 200 B/op 8 allocs/op
-BenchmarkTigerTonic_GPlusStatic 4882701 239 ns/op 32 B/op 1 allocs/op
-BenchmarkTraffic_GPlusStatic 508060 3465 ns/op 1112 B/op 16 allocs/op
-BenchmarkVulcan_GPlusStatic 1608979 725 ns/op 98 B/op 3 allocs/op
-
-BenchmarkAce_GPlusParam 2962957 414 ns/op 64 B/op 1 allocs/op
-BenchmarkAero_GPlusParam 5667668 202 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_GPlusParam 1000000 1271 ns/op 480 B/op 5 allocs/op
-BenchmarkBeego_GPlusParam 869858 1874 ns/op 352 B/op 3 allocs/op
-BenchmarkBone_GPlusParam 869476 2395 ns/op 816 B/op 6 allocs/op
-BenchmarkChi_GPlusParam 1000000 1469 ns/op 432 B/op 3 allocs/op
-BenchmarkCloudyKitRouter_GPlusParam 11149783 108 ns/op 0 B/op 0 allocs/op
-BenchmarkDenco_GPlusParam 4007298 301 ns/op 64 B/op 1 allocs/op
-BenchmarkEcho_GPlusParam 6448201 174 ns/op 0 B/op 0 allocs/op
-BenchmarkGin_GPlusParam 5470827 218 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_GPlusParam 1000000 1939 ns/op 648 B/op 8 allocs/op
-BenchmarkGoji_GPlusParam 1207621 997 ns/op 336 B/op 2 allocs/op
-BenchmarkGojiv2_GPlusParam 271326 4013 ns/op 1328 B/op 11 allocs/op
-BenchmarkGoJsonRest_GPlusParam 781062 2303 ns/op 649 B/op 13 allocs/op
-BenchmarkGoRestful_GPlusParam 121267 9871 ns/op 4192 B/op 14 allocs/op
-BenchmarkGorillaMux_GPlusParam 228406 5156 ns/op 1280 B/op 10 allocs/op
-BenchmarkGowwwRouter_GPlusParam 1000000 1074 ns/op 432 B/op 3 allocs/op
-BenchmarkHttpRouter_GPlusParam 4399740 276 ns/op 64 B/op 1 allocs/op
-BenchmarkHttpTreeMux_GPlusParam 1309540 898 ns/op 352 B/op 3 allocs/op
-BenchmarkKocha_GPlusParam 2930965 403 ns/op 56 B/op 3 allocs/op
-BenchmarkLARS_GPlusParam 7588237 151 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_GPlusParam 434997 4195 ns/op 1072 B/op 10 allocs/op
-BenchmarkMartini_GPlusParam 148207 8144 ns/op 1072 B/op 10 allocs/op
-BenchmarkPat_GPlusParam 566829 2533 ns/op 576 B/op 11 allocs/op
-BenchmarkPossum_GPlusParam 1000000 1723 ns/op 496 B/op 5 allocs/op
-BenchmarkR2router_GPlusParam 1000000 1100 ns/op 432 B/op 5 allocs/op
-BenchmarkRivet_GPlusParam 3309052 331 ns/op 48 B/op 1 allocs/op
-BenchmarkTango_GPlusParam 693728 1825 ns/op 264 B/op 8 allocs/op
-BenchmarkTigerTonic_GPlusParam 417693 3800 ns/op 856 B/op 16 allocs/op
-BenchmarkTraffic_GPlusParam 179424 6641 ns/op 1872 B/op 21 allocs/op
-BenchmarkVulcan_GPlusParam 1000000 1063 ns/op 98 B/op 3 allocs/op
-
-BenchmarkAce_GPlus2Params 2720149 460 ns/op 64 B/op 1 allocs/op
-BenchmarkAero_GPlus2Params 3525165 343 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_GPlus2Params 1000000 1502 ns/op 496 B/op 5 allocs/op
-BenchmarkBeego_GPlus2Params 730123 2102 ns/op 352 B/op 3 allocs/op
-BenchmarkBone_GPlus2Params 253177 5583 ns/op 1168 B/op 10 allocs/op
-BenchmarkChi_GPlus2Params 1000000 1531 ns/op 432 B/op 3 allocs/op
-BenchmarkCloudyKitRouter_GPlus2Params 6943176 168 ns/op 0 B/op 0 allocs/op
-BenchmarkDenco_GPlus2Params 2912601 413 ns/op 64 B/op 1 allocs/op
-BenchmarkEcho_GPlus2Params 4149189 278 ns/op 0 B/op 0 allocs/op
-BenchmarkGin_GPlus2Params 3271269 356 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_GPlus2Params 915531 2321 ns/op 712 B/op 9 allocs/op
-BenchmarkGoji_GPlus2Params 1000000 1413 ns/op 336 B/op 2 allocs/op
-BenchmarkGojiv2_GPlus2Params 256640 4521 ns/op 1408 B/op 14 allocs/op
-BenchmarkGoJsonRest_GPlus2Params 499140 3076 ns/op 713 B/op 14 allocs/op
-BenchmarkGoRestful_GPlus2Params 105928 10148 ns/op 4384 B/op 16 allocs/op
-BenchmarkGorillaMux_GPlus2Params 110953 9682 ns/op 1296 B/op 10 allocs/op
-BenchmarkGowwwRouter_GPlus2Params 1000000 1112 ns/op 432 B/op 3 allocs/op
-BenchmarkHttpRouter_GPlus2Params 3491893 321 ns/op 64 B/op 1 allocs/op
-BenchmarkHttpTreeMux_GPlus2Params 1000000 1341 ns/op 384 B/op 4 allocs/op
-BenchmarkKocha_GPlus2Params 1445288 790 ns/op 128 B/op 5 allocs/op
-BenchmarkLARS_GPlus2Params 6644953 185 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_GPlus2Params 424291 4321 ns/op 1072 B/op 10 allocs/op
-BenchmarkMartini_GPlus2Params 70866 16407 ns/op 1200 B/op 13 allocs/op
-BenchmarkPat_GPlus2Params 121308 10221 ns/op 2168 B/op 33 allocs/op
-BenchmarkPossum_GPlus2Params 1000000 1847 ns/op 496 B/op 5 allocs/op
-BenchmarkR2router_GPlus2Params 1000000 1267 ns/op 432 B/op 5 allocs/op
-BenchmarkRivet_GPlus2Params 2017526 590 ns/op 96 B/op 1 allocs/op
-BenchmarkTango_GPlus2Params 846003 2143 ns/op 344 B/op 8 allocs/op
-BenchmarkTigerTonic_GPlus2Params 303597 5736 ns/op 1200 B/op 22 allocs/op
-BenchmarkTraffic_GPlus2Params 95032 12817 ns/op 2248 B/op 28 allocs/op
-BenchmarkVulcan_GPlus2Params 692610 1575 ns/op 98 B/op 3 allocs/op
-
-BenchmarkAce_GPlusAll 271720 4948 ns/op 640 B/op 11 allocs/op
-BenchmarkAero_GPlusAll 367956 2926 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_GPlusAll 68161 17883 ns/op 5488 B/op 61 allocs/op
-BenchmarkBeego_GPlusAll 46634 25369 ns/op 4576 B/op 39 allocs/op
-BenchmarkBone_GPlusAll 24628 49198 ns/op 11744 B/op 109 allocs/op
-BenchmarkChi_GPlusAll 60778 19356 ns/op 5616 B/op 39 allocs/op
-BenchmarkCloudyKitRouter_GPlusAll 706952 1693 ns/op 0 B/op 0 allocs/op
-BenchmarkDenco_GPlusAll 327422 4222 ns/op 672 B/op 11 allocs/op
-BenchmarkEcho_GPlusAll 331987 3176 ns/op 0 B/op 0 allocs/op
-BenchmarkGin_GPlusAll 289526 3559 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_GPlusAll 45805 26768 ns/op 8040 B/op 103 allocs/op
-BenchmarkGoji_GPlusAll 74786 14428 ns/op 3696 B/op 22 allocs/op
-BenchmarkGojiv2_GPlusAll 23822 50355 ns/op 17616 B/op 154 allocs/op
-BenchmarkGoJsonRest_GPlusAll 35280 32989 ns/op 8117 B/op 170 allocs/op
-BenchmarkGoRestful_GPlusAll 10000 129418 ns/op 55520 B/op 192 allocs/op
-BenchmarkGorillaMux_GPlusAll 15968 76492 ns/op 16112 B/op 128 allocs/op
-BenchmarkGowwwRouter_GPlusAll 100096 12644 ns/op 4752 B/op 33 allocs/op
-BenchmarkHttpRouter_GPlusAll 474584 3704 ns/op 640 B/op 11 allocs/op
-BenchmarkHttpTreeMux_GPlusAll 98506 12480 ns/op 4032 B/op 38 allocs/op
-BenchmarkKocha_GPlusAll 213709 7358 ns/op 976 B/op 43 allocs/op
-BenchmarkLARS_GPlusAll 466608 2363 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_GPlusAll 34136 35790 ns/op 9568 B/op 104 allocs/op
-BenchmarkMartini_GPlusAll 8911 124543 ns/op 14016 B/op 145 allocs/op
-BenchmarkPat_GPlusAll 17391 69198 ns/op 15264 B/op 271 allocs/op
-BenchmarkPossum_GPlusAll 66774 17004 ns/op 5408 B/op 39 allocs/op
-BenchmarkR2router_GPlusAll 79681 13996 ns/op 5040 B/op 63 allocs/op
-BenchmarkRivet_GPlusAll 258788 5344 ns/op 768 B/op 11 allocs/op
-BenchmarkTango_GPlusAll 46930 25591 ns/op 3656 B/op 104 allocs/op
-BenchmarkTigerTonic_GPlusAll 20768 58038 ns/op 11600 B/op 242 allocs/op
-BenchmarkTraffic_GPlusAll 10000 108031 ns/op 26248 B/op 341 allocs/op
-BenchmarkVulcan_GPlusAll 71826 15724 ns/op 1274 B/op 39 allocs/op
+BenchmarkAce_GPlusStatic 20235060 59.2 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_GPlusStatic 31978935 37.6 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_GPlusStatic 3516523 341 ns/op 104 B/op 3 allocs/op
+BenchmarkBeego_GPlusStatic 1212036 991 ns/op 352 B/op 3 allocs/op
+BenchmarkBone_GPlusStatic 6736242 183 ns/op 32 B/op 1 allocs/op
+BenchmarkChi_GPlusStatic 1490640 814 ns/op 432 B/op 3 allocs/op
+BenchmarkDenco_GPlusStatic 55006856 21.8 ns/op 0 B/op 0 allocs/op
+BenchmarkEcho_GPlusStatic 17688258 67.9 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_GPlusStatic 1829181 666 ns/op 280 B/op 5 allocs/op
+BenchmarkGoji_GPlusStatic 9147451 130 ns/op 0 B/op 0 allocs/op
+BenchmarkGojiv2_GPlusStatic 594015 2063 ns/op 1312 B/op 10 allocs/op
+BenchmarkGoJsonRest_GPlusStatic 1264906 950 ns/op 329 B/op 11 allocs/op
+BenchmarkGoRestful_GPlusStatic 231558 5341 ns/op 3872 B/op 13 allocs/op
+BenchmarkGorillaMux_GPlusStatic 908418 1809 ns/op 976 B/op 9 allocs/op
+BenchmarkGowwwRouter_GPlusStatic 40684604 29.5 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpRouter_GPlusStatic 46742804 25.7 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_GPlusStatic 32567161 36.9 ns/op 0 B/op 0 allocs/op
+BenchmarkKocha_GPlusStatic 33800060 35.3 ns/op 0 B/op 0 allocs/op
+BenchmarkLARS_GPlusStatic 20431858 60.0 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_GPlusStatic 1000000 1745 ns/op 736 B/op 8 allocs/op
+BenchmarkMartini_GPlusStatic 442248 3619 ns/op 768 B/op 9 allocs/op
+BenchmarkPat_GPlusStatic 4328004 292 ns/op 96 B/op 2 allocs/op
+BenchmarkPossum_GPlusStatic 1570753 763 ns/op 416 B/op 3 allocs/op
+BenchmarkR2router_GPlusStatic 3339474 355 ns/op 144 B/op 4 allocs/op
+BenchmarkRivet_GPlusStatic 18570961 64.7 ns/op 0 B/op 0 allocs/op
+BenchmarkTango_GPlusStatic 1388702 860 ns/op 200 B/op 8 allocs/op
+BenchmarkTigerTonic_GPlusStatic 7803543 159 ns/op 32 B/op 1 allocs/op
+BenchmarkTraffic_GPlusStatic 878605 2171 ns/op 1112 B/op 16 allocs/op
+BenchmarkVulcan_GPlusStatic 2742446 437 ns/op 98 B/op 3 allocs/op
+BenchmarkAce_GPlusParam 11626975 105 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_GPlusParam 16914322 71.6 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_GPlusParam 1405173 832 ns/op 480 B/op 5 allocs/op
+BenchmarkBeego_GPlusParam 1000000 1075 ns/op 352 B/op 3 allocs/op
+BenchmarkBone_GPlusParam 1000000 1557 ns/op 816 B/op 6 allocs/op
+BenchmarkChi_GPlusParam 1347926 894 ns/op 432 B/op 3 allocs/op
+BenchmarkDenco_GPlusParam 5513000 212 ns/op 64 B/op 1 allocs/op
+BenchmarkEcho_GPlusParam 11884383 101 ns/op 0 B/op 0 allocs/op
+BenchmarkGin_GPlusParam 12898952 93.1 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_GPlusParam 1000000 1194 ns/op 648 B/op 8 allocs/op
+BenchmarkGoji_GPlusParam 1857229 645 ns/op 336 B/op 2 allocs/op
+BenchmarkGojiv2_GPlusParam 520939 2322 ns/op 1328 B/op 11 allocs/op
+BenchmarkGoJsonRest_GPlusParam 1000000 1536 ns/op 649 B/op 13 allocs/op
+BenchmarkGoRestful_GPlusParam 205449 5800 ns/op 4192 B/op 14 allocs/op
+BenchmarkGorillaMux_GPlusParam 395310 3188 ns/op 1280 B/op 10 allocs/op
+BenchmarkGowwwRouter_GPlusParam 1851798 667 ns/op 432 B/op 3 allocs/op
+BenchmarkHttpRouter_GPlusParam 18420789 65.2 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_GPlusParam 1878463 629 ns/op 352 B/op 3 allocs/op
+BenchmarkKocha_GPlusParam 4495610 273 ns/op 56 B/op 3 allocs/op
+BenchmarkLARS_GPlusParam 14615976 83.2 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_GPlusParam 584145 2549 ns/op 1072 B/op 10 allocs/op
+BenchmarkMartini_GPlusParam 250501 4583 ns/op 1072 B/op 10 allocs/op
+BenchmarkPat_GPlusParam 1000000 1645 ns/op 576 B/op 11 allocs/op
+BenchmarkPossum_GPlusParam 1000000 1008 ns/op 496 B/op 5 allocs/op
+BenchmarkR2router_GPlusParam 1708191 688 ns/op 432 B/op 5 allocs/op
+BenchmarkRivet_GPlusParam 5795014 211 ns/op 48 B/op 1 allocs/op
+BenchmarkTango_GPlusParam 1000000 1091 ns/op 264 B/op 8 allocs/op
+BenchmarkTigerTonic_GPlusParam 760221 2489 ns/op 856 B/op 16 allocs/op
+BenchmarkTraffic_GPlusParam 309774 4039 ns/op 1872 B/op 21 allocs/op
+BenchmarkVulcan_GPlusParam 1935730 623 ns/op 98 B/op 3 allocs/op
+BenchmarkAce_GPlus2Params 9158314 134 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_GPlus2Params 11300517 107 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_GPlus2Params 1239238 961 ns/op 496 B/op 5 allocs/op
+BenchmarkBeego_GPlus2Params 1000000 1202 ns/op 352 B/op 3 allocs/op
+BenchmarkBone_GPlus2Params 335576 3725 ns/op 1168 B/op 10 allocs/op
+BenchmarkChi_GPlus2Params 1000000 1014 ns/op 432 B/op 3 allocs/op
+BenchmarkDenco_GPlus2Params 4394598 280 ns/op 64 B/op 1 allocs/op
+BenchmarkEcho_GPlus2Params 7851861 154 ns/op 0 B/op 0 allocs/op
+BenchmarkGin_GPlus2Params 9958588 120 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_GPlus2Params 1000000 1433 ns/op 712 B/op 9 allocs/op
+BenchmarkGoji_GPlus2Params 1325134 909 ns/op 336 B/op 2 allocs/op
+BenchmarkGojiv2_GPlus2Params 405955 2870 ns/op 1408 B/op 14 allocs/op
+BenchmarkGoJsonRest_GPlus2Params 977038 1987 ns/op 713 B/op 14 allocs/op
+BenchmarkGoRestful_GPlus2Params 205018 6142 ns/op 4384 B/op 16 allocs/op
+BenchmarkGorillaMux_GPlus2Params 205641 6015 ns/op 1296 B/op 10 allocs/op
+BenchmarkGowwwRouter_GPlus2Params 1748542 684 ns/op 432 B/op 3 allocs/op
+BenchmarkHttpRouter_GPlus2Params 14047102 87.7 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_GPlus2Params 1418673 828 ns/op 384 B/op 4 allocs/op
+BenchmarkKocha_GPlus2Params 2334562 520 ns/op 128 B/op 5 allocs/op
+BenchmarkLARS_GPlus2Params 11954094 101 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_GPlus2Params 491552 2890 ns/op 1072 B/op 10 allocs/op
+BenchmarkMartini_GPlus2Params 120532 9545 ns/op 1200 B/op 13 allocs/op
+BenchmarkPat_GPlus2Params 194739 6766 ns/op 2168 B/op 33 allocs/op
+BenchmarkPossum_GPlus2Params 1201224 1009 ns/op 496 B/op 5 allocs/op
+BenchmarkR2router_GPlus2Params 1575535 756 ns/op 432 B/op 5 allocs/op
+BenchmarkRivet_GPlus2Params 3698930 325 ns/op 96 B/op 1 allocs/op
+BenchmarkTango_GPlus2Params 1000000 1212 ns/op 344 B/op 8 allocs/op
+BenchmarkTigerTonic_GPlus2Params 349350 3660 ns/op 1200 B/op 22 allocs/op
+BenchmarkTraffic_GPlus2Params 169714 7862 ns/op 2248 B/op 28 allocs/op
+BenchmarkVulcan_GPlus2Params 1222288 974 ns/op 98 B/op 3 allocs/op
+BenchmarkAce_GPlusAll 845606 1398 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_GPlusAll 1000000 1009 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_GPlusAll 103830 11386 ns/op 5488 B/op 61 allocs/op
+BenchmarkBeego_GPlusAll 82653 14784 ns/op 4576 B/op 39 allocs/op
+BenchmarkBone_GPlusAll 36601 33123 ns/op 11744 B/op 109 allocs/op
+BenchmarkChi_GPlusAll 95264 12831 ns/op 5616 B/op 39 allocs/op
+BenchmarkDenco_GPlusAll 567681 2950 ns/op 672 B/op 11 allocs/op
+BenchmarkEcho_GPlusAll 720366 1665 ns/op 0 B/op 0 allocs/op
+BenchmarkGin_GPlusAll 1000000 1185 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_GPlusAll 71575 16365 ns/op 8040 B/op 103 allocs/op
+BenchmarkGoji_GPlusAll 136352 9191 ns/op 3696 B/op 22 allocs/op
+BenchmarkGojiv2_GPlusAll 38006 31802 ns/op 17616 B/op 154 allocs/op
+BenchmarkGoJsonRest_GPlusAll 57238 21561 ns/op 8117 B/op 170 allocs/op
+BenchmarkGoRestful_GPlusAll 15147 79276 ns/op 55520 B/op 192 allocs/op
+BenchmarkGorillaMux_GPlusAll 24446 48410 ns/op 16112 B/op 128 allocs/op
+BenchmarkGowwwRouter_GPlusAll 150112 7770 ns/op 4752 B/op 33 allocs/op
+BenchmarkHttpRouter_GPlusAll 1367820 878 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_GPlusAll 166628 8004 ns/op 4032 B/op 38 allocs/op
+BenchmarkKocha_GPlusAll 265694 4570 ns/op 976 B/op 43 allocs/op
+BenchmarkLARS_GPlusAll 1000000 1068 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_GPlusAll 54564 23305 ns/op 9568 B/op 104 allocs/op
+BenchmarkMartini_GPlusAll 16274 73845 ns/op 14016 B/op 145 allocs/op
+BenchmarkPat_GPlusAll 27181 44478 ns/op 15264 B/op 271 allocs/op
+BenchmarkPossum_GPlusAll 122587 10277 ns/op 5408 B/op 39 allocs/op
+BenchmarkR2router_GPlusAll 130137 9297 ns/op 5040 B/op 63 allocs/op
+BenchmarkRivet_GPlusAll 532438 3323 ns/op 768 B/op 11 allocs/op
+BenchmarkTango_GPlusAll 86054 14531 ns/op 3656 B/op 104 allocs/op
+BenchmarkTigerTonic_GPlusAll 33936 35356 ns/op 11600 B/op 242 allocs/op
+BenchmarkTraffic_GPlusAll 17833 68181 ns/op 26248 B/op 341 allocs/op
+BenchmarkVulcan_GPlusAll 120109 9861 ns/op 1274 B/op 39 allocs/op
```
## Parse.com
-```
-BenchmarkGin_ParseStatic 8683893 140 ns/op 0 B/op 0 allocs/op
-
-BenchmarkAce_ParseStatic 7255582 160 ns/op 0 B/op 0 allocs/op
-BenchmarkAero_ParseStatic 11960128 95.0 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_ParseStatic 1791033 659 ns/op 120 B/op 3 allocs/op
-BenchmarkBeego_ParseStatic 937918 1688 ns/op 352 B/op 3 allocs/op
-BenchmarkBone_ParseStatic 1261682 949 ns/op 144 B/op 3 allocs/op
-BenchmarkChi_ParseStatic 1000000 1303 ns/op 432 B/op 3 allocs/op
-BenchmarkDenco_ParseStatic 23731242 49.8 ns/op 0 B/op 0 allocs/op
-BenchmarkEcho_ParseStatic 10585060 116 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_ParseStatic 1000000 1156 ns/op 296 B/op 5 allocs/op
-BenchmarkGoji_ParseStatic 3927530 300 ns/op 0 B/op 0 allocs/op
-BenchmarkGojiv2_ParseStatic 474836 3281 ns/op 1312 B/op 10 allocs/op
-BenchmarkGoJsonRest_ParseStatic 1000000 1445 ns/op 329 B/op 11 allocs/op
-BenchmarkGoRestful_ParseStatic 101262 11612 ns/op 4256 B/op 13 allocs/op
-BenchmarkGorillaMux_ParseStatic 562705 3530 ns/op 976 B/op 9 allocs/op
-BenchmarkGowwwRouter_ParseStatic 16479007 69.5 ns/op 0 B/op 0 allocs/op
-BenchmarkHttpRouter_ParseStatic 23205590 51.5 ns/op 0 B/op 0 allocs/op
-BenchmarkHttpTreeMux_ParseStatic 10763127 106 ns/op 0 B/op 0 allocs/op
-BenchmarkKocha_ParseStatic 17850259 60.9 ns/op 0 B/op 0 allocs/op
-BenchmarkLARS_ParseStatic 10727432 108 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_ParseStatic 685586 2665 ns/op 736 B/op 8 allocs/op
-BenchmarkMartini_ParseStatic 200642 7158 ns/op 768 B/op 9 allocs/op
-BenchmarkPat_ParseStatic 1000000 1139 ns/op 240 B/op 5 allocs/op
-BenchmarkPossum_ParseStatic 1000000 1241 ns/op 416 B/op 3 allocs/op
-BenchmarkR2router_ParseStatic 2035426 597 ns/op 144 B/op 4 allocs/op
-BenchmarkRivet_ParseStatic 9707011 127 ns/op 0 B/op 0 allocs/op
-BenchmarkTango_ParseStatic 910617 1693 ns/op 248 B/op 8 allocs/op
-BenchmarkTigerTonic_ParseStatic 3168885 385 ns/op 48 B/op 1 allocs/op
-BenchmarkTraffic_ParseStatic 493339 4264 ns/op 1256 B/op 19 allocs/op
-BenchmarkVulcan_ParseStatic 1394142 848 ns/op 98 B/op 3 allocs/op
-
-BenchmarkAce_ParseParam 3106903 387 ns/op 64 B/op 1 allocs/op
-BenchmarkAero_ParseParam 8045266 141 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_ParseParam 1000000 1434 ns/op 467 B/op 5 allocs/op
-BenchmarkBeego_ParseParam 951460 1937 ns/op 352 B/op 3 allocs/op
-BenchmarkBone_ParseParam 855555 2776 ns/op 896 B/op 7 allocs/op
-BenchmarkChi_ParseParam 1000000 1457 ns/op 432 B/op 3 allocs/op
-BenchmarkDenco_ParseParam 4084116 301 ns/op 64 B/op 1 allocs/op
-BenchmarkEcho_ParseParam 8440170 142 ns/op 0 B/op 0 allocs/op
-BenchmarkGin_ParseParam 7716948 157 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_ParseParam 886284 2045 ns/op 664 B/op 8 allocs/op
-BenchmarkGoji_ParseParam 1000000 1167 ns/op 336 B/op 2 allocs/op
-BenchmarkGojiv2_ParseParam 269731 3945 ns/op 1360 B/op 12 allocs/op
-BenchmarkGoJsonRest_ParseParam 719587 2277 ns/op 649 B/op 13 allocs/op
-BenchmarkGoRestful_ParseParam 96408 11925 ns/op 4576 B/op 14 allocs/op
-BenchmarkGorillaMux_ParseParam 289303 4154 ns/op 1280 B/op 10 allocs/op
-BenchmarkGowwwRouter_ParseParam 1000000 1070 ns/op 432 B/op 3 allocs/op
-BenchmarkHttpRouter_ParseParam 4917758 232 ns/op 64 B/op 1 allocs/op
-BenchmarkHttpTreeMux_ParseParam 1445443 828 ns/op 352 B/op 3 allocs/op
-BenchmarkKocha_ParseParam 3116233 382 ns/op 56 B/op 3 allocs/op
-BenchmarkLARS_ParseParam 10584750 113 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_ParseParam 413617 3872 ns/op 1072 B/op 10 allocs/op
-BenchmarkMartini_ParseParam 166545 7605 ns/op 1072 B/op 10 allocs/op
-BenchmarkPat_ParseParam 491829 3394 ns/op 992 B/op 15 allocs/op
-BenchmarkPossum_ParseParam 1000000 1692 ns/op 496 B/op 5 allocs/op
-BenchmarkR2router_ParseParam 1000000 1059 ns/op 432 B/op 5 allocs/op
-BenchmarkRivet_ParseParam 3572359 311 ns/op 48 B/op 1 allocs/op
-BenchmarkTango_ParseParam 787552 1889 ns/op 280 B/op 8 allocs/op
-BenchmarkTigerTonic_ParseParam 487208 3706 ns/op 784 B/op 15 allocs/op
-BenchmarkTraffic_ParseParam 186190 5812 ns/op 1896 B/op 21 allocs/op
-BenchmarkVulcan_ParseParam 1275432 892 ns/op 98 B/op 3 allocs/op
-
-BenchmarkAce_Parse2Params 2959621 412 ns/op 64 B/op 1 allocs/op
-BenchmarkAero_Parse2Params 6208641 192 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_Parse2Params 1000000 1512 ns/op 496 B/op 5 allocs/op
-BenchmarkBeego_Parse2Params 761940 1973 ns/op 352 B/op 3 allocs/op
-BenchmarkBone_Parse2Params 715987 2582 ns/op 848 B/op 6 allocs/op
-BenchmarkChi_Parse2Params 1000000 1495 ns/op 432 B/op 3 allocs/op
-BenchmarkDenco_Parse2Params 3585452 341 ns/op 64 B/op 1 allocs/op
-BenchmarkEcho_Parse2Params 5193693 204 ns/op 0 B/op 0 allocs/op
-BenchmarkGin_Parse2Params 5338316 236 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_Parse2Params 939637 2299 ns/op 712 B/op 9 allocs/op
-BenchmarkGoji_Parse2Params 1000000 1094 ns/op 336 B/op 2 allocs/op
-BenchmarkGojiv2_Parse2Params 339514 3733 ns/op 1344 B/op 11 allocs/op
-BenchmarkGoJsonRest_Parse2Params 512572 2733 ns/op 713 B/op 14 allocs/op
-BenchmarkGoRestful_Parse2Params 95913 12973 ns/op 4928 B/op 14 allocs/op
-BenchmarkGorillaMux_Parse2Params 261208 4758 ns/op 1296 B/op 10 allocs/op
-BenchmarkGowwwRouter_Parse2Params 1000000 1084 ns/op 432 B/op 3 allocs/op
-BenchmarkHttpRouter_Parse2Params 4399953 277 ns/op 64 B/op 1 allocs/op
-BenchmarkHttpTreeMux_Parse2Params 1000000 1198 ns/op 384 B/op 4 allocs/op
-BenchmarkKocha_Parse2Params 1669431 683 ns/op 128 B/op 5 allocs/op
-BenchmarkLARS_Parse2Params 8535754 142 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_Parse2Params 424590 3959 ns/op 1072 B/op 10 allocs/op
-BenchmarkMartini_Parse2Params 162448 8141 ns/op 1152 B/op 11 allocs/op
-BenchmarkPat_Parse2Params 431336 3484 ns/op 752 B/op 16 allocs/op
-BenchmarkPossum_Parse2Params 1000000 1721 ns/op 496 B/op 5 allocs/op
-BenchmarkR2router_Parse2Params 1000000 1136 ns/op 432 B/op 5 allocs/op
-BenchmarkRivet_Parse2Params 2630935 442 ns/op 96 B/op 1 allocs/op
-BenchmarkTango_Parse2Params 759218 1876 ns/op 312 B/op 8 allocs/op
-BenchmarkTigerTonic_Parse2Params 290810 5558 ns/op 1168 B/op 22 allocs/op
-BenchmarkTraffic_Parse2Params 181099 6917 ns/op 1944 B/op 22 allocs/op
-BenchmarkVulcan_Parse2Params 1000000 1080 ns/op 98 B/op 3 allocs/op
-
-BenchmarkAce_ParseAll 162906 7888 ns/op 640 B/op 16 allocs/op
-BenchmarkAero_ParseAll 219260 4833 ns/op 0 B/op 0 allocs/op
-BenchmarkBear_ParseAll 37566 32863 ns/op 8928 B/op 110 allocs/op
-BenchmarkBeego_ParseAll 25400 46518 ns/op 9152 B/op 78 allocs/op
-BenchmarkBone_ParseAll 19568 61814 ns/op 16208 B/op 147 allocs/op
-BenchmarkChi_ParseAll 30562 38281 ns/op 11232 B/op 78 allocs/op
-BenchmarkDenco_ParseAll 232554 6371 ns/op 928 B/op 16 allocs/op
-BenchmarkEcho_ParseAll 224400 5090 ns/op 0 B/op 0 allocs/op
-BenchmarkGin_ParseAll 189829 6134 ns/op 0 B/op 0 allocs/op
-BenchmarkGocraftWeb_ParseAll 25446 47000 ns/op 13728 B/op 181 allocs/op
-BenchmarkGoji_ParseAll 50503 22949 ns/op 5376 B/op 32 allocs/op
-BenchmarkGojiv2_ParseAll 12806 93106 ns/op 34448 B/op 277 allocs/op
-BenchmarkGoJsonRest_ParseAll 20764 57021 ns/op 13866 B/op 321 allocs/op
-BenchmarkGoRestful_ParseAll 4234 317238 ns/op 117600 B/op 354 allocs/op
-BenchmarkGorillaMux_ParseAll 10000 146942 ns/op 30288 B/op 250 allocs/op
-BenchmarkGowwwRouter_ParseAll 62548 19363 ns/op 6912 B/op 48 allocs/op
-BenchmarkHttpRouter_ParseAll 286662 5091 ns/op 640 B/op 16 allocs/op
-BenchmarkHttpTreeMux_ParseAll 66952 18262 ns/op 5728 B/op 51 allocs/op
-BenchmarkKocha_ParseAll 109771 9811 ns/op 1112 B/op 54 allocs/op
-BenchmarkLARS_ParseAll 272516 3976 ns/op 0 B/op 0 allocs/op
-BenchmarkMacaron_ParseAll 17094 71634 ns/op 19136 B/op 208 allocs/op
-BenchmarkMartini_ParseAll 6799 208122 ns/op 25072 B/op 253 allocs/op
-BenchmarkPat_ParseAll 15993 74594 ns/op 15216 B/op 308 allocs/op
-BenchmarkPossum_ParseAll 34897 33398 ns/op 10816 B/op 78 allocs/op
-BenchmarkR2router_ParseAll 46909 25410 ns/op 8352 B/op 120 allocs/op
-BenchmarkRivet_ParseAll 185193 7725 ns/op 912 B/op 16 allocs/op
-BenchmarkTango_ParseAll 24481 47963 ns/op 7168 B/op 208 allocs/op
-BenchmarkTigerTonic_ParseAll 15236 79623 ns/op 16048 B/op 332 allocs/op
-BenchmarkTraffic_ParseAll 8955 169411 ns/op 45520 B/op 605 allocs/op
-BenchmarkVulcan_ParseAll 40406 28971 ns/op 2548 B/op 78 allocs/op
+```sh
+BenchmarkGin_ParseStatic 18877833 63.5 ns/op 0 B/op 0 allocs/op
+
+BenchmarkAce_ParseStatic 19663731 60.8 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_ParseStatic 28967341 41.5 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_ParseStatic 3006984 402 ns/op 120 B/op 3 allocs/op
+BenchmarkBeego_ParseStatic 1000000 1031 ns/op 352 B/op 3 allocs/op
+BenchmarkBone_ParseStatic 1782482 675 ns/op 144 B/op 3 allocs/op
+BenchmarkChi_ParseStatic 1453261 819 ns/op 432 B/op 3 allocs/op
+BenchmarkDenco_ParseStatic 45023595 26.5 ns/op 0 B/op 0 allocs/op
+BenchmarkEcho_ParseStatic 17330470 69.3 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_ParseStatic 1644006 731 ns/op 296 B/op 5 allocs/op
+BenchmarkGoji_ParseStatic 7026930 170 ns/op 0 B/op 0 allocs/op
+BenchmarkGojiv2_ParseStatic 517618 2037 ns/op 1312 B/op 10 allocs/op
+BenchmarkGoJsonRest_ParseStatic 1227080 975 ns/op 329 B/op 11 allocs/op
+BenchmarkGoRestful_ParseStatic 192458 6659 ns/op 4256 B/op 13 allocs/op
+BenchmarkGorillaMux_ParseStatic 744062 2109 ns/op 976 B/op 9 allocs/op
+BenchmarkGowwwRouter_ParseStatic 37781062 31.8 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpRouter_ParseStatic 45311223 26.5 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_ParseStatic 21383475 56.1 ns/op 0 B/op 0 allocs/op
+BenchmarkKocha_ParseStatic 29953290 40.1 ns/op 0 B/op 0 allocs/op
+BenchmarkLARS_ParseStatic 20036196 62.7 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_ParseStatic 1000000 1740 ns/op 736 B/op 8 allocs/op
+BenchmarkMartini_ParseStatic 404156 3801 ns/op 768 B/op 9 allocs/op
+BenchmarkPat_ParseStatic 1547180 772 ns/op 240 B/op 5 allocs/op
+BenchmarkPossum_ParseStatic 1608991 757 ns/op 416 B/op 3 allocs/op
+BenchmarkR2router_ParseStatic 3177936 385 ns/op 144 B/op 4 allocs/op
+BenchmarkRivet_ParseStatic 17783205 67.4 ns/op 0 B/op 0 allocs/op
+BenchmarkTango_ParseStatic 1210777 990 ns/op 248 B/op 8 allocs/op
+BenchmarkTigerTonic_ParseStatic 5316440 231 ns/op 48 B/op 1 allocs/op
+BenchmarkTraffic_ParseStatic 496050 2539 ns/op 1256 B/op 19 allocs/op
+BenchmarkVulcan_ParseStatic 2462798 488 ns/op 98 B/op 3 allocs/op
+BenchmarkAce_ParseParam 13393669 89.6 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_ParseParam 19836619 60.4 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_ParseParam 1405954 864 ns/op 467 B/op 5 allocs/op
+BenchmarkBeego_ParseParam 1000000 1065 ns/op 352 B/op 3 allocs/op
+BenchmarkBone_ParseParam 1000000 1698 ns/op 896 B/op 7 allocs/op
+BenchmarkChi_ParseParam 1356037 873 ns/op 432 B/op 3 allocs/op
+BenchmarkDenco_ParseParam 6241392 204 ns/op 64 B/op 1 allocs/op
+BenchmarkEcho_ParseParam 14088100 85.1 ns/op 0 B/op 0 allocs/op
+BenchmarkGin_ParseParam 17426064 68.9 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_ParseParam 1000000 1254 ns/op 664 B/op 8 allocs/op
+BenchmarkGoji_ParseParam 1682574 713 ns/op 336 B/op 2 allocs/op
+BenchmarkGojiv2_ParseParam 502224 2333 ns/op 1360 B/op 12 allocs/op
+BenchmarkGoJsonRest_ParseParam 1000000 1401 ns/op 649 B/op 13 allocs/op
+BenchmarkGoRestful_ParseParam 182623 7097 ns/op 4576 B/op 14 allocs/op
+BenchmarkGorillaMux_ParseParam 482332 2477 ns/op 1280 B/op 10 allocs/op
+BenchmarkGowwwRouter_ParseParam 1834873 657 ns/op 432 B/op 3 allocs/op
+BenchmarkHttpRouter_ParseParam 23593393 51.0 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_ParseParam 2100160 574 ns/op 352 B/op 3 allocs/op
+BenchmarkKocha_ParseParam 4837220 252 ns/op 56 B/op 3 allocs/op
+BenchmarkLARS_ParseParam 18411192 66.2 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_ParseParam 571870 2398 ns/op 1072 B/op 10 allocs/op
+BenchmarkMartini_ParseParam 286262 4268 ns/op 1072 B/op 10 allocs/op
+BenchmarkPat_ParseParam 692906 2157 ns/op 992 B/op 15 allocs/op
+BenchmarkPossum_ParseParam 1000000 1011 ns/op 496 B/op 5 allocs/op
+BenchmarkR2router_ParseParam 1722735 697 ns/op 432 B/op 5 allocs/op
+BenchmarkRivet_ParseParam 6058054 203 ns/op 48 B/op 1 allocs/op
+BenchmarkTango_ParseParam 1000000 1061 ns/op 280 B/op 8 allocs/op
+BenchmarkTigerTonic_ParseParam 890275 2277 ns/op 784 B/op 15 allocs/op
+BenchmarkTraffic_ParseParam 351322 3543 ns/op 1896 B/op 21 allocs/op
+BenchmarkVulcan_ParseParam 2076544 572 ns/op 98 B/op 3 allocs/op
+BenchmarkAce_Parse2Params 11718074 101 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_Parse2Params 16264988 73.4 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_Parse2Params 1238322 973 ns/op 496 B/op 5 allocs/op
+BenchmarkBeego_Parse2Params 1000000 1120 ns/op 352 B/op 3 allocs/op
+BenchmarkBone_Parse2Params 1000000 1632 ns/op 848 B/op 6 allocs/op
+BenchmarkChi_Parse2Params 1239477 955 ns/op 432 B/op 3 allocs/op
+BenchmarkDenco_Parse2Params 4944133 245 ns/op 64 B/op 1 allocs/op
+BenchmarkEcho_Parse2Params 10518286 114 ns/op 0 B/op 0 allocs/op
+BenchmarkGin_Parse2Params 14505195 82.7 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_Parse2Params 1000000 1437 ns/op 712 B/op 9 allocs/op
+BenchmarkGoji_Parse2Params 1689883 707 ns/op 336 B/op 2 allocs/op
+BenchmarkGojiv2_Parse2Params 502334 2308 ns/op 1344 B/op 11 allocs/op
+BenchmarkGoJsonRest_Parse2Params 1000000 1771 ns/op 713 B/op 14 allocs/op
+BenchmarkGoRestful_Parse2Params 159092 7583 ns/op 4928 B/op 14 allocs/op
+BenchmarkGorillaMux_Parse2Params 417548 2980 ns/op 1296 B/op 10 allocs/op
+BenchmarkGowwwRouter_Parse2Params 1751737 686 ns/op 432 B/op 3 allocs/op
+BenchmarkHttpRouter_Parse2Params 18089204 66.3 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_Parse2Params 1556986 777 ns/op 384 B/op 4 allocs/op
+BenchmarkKocha_Parse2Params 2493082 485 ns/op 128 B/op 5 allocs/op
+BenchmarkLARS_Parse2Params 15350108 78.5 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_Parse2Params 530974 2605 ns/op 1072 B/op 10 allocs/op
+BenchmarkMartini_Parse2Params 247069 4673 ns/op 1152 B/op 11 allocs/op
+BenchmarkPat_Parse2Params 816295 2126 ns/op 752 B/op 16 allocs/op
+BenchmarkPossum_Parse2Params 1000000 1002 ns/op 496 B/op 5 allocs/op
+BenchmarkR2router_Parse2Params 1569771 733 ns/op 432 B/op 5 allocs/op
+BenchmarkRivet_Parse2Params 4080546 295 ns/op 96 B/op 1 allocs/op
+BenchmarkTango_Parse2Params 1000000 1121 ns/op 312 B/op 8 allocs/op
+BenchmarkTigerTonic_Parse2Params 399556 3470 ns/op 1168 B/op 22 allocs/op
+BenchmarkTraffic_Parse2Params 314194 4159 ns/op 1944 B/op 22 allocs/op
+BenchmarkVulcan_Parse2Params 1827559 664 ns/op 98 B/op 3 allocs/op
+BenchmarkAce_ParseAll 478395 2503 ns/op 0 B/op 0 allocs/op
+BenchmarkAero_ParseAll 715392 1658 ns/op 0 B/op 0 allocs/op
+BenchmarkBear_ParseAll 59191 20124 ns/op 8928 B/op 110 allocs/op
+BenchmarkBeego_ParseAll 45507 27266 ns/op 9152 B/op 78 allocs/op
+BenchmarkBone_ParseAll 29328 41459 ns/op 16208 B/op 147 allocs/op
+BenchmarkChi_ParseAll 48531 25053 ns/op 11232 B/op 78 allocs/op
+BenchmarkDenco_ParseAll 325532 4284 ns/op 928 B/op 16 allocs/op
+BenchmarkEcho_ParseAll 433771 2759 ns/op 0 B/op 0 allocs/op
+BenchmarkGin_ParseAll 576316 2082 ns/op 0 B/op 0 allocs/op
+BenchmarkGocraftWeb_ParseAll 41500 29692 ns/op 13728 B/op 181 allocs/op
+BenchmarkGoji_ParseAll 80833 15563 ns/op 5376 B/op 32 allocs/op
+BenchmarkGojiv2_ParseAll 19836 60335 ns/op 34448 B/op 277 allocs/op
+BenchmarkGoJsonRest_ParseAll 32210 38027 ns/op 13866 B/op 321 allocs/op
+BenchmarkGoRestful_ParseAll 6644 190842 ns/op 117600 B/op 354 allocs/op
+BenchmarkGorillaMux_ParseAll 12634 95894 ns/op 30288 B/op 250 allocs/op
+BenchmarkGowwwRouter_ParseAll 98152 12159 ns/op 6912 B/op 48 allocs/op
+BenchmarkHttpRouter_ParseAll 933208 1273 ns/op 0 B/op 0 allocs/op
+BenchmarkHttpTreeMux_ParseAll 107191 11554 ns/op 5728 B/op 51 allocs/op
+BenchmarkKocha_ParseAll 184862 6225 ns/op 1112 B/op 54 allocs/op
+BenchmarkLARS_ParseAll 644546 1858 ns/op 0 B/op 0 allocs/op
+BenchmarkMacaron_ParseAll 26145 46484 ns/op 19136 B/op 208 allocs/op
+BenchmarkMartini_ParseAll 10000 121838 ns/op 25072 B/op 253 allocs/op
+BenchmarkPat_ParseAll 25417 47196 ns/op 15216 B/op 308 allocs/op
+BenchmarkPossum_ParseAll 58550 20735 ns/op 10816 B/op 78 allocs/op
+BenchmarkR2router_ParseAll 72732 16584 ns/op 8352 B/op 120 allocs/op
+BenchmarkRivet_ParseAll 281365 4968 ns/op 912 B/op 16 allocs/op
+BenchmarkTango_ParseAll 42831 28668 ns/op 7168 B/op 208 allocs/op
+BenchmarkTigerTonic_ParseAll 23774 49972 ns/op 16048 B/op 332 allocs/op
+BenchmarkTraffic_ParseAll 10000 104679 ns/op 45520 B/op 605 allocs/op
+BenchmarkVulcan_ParseAll 64810 18108 ns/op 2548 B/op 78 allocs/op
```
diff --git a/vendor/github.com/gin-gonic/gin/CHANGELOG.md b/vendor/github.com/gin-gonic/gin/CHANGELOG.md
index 592c2abc8..308af74c3 100644
--- a/vendor/github.com/gin-gonic/gin/CHANGELOG.md
+++ b/vendor/github.com/gin-gonic/gin/CHANGELOG.md
@@ -1,5 +1,56 @@
# Gin ChangeLog
+## Gin v1.7.3
+
+### BUGFIXES
+
+* fix level 1 router match [#2767](https://github.com/gin-gonic/gin/issues/2767), [#2796](https://github.com/gin-gonic/gin/issues/2796)
+
+## Gin v1.7.2
+
+### BUGFIXES
+
+* Fix conflict between param and exact path [#2706](https://github.com/gin-gonic/gin/issues/2706). Close issue [#2682](https://github.com/gin-gonic/gin/issues/2682) [#2696](https://github.com/gin-gonic/gin/issues/2696).
+
+## Gin v1.7.1
+
+### BUGFIXES
+
+* fix: data race with trustedCIDRs from [#2674](https://github.com/gin-gonic/gin/issues/2674)([#2675](https://github.com/gin-gonic/gin/pull/2675))
+
+## Gin v1.7.0
+
+### BUGFIXES
+
+* fix compile error from [#2572](https://github.com/gin-gonic/gin/pull/2572) ([#2600](https://github.com/gin-gonic/gin/pull/2600))
+* fix: print headers without Authorization header on broken pipe ([#2528](https://github.com/gin-gonic/gin/pull/2528))
+* fix(tree): reassign fullpath when register new node ([#2366](https://github.com/gin-gonic/gin/pull/2366))
+
+### ENHANCEMENTS
+
+* Support params and exact routes without creating conflicts ([#2663](https://github.com/gin-gonic/gin/pull/2663))
+* chore: improve render string performance ([#2365](https://github.com/gin-gonic/gin/pull/2365))
+* Sync route tree to httprouter latest code ([#2368](https://github.com/gin-gonic/gin/pull/2368))
+* chore: rename getQueryCache/getFormCache to initQueryCache/initFormCa ([#2375](https://github.com/gin-gonic/gin/pull/2375))
+* chore(performance): improve countParams ([#2378](https://github.com/gin-gonic/gin/pull/2378))
+* Remove some functions that have the same effect as the bytes package ([#2387](https://github.com/gin-gonic/gin/pull/2387))
+* update:SetMode function ([#2321](https://github.com/gin-gonic/gin/pull/2321))
+* remove a unused type SecureJSONPrefix ([#2391](https://github.com/gin-gonic/gin/pull/2391))
+* Add a redirect sample for POST method ([#2389](https://github.com/gin-gonic/gin/pull/2389))
+* Add CustomRecovery builtin middleware ([#2322](https://github.com/gin-gonic/gin/pull/2322))
+* binding: avoid 2038 problem on 32-bit architectures ([#2450](https://github.com/gin-gonic/gin/pull/2450))
+* Prevent panic in Context.GetQuery() when there is no Request ([#2412](https://github.com/gin-gonic/gin/pull/2412))
+* Add GetUint and GetUint64 method on gin.context ([#2487](https://github.com/gin-gonic/gin/pull/2487))
+* update content-disposition header to MIME-style ([#2512](https://github.com/gin-gonic/gin/pull/2512))
+* reduce allocs and improve the render `WriteString` ([#2508](https://github.com/gin-gonic/gin/pull/2508))
+* implement ".Unwrap() error" on Error type ([#2525](https://github.com/gin-gonic/gin/pull/2525)) ([#2526](https://github.com/gin-gonic/gin/pull/2526))
+* Allow bind with a map[string]string ([#2484](https://github.com/gin-gonic/gin/pull/2484))
+* chore: update tree ([#2371](https://github.com/gin-gonic/gin/pull/2371))
+* Support binding for slice/array obj [Rewrite] ([#2302](https://github.com/gin-gonic/gin/pull/2302))
+* basic auth: fix timing oracle ([#2609](https://github.com/gin-gonic/gin/pull/2609))
+* Add mixed param and non-param paths (port of httprouter[#329](https://github.com/gin-gonic/gin/pull/329)) ([#2663](https://github.com/gin-gonic/gin/pull/2663))
+* feat(engine): add trustedproxies and remoteIP ([#2632](https://github.com/gin-gonic/gin/pull/2632))
+
## Gin v1.6.3
### ENHANCEMENTS
@@ -8,14 +59,14 @@
## Gin v1.6.2
-### BUFIXES
+### BUGFIXES
* fix missing initial sync.RWMutex [#2305](https://github.com/gin-gonic/gin/pull/2305)
### ENHANCEMENTS
* Add set samesite in cookie. [#2306](https://github.com/gin-gonic/gin/pull/2306)
## Gin v1.6.1
-### BUFIXES
+### BUGFIXES
* Revert "fix accept incoming network connections" [#2294](https://github.com/gin-gonic/gin/pull/2294)
## Gin v1.6.0
@@ -25,7 +76,7 @@
* drop support govendor [#2148](https://github.com/gin-gonic/gin/pull/2148)
* Added support for SameSite cookie flag [#1615](https://github.com/gin-gonic/gin/pull/1615)
### FEATURES
- * add yaml negotitation [#2220](https://github.com/gin-gonic/gin/pull/2220)
+ * add yaml negotiation [#2220](https://github.com/gin-gonic/gin/pull/2220)
* FileFromFS [#2112](https://github.com/gin-gonic/gin/pull/2112)
### BUGFIXES
* Unix Socket Handling [#2280](https://github.com/gin-gonic/gin/pull/2280)
@@ -215,12 +266,12 @@
## Gin 1.1
-- [NEW] Implement QueryArray and PostArray methods
-- [NEW] Refactor GetQuery and GetPostForm
-- [NEW] Add contribution guide
+- [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] 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 (...)
diff --git a/vendor/github.com/gin-gonic/gin/CONTRIBUTING.md b/vendor/github.com/gin-gonic/gin/CONTRIBUTING.md
index 547b777a1..97daa808f 100644
--- a/vendor/github.com/gin-gonic/gin/CONTRIBUTING.md
+++ b/vendor/github.com/gin-gonic/gin/CONTRIBUTING.md
@@ -1,4 +1,4 @@
-## Contributing
+## Contributing
- With issues:
- Use the search tool before opening a new issue.
@@ -8,6 +8,6 @@
- With pull requests:
- Open your pull request against `master`
- 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.
+ - It should pass all tests in the available continuous integration 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.
diff --git a/vendor/github.com/gin-gonic/gin/README.md b/vendor/github.com/gin-gonic/gin/README.md
index 998783a37..d4772d764 100644
--- a/vendor/github.com/gin-gonic/gin/README.md
+++ b/vendor/github.com/gin-gonic/gin/README.md
@@ -5,7 +5,7 @@
[![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)
+[![GoDoc](https://pkg.go.dev/badge/github.com/gin-gonic/gin?status.svg)](https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc)
[![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)
[![Sourcegraph](https://sourcegraph.com/github.com/gin-gonic/gin/-/badge.svg)](https://sourcegraph.com/github.com/gin-gonic/gin?badge)
[![Open Source Helpers](https://www.codetriage.com/gin-gonic/gin/badges/users.svg)](https://www.codetriage.com/gin-gonic/gin)
@@ -54,6 +54,7 @@ Gin is a web framework written in Go (Golang). It features a martini-like API wi
- [AsciiJSON](#asciijson)
- [PureJSON](#purejson)
- [Serving static files](#serving-static-files)
+ - [Serving data from file](#serving-data-from-file)
- [Serving data from reader](#serving-data-from-reader)
- [HTML rendering](#html-rendering)
- [Custom Template renderer](#custom-template-renderer)
@@ -68,6 +69,8 @@ Gin is a web framework written in Go (Golang). It features a martini-like API wi
- [Support Let's Encrypt](#support-lets-encrypt)
- [Run multiple service using Gin](#run-multiple-service-using-gin)
- [Graceful shutdown or restart](#graceful-shutdown-or-restart)
+ - [Third-party packages](#third-party-packages)
+ - [Manually](#manually)
- [Build a single binary with templates](#build-a-single-binary-with-templates)
- [Bind form-data request with custom struct](#bind-form-data-request-with-custom-struct)
- [Try to bind body into different structs](#try-to-bind-body-into-different-structs)
@@ -81,7 +84,7 @@ Gin is a web framework written in Go (Golang). It features a martini-like API wi
To install Gin package, you need to install Go and set your Go workspace first.
-1. The first need [Go](https://golang.org/) installed (**version 1.11+ is required**), then you can use the below Go command to install Gin.
+1. The first need [Go](https://golang.org/) installed (**version 1.12+ is required**), then you can use the below Go command to install Gin.
```sh
$ go get -u github.com/gin-gonic/gin
@@ -100,7 +103,7 @@ import "net/http"
```
## Quick start
-
+
```sh
# assume the following codes in example.go file
$ cat example.go
@@ -133,35 +136,38 @@ Gin uses a custom version of [HttpRouter](https://github.com/julienschmidt/httpr
[See all benchmarks](/BENCHMARKS.md)
-Benchmark name | (1) | (2) | (3) | (4)
---------------------------------------------|-----------:|------------:|-----------:|---------:
-**BenchmarkGin_GithubAll** | **30000** | **48375** | **0** | **0**
-BenchmarkAce_GithubAll | 10000 | 134059 | 13792 | 167
-BenchmarkBear_GithubAll | 5000 | 534445 | 86448 | 943
-BenchmarkBeego_GithubAll | 3000 | 592444 | 74705 | 812
-BenchmarkBone_GithubAll | 200 | 6957308 | 698784 | 8453
-BenchmarkDenco_GithubAll | 10000 | 158819 | 20224 | 167
-BenchmarkEcho_GithubAll | 10000 | 154700 | 6496 | 203
-BenchmarkGocraftWeb_GithubAll | 3000 | 570806 | 131656 | 1686
-BenchmarkGoji_GithubAll | 2000 | 818034 | 56112 | 334
-BenchmarkGojiv2_GithubAll | 2000 | 1213973 | 274768 | 3712
-BenchmarkGoJsonRest_GithubAll | 2000 | 785796 | 134371 | 2737
-BenchmarkGoRestful_GithubAll | 300 | 5238188 | 689672 | 4519
-BenchmarkGorillaMux_GithubAll | 100 | 10257726 | 211840 | 2272
-BenchmarkHttpRouter_GithubAll | 20000 | 105414 | 13792 | 167
-BenchmarkHttpTreeMux_GithubAll | 10000 | 319934 | 65856 | 671
-BenchmarkKocha_GithubAll | 10000 | 209442 | 23304 | 843
-BenchmarkLARS_GithubAll | 20000 | 62565 | 0 | 0
-BenchmarkMacaron_GithubAll | 2000 | 1161270 | 204194 | 2000
-BenchmarkMartini_GithubAll | 200 | 9991713 | 226549 | 2325
-BenchmarkPat_GithubAll | 200 | 5590793 | 1499568 | 27435
-BenchmarkPossum_GithubAll | 10000 | 319768 | 84448 | 609
-BenchmarkR2router_GithubAll | 10000 | 305134 | 77328 | 979
-BenchmarkRivet_GithubAll | 10000 | 132134 | 16272 | 167
-BenchmarkTango_GithubAll | 3000 | 552754 | 63826 | 1618
-BenchmarkTigerTonic_GithubAll | 1000 | 1439483 | 239104 | 5374
-BenchmarkTraffic_GithubAll | 100 | 11383067 | 2659329 | 21848
-BenchmarkVulcan_GithubAll | 5000 | 394253 | 19894 | 609
+| Benchmark name | (1) | (2) | (3) | (4) |
+| ------------------------------ | ---------:| ---------------:| ------------:| ---------------:|
+| BenchmarkGin_GithubAll | **43550** | **27364 ns/op** | **0 B/op** | **0 allocs/op** |
+| BenchmarkAce_GithubAll | 40543 | 29670 ns/op | 0 B/op | 0 allocs/op |
+| BenchmarkAero_GithubAll | 57632 | 20648 ns/op | 0 B/op | 0 allocs/op |
+| BenchmarkBear_GithubAll | 9234 | 216179 ns/op | 86448 B/op | 943 allocs/op |
+| BenchmarkBeego_GithubAll | 7407 | 243496 ns/op | 71456 B/op | 609 allocs/op |
+| BenchmarkBone_GithubAll | 420 | 2922835 ns/op | 720160 B/op | 8620 allocs/op |
+| BenchmarkChi_GithubAll | 7620 | 238331 ns/op | 87696 B/op | 609 allocs/op |
+| BenchmarkDenco_GithubAll | 18355 | 64494 ns/op | 20224 B/op | 167 allocs/op |
+| BenchmarkEcho_GithubAll | 31251 | 38479 ns/op | 0 B/op | 0 allocs/op |
+| BenchmarkGocraftWeb_GithubAll | 4117 | 300062 ns/op | 131656 B/op | 1686 allocs/op |
+| BenchmarkGoji_GithubAll | 3274 | 416158 ns/op | 56112 B/op | 334 allocs/op |
+| BenchmarkGojiv2_GithubAll | 1402 | 870518 ns/op | 352720 B/op | 4321 allocs/op |
+| BenchmarkGoJsonRest_GithubAll | 2976 | 401507 ns/op | 134371 B/op | 2737 allocs/op |
+| BenchmarkGoRestful_GithubAll | 410 | 2913158 ns/op | 910144 B/op | 2938 allocs/op |
+| BenchmarkGorillaMux_GithubAll | 346 | 3384987 ns/op | 251650 B/op | 1994 allocs/op |
+| BenchmarkGowwwRouter_GithubAll | 10000 | 143025 ns/op | 72144 B/op | 501 allocs/op |
+| BenchmarkHttpRouter_GithubAll | 55938 | 21360 ns/op | 0 B/op | 0 allocs/op |
+| BenchmarkHttpTreeMux_GithubAll | 10000 | 153944 ns/op | 65856 B/op | 671 allocs/op |
+| BenchmarkKocha_GithubAll | 10000 | 106315 ns/op | 23304 B/op | 843 allocs/op |
+| BenchmarkLARS_GithubAll | 47779 | 25084 ns/op | 0 B/op | 0 allocs/op |
+| BenchmarkMacaron_GithubAll | 3266 | 371907 ns/op | 149409 B/op | 1624 allocs/op |
+| BenchmarkMartini_GithubAll | 331 | 3444706 ns/op | 226551 B/op | 2325 allocs/op |
+| BenchmarkPat_GithubAll | 273 | 4381818 ns/op | 1483152 B/op | 26963 allocs/op |
+| BenchmarkPossum_GithubAll | 10000 | 164367 ns/op | 84448 B/op | 609 allocs/op |
+| BenchmarkR2router_GithubAll | 10000 | 160220 ns/op | 77328 B/op | 979 allocs/op |
+| BenchmarkRivet_GithubAll | 14625 | 82453 ns/op | 16272 B/op | 167 allocs/op |
+| BenchmarkTango_GithubAll | 6255 | 279611 ns/op | 63826 B/op | 1618 allocs/op |
+| BenchmarkTigerTonic_GithubAll | 2008 | 687874 ns/op | 193856 B/op | 4474 allocs/op |
+| BenchmarkTraffic_GithubAll | 355 | 3478508 ns/op | 820744 B/op | 14114 allocs/op |
+| BenchmarkVulcan_GithubAll | 6885 | 193333 ns/op | 19894 B/op | 609 allocs/op |
- (1): Total Repetitions achieved in constant time, higher means more confident result
- (2): Single Repetition Duration (ns/op), lower is better
@@ -172,8 +178,8 @@ BenchmarkVulcan_GithubAll | 5000 | 394253 | 19894
- [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] Complete suite of unit tests.
+- [x] Battle tested.
- [x] API frozen, new releases will not break your code.
## Build with [jsoniter](https://github.com/json-iterator/go)
@@ -237,6 +243,13 @@ func main() {
c.FullPath() == "/user/:name/*action" // true
})
+ // This handler will add a new router for /user/groups.
+ // Exact routes are resolved before param routes, regardless of the order they were defined.
+ // Routes starting with /user/groups are never interpreted as /user/:name/... routes
+ router.GET("/user/groups", func(c *gin.Context) {
+ c.String(http.StatusOK, "The available groups are [...]", name)
+ })
+
router.Run(":8080")
}
```
@@ -334,7 +347,7 @@ func main() {
```
```
-ids: map[b:hello a:1234], names: map[second:tianou first:thinkerou]
+ids: map[b:hello a:1234]; names: map[second:tianou first:thinkerou]
```
### Upload files
@@ -351,14 +364,14 @@ References issue [#774](https://github.com/gin-gonic/gin/issues/774) and detail
func main() {
router := gin.Default()
// Set a lower memory limit for multipart forms (default is 32 MiB)
- // router.MaxMultipartMemory = 8 << 20 // 8 MiB
+ router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.POST("/upload", func(c *gin.Context) {
// single file
file, _ := c.FormFile("file")
log.Println(file.Filename)
// Upload the file to specific dst.
- // c.SaveUploadedFile(file, dst)
+ c.SaveUploadedFile(file, dst)
c.String(http.StatusOK, fmt.Sprintf("'%s' uploaded!", file.Filename))
})
@@ -382,7 +395,7 @@ See the detail [example code](https://github.com/gin-gonic/examples/tree/master/
func main() {
router := gin.Default()
// Set a lower memory limit for multipart forms (default is 32 MiB)
- // router.MaxMultipartMemory = 8 << 20 // 8 MiB
+ router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.POST("/upload", func(c *gin.Context) {
// Multipart form
form, _ := c.MultipartForm()
@@ -392,7 +405,7 @@ func main() {
log.Println(file.Filename)
// Upload the file to specific dst.
- // c.SaveUploadedFile(file, dst)
+ c.SaveUploadedFile(file, dst)
}
c.String(http.StatusOK, fmt.Sprintf("%d files uploaded!", len(files)))
})
@@ -490,6 +503,39 @@ func main() {
}
```
+### Custom Recovery behavior
+```go
+func main() {
+ // Creates a router without any middleware by default
+ r := gin.New()
+
+ // Global middleware
+ // Logger middleware will write the logs to gin.DefaultWriter even if you set with GIN_MODE=release.
+ // By default gin.DefaultWriter = os.Stdout
+ r.Use(gin.Logger())
+
+ // Recovery middleware recovers from any panics and writes a 500 if there was one.
+ r.Use(gin.CustomRecovery(func(c *gin.Context, recovered interface{}) {
+ if err, ok := recovered.(string); ok {
+ c.String(http.StatusInternalServerError, fmt.Sprintf("error: %s", err))
+ }
+ c.AbortWithStatus(http.StatusInternalServerError)
+ }))
+
+ r.GET("/panic", func(c *gin.Context) {
+ // panic with a string -- the custom middleware could save this to a database or report it to the user
+ panic("foo")
+ })
+
+ r.GET("/", func(c *gin.Context) {
+ c.String(http.StatusOK, "ohai")
+ })
+
+ // Listen and serve on 0.0.0.0:8080
+ r.Run(":8080")
+}
+```
+
### How to write log file
```go
func main() {
@@ -549,44 +595,44 @@ func main() {
::1 - [Fri, 07 Dec 2018 17:04:38 JST] "GET /ping HTTP/1.1 200 122.767µs "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "
```
-### Controlling Log output coloring
+### Controlling Log output coloring
By default, logs output on console should be colorized depending on the detected TTY.
-Never colorize logs:
+Never colorize logs:
```go
func main() {
// Disable log's color
gin.DisableConsoleColor()
-
+
// Creates a gin router with default middleware:
// logger and recovery (crash-free) middleware
router := gin.Default()
-
+
router.GET("/ping", func(c *gin.Context) {
c.String(200, "pong")
})
-
+
router.Run(":8080")
}
```
-Always colorize logs:
+Always colorize logs:
```go
func main() {
// Force log's color
gin.ForceConsoleColor()
-
+
// Creates a gin router with default middleware:
// logger and recovery (crash-free) middleware
router := gin.Default()
-
+
router.GET("/ping", func(c *gin.Context) {
c.String(200, "pong")
})
-
+
router.Run(":8080")
}
```
@@ -628,12 +674,12 @@ func main() {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
-
+
if json.User != "manu" || json.Password != "123" {
c.JSON(http.StatusUnauthorized, gin.H{"status": "unauthorized"})
return
- }
-
+ }
+
c.JSON(http.StatusOK, gin.H{"status": "you are logged in"})
})
@@ -649,12 +695,12 @@ func main() {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
-
+
if xml.User != "manu" || xml.Password != "123" {
c.JSON(http.StatusUnauthorized, gin.H{"status": "unauthorized"})
return
- }
-
+ }
+
c.JSON(http.StatusOK, gin.H{"status": "you are logged in"})
})
@@ -666,12 +712,12 @@ func main() {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
-
+
if form.User != "manu" || form.Password != "123" {
c.JSON(http.StatusUnauthorized, gin.H{"status": "unauthorized"})
return
- }
-
+ }
+
c.JSON(http.StatusOK, gin.H{"status": "you are logged in"})
})
@@ -719,12 +765,12 @@ import (
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
- "gopkg.in/go-playground/validator.v10"
+ "github.com/go-playground/validator/v10"
)
// Booking contains binded and validated data.
type Booking struct {
- CheckIn time.Time `form:"check_in" binding:"required" time_format:"2006-01-02"`
+ CheckIn time.Time `form:"check_in" binding:"required,bookabledate" time_format:"2006-01-02"`
CheckOut time.Time `form:"check_out" binding:"required,gtfield=CheckIn" time_format:"2006-01-02"`
}
@@ -761,11 +807,14 @@ func getBookable(c *gin.Context) {
```
```console
-$ curl "localhost:8085/bookable?check_in=2018-04-16&check_out=2018-04-17"
+$ curl "localhost:8085/bookable?check_in=2030-04-16&check_out=2030-04-17"
{"message":"Booking dates are valid!"}
-$ curl "localhost:8085/bookable?check_in=2018-03-10&check_out=2018-03-09"
+$ curl "localhost:8085/bookable?check_in=2030-03-10&check_out=2030-03-09"
{"error":"Key: 'Booking.CheckOut' Error:Field validation for 'CheckOut' failed on the 'gtfield' tag"}
+
+$ curl "localhost:8085/bookable?check_in=2000-03-09&check_out=2000-03-10"
+{"error":"Key: 'Booking.CheckIn' Error:Field validation for 'CheckIn' failed on the 'bookabledate' tag"}%
```
[Struct level validations](https://github.com/go-playground/validator/releases/tag/v8.7) can also be registered this way.
@@ -1103,7 +1152,7 @@ func main() {
data := gin.H{
"foo": "bar",
}
-
+
//callback is x
// Will output : x({\"foo\":\"bar\"})
c.JSONP(http.StatusOK, data)
@@ -1148,21 +1197,21 @@ This feature is unavailable in Go 1.6 and lower.
```go
func main() {
r := gin.Default()
-
+
// Serves unicode entities
r.GET("/json", func(c *gin.Context) {
c.JSON(200, gin.H{
"html": "Hello, world!",
})
})
-
+
// Serves literal characters
r.GET("/purejson", func(c *gin.Context) {
c.PureJSON(200, gin.H{
"html": "Hello, world!",
})
})
-
+
// listen and serve on 0.0.0.0:8080
r.Run(":8080")
}
@@ -1213,6 +1262,7 @@ func main() {
}
reader := response.Body
+ defer reader.Close()
contentLength := response.ContentLength
contentType := response.Header.Get("Content-Type")
@@ -1388,6 +1438,12 @@ r.GET("/test", func(c *gin.Context) {
})
```
+Issuing a HTTP redirect from POST. Refer to issue: [#444](https://github.com/gin-gonic/gin/issues/444)
+```go
+r.POST("/test", func(c *gin.Context) {
+ c.Redirect(http.StatusFound, "/foo")
+})
+```
Issuing a Router redirect, use `HandleContext` like below.
@@ -1744,8 +1800,8 @@ func main() {
// Initializing the server in a goroutine so that
// it won't block the graceful shutdown handling below
go func() {
- if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
- log.Fatalf("listen: %s\n", err)
+ if err := srv.ListenAndServe(); err != nil && errors.Is(err, http.ErrServerClosed) {
+ log.Printf("listen: %s\n", err)
}
}()
@@ -1757,16 +1813,17 @@ func main() {
// kill -9 is syscall.SIGKILL but can't be catch, so don't need add it
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
<-quit
- log.Println("Shuting down server...")
+ log.Println("Shutting down server...")
// The context is used to inform the server it has 5 seconds to finish
// the request it is currently handling
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
+
if err := srv.Shutdown(ctx); err != nil {
log.Fatal("Server forced to shutdown:", err)
}
-
+
log.Println("Server exiting")
}
```
@@ -2057,7 +2114,7 @@ func main() {
if err != nil {
cookie = "NotSet"
- c.SetCookie("gin_cookie", "test", 3600, "/", "localhost", http.SameSiteLaxMode, false, true)
+ c.SetCookie("gin_cookie", "test", 3600, "/", "localhost", false, true)
}
fmt.Printf("Cookie value: %s \n", cookie)
@@ -2067,6 +2124,39 @@ func main() {
}
```
+## Don't trust all proxies
+
+Gin lets you specify which headers to hold the real client IP (if any),
+as well as specifying which proxies (or direct clients) you trust to
+specify one of these headers.
+
+The `TrustedProxies` slice on your `gin.Engine` specifes network addresses or
+network CIDRs from where clients which their request headers related to client
+IP can be trusted. They can be IPv4 addresses, IPv4 CIDRs, IPv6 addresses or
+IPv6 CIDRs.
+
+```go
+import (
+ "fmt"
+
+ "github.com/gin-gonic/gin"
+)
+
+func main() {
+
+ router := gin.Default()
+ router.TrustedProxies = []string{"192.168.1.2"}
+
+ router.GET("/", func(c *gin.Context) {
+ // If the client is 192.168.1.2, use the X-Forwarded-For
+ // header to deduce the original client IP from the trust-
+ // worthy parts of that header.
+ // Otherwise, simply return the direct client IP
+ fmt.Printf("ClientIP: %s\n", c.ClientIP())
+ })
+ router.Run()
+}
+```
## Testing
diff --git a/vendor/github.com/gin-gonic/gin/auth.go b/vendor/github.com/gin-gonic/gin/auth.go
index 9e5d4cf65..4d8a6ce48 100644
--- a/vendor/github.com/gin-gonic/gin/auth.go
+++ b/vendor/github.com/gin-gonic/gin/auth.go
@@ -5,6 +5,7 @@
package gin
import (
+ "crypto/subtle"
"encoding/base64"
"net/http"
"strconv"
@@ -30,7 +31,7 @@ func (a authPairs) searchCredential(authValue string) (string, bool) {
return "", false
}
for _, pair := range a {
- if pair.value == authValue {
+ if subtle.ConstantTimeCompare([]byte(pair.value), []byte(authValue)) == 1 {
return pair.user, true
}
}
@@ -70,8 +71,9 @@ func BasicAuth(accounts Accounts) HandlerFunc {
}
func processAccounts(accounts Accounts) authPairs {
- assert1(len(accounts) > 0, "Empty list of authorized credentials")
- pairs := make(authPairs, 0, len(accounts))
+ length := len(accounts)
+ assert1(length > 0, "Empty list of authorized credentials")
+ pairs := make(authPairs, 0, length)
for user, password := range accounts {
assert1(user != "", "User can not be empty")
value := authorizationHeader(user, password)
diff --git a/vendor/github.com/gin-gonic/gin/binding/binding.go b/vendor/github.com/gin-gonic/gin/binding/binding.go
index 57562845f..5caeb581a 100644
--- a/vendor/github.com/gin-gonic/gin/binding/binding.go
+++ b/vendor/github.com/gin-gonic/gin/binding/binding.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
+//go:build !nomsgpack
// +build !nomsgpack
package binding
@@ -51,7 +52,8 @@ type BindingUri interface {
// https://github.com/go-playground/validator/tree/v8.18.2.
type StructValidator interface {
// ValidateStruct can receive any kind of type and it should never panic, even if the configuration is not right.
- // If the received type is not a struct, any validation should be skipped and nil must be returned.
+ // If the received type is a slice|array, the validation should be performed travel on every element.
+ // If the received type is not a struct or slice|array, any validation should be skipped and nil must be returned.
// If the received type is a struct or pointer to a struct, the validation should be performed.
// If the struct is not valid or the validation itself fails, a descriptive error should be returned.
// Otherwise nil must be returned.
diff --git a/vendor/github.com/gin-gonic/gin/binding/binding_nomsgpack.go b/vendor/github.com/gin-gonic/gin/binding/binding_nomsgpack.go
index fd227b11a..9afa3dcf6 100644
--- a/vendor/github.com/gin-gonic/gin/binding/binding_nomsgpack.go
+++ b/vendor/github.com/gin-gonic/gin/binding/binding_nomsgpack.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
+//go:build nomsgpack
// +build nomsgpack
package binding
diff --git a/vendor/github.com/gin-gonic/gin/binding/default_validator.go b/vendor/github.com/gin-gonic/gin/binding/default_validator.go
index a4c1a7f6c..c57a120fc 100644
--- a/vendor/github.com/gin-gonic/gin/binding/default_validator.go
+++ b/vendor/github.com/gin-gonic/gin/binding/default_validator.go
@@ -5,7 +5,9 @@
package binding
import (
+ "fmt"
"reflect"
+ "strings"
"sync"
"github.com/go-playground/validator/v10"
@@ -16,22 +18,54 @@ type defaultValidator struct {
validate *validator.Validate
}
+type sliceValidateError []error
+
+func (err sliceValidateError) Error() string {
+ var errMsgs []string
+ for i, e := range err {
+ if e == nil {
+ continue
+ }
+ errMsgs = append(errMsgs, fmt.Sprintf("[%d]: %s", i, e.Error()))
+ }
+ return strings.Join(errMsgs, "\n")
+}
+
var _ StructValidator = &defaultValidator{}
// ValidateStruct receives any kind of type, but only performed struct or pointer to struct type.
func (v *defaultValidator) ValidateStruct(obj interface{}) error {
+ if obj == nil {
+ return nil
+ }
+
value := reflect.ValueOf(obj)
- valueType := value.Kind()
- if valueType == reflect.Ptr {
- valueType = value.Elem().Kind()
- }
- if valueType == reflect.Struct {
- v.lazyinit()
- if err := v.validate.Struct(obj); err != nil {
- return err
+ switch value.Kind() {
+ case reflect.Ptr:
+ return v.ValidateStruct(value.Elem().Interface())
+ case reflect.Struct:
+ return v.validateStruct(obj)
+ case reflect.Slice, reflect.Array:
+ count := value.Len()
+ validateRet := make(sliceValidateError, 0)
+ for i := 0; i < count; i++ {
+ if err := v.ValidateStruct(value.Index(i).Interface()); err != nil {
+ validateRet = append(validateRet, err)
+ }
}
+ if len(validateRet) == 0 {
+ return nil
+ }
+ return validateRet
+ default:
+ return nil
}
- return nil
+}
+
+// validateStruct receives struct type
+func (v *defaultValidator) validateStruct(obj interface{}) error {
+ v.lazyinit()
+ return v.validate.Struct(obj)
}
// Engine returns the underlying validator engine which powers the default
diff --git a/vendor/github.com/gin-gonic/gin/binding/form_mapping.go b/vendor/github.com/gin-gonic/gin/binding/form_mapping.go
index b81ad195c..2f4e45b40 100644
--- a/vendor/github.com/gin-gonic/gin/binding/form_mapping.go
+++ b/vendor/github.com/gin-gonic/gin/binding/form_mapping.go
@@ -29,6 +29,21 @@ func mapForm(ptr interface{}, form map[string][]string) error {
var emptyField = reflect.StructField{}
func mapFormByTag(ptr interface{}, form map[string][]string, tag string) error {
+ // Check if ptr is a map
+ ptrVal := reflect.ValueOf(ptr)
+ var pointed interface{}
+ if ptrVal.Kind() == reflect.Ptr {
+ ptrVal = ptrVal.Elem()
+ pointed = ptrVal.Interface()
+ }
+ if ptrVal.Kind() == reflect.Map &&
+ ptrVal.Type().Key().Kind() == reflect.String {
+ if pointed != nil {
+ ptr = pointed
+ }
+ return setFormMap(ptr, form)
+ }
+
return mappingByPtr(ptr, formSource(form), tag)
}
@@ -270,7 +285,7 @@ func setTimeField(val string, structField reflect.StructField, value reflect.Val
switch tf := strings.ToLower(timeFormat); tf {
case "unix", "unixnano":
- tv, err := strconv.ParseInt(val, 10, 0)
+ tv, err := strconv.ParseInt(val, 10, 64)
if err != nil {
return err
}
@@ -349,3 +364,29 @@ func head(str, sep string) (head string, tail string) {
}
return str[:idx], str[idx+len(sep):]
}
+
+func setFormMap(ptr interface{}, form map[string][]string) error {
+ el := reflect.TypeOf(ptr).Elem()
+
+ if el.Kind() == reflect.Slice {
+ ptrMap, ok := ptr.(map[string][]string)
+ if !ok {
+ return errors.New("cannot convert to map slices of strings")
+ }
+ for k, v := range form {
+ ptrMap[k] = v
+ }
+
+ return nil
+ }
+
+ ptrMap, ok := ptr.(map[string]string)
+ if !ok {
+ return errors.New("cannot convert to map of strings")
+ }
+ for k, v := range form {
+ ptrMap[k] = v[len(v)-1] // pick last
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/gin-gonic/gin/binding/msgpack.go b/vendor/github.com/gin-gonic/gin/binding/msgpack.go
index a5bc2ad29..2a442996a 100644
--- a/vendor/github.com/gin-gonic/gin/binding/msgpack.go
+++ b/vendor/github.com/gin-gonic/gin/binding/msgpack.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
+//go:build !nomsgpack
// +build !nomsgpack
package binding
diff --git a/vendor/github.com/gin-gonic/gin/context.go b/vendor/github.com/gin-gonic/gin/context.go
index fb7f54e93..dc03c358a 100644
--- a/vendor/github.com/gin-gonic/gin/context.go
+++ b/vendor/github.com/gin-gonic/gin/context.go
@@ -34,9 +34,11 @@ const (
MIMEPOSTForm = binding.MIMEPOSTForm
MIMEMultipartPOSTForm = binding.MIMEMultipartPOSTForm
MIMEYAML = binding.MIMEYAML
- BodyBytesKey = "_gin-gonic/gin/bodybyteskey"
)
+// BodyBytesKey indicates a default body bytes key.
+const BodyBytesKey = "_gin-gonic/gin/bodybyteskey"
+
const abortIndex int8 = math.MaxInt8 / 2
// Context is the most important part of gin. It allows us to pass variables between middleware,
@@ -52,6 +54,7 @@ type Context struct {
fullPath string
engine *Engine
+ params *Params
// This mutex protect Keys map
mu sync.RWMutex
@@ -93,6 +96,7 @@ func (c *Context) reset() {
c.Accepted = nil
c.queryCache = nil
c.formCache = nil
+ *c.params = (*c.params)[0:0]
}
// Copy returns a copy of the current context that can be safely used outside the request's scope.
@@ -291,6 +295,22 @@ func (c *Context) GetInt64(key string) (i64 int64) {
return
}
+// GetUint returns the value associated with the key as an unsigned integer.
+func (c *Context) GetUint(key string) (ui uint) {
+ if val, ok := c.Get(key); ok && val != nil {
+ ui, _ = val.(uint)
+ }
+ return
+}
+
+// GetUint64 returns the value associated with the key as an unsigned integer.
+func (c *Context) GetUint64(key string) (ui64 uint64) {
+ if val, ok := c.Get(key); ok && val != nil {
+ ui64, _ = val.(uint64)
+ }
+ return
+}
+
// GetFloat64 returns the value associated with the key as a float64.
func (c *Context) GetFloat64(key string) (f64 float64) {
if val, ok := c.Get(key); ok && val != nil {
@@ -410,16 +430,20 @@ func (c *Context) QueryArray(key string) []string {
return values
}
-func (c *Context) getQueryCache() {
+func (c *Context) initQueryCache() {
if c.queryCache == nil {
- c.queryCache = c.Request.URL.Query()
+ if c.Request != nil {
+ c.queryCache = c.Request.URL.Query()
+ } else {
+ c.queryCache = url.Values{}
+ }
}
}
// GetQueryArray returns a slice of strings for a given query key, plus
// a boolean value whether at least one value exists for the given key.
func (c *Context) GetQueryArray(key string) ([]string, bool) {
- c.getQueryCache()
+ c.initQueryCache()
if values, ok := c.queryCache[key]; ok && len(values) > 0 {
return values, true
}
@@ -435,7 +459,7 @@ func (c *Context) QueryMap(key string) map[string]string {
// GetQueryMap returns a map for a given query key, plus a boolean value
// whether at least one value exists for the given key.
func (c *Context) GetQueryMap(key string) (map[string]string, bool) {
- c.getQueryCache()
+ c.initQueryCache()
return c.get(c.queryCache, key)
}
@@ -477,7 +501,7 @@ func (c *Context) PostFormArray(key string) []string {
return values
}
-func (c *Context) getFormCache() {
+func (c *Context) initFormCache() {
if c.formCache == nil {
c.formCache = make(url.Values)
req := c.Request
@@ -493,7 +517,7 @@ func (c *Context) getFormCache() {
// GetPostFormArray returns a slice of strings for a given form key, plus
// a boolean value whether at least one value exists for the given key.
func (c *Context) GetPostFormArray(key string) ([]string, bool) {
- c.getFormCache()
+ c.initFormCache()
if values := c.formCache[key]; len(values) > 0 {
return values, true
}
@@ -509,7 +533,7 @@ func (c *Context) PostFormMap(key string) map[string]string {
// GetPostFormMap returns a map for a given form key, plus a boolean value
// whether at least one value exists for the given key.
func (c *Context) GetPostFormMap(key string) (map[string]string, bool) {
- c.getFormCache()
+ c.initFormCache()
return c.get(c.formCache, key)
}
@@ -701,32 +725,80 @@ func (c *Context) ShouldBindBodyWith(obj interface{}, bb binding.BindingBody) (e
return bb.BindBody(body, obj)
}
-// ClientIP implements a best effort algorithm to return the real client IP, it parses
-// X-Real-IP and X-Forwarded-For in order to work properly with reverse-proxies such us: nginx or haproxy.
-// Use X-Forwarded-For before X-Real-Ip as nginx uses X-Real-Ip with the proxy's IP.
+// ClientIP implements a best effort algorithm to return the real client IP.
+// It called c.RemoteIP() under the hood, to check if the remote IP is a trusted proxy or not.
+// If it's it will then try to parse the headers defined in Engine.RemoteIPHeaders (defaulting to [X-Forwarded-For, X-Real-Ip]).
+// If the headers are nots syntactically valid OR the remote IP does not correspong to a trusted proxy,
+// the remote IP (coming form Request.RemoteAddr) is returned.
func (c *Context) ClientIP() string {
- if c.engine.ForwardedByClientIP {
- clientIP := c.requestHeader("X-Forwarded-For")
- clientIP = strings.TrimSpace(strings.Split(clientIP, ",")[0])
- if clientIP == "" {
- clientIP = strings.TrimSpace(c.requestHeader("X-Real-Ip"))
- }
- if clientIP != "" {
- return clientIP
- }
- }
-
if c.engine.AppEngine {
if addr := c.requestHeader("X-Appengine-Remote-Addr"); addr != "" {
return addr
}
}
- if ip, _, err := net.SplitHostPort(strings.TrimSpace(c.Request.RemoteAddr)); err == nil {
- return ip
+ remoteIP, trusted := c.RemoteIP()
+ if remoteIP == nil {
+ return ""
}
- return ""
+ if trusted && c.engine.ForwardedByClientIP && c.engine.RemoteIPHeaders != nil {
+ for _, headerName := range c.engine.RemoteIPHeaders {
+ ip, valid := validateHeader(c.requestHeader(headerName))
+ if valid {
+ return ip
+ }
+ }
+ }
+ return remoteIP.String()
+}
+
+// RemoteIP parses the IP from Request.RemoteAddr, normalizes and returns the IP (without the port).
+// It also checks if the remoteIP is a trusted proxy or not.
+// In order to perform this validation, it will see if the IP is contained within at least one of the CIDR blocks
+// defined in Engine.TrustedProxies
+func (c *Context) RemoteIP() (net.IP, bool) {
+ ip, _, err := net.SplitHostPort(strings.TrimSpace(c.Request.RemoteAddr))
+ if err != nil {
+ return nil, false
+ }
+ remoteIP := net.ParseIP(ip)
+ if remoteIP == nil {
+ return nil, false
+ }
+
+ if c.engine.trustedCIDRs != nil {
+ for _, cidr := range c.engine.trustedCIDRs {
+ if cidr.Contains(remoteIP) {
+ return remoteIP, true
+ }
+ }
+ }
+
+ return remoteIP, false
+}
+
+func validateHeader(header string) (clientIP string, valid bool) {
+ if header == "" {
+ return "", false
+ }
+ items := strings.Split(header, ",")
+ for i, ipStr := range items {
+ ipStr = strings.TrimSpace(ipStr)
+ ip := net.ParseIP(ipStr)
+ if ip == nil {
+ return "", false
+ }
+
+ // We need to return the first IP in the list, but,
+ // we should not early return since we need to validate that
+ // the rest of the header is syntactically valid
+ if i == 0 {
+ clientIP = ipStr
+ valid = true
+ }
+ }
+ return
}
// ContentType returns the Content-Type header of the request.
@@ -863,11 +935,11 @@ func (c *Context) IndentedJSON(code int, obj interface{}) {
// Default prepends "while(1)," to response body if the given struct is array values.
// It also sets the Content-Type as "application/json".
func (c *Context) SecureJSON(code int, obj interface{}) {
- c.Render(code, render.SecureJSON{Prefix: c.engine.secureJsonPrefix, Data: obj})
+ c.Render(code, render.SecureJSON{Prefix: c.engine.secureJSONPrefix, Data: obj})
}
// JSONP serializes the given struct as JSON into the response body.
-// It add padding to response body to request data from a server residing in a different domain than the client.
+// It adds padding to response body to request data from a server residing in a different domain than the client.
// It also sets the Content-Type as "application/javascript".
func (c *Context) JSONP(code int, obj interface{}) {
callback := c.DefaultQuery("callback", "")
@@ -944,12 +1016,12 @@ func (c *Context) DataFromReader(code int, contentLength int64, contentType stri
})
}
-// File writes the specified file into the body stream in a efficient way.
+// File writes the specified file into the body stream in an efficient way.
func (c *Context) File(filepath string) {
http.ServeFile(c.Writer, c.Request, filepath)
}
-// FileFromFS writes the specified file from http.FileSytem into the body stream in an efficient way.
+// FileFromFS writes the specified file from http.FileSystem into the body stream in an efficient way.
func (c *Context) FileFromFS(filepath string, fs http.FileSystem) {
defer func(old string) {
c.Request.URL.Path = old
@@ -963,7 +1035,7 @@ func (c *Context) FileFromFS(filepath string, fs http.FileSystem) {
// FileAttachment writes the specified file into the body stream in an efficient way
// On the client side, the file will typically be downloaded with the given filename
func (c *Context) FileAttachment(filepath, filename string) {
- c.Writer.Header().Set("content-disposition", fmt.Sprintf("attachment; filename=\"%s\"", filename))
+ c.Writer.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", filename))
http.ServeFile(c.Writer, c.Request, filepath)
}
diff --git a/vendor/github.com/gin-gonic/gin/context_appengine.go b/vendor/github.com/gin-gonic/gin/context_appengine.go
index 38c189a0b..d56584348 100644
--- a/vendor/github.com/gin-gonic/gin/context_appengine.go
+++ b/vendor/github.com/gin-gonic/gin/context_appengine.go
@@ -1,9 +1,10 @@
-// +build appengine
-
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
+//go:build appengine
+// +build appengine
+
package gin
func init() {
diff --git a/vendor/github.com/gin-gonic/gin/debug.go b/vendor/github.com/gin-gonic/gin/debug.go
index c66ca4408..4c7cd0c39 100644
--- a/vendor/github.com/gin-gonic/gin/debug.go
+++ b/vendor/github.com/gin-gonic/gin/debug.go
@@ -12,7 +12,7 @@ import (
"strings"
)
-const ginSupportMinGoVer = 10
+const ginSupportMinGoVer = 12
// IsDebugging returns true if the framework is running in debug mode.
// Use SetMode(gin.ReleaseMode) to disable debug mode.
@@ -67,7 +67,7 @@ func getMinVer(v string) (uint64, error) {
func debugPrintWARNINGDefault() {
if v, e := getMinVer(runtime.Version()); e == nil && v <= ginSupportMinGoVer {
- debugPrint(`[WARNING] Now Gin requires Go 1.11 or later and Go 1.12 will be required soon.
+ debugPrint(`[WARNING] Now Gin requires Go 1.12+.
`)
}
diff --git a/vendor/github.com/gin-gonic/gin/errors.go b/vendor/github.com/gin-gonic/gin/errors.go
index 25e8ff60e..0f276c13d 100644
--- a/vendor/github.com/gin-gonic/gin/errors.go
+++ b/vendor/github.com/gin-gonic/gin/errors.go
@@ -55,7 +55,7 @@ func (msg *Error) SetMeta(data interface{}) *Error {
// JSON creates a properly formatted JSON
func (msg *Error) JSON() interface{} {
- json := H{}
+ jsonData := H{}
if msg.Meta != nil {
value := reflect.ValueOf(msg.Meta)
switch value.Kind() {
@@ -63,16 +63,16 @@ func (msg *Error) JSON() interface{} {
return msg.Meta
case reflect.Map:
for _, key := range value.MapKeys() {
- json[key.String()] = value.MapIndex(key).Interface()
+ jsonData[key.String()] = value.MapIndex(key).Interface()
}
default:
- json["meta"] = msg.Meta
+ jsonData["meta"] = msg.Meta
}
}
- if _, ok := json["error"]; !ok {
- json["error"] = msg.Error()
+ if _, ok := jsonData["error"]; !ok {
+ jsonData["error"] = msg.Error()
}
- return json
+ return jsonData
}
// MarshalJSON implements the json.Marshaller interface.
@@ -90,6 +90,11 @@ func (msg *Error) IsType(flags ErrorType) bool {
return (msg.Type & flags) > 0
}
+// Unwrap returns the wrapped error, to allow interoperability with errors.Is(), errors.As() and errors.Unwrap()
+func (msg *Error) Unwrap() error {
+ return msg.Err
+}
+
// ByType returns a readonly copy filtered the byte.
// ie ByType(gin.ErrorTypePublic) returns a slice of errors with type=ErrorTypePublic.
func (a errorMsgs) ByType(typ ErrorType) errorMsgs {
@@ -135,17 +140,17 @@ func (a errorMsgs) Errors() []string {
}
func (a errorMsgs) JSON() interface{} {
- switch len(a) {
+ switch length := len(a); length {
case 0:
return nil
case 1:
return a.Last().JSON()
default:
- json := make([]interface{}, len(a))
+ jsonData := make([]interface{}, length)
for i, err := range a {
- json[i] = err.JSON()
+ jsonData[i] = err.JSON()
}
- return json
+ return jsonData
}
}
diff --git a/vendor/github.com/gin-gonic/gin/fs.go b/vendor/github.com/gin-gonic/gin/fs.go
index 7a6738a68..007d9b755 100644
--- a/vendor/github.com/gin-gonic/gin/fs.go
+++ b/vendor/github.com/gin-gonic/gin/fs.go
@@ -9,7 +9,7 @@ import (
"os"
)
-type onlyfilesFS struct {
+type onlyFilesFS struct {
fs http.FileSystem
}
@@ -26,11 +26,11 @@ func Dir(root string, listDirectory bool) http.FileSystem {
if listDirectory {
return fs
}
- return &onlyfilesFS{fs}
+ return &onlyFilesFS{fs}
}
// Open conforms to http.Filesystem.
-func (fs onlyfilesFS) Open(name string) (http.File, error) {
+func (fs onlyFilesFS) Open(name string) (http.File, error) {
f, err := fs.fs.Open(name)
if err != nil {
return nil, err
diff --git a/vendor/github.com/gin-gonic/gin/gin.go b/vendor/github.com/gin-gonic/gin/gin.go
index ab1d0a468..03a0e127e 100644
--- a/vendor/github.com/gin-gonic/gin/gin.go
+++ b/vendor/github.com/gin-gonic/gin/gin.go
@@ -11,6 +11,7 @@ import (
"net/http"
"os"
"path"
+ "strings"
"sync"
"github.com/gin-gonic/gin/internal/bytesconv"
@@ -20,11 +21,12 @@ import (
const defaultMultipartMemory = 32 << 20 // 32 MB
var (
- default404Body = []byte("404 page not found")
- default405Body = []byte("405 method not allowed")
- defaultAppEngine bool
+ default404Body = []byte("404 page not found")
+ default405Body = []byte("405 method not allowed")
)
+var defaultAppEngine bool
+
// HandlerFunc defines the handler used by gin middleware as return value.
type HandlerFunc func(*Context)
@@ -80,9 +82,26 @@ type Engine struct {
// If no other Method is allowed, the request is delegated to the NotFound
// handler.
HandleMethodNotAllowed bool
- ForwardedByClientIP bool
- // #726 #755 If enabled, it will thrust some headers starting with
+ // If enabled, client IP will be parsed from the request's headers that
+ // match those stored at `(*gin.Engine).RemoteIPHeaders`. If no IP was
+ // fetched, it falls back to the IP obtained from
+ // `(*gin.Context).Request.RemoteAddr`.
+ ForwardedByClientIP bool
+
+ // List of headers used to obtain the client IP when
+ // `(*gin.Engine).ForwardedByClientIP` is `true` and
+ // `(*gin.Context).Request.RemoteAddr` is matched by at least one of the
+ // network origins of `(*gin.Engine).TrustedProxies`.
+ RemoteIPHeaders []string
+
+ // List of network origins (IPv4 addresses, IPv4 CIDRs, IPv6 addresses or
+ // IPv6 CIDRs) from which to trust request's headers that contain
+ // alternative client IP when `(*gin.Engine).ForwardedByClientIP` is
+ // `true`.
+ TrustedProxies []string
+
+ // #726 #755 If enabled, it will trust some headers starting with
// 'X-AppEngine...' for better integration with that PaaS.
AppEngine bool
@@ -103,7 +122,7 @@ type Engine struct {
RemoveExtraSlash bool
delims render.Delims
- secureJsonPrefix string
+ secureJSONPrefix string
HTMLRender render.HTMLRender
FuncMap template.FuncMap
allNoRoute HandlersChain
@@ -112,6 +131,8 @@ type Engine struct {
noMethod HandlersChain
pool sync.Pool
trees methodTrees
+ maxParams uint16
+ trustedCIDRs []*net.IPNet
}
var _ IRouter = &Engine{}
@@ -137,6 +158,8 @@ func New() *Engine {
RedirectFixedPath: false,
HandleMethodNotAllowed: false,
ForwardedByClientIP: true,
+ RemoteIPHeaders: []string{"X-Forwarded-For", "X-Real-IP"},
+ TrustedProxies: []string{"0.0.0.0/0"},
AppEngine: defaultAppEngine,
UseRawPath: false,
RemoveExtraSlash: false,
@@ -144,7 +167,7 @@ func New() *Engine {
MaxMultipartMemory: defaultMultipartMemory,
trees: make(methodTrees, 0, 9),
delims: render.Delims{Left: "{{", Right: "}}"},
- secureJsonPrefix: "while(1);",
+ secureJSONPrefix: "while(1);",
}
engine.RouterGroup.engine = engine
engine.pool.New = func() interface{} {
@@ -162,7 +185,8 @@ func Default() *Engine {
}
func (engine *Engine) allocateContext() *Context {
- return &Context{engine: engine}
+ v := make(Params, 0, engine.maxParams)
+ return &Context{engine: engine, params: &v}
}
// Delims sets template left and right delims and returns a Engine instance.
@@ -171,9 +195,9 @@ func (engine *Engine) Delims(left, right string) *Engine {
return engine
}
-// SecureJsonPrefix sets the secureJsonPrefix used in Context.SecureJSON.
+// SecureJsonPrefix sets the secureJSONPrefix used in Context.SecureJSON.
func (engine *Engine) SecureJsonPrefix(prefix string) *Engine {
- engine.secureJsonPrefix = prefix
+ engine.secureJSONPrefix = prefix
return engine
}
@@ -255,6 +279,7 @@ func (engine *Engine) addRoute(method, path string, handlers HandlersChain) {
assert1(len(handlers) > 0, "there must be at least one handler")
debugPrintRoute(method, path, handlers)
+
root := engine.trees.get(method)
if root == nil {
root = new(node)
@@ -262,6 +287,11 @@ func (engine *Engine) addRoute(method, path string, handlers HandlersChain) {
engine.trees = append(engine.trees, methodTree{method: method, root: root})
}
root.addRoute(path, handlers)
+
+ // Update maxParams
+ if paramsCount := countParams(path); paramsCount > engine.maxParams {
+ engine.maxParams = paramsCount
+ }
}
// Routes returns a slice of registered routes, including some useful information, such as:
@@ -296,12 +326,60 @@ func iterate(path, method string, routes RoutesInfo, root *node) RoutesInfo {
func (engine *Engine) Run(addr ...string) (err error) {
defer func() { debugPrintError(err) }()
+ trustedCIDRs, err := engine.prepareTrustedCIDRs()
+ if err != nil {
+ return err
+ }
+ engine.trustedCIDRs = trustedCIDRs
address := resolveAddress(addr)
debugPrint("Listening and serving HTTP on %s\n", address)
err = http.ListenAndServe(address, engine)
return
}
+func (engine *Engine) prepareTrustedCIDRs() ([]*net.IPNet, error) {
+ if engine.TrustedProxies == nil {
+ return nil, nil
+ }
+
+ cidr := make([]*net.IPNet, 0, len(engine.TrustedProxies))
+ for _, trustedProxy := range engine.TrustedProxies {
+ if !strings.Contains(trustedProxy, "/") {
+ ip := parseIP(trustedProxy)
+ if ip == nil {
+ return cidr, &net.ParseError{Type: "IP address", Text: trustedProxy}
+ }
+
+ switch len(ip) {
+ case net.IPv4len:
+ trustedProxy += "/32"
+ case net.IPv6len:
+ trustedProxy += "/128"
+ }
+ }
+ _, cidrNet, err := net.ParseCIDR(trustedProxy)
+ if err != nil {
+ return cidr, err
+ }
+ cidr = append(cidr, cidrNet)
+ }
+ return cidr, nil
+}
+
+// parseIP parse a string representation of an IP and returns a net.IP with the
+// minimum byte representation or nil if input is invalid.
+func parseIP(ip string) net.IP {
+ parsedIP := net.ParseIP(ip)
+
+ if ipv4 := parsedIP.To4(); ipv4 != nil {
+ // return ip in a 4-byte representation
+ return ipv4
+ }
+
+ // return ip in a 16-byte representation or nil
+ return parsedIP
+}
+
// RunTLS attaches the router to a http.Server and starts listening and serving HTTPS (secure) requests.
// It is a shortcut for http.ListenAndServeTLS(addr, certFile, keyFile, router)
// Note: this method will block the calling goroutine indefinitely unless an error happens.
@@ -401,10 +479,12 @@ func (engine *Engine) handleHTTPRequest(c *Context) {
}
root := t[i].root
// Find route in tree
- value := root.getValue(rPath, c.Params, unescape)
+ value := root.getValue(rPath, c.params, unescape)
+ if value.params != nil {
+ c.Params = *value.params
+ }
if value.handlers != nil {
c.handlers = value.handlers
- c.Params = value.params
c.fullPath = value.fullPath
c.Next()
c.writermem.WriteHeaderNow()
diff --git a/vendor/github.com/gin-gonic/gin/go.mod b/vendor/github.com/gin-gonic/gin/go.mod
index cfaee7462..884ff8517 100644
--- a/vendor/github.com/gin-gonic/gin/go.mod
+++ b/vendor/github.com/gin-gonic/gin/go.mod
@@ -4,7 +4,7 @@ go 1.13
require (
github.com/gin-contrib/sse v0.1.0
- github.com/go-playground/validator/v10 v10.2.0
+ github.com/go-playground/validator/v10 v10.4.1
github.com/golang/protobuf v1.3.3
github.com/json-iterator/go v1.1.9
github.com/mattn/go-isatty v0.0.12
diff --git a/vendor/github.com/gin-gonic/gin/go.sum b/vendor/github.com/gin-gonic/gin/go.sum
index 4c14fb83f..a64b33192 100644
--- a/vendor/github.com/gin-gonic/gin/go.sum
+++ b/vendor/github.com/gin-gonic/gin/go.sum
@@ -9,8 +9,8 @@ github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8c
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
-github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
-github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
+github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
+github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
@@ -34,8 +34,15 @@ github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
diff --git a/vendor/github.com/gin-gonic/gin/internal/bytesconv/bytesconv.go b/vendor/github.com/gin-gonic/gin/internal/bytesconv/bytesconv.go
index 32c2b59e0..86e4c4d44 100644
--- a/vendor/github.com/gin-gonic/gin/internal/bytesconv/bytesconv.go
+++ b/vendor/github.com/gin-gonic/gin/internal/bytesconv/bytesconv.go
@@ -1,16 +1,21 @@
+// Copyright 2020 Gin Core Team. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
package bytesconv
import (
- "reflect"
"unsafe"
)
// StringToBytes converts string to byte slice without a memory allocation.
-func StringToBytes(s string) (b []byte) {
- sh := *(*reflect.StringHeader)(unsafe.Pointer(&s))
- bh := (*reflect.SliceHeader)(unsafe.Pointer(&b))
- bh.Data, bh.Len, bh.Cap = sh.Data, sh.Len, sh.Len
- return b
+func StringToBytes(s string) []byte {
+ return *(*[]byte)(unsafe.Pointer(
+ &struct {
+ string
+ Cap int
+ }{s, len(s)},
+ ))
}
// BytesToString converts byte slice to string without a memory allocation.
diff --git a/vendor/github.com/gin-gonic/gin/internal/json/json.go b/vendor/github.com/gin-gonic/gin/internal/json/json.go
index 480e8bff4..172aeb241 100644
--- a/vendor/github.com/gin-gonic/gin/internal/json/json.go
+++ b/vendor/github.com/gin-gonic/gin/internal/json/json.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
+//go:build !jsoniter
// +build !jsoniter
package json
diff --git a/vendor/github.com/gin-gonic/gin/internal/json/jsoniter.go b/vendor/github.com/gin-gonic/gin/internal/json/jsoniter.go
index fabd7b84e..232f8dcad 100644
--- a/vendor/github.com/gin-gonic/gin/internal/json/jsoniter.go
+++ b/vendor/github.com/gin-gonic/gin/internal/json/jsoniter.go
@@ -2,11 +2,12 @@
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
+//go:build jsoniter
// +build jsoniter
package json
-import "github.com/json-iterator/go"
+import jsoniter "github.com/json-iterator/go"
var (
json = jsoniter.ConfigCompatibleWithStandardLibrary
diff --git a/vendor/github.com/gin-gonic/gin/mode.go b/vendor/github.com/gin-gonic/gin/mode.go
index edfc29406..c8813aff2 100644
--- a/vendor/github.com/gin-gonic/gin/mode.go
+++ b/vendor/github.com/gin-gonic/gin/mode.go
@@ -22,6 +22,7 @@ const (
// TestMode indicates gin mode is test.
TestMode = "test"
)
+
const (
debugCode = iota
releaseCode
@@ -50,19 +51,21 @@ func init() {
// SetMode sets gin mode according to input string.
func SetMode(value string) {
+ if value == "" {
+ value = DebugMode
+ }
+
switch value {
- case DebugMode, "":
+ case DebugMode:
ginMode = debugCode
case ReleaseMode:
ginMode = releaseCode
case TestMode:
ginMode = testCode
default:
- panic("gin mode unknown: " + value)
- }
- if value == "" {
- value = DebugMode
+ panic("gin mode unknown: " + value + " (available mode: debug release test)")
}
+
modeName = value
}
diff --git a/vendor/github.com/gin-gonic/gin/path.go b/vendor/github.com/gin-gonic/gin/path.go
index 51346e4a0..d42d6b9d0 100644
--- a/vendor/github.com/gin-gonic/gin/path.go
+++ b/vendor/github.com/gin-gonic/gin/path.go
@@ -136,10 +136,11 @@ func bufApp(buf *[]byte, s string, w int, c byte) {
// Otherwise use either the stack buffer, if it is large enough, or
// allocate a new buffer on the heap, and copy all previous characters.
- if l := len(s); l > cap(b) {
- *buf = make([]byte, len(s))
+ length := len(s)
+ if length > cap(b) {
+ *buf = make([]byte, length)
} else {
- *buf = (*buf)[:l]
+ *buf = (*buf)[:length]
}
b = *buf
diff --git a/vendor/github.com/gin-gonic/gin/recovery.go b/vendor/github.com/gin-gonic/gin/recovery.go
index bc946c03a..563f5aaa8 100644
--- a/vendor/github.com/gin-gonic/gin/recovery.go
+++ b/vendor/github.com/gin-gonic/gin/recovery.go
@@ -26,13 +26,29 @@ var (
slash = []byte("/")
)
+// RecoveryFunc defines the function passable to CustomRecovery.
+type RecoveryFunc func(c *Context, err interface{})
+
// Recovery returns a middleware that recovers from any panics and writes a 500 if there was one.
func Recovery() HandlerFunc {
return RecoveryWithWriter(DefaultErrorWriter)
}
+//CustomRecovery returns a middleware that recovers from any panics and calls the provided handle func to handle it.
+func CustomRecovery(handle RecoveryFunc) HandlerFunc {
+ return RecoveryWithWriter(DefaultErrorWriter, handle)
+}
+
// RecoveryWithWriter returns a middleware for a given writer that recovers from any panics and writes a 500 if there was one.
-func RecoveryWithWriter(out io.Writer) HandlerFunc {
+func RecoveryWithWriter(out io.Writer, recovery ...RecoveryFunc) HandlerFunc {
+ if len(recovery) > 0 {
+ return CustomRecoveryWithWriter(out, recovery[0])
+ }
+ return CustomRecoveryWithWriter(out, defaultHandleRecovery)
+}
+
+// CustomRecoveryWithWriter returns a middleware for a given writer that recovers from any panics and calls the provided handle func to handle it.
+func CustomRecoveryWithWriter(out io.Writer, handle RecoveryFunc) HandlerFunc {
var logger *log.Logger
if out != nil {
logger = log.New(out, "\n\n\x1b[31m", log.LstdFlags)
@@ -60,23 +76,23 @@ func RecoveryWithWriter(out io.Writer) HandlerFunc {
headers[idx] = current[0] + ": *"
}
}
+ headersToStr := strings.Join(headers, "\r\n")
if brokenPipe {
- logger.Printf("%s\n%s%s", err, string(httpRequest), reset)
+ logger.Printf("%s\n%s%s", err, headersToStr, reset)
} else if IsDebugging() {
logger.Printf("[Recovery] %s panic recovered:\n%s\n%s\n%s%s",
- timeFormat(time.Now()), strings.Join(headers, "\r\n"), err, stack, reset)
+ timeFormat(time.Now()), headersToStr, err, stack, reset)
} else {
logger.Printf("[Recovery] %s panic recovered:\n%s\n%s%s",
timeFormat(time.Now()), err, stack, reset)
}
}
-
- // If the connection is dead, we can't write a status to it.
if brokenPipe {
+ // If the connection is dead, we can't write a status to it.
c.Error(err.(error)) // nolint: errcheck
c.Abort()
} else {
- c.AbortWithStatus(http.StatusInternalServerError)
+ handle(c, err)
}
}
}()
@@ -84,6 +100,10 @@ func RecoveryWithWriter(out io.Writer) HandlerFunc {
}
}
+func defaultHandleRecovery(c *Context, err interface{}) {
+ c.AbortWithStatus(http.StatusInternalServerError)
+}
+
// stack returns a nicely formatted stack frame, skipping skip frames.
func stack(skip int) []byte {
buf := new(bytes.Buffer) // the returned data
@@ -146,6 +166,6 @@ func function(pc uintptr) []byte {
}
func timeFormat(t time.Time) string {
- var timeString = t.Format("2006/01/02 - 15:04:05")
+ timeString := t.Format("2006/01/02 - 15:04:05")
return timeString
}
diff --git a/vendor/github.com/gin-gonic/gin/render/json.go b/vendor/github.com/gin-gonic/gin/render/json.go
index 015c0dbb5..418630939 100644
--- a/vendor/github.com/gin-gonic/gin/render/json.go
+++ b/vendor/github.com/gin-gonic/gin/render/json.go
@@ -41,9 +41,6 @@ type AsciiJSON struct {
Data interface{}
}
-// SecureJSONPrefix is a string which represents SecureJSON prefix.
-type SecureJSONPrefix string
-
// PureJSON contains the given interface object.
type PureJSON struct {
Data interface{}
diff --git a/vendor/github.com/gin-gonic/gin/render/msgpack.go b/vendor/github.com/gin-gonic/gin/render/msgpack.go
index be2d45c51..6ef5b6e51 100644
--- a/vendor/github.com/gin-gonic/gin/render/msgpack.go
+++ b/vendor/github.com/gin-gonic/gin/render/msgpack.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
+//go:build !nomsgpack
// +build !nomsgpack
package render
diff --git a/vendor/github.com/gin-gonic/gin/render/text.go b/vendor/github.com/gin-gonic/gin/render/text.go
index 4e52d4c50..461b720af 100644
--- a/vendor/github.com/gin-gonic/gin/render/text.go
+++ b/vendor/github.com/gin-gonic/gin/render/text.go
@@ -6,8 +6,9 @@ package render
import (
"fmt"
- "io"
"net/http"
+
+ "github.com/gin-gonic/gin/internal/bytesconv"
)
// String contains the given interface object slice and its format.
@@ -35,6 +36,6 @@ func WriteString(w http.ResponseWriter, format string, data []interface{}) (err
_, err = fmt.Fprintf(w, format, data...)
return
}
- _, err = io.WriteString(w, format)
+ _, err = w.Write(bytesconv.StringToBytes(format))
return
}
diff --git a/vendor/github.com/gin-gonic/gin/routergroup.go b/vendor/github.com/gin-gonic/gin/routergroup.go
index 9ff7c0385..15d9930d3 100644
--- a/vendor/github.com/gin-gonic/gin/routergroup.go
+++ b/vendor/github.com/gin-gonic/gin/routergroup.go
@@ -187,7 +187,7 @@ func (group *RouterGroup) createStaticHandler(relativePath string, fs http.FileS
fileServer := http.StripPrefix(absolutePath, http.FileServer(fs))
return func(c *Context) {
- if _, nolisting := fs.(*onlyfilesFS); nolisting {
+ if _, noListing := fs.(*onlyFilesFS); noListing {
c.Writer.WriteHeader(http.StatusNotFound)
}
diff --git a/vendor/github.com/gin-gonic/gin/tree.go b/vendor/github.com/gin-gonic/gin/tree.go
index b687ec43d..5eb093489 100644
--- a/vendor/github.com/gin-gonic/gin/tree.go
+++ b/vendor/github.com/gin-gonic/gin/tree.go
@@ -5,9 +5,18 @@
package gin
import (
+ "bytes"
"net/url"
"strings"
"unicode"
+ "unicode/utf8"
+
+ "github.com/gin-gonic/gin/internal/bytesconv"
+)
+
+var (
+ strColon = []byte(":")
+ strStar = []byte("*")
)
// Param is a single URL parameter, consisting of a key and a value.
@@ -71,17 +80,22 @@ func longestCommonPrefix(a, b string) int {
return i
}
-func countParams(path string) uint8 {
- var n uint
- for i := 0; i < len(path); i++ {
- if path[i] == ':' || path[i] == '*' {
- n++
- }
+// addChild will add a child node, keeping wildcards at the end
+func (n *node) addChild(child *node) {
+ if n.wildChild && len(n.children) > 0 {
+ wildcardChild := n.children[len(n.children)-1]
+ n.children = append(n.children[:len(n.children)-1], child, wildcardChild)
+ } else {
+ n.children = append(n.children, child)
}
- if n >= 255 {
- return 255
- }
- return uint8(n)
+}
+
+func countParams(path string) uint16 {
+ var n uint16
+ s := bytesconv.StringToBytes(path)
+ n += uint16(bytes.Count(s, strColon))
+ n += uint16(bytes.Count(s, strStar))
+ return n
}
type nodeType uint8
@@ -96,16 +110,15 @@ const (
type node struct {
path string
indices string
- children []*node
- handlers HandlersChain
- priority uint32
- nType nodeType
- maxParams uint8
wildChild bool
+ nType nodeType
+ priority uint32
+ children []*node // child nodes, at most 1 :param style node at the end of the array
+ handlers HandlersChain
fullPath string
}
-// increments priority of the given child and reorders if necessary.
+// Increments priority of the given child and reorders if necessary
func (n *node) incrementChildPrio(pos int) int {
cs := n.children
cs[pos].priority++
@@ -118,11 +131,11 @@ func (n *node) incrementChildPrio(pos int) int {
cs[newPos-1], cs[newPos] = cs[newPos], cs[newPos-1]
}
- // build new index char string
+ // Build new index char string
if newPos != pos {
- n.indices = n.indices[:newPos] + // unchanged prefix, might be empty
- n.indices[pos:pos+1] + // the index char we move
- n.indices[newPos:pos] + n.indices[pos+1:] // rest without char at 'pos'
+ n.indices = n.indices[:newPos] + // Unchanged prefix, might be empty
+ n.indices[pos:pos+1] + // The index char we move
+ n.indices[newPos:pos] + n.indices[pos+1:] // Rest without char at 'pos'
}
return newPos
@@ -133,11 +146,10 @@ func (n *node) incrementChildPrio(pos int) int {
func (n *node) addRoute(path string, handlers HandlersChain) {
fullPath := path
n.priority++
- numParams := countParams(path)
// Empty tree
if len(n.path) == 0 && len(n.children) == 0 {
- n.insertChild(numParams, path, fullPath, handlers)
+ n.insertChild(path, fullPath, handlers)
n.nType = root
return
}
@@ -146,11 +158,6 @@ func (n *node) addRoute(path string, handlers HandlersChain) {
walk:
for {
- // Update maxParams of the current node
- if numParams > n.maxParams {
- n.maxParams = numParams
- }
-
// Find the longest common prefix.
// This also implies that the common prefix contains no ':' or '*'
// since the existing key can't contain those chars.
@@ -168,16 +175,9 @@ walk:
fullPath: n.fullPath,
}
- // Update maxParams (max of all children)
- for _, v := range child.children {
- if v.maxParams > child.maxParams {
- child.maxParams = v.maxParams
- }
- }
-
n.children = []*node{&child}
// []byte for proper unicode char conversion, see #65
- n.indices = string([]byte{n.path[i]})
+ n.indices = bytesconv.BytesToString([]byte{n.path[i]})
n.path = path[:i]
n.handlers = nil
n.wildChild = false
@@ -187,41 +187,9 @@ walk:
// Make new node a child of this node
if i < len(path) {
path = path[i:]
-
- if n.wildChild {
- parentFullPathIndex += len(n.path)
- n = n.children[0]
- n.priority++
-
- // Update maxParams of the child node
- if numParams > n.maxParams {
- n.maxParams = numParams
- }
- numParams--
-
- // Check if the wildcard matches
- if len(path) >= len(n.path) && n.path == path[:len(n.path)] {
- // check for longer wildcard, e.g. :name and :names
- if len(n.path) >= len(path) || path[len(n.path)] == '/' {
- continue walk
- }
- }
-
- pathSeg := path
- if n.nType != catchAll {
- pathSeg = strings.SplitN(path, "/", 2)[0]
- }
- prefix := fullPath[:strings.Index(fullPath, pathSeg)] + n.path
- panic("'" + pathSeg +
- "' in new path '" + fullPath +
- "' conflicts with existing wildcard '" + n.path +
- "' in existing prefix '" + prefix +
- "'")
- }
-
c := path[0]
- // slash after param
+ // '/' after param
if n.nType == param && c == '/' && len(n.children) == 1 {
parentFullPathIndex += len(n.path)
n = n.children[0]
@@ -240,32 +208,58 @@ walk:
}
// Otherwise insert it
- if c != ':' && c != '*' {
+ if c != ':' && c != '*' && n.nType != catchAll {
// []byte for proper unicode char conversion, see #65
- n.indices += string([]byte{c})
+ n.indices += bytesconv.BytesToString([]byte{c})
child := &node{
- maxParams: numParams,
- fullPath: fullPath,
+ fullPath: fullPath,
}
- n.children = append(n.children, child)
+ n.addChild(child)
n.incrementChildPrio(len(n.indices) - 1)
n = child
+ } else if n.wildChild {
+ // inserting a wildcard node, need to check if it conflicts with the existing wildcard
+ n = n.children[len(n.children)-1]
+ n.priority++
+
+ // Check if the wildcard matches
+ if len(path) >= len(n.path) && n.path == path[:len(n.path)] &&
+ // Adding a child to a catchAll is not possible
+ n.nType != catchAll &&
+ // Check for longer wildcard, e.g. :name and :names
+ (len(n.path) >= len(path) || path[len(n.path)] == '/') {
+ continue walk
+ }
+
+ // Wildcard conflict
+ pathSeg := path
+ if n.nType != catchAll {
+ pathSeg = strings.SplitN(pathSeg, "/", 2)[0]
+ }
+ prefix := fullPath[:strings.Index(fullPath, pathSeg)] + n.path
+ panic("'" + pathSeg +
+ "' in new path '" + fullPath +
+ "' conflicts with existing wildcard '" + n.path +
+ "' in existing prefix '" + prefix +
+ "'")
}
- n.insertChild(numParams, path, fullPath, handlers)
+
+ n.insertChild(path, fullPath, handlers)
return
}
- // Otherwise and handle to current node
+ // Otherwise add handle to current node
if n.handlers != nil {
panic("handlers are already registered for path '" + fullPath + "'")
}
n.handlers = handlers
+ n.fullPath = fullPath
return
}
}
// Search for a wildcard segment and check the name for invalid characters.
-// Returns -1 as index, if no wildcard war found.
+// Returns -1 as index, if no wildcard was found.
func findWildcard(path string) (wildcard string, i int, valid bool) {
// Find start
for start, c := range []byte(path) {
@@ -289,8 +283,8 @@ func findWildcard(path string) (wildcard string, i int, valid bool) {
return "", -1, false
}
-func (n *node) insertChild(numParams uint8, path string, fullPath string, handlers HandlersChain) {
- for numParams > 0 {
+func (n *node) insertChild(path string, fullPath string, handlers HandlersChain) {
+ for {
// Find prefix until first wildcard
wildcard, i, valid := findWildcard(path)
if i < 0 { // No wildcard found
@@ -308,13 +302,6 @@ func (n *node) insertChild(numParams uint8, path string, fullPath string, handle
panic("wildcards must be named with a non-empty name in path '" + fullPath + "'")
}
- // Check if this node has existing children which would be
- // unreachable if we insert the wildcard here
- if len(n.children) > 0 {
- panic("wildcard segment '" + wildcard +
- "' conflicts with existing children in path '" + fullPath + "'")
- }
-
if wildcard[0] == ':' { // param
if i > 0 {
// Insert prefix before the current wildcard
@@ -322,17 +309,15 @@ func (n *node) insertChild(numParams uint8, path string, fullPath string, handle
path = path[i:]
}
- n.wildChild = true
child := &node{
- nType: param,
- path: wildcard,
- maxParams: numParams,
- fullPath: fullPath,
+ nType: param,
+ path: wildcard,
+ fullPath: fullPath,
}
- n.children = []*node{child}
+ n.addChild(child)
+ n.wildChild = true
n = child
n.priority++
- numParams--
// if the path doesn't end with the wildcard, then there
// will be another non-wildcard subpath starting with '/'
@@ -340,11 +325,10 @@ func (n *node) insertChild(numParams uint8, path string, fullPath string, handle
path = path[len(wildcard):]
child := &node{
- maxParams: numParams,
- priority: 1,
- fullPath: fullPath,
+ priority: 1,
+ fullPath: fullPath,
}
- n.children = []*node{child}
+ n.addChild(child)
n = child
continue
}
@@ -355,7 +339,7 @@ func (n *node) insertChild(numParams uint8, path string, fullPath string, handle
}
// catchAll
- if i+len(wildcard) != len(path) || numParams > 1 {
+ if i+len(wildcard) != len(path) {
panic("catch-all routes are only allowed at the end of the path in path '" + fullPath + "'")
}
@@ -375,26 +359,21 @@ func (n *node) insertChild(numParams uint8, path string, fullPath string, handle
child := &node{
wildChild: true,
nType: catchAll,
- maxParams: 1,
fullPath: fullPath,
}
- // update maxParams of the parent node
- if n.maxParams < 1 {
- n.maxParams = 1
- }
- n.children = []*node{child}
+
+ n.addChild(child)
n.indices = string('/')
n = child
n.priority++
// second node: node holding the variable
child = &node{
- path: path[i:],
- nType: catchAll,
- maxParams: 1,
- handlers: handlers,
- priority: 1,
- fullPath: fullPath,
+ path: path[i:],
+ nType: catchAll,
+ handlers: handlers,
+ priority: 1,
+ fullPath: fullPath,
}
n.children = []*node{child}
@@ -410,22 +389,170 @@ func (n *node) insertChild(numParams uint8, path string, fullPath string, handle
// nodeValue holds return values of (*Node).getValue method
type nodeValue struct {
handlers HandlersChain
- params Params
+ params *Params
tsr bool
fullPath string
}
-// getValue returns the handle registered with the given path (key). The values of
+// Returns the handle registered with the given path (key). The values of
// wildcards are saved to a map.
// If no handle can be found, a TSR (trailing slash redirect) recommendation is
// made if a handle exists with an extra (without the) trailing slash for the
// given path.
-func (n *node) getValue(path string, po Params, unescape bool) (value nodeValue) {
- value.params = po
+func (n *node) getValue(path string, params *Params, unescape bool) (value nodeValue) {
+ var (
+ skippedPath string
+ latestNode = n // Caching the latest node
+ )
+
walk: // Outer loop for walking the tree
for {
prefix := n.path
+ if len(path) > len(prefix) {
+ if path[:len(prefix)] == prefix {
+ path = path[len(prefix):]
+
+ // Try all the non-wildcard children first by matching the indices
+ idxc := path[0]
+ for i, c := range []byte(n.indices) {
+ if c == idxc {
+ // strings.HasPrefix(n.children[len(n.children)-1].path, ":") == n.wildChild
+ if n.wildChild {
+ skippedPath = prefix + path
+ latestNode = &node{
+ path: n.path,
+ wildChild: n.wildChild,
+ nType: n.nType,
+ priority: n.priority,
+ children: n.children,
+ handlers: n.handlers,
+ fullPath: n.fullPath,
+ }
+ }
+
+ n = n.children[i]
+ continue walk
+ }
+ }
+ // If the path at the end of the loop is not equal to '/' and the current node has no child nodes
+ // the current node needs to be equal to the latest matching node
+ matched := path != "/" && !n.wildChild
+ if matched {
+ n = latestNode
+ }
+
+ // If there is no wildcard pattern, recommend a redirection
+ if !n.wildChild {
+ // Nothing found.
+ // We can recommend to redirect to the same URL without a
+ // trailing slash if a leaf exists for that path.
+ value.tsr = path == "/" && n.handlers != nil
+ return
+ }
+
+ // Handle wildcard child, which is always at the end of the array
+ n = n.children[len(n.children)-1]
+
+ switch n.nType {
+ case param:
+ // fix truncate the parameter
+ // tree_test.go line: 204
+ if matched {
+ path = prefix + path
+ // The saved path is used after the prefix route is intercepted by matching
+ if n.indices == "/" {
+ path = skippedPath[1:]
+ }
+ }
+
+ // Find param end (either '/' or path end)
+ end := 0
+ for end < len(path) && path[end] != '/' {
+ end++
+ }
+
+ // Save param value
+ if params != nil {
+ if value.params == nil {
+ value.params = params
+ }
+ // Expand slice within preallocated capacity
+ i := len(*value.params)
+ *value.params = (*value.params)[:i+1]
+ val := path[:end]
+ if unescape {
+ if v, err := url.QueryUnescape(val); err == nil {
+ val = v
+ }
+ }
+ (*value.params)[i] = Param{
+ Key: n.path[1:],
+ Value: val,
+ }
+ }
+
+ // we need to go deeper!
+ if end < len(path) {
+ if len(n.children) > 0 {
+ path = path[end:]
+ n = n.children[0]
+ continue walk
+ }
+
+ // ... but we can't
+ value.tsr = (len(path) == end+1)
+ return
+ }
+
+ if value.handlers = n.handlers; value.handlers != nil {
+ value.fullPath = n.fullPath
+ return
+ }
+ if len(n.children) == 1 {
+ // No handle found. Check if a handle for this path + a
+ // trailing slash exists for TSR recommendation
+ n = n.children[0]
+ value.tsr = (n.path == "/" && n.handlers != nil)
+ }
+ return
+
+ case catchAll:
+ // Save param value
+ if params != nil {
+ if value.params == nil {
+ value.params = params
+ }
+ // Expand slice within preallocated capacity
+ i := len(*value.params)
+ *value.params = (*value.params)[:i+1]
+ val := path
+ if unescape {
+ if v, err := url.QueryUnescape(path); err == nil {
+ val = v
+ }
+ }
+ (*value.params)[i] = Param{
+ Key: n.path[2:],
+ Value: val,
+ }
+ }
+
+ value.handlers = n.handlers
+ value.fullPath = n.fullPath
+ return
+
+ default:
+ panic("invalid node type")
+ }
+ }
+ }
+
if path == prefix {
+ // If the current path does not equal '/' and the node does not have a registered handle and the most recently matched node has a child node
+ // the current node needs to be equal to the latest matching node
+ if latestNode.wildChild && n.handlers == nil && path != "/" {
+ n = latestNode.children[len(latestNode.children)-1]
+ }
// We should have reached the node containing the handle.
// Check if this node has a handle registered.
if value.handlers = n.handlers; value.handlers != nil {
@@ -433,6 +560,9 @@ walk: // Outer loop for walking the tree
return
}
+ // If there is no handle for this route, but this route has a
+ // wildcard child, there must be a handle for this path with an
+ // additional trailing slash
if path == "/" && n.wildChild && n.nType != root {
value.tsr = true
return
@@ -440,9 +570,8 @@ walk: // Outer loop for walking the tree
// No handle found. Check if a handle for this path + a
// trailing slash exists for trailing slash recommendation
- indices := n.indices
- for i, max := 0, len(indices); i < max; i++ {
- if indices[i] == '/' {
+ for i, c := range []byte(n.indices) {
+ if c == '/' {
n = n.children[i]
value.tsr = (len(n.path) == 1 && n.handlers != nil) ||
(n.nType == catchAll && n.children[0].handlers != nil)
@@ -453,171 +582,186 @@ walk: // Outer loop for walking the tree
return
}
- if len(path) > len(prefix) && path[:len(prefix)] == prefix {
- path = path[len(prefix):]
- // If this node does not have a wildcard (param or catchAll)
- // child, we can just look up the next child node and continue
- // to walk down the tree
- if !n.wildChild {
- c := path[0]
- indices := n.indices
- for i, max := 0, len(indices); i < max; i++ {
- if c == indices[i] {
- n = n.children[i]
- continue walk
- }
- }
-
- // Nothing found.
- // We can recommend to redirect to the same URL without a
- // trailing slash if a leaf exists for that path.
- value.tsr = path == "/" && n.handlers != nil
- return
- }
-
- // handle wildcard child
- n = n.children[0]
- switch n.nType {
- case param:
- // find param end (either '/' or path end)
- end := 0
- for end < len(path) && path[end] != '/' {
- end++
- }
-
- // save param value
- if cap(value.params) < int(n.maxParams) {
- value.params = make(Params, 0, n.maxParams)
- }
- i := len(value.params)
- value.params = value.params[:i+1] // expand slice within preallocated capacity
- value.params[i].Key = n.path[1:]
- val := path[:end]
- if unescape {
- var err error
- if value.params[i].Value, err = url.QueryUnescape(val); err != nil {
- value.params[i].Value = val // fallback, in case of error
- }
- } else {
- value.params[i].Value = val
- }
-
- // we need to go deeper!
- if end < len(path) {
- if len(n.children) > 0 {
- path = path[end:]
- n = n.children[0]
- continue walk
- }
-
- // ... but we can't
- value.tsr = len(path) == end+1
- return
- }
-
- if value.handlers = n.handlers; value.handlers != nil {
- value.fullPath = n.fullPath
- return
- }
- if len(n.children) == 1 {
- // No handle found. Check if a handle for this path + a
- // trailing slash exists for TSR recommendation
- n = n.children[0]
- value.tsr = n.path == "/" && n.handlers != nil
- }
- return
-
- case catchAll:
- // save param value
- if cap(value.params) < int(n.maxParams) {
- value.params = make(Params, 0, n.maxParams)
- }
- i := len(value.params)
- value.params = value.params[:i+1] // expand slice within preallocated capacity
- value.params[i].Key = n.path[2:]
- if unescape {
- var err error
- if value.params[i].Value, err = url.QueryUnescape(path); err != nil {
- value.params[i].Value = path // fallback, in case of error
- }
- } else {
- value.params[i].Value = path
- }
-
- value.handlers = n.handlers
- value.fullPath = n.fullPath
- return
-
- default:
- panic("invalid node type")
- }
+ if path != "/" && len(skippedPath) > 0 && strings.HasSuffix(skippedPath, path) {
+ path = skippedPath
+ // Reduce the number of cycles
+ n, latestNode = latestNode, n
+ // skippedPath cannot execute
+ // example:
+ // * /:cc/cc
+ // call /a/cc expectations:match/200 Actual:match/200
+ // call /a/dd expectations:unmatch/404 Actual: panic
+ // call /addr/dd/aa expectations:unmatch/404 Actual: panic
+ // skippedPath: It can only be executed if the secondary route is not found
+ skippedPath = ""
+ continue walk
}
// Nothing found. We can recommend to redirect to the same URL with an
// extra trailing slash if a leaf exists for that path
- value.tsr = (path == "/") ||
- (len(prefix) == len(path)+1 && prefix[len(path)] == '/' &&
- path == prefix[:len(prefix)-1] && n.handlers != nil)
+ value.tsr = path == "/" ||
+ (len(prefix) == len(path)+1 && n.handlers != nil)
return
}
}
-// findCaseInsensitivePath makes a case-insensitive lookup of the given path and tries to find a handler.
+// Makes a case-insensitive lookup of the given path and tries to find a handler.
// It can optionally also fix trailing slashes.
// It returns the case-corrected path and a bool indicating whether the lookup
// was successful.
-func (n *node) findCaseInsensitivePath(path string, fixTrailingSlash bool) (ciPath []byte, found bool) {
- ciPath = make([]byte, 0, len(path)+1) // preallocate enough memory
+func (n *node) findCaseInsensitivePath(path string, fixTrailingSlash bool) ([]byte, bool) {
+ const stackBufSize = 128
- // Outer loop for walking the tree
- for len(path) >= len(n.path) && strings.EqualFold(path[:len(n.path)], n.path) {
- path = path[len(n.path):]
+ // Use a static sized buffer on the stack in the common case.
+ // If the path is too long, allocate a buffer on the heap instead.
+ buf := make([]byte, 0, stackBufSize)
+ if length := len(path) + 1; length > stackBufSize {
+ buf = make([]byte, 0, length)
+ }
+
+ ciPath := n.findCaseInsensitivePathRec(
+ path,
+ buf, // Preallocate enough memory for new path
+ [4]byte{}, // Empty rune buffer
+ fixTrailingSlash,
+ )
+
+ return ciPath, ciPath != nil
+}
+
+// Shift bytes in array by n bytes left
+func shiftNRuneBytes(rb [4]byte, n int) [4]byte {
+ switch n {
+ case 0:
+ return rb
+ case 1:
+ return [4]byte{rb[1], rb[2], rb[3], 0}
+ case 2:
+ return [4]byte{rb[2], rb[3]}
+ case 3:
+ return [4]byte{rb[3]}
+ default:
+ return [4]byte{}
+ }
+}
+
+// Recursive case-insensitive lookup function used by n.findCaseInsensitivePath
+func (n *node) findCaseInsensitivePathRec(path string, ciPath []byte, rb [4]byte, fixTrailingSlash bool) []byte {
+ npLen := len(n.path)
+
+walk: // Outer loop for walking the tree
+ for len(path) >= npLen && (npLen == 0 || strings.EqualFold(path[1:npLen], n.path[1:])) {
+ // Add common prefix to result
+ oldPath := path
+ path = path[npLen:]
ciPath = append(ciPath, n.path...)
if len(path) == 0 {
// We should have reached the node containing the handle.
// Check if this node has a handle registered.
if n.handlers != nil {
- return ciPath, true
+ return ciPath
}
// No handle found.
// Try to fix the path by adding a trailing slash
if fixTrailingSlash {
- for i := 0; i < len(n.indices); i++ {
- if n.indices[i] == '/' {
+ for i, c := range []byte(n.indices) {
+ if c == '/' {
n = n.children[i]
if (len(n.path) == 1 && n.handlers != nil) ||
(n.nType == catchAll && n.children[0].handlers != nil) {
- return append(ciPath, '/'), true
+ return append(ciPath, '/')
}
- return
+ return nil
}
}
}
- return
+ return nil
}
// If this node does not have a wildcard (param or catchAll) child,
// we can just look up the next child node and continue to walk down
// the tree
if !n.wildChild {
- r := unicode.ToLower(rune(path[0]))
- for i, index := range n.indices {
- // must use recursive approach since both index and
- // ToLower(index) could exist. We must check both.
- if r == unicode.ToLower(index) {
- out, found := n.children[i].findCaseInsensitivePath(path, fixTrailingSlash)
- if found {
- return append(ciPath, out...), true
+ // Skip rune bytes already processed
+ rb = shiftNRuneBytes(rb, npLen)
+
+ if rb[0] != 0 {
+ // Old rune not finished
+ idxc := rb[0]
+ for i, c := range []byte(n.indices) {
+ if c == idxc {
+ // continue with child node
+ n = n.children[i]
+ npLen = len(n.path)
+ continue walk
+ }
+ }
+ } else {
+ // Process a new rune
+ var rv rune
+
+ // Find rune start.
+ // Runes are up to 4 byte long,
+ // -4 would definitely be another rune.
+ var off int
+ for max := min(npLen, 3); off < max; off++ {
+ if i := npLen - off; utf8.RuneStart(oldPath[i]) {
+ // read rune from cached path
+ rv, _ = utf8.DecodeRuneInString(oldPath[i:])
+ break
+ }
+ }
+
+ // Calculate lowercase bytes of current rune
+ lo := unicode.ToLower(rv)
+ utf8.EncodeRune(rb[:], lo)
+
+ // Skip already processed bytes
+ rb = shiftNRuneBytes(rb, off)
+
+ idxc := rb[0]
+ for i, c := range []byte(n.indices) {
+ // Lowercase matches
+ if c == idxc {
+ // must use a recursive approach since both the
+ // uppercase byte and the lowercase byte might exist
+ // as an index
+ if out := n.children[i].findCaseInsensitivePathRec(
+ path, ciPath, rb, fixTrailingSlash,
+ ); out != nil {
+ return out
+ }
+ break
+ }
+ }
+
+ // If we found no match, the same for the uppercase rune,
+ // if it differs
+ if up := unicode.ToUpper(rv); up != lo {
+ utf8.EncodeRune(rb[:], up)
+ rb = shiftNRuneBytes(rb, off)
+
+ idxc := rb[0]
+ for i, c := range []byte(n.indices) {
+ // Uppercase matches
+ if c == idxc {
+ // Continue with child node
+ n = n.children[i]
+ npLen = len(n.path)
+ continue walk
+ }
}
}
}
// Nothing found. We can recommend to redirect to the same URL
// without a trailing slash if a leaf exists for that path
- found = fixTrailingSlash && path == "/" && n.handlers != nil
- return
+ if fixTrailingSlash && path == "/" && n.handlers != nil {
+ return ciPath
+ }
+ return nil
}
n = n.children[0]
@@ -629,39 +773,43 @@ func (n *node) findCaseInsensitivePath(path string, fixTrailingSlash bool) (ciPa
end++
}
- // add param value to case insensitive path
+ // Add param value to case insensitive path
ciPath = append(ciPath, path[:end]...)
- // we need to go deeper!
+ // We need to go deeper!
if end < len(path) {
if len(n.children) > 0 {
- path = path[end:]
+ // Continue with child node
n = n.children[0]
+ npLen = len(n.path)
+ path = path[end:]
continue
}
// ... but we can't
if fixTrailingSlash && len(path) == end+1 {
- return ciPath, true
+ return ciPath
}
- return
+ return nil
}
if n.handlers != nil {
- return ciPath, true
+ return ciPath
}
+
if fixTrailingSlash && len(n.children) == 1 {
// No handle found. Check if a handle for this path + a
// trailing slash exists
n = n.children[0]
if n.path == "/" && n.handlers != nil {
- return append(ciPath, '/'), true
+ return append(ciPath, '/')
}
}
- return
+
+ return nil
case catchAll:
- return append(ciPath, path...), true
+ return append(ciPath, path...)
default:
panic("invalid node type")
@@ -672,13 +820,12 @@ func (n *node) findCaseInsensitivePath(path string, fixTrailingSlash bool) (ciPa
// Try to fix the path by adding / removing a trailing slash
if fixTrailingSlash {
if path == "/" {
- return ciPath, true
+ return ciPath
}
- if len(path)+1 == len(n.path) && n.path[len(path)] == '/' &&
- strings.EqualFold(path, n.path[:len(path)]) &&
- n.handlers != nil {
- return append(ciPath, n.path...), true
+ if len(path)+1 == npLen && n.path[len(path)] == '/' &&
+ strings.EqualFold(path[1:], n.path[1:len(path)]) && n.handlers != nil {
+ return append(ciPath, n.path...)
}
}
- return
+ return nil
}
diff --git a/vendor/github.com/gin-gonic/gin/utils.go b/vendor/github.com/gin-gonic/gin/utils.go
index 71b80de76..c32f0eeb0 100644
--- a/vendor/github.com/gin-gonic/gin/utils.go
+++ b/vendor/github.com/gin-gonic/gin/utils.go
@@ -90,20 +90,23 @@ func filterFlags(content string) string {
}
func chooseData(custom, wildcard interface{}) interface{} {
- if custom == nil {
- if wildcard == nil {
- panic("negotiation config is invalid")
- }
+ if custom != nil {
+ return custom
+ }
+ if wildcard != nil {
return wildcard
}
- return custom
+ panic("negotiation config is invalid")
}
func parseAccept(acceptHeader string) []string {
parts := strings.Split(acceptHeader, ",")
out := make([]string, 0, len(parts))
for _, part := range parts {
- if part = strings.TrimSpace(strings.Split(part, ";")[0]); part != "" {
+ if i := strings.IndexByte(part, ';'); i > 0 {
+ part = part[:i]
+ }
+ if part = strings.TrimSpace(part); part != "" {
out = append(out, part)
}
}
@@ -127,8 +130,7 @@ func joinPaths(absolutePath, relativePath string) string {
}
finalPath := path.Join(absolutePath, relativePath)
- appendSlash := lastChar(relativePath) == '/' && lastChar(finalPath) != '/'
- if appendSlash {
+ if lastChar(relativePath) == '/' && lastChar(finalPath) != '/' {
return finalPath + "/"
}
return finalPath
diff --git a/vendor/github.com/gin-gonic/gin/version.go b/vendor/github.com/gin-gonic/gin/version.go
index 3e9687dc7..535bfc827 100644
--- a/vendor/github.com/gin-gonic/gin/version.go
+++ b/vendor/github.com/gin-gonic/gin/version.go
@@ -5,4 +5,4 @@
package gin
// Version is the current gin framework's version.
-const Version = "v1.6.3"
+const Version = "v1.7.3"
diff --git a/vendor/github.com/go-playground/locales/README.md b/vendor/github.com/go-playground/locales/README.md
index ba1b0680c..5b0694fd1 100644
--- a/vendor/github.com/go-playground/locales/README.md
+++ b/vendor/github.com/go-playground/locales/README.md
@@ -1,5 +1,5 @@
## locales
-![Project status](https://img.shields.io/badge/version-0.13.0-green.svg)
+![Project status](https://img.shields.io/badge/version-0.14.0-green.svg)
[![Build Status](https://travis-ci.org/go-playground/locales.svg?branch=master)](https://travis-ci.org/go-playground/locales)
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/locales)](https://goreportcard.com/report/github.com/go-playground/locales)
[![GoDoc](https://godoc.org/github.com/go-playground/locales?status.svg)](https://godoc.org/github.com/go-playground/locales)
@@ -11,7 +11,7 @@ an i18n package; these were built for use with, but not exclusive to, [Universal
Features
--------
-- [x] Rules generated from the latest [CLDR](http://cldr.unicode.org/index/downloads) data, v31.0.1
+- [x] Rules generated from the latest [CLDR](http://cldr.unicode.org/index/downloads) data, v36.0.1
- [x] Contains Cardinal, Ordinal and Range Plural Rules
- [x] Contains Month, Weekday and Timezone translations built in
- [x] Contains Date & Time formatting functions
diff --git a/vendor/github.com/go-playground/locales/currency/currency.go b/vendor/github.com/go-playground/locales/currency/currency.go
index cdaba596b..b5a95fb07 100644
--- a/vendor/github.com/go-playground/locales/currency/currency.go
+++ b/vendor/github.com/go-playground/locales/currency/currency.go
@@ -176,6 +176,7 @@ const (
MNT
MOP
MRO
+ MRU
MTL
MTP
MUR
@@ -262,9 +263,11 @@ const (
UYI
UYP
UYU
+ UYW
UZS
VEB
VEF
+ VES
VND
VNN
VUV
diff --git a/vendor/github.com/go-playground/locales/go.mod b/vendor/github.com/go-playground/locales/go.mod
index 34ab6f238..41b8dc104 100644
--- a/vendor/github.com/go-playground/locales/go.mod
+++ b/vendor/github.com/go-playground/locales/go.mod
@@ -2,4 +2,4 @@ module github.com/go-playground/locales
go 1.13
-require golang.org/x/text v0.3.2
+require golang.org/x/text v0.3.6
diff --git a/vendor/github.com/go-playground/locales/go.sum b/vendor/github.com/go-playground/locales/go.sum
index 63c9200f5..3c12b4ff2 100644
--- a/vendor/github.com/go-playground/locales/go.sum
+++ b/vendor/github.com/go-playground/locales/go.sum
@@ -1,3 +1,3 @@
-golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
-golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
diff --git a/vendor/github.com/go-playground/universal-translator/Makefile b/vendor/github.com/go-playground/universal-translator/Makefile
new file mode 100644
index 000000000..ec3455bd5
--- /dev/null
+++ b/vendor/github.com/go-playground/universal-translator/Makefile
@@ -0,0 +1,18 @@
+GOCMD=GO111MODULE=on go
+
+linters-install:
+ @golangci-lint --version >/dev/null 2>&1 || { \
+ echo "installing linting tools..."; \
+ curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.41.1; \
+ }
+
+lint: linters-install
+ golangci-lint run
+
+test:
+ $(GOCMD) test -cover -race ./...
+
+bench:
+ $(GOCMD) test -bench=. -benchmem ./...
+
+.PHONY: test lint linters-install
\ No newline at end of file
diff --git a/vendor/github.com/go-playground/universal-translator/README.md b/vendor/github.com/go-playground/universal-translator/README.md
index 071f33ab2..46dec6d2b 100644
--- a/vendor/github.com/go-playground/universal-translator/README.md
+++ b/vendor/github.com/go-playground/universal-translator/README.md
@@ -1,5 +1,5 @@
## universal-translator
-![Project status](https://img.shields.io/badge/version-0.17.0-green.svg)
+![Project status](https://img.shields.io/badge/version-0.18.0-green.svg)
[![Build Status](https://travis-ci.org/go-playground/universal-translator.svg?branch=master)](https://travis-ci.org/go-playground/universal-translator)
[![Coverage Status](https://coveralls.io/repos/github/go-playground/universal-translator/badge.svg)](https://coveralls.io/github/go-playground/universal-translator)
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/universal-translator)](https://goreportcard.com/report/github.com/go-playground/universal-translator)
@@ -18,7 +18,7 @@ use in your applications.
Features
--------
-- [x] Rules generated from the [CLDR](http://cldr.unicode.org/index/downloads) data, v30.0.3
+- [x] Rules generated from the [CLDR](http://cldr.unicode.org/index/downloads) data, v36.0.1
- [x] Contains Cardinal, Ordinal and Range Plural Rules
- [x] Contains Month, Weekday and Timezone translations built in
- [x] Contains Date & Time formatting functions
@@ -51,7 +51,7 @@ Please see https://godoc.org/github.com/go-playground/universal-translator for u
File formatting
--------------
-All types, Plain substitution, Cardinal, Ordinal and Range translations can all be contained withing the same file(s);
+All types, Plain substitution, Cardinal, Ordinal and Range translations can all be contained within the same file(s);
they are only separated for easy viewing.
##### Examples:
diff --git a/vendor/github.com/go-playground/universal-translator/go.mod b/vendor/github.com/go-playground/universal-translator/go.mod
index 8079590fe..9d086000c 100644
--- a/vendor/github.com/go-playground/universal-translator/go.mod
+++ b/vendor/github.com/go-playground/universal-translator/go.mod
@@ -2,4 +2,4 @@ module github.com/go-playground/universal-translator
go 1.13
-require github.com/go-playground/locales v0.13.0
+require github.com/go-playground/locales v0.14.0
diff --git a/vendor/github.com/go-playground/universal-translator/go.sum b/vendor/github.com/go-playground/universal-translator/go.sum
index cbbf32416..20667ea98 100644
--- a/vendor/github.com/go-playground/universal-translator/go.sum
+++ b/vendor/github.com/go-playground/universal-translator/go.sum
@@ -1,4 +1,7 @@
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
+github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=
+github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
diff --git a/vendor/github.com/go-playground/universal-translator/import_export.go b/vendor/github.com/go-playground/universal-translator/import_export.go
index 7bd76f26b..1216f1923 100644
--- a/vendor/github.com/go-playground/universal-translator/import_export.go
+++ b/vendor/github.com/go-playground/universal-translator/import_export.go
@@ -257,6 +257,8 @@ func (t *UniversalTranslator) ImportByReader(format ImportExportFormat, reader i
func stringToPR(s string) locales.PluralRule {
switch s {
+ case "Zero":
+ return locales.PluralRuleZero
case "One":
return locales.PluralRuleOne
case "Two":
diff --git a/vendor/github.com/go-playground/universal-translator/translator.go b/vendor/github.com/go-playground/universal-translator/translator.go
index cfafce8a0..24b18db92 100644
--- a/vendor/github.com/go-playground/universal-translator/translator.go
+++ b/vendor/github.com/go-playground/universal-translator/translator.go
@@ -159,13 +159,13 @@ func (t *translator) AddCardinal(key interface{}, text string, rule locales.Plur
}
} else {
- tarr = make([]*transText, 7, 7)
+ tarr = make([]*transText, 7)
t.cardinalTanslations[key] = tarr
}
trans := &transText{
text: text,
- indexes: make([]int, 2, 2),
+ indexes: make([]int, 2),
}
tarr[rule] = trans
@@ -211,13 +211,13 @@ func (t *translator) AddOrdinal(key interface{}, text string, rule locales.Plura
}
} else {
- tarr = make([]*transText, 7, 7)
+ tarr = make([]*transText, 7)
t.ordinalTanslations[key] = tarr
}
trans := &transText{
text: text,
- indexes: make([]int, 2, 2),
+ indexes: make([]int, 2),
}
tarr[rule] = trans
@@ -261,13 +261,13 @@ func (t *translator) AddRange(key interface{}, text string, rule locales.PluralR
}
} else {
- tarr = make([]*transText, 7, 7)
+ tarr = make([]*transText, 7)
t.rangeTanslations[key] = tarr
}
trans := &transText{
text: text,
- indexes: make([]int, 4, 4),
+ indexes: make([]int, 4),
}
tarr[rule] = trans
diff --git a/vendor/github.com/go-playground/validator/v10/.gitignore b/vendor/github.com/go-playground/validator/v10/.gitignore
index 792ca00d2..6e43fac0d 100644
--- a/vendor/github.com/go-playground/validator/v10/.gitignore
+++ b/vendor/github.com/go-playground/validator/v10/.gitignore
@@ -6,6 +6,7 @@
# Folders
_obj
_test
+bin
# Architecture specific extensions/prefixes
*.[568vq]
@@ -26,4 +27,4 @@ _testmain.go
*.out
*.txt
cover.html
-README.html
\ No newline at end of file
+README.html
diff --git a/vendor/github.com/go-playground/validator/v10/.travis.yml b/vendor/github.com/go-playground/validator/v10/.travis.yml
deleted file mode 100644
index b88bb9fc3..000000000
--- a/vendor/github.com/go-playground/validator/v10/.travis.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-language: go
-go:
- - 1.13.4
- - tip
-matrix:
- allow_failures:
- - go: tip
-
-notifications:
- email:
- recipients: dean.karn@gmail.com
- on_success: change
- on_failure: always
-
-before_install:
- - go install github.com/mattn/goveralls
- - mkdir -p $GOPATH/src/gopkg.in
- - ln -s $GOPATH/src/github.com/$TRAVIS_REPO_SLUG $GOPATH/src/gopkg.in/validator.v9
-
-# Only clone the most recent commit.
-git:
- depth: 1
-
-script:
- - go test -v -race -covermode=atomic -coverprofile=coverage.coverprofile ./...
-
-after_success: |
- [ $TRAVIS_GO_VERSION = 1.13.4 ] &&
- goveralls -coverprofile=coverage.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN
\ No newline at end of file
diff --git a/vendor/github.com/go-playground/validator/v10/MAINTAINERS.md b/vendor/github.com/go-playground/validator/v10/MAINTAINERS.md
new file mode 100644
index 000000000..b809c4ce1
--- /dev/null
+++ b/vendor/github.com/go-playground/validator/v10/MAINTAINERS.md
@@ -0,0 +1,16 @@
+## Maintainers Guide
+
+### Semantic Versioning
+Semantic versioning as defined [here](https://semver.org) must be strictly adhered to.
+
+### External Dependencies
+Any new external dependencies MUST:
+- Have a compatible LICENSE present.
+- Be actively maintained.
+- Be approved by @go-playground/admins
+
+### PR Merge Requirements
+- Up-to-date branch.
+- Passing tests and linting.
+- CODEOWNERS approval.
+- Tests that cover both the Happy and Unhappy paths.
\ No newline at end of file
diff --git a/vendor/github.com/go-playground/validator/v10/Makefile b/vendor/github.com/go-playground/validator/v10/Makefile
index 19c91ed73..ec3455bd5 100644
--- a/vendor/github.com/go-playground/validator/v10/Makefile
+++ b/vendor/github.com/go-playground/validator/v10/Makefile
@@ -3,11 +3,11 @@ GOCMD=GO111MODULE=on go
linters-install:
@golangci-lint --version >/dev/null 2>&1 || { \
echo "installing linting tools..."; \
- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0; \
+ curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.41.1; \
}
lint: linters-install
- $(PWD)/bin/golangci-lint run
+ golangci-lint run
test:
$(GOCMD) test -cover -race ./...
diff --git a/vendor/github.com/go-playground/validator/v10/README.md b/vendor/github.com/go-playground/validator/v10/README.md
index daf28f1da..f56cff15d 100644
--- a/vendor/github.com/go-playground/validator/v10/README.md
+++ b/vendor/github.com/go-playground/validator/v10/README.md
@@ -1,20 +1,20 @@
Package validator
-================
+=================
[![Join the chat at https://gitter.im/go-playground/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-10.1.0-green.svg)
+![Project status](https://img.shields.io/badge/version-10.9.0-green.svg)
[![Build Status](https://travis-ci.org/go-playground/validator.svg?branch=master)](https://travis-ci.org/go-playground/validator)
[![Coverage Status](https://coveralls.io/repos/go-playground/validator/badge.svg?branch=master&service=github)](https://coveralls.io/github/go-playground/validator?branch=master)
[![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/github.com/go-playground/validator?status.svg)](https://godoc.org/github.com/go-playground/validator)
+[![GoDoc](https://godoc.org/github.com/go-playground/validator?status.svg)](https://pkg.go.dev/github.com/go-playground/validator/v10)
![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.
+- 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.
-- Ability to dive into both map keys and values for validation
+- Ability to dive into both map keys and values for validation
- 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
@@ -43,7 +43,7 @@ They return type error to avoid the issue discussed in the following, where err
* http://stackoverflow.com/a/29138676/3158232
* https://github.com/go-playground/validator/issues/134
-Validator only InvalidValidationError for bad validation input, nil or ValidationErrors as type error; so, in your code all you need to do is check if the error returned is not nil, and if it's not check if error is InvalidValidationError ( if necessary, most of the time it isn't ) type cast it to type ValidationErrors like so:
+Validator returns only InvalidValidationError for bad validation input, nil or ValidationErrors as type error; so, in your code all you need to do is check if the error returned is not nil, and if it's not check if error is InvalidValidationError ( if necessary, most of the time it isn't ) type cast it to type ValidationErrors like so:
```go
err := validate.Struct(mystruct)
@@ -53,7 +53,7 @@ validationErrors := err.(validator.ValidationErrors)
Usage and documentation
------
-Please see https://godoc.org/github.com/go-playground/validator for detailed usage docs.
+Please see https://pkg.go.dev/github.com/go-playground/validator/v10 for detailed usage docs.
##### Examples:
@@ -64,6 +64,171 @@ Please see https://godoc.org/github.com/go-playground/validator for detailed usa
- [Gin upgrade and/or override validator](https://github.com/go-playground/validator/tree/v9/_examples/gin-upgrading-overriding)
- [wash - an example application putting it all together](https://github.com/bluesuncorp/wash)
+Baked-in Validations
+------
+
+### Fields:
+
+| Tag | Description |
+| - | - |
+| eqcsfield | Field Equals Another Field (relative)|
+| eqfield | Field Equals Another Field |
+| fieldcontains | NOT DOCUMENTED IN doc.go |
+| fieldexcludes | NOT DOCUMENTED IN doc.go |
+| gtcsfield | Field Greater Than Another Relative Field |
+| gtecsfield | Field Greater Than or Equal To Another Relative Field |
+| gtefield | Field Greater Than or Equal To Another Field |
+| gtfield | Field Greater Than Another Field |
+| ltcsfield | Less Than Another Relative Field |
+| ltecsfield | Less Than or Equal To Another Relative Field |
+| ltefield | Less Than or Equal To Another Field |
+| ltfield | Less Than Another Field |
+| necsfield | Field Does Not Equal Another Field (relative) |
+| nefield | Field Does Not Equal Another Field |
+
+### Network:
+
+| Tag | Description |
+| - | - |
+| cidr | Classless Inter-Domain Routing CIDR |
+| cidrv4 | Classless Inter-Domain Routing CIDRv4 |
+| cidrv6 | Classless Inter-Domain Routing CIDRv6 |
+| datauri | Data URL |
+| fqdn | Full Qualified Domain Name (FQDN) |
+| hostname | Hostname RFC 952 |
+| hostname_port | HostPort |
+| hostname_rfc1123 | Hostname RFC 1123 |
+| ip | Internet Protocol Address IP |
+| ip4_addr | Internet Protocol Address IPv4 |
+| ip6_addr | Internet Protocol Address IPv6 |
+| ip_addr | Internet Protocol Address IP |
+| ipv4 | Internet Protocol Address IPv4 |
+| ipv6 | Internet Protocol Address IPv6 |
+| mac | Media Access Control Address MAC |
+| tcp4_addr | Transmission Control Protocol Address TCPv4 |
+| tcp6_addr | Transmission Control Protocol Address TCPv6 |
+| tcp_addr | Transmission Control Protocol Address TCP |
+| udp4_addr | User Datagram Protocol Address UDPv4 |
+| udp6_addr | User Datagram Protocol Address UDPv6 |
+| udp_addr | User Datagram Protocol Address UDP |
+| unix_addr | Unix domain socket end point Address |
+| uri | URI String |
+| url | URL String |
+| url_encoded | URL Encoded |
+| urn_rfc2141 | Urn RFC 2141 String |
+
+### Strings:
+
+| Tag | Description |
+| - | - |
+| alpha | Alpha Only |
+| alphanum | Alphanumeric |
+| alphanumunicode | Alphanumeric Unicode |
+| alphaunicode | Alpha Unicode |
+| ascii | ASCII |
+| boolean | Boolean |
+| contains | Contains |
+| containsany | Contains Any |
+| containsrune | Contains Rune |
+| endsnotwith | Ends With |
+| endswith | Ends With |
+| excludes | Excludes |
+| excludesall | Excludes All |
+| excludesrune | Excludes Rune |
+| lowercase | Lowercase |
+| multibyte | Multi-Byte Characters |
+| number | NOT DOCUMENTED IN doc.go |
+| numeric | Numeric |
+| printascii | Printable ASCII |
+| startsnotwith | Starts Not With |
+| startswith | Starts With |
+| uppercase | Uppercase |
+
+### Format:
+| Tag | Description |
+| - | - |
+| base64 | Base64 String |
+| base64url | Base64URL String |
+| bic | Business Identifier Code (ISO 9362) |
+| bcp47_language_tag | Language tag (BCP 47) |
+| btc_addr | Bitcoin Address |
+| btc_addr_bech32 | Bitcoin Bech32 Address (segwit) |
+| datetime | Datetime |
+| e164 | e164 formatted phone number |
+| email | E-mail String
+| eth_addr | Ethereum Address |
+| hexadecimal | Hexadecimal String |
+| hexcolor | Hexcolor String |
+| hsl | HSL String |
+| hsla | HSLA String |
+| html | HTML Tags |
+| html_encoded | HTML Encoded |
+| isbn | International Standard Book Number |
+| isbn10 | International Standard Book Number 10 |
+| isbn13 | International Standard Book Number 13 |
+| iso3166_1_alpha2 | Two-letter country code (ISO 3166-1 alpha-2) |
+| iso3166_1_alpha3 | Three-letter country code (ISO 3166-1 alpha-3) |
+| iso3166_1_alpha_numeric | Numeric country code (ISO 3166-1 numeric) |
+| iso3166_2 | Country subdivision code (ISO 3166-2) |
+| iso4217 | Currency code (ISO 4217) |
+| json | JSON |
+| jwt | JSON Web Token (JWT) |
+| latitude | Latitude |
+| longitude | Longitude |
+| postcode_iso3166_alpha2 | Postcode |
+| postcode_iso3166_alpha2_field | Postcode |
+| rgb | RGB String |
+| rgba | RGBA String |
+| ssn | Social Security Number SSN |
+| timezone | Timezone |
+| uuid | Universally Unique Identifier UUID |
+| uuid3 | Universally Unique Identifier UUID v3 |
+| uuid3_rfc4122 | Universally Unique Identifier UUID v3 RFC4122 |
+| uuid4 | Universally Unique Identifier UUID v4 |
+| uuid4_rfc4122 | Universally Unique Identifier UUID v4 RFC4122 |
+| uuid5 | Universally Unique Identifier UUID v5 |
+| uuid5_rfc4122 | Universally Unique Identifier UUID v5 RFC4122 |
+| uuid_rfc4122 | Universally Unique Identifier UUID RFC4122 |
+
+### Comparisons:
+| Tag | Description |
+| - | - |
+| eq | Equals |
+| gt | Greater than|
+| gte | Greater than or equal |
+| lt | Less Than |
+| lte | Less Than or Equal |
+| ne | Not Equal |
+
+### Other:
+| Tag | Description |
+| - | - |
+| dir | Directory |
+| file | File path |
+| isdefault | Is Default |
+| len | Length |
+| max | Maximum |
+| min | Minimum |
+| oneof | One Of |
+| required | Required |
+| required_if | Required If |
+| required_unless | Required Unless |
+| required_with | Required With |
+| required_with_all | Required With All |
+| required_without | Required Without |
+| required_without_all | Required Without All |
+| excluded_with | Excluded With |
+| excluded_with_all | Excluded With All |
+| excluded_without | Excluded Without |
+| excluded_without_all | Excluded Without All |
+| unique | Unique |
+
+#### Aliases:
+| Tag | Description |
+| - | - |
+| iscolor | hexcolor\|rgb\|rgba\|hsl\|hsla |
+| country_code | iso3166_1_alpha2\|iso3166_1_alpha3\|iso3166_1_alpha_numeric |
+
Benchmarks
------
###### Run on MacBook Pro (15-inch, 2017) go version go1.10.2 darwin/amd64
@@ -149,5 +314,10 @@ How to Contribute
Make a pull request...
License
-------
+-------
Distributed under MIT License, please see license file within the code for more details.
+
+Maintainers
+-----------
+This project has grown large enough that more than one person is required to properly support the community.
+If you are interested in becoming a maintainer please reach out to me https://github.com/deankarn
diff --git a/vendor/github.com/go-playground/validator/v10/baked_in.go b/vendor/github.com/go-playground/validator/v10/baked_in.go
index 4124c621a..f5fd2391d 100644
--- a/vendor/github.com/go-playground/validator/v10/baked_in.go
+++ b/vendor/github.com/go-playground/validator/v10/baked_in.go
@@ -4,6 +4,7 @@ import (
"bytes"
"context"
"crypto/sha256"
+ "encoding/hex"
"encoding/json"
"fmt"
"net"
@@ -16,6 +17,9 @@ import (
"time"
"unicode/utf8"
+ "golang.org/x/crypto/sha3"
+ "golang.org/x/text/language"
+
urn "github.com/leodido/go-urn"
)
@@ -52,126 +56,148 @@ var (
isdefault: {},
}
- // BakedInAliasValidators is a default mapping of a single validation tag that
+ // bakedInAliases is a default mapping of a single validation tag that
// defines a common or complex set of validation(s) to simplify
// adding validation to structs.
bakedInAliases = map[string]string{
- "iscolor": "hexcolor|rgb|rgba|hsl|hsla",
+ "iscolor": "hexcolor|rgb|rgba|hsl|hsla",
+ "country_code": "iso3166_1_alpha2|iso3166_1_alpha3|iso3166_1_alpha_numeric",
}
- // BakedInValidators is the default map of ValidationFunc
+ // bakedInValidators is the default map of ValidationFunc
// you can add, remove or even replace items to suite your needs,
// or even disregard and use your own map if so desired.
bakedInValidators = map[string]Func{
- "required": hasValue,
- "required_with": requiredWith,
- "required_with_all": requiredWithAll,
- "required_without": requiredWithout,
- "required_without_all": requiredWithoutAll,
- "isdefault": isDefault,
- "len": hasLengthOf,
- "min": hasMinOf,
- "max": hasMaxOf,
- "eq": isEq,
- "ne": isNe,
- "lt": isLt,
- "lte": isLte,
- "gt": isGt,
- "gte": isGte,
- "eqfield": isEqField,
- "eqcsfield": isEqCrossStructField,
- "necsfield": isNeCrossStructField,
- "gtcsfield": isGtCrossStructField,
- "gtecsfield": isGteCrossStructField,
- "ltcsfield": isLtCrossStructField,
- "ltecsfield": isLteCrossStructField,
- "nefield": isNeField,
- "gtefield": isGteField,
- "gtfield": isGtField,
- "ltefield": isLteField,
- "ltfield": isLtField,
- "fieldcontains": fieldContains,
- "fieldexcludes": fieldExcludes,
- "alpha": isAlpha,
- "alphanum": isAlphanum,
- "alphaunicode": isAlphaUnicode,
- "alphanumunicode": isAlphanumUnicode,
- "numeric": isNumeric,
- "number": isNumber,
- "hexadecimal": isHexadecimal,
- "hexcolor": isHEXColor,
- "rgb": isRGB,
- "rgba": isRGBA,
- "hsl": isHSL,
- "hsla": isHSLA,
- "e164": isE164,
- "email": isEmail,
- "url": isURL,
- "uri": isURI,
- "urn_rfc2141": isUrnRFC2141, // RFC 2141
- "file": isFile,
- "base64": isBase64,
- "base64url": isBase64URL,
- "contains": contains,
- "containsany": containsAny,
- "containsrune": containsRune,
- "excludes": excludes,
- "excludesall": excludesAll,
- "excludesrune": excludesRune,
- "startswith": startsWith,
- "endswith": endsWith,
- "isbn": isISBN,
- "isbn10": isISBN10,
- "isbn13": isISBN13,
- "eth_addr": isEthereumAddress,
- "btc_addr": isBitcoinAddress,
- "btc_addr_bech32": isBitcoinBech32Address,
- "uuid": isUUID,
- "uuid3": isUUID3,
- "uuid4": isUUID4,
- "uuid5": isUUID5,
- "uuid_rfc4122": isUUIDRFC4122,
- "uuid3_rfc4122": isUUID3RFC4122,
- "uuid4_rfc4122": isUUID4RFC4122,
- "uuid5_rfc4122": isUUID5RFC4122,
- "ascii": isASCII,
- "printascii": isPrintableASCII,
- "multibyte": hasMultiByteCharacter,
- "datauri": isDataURI,
- "latitude": isLatitude,
- "longitude": isLongitude,
- "ssn": isSSN,
- "ipv4": isIPv4,
- "ipv6": isIPv6,
- "ip": isIP,
- "cidrv4": isCIDRv4,
- "cidrv6": isCIDRv6,
- "cidr": isCIDR,
- "tcp4_addr": isTCP4AddrResolvable,
- "tcp6_addr": isTCP6AddrResolvable,
- "tcp_addr": isTCPAddrResolvable,
- "udp4_addr": isUDP4AddrResolvable,
- "udp6_addr": isUDP6AddrResolvable,
- "udp_addr": isUDPAddrResolvable,
- "ip4_addr": isIP4AddrResolvable,
- "ip6_addr": isIP6AddrResolvable,
- "ip_addr": isIPAddrResolvable,
- "unix_addr": isUnixAddrResolvable,
- "mac": isMAC,
- "hostname": isHostnameRFC952, // RFC 952
- "hostname_rfc1123": isHostnameRFC1123, // RFC 1123
- "fqdn": isFQDN,
- "unique": isUnique,
- "oneof": isOneOf,
- "html": isHTML,
- "html_encoded": isHTMLEncoded,
- "url_encoded": isURLEncoded,
- "dir": isDir,
- "json": isJSON,
- "hostname_port": isHostnamePort,
- "lowercase": isLowercase,
- "uppercase": isUppercase,
- "datetime": isDatetime,
+ "required": hasValue,
+ "required_if": requiredIf,
+ "required_unless": requiredUnless,
+ "required_with": requiredWith,
+ "required_with_all": requiredWithAll,
+ "required_without": requiredWithout,
+ "required_without_all": requiredWithoutAll,
+ "excluded_with": excludedWith,
+ "excluded_with_all": excludedWithAll,
+ "excluded_without": excludedWithout,
+ "excluded_without_all": excludedWithoutAll,
+ "isdefault": isDefault,
+ "len": hasLengthOf,
+ "min": hasMinOf,
+ "max": hasMaxOf,
+ "eq": isEq,
+ "ne": isNe,
+ "lt": isLt,
+ "lte": isLte,
+ "gt": isGt,
+ "gte": isGte,
+ "eqfield": isEqField,
+ "eqcsfield": isEqCrossStructField,
+ "necsfield": isNeCrossStructField,
+ "gtcsfield": isGtCrossStructField,
+ "gtecsfield": isGteCrossStructField,
+ "ltcsfield": isLtCrossStructField,
+ "ltecsfield": isLteCrossStructField,
+ "nefield": isNeField,
+ "gtefield": isGteField,
+ "gtfield": isGtField,
+ "ltefield": isLteField,
+ "ltfield": isLtField,
+ "fieldcontains": fieldContains,
+ "fieldexcludes": fieldExcludes,
+ "alpha": isAlpha,
+ "alphanum": isAlphanum,
+ "alphaunicode": isAlphaUnicode,
+ "alphanumunicode": isAlphanumUnicode,
+ "boolean": isBoolean,
+ "numeric": isNumeric,
+ "number": isNumber,
+ "hexadecimal": isHexadecimal,
+ "hexcolor": isHEXColor,
+ "rgb": isRGB,
+ "rgba": isRGBA,
+ "hsl": isHSL,
+ "hsla": isHSLA,
+ "e164": isE164,
+ "email": isEmail,
+ "url": isURL,
+ "uri": isURI,
+ "urn_rfc2141": isUrnRFC2141, // RFC 2141
+ "file": isFile,
+ "base64": isBase64,
+ "base64url": isBase64URL,
+ "contains": contains,
+ "containsany": containsAny,
+ "containsrune": containsRune,
+ "excludes": excludes,
+ "excludesall": excludesAll,
+ "excludesrune": excludesRune,
+ "startswith": startsWith,
+ "endswith": endsWith,
+ "startsnotwith": startsNotWith,
+ "endsnotwith": endsNotWith,
+ "isbn": isISBN,
+ "isbn10": isISBN10,
+ "isbn13": isISBN13,
+ "eth_addr": isEthereumAddress,
+ "btc_addr": isBitcoinAddress,
+ "btc_addr_bech32": isBitcoinBech32Address,
+ "uuid": isUUID,
+ "uuid3": isUUID3,
+ "uuid4": isUUID4,
+ "uuid5": isUUID5,
+ "uuid_rfc4122": isUUIDRFC4122,
+ "uuid3_rfc4122": isUUID3RFC4122,
+ "uuid4_rfc4122": isUUID4RFC4122,
+ "uuid5_rfc4122": isUUID5RFC4122,
+ "ascii": isASCII,
+ "printascii": isPrintableASCII,
+ "multibyte": hasMultiByteCharacter,
+ "datauri": isDataURI,
+ "latitude": isLatitude,
+ "longitude": isLongitude,
+ "ssn": isSSN,
+ "ipv4": isIPv4,
+ "ipv6": isIPv6,
+ "ip": isIP,
+ "cidrv4": isCIDRv4,
+ "cidrv6": isCIDRv6,
+ "cidr": isCIDR,
+ "tcp4_addr": isTCP4AddrResolvable,
+ "tcp6_addr": isTCP6AddrResolvable,
+ "tcp_addr": isTCPAddrResolvable,
+ "udp4_addr": isUDP4AddrResolvable,
+ "udp6_addr": isUDP6AddrResolvable,
+ "udp_addr": isUDPAddrResolvable,
+ "ip4_addr": isIP4AddrResolvable,
+ "ip6_addr": isIP6AddrResolvable,
+ "ip_addr": isIPAddrResolvable,
+ "unix_addr": isUnixAddrResolvable,
+ "mac": isMAC,
+ "hostname": isHostnameRFC952, // RFC 952
+ "hostname_rfc1123": isHostnameRFC1123, // RFC 1123
+ "fqdn": isFQDN,
+ "unique": isUnique,
+ "oneof": isOneOf,
+ "html": isHTML,
+ "html_encoded": isHTMLEncoded,
+ "url_encoded": isURLEncoded,
+ "dir": isDir,
+ "json": isJSON,
+ "jwt": isJWT,
+ "hostname_port": isHostnamePort,
+ "lowercase": isLowercase,
+ "uppercase": isUppercase,
+ "datetime": isDatetime,
+ "timezone": isTimeZone,
+ "iso3166_1_alpha2": isIso3166Alpha2,
+ "iso3166_1_alpha3": isIso3166Alpha3,
+ "iso3166_1_alpha_numeric": isIso3166AlphaNumeric,
+ "iso3166_2": isIso31662,
+ "iso4217": isIso4217,
+ "iso4217_numeric": isIso4217Numeric,
+ "bcp47_language_tag": isBCP47LanguageTag,
+ "postcode_iso3166_alpha2": isPostcodeByIso3166Alpha2,
+ "postcode_iso3166_alpha2_field": isPostcodeByIso3166Alpha2Field,
+ "bic": isIsoBicFormat,
}
)
@@ -239,23 +265,33 @@ func isUnique(fl FieldLevel) bool {
switch field.Kind() {
case reflect.Slice, reflect.Array:
+ elem := field.Type().Elem()
+ if elem.Kind() == reflect.Ptr {
+ elem = elem.Elem()
+ }
+
if param == "" {
- m := reflect.MakeMap(reflect.MapOf(field.Type().Elem(), v.Type()))
+ m := reflect.MakeMap(reflect.MapOf(elem, v.Type()))
for i := 0; i < field.Len(); i++ {
- m.SetMapIndex(field.Index(i), v)
+ m.SetMapIndex(reflect.Indirect(field.Index(i)), v)
}
return field.Len() == m.Len()
}
- sf, ok := field.Type().Elem().FieldByName(param)
+ sf, ok := elem.FieldByName(param)
if !ok {
panic(fmt.Sprintf("Bad field name %s", param))
}
- m := reflect.MakeMap(reflect.MapOf(sf.Type, v.Type()))
+ sfTyp := sf.Type
+ if sfTyp.Kind() == reflect.Ptr {
+ sfTyp = sfTyp.Elem()
+ }
+
+ m := reflect.MakeMap(reflect.MapOf(sfTyp, v.Type()))
for i := 0; i < field.Len(); i++ {
- m.SetMapIndex(field.Index(i).FieldByName(param), v)
+ m.SetMapIndex(reflect.Indirect(reflect.Indirect(field.Index(i)).FieldByName(param)), v)
}
return field.Len() == m.Len()
case reflect.Map:
@@ -270,7 +306,7 @@ func isUnique(fl FieldLevel) bool {
}
}
-// IsMAC is the validation function for validating if the field's value is a valid MAC address.
+// isMAC is the validation function for validating if the field's value is a valid MAC address.
func isMAC(fl FieldLevel) bool {
_, err := net.ParseMAC(fl.Field().String())
@@ -278,7 +314,7 @@ func isMAC(fl FieldLevel) bool {
return err == nil
}
-// IsCIDRv4 is the validation function for validating if the field's value is a valid v4 CIDR address.
+// isCIDRv4 is the validation function for validating if the field's value is a valid v4 CIDR address.
func isCIDRv4(fl FieldLevel) bool {
ip, _, err := net.ParseCIDR(fl.Field().String())
@@ -286,7 +322,7 @@ func isCIDRv4(fl FieldLevel) bool {
return err == nil && ip.To4() != nil
}
-// IsCIDRv6 is the validation function for validating if the field's value is a valid v6 CIDR address.
+// isCIDRv6 is the validation function for validating if the field's value is a valid v6 CIDR address.
func isCIDRv6(fl FieldLevel) bool {
ip, _, err := net.ParseCIDR(fl.Field().String())
@@ -294,7 +330,7 @@ func isCIDRv6(fl FieldLevel) bool {
return err == nil && ip.To4() == nil
}
-// IsCIDR is the validation function for validating if the field's value is a valid v4 or v6 CIDR address.
+// isCIDR is the validation function for validating if the field's value is a valid v4 or v6 CIDR address.
func isCIDR(fl FieldLevel) bool {
_, _, err := net.ParseCIDR(fl.Field().String())
@@ -302,7 +338,7 @@ func isCIDR(fl FieldLevel) bool {
return err == nil
}
-// IsIPv4 is the validation function for validating if a value is a valid v4 IP address.
+// isIPv4 is the validation function for validating if a value is a valid v4 IP address.
func isIPv4(fl FieldLevel) bool {
ip := net.ParseIP(fl.Field().String())
@@ -310,7 +346,7 @@ func isIPv4(fl FieldLevel) bool {
return ip != nil && ip.To4() != nil
}
-// IsIPv6 is the validation function for validating if the field's value is a valid v6 IP address.
+// isIPv6 is the validation function for validating if the field's value is a valid v6 IP address.
func isIPv6(fl FieldLevel) bool {
ip := net.ParseIP(fl.Field().String())
@@ -318,7 +354,7 @@ func isIPv6(fl FieldLevel) bool {
return ip != nil && ip.To4() == nil
}
-// IsIP is the validation function for validating if the field's value is a valid v4 or v6 IP address.
+// isIP is the validation function for validating if the field's value is a valid v4 or v6 IP address.
func isIP(fl FieldLevel) bool {
ip := net.ParseIP(fl.Field().String())
@@ -326,7 +362,7 @@ func isIP(fl FieldLevel) bool {
return ip != nil
}
-// IsSSN is the validation function for validating if the field's value is a valid SSN.
+// isSSN is the validation function for validating if the field's value is a valid SSN.
func isSSN(fl FieldLevel) bool {
field := fl.Field()
@@ -338,7 +374,7 @@ func isSSN(fl FieldLevel) bool {
return sSNRegex.MatchString(field.String())
}
-// IsLongitude is the validation function for validating if the field's value is a valid longitude coordinate.
+// isLongitude is the validation function for validating if the field's value is a valid longitude coordinate.
func isLongitude(fl FieldLevel) bool {
field := fl.Field()
@@ -361,7 +397,7 @@ func isLongitude(fl FieldLevel) bool {
return longitudeRegex.MatchString(v)
}
-// IsLatitude is the validation function for validating if the field's value is a valid latitude coordinate.
+// isLatitude is the validation function for validating if the field's value is a valid latitude coordinate.
func isLatitude(fl FieldLevel) bool {
field := fl.Field()
@@ -384,7 +420,7 @@ func isLatitude(fl FieldLevel) bool {
return latitudeRegex.MatchString(v)
}
-// IsDataURI is the validation function for validating if the field's value is a valid data URI.
+// isDataURI is the validation function for validating if the field's value is a valid data URI.
func isDataURI(fl FieldLevel) bool {
uri := strings.SplitN(fl.Field().String(), ",", 2)
@@ -400,7 +436,7 @@ func isDataURI(fl FieldLevel) bool {
return base64Regex.MatchString(uri[1])
}
-// HasMultiByteCharacter is the validation function for validating if the field's value has a multi byte character.
+// hasMultiByteCharacter is the validation function for validating if the field's value has a multi byte character.
func hasMultiByteCharacter(fl FieldLevel) bool {
field := fl.Field()
@@ -412,62 +448,62 @@ func hasMultiByteCharacter(fl FieldLevel) bool {
return multibyteRegex.MatchString(field.String())
}
-// IsPrintableASCII is the validation function for validating if the field's value is a valid printable ASCII character.
+// isPrintableASCII is the validation function for validating if the field's value is a valid printable ASCII character.
func isPrintableASCII(fl FieldLevel) bool {
return printableASCIIRegex.MatchString(fl.Field().String())
}
-// IsASCII is the validation function for validating if the field's value is a valid ASCII character.
+// isASCII is the validation function for validating if the field's value is a valid ASCII character.
func isASCII(fl FieldLevel) bool {
return aSCIIRegex.MatchString(fl.Field().String())
}
-// IsUUID5 is the validation function for validating if the field's value is a valid v5 UUID.
+// isUUID5 is the validation function for validating if the field's value is a valid v5 UUID.
func isUUID5(fl FieldLevel) bool {
return uUID5Regex.MatchString(fl.Field().String())
}
-// IsUUID4 is the validation function for validating if the field's value is a valid v4 UUID.
+// isUUID4 is the validation function for validating if the field's value is a valid v4 UUID.
func isUUID4(fl FieldLevel) bool {
return uUID4Regex.MatchString(fl.Field().String())
}
-// IsUUID3 is the validation function for validating if the field's value is a valid v3 UUID.
+// isUUID3 is the validation function for validating if the field's value is a valid v3 UUID.
func isUUID3(fl FieldLevel) bool {
return uUID3Regex.MatchString(fl.Field().String())
}
-// IsUUID is the validation function for validating if the field's value is a valid UUID of any version.
+// isUUID is the validation function for validating if the field's value is a valid UUID of any version.
func isUUID(fl FieldLevel) bool {
return uUIDRegex.MatchString(fl.Field().String())
}
-// IsUUID5RFC4122 is the validation function for validating if the field's value is a valid RFC4122 v5 UUID.
+// isUUID5RFC4122 is the validation function for validating if the field's value is a valid RFC4122 v5 UUID.
func isUUID5RFC4122(fl FieldLevel) bool {
return uUID5RFC4122Regex.MatchString(fl.Field().String())
}
-// IsUUID4RFC4122 is the validation function for validating if the field's value is a valid RFC4122 v4 UUID.
+// isUUID4RFC4122 is the validation function for validating if the field's value is a valid RFC4122 v4 UUID.
func isUUID4RFC4122(fl FieldLevel) bool {
return uUID4RFC4122Regex.MatchString(fl.Field().String())
}
-// IsUUID3RFC4122 is the validation function for validating if the field's value is a valid RFC4122 v3 UUID.
+// isUUID3RFC4122 is the validation function for validating if the field's value is a valid RFC4122 v3 UUID.
func isUUID3RFC4122(fl FieldLevel) bool {
return uUID3RFC4122Regex.MatchString(fl.Field().String())
}
-// IsUUIDRFC4122 is the validation function for validating if the field's value is a valid RFC4122 UUID of any version.
+// isUUIDRFC4122 is the validation function for validating if the field's value is a valid RFC4122 UUID of any version.
func isUUIDRFC4122(fl FieldLevel) bool {
return uUIDRFC4122Regex.MatchString(fl.Field().String())
}
-// IsISBN is the validation function for validating if the field's value is a valid v10 or v13 ISBN.
+// isISBN is the validation function for validating if the field's value is a valid v10 or v13 ISBN.
func isISBN(fl FieldLevel) bool {
return isISBN10(fl) || isISBN13(fl)
}
-// IsISBN13 is the validation function for validating if the field's value is a valid v13 ISBN.
+// isISBN13 is the validation function for validating if the field's value is a valid v13 ISBN.
func isISBN13(fl FieldLevel) bool {
s := strings.Replace(strings.Replace(fl.Field().String(), "-", "", 4), " ", "", 4)
@@ -488,7 +524,7 @@ func isISBN13(fl FieldLevel) bool {
return (int32(s[12]-'0'))-((10-(checksum%10))%10) == 0
}
-// IsISBN10 is the validation function for validating if the field's value is a valid v10 ISBN.
+// isISBN10 is the validation function for validating if the field's value is a valid v10 ISBN.
func isISBN10(fl FieldLevel) bool {
s := strings.Replace(strings.Replace(fl.Field().String(), "-", "", 3), " ", "", 3)
@@ -513,7 +549,7 @@ func isISBN10(fl FieldLevel) bool {
return checksum%11 == 0
}
-// IsEthereumAddress is the validation function for validating if the field's value is a valid ethereum address based currently only on the format
+// isEthereumAddress is the validation function for validating if the field's value is a valid Ethereum address.
func isEthereumAddress(fl FieldLevel) bool {
address := fl.Field().String()
@@ -521,16 +557,30 @@ func isEthereumAddress(fl FieldLevel) bool {
return false
}
- if ethaddressRegexUpper.MatchString(address) || ethAddressRegexLower.MatchString(address) {
+ if ethAddressRegexUpper.MatchString(address) || ethAddressRegexLower.MatchString(address) {
return true
}
- // checksum validation is blocked by https://github.com/golang/crypto/pull/28
+ // Checksum validation. Reference: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md
+ address = address[2:] // Skip "0x" prefix.
+ h := sha3.NewLegacyKeccak256()
+ // hash.Hash's io.Writer implementation says it never returns an error. https://golang.org/pkg/hash/#Hash
+ _, _ = h.Write([]byte(strings.ToLower(address)))
+ hash := hex.EncodeToString(h.Sum(nil))
+
+ for i := 0; i < len(address); i++ {
+ if address[i] <= '9' { // Skip 0-9 digits: they don't have upper/lower-case.
+ continue
+ }
+ if hash[i] > '7' && address[i] >= 'a' || hash[i] <= '7' && address[i] <= 'F' {
+ return false
+ }
+ }
return true
}
-// IsBitcoinAddress is the validation function for validating if the field's value is a valid btc address
+// isBitcoinAddress is the validation function for validating if the field's value is a valid btc address
func isBitcoinAddress(fl FieldLevel) bool {
address := fl.Field().String()
@@ -567,7 +617,7 @@ func isBitcoinAddress(fl FieldLevel) bool {
return validchecksum == computedchecksum
}
-// IsBitcoinBech32Address is the validation function for validating if the field's value is a valid bech32 btc address
+// isBitcoinBech32Address is the validation function for validating if the field's value is a valid bech32 btc address
func isBitcoinBech32Address(fl FieldLevel) bool {
address := fl.Field().String()
@@ -647,22 +697,22 @@ func isBitcoinBech32Address(fl FieldLevel) bool {
return true
}
-// ExcludesRune is the validation function for validating that the field's value does not contain the rune specified within the param.
+// excludesRune is the validation function for validating that the field's value does not contain the rune specified within the param.
func excludesRune(fl FieldLevel) bool {
return !containsRune(fl)
}
-// ExcludesAll is the validation function for validating that the field's value does not contain any of the characters specified within the param.
+// excludesAll is the validation function for validating that the field's value does not contain any of the characters specified within the param.
func excludesAll(fl FieldLevel) bool {
return !containsAny(fl)
}
-// Excludes is the validation function for validating that the field's value does not contain the text specified within the param.
+// excludes is the validation function for validating that the field's value does not contain the text specified within the param.
func excludes(fl FieldLevel) bool {
return !contains(fl)
}
-// ContainsRune is the validation function for validating that the field's value contains the rune specified within the param.
+// containsRune is the validation function for validating that the field's value contains the rune specified within the param.
func containsRune(fl FieldLevel) bool {
r, _ := utf8.DecodeRuneInString(fl.Param())
@@ -670,27 +720,37 @@ func containsRune(fl FieldLevel) bool {
return strings.ContainsRune(fl.Field().String(), r)
}
-// ContainsAny is the validation function for validating that the field's value contains any of the characters specified within the param.
+// containsAny is the validation function for validating that the field's value contains any of the characters specified within the param.
func containsAny(fl FieldLevel) bool {
return strings.ContainsAny(fl.Field().String(), fl.Param())
}
-// Contains is the validation function for validating that the field's value contains the text specified within the param.
+// contains is the validation function for validating that the field's value contains the text specified within the param.
func contains(fl FieldLevel) bool {
return strings.Contains(fl.Field().String(), fl.Param())
}
-// StartsWith is the validation function for validating that the field's value starts with the text specified within the param.
+// startsWith is the validation function for validating that the field's value starts with the text specified within the param.
func startsWith(fl FieldLevel) bool {
return strings.HasPrefix(fl.Field().String(), fl.Param())
}
-// EndsWith is the validation function for validating that the field's value ends with the text specified within the param.
+// endsWith is the validation function for validating that the field's value ends with the text specified within the param.
func endsWith(fl FieldLevel) bool {
return strings.HasSuffix(fl.Field().String(), fl.Param())
}
-// FieldContains is the validation function for validating if the current field's value contains the field specified by the param's value.
+// startsNotWith is the validation function for validating that the field's value does not start with the text specified within the param.
+func startsNotWith(fl FieldLevel) bool {
+ return !startsWith(fl)
+}
+
+// endsNotWith is the validation function for validating that the field's value does not end with the text specified within the param.
+func endsNotWith(fl FieldLevel) bool {
+ return !endsWith(fl)
+}
+
+// fieldContains is the validation function for validating if the current field's value contains the field specified by the param's value.
func fieldContains(fl FieldLevel) bool {
field := fl.Field()
@@ -703,7 +763,7 @@ func fieldContains(fl FieldLevel) bool {
return strings.Contains(field.String(), currentField.String())
}
-// FieldExcludes is the validation function for validating if the current field's value excludes the field specified by the param's value.
+// fieldExcludes is the validation function for validating if the current field's value excludes the field specified by the param's value.
func fieldExcludes(fl FieldLevel) bool {
field := fl.Field()
@@ -715,7 +775,7 @@ func fieldExcludes(fl FieldLevel) bool {
return !strings.Contains(field.String(), currentField.String())
}
-// IsNeField is the validation function for validating if the current field's value is not equal to the field specified by the param's value.
+// isNeField is the validation function for validating if the current field's value is not equal to the field specified by the param's value.
func isNeField(fl FieldLevel) bool {
field := fl.Field()
@@ -741,6 +801,9 @@ func isNeField(fl FieldLevel) bool {
case reflect.Slice, reflect.Map, reflect.Array:
return int64(field.Len()) != int64(currentField.Len())
+ case reflect.Bool:
+ return field.Bool() != currentField.Bool()
+
case reflect.Struct:
fieldType := field.Type()
@@ -764,12 +827,12 @@ func isNeField(fl FieldLevel) bool {
return field.String() != currentField.String()
}
-// IsNe is the validation function for validating that the field's value does not equal the provided param value.
+// isNe is the validation function for validating that the field's value does not equal the provided param value.
func isNe(fl FieldLevel) bool {
return !isEq(fl)
}
-// IsLteCrossStructField is the validation function for validating if the current field's value is less than or equal to the field, within a separate struct, specified by the param's value.
+// isLteCrossStructField is the validation function for validating if the current field's value is less than or equal to the field, within a separate struct, specified by the param's value.
func isLteCrossStructField(fl FieldLevel) bool {
field := fl.Field()
@@ -816,7 +879,7 @@ func isLteCrossStructField(fl FieldLevel) bool {
return field.String() <= topField.String()
}
-// IsLtCrossStructField is the validation function for validating if the current field's value is less than the field, within a separate struct, specified by the param's value.
+// isLtCrossStructField is the validation function for validating if the current field's value is less than the field, within a separate struct, specified by the param's value.
// NOTE: This is exposed for use within your own custom functions and not intended to be called directly.
func isLtCrossStructField(fl FieldLevel) bool {
@@ -864,7 +927,7 @@ func isLtCrossStructField(fl FieldLevel) bool {
return field.String() < topField.String()
}
-// IsGteCrossStructField is the validation function for validating if the current field's value is greater than or equal to the field, within a separate struct, specified by the param's value.
+// isGteCrossStructField is the validation function for validating if the current field's value is greater than or equal to the field, within a separate struct, specified by the param's value.
func isGteCrossStructField(fl FieldLevel) bool {
field := fl.Field()
@@ -911,7 +974,7 @@ func isGteCrossStructField(fl FieldLevel) bool {
return field.String() >= topField.String()
}
-// IsGtCrossStructField is the validation function for validating if the current field's value is greater than the field, within a separate struct, specified by the param's value.
+// isGtCrossStructField is the validation function for validating if the current field's value is greater than the field, within a separate struct, specified by the param's value.
func isGtCrossStructField(fl FieldLevel) bool {
field := fl.Field()
@@ -958,7 +1021,7 @@ func isGtCrossStructField(fl FieldLevel) bool {
return field.String() > topField.String()
}
-// IsNeCrossStructField is the validation function for validating that the current field's value is not equal to the field, within a separate struct, specified by the param's value.
+// isNeCrossStructField is the validation function for validating that the current field's value is not equal to the field, within a separate struct, specified by the param's value.
func isNeCrossStructField(fl FieldLevel) bool {
field := fl.Field()
@@ -983,6 +1046,9 @@ func isNeCrossStructField(fl FieldLevel) bool {
case reflect.Slice, reflect.Map, reflect.Array:
return int64(topField.Len()) != int64(field.Len())
+ case reflect.Bool:
+ return topField.Bool() != field.Bool()
+
case reflect.Struct:
fieldType := field.Type()
@@ -1005,7 +1071,7 @@ func isNeCrossStructField(fl FieldLevel) bool {
return topField.String() != field.String()
}
-// IsEqCrossStructField is the validation function for validating that the current field's value is equal to the field, within a separate struct, specified by the param's value.
+// isEqCrossStructField is the validation function for validating that the current field's value is equal to the field, within a separate struct, specified by the param's value.
func isEqCrossStructField(fl FieldLevel) bool {
field := fl.Field()
@@ -1030,6 +1096,9 @@ func isEqCrossStructField(fl FieldLevel) bool {
case reflect.Slice, reflect.Map, reflect.Array:
return int64(topField.Len()) == int64(field.Len())
+ case reflect.Bool:
+ return topField.Bool() == field.Bool()
+
case reflect.Struct:
fieldType := field.Type()
@@ -1052,7 +1121,7 @@ func isEqCrossStructField(fl FieldLevel) bool {
return topField.String() == field.String()
}
-// IsEqField is the validation function for validating if the current field's value is equal to the field specified by the param's value.
+// isEqField is the validation function for validating if the current field's value is equal to the field specified by the param's value.
func isEqField(fl FieldLevel) bool {
field := fl.Field()
@@ -1077,6 +1146,9 @@ func isEqField(fl FieldLevel) bool {
case reflect.Slice, reflect.Map, reflect.Array:
return int64(field.Len()) == int64(currentField.Len())
+ case reflect.Bool:
+ return field.Bool() == currentField.Bool()
+
case reflect.Struct:
fieldType := field.Type()
@@ -1100,7 +1172,7 @@ func isEqField(fl FieldLevel) bool {
return field.String() == currentField.String()
}
-// IsEq is the validation function for validating if the current field's value is equal to the param's value.
+// isEq is the validation function for validating if the current field's value is equal to the param's value.
func isEq(fl FieldLevel) bool {
field := fl.Field()
@@ -1117,7 +1189,7 @@ func isEq(fl FieldLevel) bool {
return int64(field.Len()) == p
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- p := asInt(param)
+ p := asIntFromType(field.Type(), param)
return field.Int() == p
@@ -1140,17 +1212,58 @@ func isEq(fl FieldLevel) bool {
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
}
-// IsBase64 is the validation function for validating if the current field's value is a valid base 64.
+// isPostcodeByIso3166Alpha2 validates by value which is country code in iso 3166 alpha 2
+// example: `postcode_iso3166_alpha2=US`
+func isPostcodeByIso3166Alpha2(fl FieldLevel) bool {
+ field := fl.Field()
+ param := fl.Param()
+
+ reg, found := postCodeRegexDict[param]
+ if !found {
+ return false
+ }
+
+ return reg.MatchString(field.String())
+}
+
+// isPostcodeByIso3166Alpha2 validates by field which represents for a value of country code in iso 3166 alpha 2
+// example: `postcode_iso3166_alpha2_field=CountryCode`
+func isPostcodeByIso3166Alpha2Field(fl FieldLevel) bool {
+ field := fl.Field()
+ params := parseOneOfParam2(fl.Param())
+
+ if len(params) != 1 {
+ return false
+ }
+
+ currentField, kind, _, found := fl.GetStructFieldOKAdvanced2(fl.Parent(), params[0])
+ if !found {
+ return false
+ }
+
+ if kind != reflect.String {
+ panic(fmt.Sprintf("Bad field type %T", currentField.Interface()))
+ }
+
+ reg, found := postCodeRegexDict[currentField.String()]
+ if !found {
+ return false
+ }
+
+ return reg.MatchString(field.String())
+}
+
+// isBase64 is the validation function for validating if the current field's value is a valid base 64.
func isBase64(fl FieldLevel) bool {
return base64Regex.MatchString(fl.Field().String())
}
-// IsBase64URL is the validation function for validating if the current field's value is a valid base64 URL safe string.
+// isBase64URL is the validation function for validating if the current field's value is a valid base64 URL safe string.
func isBase64URL(fl FieldLevel) bool {
return base64URLRegex.MatchString(fl.Field().String())
}
-// IsURI is the validation function for validating if the current field's value is a valid URI.
+// isURI is the validation function for validating if the current field's value is a valid URI.
func isURI(fl FieldLevel) bool {
field := fl.Field()
@@ -1179,7 +1292,7 @@ func isURI(fl FieldLevel) bool {
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
}
-// IsURL is the validation function for validating if the current field's value is a valid URL.
+// isURL is the validation function for validating if the current field's value is a valid URL.
func isURL(fl FieldLevel) bool {
field := fl.Field()
@@ -1231,7 +1344,7 @@ func isUrnRFC2141(fl FieldLevel) bool {
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
}
-// IsFile is the validation function for validating if the current field's value is a valid file path.
+// isFile is the validation function for validating if the current field's value is a valid file path.
func isFile(fl FieldLevel) bool {
field := fl.Field()
@@ -1248,47 +1361,47 @@ func isFile(fl FieldLevel) bool {
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
}
-// IsE164 is the validation function for validating if the current field's value is a valid e.164 formatted phone number.
+// isE164 is the validation function for validating if the current field's value is a valid e.164 formatted phone number.
func isE164(fl FieldLevel) bool {
return e164Regex.MatchString(fl.Field().String())
}
-// IsEmail is the validation function for validating if the current field's value is a valid email address.
+// isEmail is the validation function for validating if the current field's value is a valid email address.
func isEmail(fl FieldLevel) bool {
return emailRegex.MatchString(fl.Field().String())
}
-// IsHSLA is the validation function for validating if the current field's value is a valid HSLA color.
+// isHSLA is the validation function for validating if the current field's value is a valid HSLA color.
func isHSLA(fl FieldLevel) bool {
return hslaRegex.MatchString(fl.Field().String())
}
-// IsHSL is the validation function for validating if the current field's value is a valid HSL color.
+// isHSL is the validation function for validating if the current field's value is a valid HSL color.
func isHSL(fl FieldLevel) bool {
return hslRegex.MatchString(fl.Field().String())
}
-// IsRGBA is the validation function for validating if the current field's value is a valid RGBA color.
+// isRGBA is the validation function for validating if the current field's value is a valid RGBA color.
func isRGBA(fl FieldLevel) bool {
return rgbaRegex.MatchString(fl.Field().String())
}
-// IsRGB is the validation function for validating if the current field's value is a valid RGB color.
+// isRGB is the validation function for validating if the current field's value is a valid RGB color.
func isRGB(fl FieldLevel) bool {
return rgbRegex.MatchString(fl.Field().String())
}
-// IsHEXColor is the validation function for validating if the current field's value is a valid HEX color.
+// isHEXColor is the validation function for validating if the current field's value is a valid HEX color.
func isHEXColor(fl FieldLevel) bool {
- return hexcolorRegex.MatchString(fl.Field().String())
+ return hexColorRegex.MatchString(fl.Field().String())
}
-// IsHexadecimal is the validation function for validating if the current field's value is a valid hexadecimal.
+// isHexadecimal is the validation function for validating if the current field's value is a valid hexadecimal.
func isHexadecimal(fl FieldLevel) bool {
return hexadecimalRegex.MatchString(fl.Field().String())
}
-// IsNumber is the validation function for validating if the current field's value is a valid number.
+// isNumber is the validation function for validating if the current field's value is a valid number.
func isNumber(fl FieldLevel) bool {
switch fl.Field().Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.Float32, reflect.Float64:
@@ -1298,7 +1411,7 @@ func isNumber(fl FieldLevel) bool {
}
}
-// IsNumeric is the validation function for validating if the current field's value is a valid numeric value.
+// isNumeric is the validation function for validating if the current field's value is a valid numeric value.
func isNumeric(fl FieldLevel) bool {
switch fl.Field().Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.Float32, reflect.Float64:
@@ -1308,32 +1421,38 @@ func isNumeric(fl FieldLevel) bool {
}
}
-// IsAlphanum is the validation function for validating if the current field's value is a valid alphanumeric value.
+// isAlphanum is the validation function for validating if the current field's value is a valid alphanumeric value.
func isAlphanum(fl FieldLevel) bool {
return alphaNumericRegex.MatchString(fl.Field().String())
}
-// IsAlpha is the validation function for validating if the current field's value is a valid alpha value.
+// isAlpha is the validation function for validating if the current field's value is a valid alpha value.
func isAlpha(fl FieldLevel) bool {
return alphaRegex.MatchString(fl.Field().String())
}
-// IsAlphanumUnicode is the validation function for validating if the current field's value is a valid alphanumeric unicode value.
+// isAlphanumUnicode is the validation function for validating if the current field's value is a valid alphanumeric unicode value.
func isAlphanumUnicode(fl FieldLevel) bool {
return alphaUnicodeNumericRegex.MatchString(fl.Field().String())
}
-// IsAlphaUnicode is the validation function for validating if the current field's value is a valid alpha unicode value.
+// isAlphaUnicode is the validation function for validating if the current field's value is a valid alpha unicode value.
func isAlphaUnicode(fl FieldLevel) bool {
return alphaUnicodeRegex.MatchString(fl.Field().String())
}
+// isBoolean is the validation function for validating if the current field's value can be safely converted to a boolean.
+func isBoolean(fl FieldLevel) bool {
+ _, err := strconv.ParseBool(fl.Field().String())
+ return err == nil
+}
+
// isDefault is the opposite of required aka hasValue
func isDefault(fl FieldLevel) bool {
return !hasValue(fl)
}
-// HasValue is the validation function for validating if the current field's value is not the default static value.
+// hasValue is the validation function for validating if the current field's value is not the default static value.
func hasValue(fl FieldLevel) bool {
field := fl.Field()
switch field.Kind() {
@@ -1371,7 +1490,79 @@ func requireCheckFieldKind(fl FieldLevel, param string, defaultNotFoundValue boo
}
}
-// RequiredWith is the validation function
+// requireCheckFieldValue is a func for check field value
+func requireCheckFieldValue(fl FieldLevel, param string, value string, defaultNotFoundValue bool) bool {
+ field, kind, _, found := fl.GetStructFieldOKAdvanced2(fl.Parent(), param)
+ if !found {
+ return defaultNotFoundValue
+ }
+
+ switch kind {
+
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ return field.Int() == asInt(value)
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
+ return field.Uint() == asUint(value)
+
+ case reflect.Float32, reflect.Float64:
+ return field.Float() == asFloat(value)
+
+ case reflect.Slice, reflect.Map, reflect.Array:
+ return int64(field.Len()) == asInt(value)
+
+ case reflect.Bool:
+ return field.Bool() == asBool(value)
+ }
+
+ // default reflect.String:
+ return field.String() == value
+}
+
+// requiredIf is the validation function
+// The field under validation must be present and not empty only if all the other specified fields are equal to the value following with the specified field.
+func requiredIf(fl FieldLevel) bool {
+ params := parseOneOfParam2(fl.Param())
+ if len(params)%2 != 0 {
+ panic(fmt.Sprintf("Bad param number for required_if %s", fl.FieldName()))
+ }
+ for i := 0; i < len(params); i += 2 {
+ if !requireCheckFieldValue(fl, params[i], params[i+1], false) {
+ return true
+ }
+ }
+ return hasValue(fl)
+}
+
+// requiredUnless is the validation function
+// The field under validation must be present and not empty only unless all the other specified fields are equal to the value following with the specified field.
+func requiredUnless(fl FieldLevel) bool {
+ params := parseOneOfParam2(fl.Param())
+ if len(params)%2 != 0 {
+ panic(fmt.Sprintf("Bad param number for required_unless %s", fl.FieldName()))
+ }
+
+ for i := 0; i < len(params); i += 2 {
+ if requireCheckFieldValue(fl, params[i], params[i+1], false) {
+ return true
+ }
+ }
+ return hasValue(fl)
+}
+
+// excludedWith is the validation function
+// The field under validation must not be present or is empty if any of the other specified fields are present.
+func excludedWith(fl FieldLevel) bool {
+ params := parseOneOfParam2(fl.Param())
+ for _, param := range params {
+ if !requireCheckFieldKind(fl, param, true) {
+ return !hasValue(fl)
+ }
+ }
+ return true
+}
+
+// requiredWith is the validation function
// The field under validation must be present and not empty only if any of the other specified fields are present.
func requiredWith(fl FieldLevel) bool {
params := parseOneOfParam2(fl.Param())
@@ -1383,7 +1574,19 @@ func requiredWith(fl FieldLevel) bool {
return true
}
-// RequiredWithAll is the validation function
+// excludedWithAll is the validation function
+// The field under validation must not be present or is empty if all of the other specified fields are present.
+func excludedWithAll(fl FieldLevel) bool {
+ params := parseOneOfParam2(fl.Param())
+ for _, param := range params {
+ if requireCheckFieldKind(fl, param, true) {
+ return true
+ }
+ }
+ return !hasValue(fl)
+}
+
+// requiredWithAll is the validation function
// The field under validation must be present and not empty only if all of the other specified fields are present.
func requiredWithAll(fl FieldLevel) bool {
params := parseOneOfParam2(fl.Param())
@@ -1395,7 +1598,16 @@ func requiredWithAll(fl FieldLevel) bool {
return hasValue(fl)
}
-// RequiredWithout is the validation function
+// excludedWithout is the validation function
+// The field under validation must not be present or is empty when any of the other specified fields are not present.
+func excludedWithout(fl FieldLevel) bool {
+ if requireCheckFieldKind(fl, strings.TrimSpace(fl.Param()), true) {
+ return !hasValue(fl)
+ }
+ return true
+}
+
+// requiredWithout is the validation function
// The field under validation must be present and not empty only when any of the other specified fields are not present.
func requiredWithout(fl FieldLevel) bool {
if requireCheckFieldKind(fl, strings.TrimSpace(fl.Param()), true) {
@@ -1404,7 +1616,19 @@ func requiredWithout(fl FieldLevel) bool {
return true
}
-// RequiredWithoutAll is the validation function
+// excludedWithoutAll is the validation function
+// The field under validation must not be present or is empty when all of the other specified fields are not present.
+func excludedWithoutAll(fl FieldLevel) bool {
+ params := parseOneOfParam2(fl.Param())
+ for _, param := range params {
+ if !requireCheckFieldKind(fl, param, true) {
+ return true
+ }
+ }
+ return !hasValue(fl)
+}
+
+// requiredWithoutAll is the validation function
// The field under validation must be present and not empty only when all of the other specified fields are not present.
func requiredWithoutAll(fl FieldLevel) bool {
params := parseOneOfParam2(fl.Param())
@@ -1416,7 +1640,7 @@ func requiredWithoutAll(fl FieldLevel) bool {
return hasValue(fl)
}
-// IsGteField is the validation function for validating if the current field's value is greater than or equal to the field specified by the param's value.
+// isGteField is the validation function for validating if the current field's value is greater than or equal to the field specified by the param's value.
func isGteField(fl FieldLevel) bool {
field := fl.Field()
@@ -1463,7 +1687,7 @@ func isGteField(fl FieldLevel) bool {
return len(field.String()) >= len(currentField.String())
}
-// IsGtField is the validation function for validating if the current field's value is greater than the field specified by the param's value.
+// isGtField is the validation function for validating if the current field's value is greater than the field specified by the param's value.
func isGtField(fl FieldLevel) bool {
field := fl.Field()
@@ -1510,7 +1734,7 @@ func isGtField(fl FieldLevel) bool {
return len(field.String()) > len(currentField.String())
}
-// IsGte is the validation function for validating if the current field's value is greater than or equal to the param's value.
+// isGte is the validation function for validating if the current field's value is greater than or equal to the param's value.
func isGte(fl FieldLevel) bool {
field := fl.Field()
@@ -1529,7 +1753,7 @@ func isGte(fl FieldLevel) bool {
return int64(field.Len()) >= p
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- p := asInt(param)
+ p := asIntFromType(field.Type(), param)
return field.Int() >= p
@@ -1557,7 +1781,7 @@ func isGte(fl FieldLevel) bool {
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
}
-// IsGt is the validation function for validating if the current field's value is greater than the param's value.
+// isGt is the validation function for validating if the current field's value is greater than the param's value.
func isGt(fl FieldLevel) bool {
field := fl.Field()
@@ -1576,7 +1800,7 @@ func isGt(fl FieldLevel) bool {
return int64(field.Len()) > p
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- p := asInt(param)
+ p := asIntFromType(field.Type(), param)
return field.Int() > p
@@ -1600,7 +1824,7 @@ func isGt(fl FieldLevel) bool {
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
}
-// HasLengthOf is the validation function for validating if the current field's value is equal to the param's value.
+// hasLengthOf is the validation function for validating if the current field's value is equal to the param's value.
func hasLengthOf(fl FieldLevel) bool {
field := fl.Field()
@@ -1619,7 +1843,7 @@ func hasLengthOf(fl FieldLevel) bool {
return int64(field.Len()) == p
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- p := asInt(param)
+ p := asIntFromType(field.Type(), param)
return field.Int() == p
@@ -1637,12 +1861,12 @@ func hasLengthOf(fl FieldLevel) bool {
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
}
-// HasMinOf is the validation function for validating if the current field's value is greater than or equal to the param's value.
+// hasMinOf is the validation function for validating if the current field's value is greater than or equal to the param's value.
func hasMinOf(fl FieldLevel) bool {
return isGte(fl)
}
-// IsLteField is the validation function for validating if the current field's value is less than or equal to the field specified by the param's value.
+// isLteField is the validation function for validating if the current field's value is less than or equal to the field specified by the param's value.
func isLteField(fl FieldLevel) bool {
field := fl.Field()
@@ -1689,7 +1913,7 @@ func isLteField(fl FieldLevel) bool {
return len(field.String()) <= len(currentField.String())
}
-// IsLtField is the validation function for validating if the current field's value is less than the field specified by the param's value.
+// isLtField is the validation function for validating if the current field's value is less than the field specified by the param's value.
func isLtField(fl FieldLevel) bool {
field := fl.Field()
@@ -1736,7 +1960,7 @@ func isLtField(fl FieldLevel) bool {
return len(field.String()) < len(currentField.String())
}
-// IsLte is the validation function for validating if the current field's value is less than or equal to the param's value.
+// isLte is the validation function for validating if the current field's value is less than or equal to the param's value.
func isLte(fl FieldLevel) bool {
field := fl.Field()
@@ -1755,7 +1979,7 @@ func isLte(fl FieldLevel) bool {
return int64(field.Len()) <= p
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- p := asInt(param)
+ p := asIntFromType(field.Type(), param)
return field.Int() <= p
@@ -1783,7 +2007,7 @@ func isLte(fl FieldLevel) bool {
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
}
-// IsLt is the validation function for validating if the current field's value is less than the param's value.
+// isLt is the validation function for validating if the current field's value is less than the param's value.
func isLt(fl FieldLevel) bool {
field := fl.Field()
@@ -1802,7 +2026,7 @@ func isLt(fl FieldLevel) bool {
return int64(field.Len()) < p
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- p := asInt(param)
+ p := asIntFromType(field.Type(), param)
return field.Int() < p
@@ -1827,12 +2051,12 @@ func isLt(fl FieldLevel) bool {
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
}
-// HasMaxOf is the validation function for validating if the current field's value is less than or equal to the param's value.
+// hasMaxOf is the validation function for validating if the current field's value is less than or equal to the param's value.
func hasMaxOf(fl FieldLevel) bool {
return isLte(fl)
}
-// IsTCP4AddrResolvable is the validation function for validating if the field's value is a resolvable tcp4 address.
+// isTCP4AddrResolvable is the validation function for validating if the field's value is a resolvable tcp4 address.
func isTCP4AddrResolvable(fl FieldLevel) bool {
if !isIP4Addr(fl) {
@@ -1843,7 +2067,7 @@ func isTCP4AddrResolvable(fl FieldLevel) bool {
return err == nil
}
-// IsTCP6AddrResolvable is the validation function for validating if the field's value is a resolvable tcp6 address.
+// isTCP6AddrResolvable is the validation function for validating if the field's value is a resolvable tcp6 address.
func isTCP6AddrResolvable(fl FieldLevel) bool {
if !isIP6Addr(fl) {
@@ -1855,7 +2079,7 @@ func isTCP6AddrResolvable(fl FieldLevel) bool {
return err == nil
}
-// IsTCPAddrResolvable is the validation function for validating if the field's value is a resolvable tcp address.
+// isTCPAddrResolvable is the validation function for validating if the field's value is a resolvable tcp address.
func isTCPAddrResolvable(fl FieldLevel) bool {
if !isIP4Addr(fl) && !isIP6Addr(fl) {
@@ -1867,7 +2091,7 @@ func isTCPAddrResolvable(fl FieldLevel) bool {
return err == nil
}
-// IsUDP4AddrResolvable is the validation function for validating if the field's value is a resolvable udp4 address.
+// isUDP4AddrResolvable is the validation function for validating if the field's value is a resolvable udp4 address.
func isUDP4AddrResolvable(fl FieldLevel) bool {
if !isIP4Addr(fl) {
@@ -1879,7 +2103,7 @@ func isUDP4AddrResolvable(fl FieldLevel) bool {
return err == nil
}
-// IsUDP6AddrResolvable is the validation function for validating if the field's value is a resolvable udp6 address.
+// isUDP6AddrResolvable is the validation function for validating if the field's value is a resolvable udp6 address.
func isUDP6AddrResolvable(fl FieldLevel) bool {
if !isIP6Addr(fl) {
@@ -1891,7 +2115,7 @@ func isUDP6AddrResolvable(fl FieldLevel) bool {
return err == nil
}
-// IsUDPAddrResolvable is the validation function for validating if the field's value is a resolvable udp address.
+// isUDPAddrResolvable is the validation function for validating if the field's value is a resolvable udp address.
func isUDPAddrResolvable(fl FieldLevel) bool {
if !isIP4Addr(fl) && !isIP6Addr(fl) {
@@ -1903,7 +2127,7 @@ func isUDPAddrResolvable(fl FieldLevel) bool {
return err == nil
}
-// IsIP4AddrResolvable is the validation function for validating if the field's value is a resolvable ip4 address.
+// isIP4AddrResolvable is the validation function for validating if the field's value is a resolvable ip4 address.
func isIP4AddrResolvable(fl FieldLevel) bool {
if !isIPv4(fl) {
@@ -1915,7 +2139,7 @@ func isIP4AddrResolvable(fl FieldLevel) bool {
return err == nil
}
-// IsIP6AddrResolvable is the validation function for validating if the field's value is a resolvable ip6 address.
+// isIP6AddrResolvable is the validation function for validating if the field's value is a resolvable ip6 address.
func isIP6AddrResolvable(fl FieldLevel) bool {
if !isIPv6(fl) {
@@ -1927,7 +2151,7 @@ func isIP6AddrResolvable(fl FieldLevel) bool {
return err == nil
}
-// IsIPAddrResolvable is the validation function for validating if the field's value is a resolvable ip address.
+// isIPAddrResolvable is the validation function for validating if the field's value is a resolvable ip address.
func isIPAddrResolvable(fl FieldLevel) bool {
if !isIP(fl) {
@@ -1939,7 +2163,7 @@ func isIPAddrResolvable(fl FieldLevel) bool {
return err == nil
}
-// IsUnixAddrResolvable is the validation function for validating if the field's value is a resolvable unix address.
+// isUnixAddrResolvable is the validation function for validating if the field's value is a resolvable unix address.
func isUnixAddrResolvable(fl FieldLevel) bool {
_, err := net.ResolveUnixAddr("unix", fl.Field().String())
@@ -1990,15 +2214,10 @@ func isFQDN(fl FieldLevel) bool {
return false
}
- if val[len(val)-1] == '.' {
- val = val[0 : len(val)-1]
- }
-
- return strings.ContainsAny(val, ".") &&
- hostnameRegexRFC952.MatchString(val)
+ return fqdnRegexRFC1123.MatchString(val)
}
-// IsDir is the validation function for validating if the current field's value is a valid directory.
+// isDir is the validation function for validating if the current field's value is a valid directory.
func isDir(fl FieldLevel) bool {
field := fl.Field()
@@ -2026,6 +2245,11 @@ func isJSON(fl FieldLevel) bool {
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
}
+// isJWT is the validation function for validating if the current field's value is a valid JWT string.
+func isJWT(fl FieldLevel) bool {
+ return jWTRegex.MatchString(fl.Field().String())
+}
+
// isHostnamePort validates a : combination for fields typically used for socket address.
func isHostnamePort(fl FieldLevel) bool {
val := fl.Field().String()
@@ -2080,12 +2304,106 @@ func isDatetime(fl FieldLevel) bool {
if field.Kind() == reflect.String {
_, err := time.Parse(param, field.String())
- if err != nil {
- return false
- }
- return true
+ return err == nil
}
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
}
+
+// isTimeZone is the validation function for validating if the current field's value is a valid time zone string.
+func isTimeZone(fl FieldLevel) bool {
+ field := fl.Field()
+
+ if field.Kind() == reflect.String {
+ // empty value is converted to UTC by time.LoadLocation but disallow it as it is not a valid time zone name
+ if field.String() == "" {
+ return false
+ }
+
+ // Local value is converted to the current system time zone by time.LoadLocation but disallow it as it is not a valid time zone name
+ if strings.ToLower(field.String()) == "local" {
+ return false
+ }
+
+ _, err := time.LoadLocation(field.String())
+ return err == nil
+ }
+
+ panic(fmt.Sprintf("Bad field type %T", field.Interface()))
+}
+
+// isIso3166Alpha2 is the validation function for validating if the current field's value is a valid iso3166-1 alpha-2 country code.
+func isIso3166Alpha2(fl FieldLevel) bool {
+ val := fl.Field().String()
+ return iso3166_1_alpha2[val]
+}
+
+// isIso3166Alpha2 is the validation function for validating if the current field's value is a valid iso3166-1 alpha-3 country code.
+func isIso3166Alpha3(fl FieldLevel) bool {
+ val := fl.Field().String()
+ return iso3166_1_alpha3[val]
+}
+
+// isIso3166Alpha2 is the validation function for validating if the current field's value is a valid iso3166-1 alpha-numeric country code.
+func isIso3166AlphaNumeric(fl FieldLevel) bool {
+ field := fl.Field()
+
+ var code int
+ switch field.Kind() {
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ code = int(field.Int() % 1000)
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ code = int(field.Uint() % 1000)
+ default:
+ panic(fmt.Sprintf("Bad field type %T", field.Interface()))
+ }
+ return iso3166_1_alpha_numeric[code]
+}
+
+// isIso31662 is the validation function for validating if the current field's value is a valid iso3166-2 code.
+func isIso31662(fl FieldLevel) bool {
+ val := fl.Field().String()
+ return iso3166_2[val]
+}
+
+// isIso4217 is the validation function for validating if the current field's value is a valid iso4217 currency code.
+func isIso4217(fl FieldLevel) bool {
+ val := fl.Field().String()
+ return iso4217[val]
+}
+
+// isIso4217Numeric is the validation function for validating if the current field's value is a valid iso4217 numeric currency code.
+func isIso4217Numeric(fl FieldLevel) bool {
+ field := fl.Field()
+
+ var code int
+ switch field.Kind() {
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ code = int(field.Int())
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ code = int(field.Uint())
+ default:
+ panic(fmt.Sprintf("Bad field type %T", field.Interface()))
+ }
+ return iso4217_numeric[code]
+}
+
+// isBCP47LanguageTag is the validation function for validating if the current field's value is a valid BCP 47 language tag, as parsed by language.Parse
+func isBCP47LanguageTag(fl FieldLevel) bool {
+ field := fl.Field()
+
+ if field.Kind() == reflect.String {
+ _, err := language.Parse(field.String())
+ return err == nil
+ }
+
+ panic(fmt.Sprintf("Bad field type %T", field.Interface()))
+}
+
+// isIsoBicFormat is the validation function for validating if the current field's value is a valid Business Identifier Code (SWIFT code), defined in ISO 9362
+func isIsoBicFormat(fl FieldLevel) bool {
+ bicString := fl.Field().String()
+
+ return bicRegex.MatchString(bicString)
+}
diff --git a/vendor/github.com/go-playground/validator/v10/country_codes.go b/vendor/github.com/go-playground/validator/v10/country_codes.go
new file mode 100644
index 000000000..0d9eda033
--- /dev/null
+++ b/vendor/github.com/go-playground/validator/v10/country_codes.go
@@ -0,0 +1,1132 @@
+package validator
+
+var iso3166_1_alpha2 = map[string]bool{
+ // see: https://www.iso.org/iso-3166-country-codes.html
+ "AF": true, "AX": true, "AL": true, "DZ": true, "AS": true,
+ "AD": true, "AO": true, "AI": true, "AQ": true, "AG": true,
+ "AR": true, "AM": true, "AW": true, "AU": true, "AT": true,
+ "AZ": true, "BS": true, "BH": true, "BD": true, "BB": true,
+ "BY": true, "BE": true, "BZ": true, "BJ": true, "BM": true,
+ "BT": true, "BO": true, "BQ": true, "BA": true, "BW": true,
+ "BV": true, "BR": true, "IO": true, "BN": true, "BG": true,
+ "BF": true, "BI": true, "KH": true, "CM": true, "CA": true,
+ "CV": true, "KY": true, "CF": true, "TD": true, "CL": true,
+ "CN": true, "CX": true, "CC": true, "CO": true, "KM": true,
+ "CG": true, "CD": true, "CK": true, "CR": true, "CI": true,
+ "HR": true, "CU": true, "CW": true, "CY": true, "CZ": true,
+ "DK": true, "DJ": true, "DM": true, "DO": true, "EC": true,
+ "EG": true, "SV": true, "GQ": true, "ER": true, "EE": true,
+ "ET": true, "FK": true, "FO": true, "FJ": true, "FI": true,
+ "FR": true, "GF": true, "PF": true, "TF": true, "GA": true,
+ "GM": true, "GE": true, "DE": true, "GH": true, "GI": true,
+ "GR": true, "GL": true, "GD": true, "GP": true, "GU": true,
+ "GT": true, "GG": true, "GN": true, "GW": true, "GY": true,
+ "HT": true, "HM": true, "VA": true, "HN": true, "HK": true,
+ "HU": true, "IS": true, "IN": true, "ID": true, "IR": true,
+ "IQ": true, "IE": true, "IM": true, "IL": true, "IT": true,
+ "JM": true, "JP": true, "JE": true, "JO": true, "KZ": true,
+ "KE": true, "KI": true, "KP": true, "KR": true, "KW": true,
+ "KG": true, "LA": true, "LV": true, "LB": true, "LS": true,
+ "LR": true, "LY": true, "LI": true, "LT": true, "LU": true,
+ "MO": true, "MK": true, "MG": true, "MW": true, "MY": true,
+ "MV": true, "ML": true, "MT": true, "MH": true, "MQ": true,
+ "MR": true, "MU": true, "YT": true, "MX": true, "FM": true,
+ "MD": true, "MC": true, "MN": true, "ME": true, "MS": true,
+ "MA": true, "MZ": true, "MM": true, "NA": true, "NR": true,
+ "NP": true, "NL": true, "NC": true, "NZ": true, "NI": true,
+ "NE": true, "NG": true, "NU": true, "NF": true, "MP": true,
+ "NO": true, "OM": true, "PK": true, "PW": true, "PS": true,
+ "PA": true, "PG": true, "PY": true, "PE": true, "PH": true,
+ "PN": true, "PL": true, "PT": true, "PR": true, "QA": true,
+ "RE": true, "RO": true, "RU": true, "RW": true, "BL": true,
+ "SH": true, "KN": true, "LC": true, "MF": true, "PM": true,
+ "VC": true, "WS": true, "SM": true, "ST": true, "SA": true,
+ "SN": true, "RS": true, "SC": true, "SL": true, "SG": true,
+ "SX": true, "SK": true, "SI": true, "SB": true, "SO": true,
+ "ZA": true, "GS": true, "SS": true, "ES": true, "LK": true,
+ "SD": true, "SR": true, "SJ": true, "SZ": true, "SE": true,
+ "CH": true, "SY": true, "TW": true, "TJ": true, "TZ": true,
+ "TH": true, "TL": true, "TG": true, "TK": true, "TO": true,
+ "TT": true, "TN": true, "TR": true, "TM": true, "TC": true,
+ "TV": true, "UG": true, "UA": true, "AE": true, "GB": true,
+ "US": true, "UM": true, "UY": true, "UZ": true, "VU": true,
+ "VE": true, "VN": true, "VG": true, "VI": true, "WF": true,
+ "EH": true, "YE": true, "ZM": true, "ZW": true,
+}
+
+var iso3166_1_alpha3 = map[string]bool{
+ // see: https://www.iso.org/iso-3166-country-codes.html
+ "AFG": true, "ALB": true, "DZA": true, "ASM": true, "AND": true,
+ "AGO": true, "AIA": true, "ATA": true, "ATG": true, "ARG": true,
+ "ARM": true, "ABW": true, "AUS": true, "AUT": true, "AZE": true,
+ "BHS": true, "BHR": true, "BGD": true, "BRB": true, "BLR": true,
+ "BEL": true, "BLZ": true, "BEN": true, "BMU": true, "BTN": true,
+ "BOL": true, "BES": true, "BIH": true, "BWA": true, "BVT": true,
+ "BRA": true, "IOT": true, "BRN": true, "BGR": true, "BFA": true,
+ "BDI": true, "CPV": true, "KHM": true, "CMR": true, "CAN": true,
+ "CYM": true, "CAF": true, "TCD": true, "CHL": true, "CHN": true,
+ "CXR": true, "CCK": true, "COL": true, "COM": true, "COD": true,
+ "COG": true, "COK": true, "CRI": true, "HRV": true, "CUB": true,
+ "CUW": true, "CYP": true, "CZE": true, "CIV": true, "DNK": true,
+ "DJI": true, "DMA": true, "DOM": true, "ECU": true, "EGY": true,
+ "SLV": true, "GNQ": true, "ERI": true, "EST": true, "SWZ": true,
+ "ETH": true, "FLK": true, "FRO": true, "FJI": true, "FIN": true,
+ "FRA": true, "GUF": true, "PYF": true, "ATF": true, "GAB": true,
+ "GMB": true, "GEO": true, "DEU": true, "GHA": true, "GIB": true,
+ "GRC": true, "GRL": true, "GRD": true, "GLP": true, "GUM": true,
+ "GTM": true, "GGY": true, "GIN": true, "GNB": true, "GUY": true,
+ "HTI": true, "HMD": true, "VAT": true, "HND": true, "HKG": true,
+ "HUN": true, "ISL": true, "IND": true, "IDN": true, "IRN": true,
+ "IRQ": true, "IRL": true, "IMN": true, "ISR": true, "ITA": true,
+ "JAM": true, "JPN": true, "JEY": true, "JOR": true, "KAZ": true,
+ "KEN": true, "KIR": true, "PRK": true, "KOR": true, "KWT": true,
+ "KGZ": true, "LAO": true, "LVA": true, "LBN": true, "LSO": true,
+ "LBR": true, "LBY": true, "LIE": true, "LTU": true, "LUX": true,
+ "MAC": true, "MDG": true, "MWI": true, "MYS": true, "MDV": true,
+ "MLI": true, "MLT": true, "MHL": true, "MTQ": true, "MRT": true,
+ "MUS": true, "MYT": true, "MEX": true, "FSM": true, "MDA": true,
+ "MCO": true, "MNG": true, "MNE": true, "MSR": true, "MAR": true,
+ "MOZ": true, "MMR": true, "NAM": true, "NRU": true, "NPL": true,
+ "NLD": true, "NCL": true, "NZL": true, "NIC": true, "NER": true,
+ "NGA": true, "NIU": true, "NFK": true, "MKD": true, "MNP": true,
+ "NOR": true, "OMN": true, "PAK": true, "PLW": true, "PSE": true,
+ "PAN": true, "PNG": true, "PRY": true, "PER": true, "PHL": true,
+ "PCN": true, "POL": true, "PRT": true, "PRI": true, "QAT": true,
+ "ROU": true, "RUS": true, "RWA": true, "REU": true, "BLM": true,
+ "SHN": true, "KNA": true, "LCA": true, "MAF": true, "SPM": true,
+ "VCT": true, "WSM": true, "SMR": true, "STP": true, "SAU": true,
+ "SEN": true, "SRB": true, "SYC": true, "SLE": true, "SGP": true,
+ "SXM": true, "SVK": true, "SVN": true, "SLB": true, "SOM": true,
+ "ZAF": true, "SGS": true, "SSD": true, "ESP": true, "LKA": true,
+ "SDN": true, "SUR": true, "SJM": true, "SWE": true, "CHE": true,
+ "SYR": true, "TWN": true, "TJK": true, "TZA": true, "THA": true,
+ "TLS": true, "TGO": true, "TKL": true, "TON": true, "TTO": true,
+ "TUN": true, "TUR": true, "TKM": true, "TCA": true, "TUV": true,
+ "UGA": true, "UKR": true, "ARE": true, "GBR": true, "UMI": true,
+ "USA": true, "URY": true, "UZB": true, "VUT": true, "VEN": true,
+ "VNM": true, "VGB": true, "VIR": true, "WLF": true, "ESH": true,
+ "YEM": true, "ZMB": true, "ZWE": true, "ALA": true,
+}
+var iso3166_1_alpha_numeric = map[int]bool{
+ // see: https://www.iso.org/iso-3166-country-codes.html
+ 4: true, 8: true, 12: true, 16: true, 20: true,
+ 24: true, 660: true, 10: true, 28: true, 32: true,
+ 51: true, 533: true, 36: true, 40: true, 31: true,
+ 44: true, 48: true, 50: true, 52: true, 112: true,
+ 56: true, 84: true, 204: true, 60: true, 64: true,
+ 68: true, 535: true, 70: true, 72: true, 74: true,
+ 76: true, 86: true, 96: true, 100: true, 854: true,
+ 108: true, 132: true, 116: true, 120: true, 124: true,
+ 136: true, 140: true, 148: true, 152: true, 156: true,
+ 162: true, 166: true, 170: true, 174: true, 180: true,
+ 178: true, 184: true, 188: true, 191: true, 192: true,
+ 531: true, 196: true, 203: true, 384: true, 208: true,
+ 262: true, 212: true, 214: true, 218: true, 818: true,
+ 222: true, 226: true, 232: true, 233: true, 748: true,
+ 231: true, 238: true, 234: true, 242: true, 246: true,
+ 250: true, 254: true, 258: true, 260: true, 266: true,
+ 270: true, 268: true, 276: true, 288: true, 292: true,
+ 300: true, 304: true, 308: true, 312: true, 316: true,
+ 320: true, 831: true, 324: true, 624: true, 328: true,
+ 332: true, 334: true, 336: true, 340: true, 344: true,
+ 348: true, 352: true, 356: true, 360: true, 364: true,
+ 368: true, 372: true, 833: true, 376: true, 380: true,
+ 388: true, 392: true, 832: true, 400: true, 398: true,
+ 404: true, 296: true, 408: true, 410: true, 414: true,
+ 417: true, 418: true, 428: true, 422: true, 426: true,
+ 430: true, 434: true, 438: true, 440: true, 442: true,
+ 446: true, 450: true, 454: true, 458: true, 462: true,
+ 466: true, 470: true, 584: true, 474: true, 478: true,
+ 480: true, 175: true, 484: true, 583: true, 498: true,
+ 492: true, 496: true, 499: true, 500: true, 504: true,
+ 508: true, 104: true, 516: true, 520: true, 524: true,
+ 528: true, 540: true, 554: true, 558: true, 562: true,
+ 566: true, 570: true, 574: true, 807: true, 580: true,
+ 578: true, 512: true, 586: true, 585: true, 275: true,
+ 591: true, 598: true, 600: true, 604: true, 608: true,
+ 612: true, 616: true, 620: true, 630: true, 634: true,
+ 642: true, 643: true, 646: true, 638: true, 652: true,
+ 654: true, 659: true, 662: true, 663: true, 666: true,
+ 670: true, 882: true, 674: true, 678: true, 682: true,
+ 686: true, 688: true, 690: true, 694: true, 702: true,
+ 534: true, 703: true, 705: true, 90: true, 706: true,
+ 710: true, 239: true, 728: true, 724: true, 144: true,
+ 729: true, 740: true, 744: true, 752: true, 756: true,
+ 760: true, 158: true, 762: true, 834: true, 764: true,
+ 626: true, 768: true, 772: true, 776: true, 780: true,
+ 788: true, 792: true, 795: true, 796: true, 798: true,
+ 800: true, 804: true, 784: true, 826: true, 581: true,
+ 840: true, 858: true, 860: true, 548: true, 862: true,
+ 704: true, 92: true, 850: true, 876: true, 732: true,
+ 887: true, 894: true, 716: true, 248: true,
+}
+
+var iso3166_2 = map[string]bool{
+ "AD-02" : true, "AD-03" : true, "AD-04" : true, "AD-05" : true, "AD-06" : true,
+ "AD-07" : true, "AD-08" : true, "AE-AJ" : true, "AE-AZ" : true, "AE-DU" : true,
+ "AE-FU" : true, "AE-RK" : true, "AE-SH" : true, "AE-UQ" : true, "AF-BAL" : true,
+ "AF-BAM" : true, "AF-BDG" : true, "AF-BDS" : true, "AF-BGL" : true, "AF-DAY" : true,
+ "AF-FRA" : true, "AF-FYB" : true, "AF-GHA" : true, "AF-GHO" : true, "AF-HEL" : true,
+ "AF-HER" : true, "AF-JOW" : true, "AF-KAB" : true, "AF-KAN" : true, "AF-KAP" : true,
+ "AF-KDZ" : true, "AF-KHO" : true, "AF-KNR" : true, "AF-LAG" : true, "AF-LOG" : true,
+ "AF-NAN" : true, "AF-NIM" : true, "AF-NUR" : true, "AF-PAN" : true, "AF-PAR" : true,
+ "AF-PIA" : true, "AF-PKA" : true, "AF-SAM" : true, "AF-SAR" : true, "AF-TAK" : true,
+ "AF-URU" : true, "AF-WAR" : true, "AF-ZAB" : true, "AG-03" : true, "AG-04" : true,
+ "AG-05" : true, "AG-06" : true, "AG-07" : true, "AG-08" : true, "AG-10" : true,
+ "AG-11" : true, "AL-01" : true, "AL-02" : true, "AL-03" : true, "AL-04" : true,
+ "AL-05" : true, "AL-06" : true, "AL-07" : true, "AL-08" : true, "AL-09" : true,
+ "AL-10" : true, "AL-11" : true, "AL-12" : true, "AL-BR" : true, "AL-BU" : true,
+ "AL-DI" : true, "AL-DL" : true, "AL-DR" : true, "AL-DV" : true, "AL-EL" : true,
+ "AL-ER" : true, "AL-FR" : true, "AL-GJ" : true, "AL-GR" : true, "AL-HA" : true,
+ "AL-KA" : true, "AL-KB" : true, "AL-KC" : true, "AL-KO" : true, "AL-KR" : true,
+ "AL-KU" : true, "AL-LB" : true, "AL-LE" : true, "AL-LU" : true, "AL-MK" : true,
+ "AL-MM" : true, "AL-MR" : true, "AL-MT" : true, "AL-PG" : true, "AL-PQ" : true,
+ "AL-PR" : true, "AL-PU" : true, "AL-SH" : true, "AL-SK" : true, "AL-SR" : true,
+ "AL-TE" : true, "AL-TP" : true, "AL-TR" : true, "AL-VL" : true, "AM-AG" : true,
+ "AM-AR" : true, "AM-AV" : true, "AM-ER" : true, "AM-GR" : true, "AM-KT" : true,
+ "AM-LO" : true, "AM-SH" : true, "AM-SU" : true, "AM-TV" : true, "AM-VD" : true,
+ "AO-BGO" : true, "AO-BGU" : true, "AO-BIE" : true, "AO-CAB" : true, "AO-CCU" : true,
+ "AO-CNN" : true, "AO-CNO" : true, "AO-CUS" : true, "AO-HUA" : true, "AO-HUI" : true,
+ "AO-LNO" : true, "AO-LSU" : true, "AO-LUA" : true, "AO-MAL" : true, "AO-MOX" : true,
+ "AO-NAM" : true, "AO-UIG" : true, "AO-ZAI" : true, "AR-A" : true, "AR-B" : true,
+ "AR-C" : true, "AR-D" : true, "AR-E" : true, "AR-G" : true, "AR-H" : true,
+ "AR-J" : true, "AR-K" : true, "AR-L" : true, "AR-M" : true, "AR-N" : true,
+ "AR-P" : true, "AR-Q" : true, "AR-R" : true, "AR-S" : true, "AR-T" : true,
+ "AR-U" : true, "AR-V" : true, "AR-W" : true, "AR-X" : true, "AR-Y" : true,
+ "AR-Z" : true, "AT-1" : true, "AT-2" : true, "AT-3" : true, "AT-4" : true,
+ "AT-5" : true, "AT-6" : true, "AT-7" : true, "AT-8" : true, "AT-9" : true,
+ "AU-ACT" : true, "AU-NSW" : true, "AU-NT" : true, "AU-QLD" : true, "AU-SA" : true,
+ "AU-TAS" : true, "AU-VIC" : true, "AU-WA" : true, "AZ-ABS" : true, "AZ-AGA" : true,
+ "AZ-AGC" : true, "AZ-AGM" : true, "AZ-AGS" : true, "AZ-AGU" : true, "AZ-AST" : true,
+ "AZ-BA" : true, "AZ-BAB" : true, "AZ-BAL" : true, "AZ-BAR" : true, "AZ-BEY" : true,
+ "AZ-BIL" : true, "AZ-CAB" : true, "AZ-CAL" : true, "AZ-CUL" : true, "AZ-DAS" : true,
+ "AZ-FUZ" : true, "AZ-GA" : true, "AZ-GAD" : true, "AZ-GOR" : true, "AZ-GOY" : true,
+ "AZ-GYG" : true, "AZ-HAC" : true, "AZ-IMI" : true, "AZ-ISM" : true, "AZ-KAL" : true,
+ "AZ-KAN" : true, "AZ-KUR" : true, "AZ-LA" : true, "AZ-LAC" : true, "AZ-LAN" : true,
+ "AZ-LER" : true, "AZ-MAS" : true, "AZ-MI" : true, "AZ-NA" : true, "AZ-NEF" : true,
+ "AZ-NV" : true, "AZ-NX" : true, "AZ-OGU" : true, "AZ-ORD" : true, "AZ-QAB" : true,
+ "AZ-QAX" : true, "AZ-QAZ" : true, "AZ-QBA" : true, "AZ-QBI" : true, "AZ-QOB" : true,
+ "AZ-QUS" : true, "AZ-SA" : true, "AZ-SAB" : true, "AZ-SAD" : true, "AZ-SAH" : true,
+ "AZ-SAK" : true, "AZ-SAL" : true, "AZ-SAR" : true, "AZ-SAT" : true, "AZ-SBN" : true,
+ "AZ-SIY" : true, "AZ-SKR" : true, "AZ-SM" : true, "AZ-SMI" : true, "AZ-SMX" : true,
+ "AZ-SR" : true, "AZ-SUS" : true, "AZ-TAR" : true, "AZ-TOV" : true, "AZ-UCA" : true,
+ "AZ-XA" : true, "AZ-XAC" : true, "AZ-XCI" : true, "AZ-XIZ" : true, "AZ-XVD" : true,
+ "AZ-YAR" : true, "AZ-YE" : true, "AZ-YEV" : true, "AZ-ZAN" : true, "AZ-ZAQ" : true,
+ "AZ-ZAR" : true, "BA-01" : true, "BA-02" : true, "BA-03" : true, "BA-04" : true,
+ "BA-05" : true, "BA-06" : true, "BA-07" : true, "BA-08" : true, "BA-09" : true,
+ "BA-10" : true, "BA-BIH" : true, "BA-BRC" : true, "BA-SRP" : true, "BB-01" : true,
+ "BB-02" : true, "BB-03" : true, "BB-04" : true, "BB-05" : true, "BB-06" : true,
+ "BB-07" : true, "BB-08" : true, "BB-09" : true, "BB-10" : true, "BB-11" : true,
+ "BD-01" : true, "BD-02" : true, "BD-03" : true, "BD-04" : true, "BD-05" : true,
+ "BD-06" : true, "BD-07" : true, "BD-08" : true, "BD-09" : true, "BD-10" : true,
+ "BD-11" : true, "BD-12" : true, "BD-13" : true, "BD-14" : true, "BD-15" : true,
+ "BD-16" : true, "BD-17" : true, "BD-18" : true, "BD-19" : true, "BD-20" : true,
+ "BD-21" : true, "BD-22" : true, "BD-23" : true, "BD-24" : true, "BD-25" : true,
+ "BD-26" : true, "BD-27" : true, "BD-28" : true, "BD-29" : true, "BD-30" : true,
+ "BD-31" : true, "BD-32" : true, "BD-33" : true, "BD-34" : true, "BD-35" : true,
+ "BD-36" : true, "BD-37" : true, "BD-38" : true, "BD-39" : true, "BD-40" : true,
+ "BD-41" : true, "BD-42" : true, "BD-43" : true, "BD-44" : true, "BD-45" : true,
+ "BD-46" : true, "BD-47" : true, "BD-48" : true, "BD-49" : true, "BD-50" : true,
+ "BD-51" : true, "BD-52" : true, "BD-53" : true, "BD-54" : true, "BD-55" : true,
+ "BD-56" : true, "BD-57" : true, "BD-58" : true, "BD-59" : true, "BD-60" : true,
+ "BD-61" : true, "BD-62" : true, "BD-63" : true, "BD-64" : true, "BD-A" : true,
+ "BD-B" : true, "BD-C" : true, "BD-D" : true, "BD-E" : true, "BD-F" : true,
+ "BD-G" : true, "BE-BRU" : true, "BE-VAN" : true, "BE-VBR" : true, "BE-VLG" : true,
+ "BE-VLI" : true, "BE-VOV" : true, "BE-VWV" : true, "BE-WAL" : true, "BE-WBR" : true,
+ "BE-WHT" : true, "BE-WLG" : true, "BE-WLX" : true, "BE-WNA" : true, "BF-01" : true,
+ "BF-02" : true, "BF-03" : true, "BF-04" : true, "BF-05" : true, "BF-06" : true,
+ "BF-07" : true, "BF-08" : true, "BF-09" : true, "BF-10" : true, "BF-11" : true,
+ "BF-12" : true, "BF-13" : true, "BF-BAL" : true, "BF-BAM" : true, "BF-BAN" : true,
+ "BF-BAZ" : true, "BF-BGR" : true, "BF-BLG" : true, "BF-BLK" : true, "BF-COM" : true,
+ "BF-GAN" : true, "BF-GNA" : true, "BF-GOU" : true, "BF-HOU" : true, "BF-IOB" : true,
+ "BF-KAD" : true, "BF-KEN" : true, "BF-KMD" : true, "BF-KMP" : true, "BF-KOP" : true,
+ "BF-KOS" : true, "BF-KOT" : true, "BF-KOW" : true, "BF-LER" : true, "BF-LOR" : true,
+ "BF-MOU" : true, "BF-NAM" : true, "BF-NAO" : true, "BF-NAY" : true, "BF-NOU" : true,
+ "BF-OUB" : true, "BF-OUD" : true, "BF-PAS" : true, "BF-PON" : true, "BF-SEN" : true,
+ "BF-SIS" : true, "BF-SMT" : true, "BF-SNG" : true, "BF-SOM" : true, "BF-SOR" : true,
+ "BF-TAP" : true, "BF-TUI" : true, "BF-YAG" : true, "BF-YAT" : true, "BF-ZIR" : true,
+ "BF-ZON" : true, "BF-ZOU" : true, "BG-01" : true, "BG-02" : true, "BG-03" : true,
+ "BG-04" : true, "BG-05" : true, "BG-06" : true, "BG-07" : true, "BG-08" : true,
+ "BG-09" : true, "BG-10" : true, "BG-11" : true, "BG-12" : true, "BG-13" : true,
+ "BG-14" : true, "BG-15" : true, "BG-16" : true, "BG-17" : true, "BG-18" : true,
+ "BG-19" : true, "BG-20" : true, "BG-21" : true, "BG-22" : true, "BG-23" : true,
+ "BG-24" : true, "BG-25" : true, "BG-26" : true, "BG-27" : true, "BG-28" : true,
+ "BH-13" : true, "BH-14" : true, "BH-15" : true, "BH-16" : true, "BH-17" : true,
+ "BI-BB" : true, "BI-BL" : true, "BI-BM" : true, "BI-BR" : true, "BI-CA" : true,
+ "BI-CI" : true, "BI-GI" : true, "BI-KI" : true, "BI-KR" : true, "BI-KY" : true,
+ "BI-MA" : true, "BI-MU" : true, "BI-MW" : true, "BI-NG" : true, "BI-RT" : true,
+ "BI-RY" : true, "BJ-AK" : true, "BJ-AL" : true, "BJ-AQ" : true, "BJ-BO" : true,
+ "BJ-CO" : true, "BJ-DO" : true, "BJ-KO" : true, "BJ-LI" : true, "BJ-MO" : true,
+ "BJ-OU" : true, "BJ-PL" : true, "BJ-ZO" : true, "BN-BE" : true, "BN-BM" : true,
+ "BN-TE" : true, "BN-TU" : true, "BO-B" : true, "BO-C" : true, "BO-H" : true,
+ "BO-L" : true, "BO-N" : true, "BO-O" : true, "BO-P" : true, "BO-S" : true,
+ "BO-T" : true, "BQ-BO" : true, "BQ-SA" : true, "BQ-SE" : true, "BR-AC" : true,
+ "BR-AL" : true, "BR-AM" : true, "BR-AP" : true, "BR-BA" : true, "BR-CE" : true,
+ "BR-DF" : true, "BR-ES" : true, "BR-FN" : true, "BR-GO" : true, "BR-MA" : true,
+ "BR-MG" : true, "BR-MS" : true, "BR-MT" : true, "BR-PA" : true, "BR-PB" : true,
+ "BR-PE" : true, "BR-PI" : true, "BR-PR" : true, "BR-RJ" : true, "BR-RN" : true,
+ "BR-RO" : true, "BR-RR" : true, "BR-RS" : true, "BR-SC" : true, "BR-SE" : true,
+ "BR-SP" : true, "BR-TO" : true, "BS-AK" : true, "BS-BI" : true, "BS-BP" : true,
+ "BS-BY" : true, "BS-CE" : true, "BS-CI" : true, "BS-CK" : true, "BS-CO" : true,
+ "BS-CS" : true, "BS-EG" : true, "BS-EX" : true, "BS-FP" : true, "BS-GC" : true,
+ "BS-HI" : true, "BS-HT" : true, "BS-IN" : true, "BS-LI" : true, "BS-MC" : true,
+ "BS-MG" : true, "BS-MI" : true, "BS-NE" : true, "BS-NO" : true, "BS-NS" : true,
+ "BS-RC" : true, "BS-RI" : true, "BS-SA" : true, "BS-SE" : true, "BS-SO" : true,
+ "BS-SS" : true, "BS-SW" : true, "BS-WG" : true, "BT-11" : true, "BT-12" : true,
+ "BT-13" : true, "BT-14" : true, "BT-15" : true, "BT-21" : true, "BT-22" : true,
+ "BT-23" : true, "BT-24" : true, "BT-31" : true, "BT-32" : true, "BT-33" : true,
+ "BT-34" : true, "BT-41" : true, "BT-42" : true, "BT-43" : true, "BT-44" : true,
+ "BT-45" : true, "BT-GA" : true, "BT-TY" : true, "BW-CE" : true, "BW-GH" : true,
+ "BW-KG" : true, "BW-KL" : true, "BW-KW" : true, "BW-NE" : true, "BW-NW" : true,
+ "BW-SE" : true, "BW-SO" : true, "BY-BR" : true, "BY-HM" : true, "BY-HO" : true,
+ "BY-HR" : true, "BY-MA" : true, "BY-MI" : true, "BY-VI" : true, "BZ-BZ" : true,
+ "BZ-CY" : true, "BZ-CZL" : true, "BZ-OW" : true, "BZ-SC" : true, "BZ-TOL" : true,
+ "CA-AB" : true, "CA-BC" : true, "CA-MB" : true, "CA-NB" : true, "CA-NL" : true,
+ "CA-NS" : true, "CA-NT" : true, "CA-NU" : true, "CA-ON" : true, "CA-PE" : true,
+ "CA-QC" : true, "CA-SK" : true, "CA-YT" : true, "CD-BC" : true, "CD-BN" : true,
+ "CD-EQ" : true, "CD-KA" : true, "CD-KE" : true, "CD-KN" : true, "CD-KW" : true,
+ "CD-MA" : true, "CD-NK" : true, "CD-OR" : true, "CD-SK" : true, "CF-AC" : true,
+ "CF-BB" : true, "CF-BGF" : true, "CF-BK" : true, "CF-HK" : true, "CF-HM" : true,
+ "CF-HS" : true, "CF-KB" : true, "CF-KG" : true, "CF-LB" : true, "CF-MB" : true,
+ "CF-MP" : true, "CF-NM" : true, "CF-OP" : true, "CF-SE" : true, "CF-UK" : true,
+ "CF-VK" : true, "CG-11" : true, "CG-12" : true, "CG-13" : true, "CG-14" : true,
+ "CG-15" : true, "CG-2" : true, "CG-5" : true, "CG-7" : true, "CG-8" : true,
+ "CG-9" : true, "CG-BZV" : true, "CH-AG" : true, "CH-AI" : true, "CH-AR" : true,
+ "CH-BE" : true, "CH-BL" : true, "CH-BS" : true, "CH-FR" : true, "CH-GE" : true,
+ "CH-GL" : true, "CH-GR" : true, "CH-JU" : true, "CH-LU" : true, "CH-NE" : true,
+ "CH-NW" : true, "CH-OW" : true, "CH-SG" : true, "CH-SH" : true, "CH-SO" : true,
+ "CH-SZ" : true, "CH-TG" : true, "CH-TI" : true, "CH-UR" : true, "CH-VD" : true,
+ "CH-VS" : true, "CH-ZG" : true, "CH-ZH" : true, "CI-01" : true, "CI-02" : true,
+ "CI-03" : true, "CI-04" : true, "CI-05" : true, "CI-06" : true, "CI-07" : true,
+ "CI-08" : true, "CI-09" : true, "CI-10" : true, "CI-11" : true, "CI-12" : true,
+ "CI-13" : true, "CI-14" : true, "CI-15" : true, "CI-16" : true, "CI-17" : true,
+ "CI-18" : true, "CI-19" : true, "CL-AI" : true, "CL-AN" : true, "CL-AP" : true,
+ "CL-AR" : true, "CL-AT" : true, "CL-BI" : true, "CL-CO" : true, "CL-LI" : true,
+ "CL-LL" : true, "CL-LR" : true, "CL-MA" : true, "CL-ML" : true, "CL-RM" : true,
+ "CL-TA" : true, "CL-VS" : true, "CM-AD" : true, "CM-CE" : true, "CM-EN" : true,
+ "CM-ES" : true, "CM-LT" : true, "CM-NO" : true, "CM-NW" : true, "CM-OU" : true,
+ "CM-SU" : true, "CM-SW" : true, "CN-11" : true, "CN-12" : true, "CN-13" : true,
+ "CN-14" : true, "CN-15" : true, "CN-21" : true, "CN-22" : true, "CN-23" : true,
+ "CN-31" : true, "CN-32" : true, "CN-33" : true, "CN-34" : true, "CN-35" : true,
+ "CN-36" : true, "CN-37" : true, "CN-41" : true, "CN-42" : true, "CN-43" : true,
+ "CN-44" : true, "CN-45" : true, "CN-46" : true, "CN-50" : true, "CN-51" : true,
+ "CN-52" : true, "CN-53" : true, "CN-54" : true, "CN-61" : true, "CN-62" : true,
+ "CN-63" : true, "CN-64" : true, "CN-65" : true, "CN-71" : true, "CN-91" : true,
+ "CN-92" : true, "CO-AMA" : true, "CO-ANT" : true, "CO-ARA" : true, "CO-ATL" : true,
+ "CO-BOL" : true, "CO-BOY" : true, "CO-CAL" : true, "CO-CAQ" : true, "CO-CAS" : true,
+ "CO-CAU" : true, "CO-CES" : true, "CO-CHO" : true, "CO-COR" : true, "CO-CUN" : true,
+ "CO-DC" : true, "CO-GUA" : true, "CO-GUV" : true, "CO-HUI" : true, "CO-LAG" : true,
+ "CO-MAG" : true, "CO-MET" : true, "CO-NAR" : true, "CO-NSA" : true, "CO-PUT" : true,
+ "CO-QUI" : true, "CO-RIS" : true, "CO-SAN" : true, "CO-SAP" : true, "CO-SUC" : true,
+ "CO-TOL" : true, "CO-VAC" : true, "CO-VAU" : true, "CO-VID" : true, "CR-A" : true,
+ "CR-C" : true, "CR-G" : true, "CR-H" : true, "CR-L" : true, "CR-P" : true,
+ "CR-SJ" : true, "CU-01" : true, "CU-02" : true, "CU-03" : true, "CU-04" : true,
+ "CU-05" : true, "CU-06" : true, "CU-07" : true, "CU-08" : true, "CU-09" : true,
+ "CU-10" : true, "CU-11" : true, "CU-12" : true, "CU-13" : true, "CU-14" : true,
+ "CU-99" : true, "CV-B" : true, "CV-BR" : true, "CV-BV" : true, "CV-CA" : true,
+ "CV-CF" : true, "CV-CR" : true, "CV-MA" : true, "CV-MO" : true, "CV-PA" : true,
+ "CV-PN" : true, "CV-PR" : true, "CV-RB" : true, "CV-RG" : true, "CV-RS" : true,
+ "CV-S" : true, "CV-SD" : true, "CV-SF" : true, "CV-SL" : true, "CV-SM" : true,
+ "CV-SO" : true, "CV-SS" : true, "CV-SV" : true, "CV-TA" : true, "CV-TS" : true,
+ "CY-01" : true, "CY-02" : true, "CY-03" : true, "CY-04" : true, "CY-05" : true,
+ "CY-06" : true, "CZ-10" : true, "CZ-101" : true, "CZ-102" : true, "CZ-103" : true,
+ "CZ-104" : true, "CZ-105" : true, "CZ-106" : true, "CZ-107" : true, "CZ-108" : true,
+ "CZ-109" : true, "CZ-110" : true, "CZ-111" : true, "CZ-112" : true, "CZ-113" : true,
+ "CZ-114" : true, "CZ-115" : true, "CZ-116" : true, "CZ-117" : true, "CZ-118" : true,
+ "CZ-119" : true, "CZ-120" : true, "CZ-121" : true, "CZ-122" : true, "CZ-20" : true,
+ "CZ-201" : true, "CZ-202" : true, "CZ-203" : true, "CZ-204" : true, "CZ-205" : true,
+ "CZ-206" : true, "CZ-207" : true, "CZ-208" : true, "CZ-209" : true, "CZ-20A" : true,
+ "CZ-20B" : true, "CZ-20C" : true, "CZ-31" : true, "CZ-311" : true, "CZ-312" : true,
+ "CZ-313" : true, "CZ-314" : true, "CZ-315" : true, "CZ-316" : true, "CZ-317" : true,
+ "CZ-32" : true, "CZ-321" : true, "CZ-322" : true, "CZ-323" : true, "CZ-324" : true,
+ "CZ-325" : true, "CZ-326" : true, "CZ-327" : true, "CZ-41" : true, "CZ-411" : true,
+ "CZ-412" : true, "CZ-413" : true, "CZ-42" : true, "CZ-421" : true, "CZ-422" : true,
+ "CZ-423" : true, "CZ-424" : true, "CZ-425" : true, "CZ-426" : true, "CZ-427" : true,
+ "CZ-51" : true, "CZ-511" : true, "CZ-512" : true, "CZ-513" : true, "CZ-514" : true,
+ "CZ-52" : true, "CZ-521" : true, "CZ-522" : true, "CZ-523" : true, "CZ-524" : true,
+ "CZ-525" : true, "CZ-53" : true, "CZ-531" : true, "CZ-532" : true, "CZ-533" : true,
+ "CZ-534" : true, "CZ-63" : true, "CZ-631" : true, "CZ-632" : true, "CZ-633" : true,
+ "CZ-634" : true, "CZ-635" : true, "CZ-64" : true, "CZ-641" : true, "CZ-642" : true,
+ "CZ-643" : true, "CZ-644" : true, "CZ-645" : true, "CZ-646" : true, "CZ-647" : true,
+ "CZ-71" : true, "CZ-711" : true, "CZ-712" : true, "CZ-713" : true, "CZ-714" : true,
+ "CZ-715" : true, "CZ-72" : true, "CZ-721" : true, "CZ-722" : true, "CZ-723" : true,
+ "CZ-724" : true, "CZ-80" : true, "CZ-801" : true, "CZ-802" : true, "CZ-803" : true,
+ "CZ-804" : true, "CZ-805" : true, "CZ-806" : true, "DE-BB" : true, "DE-BE" : true,
+ "DE-BW" : true, "DE-BY" : true, "DE-HB" : true, "DE-HE" : true, "DE-HH" : true,
+ "DE-MV" : true, "DE-NI" : true, "DE-NW" : true, "DE-RP" : true, "DE-SH" : true,
+ "DE-SL" : true, "DE-SN" : true, "DE-ST" : true, "DE-TH" : true, "DJ-AR" : true,
+ "DJ-AS" : true, "DJ-DI" : true, "DJ-DJ" : true, "DJ-OB" : true, "DJ-TA" : true,
+ "DK-81" : true, "DK-82" : true, "DK-83" : true, "DK-84" : true, "DK-85" : true,
+ "DM-01" : true, "DM-02" : true, "DM-03" : true, "DM-04" : true, "DM-05" : true,
+ "DM-06" : true, "DM-07" : true, "DM-08" : true, "DM-09" : true, "DM-10" : true,
+ "DO-01" : true, "DO-02" : true, "DO-03" : true, "DO-04" : true, "DO-05" : true,
+ "DO-06" : true, "DO-07" : true, "DO-08" : true, "DO-09" : true, "DO-10" : true,
+ "DO-11" : true, "DO-12" : true, "DO-13" : true, "DO-14" : true, "DO-15" : true,
+ "DO-16" : true, "DO-17" : true, "DO-18" : true, "DO-19" : true, "DO-20" : true,
+ "DO-21" : true, "DO-22" : true, "DO-23" : true, "DO-24" : true, "DO-25" : true,
+ "DO-26" : true, "DO-27" : true, "DO-28" : true, "DO-29" : true, "DO-30" : true,
+ "DZ-01" : true, "DZ-02" : true, "DZ-03" : true, "DZ-04" : true, "DZ-05" : true,
+ "DZ-06" : true, "DZ-07" : true, "DZ-08" : true, "DZ-09" : true, "DZ-10" : true,
+ "DZ-11" : true, "DZ-12" : true, "DZ-13" : true, "DZ-14" : true, "DZ-15" : true,
+ "DZ-16" : true, "DZ-17" : true, "DZ-18" : true, "DZ-19" : true, "DZ-20" : true,
+ "DZ-21" : true, "DZ-22" : true, "DZ-23" : true, "DZ-24" : true, "DZ-25" : true,
+ "DZ-26" : true, "DZ-27" : true, "DZ-28" : true, "DZ-29" : true, "DZ-30" : true,
+ "DZ-31" : true, "DZ-32" : true, "DZ-33" : true, "DZ-34" : true, "DZ-35" : true,
+ "DZ-36" : true, "DZ-37" : true, "DZ-38" : true, "DZ-39" : true, "DZ-40" : true,
+ "DZ-41" : true, "DZ-42" : true, "DZ-43" : true, "DZ-44" : true, "DZ-45" : true,
+ "DZ-46" : true, "DZ-47" : true, "DZ-48" : true, "EC-A" : true, "EC-B" : true,
+ "EC-C" : true, "EC-D" : true, "EC-E" : true, "EC-F" : true, "EC-G" : true,
+ "EC-H" : true, "EC-I" : true, "EC-L" : true, "EC-M" : true, "EC-N" : true,
+ "EC-O" : true, "EC-P" : true, "EC-R" : true, "EC-S" : true, "EC-SD" : true,
+ "EC-SE" : true, "EC-T" : true, "EC-U" : true, "EC-W" : true, "EC-X" : true,
+ "EC-Y" : true, "EC-Z" : true, "EE-37" : true, "EE-39" : true, "EE-44" : true,
+ "EE-49" : true, "EE-51" : true, "EE-57" : true, "EE-59" : true, "EE-65" : true,
+ "EE-67" : true, "EE-70" : true, "EE-74" : true, "EE-78" : true, "EE-82" : true,
+ "EE-84" : true, "EE-86" : true, "EG-ALX" : true, "EG-ASN" : true, "EG-AST" : true,
+ "EG-BA" : true, "EG-BH" : true, "EG-BNS" : true, "EG-C" : true, "EG-DK" : true,
+ "EG-DT" : true, "EG-FYM" : true, "EG-GH" : true, "EG-GZ" : true, "EG-HU" : true,
+ "EG-IS" : true, "EG-JS" : true, "EG-KB" : true, "EG-KFS" : true, "EG-KN" : true,
+ "EG-MN" : true, "EG-MNF" : true, "EG-MT" : true, "EG-PTS" : true, "EG-SHG" : true,
+ "EG-SHR" : true, "EG-SIN" : true, "EG-SU" : true, "EG-SUZ" : true, "EG-WAD" : true,
+ "ER-AN" : true, "ER-DK" : true, "ER-DU" : true, "ER-GB" : true, "ER-MA" : true,
+ "ER-SK" : true, "ES-A" : true, "ES-AB" : true, "ES-AL" : true, "ES-AN" : true,
+ "ES-AR" : true, "ES-AS" : true, "ES-AV" : true, "ES-B" : true, "ES-BA" : true,
+ "ES-BI" : true, "ES-BU" : true, "ES-C" : true, "ES-CA" : true, "ES-CB" : true,
+ "ES-CC" : true, "ES-CE" : true, "ES-CL" : true, "ES-CM" : true, "ES-CN" : true,
+ "ES-CO" : true, "ES-CR" : true, "ES-CS" : true, "ES-CT" : true, "ES-CU" : true,
+ "ES-EX" : true, "ES-GA" : true, "ES-GC" : true, "ES-GI" : true, "ES-GR" : true,
+ "ES-GU" : true, "ES-H" : true, "ES-HU" : true, "ES-IB" : true, "ES-J" : true,
+ "ES-L" : true, "ES-LE" : true, "ES-LO" : true, "ES-LU" : true, "ES-M" : true,
+ "ES-MA" : true, "ES-MC" : true, "ES-MD" : true, "ES-ML" : true, "ES-MU" : true,
+ "ES-NA" : true, "ES-NC" : true, "ES-O" : true, "ES-OR" : true, "ES-P" : true,
+ "ES-PM" : true, "ES-PO" : true, "ES-PV" : true, "ES-RI" : true, "ES-S" : true,
+ "ES-SA" : true, "ES-SE" : true, "ES-SG" : true, "ES-SO" : true, "ES-SS" : true,
+ "ES-T" : true, "ES-TE" : true, "ES-TF" : true, "ES-TO" : true, "ES-V" : true,
+ "ES-VA" : true, "ES-VC" : true, "ES-VI" : true, "ES-Z" : true, "ES-ZA" : true,
+ "ET-AA" : true, "ET-AF" : true, "ET-AM" : true, "ET-BE" : true, "ET-DD" : true,
+ "ET-GA" : true, "ET-HA" : true, "ET-OR" : true, "ET-SN" : true, "ET-SO" : true,
+ "ET-TI" : true, "FI-01" : true, "FI-02" : true, "FI-03" : true, "FI-04" : true,
+ "FI-05" : true, "FI-06" : true, "FI-07" : true, "FI-08" : true, "FI-09" : true,
+ "FI-10" : true, "FI-11" : true, "FI-12" : true, "FI-13" : true, "FI-14" : true,
+ "FI-15" : true, "FI-16" : true, "FI-17" : true, "FI-18" : true, "FI-19" : true,
+ "FJ-C" : true, "FJ-E" : true, "FJ-N" : true, "FJ-R" : true, "FJ-W" : true,
+ "FM-KSA" : true, "FM-PNI" : true, "FM-TRK" : true, "FM-YAP" : true, "FR-01" : true,
+ "FR-02" : true, "FR-03" : true, "FR-04" : true, "FR-05" : true, "FR-06" : true,
+ "FR-07" : true, "FR-08" : true, "FR-09" : true, "FR-10" : true, "FR-11" : true,
+ "FR-12" : true, "FR-13" : true, "FR-14" : true, "FR-15" : true, "FR-16" : true,
+ "FR-17" : true, "FR-18" : true, "FR-19" : true, "FR-21" : true, "FR-22" : true,
+ "FR-23" : true, "FR-24" : true, "FR-25" : true, "FR-26" : true, "FR-27" : true,
+ "FR-28" : true, "FR-29" : true, "FR-2A" : true, "FR-2B" : true, "FR-30" : true,
+ "FR-31" : true, "FR-32" : true, "FR-33" : true, "FR-34" : true, "FR-35" : true,
+ "FR-36" : true, "FR-37" : true, "FR-38" : true, "FR-39" : true, "FR-40" : true,
+ "FR-41" : true, "FR-42" : true, "FR-43" : true, "FR-44" : true, "FR-45" : true,
+ "FR-46" : true, "FR-47" : true, "FR-48" : true, "FR-49" : true, "FR-50" : true,
+ "FR-51" : true, "FR-52" : true, "FR-53" : true, "FR-54" : true, "FR-55" : true,
+ "FR-56" : true, "FR-57" : true, "FR-58" : true, "FR-59" : true, "FR-60" : true,
+ "FR-61" : true, "FR-62" : true, "FR-63" : true, "FR-64" : true, "FR-65" : true,
+ "FR-66" : true, "FR-67" : true, "FR-68" : true, "FR-69" : true, "FR-70" : true,
+ "FR-71" : true, "FR-72" : true, "FR-73" : true, "FR-74" : true, "FR-75" : true,
+ "FR-76" : true, "FR-77" : true, "FR-78" : true, "FR-79" : true, "FR-80" : true,
+ "FR-81" : true, "FR-82" : true, "FR-83" : true, "FR-84" : true, "FR-85" : true,
+ "FR-86" : true, "FR-87" : true, "FR-88" : true, "FR-89" : true, "FR-90" : true,
+ "FR-91" : true, "FR-92" : true, "FR-93" : true, "FR-94" : true, "FR-95" : true,
+ "FR-ARA" : true, "FR-BFC" : true, "FR-BL" : true, "FR-BRE" : true, "FR-COR" : true,
+ "FR-CP" : true, "FR-CVL" : true, "FR-GES" : true, "FR-GF" : true, "FR-GP" : true,
+ "FR-GUA" : true, "FR-HDF" : true, "FR-IDF" : true, "FR-LRE" : true, "FR-MAY" : true,
+ "FR-MF" : true, "FR-MQ" : true, "FR-NAQ" : true, "FR-NC" : true, "FR-NOR" : true,
+ "FR-OCC" : true, "FR-PAC" : true, "FR-PDL" : true, "FR-PF" : true, "FR-PM" : true,
+ "FR-RE" : true, "FR-TF" : true, "FR-WF" : true, "FR-YT" : true, "GA-1" : true,
+ "GA-2" : true, "GA-3" : true, "GA-4" : true, "GA-5" : true, "GA-6" : true,
+ "GA-7" : true, "GA-8" : true, "GA-9" : true, "GB-ABC" : true, "GB-ABD" : true,
+ "GB-ABE" : true, "GB-AGB" : true, "GB-AGY" : true, "GB-AND" : true, "GB-ANN" : true,
+ "GB-ANS" : true, "GB-BAS" : true, "GB-BBD" : true, "GB-BDF" : true, "GB-BDG" : true,
+ "GB-BEN" : true, "GB-BEX" : true, "GB-BFS" : true, "GB-BGE" : true, "GB-BGW" : true,
+ "GB-BIR" : true, "GB-BKM" : true, "GB-BMH" : true, "GB-BNE" : true, "GB-BNH" : true,
+ "GB-BNS" : true, "GB-BOL" : true, "GB-BPL" : true, "GB-BRC" : true, "GB-BRD" : true,
+ "GB-BRY" : true, "GB-BST" : true, "GB-BUR" : true, "GB-CAM" : true, "GB-CAY" : true,
+ "GB-CBF" : true, "GB-CCG" : true, "GB-CGN" : true, "GB-CHE" : true, "GB-CHW" : true,
+ "GB-CLD" : true, "GB-CLK" : true, "GB-CMA" : true, "GB-CMD" : true, "GB-CMN" : true,
+ "GB-CON" : true, "GB-COV" : true, "GB-CRF" : true, "GB-CRY" : true, "GB-CWY" : true,
+ "GB-DAL" : true, "GB-DBY" : true, "GB-DEN" : true, "GB-DER" : true, "GB-DEV" : true,
+ "GB-DGY" : true, "GB-DNC" : true, "GB-DND" : true, "GB-DOR" : true, "GB-DRS" : true,
+ "GB-DUD" : true, "GB-DUR" : true, "GB-EAL" : true, "GB-EAW" : true, "GB-EAY" : true,
+ "GB-EDH" : true, "GB-EDU" : true, "GB-ELN" : true, "GB-ELS" : true, "GB-ENF" : true,
+ "GB-ENG" : true, "GB-ERW" : true, "GB-ERY" : true, "GB-ESS" : true, "GB-ESX" : true,
+ "GB-FAL" : true, "GB-FIF" : true, "GB-FLN" : true, "GB-FMO" : true, "GB-GAT" : true,
+ "GB-GBN" : true, "GB-GLG" : true, "GB-GLS" : true, "GB-GRE" : true, "GB-GWN" : true,
+ "GB-HAL" : true, "GB-HAM" : true, "GB-HAV" : true, "GB-HCK" : true, "GB-HEF" : true,
+ "GB-HIL" : true, "GB-HLD" : true, "GB-HMF" : true, "GB-HNS" : true, "GB-HPL" : true,
+ "GB-HRT" : true, "GB-HRW" : true, "GB-HRY" : true, "GB-IOS" : true, "GB-IOW" : true,
+ "GB-ISL" : true, "GB-IVC" : true, "GB-KEC" : true, "GB-KEN" : true, "GB-KHL" : true,
+ "GB-KIR" : true, "GB-KTT" : true, "GB-KWL" : true, "GB-LAN" : true, "GB-LBC" : true,
+ "GB-LBH" : true, "GB-LCE" : true, "GB-LDS" : true, "GB-LEC" : true, "GB-LEW" : true,
+ "GB-LIN" : true, "GB-LIV" : true, "GB-LND" : true, "GB-LUT" : true, "GB-MAN" : true,
+ "GB-MDB" : true, "GB-MDW" : true, "GB-MEA" : true, "GB-MIK" : true, "GD-01" : true,
+ "GB-MLN" : true, "GB-MON" : true, "GB-MRT" : true, "GB-MRY" : true, "GB-MTY" : true,
+ "GB-MUL" : true, "GB-NAY" : true, "GB-NBL" : true, "GB-NEL" : true, "GB-NET" : true,
+ "GB-NFK" : true, "GB-NGM" : true, "GB-NIR" : true, "GB-NLK" : true, "GB-NLN" : true,
+ "GB-NMD" : true, "GB-NSM" : true, "GB-NTH" : true, "GB-NTL" : true, "GB-NTT" : true,
+ "GB-NTY" : true, "GB-NWM" : true, "GB-NWP" : true, "GB-NYK" : true, "GB-OLD" : true,
+ "GB-ORK" : true, "GB-OXF" : true, "GB-PEM" : true, "GB-PKN" : true, "GB-PLY" : true,
+ "GB-POL" : true, "GB-POR" : true, "GB-POW" : true, "GB-PTE" : true, "GB-RCC" : true,
+ "GB-RCH" : true, "GB-RCT" : true, "GB-RDB" : true, "GB-RDG" : true, "GB-RFW" : true,
+ "GB-RIC" : true, "GB-ROT" : true, "GB-RUT" : true, "GB-SAW" : true, "GB-SAY" : true,
+ "GB-SCB" : true, "GB-SCT" : true, "GB-SFK" : true, "GB-SFT" : true, "GB-SGC" : true,
+ "GB-SHF" : true, "GB-SHN" : true, "GB-SHR" : true, "GB-SKP" : true, "GB-SLF" : true,
+ "GB-SLG" : true, "GB-SLK" : true, "GB-SND" : true, "GB-SOL" : true, "GB-SOM" : true,
+ "GB-SOS" : true, "GB-SRY" : true, "GB-STE" : true, "GB-STG" : true, "GB-STH" : true,
+ "GB-STN" : true, "GB-STS" : true, "GB-STT" : true, "GB-STY" : true, "GB-SWA" : true,
+ "GB-SWD" : true, "GB-SWK" : true, "GB-TAM" : true, "GB-TFW" : true, "GB-THR" : true,
+ "GB-TOB" : true, "GB-TOF" : true, "GB-TRF" : true, "GB-TWH" : true, "GB-UKM" : true,
+ "GB-VGL" : true, "GB-WAR" : true, "GB-WBK" : true, "GB-WDU" : true, "GB-WFT" : true,
+ "GB-WGN" : true, "GB-WIL" : true, "GB-WKF" : true, "GB-WLL" : true, "GB-WLN" : true,
+ "GB-WLS" : true, "GB-WLV" : true, "GB-WND" : true, "GB-WNM" : true, "GB-WOK" : true,
+ "GB-WOR" : true, "GB-WRL" : true, "GB-WRT" : true, "GB-WRX" : true, "GB-WSM" : true,
+ "GB-WSX" : true, "GB-YOR" : true, "GB-ZET" : true, "GD-02" : true, "GD-03" : true,
+ "GD-04" : true, "GD-05" : true, "GD-06" : true, "GD-10" : true, "GE-AB" : true,
+ "GE-AJ" : true, "GE-GU" : true, "GE-IM" : true, "GE-KA" : true, "GE-KK" : true,
+ "GE-MM" : true, "GE-RL" : true, "GE-SJ" : true, "GE-SK" : true, "GE-SZ" : true,
+ "GE-TB" : true, "GH-AA" : true, "GH-AH" : true, "GH-BA" : true, "GH-CP" : true,
+ "GH-EP" : true, "GH-NP" : true, "GH-TV" : true, "GH-UE" : true, "GH-UW" : true,
+ "GH-WP" : true, "GL-KU" : true, "GL-QA" : true, "GL-QE" : true, "GL-SM" : true,
+ "GM-B" : true, "GM-L" : true, "GM-M" : true, "GM-N" : true, "GM-U" : true,
+ "GM-W" : true, "GN-B" : true, "GN-BE" : true, "GN-BF" : true, "GN-BK" : true,
+ "GN-C" : true, "GN-CO" : true, "GN-D" : true, "GN-DB" : true, "GN-DI" : true,
+ "GN-DL" : true, "GN-DU" : true, "GN-F" : true, "GN-FA" : true, "GN-FO" : true,
+ "GN-FR" : true, "GN-GA" : true, "GN-GU" : true, "GN-K" : true, "GN-KA" : true,
+ "GN-KB" : true, "GN-KD" : true, "GN-KE" : true, "GN-KN" : true, "GN-KO" : true,
+ "GN-KS" : true, "GN-L" : true, "GN-LA" : true, "GN-LE" : true, "GN-LO" : true,
+ "GN-M" : true, "GN-MC" : true, "GN-MD" : true, "GN-ML" : true, "GN-MM" : true,
+ "GN-N" : true, "GN-NZ" : true, "GN-PI" : true, "GN-SI" : true, "GN-TE" : true,
+ "GN-TO" : true, "GN-YO" : true, "GQ-AN" : true, "GQ-BN" : true, "GQ-BS" : true,
+ "GQ-C" : true, "GQ-CS" : true, "GQ-I" : true, "GQ-KN" : true, "GQ-LI" : true,
+ "GQ-WN" : true, "GR-01" : true, "GR-03" : true, "GR-04" : true, "GR-05" : true,
+ "GR-06" : true, "GR-07" : true, "GR-11" : true, "GR-12" : true, "GR-13" : true,
+ "GR-14" : true, "GR-15" : true, "GR-16" : true, "GR-17" : true, "GR-21" : true,
+ "GR-22" : true, "GR-23" : true, "GR-24" : true, "GR-31" : true, "GR-32" : true,
+ "GR-33" : true, "GR-34" : true, "GR-41" : true, "GR-42" : true, "GR-43" : true,
+ "GR-44" : true, "GR-51" : true, "GR-52" : true, "GR-53" : true, "GR-54" : true,
+ "GR-55" : true, "GR-56" : true, "GR-57" : true, "GR-58" : true, "GR-59" : true,
+ "GR-61" : true, "GR-62" : true, "GR-63" : true, "GR-64" : true, "GR-69" : true,
+ "GR-71" : true, "GR-72" : true, "GR-73" : true, "GR-81" : true, "GR-82" : true,
+ "GR-83" : true, "GR-84" : true, "GR-85" : true, "GR-91" : true, "GR-92" : true,
+ "GR-93" : true, "GR-94" : true, "GR-A" : true, "GR-A1" : true, "GR-B" : true,
+ "GR-C" : true, "GR-D" : true, "GR-E" : true, "GR-F" : true, "GR-G" : true,
+ "GR-H" : true, "GR-I" : true, "GR-J" : true, "GR-K" : true, "GR-L" : true,
+ "GR-M" : true, "GT-AV" : true, "GT-BV" : true, "GT-CM" : true, "GT-CQ" : true,
+ "GT-ES" : true, "GT-GU" : true, "GT-HU" : true, "GT-IZ" : true, "GT-JA" : true,
+ "GT-JU" : true, "GT-PE" : true, "GT-PR" : true, "GT-QC" : true, "GT-QZ" : true,
+ "GT-RE" : true, "GT-SA" : true, "GT-SM" : true, "GT-SO" : true, "GT-SR" : true,
+ "GT-SU" : true, "GT-TO" : true, "GT-ZA" : true, "GW-BA" : true, "GW-BL" : true,
+ "GW-BM" : true, "GW-BS" : true, "GW-CA" : true, "GW-GA" : true, "GW-L" : true,
+ "GW-N" : true, "GW-OI" : true, "GW-QU" : true, "GW-S" : true, "GW-TO" : true,
+ "GY-BA" : true, "GY-CU" : true, "GY-DE" : true, "GY-EB" : true, "GY-ES" : true,
+ "GY-MA" : true, "GY-PM" : true, "GY-PT" : true, "GY-UD" : true, "GY-UT" : true,
+ "HN-AT" : true, "HN-CH" : true, "HN-CL" : true, "HN-CM" : true, "HN-CP" : true,
+ "HN-CR" : true, "HN-EP" : true, "HN-FM" : true, "HN-GD" : true, "HN-IB" : true,
+ "HN-IN" : true, "HN-LE" : true, "HN-LP" : true, "HN-OC" : true, "HN-OL" : true,
+ "HN-SB" : true, "HN-VA" : true, "HN-YO" : true, "HR-01" : true, "HR-02" : true,
+ "HR-03" : true, "HR-04" : true, "HR-05" : true, "HR-06" : true, "HR-07" : true,
+ "HR-08" : true, "HR-09" : true, "HR-10" : true, "HR-11" : true, "HR-12" : true,
+ "HR-13" : true, "HR-14" : true, "HR-15" : true, "HR-16" : true, "HR-17" : true,
+ "HR-18" : true, "HR-19" : true, "HR-20" : true, "HR-21" : true, "HT-AR" : true,
+ "HT-CE" : true, "HT-GA" : true, "HT-ND" : true, "HT-NE" : true, "HT-NO" : true,
+ "HT-OU" : true, "HT-SD" : true, "HT-SE" : true, "HU-BA" : true, "HU-BC" : true,
+ "HU-BE" : true, "HU-BK" : true, "HU-BU" : true, "HU-BZ" : true, "HU-CS" : true,
+ "HU-DE" : true, "HU-DU" : true, "HU-EG" : true, "HU-ER" : true, "HU-FE" : true,
+ "HU-GS" : true, "HU-GY" : true, "HU-HB" : true, "HU-HE" : true, "HU-HV" : true,
+ "HU-JN" : true, "HU-KE" : true, "HU-KM" : true, "HU-KV" : true, "HU-MI" : true,
+ "HU-NK" : true, "HU-NO" : true, "HU-NY" : true, "HU-PE" : true, "HU-PS" : true,
+ "HU-SD" : true, "HU-SF" : true, "HU-SH" : true, "HU-SK" : true, "HU-SN" : true,
+ "HU-SO" : true, "HU-SS" : true, "HU-ST" : true, "HU-SZ" : true, "HU-TB" : true,
+ "HU-TO" : true, "HU-VA" : true, "HU-VE" : true, "HU-VM" : true, "HU-ZA" : true,
+ "HU-ZE" : true, "ID-AC" : true, "ID-BA" : true, "ID-BB" : true, "ID-BE" : true,
+ "ID-BT" : true, "ID-GO" : true, "ID-IJ" : true, "ID-JA" : true, "ID-JB" : true,
+ "ID-JI" : true, "ID-JK" : true, "ID-JT" : true, "ID-JW" : true, "ID-KA" : true,
+ "ID-KB" : true, "ID-KI" : true, "ID-KR" : true, "ID-KS" : true, "ID-KT" : true,
+ "ID-LA" : true, "ID-MA" : true, "ID-ML" : true, "ID-MU" : true, "ID-NB" : true,
+ "ID-NT" : true, "ID-NU" : true, "ID-PA" : true, "ID-PB" : true, "ID-RI" : true,
+ "ID-SA" : true, "ID-SB" : true, "ID-SG" : true, "ID-SL" : true, "ID-SM" : true,
+ "ID-SN" : true, "ID-SR" : true, "ID-SS" : true, "ID-ST" : true, "ID-SU" : true,
+ "ID-YO" : true, "IE-C" : true, "IE-CE" : true, "IE-CN" : true, "IE-CO" : true,
+ "IE-CW" : true, "IE-D" : true, "IE-DL" : true, "IE-G" : true, "IE-KE" : true,
+ "IE-KK" : true, "IE-KY" : true, "IE-L" : true, "IE-LD" : true, "IE-LH" : true,
+ "IE-LK" : true, "IE-LM" : true, "IE-LS" : true, "IE-M" : true, "IE-MH" : true,
+ "IE-MN" : true, "IE-MO" : true, "IE-OY" : true, "IE-RN" : true, "IE-SO" : true,
+ "IE-TA" : true, "IE-U" : true, "IE-WD" : true, "IE-WH" : true, "IE-WW" : true,
+ "IE-WX" : true, "IL-D" : true, "IL-HA" : true, "IL-JM" : true, "IL-M" : true,
+ "IL-TA" : true, "IL-Z" : true, "IN-AN" : true, "IN-AP" : true, "IN-AR" : true,
+ "IN-AS" : true, "IN-BR" : true, "IN-CH" : true, "IN-CT" : true, "IN-DD" : true,
+ "IN-DL" : true, "IN-DN" : true, "IN-GA" : true, "IN-GJ" : true, "IN-HP" : true,
+ "IN-HR" : true, "IN-JH" : true, "IN-JK" : true, "IN-KA" : true, "IN-KL" : true,
+ "IN-LD" : true, "IN-MH" : true, "IN-ML" : true, "IN-MN" : true, "IN-MP" : true,
+ "IN-MZ" : true, "IN-NL" : true, "IN-OR" : true, "IN-PB" : true, "IN-PY" : true,
+ "IN-RJ" : true, "IN-SK" : true, "IN-TN" : true, "IN-TR" : true, "IN-UP" : true,
+ "IN-UT" : true, "IN-WB" : true, "IQ-AN" : true, "IQ-AR" : true, "IQ-BA" : true,
+ "IQ-BB" : true, "IQ-BG" : true, "IQ-DA" : true, "IQ-DI" : true, "IQ-DQ" : true,
+ "IQ-KA" : true, "IQ-MA" : true, "IQ-MU" : true, "IQ-NA" : true, "IQ-NI" : true,
+ "IQ-QA" : true, "IQ-SD" : true, "IQ-SW" : true, "IQ-TS" : true, "IQ-WA" : true,
+ "IR-01" : true, "IR-02" : true, "IR-03" : true, "IR-04" : true, "IR-05" : true,
+ "IR-06" : true, "IR-07" : true, "IR-08" : true, "IR-10" : true, "IR-11" : true,
+ "IR-12" : true, "IR-13" : true, "IR-14" : true, "IR-15" : true, "IR-16" : true,
+ "IR-17" : true, "IR-18" : true, "IR-19" : true, "IR-20" : true, "IR-21" : true,
+ "IR-22" : true, "IR-23" : true, "IR-24" : true, "IR-25" : true, "IR-26" : true,
+ "IR-27" : true, "IR-28" : true, "IR-29" : true, "IR-30" : true, "IR-31" : true,
+ "IS-0" : true, "IS-1" : true, "IS-2" : true, "IS-3" : true, "IS-4" : true,
+ "IS-5" : true, "IS-6" : true, "IS-7" : true, "IS-8" : true, "IT-21" : true,
+ "IT-23" : true, "IT-25" : true, "IT-32" : true, "IT-34" : true, "IT-36" : true,
+ "IT-42" : true, "IT-45" : true, "IT-52" : true, "IT-55" : true, "IT-57" : true,
+ "IT-62" : true, "IT-65" : true, "IT-67" : true, "IT-72" : true, "IT-75" : true,
+ "IT-77" : true, "IT-78" : true, "IT-82" : true, "IT-88" : true, "IT-AG" : true,
+ "IT-AL" : true, "IT-AN" : true, "IT-AO" : true, "IT-AP" : true, "IT-AQ" : true,
+ "IT-AR" : true, "IT-AT" : true, "IT-AV" : true, "IT-BA" : true, "IT-BG" : true,
+ "IT-BI" : true, "IT-BL" : true, "IT-BN" : true, "IT-BO" : true, "IT-BR" : true,
+ "IT-BS" : true, "IT-BT" : true, "IT-BZ" : true, "IT-CA" : true, "IT-CB" : true,
+ "IT-CE" : true, "IT-CH" : true, "IT-CI" : true, "IT-CL" : true, "IT-CN" : true,
+ "IT-CO" : true, "IT-CR" : true, "IT-CS" : true, "IT-CT" : true, "IT-CZ" : true,
+ "IT-EN" : true, "IT-FC" : true, "IT-FE" : true, "IT-FG" : true, "IT-FI" : true,
+ "IT-FM" : true, "IT-FR" : true, "IT-GE" : true, "IT-GO" : true, "IT-GR" : true,
+ "IT-IM" : true, "IT-IS" : true, "IT-KR" : true, "IT-LC" : true, "IT-LE" : true,
+ "IT-LI" : true, "IT-LO" : true, "IT-LT" : true, "IT-LU" : true, "IT-MB" : true,
+ "IT-MC" : true, "IT-ME" : true, "IT-MI" : true, "IT-MN" : true, "IT-MO" : true,
+ "IT-MS" : true, "IT-MT" : true, "IT-NA" : true, "IT-NO" : true, "IT-NU" : true,
+ "IT-OG" : true, "IT-OR" : true, "IT-OT" : true, "IT-PA" : true, "IT-PC" : true,
+ "IT-PD" : true, "IT-PE" : true, "IT-PG" : true, "IT-PI" : true, "IT-PN" : true,
+ "IT-PO" : true, "IT-PR" : true, "IT-PT" : true, "IT-PU" : true, "IT-PV" : true,
+ "IT-PZ" : true, "IT-RA" : true, "IT-RC" : true, "IT-RE" : true, "IT-RG" : true,
+ "IT-RI" : true, "IT-RM" : true, "IT-RN" : true, "IT-RO" : true, "IT-SA" : true,
+ "IT-SI" : true, "IT-SO" : true, "IT-SP" : true, "IT-SR" : true, "IT-SS" : true,
+ "IT-SV" : true, "IT-TA" : true, "IT-TE" : true, "IT-TN" : true, "IT-TO" : true,
+ "IT-TP" : true, "IT-TR" : true, "IT-TS" : true, "IT-TV" : true, "IT-UD" : true,
+ "IT-VA" : true, "IT-VB" : true, "IT-VC" : true, "IT-VE" : true, "IT-VI" : true,
+ "IT-VR" : true, "IT-VS" : true, "IT-VT" : true, "IT-VV" : true, "JM-01" : true,
+ "JM-02" : true, "JM-03" : true, "JM-04" : true, "JM-05" : true, "JM-06" : true,
+ "JM-07" : true, "JM-08" : true, "JM-09" : true, "JM-10" : true, "JM-11" : true,
+ "JM-12" : true, "JM-13" : true, "JM-14" : true, "JO-AJ" : true, "JO-AM" : true,
+ "JO-AQ" : true, "JO-AT" : true, "JO-AZ" : true, "JO-BA" : true, "JO-IR" : true,
+ "JO-JA" : true, "JO-KA" : true, "JO-MA" : true, "JO-MD" : true, "JO-MN" : true,
+ "JP-01" : true, "JP-02" : true, "JP-03" : true, "JP-04" : true, "JP-05" : true,
+ "JP-06" : true, "JP-07" : true, "JP-08" : true, "JP-09" : true, "JP-10" : true,
+ "JP-11" : true, "JP-12" : true, "JP-13" : true, "JP-14" : true, "JP-15" : true,
+ "JP-16" : true, "JP-17" : true, "JP-18" : true, "JP-19" : true, "JP-20" : true,
+ "JP-21" : true, "JP-22" : true, "JP-23" : true, "JP-24" : true, "JP-25" : true,
+ "JP-26" : true, "JP-27" : true, "JP-28" : true, "JP-29" : true, "JP-30" : true,
+ "JP-31" : true, "JP-32" : true, "JP-33" : true, "JP-34" : true, "JP-35" : true,
+ "JP-36" : true, "JP-37" : true, "JP-38" : true, "JP-39" : true, "JP-40" : true,
+ "JP-41" : true, "JP-42" : true, "JP-43" : true, "JP-44" : true, "JP-45" : true,
+ "JP-46" : true, "JP-47" : true, "KE-110" : true, "KE-200" : true, "KE-300" : true,
+ "KE-400" : true, "KE-500" : true, "KE-700" : true, "KE-800" : true, "KG-B" : true,
+ "KG-C" : true, "KG-GB" : true, "KG-J" : true, "KG-N" : true, "KG-O" : true,
+ "KG-T" : true, "KG-Y" : true, "KH-1" : true, "KH-10" : true, "KH-11" : true,
+ "KH-12" : true, "KH-13" : true, "KH-14" : true, "KH-15" : true, "KH-16" : true,
+ "KH-17" : true, "KH-18" : true, "KH-19" : true, "KH-2" : true, "KH-20" : true,
+ "KH-21" : true, "KH-22" : true, "KH-23" : true, "KH-24" : true, "KH-3" : true,
+ "KH-4" : true, "KH-5" : true, "KH-6" : true, "KH-7" : true, "KH-8" : true,
+ "KH-9" : true, "KI-G" : true, "KI-L" : true, "KI-P" : true, "KM-A" : true,
+ "KM-G" : true, "KM-M" : true, "KN-01" : true, "KN-02" : true, "KN-03" : true,
+ "KN-04" : true, "KN-05" : true, "KN-06" : true, "KN-07" : true, "KN-08" : true,
+ "KN-09" : true, "KN-10" : true, "KN-11" : true, "KN-12" : true, "KN-13" : true,
+ "KN-15" : true, "KN-K" : true, "KN-N" : true, "KP-01" : true, "KP-02" : true,
+ "KP-03" : true, "KP-04" : true, "KP-05" : true, "KP-06" : true, "KP-07" : true,
+ "KP-08" : true, "KP-09" : true, "KP-10" : true, "KP-13" : true, "KR-11" : true,
+ "KR-26" : true, "KR-27" : true, "KR-28" : true, "KR-29" : true, "KR-30" : true,
+ "KR-31" : true, "KR-41" : true, "KR-42" : true, "KR-43" : true, "KR-44" : true,
+ "KR-45" : true, "KR-46" : true, "KR-47" : true, "KR-48" : true, "KR-49" : true,
+ "KW-AH" : true, "KW-FA" : true, "KW-HA" : true, "KW-JA" : true, "KW-KU" : true,
+ "KW-MU" : true, "KZ-AKM" : true, "KZ-AKT" : true, "KZ-ALA" : true, "KZ-ALM" : true,
+ "KZ-AST" : true, "KZ-ATY" : true, "KZ-KAR" : true, "KZ-KUS" : true, "KZ-KZY" : true,
+ "KZ-MAN" : true, "KZ-PAV" : true, "KZ-SEV" : true, "KZ-VOS" : true, "KZ-YUZ" : true,
+ "KZ-ZAP" : true, "KZ-ZHA" : true, "LA-AT" : true, "LA-BK" : true, "LA-BL" : true,
+ "LA-CH" : true, "LA-HO" : true, "LA-KH" : true, "LA-LM" : true, "LA-LP" : true,
+ "LA-OU" : true, "LA-PH" : true, "LA-SL" : true, "LA-SV" : true, "LA-VI" : true,
+ "LA-VT" : true, "LA-XA" : true, "LA-XE" : true, "LA-XI" : true, "LA-XS" : true,
+ "LB-AK" : true, "LB-AS" : true, "LB-BA" : true, "LB-BH" : true, "LB-BI" : true,
+ "LB-JA" : true, "LB-JL" : true, "LB-NA" : true, "LI-01" : true, "LI-02" : true,
+ "LI-03" : true, "LI-04" : true, "LI-05" : true, "LI-06" : true, "LI-07" : true,
+ "LI-08" : true, "LI-09" : true, "LI-10" : true, "LI-11" : true, "LK-1" : true,
+ "LK-11" : true, "LK-12" : true, "LK-13" : true, "LK-2" : true, "LK-21" : true,
+ "LK-22" : true, "LK-23" : true, "LK-3" : true, "LK-31" : true, "LK-32" : true,
+ "LK-33" : true, "LK-4" : true, "LK-41" : true, "LK-42" : true, "LK-43" : true,
+ "LK-44" : true, "LK-45" : true, "LK-5" : true, "LK-51" : true, "LK-52" : true,
+ "LK-53" : true, "LK-6" : true, "LK-61" : true, "LK-62" : true, "LK-7" : true,
+ "LK-71" : true, "LK-72" : true, "LK-8" : true, "LK-81" : true, "LK-82" : true,
+ "LK-9" : true, "LK-91" : true, "LK-92" : true, "LR-BG" : true, "LR-BM" : true,
+ "LR-CM" : true, "LR-GB" : true, "LR-GG" : true, "LR-GK" : true, "LR-LO" : true,
+ "LR-MG" : true, "LR-MO" : true, "LR-MY" : true, "LR-NI" : true, "LR-RI" : true,
+ "LR-SI" : true, "LS-A" : true, "LS-B" : true, "LS-C" : true, "LS-D" : true,
+ "LS-E" : true, "LS-F" : true, "LS-G" : true, "LS-H" : true, "LS-J" : true,
+ "LS-K" : true, "LT-AL" : true, "LT-KL" : true, "LT-KU" : true, "LT-MR" : true,
+ "LT-PN" : true, "LT-SA" : true, "LT-TA" : true, "LT-TE" : true, "LT-UT" : true,
+ "LT-VL" : true, "LU-D" : true, "LU-G" : true, "LU-L" : true, "LV-001" : true,
+ "LV-002" : true, "LV-003" : true, "LV-004" : true, "LV-005" : true, "LV-006" : true,
+ "LV-007" : true, "LV-008" : true, "LV-009" : true, "LV-010" : true, "LV-011" : true,
+ "LV-012" : true, "LV-013" : true, "LV-014" : true, "LV-015" : true, "LV-016" : true,
+ "LV-017" : true, "LV-018" : true, "LV-019" : true, "LV-020" : true, "LV-021" : true,
+ "LV-022" : true, "LV-023" : true, "LV-024" : true, "LV-025" : true, "LV-026" : true,
+ "LV-027" : true, "LV-028" : true, "LV-029" : true, "LV-030" : true, "LV-031" : true,
+ "LV-032" : true, "LV-033" : true, "LV-034" : true, "LV-035" : true, "LV-036" : true,
+ "LV-037" : true, "LV-038" : true, "LV-039" : true, "LV-040" : true, "LV-041" : true,
+ "LV-042" : true, "LV-043" : true, "LV-044" : true, "LV-045" : true, "LV-046" : true,
+ "LV-047" : true, "LV-048" : true, "LV-049" : true, "LV-050" : true, "LV-051" : true,
+ "LV-052" : true, "LV-053" : true, "LV-054" : true, "LV-055" : true, "LV-056" : true,
+ "LV-057" : true, "LV-058" : true, "LV-059" : true, "LV-060" : true, "LV-061" : true,
+ "LV-062" : true, "LV-063" : true, "LV-064" : true, "LV-065" : true, "LV-066" : true,
+ "LV-067" : true, "LV-068" : true, "LV-069" : true, "LV-070" : true, "LV-071" : true,
+ "LV-072" : true, "LV-073" : true, "LV-074" : true, "LV-075" : true, "LV-076" : true,
+ "LV-077" : true, "LV-078" : true, "LV-079" : true, "LV-080" : true, "LV-081" : true,
+ "LV-082" : true, "LV-083" : true, "LV-084" : true, "LV-085" : true, "LV-086" : true,
+ "LV-087" : true, "LV-088" : true, "LV-089" : true, "LV-090" : true, "LV-091" : true,
+ "LV-092" : true, "LV-093" : true, "LV-094" : true, "LV-095" : true, "LV-096" : true,
+ "LV-097" : true, "LV-098" : true, "LV-099" : true, "LV-100" : true, "LV-101" : true,
+ "LV-102" : true, "LV-103" : true, "LV-104" : true, "LV-105" : true, "LV-106" : true,
+ "LV-107" : true, "LV-108" : true, "LV-109" : true, "LV-110" : true, "LV-DGV" : true,
+ "LV-JEL" : true, "LV-JKB" : true, "LV-JUR" : true, "LV-LPX" : true, "LV-REZ" : true,
+ "LV-RIX" : true, "LV-VEN" : true, "LV-VMR" : true, "LY-BA" : true, "LY-BU" : true,
+ "LY-DR" : true, "LY-GT" : true, "LY-JA" : true, "LY-JB" : true, "LY-JG" : true,
+ "LY-JI" : true, "LY-JU" : true, "LY-KF" : true, "LY-MB" : true, "LY-MI" : true,
+ "LY-MJ" : true, "LY-MQ" : true, "LY-NL" : true, "LY-NQ" : true, "LY-SB" : true,
+ "LY-SR" : true, "LY-TB" : true, "LY-WA" : true, "LY-WD" : true, "LY-WS" : true,
+ "LY-ZA" : true, "MA-01" : true, "MA-02" : true, "MA-03" : true, "MA-04" : true,
+ "MA-05" : true, "MA-06" : true, "MA-07" : true, "MA-08" : true, "MA-09" : true,
+ "MA-10" : true, "MA-11" : true, "MA-12" : true, "MA-13" : true, "MA-14" : true,
+ "MA-15" : true, "MA-16" : true, "MA-AGD" : true, "MA-AOU" : true, "MA-ASZ" : true,
+ "MA-AZI" : true, "MA-BEM" : true, "MA-BER" : true, "MA-BES" : true, "MA-BOD" : true,
+ "MA-BOM" : true, "MA-CAS" : true, "MA-CHE" : true, "MA-CHI" : true, "MA-CHT" : true,
+ "MA-ERR" : true, "MA-ESI" : true, "MA-ESM" : true, "MA-FAH" : true, "MA-FES" : true,
+ "MA-FIG" : true, "MA-GUE" : true, "MA-HAJ" : true, "MA-HAO" : true, "MA-HOC" : true,
+ "MA-IFR" : true, "MA-INE" : true, "MA-JDI" : true, "MA-JRA" : true, "MA-KEN" : true,
+ "MA-KES" : true, "MA-KHE" : true, "MA-KHN" : true, "MA-KHO" : true, "MA-LAA" : true,
+ "MA-LAR" : true, "MA-MED" : true, "MA-MEK" : true, "MA-MMD" : true, "MA-MMN" : true,
+ "MA-MOH" : true, "MA-MOU" : true, "MA-NAD" : true, "MA-NOU" : true, "MA-OUA" : true,
+ "MA-OUD" : true, "MA-OUJ" : true, "MA-RAB" : true, "MA-SAF" : true, "MA-SAL" : true,
+ "MA-SEF" : true, "MA-SET" : true, "MA-SIK" : true, "MA-SKH" : true, "MA-SYB" : true,
+ "MA-TAI" : true, "MA-TAO" : true, "MA-TAR" : true, "MA-TAT" : true, "MA-TAZ" : true,
+ "MA-TET" : true, "MA-TIZ" : true, "MA-TNG" : true, "MA-TNT" : true, "MA-ZAG" : true,
+ "MC-CL" : true, "MC-CO" : true, "MC-FO" : true, "MC-GA" : true, "MC-JE" : true,
+ "MC-LA" : true, "MC-MA" : true, "MC-MC" : true, "MC-MG" : true, "MC-MO" : true,
+ "MC-MU" : true, "MC-PH" : true, "MC-SD" : true, "MC-SO" : true, "MC-SP" : true,
+ "MC-SR" : true, "MC-VR" : true, "MD-AN" : true, "MD-BA" : true, "MD-BD" : true,
+ "MD-BR" : true, "MD-BS" : true, "MD-CA" : true, "MD-CL" : true, "MD-CM" : true,
+ "MD-CR" : true, "MD-CS" : true, "MD-CT" : true, "MD-CU" : true, "MD-DO" : true,
+ "MD-DR" : true, "MD-DU" : true, "MD-ED" : true, "MD-FA" : true, "MD-FL" : true,
+ "MD-GA" : true, "MD-GL" : true, "MD-HI" : true, "MD-IA" : true, "MD-LE" : true,
+ "MD-NI" : true, "MD-OC" : true, "MD-OR" : true, "MD-RE" : true, "MD-RI" : true,
+ "MD-SD" : true, "MD-SI" : true, "MD-SN" : true, "MD-SO" : true, "MD-ST" : true,
+ "MD-SV" : true, "MD-TA" : true, "MD-TE" : true, "MD-UN" : true, "ME-01" : true,
+ "ME-02" : true, "ME-03" : true, "ME-04" : true, "ME-05" : true, "ME-06" : true,
+ "ME-07" : true, "ME-08" : true, "ME-09" : true, "ME-10" : true, "ME-11" : true,
+ "ME-12" : true, "ME-13" : true, "ME-14" : true, "ME-15" : true, "ME-16" : true,
+ "ME-17" : true, "ME-18" : true, "ME-19" : true, "ME-20" : true, "ME-21" : true,
+ "MG-A" : true, "MG-D" : true, "MG-F" : true, "MG-M" : true, "MG-T" : true,
+ "MG-U" : true, "MH-ALK" : true, "MH-ALL" : true, "MH-ARN" : true, "MH-AUR" : true,
+ "MH-EBO" : true, "MH-ENI" : true, "MH-JAB" : true, "MH-JAL" : true, "MH-KIL" : true,
+ "MH-KWA" : true, "MH-L" : true, "MH-LAE" : true, "MH-LIB" : true, "MH-LIK" : true,
+ "MH-MAJ" : true, "MH-MAL" : true, "MH-MEJ" : true, "MH-MIL" : true, "MH-NMK" : true,
+ "MH-NMU" : true, "MH-RON" : true, "MH-T" : true, "MH-UJA" : true, "MH-UTI" : true,
+ "MH-WTJ" : true, "MH-WTN" : true, "MK-01" : true, "MK-02" : true, "MK-03" : true,
+ "MK-04" : true, "MK-05" : true, "MK-06" : true, "MK-07" : true, "MK-08" : true,
+ "MK-09" : true, "MK-10" : true, "MK-11" : true, "MK-12" : true, "MK-13" : true,
+ "MK-14" : true, "MK-15" : true, "MK-16" : true, "MK-17" : true, "MK-18" : true,
+ "MK-19" : true, "MK-20" : true, "MK-21" : true, "MK-22" : true, "MK-23" : true,
+ "MK-24" : true, "MK-25" : true, "MK-26" : true, "MK-27" : true, "MK-28" : true,
+ "MK-29" : true, "MK-30" : true, "MK-31" : true, "MK-32" : true, "MK-33" : true,
+ "MK-34" : true, "MK-35" : true, "MK-36" : true, "MK-37" : true, "MK-38" : true,
+ "MK-39" : true, "MK-40" : true, "MK-41" : true, "MK-42" : true, "MK-43" : true,
+ "MK-44" : true, "MK-45" : true, "MK-46" : true, "MK-47" : true, "MK-48" : true,
+ "MK-49" : true, "MK-50" : true, "MK-51" : true, "MK-52" : true, "MK-53" : true,
+ "MK-54" : true, "MK-55" : true, "MK-56" : true, "MK-57" : true, "MK-58" : true,
+ "MK-59" : true, "MK-60" : true, "MK-61" : true, "MK-62" : true, "MK-63" : true,
+ "MK-64" : true, "MK-65" : true, "MK-66" : true, "MK-67" : true, "MK-68" : true,
+ "MK-69" : true, "MK-70" : true, "MK-71" : true, "MK-72" : true, "MK-73" : true,
+ "MK-74" : true, "MK-75" : true, "MK-76" : true, "MK-77" : true, "MK-78" : true,
+ "MK-79" : true, "MK-80" : true, "MK-81" : true, "MK-82" : true, "MK-83" : true,
+ "MK-84" : true, "ML-1" : true, "ML-2" : true, "ML-3" : true, "ML-4" : true,
+ "ML-5" : true, "ML-6" : true, "ML-7" : true, "ML-8" : true, "ML-BK0" : true,
+ "MM-01" : true, "MM-02" : true, "MM-03" : true, "MM-04" : true, "MM-05" : true,
+ "MM-06" : true, "MM-07" : true, "MM-11" : true, "MM-12" : true, "MM-13" : true,
+ "MM-14" : true, "MM-15" : true, "MM-16" : true, "MM-17" : true, "MN-035" : true,
+ "MN-037" : true, "MN-039" : true, "MN-041" : true, "MN-043" : true, "MN-046" : true,
+ "MN-047" : true, "MN-049" : true, "MN-051" : true, "MN-053" : true, "MN-055" : true,
+ "MN-057" : true, "MN-059" : true, "MN-061" : true, "MN-063" : true, "MN-064" : true,
+ "MN-065" : true, "MN-067" : true, "MN-069" : true, "MN-071" : true, "MN-073" : true,
+ "MN-1" : true, "MR-01" : true, "MR-02" : true, "MR-03" : true, "MR-04" : true,
+ "MR-05" : true, "MR-06" : true, "MR-07" : true, "MR-08" : true, "MR-09" : true,
+ "MR-10" : true, "MR-11" : true, "MR-12" : true, "MR-NKC" : true, "MT-01" : true,
+ "MT-02" : true, "MT-03" : true, "MT-04" : true, "MT-05" : true, "MT-06" : true,
+ "MT-07" : true, "MT-08" : true, "MT-09" : true, "MT-10" : true, "MT-11" : true,
+ "MT-12" : true, "MT-13" : true, "MT-14" : true, "MT-15" : true, "MT-16" : true,
+ "MT-17" : true, "MT-18" : true, "MT-19" : true, "MT-20" : true, "MT-21" : true,
+ "MT-22" : true, "MT-23" : true, "MT-24" : true, "MT-25" : true, "MT-26" : true,
+ "MT-27" : true, "MT-28" : true, "MT-29" : true, "MT-30" : true, "MT-31" : true,
+ "MT-32" : true, "MT-33" : true, "MT-34" : true, "MT-35" : true, "MT-36" : true,
+ "MT-37" : true, "MT-38" : true, "MT-39" : true, "MT-40" : true, "MT-41" : true,
+ "MT-42" : true, "MT-43" : true, "MT-44" : true, "MT-45" : true, "MT-46" : true,
+ "MT-47" : true, "MT-48" : true, "MT-49" : true, "MT-50" : true, "MT-51" : true,
+ "MT-52" : true, "MT-53" : true, "MT-54" : true, "MT-55" : true, "MT-56" : true,
+ "MT-57" : true, "MT-58" : true, "MT-59" : true, "MT-60" : true, "MT-61" : true,
+ "MT-62" : true, "MT-63" : true, "MT-64" : true, "MT-65" : true, "MT-66" : true,
+ "MT-67" : true, "MT-68" : true, "MU-AG" : true, "MU-BL" : true, "MU-BR" : true,
+ "MU-CC" : true, "MU-CU" : true, "MU-FL" : true, "MU-GP" : true, "MU-MO" : true,
+ "MU-PA" : true, "MU-PL" : true, "MU-PU" : true, "MU-PW" : true, "MU-QB" : true,
+ "MU-RO" : true, "MU-RP" : true, "MU-SA" : true, "MU-VP" : true, "MV-00" : true,
+ "MV-01" : true, "MV-02" : true, "MV-03" : true, "MV-04" : true, "MV-05" : true,
+ "MV-07" : true, "MV-08" : true, "MV-12" : true, "MV-13" : true, "MV-14" : true,
+ "MV-17" : true, "MV-20" : true, "MV-23" : true, "MV-24" : true, "MV-25" : true,
+ "MV-26" : true, "MV-27" : true, "MV-28" : true, "MV-29" : true, "MV-CE" : true,
+ "MV-MLE" : true, "MV-NC" : true, "MV-NO" : true, "MV-SC" : true, "MV-SU" : true,
+ "MV-UN" : true, "MV-US" : true, "MW-BA" : true, "MW-BL" : true, "MW-C" : true,
+ "MW-CK" : true, "MW-CR" : true, "MW-CT" : true, "MW-DE" : true, "MW-DO" : true,
+ "MW-KR" : true, "MW-KS" : true, "MW-LI" : true, "MW-LK" : true, "MW-MC" : true,
+ "MW-MG" : true, "MW-MH" : true, "MW-MU" : true, "MW-MW" : true, "MW-MZ" : true,
+ "MW-N" : true, "MW-NB" : true, "MW-NE" : true, "MW-NI" : true, "MW-NK" : true,
+ "MW-NS" : true, "MW-NU" : true, "MW-PH" : true, "MW-RU" : true, "MW-S" : true,
+ "MW-SA" : true, "MW-TH" : true, "MW-ZO" : true, "MX-AGU" : true, "MX-BCN" : true,
+ "MX-BCS" : true, "MX-CAM" : true, "MX-CHH" : true, "MX-CHP" : true, "MX-COA" : true,
+ "MX-COL" : true, "MX-DIF" : true, "MX-DUR" : true, "MX-GRO" : true, "MX-GUA" : true,
+ "MX-HID" : true, "MX-JAL" : true, "MX-MEX" : true, "MX-MIC" : true, "MX-MOR" : true,
+ "MX-NAY" : true, "MX-NLE" : true, "MX-OAX" : true, "MX-PUE" : true, "MX-QUE" : true,
+ "MX-ROO" : true, "MX-SIN" : true, "MX-SLP" : true, "MX-SON" : true, "MX-TAB" : true,
+ "MX-TAM" : true, "MX-TLA" : true, "MX-VER" : true, "MX-YUC" : true, "MX-ZAC" : true,
+ "MY-01" : true, "MY-02" : true, "MY-03" : true, "MY-04" : true, "MY-05" : true,
+ "MY-06" : true, "MY-07" : true, "MY-08" : true, "MY-09" : true, "MY-10" : true,
+ "MY-11" : true, "MY-12" : true, "MY-13" : true, "MY-14" : true, "MY-15" : true,
+ "MY-16" : true, "MZ-A" : true, "MZ-B" : true, "MZ-G" : true, "MZ-I" : true,
+ "MZ-L" : true, "MZ-MPM" : true, "MZ-N" : true, "MZ-P" : true, "MZ-Q" : true,
+ "MZ-S" : true, "MZ-T" : true, "NA-CA" : true, "NA-ER" : true, "NA-HA" : true,
+ "NA-KA" : true, "NA-KH" : true, "NA-KU" : true, "NA-OD" : true, "NA-OH" : true,
+ "NA-OK" : true, "NA-ON" : true, "NA-OS" : true, "NA-OT" : true, "NA-OW" : true,
+ "NE-1" : true, "NE-2" : true, "NE-3" : true, "NE-4" : true, "NE-5" : true,
+ "NE-6" : true, "NE-7" : true, "NE-8" : true, "NG-AB" : true, "NG-AD" : true,
+ "NG-AK" : true, "NG-AN" : true, "NG-BA" : true, "NG-BE" : true, "NG-BO" : true,
+ "NG-BY" : true, "NG-CR" : true, "NG-DE" : true, "NG-EB" : true, "NG-ED" : true,
+ "NG-EK" : true, "NG-EN" : true, "NG-FC" : true, "NG-GO" : true, "NG-IM" : true,
+ "NG-JI" : true, "NG-KD" : true, "NG-KE" : true, "NG-KN" : true, "NG-KO" : true,
+ "NG-KT" : true, "NG-KW" : true, "NG-LA" : true, "NG-NA" : true, "NG-NI" : true,
+ "NG-OG" : true, "NG-ON" : true, "NG-OS" : true, "NG-OY" : true, "NG-PL" : true,
+ "NG-RI" : true, "NG-SO" : true, "NG-TA" : true, "NG-YO" : true, "NG-ZA" : true,
+ "NI-AN" : true, "NI-AS" : true, "NI-BO" : true, "NI-CA" : true, "NI-CI" : true,
+ "NI-CO" : true, "NI-ES" : true, "NI-GR" : true, "NI-JI" : true, "NI-LE" : true,
+ "NI-MD" : true, "NI-MN" : true, "NI-MS" : true, "NI-MT" : true, "NI-NS" : true,
+ "NI-RI" : true, "NI-SJ" : true, "NL-AW" : true, "NL-BQ1" : true, "NL-BQ2" : true,
+ "NL-BQ3" : true, "NL-CW" : true, "NL-DR" : true, "NL-FL" : true, "NL-FR" : true,
+ "NL-GE" : true, "NL-GR" : true, "NL-LI" : true, "NL-NB" : true, "NL-NH" : true,
+ "NL-OV" : true, "NL-SX" : true, "NL-UT" : true, "NL-ZE" : true, "NL-ZH" : true,
+ "NO-01" : true, "NO-02" : true, "NO-03" : true, "NO-04" : true, "NO-05" : true,
+ "NO-06" : true, "NO-07" : true, "NO-08" : true, "NO-09" : true, "NO-10" : true,
+ "NO-11" : true, "NO-12" : true, "NO-14" : true, "NO-15" : true, "NO-16" : true,
+ "NO-17" : true, "NO-18" : true, "NO-19" : true, "NO-20" : true, "NO-21" : true,
+ "NO-22" : true, "NP-1" : true, "NP-2" : true, "NP-3" : true, "NP-4" : true,
+ "NP-5" : true, "NP-BA" : true, "NP-BH" : true, "NP-DH" : true, "NP-GA" : true,
+ "NP-JA" : true, "NP-KA" : true, "NP-KO" : true, "NP-LU" : true, "NP-MA" : true,
+ "NP-ME" : true, "NP-NA" : true, "NP-RA" : true, "NP-SA" : true, "NP-SE" : true,
+ "NR-01" : true, "NR-02" : true, "NR-03" : true, "NR-04" : true, "NR-05" : true,
+ "NR-06" : true, "NR-07" : true, "NR-08" : true, "NR-09" : true, "NR-10" : true,
+ "NR-11" : true, "NR-12" : true, "NR-13" : true, "NR-14" : true, "NZ-AUK" : true,
+ "NZ-BOP" : true, "NZ-CAN" : true, "NZ-CIT" : true, "NZ-GIS" : true, "NZ-HKB" : true,
+ "NZ-MBH" : true, "NZ-MWT" : true, "NZ-N" : true, "NZ-NSN" : true, "NZ-NTL" : true,
+ "NZ-OTA" : true, "NZ-S" : true, "NZ-STL" : true, "NZ-TAS" : true, "NZ-TKI" : true,
+ "NZ-WGN" : true, "NZ-WKO" : true, "NZ-WTC" : true, "OM-BA" : true, "OM-BU" : true,
+ "OM-DA" : true, "OM-MA" : true, "OM-MU" : true, "OM-SH" : true, "OM-WU" : true,
+ "OM-ZA" : true, "OM-ZU" : true, "PA-1" : true, "PA-2" : true, "PA-3" : true,
+ "PA-4" : true, "PA-5" : true, "PA-6" : true, "PA-7" : true, "PA-8" : true,
+ "PA-9" : true, "PA-EM" : true, "PA-KY" : true, "PA-NB" : true, "PE-AMA" : true,
+ "PE-ANC" : true, "PE-APU" : true, "PE-ARE" : true, "PE-AYA" : true, "PE-CAJ" : true,
+ "PE-CAL" : true, "PE-CUS" : true, "PE-HUC" : true, "PE-HUV" : true, "PE-ICA" : true,
+ "PE-JUN" : true, "PE-LAL" : true, "PE-LAM" : true, "PE-LIM" : true, "PE-LMA" : true,
+ "PE-LOR" : true, "PE-MDD" : true, "PE-MOQ" : true, "PE-PAS" : true, "PE-PIU" : true,
+ "PE-PUN" : true, "PE-SAM" : true, "PE-TAC" : true, "PE-TUM" : true, "PE-UCA" : true,
+ "PG-CPK" : true, "PG-CPM" : true, "PG-EBR" : true, "PG-EHG" : true, "PG-EPW" : true,
+ "PG-ESW" : true, "PG-GPK" : true, "PG-MBA" : true, "PG-MPL" : true, "PG-MPM" : true,
+ "PG-MRL" : true, "PG-NCD" : true, "PG-NIK" : true, "PG-NPP" : true, "PG-NSB" : true,
+ "PG-SAN" : true, "PG-SHM" : true, "PG-WBK" : true, "PG-WHM" : true, "PG-WPD" : true,
+ "PH-00" : true, "PH-01" : true, "PH-02" : true, "PH-03" : true, "PH-05" : true,
+ "PH-06" : true, "PH-07" : true, "PH-08" : true, "PH-09" : true, "PH-10" : true,
+ "PH-11" : true, "PH-12" : true, "PH-13" : true, "PH-14" : true, "PH-15" : true,
+ "PH-40" : true, "PH-41" : true, "PH-ABR" : true, "PH-AGN" : true, "PH-AGS" : true,
+ "PH-AKL" : true, "PH-ALB" : true, "PH-ANT" : true, "PH-APA" : true, "PH-AUR" : true,
+ "PH-BAN" : true, "PH-BAS" : true, "PH-BEN" : true, "PH-BIL" : true, "PH-BOH" : true,
+ "PH-BTG" : true, "PH-BTN" : true, "PH-BUK" : true, "PH-BUL" : true, "PH-CAG" : true,
+ "PH-CAM" : true, "PH-CAN" : true, "PH-CAP" : true, "PH-CAS" : true, "PH-CAT" : true,
+ "PH-CAV" : true, "PH-CEB" : true, "PH-COM" : true, "PH-DAO" : true, "PH-DAS" : true,
+ "PH-DAV" : true, "PH-DIN" : true, "PH-EAS" : true, "PH-GUI" : true, "PH-IFU" : true,
+ "PH-ILI" : true, "PH-ILN" : true, "PH-ILS" : true, "PH-ISA" : true, "PH-KAL" : true,
+ "PH-LAG" : true, "PH-LAN" : true, "PH-LAS" : true, "PH-LEY" : true, "PH-LUN" : true,
+ "PH-MAD" : true, "PH-MAG" : true, "PH-MAS" : true, "PH-MDC" : true, "PH-MDR" : true,
+ "PH-MOU" : true, "PH-MSC" : true, "PH-MSR" : true, "PH-NCO" : true, "PH-NEC" : true,
+ "PH-NER" : true, "PH-NSA" : true, "PH-NUE" : true, "PH-NUV" : true, "PH-PAM" : true,
+ "PH-PAN" : true, "PH-PLW" : true, "PH-QUE" : true, "PH-QUI" : true, "PH-RIZ" : true,
+ "PH-ROM" : true, "PH-SAR" : true, "PH-SCO" : true, "PH-SIG" : true, "PH-SLE" : true,
+ "PH-SLU" : true, "PH-SOR" : true, "PH-SUK" : true, "PH-SUN" : true, "PH-SUR" : true,
+ "PH-TAR" : true, "PH-TAW" : true, "PH-WSA" : true, "PH-ZAN" : true, "PH-ZAS" : true,
+ "PH-ZMB" : true, "PH-ZSI" : true, "PK-BA" : true, "PK-GB" : true, "PK-IS" : true,
+ "PK-JK" : true, "PK-KP" : true, "PK-PB" : true, "PK-SD" : true, "PK-TA" : true,
+ "PL-DS" : true, "PL-KP" : true, "PL-LB" : true, "PL-LD" : true, "PL-LU" : true,
+ "PL-MA" : true, "PL-MZ" : true, "PL-OP" : true, "PL-PD" : true, "PL-PK" : true,
+ "PL-PM" : true, "PL-SK" : true, "PL-SL" : true, "PL-WN" : true, "PL-WP" : true,
+ "PL-ZP" : true, "PS-BTH" : true, "PS-DEB" : true, "PS-GZA" : true, "PS-HBN" : true,
+ "PS-JEM" : true, "PS-JEN" : true, "PS-JRH" : true, "PS-KYS" : true, "PS-NBS" : true,
+ "PS-NGZ" : true, "PS-QQA" : true, "PS-RBH" : true, "PS-RFH" : true, "PS-SLT" : true,
+ "PS-TBS" : true, "PS-TKM" : true, "PT-01" : true, "PT-02" : true, "PT-03" : true,
+ "PT-04" : true, "PT-05" : true, "PT-06" : true, "PT-07" : true, "PT-08" : true,
+ "PT-09" : true, "PT-10" : true, "PT-11" : true, "PT-12" : true, "PT-13" : true,
+ "PT-14" : true, "PT-15" : true, "PT-16" : true, "PT-17" : true, "PT-18" : true,
+ "PT-20" : true, "PT-30" : true, "PW-002" : true, "PW-004" : true, "PW-010" : true,
+ "PW-050" : true, "PW-100" : true, "PW-150" : true, "PW-212" : true, "PW-214" : true,
+ "PW-218" : true, "PW-222" : true, "PW-224" : true, "PW-226" : true, "PW-227" : true,
+ "PW-228" : true, "PW-350" : true, "PW-370" : true, "PY-1" : true, "PY-10" : true,
+ "PY-11" : true, "PY-12" : true, "PY-13" : true, "PY-14" : true, "PY-15" : true,
+ "PY-16" : true, "PY-19" : true, "PY-2" : true, "PY-3" : true, "PY-4" : true,
+ "PY-5" : true, "PY-6" : true, "PY-7" : true, "PY-8" : true, "PY-9" : true,
+ "PY-ASU" : true, "QA-DA" : true, "QA-KH" : true, "QA-MS" : true, "QA-RA" : true,
+ "QA-US" : true, "QA-WA" : true, "QA-ZA" : true, "RO-AB" : true, "RO-AG" : true,
+ "RO-AR" : true, "RO-B" : true, "RO-BC" : true, "RO-BH" : true, "RO-BN" : true,
+ "RO-BR" : true, "RO-BT" : true, "RO-BV" : true, "RO-BZ" : true, "RO-CJ" : true,
+ "RO-CL" : true, "RO-CS" : true, "RO-CT" : true, "RO-CV" : true, "RO-DB" : true,
+ "RO-DJ" : true, "RO-GJ" : true, "RO-GL" : true, "RO-GR" : true, "RO-HD" : true,
+ "RO-HR" : true, "RO-IF" : true, "RO-IL" : true, "RO-IS" : true, "RO-MH" : true,
+ "RO-MM" : true, "RO-MS" : true, "RO-NT" : true, "RO-OT" : true, "RO-PH" : true,
+ "RO-SB" : true, "RO-SJ" : true, "RO-SM" : true, "RO-SV" : true, "RO-TL" : true,
+ "RO-TM" : true, "RO-TR" : true, "RO-VL" : true, "RO-VN" : true, "RO-VS" : true,
+ "RS-00" : true, "RS-01" : true, "RS-02" : true, "RS-03" : true, "RS-04" : true,
+ "RS-05" : true, "RS-06" : true, "RS-07" : true, "RS-08" : true, "RS-09" : true,
+ "RS-10" : true, "RS-11" : true, "RS-12" : true, "RS-13" : true, "RS-14" : true,
+ "RS-15" : true, "RS-16" : true, "RS-17" : true, "RS-18" : true, "RS-19" : true,
+ "RS-20" : true, "RS-21" : true, "RS-22" : true, "RS-23" : true, "RS-24" : true,
+ "RS-25" : true, "RS-26" : true, "RS-27" : true, "RS-28" : true, "RS-29" : true,
+ "RS-KM" : true, "RS-VO" : true, "RU-AD" : true, "RU-AL" : true, "RU-ALT" : true,
+ "RU-AMU" : true, "RU-ARK" : true, "RU-AST" : true, "RU-BA" : true, "RU-BEL" : true,
+ "RU-BRY" : true, "RU-BU" : true, "RU-CE" : true, "RU-CHE" : true, "RU-CHU" : true,
+ "RU-CU" : true, "RU-DA" : true, "RU-IN" : true, "RU-IRK" : true, "RU-IVA" : true,
+ "RU-KAM" : true, "RU-KB" : true, "RU-KC" : true, "RU-KDA" : true, "RU-KEM" : true,
+ "RU-KGD" : true, "RU-KGN" : true, "RU-KHA" : true, "RU-KHM" : true, "RU-KIR" : true,
+ "RU-KK" : true, "RU-KL" : true, "RU-KLU" : true, "RU-KO" : true, "RU-KOS" : true,
+ "RU-KR" : true, "RU-KRS" : true, "RU-KYA" : true, "RU-LEN" : true, "RU-LIP" : true,
+ "RU-MAG" : true, "RU-ME" : true, "RU-MO" : true, "RU-MOS" : true, "RU-MOW" : true,
+ "RU-MUR" : true, "RU-NEN" : true, "RU-NGR" : true, "RU-NIZ" : true, "RU-NVS" : true,
+ "RU-OMS" : true, "RU-ORE" : true, "RU-ORL" : true, "RU-PER" : true, "RU-PNZ" : true,
+ "RU-PRI" : true, "RU-PSK" : true, "RU-ROS" : true, "RU-RYA" : true, "RU-SA" : true,
+ "RU-SAK" : true, "RU-SAM" : true, "RU-SAR" : true, "RU-SE" : true, "RU-SMO" : true,
+ "RU-SPE" : true, "RU-STA" : true, "RU-SVE" : true, "RU-TA" : true, "RU-TAM" : true,
+ "RU-TOM" : true, "RU-TUL" : true, "RU-TVE" : true, "RU-TY" : true, "RU-TYU" : true,
+ "RU-UD" : true, "RU-ULY" : true, "RU-VGG" : true, "RU-VLA" : true, "RU-VLG" : true,
+ "RU-VOR" : true, "RU-YAN" : true, "RU-YAR" : true, "RU-YEV" : true, "RU-ZAB" : true,
+ "RW-01" : true, "RW-02" : true, "RW-03" : true, "RW-04" : true, "RW-05" : true,
+ "SA-01" : true, "SA-02" : true, "SA-03" : true, "SA-04" : true, "SA-05" : true,
+ "SA-06" : true, "SA-07" : true, "SA-08" : true, "SA-09" : true, "SA-10" : true,
+ "SA-11" : true, "SA-12" : true, "SA-14" : true, "SB-CE" : true, "SB-CH" : true,
+ "SB-CT" : true, "SB-GU" : true, "SB-IS" : true, "SB-MK" : true, "SB-ML" : true,
+ "SB-RB" : true, "SB-TE" : true, "SB-WE" : true, "SC-01" : true, "SC-02" : true,
+ "SC-03" : true, "SC-04" : true, "SC-05" : true, "SC-06" : true, "SC-07" : true,
+ "SC-08" : true, "SC-09" : true, "SC-10" : true, "SC-11" : true, "SC-12" : true,
+ "SC-13" : true, "SC-14" : true, "SC-15" : true, "SC-16" : true, "SC-17" : true,
+ "SC-18" : true, "SC-19" : true, "SC-20" : true, "SC-21" : true, "SC-22" : true,
+ "SC-23" : true, "SC-24" : true, "SC-25" : true, "SD-DC" : true, "SD-DE" : true,
+ "SD-DN" : true, "SD-DS" : true, "SD-DW" : true, "SD-GD" : true, "SD-GZ" : true,
+ "SD-KA" : true, "SD-KH" : true, "SD-KN" : true, "SD-KS" : true, "SD-NB" : true,
+ "SD-NO" : true, "SD-NR" : true, "SD-NW" : true, "SD-RS" : true, "SD-SI" : true,
+ "SE-AB" : true, "SE-AC" : true, "SE-BD" : true, "SE-C" : true, "SE-D" : true,
+ "SE-E" : true, "SE-F" : true, "SE-G" : true, "SE-H" : true, "SE-I" : true,
+ "SE-K" : true, "SE-M" : true, "SE-N" : true, "SE-O" : true, "SE-S" : true,
+ "SE-T" : true, "SE-U" : true, "SE-W" : true, "SE-X" : true, "SE-Y" : true,
+ "SE-Z" : true, "SG-01" : true, "SG-02" : true, "SG-03" : true, "SG-04" : true,
+ "SG-05" : true, "SH-AC" : true, "SH-HL" : true, "SH-TA" : true, "SI-001" : true,
+ "SI-002" : true, "SI-003" : true, "SI-004" : true, "SI-005" : true, "SI-006" : true,
+ "SI-007" : true, "SI-008" : true, "SI-009" : true, "SI-010" : true, "SI-011" : true,
+ "SI-012" : true, "SI-013" : true, "SI-014" : true, "SI-015" : true, "SI-016" : true,
+ "SI-017" : true, "SI-018" : true, "SI-019" : true, "SI-020" : true, "SI-021" : true,
+ "SI-022" : true, "SI-023" : true, "SI-024" : true, "SI-025" : true, "SI-026" : true,
+ "SI-027" : true, "SI-028" : true, "SI-029" : true, "SI-030" : true, "SI-031" : true,
+ "SI-032" : true, "SI-033" : true, "SI-034" : true, "SI-035" : true, "SI-036" : true,
+ "SI-037" : true, "SI-038" : true, "SI-039" : true, "SI-040" : true, "SI-041" : true,
+ "SI-042" : true, "SI-043" : true, "SI-044" : true, "SI-045" : true, "SI-046" : true,
+ "SI-047" : true, "SI-048" : true, "SI-049" : true, "SI-050" : true, "SI-051" : true,
+ "SI-052" : true, "SI-053" : true, "SI-054" : true, "SI-055" : true, "SI-056" : true,
+ "SI-057" : true, "SI-058" : true, "SI-059" : true, "SI-060" : true, "SI-061" : true,
+ "SI-062" : true, "SI-063" : true, "SI-064" : true, "SI-065" : true, "SI-066" : true,
+ "SI-067" : true, "SI-068" : true, "SI-069" : true, "SI-070" : true, "SI-071" : true,
+ "SI-072" : true, "SI-073" : true, "SI-074" : true, "SI-075" : true, "SI-076" : true,
+ "SI-077" : true, "SI-078" : true, "SI-079" : true, "SI-080" : true, "SI-081" : true,
+ "SI-082" : true, "SI-083" : true, "SI-084" : true, "SI-085" : true, "SI-086" : true,
+ "SI-087" : true, "SI-088" : true, "SI-089" : true, "SI-090" : true, "SI-091" : true,
+ "SI-092" : true, "SI-093" : true, "SI-094" : true, "SI-095" : true, "SI-096" : true,
+ "SI-097" : true, "SI-098" : true, "SI-099" : true, "SI-100" : true, "SI-101" : true,
+ "SI-102" : true, "SI-103" : true, "SI-104" : true, "SI-105" : true, "SI-106" : true,
+ "SI-107" : true, "SI-108" : true, "SI-109" : true, "SI-110" : true, "SI-111" : true,
+ "SI-112" : true, "SI-113" : true, "SI-114" : true, "SI-115" : true, "SI-116" : true,
+ "SI-117" : true, "SI-118" : true, "SI-119" : true, "SI-120" : true, "SI-121" : true,
+ "SI-122" : true, "SI-123" : true, "SI-124" : true, "SI-125" : true, "SI-126" : true,
+ "SI-127" : true, "SI-128" : true, "SI-129" : true, "SI-130" : true, "SI-131" : true,
+ "SI-132" : true, "SI-133" : true, "SI-134" : true, "SI-135" : true, "SI-136" : true,
+ "SI-137" : true, "SI-138" : true, "SI-139" : true, "SI-140" : true, "SI-141" : true,
+ "SI-142" : true, "SI-143" : true, "SI-144" : true, "SI-146" : true, "SI-147" : true,
+ "SI-148" : true, "SI-149" : true, "SI-150" : true, "SI-151" : true, "SI-152" : true,
+ "SI-153" : true, "SI-154" : true, "SI-155" : true, "SI-156" : true, "SI-157" : true,
+ "SI-158" : true, "SI-159" : true, "SI-160" : true, "SI-161" : true, "SI-162" : true,
+ "SI-163" : true, "SI-164" : true, "SI-165" : true, "SI-166" : true, "SI-167" : true,
+ "SI-168" : true, "SI-169" : true, "SI-170" : true, "SI-171" : true, "SI-172" : true,
+ "SI-173" : true, "SI-174" : true, "SI-175" : true, "SI-176" : true, "SI-177" : true,
+ "SI-178" : true, "SI-179" : true, "SI-180" : true, "SI-181" : true, "SI-182" : true,
+ "SI-183" : true, "SI-184" : true, "SI-185" : true, "SI-186" : true, "SI-187" : true,
+ "SI-188" : true, "SI-189" : true, "SI-190" : true, "SI-191" : true, "SI-192" : true,
+ "SI-193" : true, "SI-194" : true, "SI-195" : true, "SI-196" : true, "SI-197" : true,
+ "SI-198" : true, "SI-199" : true, "SI-200" : true, "SI-201" : true, "SI-202" : true,
+ "SI-203" : true, "SI-204" : true, "SI-205" : true, "SI-206" : true, "SI-207" : true,
+ "SI-208" : true, "SI-209" : true, "SI-210" : true, "SI-211" : true, "SK-BC" : true,
+ "SK-BL" : true, "SK-KI" : true, "SK-NI" : true, "SK-PV" : true, "SK-TA" : true,
+ "SK-TC" : true, "SK-ZI" : true, "SL-E" : true, "SL-N" : true, "SL-S" : true,
+ "SL-W" : true, "SM-01" : true, "SM-02" : true, "SM-03" : true, "SM-04" : true,
+ "SM-05" : true, "SM-06" : true, "SM-07" : true, "SM-08" : true, "SM-09" : true,
+ "SN-DB" : true, "SN-DK" : true, "SN-FK" : true, "SN-KA" : true, "SN-KD" : true,
+ "SN-KE" : true, "SN-KL" : true, "SN-LG" : true, "SN-MT" : true, "SN-SE" : true,
+ "SN-SL" : true, "SN-TC" : true, "SN-TH" : true, "SN-ZG" : true, "SO-AW" : true,
+ "SO-BK" : true, "SO-BN" : true, "SO-BR" : true, "SO-BY" : true, "SO-GA" : true,
+ "SO-GE" : true, "SO-HI" : true, "SO-JD" : true, "SO-JH" : true, "SO-MU" : true,
+ "SO-NU" : true, "SO-SA" : true, "SO-SD" : true, "SO-SH" : true, "SO-SO" : true,
+ "SO-TO" : true, "SO-WO" : true, "SR-BR" : true, "SR-CM" : true, "SR-CR" : true,
+ "SR-MA" : true, "SR-NI" : true, "SR-PM" : true, "SR-PR" : true, "SR-SA" : true,
+ "SR-SI" : true, "SR-WA" : true, "SS-BN" : true, "SS-BW" : true, "SS-EC" : true,
+ "SS-EE8" : true, "SS-EW" : true, "SS-JG" : true, "SS-LK" : true, "SS-NU" : true,
+ "SS-UY" : true, "SS-WR" : true, "ST-P" : true, "ST-S" : true, "SV-AH" : true,
+ "SV-CA" : true, "SV-CH" : true, "SV-CU" : true, "SV-LI" : true, "SV-MO" : true,
+ "SV-PA" : true, "SV-SA" : true, "SV-SM" : true, "SV-SO" : true, "SV-SS" : true,
+ "SV-SV" : true, "SV-UN" : true, "SV-US" : true, "SY-DI" : true, "SY-DR" : true,
+ "SY-DY" : true, "SY-HA" : true, "SY-HI" : true, "SY-HL" : true, "SY-HM" : true,
+ "SY-ID" : true, "SY-LA" : true, "SY-QU" : true, "SY-RA" : true, "SY-RD" : true,
+ "SY-SU" : true, "SY-TA" : true, "SZ-HH" : true, "SZ-LU" : true, "SZ-MA" : true,
+ "SZ-SH" : true, "TD-BA" : true, "TD-BG" : true, "TD-BO" : true, "TD-CB" : true,
+ "TD-EN" : true, "TD-GR" : true, "TD-HL" : true, "TD-KA" : true, "TD-LC" : true,
+ "TD-LO" : true, "TD-LR" : true, "TD-MA" : true, "TD-MC" : true, "TD-ME" : true,
+ "TD-MO" : true, "TD-ND" : true, "TD-OD" : true, "TD-SA" : true, "TD-SI" : true,
+ "TD-TA" : true, "TD-TI" : true, "TD-WF" : true, "TG-C" : true, "TG-K" : true,
+ "TG-M" : true, "TG-P" : true, "TG-S" : true, "TH-10" : true, "TH-11" : true,
+ "TH-12" : true, "TH-13" : true, "TH-14" : true, "TH-15" : true, "TH-16" : true,
+ "TH-17" : true, "TH-18" : true, "TH-19" : true, "TH-20" : true, "TH-21" : true,
+ "TH-22" : true, "TH-23" : true, "TH-24" : true, "TH-25" : true, "TH-26" : true,
+ "TH-27" : true, "TH-30" : true, "TH-31" : true, "TH-32" : true, "TH-33" : true,
+ "TH-34" : true, "TH-35" : true, "TH-36" : true, "TH-37" : true, "TH-39" : true,
+ "TH-40" : true, "TH-41" : true, "TH-42" : true, "TH-43" : true, "TH-44" : true,
+ "TH-45" : true, "TH-46" : true, "TH-47" : true, "TH-48" : true, "TH-49" : true,
+ "TH-50" : true, "TH-51" : true, "TH-52" : true, "TH-53" : true, "TH-54" : true,
+ "TH-55" : true, "TH-56" : true, "TH-57" : true, "TH-58" : true, "TH-60" : true,
+ "TH-61" : true, "TH-62" : true, "TH-63" : true, "TH-64" : true, "TH-65" : true,
+ "TH-66" : true, "TH-67" : true, "TH-70" : true, "TH-71" : true, "TH-72" : true,
+ "TH-73" : true, "TH-74" : true, "TH-75" : true, "TH-76" : true, "TH-77" : true,
+ "TH-80" : true, "TH-81" : true, "TH-82" : true, "TH-83" : true, "TH-84" : true,
+ "TH-85" : true, "TH-86" : true, "TH-90" : true, "TH-91" : true, "TH-92" : true,
+ "TH-93" : true, "TH-94" : true, "TH-95" : true, "TH-96" : true, "TH-S" : true,
+ "TJ-GB" : true, "TJ-KT" : true, "TJ-SU" : true, "TL-AL" : true, "TL-AN" : true,
+ "TL-BA" : true, "TL-BO" : true, "TL-CO" : true, "TL-DI" : true, "TL-ER" : true,
+ "TL-LA" : true, "TL-LI" : true, "TL-MF" : true, "TL-MT" : true, "TL-OE" : true,
+ "TL-VI" : true, "TM-A" : true, "TM-B" : true, "TM-D" : true, "TM-L" : true,
+ "TM-M" : true, "TM-S" : true, "TN-11" : true, "TN-12" : true, "TN-13" : true,
+ "TN-14" : true, "TN-21" : true, "TN-22" : true, "TN-23" : true, "TN-31" : true,
+ "TN-32" : true, "TN-33" : true, "TN-34" : true, "TN-41" : true, "TN-42" : true,
+ "TN-43" : true, "TN-51" : true, "TN-52" : true, "TN-53" : true, "TN-61" : true,
+ "TN-71" : true, "TN-72" : true, "TN-73" : true, "TN-81" : true, "TN-82" : true,
+ "TN-83" : true, "TO-01" : true, "TO-02" : true, "TO-03" : true, "TO-04" : true,
+ "TO-05" : true, "TR-01" : true, "TR-02" : true, "TR-03" : true, "TR-04" : true,
+ "TR-05" : true, "TR-06" : true, "TR-07" : true, "TR-08" : true, "TR-09" : true,
+ "TR-10" : true, "TR-11" : true, "TR-12" : true, "TR-13" : true, "TR-14" : true,
+ "TR-15" : true, "TR-16" : true, "TR-17" : true, "TR-18" : true, "TR-19" : true,
+ "TR-20" : true, "TR-21" : true, "TR-22" : true, "TR-23" : true, "TR-24" : true,
+ "TR-25" : true, "TR-26" : true, "TR-27" : true, "TR-28" : true, "TR-29" : true,
+ "TR-30" : true, "TR-31" : true, "TR-32" : true, "TR-33" : true, "TR-34" : true,
+ "TR-35" : true, "TR-36" : true, "TR-37" : true, "TR-38" : true, "TR-39" : true,
+ "TR-40" : true, "TR-41" : true, "TR-42" : true, "TR-43" : true, "TR-44" : true,
+ "TR-45" : true, "TR-46" : true, "TR-47" : true, "TR-48" : true, "TR-49" : true,
+ "TR-50" : true, "TR-51" : true, "TR-52" : true, "TR-53" : true, "TR-54" : true,
+ "TR-55" : true, "TR-56" : true, "TR-57" : true, "TR-58" : true, "TR-59" : true,
+ "TR-60" : true, "TR-61" : true, "TR-62" : true, "TR-63" : true, "TR-64" : true,
+ "TR-65" : true, "TR-66" : true, "TR-67" : true, "TR-68" : true, "TR-69" : true,
+ "TR-70" : true, "TR-71" : true, "TR-72" : true, "TR-73" : true, "TR-74" : true,
+ "TR-75" : true, "TR-76" : true, "TR-77" : true, "TR-78" : true, "TR-79" : true,
+ "TR-80" : true, "TR-81" : true, "TT-ARI" : true, "TT-CHA" : true, "TT-CTT" : true,
+ "TT-DMN" : true, "TT-ETO" : true, "TT-PED" : true, "TT-POS" : true, "TT-PRT" : true,
+ "TT-PTF" : true, "TT-RCM" : true, "TT-SFO" : true, "TT-SGE" : true, "TT-SIP" : true,
+ "TT-SJL" : true, "TT-TUP" : true, "TT-WTO" : true, "TV-FUN" : true, "TV-NIT" : true,
+ "TV-NKF" : true, "TV-NKL" : true, "TV-NMA" : true, "TV-NMG" : true, "TV-NUI" : true,
+ "TV-VAI" : true, "TW-CHA" : true, "TW-CYI" : true, "TW-CYQ" : true, "TW-HSQ" : true,
+ "TW-HSZ" : true, "TW-HUA" : true, "TW-ILA" : true, "TW-KEE" : true, "TW-KHH" : true,
+ "TW-KHQ" : true, "TW-MIA" : true, "TW-NAN" : true, "TW-PEN" : true, "TW-PIF" : true,
+ "TW-TAO" : true, "TW-TNN" : true, "TW-TNQ" : true, "TW-TPE" : true, "TW-TPQ" : true,
+ "TW-TTT" : true, "TW-TXG" : true, "TW-TXQ" : true, "TW-YUN" : true, "TZ-01" : true,
+ "TZ-02" : true, "TZ-03" : true, "TZ-04" : true, "TZ-05" : true, "TZ-06" : true,
+ "TZ-07" : true, "TZ-08" : true, "TZ-09" : true, "TZ-10" : true, "TZ-11" : true,
+ "TZ-12" : true, "TZ-13" : true, "TZ-14" : true, "TZ-15" : true, "TZ-16" : true,
+ "TZ-17" : true, "TZ-18" : true, "TZ-19" : true, "TZ-20" : true, "TZ-21" : true,
+ "TZ-22" : true, "TZ-23" : true, "TZ-24" : true, "TZ-25" : true, "TZ-26" : true,
+ "UA-05" : true, "UA-07" : true, "UA-09" : true, "UA-12" : true, "UA-14" : true,
+ "UA-18" : true, "UA-21" : true, "UA-23" : true, "UA-26" : true, "UA-30" : true,
+ "UA-32" : true, "UA-35" : true, "UA-40" : true, "UA-43" : true, "UA-46" : true,
+ "UA-48" : true, "UA-51" : true, "UA-53" : true, "UA-56" : true, "UA-59" : true,
+ "UA-61" : true, "UA-63" : true, "UA-65" : true, "UA-68" : true, "UA-71" : true,
+ "UA-74" : true, "UA-77" : true, "UG-101" : true, "UG-102" : true, "UG-103" : true,
+ "UG-104" : true, "UG-105" : true, "UG-106" : true, "UG-107" : true, "UG-108" : true,
+ "UG-109" : true, "UG-110" : true, "UG-111" : true, "UG-112" : true, "UG-113" : true,
+ "UG-114" : true, "UG-115" : true, "UG-116" : true, "UG-201" : true, "UG-202" : true,
+ "UG-203" : true, "UG-204" : true, "UG-205" : true, "UG-206" : true, "UG-207" : true,
+ "UG-208" : true, "UG-209" : true, "UG-210" : true, "UG-211" : true, "UG-212" : true,
+ "UG-213" : true, "UG-214" : true, "UG-215" : true, "UG-216" : true, "UG-217" : true,
+ "UG-218" : true, "UG-219" : true, "UG-220" : true, "UG-221" : true, "UG-222" : true,
+ "UG-223" : true, "UG-224" : true, "UG-301" : true, "UG-302" : true, "UG-303" : true,
+ "UG-304" : true, "UG-305" : true, "UG-306" : true, "UG-307" : true, "UG-308" : true,
+ "UG-309" : true, "UG-310" : true, "UG-311" : true, "UG-312" : true, "UG-313" : true,
+ "UG-314" : true, "UG-315" : true, "UG-316" : true, "UG-317" : true, "UG-318" : true,
+ "UG-319" : true, "UG-320" : true, "UG-321" : true, "UG-401" : true, "UG-402" : true,
+ "UG-403" : true, "UG-404" : true, "UG-405" : true, "UG-406" : true, "UG-407" : true,
+ "UG-408" : true, "UG-409" : true, "UG-410" : true, "UG-411" : true, "UG-412" : true,
+ "UG-413" : true, "UG-414" : true, "UG-415" : true, "UG-416" : true, "UG-417" : true,
+ "UG-418" : true, "UG-419" : true, "UG-C" : true, "UG-E" : true, "UG-N" : true,
+ "UG-W" : true, "UM-67" : true, "UM-71" : true, "UM-76" : true, "UM-79" : true,
+ "UM-81" : true, "UM-84" : true, "UM-86" : true, "UM-89" : true, "UM-95" : true,
+ "US-AK" : true, "US-AL" : true, "US-AR" : true, "US-AS" : true, "US-AZ" : true,
+ "US-CA" : true, "US-CO" : true, "US-CT" : true, "US-DC" : true, "US-DE" : true,
+ "US-FL" : true, "US-GA" : true, "US-GU" : true, "US-HI" : true, "US-IA" : true,
+ "US-ID" : true, "US-IL" : true, "US-IN" : true, "US-KS" : true, "US-KY" : true,
+ "US-LA" : true, "US-MA" : true, "US-MD" : true, "US-ME" : true, "US-MI" : true,
+ "US-MN" : true, "US-MO" : true, "US-MP" : true, "US-MS" : true, "US-MT" : true,
+ "US-NC" : true, "US-ND" : true, "US-NE" : true, "US-NH" : true, "US-NJ" : true,
+ "US-NM" : true, "US-NV" : true, "US-NY" : true, "US-OH" : true, "US-OK" : true,
+ "US-OR" : true, "US-PA" : true, "US-PR" : true, "US-RI" : true, "US-SC" : true,
+ "US-SD" : true, "US-TN" : true, "US-TX" : true, "US-UM" : true, "US-UT" : true,
+ "US-VA" : true, "US-VI" : true, "US-VT" : true, "US-WA" : true, "US-WI" : true,
+ "US-WV" : true, "US-WY" : true, "UY-AR" : true, "UY-CA" : true, "UY-CL" : true,
+ "UY-CO" : true, "UY-DU" : true, "UY-FD" : true, "UY-FS" : true, "UY-LA" : true,
+ "UY-MA" : true, "UY-MO" : true, "UY-PA" : true, "UY-RN" : true, "UY-RO" : true,
+ "UY-RV" : true, "UY-SA" : true, "UY-SJ" : true, "UY-SO" : true, "UY-TA" : true,
+ "UY-TT" : true, "UZ-AN" : true, "UZ-BU" : true, "UZ-FA" : true, "UZ-JI" : true,
+ "UZ-NG" : true, "UZ-NW" : true, "UZ-QA" : true, "UZ-QR" : true, "UZ-SA" : true,
+ "UZ-SI" : true, "UZ-SU" : true, "UZ-TK" : true, "UZ-TO" : true, "UZ-XO" : true,
+ "VC-01" : true, "VC-02" : true, "VC-03" : true, "VC-04" : true, "VC-05" : true,
+ "VC-06" : true, "VE-A" : true, "VE-B" : true, "VE-C" : true, "VE-D" : true,
+ "VE-E" : true, "VE-F" : true, "VE-G" : true, "VE-H" : true, "VE-I" : true,
+ "VE-J" : true, "VE-K" : true, "VE-L" : true, "VE-M" : true, "VE-N" : true,
+ "VE-O" : true, "VE-P" : true, "VE-R" : true, "VE-S" : true, "VE-T" : true,
+ "VE-U" : true, "VE-V" : true, "VE-W" : true, "VE-X" : true, "VE-Y" : true,
+ "VE-Z" : true, "VN-01" : true, "VN-02" : true, "VN-03" : true, "VN-04" : true,
+ "VN-05" : true, "VN-06" : true, "VN-07" : true, "VN-09" : true, "VN-13" : true,
+ "VN-14" : true, "VN-15" : true, "VN-18" : true, "VN-20" : true, "VN-21" : true,
+ "VN-22" : true, "VN-23" : true, "VN-24" : true, "VN-25" : true, "VN-26" : true,
+ "VN-27" : true, "VN-28" : true, "VN-29" : true, "VN-30" : true, "VN-31" : true,
+ "VN-32" : true, "VN-33" : true, "VN-34" : true, "VN-35" : true, "VN-36" : true,
+ "VN-37" : true, "VN-39" : true, "VN-40" : true, "VN-41" : true, "VN-43" : true,
+ "VN-44" : true, "VN-45" : true, "VN-46" : true, "VN-47" : true, "VN-49" : true,
+ "VN-50" : true, "VN-51" : true, "VN-52" : true, "VN-53" : true, "VN-54" : true,
+ "VN-55" : true, "VN-56" : true, "VN-57" : true, "VN-58" : true, "VN-59" : true,
+ "VN-61" : true, "VN-63" : true, "VN-66" : true, "VN-67" : true, "VN-68" : true,
+ "VN-69" : true, "VN-70" : true, "VN-71" : true, "VN-72" : true, "VN-73" : true,
+ "VN-CT" : true, "VN-DN" : true, "VN-HN" : true, "VN-HP" : true, "VN-SG" : true,
+ "VU-MAP" : true, "VU-PAM" : true, "VU-SAM" : true, "VU-SEE" : true, "VU-TAE" : true,
+ "VU-TOB" : true, "WS-AA" : true, "WS-AL" : true, "WS-AT" : true, "WS-FA" : true,
+ "WS-GE" : true, "WS-GI" : true, "WS-PA" : true, "WS-SA" : true, "WS-TU" : true,
+ "WS-VF" : true, "WS-VS" : true, "YE-AB" : true, "YE-AD" : true, "YE-AM" : true,
+ "YE-BA" : true, "YE-DA" : true, "YE-DH" : true, "YE-HD" : true, "YE-HJ" : true,
+ "YE-IB" : true, "YE-JA" : true, "YE-LA" : true, "YE-MA" : true, "YE-MR" : true,
+ "YE-MU" : true, "YE-MW" : true, "YE-RA" : true, "YE-SD" : true, "YE-SH" : true,
+ "YE-SN" : true, "YE-TA" : true, "ZA-EC" : true, "ZA-FS" : true, "ZA-GP" : true,
+ "ZA-LP" : true, "ZA-MP" : true, "ZA-NC" : true, "ZA-NW" : true, "ZA-WC" : true,
+ "ZA-ZN" : true, "ZM-01" : true, "ZM-02" : true, "ZM-03" : true, "ZM-04" : true,
+ "ZM-05" : true, "ZM-06" : true, "ZM-07" : true, "ZM-08" : true, "ZM-09" : true,
+ "ZW-BU" : true, "ZW-HA" : true, "ZW-MA" : true, "ZW-MC" : true, "ZW-ME" : true,
+ "ZW-MI" : true, "ZW-MN" : true, "ZW-MS" : true, "ZW-MV" : true, "ZW-MW" : true,
+}
diff --git a/vendor/github.com/go-playground/validator/v10/currency_codes.go b/vendor/github.com/go-playground/validator/v10/currency_codes.go
new file mode 100644
index 000000000..a5cd9b18a
--- /dev/null
+++ b/vendor/github.com/go-playground/validator/v10/currency_codes.go
@@ -0,0 +1,79 @@
+package validator
+
+var iso4217 = map[string]bool{
+ "AFN": true, "EUR": true, "ALL": true, "DZD": true, "USD": true,
+ "AOA": true, "XCD": true, "ARS": true, "AMD": true, "AWG": true,
+ "AUD": true, "AZN": true, "BSD": true, "BHD": true, "BDT": true,
+ "BBD": true, "BYN": true, "BZD": true, "XOF": true, "BMD": true,
+ "INR": true, "BTN": true, "BOB": true, "BOV": true, "BAM": true,
+ "BWP": true, "NOK": true, "BRL": true, "BND": true, "BGN": true,
+ "BIF": true, "CVE": true, "KHR": true, "XAF": true, "CAD": true,
+ "KYD": true, "CLP": true, "CLF": true, "CNY": true, "COP": true,
+ "COU": true, "KMF": true, "CDF": true, "NZD": true, "CRC": true,
+ "HRK": true, "CUP": true, "CUC": true, "ANG": true, "CZK": true,
+ "DKK": true, "DJF": true, "DOP": true, "EGP": true, "SVC": true,
+ "ERN": true, "SZL": true, "ETB": true, "FKP": true, "FJD": true,
+ "XPF": true, "GMD": true, "GEL": true, "GHS": true, "GIP": true,
+ "GTQ": true, "GBP": true, "GNF": true, "GYD": true, "HTG": true,
+ "HNL": true, "HKD": true, "HUF": true, "ISK": true, "IDR": true,
+ "XDR": true, "IRR": true, "IQD": true, "ILS": true, "JMD": true,
+ "JPY": true, "JOD": true, "KZT": true, "KES": true, "KPW": true,
+ "KRW": true, "KWD": true, "KGS": true, "LAK": true, "LBP": true,
+ "LSL": true, "ZAR": true, "LRD": true, "LYD": true, "CHF": true,
+ "MOP": true, "MKD": true, "MGA": true, "MWK": true, "MYR": true,
+ "MVR": true, "MRU": true, "MUR": true, "XUA": true, "MXN": true,
+ "MXV": true, "MDL": true, "MNT": true, "MAD": true, "MZN": true,
+ "MMK": true, "NAD": true, "NPR": true, "NIO": true, "NGN": true,
+ "OMR": true, "PKR": true, "PAB": true, "PGK": true, "PYG": true,
+ "PEN": true, "PHP": true, "PLN": true, "QAR": true, "RON": true,
+ "RUB": true, "RWF": true, "SHP": true, "WST": true, "STN": true,
+ "SAR": true, "RSD": true, "SCR": true, "SLL": true, "SGD": true,
+ "XSU": true, "SBD": true, "SOS": true, "SSP": true, "LKR": true,
+ "SDG": true, "SRD": true, "SEK": true, "CHE": true, "CHW": true,
+ "SYP": true, "TWD": true, "TJS": true, "TZS": true, "THB": true,
+ "TOP": true, "TTD": true, "TND": true, "TRY": true, "TMT": true,
+ "UGX": true, "UAH": true, "AED": true, "USN": true, "UYU": true,
+ "UYI": true, "UYW": true, "UZS": true, "VUV": true, "VES": true,
+ "VND": true, "YER": true, "ZMW": true, "ZWL": true, "XBA": true,
+ "XBB": true, "XBC": true, "XBD": true, "XTS": true, "XXX": true,
+ "XAU": true, "XPD": true, "XPT": true, "XAG": true,
+}
+
+var iso4217_numeric = map[int]bool{
+ 8: true, 12: true, 32: true, 36: true, 44: true,
+ 48: true, 50: true, 51: true, 52: true, 60: true,
+ 64: true, 68: true, 72: true, 84: true, 90: true,
+ 96: true, 104: true, 108: true, 116: true, 124: true,
+ 132: true, 136: true, 144: true, 152: true, 156: true,
+ 170: true, 174: true, 188: true, 191: true, 192: true,
+ 203: true, 208: true, 214: true, 222: true, 230: true,
+ 232: true, 238: true, 242: true, 262: true, 270: true,
+ 292: true, 320: true, 324: true, 328: true, 332: true,
+ 340: true, 344: true, 348: true, 352: true, 356: true,
+ 360: true, 364: true, 368: true, 376: true, 388: true,
+ 392: true, 398: true, 400: true, 404: true, 408: true,
+ 410: true, 414: true, 417: true, 418: true, 422: true,
+ 426: true, 430: true, 434: true, 446: true, 454: true,
+ 458: true, 462: true, 480: true, 484: true, 496: true,
+ 498: true, 504: true, 512: true, 516: true, 524: true,
+ 532: true, 533: true, 548: true, 554: true, 558: true,
+ 566: true, 578: true, 586: true, 590: true, 598: true,
+ 600: true, 604: true, 608: true, 634: true, 643: true,
+ 646: true, 654: true, 682: true, 690: true, 694: true,
+ 702: true, 704: true, 706: true, 710: true, 728: true,
+ 748: true, 752: true, 756: true, 760: true, 764: true,
+ 776: true, 780: true, 784: true, 788: true, 800: true,
+ 807: true, 818: true, 826: true, 834: true, 840: true,
+ 858: true, 860: true, 882: true, 886: true, 901: true,
+ 927: true, 928: true, 929: true, 930: true, 931: true,
+ 932: true, 933: true, 934: true, 936: true, 938: true,
+ 940: true, 941: true, 943: true, 944: true, 946: true,
+ 947: true, 948: true, 949: true, 950: true, 951: true,
+ 952: true, 953: true, 955: true, 956: true, 957: true,
+ 958: true, 959: true, 960: true, 961: true, 962: true,
+ 963: true, 964: true, 965: true, 967: true, 968: true,
+ 969: true, 970: true, 971: true, 972: true, 973: true,
+ 975: true, 976: true, 977: true, 978: true, 979: true,
+ 980: true, 981: true, 984: true, 985: true, 986: true,
+ 990: true, 994: true, 997: true, 999: true,
+}
diff --git a/vendor/github.com/go-playground/validator/v10/doc.go b/vendor/github.com/go-playground/validator/v10/doc.go
index 291c629d4..8c2584792 100644
--- a/vendor/github.com/go-playground/validator/v10/doc.go
+++ b/vendor/github.com/go-playground/validator/v10/doc.go
@@ -7,6 +7,14 @@ and has the ability to dive into arrays and maps of any type.
see more examples https://github.com/go-playground/validator/tree/master/_examples
+Singleton
+
+Validator is designed to be thread-safe and used as a singleton instance.
+It caches information about your struct and validations,
+in essence only parsing your validation tags once per struct type.
+Using multiple instances neglects the benefit of caching.
+The not thread-safe functions are explicitly marked as such in the documentation.
+
Validation Functions Return Type error
Doing things this way is actually the way the standard library does, see the
@@ -245,6 +253,40 @@ ensures the value is not nil.
Usage: required
+Required If
+
+The field under validation must be present and not empty only if all
+the other specified fields are equal to the value following the specified
+field. For strings ensures value is not "". For slices, maps, pointers,
+interfaces, channels and functions ensures the value is not nil.
+
+ Usage: required_if
+
+Examples:
+
+ // require the field if the Field1 is equal to the parameter given:
+ Usage: required_if=Field1 foobar
+
+ // require the field if the Field1 and Field2 is equal to the value respectively:
+ Usage: required_if=Field1 foo Field2 bar
+
+Required Unless
+
+The field under validation must be present and not empty unless all
+the other specified fields are equal to the value following the specified
+field. For strings ensures value is not "". For slices, maps, pointers,
+interfaces, channels and functions ensures the value is not nil.
+
+ Usage: required_unless
+
+Examples:
+
+ // require the field unless the Field1 is equal to the parameter given:
+ Usage: required_unless=Field1 foobar
+
+ // require the field unless the Field1 and Field2 is equal to the value respectively:
+ Usage: required_unless=Field1 foo Field2 bar
+
Required With
The field under validation must be present and not empty only if any
@@ -321,8 +363,17 @@ equal to the parameter given. For strings, it checks that
the string length is exactly that number of characters. For slices,
arrays, and maps, validates the number of items.
+Example #1
+
Usage: len=10
+Example #2 (time.Duration)
+
+For time.Duration, len will ensure that the value is equal to the duration given
+in the parameter.
+
+ Usage: len=1h30m
+
Maximum
For numbers, max will ensure that the value is
@@ -330,8 +381,17 @@ less than or equal to the parameter given. For strings, it checks
that the string length is at most that number of characters. For
slices, arrays, and maps, validates the number of items.
+Example #1
+
Usage: max=10
+Example #2 (time.Duration)
+
+For time.Duration, max will ensure that the value is less than or equal to the
+duration given in the parameter.
+
+ Usage: max=1h30m
+
Minimum
For numbers, min will ensure that the value is
@@ -339,24 +399,51 @@ greater or equal to the parameter given. For strings, it checks that
the string length is at least that number of characters. For slices,
arrays, and maps, validates the number of items.
+Example #1
+
Usage: min=10
+Example #2 (time.Duration)
+
+For time.Duration, min will ensure that the value is greater than or equal to
+the duration given in the parameter.
+
+ Usage: min=1h30m
+
Equals
For strings & numbers, eq will ensure that the value is
equal to the parameter given. For slices, arrays, and maps,
validates the number of items.
+Example #1
+
Usage: eq=10
+Example #2 (time.Duration)
+
+For time.Duration, eq will ensure that the value is equal to the duration given
+in the parameter.
+
+ Usage: eq=1h30m
+
Not Equal
For strings & numbers, ne will ensure that the value is not
equal to the parameter given. For slices, arrays, and maps,
validates the number of items.
+Example #1
+
Usage: ne=10
+Example #2 (time.Duration)
+
+For time.Duration, ne will ensure that the value is not equal to the duration
+given in the parameter.
+
+ Usage: ne=1h30m
+
One Of
For strings, ints, and uints, oneof will ensure that the value
@@ -386,11 +473,17 @@ For time.Time ensures the time value is greater than time.Now.UTC().
Usage: gt
+Example #3 (time.Duration)
+
+For time.Duration, gt will ensure that the value is greater than the duration
+given in the parameter.
+
+ Usage: gt=1h30m
+
Greater Than or Equal
Same as 'min' above. Kept both to make terminology with 'len' easier.
-
Example #1
Usage: gte=10
@@ -401,6 +494,13 @@ For time.Time ensures the time value is greater than or equal to time.Now.UTC().
Usage: gte
+Example #3 (time.Duration)
+
+For time.Duration, gte will ensure that the value is greater than or equal to
+the duration given in the parameter.
+
+ Usage: gte=1h30m
+
Less Than
For numbers, this will ensure that the value is less than the parameter given.
@@ -412,10 +512,18 @@ Example #1
Usage: lt=10
Example #2 (time.Time)
+
For time.Time ensures the time value is less than time.Now.UTC().
Usage: lt
+Example #3 (time.Duration)
+
+For time.Duration, lt will ensure that the value is less than the duration given
+in the parameter.
+
+ Usage: lt=1h30m
+
Less Than or Equal
Same as 'max' above. Kept both to make terminology with 'len' easier.
@@ -430,6 +538,13 @@ For time.Time ensures the time value is less than or equal to time.Now.UTC().
Usage: lte
+Example #3 (time.Duration)
+
+For time.Duration, lte will ensure that the value is less than or equal to the
+duration given in the parameter.
+
+ Usage: lte=1h30m
+
Field Equals Another Field
This will validate the field value against another fields value either within
@@ -476,9 +591,9 @@ relative to the top level struct.
Field Greater Than Another Field
-Only valid for Numbers and time.Time types, this will validate the field value
-against another fields value either within a struct or passed in field.
-usage examples are for validation of a Start and End date:
+Only valid for Numbers, time.Duration and time.Time types, this will validate
+the field value against another fields value either within a struct or passed in
+field. usage examples are for validation of a Start and End date:
Example #1:
@@ -490,7 +605,6 @@ Example #2:
// Validating by field:
validate.VarWithValue(start, end, "gtfield")
-
Field Greater Than Another Relative Field
This does the same as gtfield except that it validates the field provided
@@ -500,9 +614,9 @@ relative to the top level struct.
Field Greater Than or Equal To Another Field
-Only valid for Numbers and time.Time types, this will validate the field value
-against another fields value either within a struct or passed in field.
-usage examples are for validation of a Start and End date:
+Only valid for Numbers, time.Duration and time.Time types, this will validate
+the field value against another fields value either within a struct or passed in
+field. usage examples are for validation of a Start and End date:
Example #1:
@@ -523,9 +637,9 @@ to the top level struct.
Less Than Another Field
-Only valid for Numbers and time.Time types, this will validate the field value
-against another fields value either within a struct or passed in field.
-usage examples are for validation of a Start and End date:
+Only valid for Numbers, time.Duration and time.Time types, this will validate
+the field value against another fields value either within a struct or passed in
+field. usage examples are for validation of a Start and End date:
Example #1:
@@ -546,9 +660,9 @@ to the top level struct.
Less Than or Equal To Another Field
-Only valid for Numbers and time.Time types, this will validate the field value
-against another fields value either within a struct or passed in field.
-usage examples are for validation of a Start and End date:
+Only valid for Numbers, time.Duration and time.Time types, this will validate
+the field value against another fields value either within a struct or passed in
+field. usage examples are for validation of a Start and End date:
Example #1:
@@ -620,6 +734,19 @@ This validates that a string value contains unicode alphanumeric characters only
Usage: alphanumunicode
+Boolean
+
+This validates that a string value can successfully be parsed into a boolean with strconv.ParseBool
+
+ Usage: boolean
+
+Number
+
+This validates that a string value contains number values only.
+For integers or float it returns true.
+
+ Usage: number
+
Numeric
This validates that a string value contains a basic numeric value.
@@ -677,6 +804,13 @@ This validates that a string value contains a valid hsla color
Usage: hsla
+E.164 Phone Number String
+
+This validates that a string value contains a valid E.164 Phone number
+https://en.wikipedia.org/wiki/E.164 (ex. +1123456789)
+
+ Usage: e164
+
E-mail String
This validates that a string value contains a valid email
@@ -691,6 +825,12 @@ This validates that a string value is valid JSON
Usage: json
+JWT String
+
+This validates that a string value is a valid JWT
+
+ Usage: jwt
+
File path
This validates that a string value contains a valid file path and that
@@ -759,8 +899,7 @@ Special thanks to Pieter Wuille for providng reference implementations.
Ethereum Address
This validates that a string value contains a valid ethereum address.
-The format of the string is checked to ensure it matches the standard Ethereum address format
-Full validation is blocked by https://github.com/golang/crypto/pull/28
+The format of the string is checked to ensure it matches the standard Ethereum address format.
Usage: eth_addr
@@ -814,6 +953,18 @@ This validates that a string value ends with the supplied string value
Usage: endswith=goodbye
+Does Not Start With
+
+This validates that a string value does not start with the supplied string value
+
+ Usage: startsnotwith=hello
+
+Does Not End With
+
+This validates that a string value does not end with the supplied string value
+
+ Usage: endsnotwith=goodbye
+
International Standard Book Number
This validates that a string value contains a valid isbn10 or isbn13 value.
@@ -1069,6 +1220,50 @@ Supplied format must match the official Go time format layout as documented in h
Usage: datetime=2006-01-02
+Iso3166-1 alpha-2
+
+This validates that a string value is a valid country code based on iso3166-1 alpha-2 standard.
+see: https://www.iso.org/iso-3166-country-codes.html
+
+ Usage: iso3166_1_alpha2
+
+Iso3166-1 alpha-3
+
+This validates that a string value is a valid country code based on iso3166-1 alpha-3 standard.
+see: https://www.iso.org/iso-3166-country-codes.html
+
+ Usage: iso3166_1_alpha3
+
+Iso3166-1 alpha-numeric
+
+This validates that a string value is a valid country code based on iso3166-1 alpha-numeric standard.
+see: https://www.iso.org/iso-3166-country-codes.html
+
+ Usage: iso3166_1_alpha3
+
+BCP 47 Language Tag
+
+This validates that a string value is a valid BCP 47 language tag, as parsed by language.Parse.
+More information on https://pkg.go.dev/golang.org/x/text/language
+
+ Usage: bcp47_language_tag
+
+BIC (SWIFT code)
+
+This validates that a string value is a valid Business Identifier Code (SWIFT code), defined in ISO 9362.
+More information on https://www.iso.org/standard/60390.html
+
+ Usage: bic
+
+TimeZone
+
+This validates that a string value is a valid time zone based on the time zone database present on the system.
+Although empty value and Local value are allowed by time.LoadLocation golang function, they are not allowed by this validator.
+More information on https://golang.org/pkg/time/#LoadLocation
+
+ Usage: timezone
+
+
Alias Validators and Tags
NOTE: When returning an error, the tag returned in "FieldError" will be
@@ -1080,6 +1275,8 @@ Here is a list of the current built in alias tags:
"iscolor"
alias is "hexcolor|rgb|rgba|hsl|hsla" (Usage: iscolor)
+ "country_code"
+ alias is "iso3166_1_alpha2|iso3166_1_alpha3|iso3166_1_alpha_numeric" (Usage: country_code)
Validator notes:
diff --git a/vendor/github.com/go-playground/validator/v10/errors.go b/vendor/github.com/go-playground/validator/v10/errors.go
index 46c24c9b2..9a1b1abe9 100644
--- a/vendor/github.com/go-playground/validator/v10/errors.go
+++ b/vendor/github.com/go-playground/validator/v10/errors.go
@@ -82,7 +82,7 @@ func (ve ValidationErrors) Translate(ut ut.Translator) ValidationErrorsTranslati
// FieldError contains all functions to get error details
type FieldError interface {
- // returns the validation tag that failed. if the
+ // Tag returns the validation tag that failed. if the
// validation was an alias, this will return the
// alias name and not the underlying tag that failed.
//
@@ -90,7 +90,7 @@ type FieldError interface {
// will return "iscolor"
Tag() string
- // returns the validation tag that failed, even if an
+ // ActualTag returns the validation tag that failed, even if an
// alias the actual tag within the alias will be returned.
// If an 'or' validation fails the entire or will be returned.
//
@@ -98,8 +98,8 @@ type FieldError interface {
// will return "hexcolor|rgb|rgba|hsl|hsla"
ActualTag() string
- // returns the namespace for the field error, with the tag
- // name taking precedence over the fields actual name.
+ // Namespace returns the namespace for the field error, with the tag
+ // name taking precedence over the field's actual name.
//
// eg. JSON name "User.fname"
//
@@ -109,33 +109,33 @@ type FieldError interface {
// using validate.Field(...) as there is no way to extract it's name
Namespace() string
- // returns the namespace for the field error, with the fields
+ // StructNamespace returns the namespace for the field error, with the field's
// actual name.
//
// eq. "User.FirstName" see Namespace for comparison
//
// NOTE: this field can be blank when validating a single primitive field
- // using validate.Field(...) as there is no way to extract it's name
+ // using validate.Field(...) as there is no way to extract its name
StructNamespace() string
- // returns the fields name with the tag name taking precedence over the
- // fields actual name.
+ // Field returns the fields name with the tag name taking precedence over the
+ // field's actual name.
//
// eq. JSON name "fname"
// see StructField for comparison
Field() string
- // returns the fields actual name from the struct, when able to determine.
+ // StructField returns the field's actual name from the struct, when able to determine.
//
// eq. "FirstName"
// see Field for comparison
StructField() string
- // returns the actual fields value in case needed for creating the error
+ // Value returns the actual field's value in case needed for creating the error
// message
Value() interface{}
- // returns the param value, in string form for comparison; this will also
+ // Param returns the param value, in string form for comparison; this will also
// help with generating an error message
Param() string
@@ -146,15 +146,18 @@ type FieldError interface {
// Type returns the Field's reflect Type
//
- // // eg. time.Time's type is time.Time
+ // eg. time.Time's type is time.Time
Type() reflect.Type
- // returns the FieldError's translated error
+ // Translate returns the FieldError's translated error
// from the provided 'ut.Translator' and registered 'TranslationFunc'
//
// NOTE: if no registered translator can be found it returns the same as
// calling fe.Error()
Translate(ut ut.Translator) string
+
+ // Error returns the FieldError's message
+ Error() string
}
// compile time interface checks
@@ -190,19 +193,19 @@ func (fe *fieldError) ActualTag() string {
}
// Namespace returns the namespace for the field error, with the tag
-// name taking precedence over the fields actual name.
+// name taking precedence over the field's actual name.
func (fe *fieldError) Namespace() string {
return fe.ns
}
-// StructNamespace returns the namespace for the field error, with the fields
+// StructNamespace returns the namespace for the field error, with the field's
// actual name.
func (fe *fieldError) StructNamespace() string {
return fe.structNs
}
-// Field returns the fields name with the tag name taking precedence over the
-// fields actual name.
+// Field returns the field's name with the tag name taking precedence over the
+// field's actual name.
func (fe *fieldError) Field() string {
return fe.ns[len(fe.ns)-int(fe.fieldLen):]
@@ -218,13 +221,13 @@ func (fe *fieldError) Field() string {
// return fld
}
-// returns the fields actual name from the struct, when able to determine.
+// StructField returns the field's actual name from the struct, when able to determine.
func (fe *fieldError) StructField() string {
// return fe.structField
return fe.structNs[len(fe.structNs)-int(fe.structfieldLen):]
}
-// Value returns the actual fields value in case needed for creating the error
+// Value returns the actual field's value in case needed for creating the error
// message
func (fe *fieldError) Value() interface{} {
return fe.value
@@ -254,8 +257,8 @@ func (fe *fieldError) Error() string {
// Translate returns the FieldError's translated error
// from the provided 'ut.Translator' and registered 'TranslationFunc'
//
-// NOTE: is not registered translation can be found it returns the same
-// as calling fe.Error()
+// NOTE: if no registered translation can be found, it returns the original
+// untranslated error message.
func (fe *fieldError) Translate(ut ut.Translator) string {
m, ok := fe.v.transTagFunc[ut]
diff --git a/vendor/github.com/go-playground/validator/v10/field_level.go b/vendor/github.com/go-playground/validator/v10/field_level.go
index f0e2a9a85..ef35826ee 100644
--- a/vendor/github.com/go-playground/validator/v10/field_level.go
+++ b/vendor/github.com/go-playground/validator/v10/field_level.go
@@ -5,24 +5,25 @@ import "reflect"
// FieldLevel contains all the information and helper functions
// to validate a field
type FieldLevel interface {
- // returns the top level struct, if any
+
+ // Top returns the top level struct, if any
Top() reflect.Value
- // returns the current fields parent struct, if any or
+ // Parent returns the current fields parent struct, if any or
// the comparison value if called 'VarWithValue'
Parent() reflect.Value
- // returns current field for validation
+ // Field returns current field for validation
Field() reflect.Value
- // returns the field's name with the tag
+ // FieldName returns the field's name with the tag
// name taking precedence over the fields actual name.
FieldName() string
- // returns the struct field's name
+ // StructFieldName returns the struct field's name
StructFieldName() string
- // returns param for validation against current field
+ // Param returns param for validation against current field
Param() string
// GetTag returns the current validations tag name
@@ -33,7 +34,7 @@ type FieldLevel interface {
// underlying value and it's kind.
ExtractType(field reflect.Value) (value reflect.Value, kind reflect.Kind, nullable bool)
- // traverses the parent struct to retrieve a specific field denoted by the provided namespace
+ // GetStructFieldOK traverses the parent struct to retrieve a specific field denoted by the provided namespace
// in the param and returns the field, field kind and whether is was successful in retrieving
// the field at all.
//
@@ -49,7 +50,7 @@ type FieldLevel interface {
// Deprecated: Use GetStructFieldOKAdvanced2() instead which also return if the value is nullable.
GetStructFieldOKAdvanced(val reflect.Value, namespace string) (reflect.Value, reflect.Kind, bool)
- // traverses the parent struct to retrieve a specific field denoted by the provided namespace
+ // GetStructFieldOK2 traverses the parent struct to retrieve a specific field denoted by the provided namespace
// in the param and returns the field, field kind, if it's a nullable type and whether is was successful in retrieving
// the field at all.
//
@@ -57,7 +58,7 @@ type FieldLevel interface {
// could not be retrieved because it didn't exist.
GetStructFieldOK2() (reflect.Value, reflect.Kind, bool, bool)
- // GetStructFieldOKAdvanced is the same as GetStructFieldOK except that it accepts the parent struct to start looking for
+ // GetStructFieldOKAdvanced2 is the same as GetStructFieldOK except that it accepts the parent struct to start looking for
// the field and namespace allowing more extensibility for validators.
GetStructFieldOKAdvanced2(val reflect.Value, namespace string) (reflect.Value, reflect.Kind, bool, bool)
}
@@ -107,12 +108,12 @@ func (v *validate) GetStructFieldOKAdvanced(val reflect.Value, namespace string)
return current, kind, found
}
-// GetStructFieldOK returns Param returns param for validation against current field
+// GetStructFieldOK2 returns Param returns param for validation against current field
func (v *validate) GetStructFieldOK2() (reflect.Value, reflect.Kind, bool, bool) {
return v.getStructFieldOKInternal(v.slflParent, v.ct.param)
}
-// GetStructFieldOKAdvanced is the same as GetStructFieldOK except that it accepts the parent struct to start looking for
+// GetStructFieldOKAdvanced2 is the same as GetStructFieldOK except that it accepts the parent struct to start looking for
// the field and namespace allowing more extensibility for validators.
func (v *validate) GetStructFieldOKAdvanced2(val reflect.Value, namespace string) (reflect.Value, reflect.Kind, bool, bool) {
return v.getStructFieldOKInternal(val, namespace)
diff --git a/vendor/github.com/go-playground/validator/v10/go.mod b/vendor/github.com/go-playground/validator/v10/go.mod
index 21316b3ab..ddecff628 100644
--- a/vendor/github.com/go-playground/validator/v10/go.mod
+++ b/vendor/github.com/go-playground/validator/v10/go.mod
@@ -3,8 +3,17 @@ module github.com/go-playground/validator/v10
go 1.13
require (
+ github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-playground/assert/v2 v2.0.1
- github.com/go-playground/locales v0.13.0
- github.com/go-playground/universal-translator v0.17.0
- github.com/leodido/go-urn v1.2.0
+ github.com/go-playground/locales v0.14.0
+ github.com/go-playground/universal-translator v0.18.0
+ github.com/kr/pretty v0.3.0 // indirect
+ github.com/leodido/go-urn v1.2.1
+ github.com/rogpeppe/go-internal v1.8.0 // indirect
+ github.com/stretchr/testify v1.7.0 // indirect
+ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97
+ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect
+ golang.org/x/text v0.3.6
+ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
+ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
diff --git a/vendor/github.com/go-playground/validator/v10/go.sum b/vendor/github.com/go-playground/validator/v10/go.sum
index dc7dec4de..57500933f 100644
--- a/vendor/github.com/go-playground/validator/v10/go.sum
+++ b/vendor/github.com/go-playground/validator/v10/go.sum
@@ -1,21 +1,50 @@
-github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
+github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+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/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
-github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
-github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
-github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
-github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
-github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
-github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
+github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=
+github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
+github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho=
+github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
+github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
+github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
+github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
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/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
+github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
+github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
-github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI=
+golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 h1:siQdpVirKtzPhKl3lZWozZraCFObP8S1v6PRp0bLrtU=
+golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-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/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
-gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
+gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
+gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/vendor/github.com/go-playground/validator/v10/postcode_regexes.go b/vendor/github.com/go-playground/validator/v10/postcode_regexes.go
new file mode 100644
index 000000000..e7e7b687f
--- /dev/null
+++ b/vendor/github.com/go-playground/validator/v10/postcode_regexes.go
@@ -0,0 +1,173 @@
+package validator
+
+import "regexp"
+
+var postCodePatternDict = map[string]string{
+ "GB": `^GIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}))|BFPO[ ]?\d{1,4}$`,
+ "JE": `^JE\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$`,
+ "GG": `^GY\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$`,
+ "IM": `^IM\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$`,
+ "US": `^\d{5}([ \-]\d{4})?$`,
+ "CA": `^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ ]?\d[ABCEGHJ-NPRSTV-Z]\d$`,
+ "DE": `^\d{5}$`,
+ "JP": `^\d{3}-\d{4}$`,
+ "FR": `^\d{2}[ ]?\d{3}$`,
+ "AU": `^\d{4}$`,
+ "IT": `^\d{5}$`,
+ "CH": `^\d{4}$`,
+ "AT": `^\d{4}$`,
+ "ES": `^\d{5}$`,
+ "NL": `^\d{4}[ ]?[A-Z]{2}$`,
+ "BE": `^\d{4}$`,
+ "DK": `^\d{4}$`,
+ "SE": `^\d{3}[ ]?\d{2}$`,
+ "NO": `^\d{4}$`,
+ "BR": `^\d{5}[\-]?\d{3}$`,
+ "PT": `^\d{4}([\-]\d{3})?$`,
+ "FI": `^\d{5}$`,
+ "AX": `^22\d{3}$`,
+ "KR": `^\d{3}[\-]\d{3}$`,
+ "CN": `^\d{6}$`,
+ "TW": `^\d{3}(\d{2})?$`,
+ "SG": `^\d{6}$`,
+ "DZ": `^\d{5}$`,
+ "AD": `^AD\d{3}$`,
+ "AR": `^([A-HJ-NP-Z])?\d{4}([A-Z]{3})?$`,
+ "AM": `^(37)?\d{4}$`,
+ "AZ": `^\d{4}$`,
+ "BH": `^((1[0-2]|[2-9])\d{2})?$`,
+ "BD": `^\d{4}$`,
+ "BB": `^(BB\d{5})?$`,
+ "BY": `^\d{6}$`,
+ "BM": `^[A-Z]{2}[ ]?[A-Z0-9]{2}$`,
+ "BA": `^\d{5}$`,
+ "IO": `^BBND 1ZZ$`,
+ "BN": `^[A-Z]{2}[ ]?\d{4}$`,
+ "BG": `^\d{4}$`,
+ "KH": `^\d{5}$`,
+ "CV": `^\d{4}$`,
+ "CL": `^\d{7}$`,
+ "CR": `^\d{4,5}|\d{3}-\d{4}$`,
+ "HR": `^\d{5}$`,
+ "CY": `^\d{4}$`,
+ "CZ": `^\d{3}[ ]?\d{2}$`,
+ "DO": `^\d{5}$`,
+ "EC": `^([A-Z]\d{4}[A-Z]|(?:[A-Z]{2})?\d{6})?$`,
+ "EG": `^\d{5}$`,
+ "EE": `^\d{5}$`,
+ "FO": `^\d{3}$`,
+ "GE": `^\d{4}$`,
+ "GR": `^\d{3}[ ]?\d{2}$`,
+ "GL": `^39\d{2}$`,
+ "GT": `^\d{5}$`,
+ "HT": `^\d{4}$`,
+ "HN": `^(?:\d{5})?$`,
+ "HU": `^\d{4}$`,
+ "IS": `^\d{3}$`,
+ "IN": `^\d{6}$`,
+ "ID": `^\d{5}$`,
+ "IL": `^\d{5}$`,
+ "JO": `^\d{5}$`,
+ "KZ": `^\d{6}$`,
+ "KE": `^\d{5}$`,
+ "KW": `^\d{5}$`,
+ "LA": `^\d{5}$`,
+ "LV": `^\d{4}$`,
+ "LB": `^(\d{4}([ ]?\d{4})?)?$`,
+ "LI": `^(948[5-9])|(949[0-7])$`,
+ "LT": `^\d{5}$`,
+ "LU": `^\d{4}$`,
+ "MK": `^\d{4}$`,
+ "MY": `^\d{5}$`,
+ "MV": `^\d{5}$`,
+ "MT": `^[A-Z]{3}[ ]?\d{2,4}$`,
+ "MU": `^(\d{3}[A-Z]{2}\d{3})?$`,
+ "MX": `^\d{5}$`,
+ "MD": `^\d{4}$`,
+ "MC": `^980\d{2}$`,
+ "MA": `^\d{5}$`,
+ "NP": `^\d{5}$`,
+ "NZ": `^\d{4}$`,
+ "NI": `^((\d{4}-)?\d{3}-\d{3}(-\d{1})?)?$`,
+ "NG": `^(\d{6})?$`,
+ "OM": `^(PC )?\d{3}$`,
+ "PK": `^\d{5}$`,
+ "PY": `^\d{4}$`,
+ "PH": `^\d{4}$`,
+ "PL": `^\d{2}-\d{3}$`,
+ "PR": `^00[679]\d{2}([ \-]\d{4})?$`,
+ "RO": `^\d{6}$`,
+ "RU": `^\d{6}$`,
+ "SM": `^4789\d$`,
+ "SA": `^\d{5}$`,
+ "SN": `^\d{5}$`,
+ "SK": `^\d{3}[ ]?\d{2}$`,
+ "SI": `^\d{4}$`,
+ "ZA": `^\d{4}$`,
+ "LK": `^\d{5}$`,
+ "TJ": `^\d{6}$`,
+ "TH": `^\d{5}$`,
+ "TN": `^\d{4}$`,
+ "TR": `^\d{5}$`,
+ "TM": `^\d{6}$`,
+ "UA": `^\d{5}$`,
+ "UY": `^\d{5}$`,
+ "UZ": `^\d{6}$`,
+ "VA": `^00120$`,
+ "VE": `^\d{4}$`,
+ "ZM": `^\d{5}$`,
+ "AS": `^96799$`,
+ "CC": `^6799$`,
+ "CK": `^\d{4}$`,
+ "RS": `^\d{6}$`,
+ "ME": `^8\d{4}$`,
+ "CS": `^\d{5}$`,
+ "YU": `^\d{5}$`,
+ "CX": `^6798$`,
+ "ET": `^\d{4}$`,
+ "FK": `^FIQQ 1ZZ$`,
+ "NF": `^2899$`,
+ "FM": `^(9694[1-4])([ \-]\d{4})?$`,
+ "GF": `^9[78]3\d{2}$`,
+ "GN": `^\d{3}$`,
+ "GP": `^9[78][01]\d{2}$`,
+ "GS": `^SIQQ 1ZZ$`,
+ "GU": `^969[123]\d([ \-]\d{4})?$`,
+ "GW": `^\d{4}$`,
+ "HM": `^\d{4}$`,
+ "IQ": `^\d{5}$`,
+ "KG": `^\d{6}$`,
+ "LR": `^\d{4}$`,
+ "LS": `^\d{3}$`,
+ "MG": `^\d{3}$`,
+ "MH": `^969[67]\d([ \-]\d{4})?$`,
+ "MN": `^\d{6}$`,
+ "MP": `^9695[012]([ \-]\d{4})?$`,
+ "MQ": `^9[78]2\d{2}$`,
+ "NC": `^988\d{2}$`,
+ "NE": `^\d{4}$`,
+ "VI": `^008(([0-4]\d)|(5[01]))([ \-]\d{4})?$`,
+ "VN": `^[0-9]{1,6}$`,
+ "PF": `^987\d{2}$`,
+ "PG": `^\d{3}$`,
+ "PM": `^9[78]5\d{2}$`,
+ "PN": `^PCRN 1ZZ$`,
+ "PW": `^96940$`,
+ "RE": `^9[78]4\d{2}$`,
+ "SH": `^(ASCN|STHL) 1ZZ$`,
+ "SJ": `^\d{4}$`,
+ "SO": `^\d{5}$`,
+ "SZ": `^[HLMS]\d{3}$`,
+ "TC": `^TKCA 1ZZ$`,
+ "WF": `^986\d{2}$`,
+ "XK": `^\d{5}$`,
+ "YT": `^976\d{2}$`,
+}
+
+var postCodeRegexDict = map[string]*regexp.Regexp{}
+
+func init() {
+ for countryCode, pattern := range postCodePatternDict {
+ postCodeRegexDict[countryCode] = regexp.MustCompile(pattern)
+ }
+}
diff --git a/vendor/github.com/go-playground/validator/v10/regexes.go b/vendor/github.com/go-playground/validator/v10/regexes.go
index b8bf25316..df00c4ebc 100644
--- a/vendor/github.com/go-playground/validator/v10/regexes.go
+++ b/vendor/github.com/go-playground/validator/v10/regexes.go
@@ -9,8 +9,8 @@ const (
alphaUnicodeNumericRegexString = "^[\\p{L}\\p{N}]+$"
numericRegexString = "^[-+]?[0-9]+(?:\\.[0-9]+)?$"
numberRegexString = "^[0-9]+$"
- hexadecimalRegexString = "^[0-9a-fA-F]+$"
- hexcolorRegexString = "^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"
+ hexadecimalRegexString = "^(0[xX])?[0-9a-fA-F]+$"
+ hexColorRegexString = "^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"
rgbRegexString = "^rgb\\(\\s*(?:(?:0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(?:0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(?:0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])|(?:0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])%\\s*,\\s*(?:0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])%\\s*,\\s*(?:0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])%)\\s*\\)$"
rgbaRegexString = "^rgba\\(\\s*(?:(?:0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(?:0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(?:0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])|(?:0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])%\\s*,\\s*(?:0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])%\\s*,\\s*(?:0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])%)\\s*,\\s*(?:(?:0.[1-9]*)|[01])\\s*\\)$"
hslRegexString = "^hsl\\(\\s*(?:0|[1-9]\\d?|[12]\\d\\d|3[0-5]\\d|360)\\s*,\\s*(?:(?:0|[1-9]\\d?|100)%)\\s*,\\s*(?:(?:0|[1-9]\\d?|100)%)\\s*\\)$"
@@ -36,18 +36,21 @@ const (
latitudeRegexString = "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?)$"
longitudeRegexString = "^[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$"
sSNRegexString = `^[0-9]{3}[ -]?(0[1-9]|[1-9][0-9])[ -]?([1-9][0-9]{3}|[0-9][1-9][0-9]{2}|[0-9]{2}[1-9][0-9]|[0-9]{3}[1-9])$`
- hostnameRegexStringRFC952 = `^[a-zA-Z][a-zA-Z0-9\-\.]+[a-zA-Z0-9]$` // https://tools.ietf.org/html/rfc952
- hostnameRegexStringRFC1123 = `^([a-zA-Z0-9]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*?$` // accepts hostname starting with a digit https://tools.ietf.org/html/rfc1123
- btcAddressRegexString = `^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$` // bitcoin address
- btcAddressUpperRegexStringBech32 = `^BC1[02-9AC-HJ-NP-Z]{7,76}$` // bitcoin bech32 address https://en.bitcoin.it/wiki/Bech32
- btcAddressLowerRegexStringBech32 = `^bc1[02-9ac-hj-np-z]{7,76}$` // bitcoin bech32 address https://en.bitcoin.it/wiki/Bech32
+ hostnameRegexStringRFC952 = `^[a-zA-Z]([a-zA-Z0-9\-]+[\.]?)*[a-zA-Z0-9]$` // https://tools.ietf.org/html/rfc952
+ hostnameRegexStringRFC1123 = `^([a-zA-Z0-9]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*?$` // accepts hostname starting with a digit https://tools.ietf.org/html/rfc1123
+ fqdnRegexStringRFC1123 = `^([a-zA-Z0-9]{1}[a-zA-Z0-9_-]{0,62})(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*?(\.[a-zA-Z]{1}[a-zA-Z0-9]{0,62})\.?$` // same as hostnameRegexStringRFC1123 but must contain a non numerical TLD (possibly ending with '.')
+ btcAddressRegexString = `^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$` // bitcoin address
+ btcAddressUpperRegexStringBech32 = `^BC1[02-9AC-HJ-NP-Z]{7,76}$` // bitcoin bech32 address https://en.bitcoin.it/wiki/Bech32
+ btcAddressLowerRegexStringBech32 = `^bc1[02-9ac-hj-np-z]{7,76}$` // bitcoin bech32 address https://en.bitcoin.it/wiki/Bech32
ethAddressRegexString = `^0x[0-9a-fA-F]{40}$`
ethAddressUpperRegexString = `^0x[0-9A-F]{40}$`
ethAddressLowerRegexString = `^0x[0-9a-f]{40}$`
- uRLEncodedRegexString = `(%[A-Fa-f0-9]{2})`
+ uRLEncodedRegexString = `^(?:[^%]|%[0-9A-Fa-f]{2})*$`
hTMLEncodedRegexString = `[x]?([0-9a-fA-F]{2})|(>)|(<)|(")|(&)+[;]?`
hTMLRegexString = `<[/]?([a-zA-Z]+).*?>`
+ jWTRegexString = "^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$"
splitParamsRegexString = `'[^']*'|\S+`
+ bicRegexString = `^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$`
)
var (
@@ -58,7 +61,7 @@ var (
numericRegex = regexp.MustCompile(numericRegexString)
numberRegex = regexp.MustCompile(numberRegexString)
hexadecimalRegex = regexp.MustCompile(hexadecimalRegexString)
- hexcolorRegex = regexp.MustCompile(hexcolorRegexString)
+ hexColorRegex = regexp.MustCompile(hexColorRegexString)
rgbRegex = regexp.MustCompile(rgbRegexString)
rgbaRegex = regexp.MustCompile(rgbaRegexString)
hslRegex = regexp.MustCompile(hslRegexString)
@@ -86,14 +89,17 @@ var (
sSNRegex = regexp.MustCompile(sSNRegexString)
hostnameRegexRFC952 = regexp.MustCompile(hostnameRegexStringRFC952)
hostnameRegexRFC1123 = regexp.MustCompile(hostnameRegexStringRFC1123)
+ fqdnRegexRFC1123 = regexp.MustCompile(fqdnRegexStringRFC1123)
btcAddressRegex = regexp.MustCompile(btcAddressRegexString)
btcUpperAddressRegexBech32 = regexp.MustCompile(btcAddressUpperRegexStringBech32)
btcLowerAddressRegexBech32 = regexp.MustCompile(btcAddressLowerRegexStringBech32)
ethAddressRegex = regexp.MustCompile(ethAddressRegexString)
- ethaddressRegexUpper = regexp.MustCompile(ethAddressUpperRegexString)
+ ethAddressRegexUpper = regexp.MustCompile(ethAddressUpperRegexString)
ethAddressRegexLower = regexp.MustCompile(ethAddressLowerRegexString)
uRLEncodedRegex = regexp.MustCompile(uRLEncodedRegexString)
hTMLEncodedRegex = regexp.MustCompile(hTMLEncodedRegexString)
hTMLRegex = regexp.MustCompile(hTMLRegexString)
+ jWTRegex = regexp.MustCompile(jWTRegexString)
splitParamsRegex = regexp.MustCompile(splitParamsRegexString)
+ bicRegex = regexp.MustCompile(bicRegexString)
)
diff --git a/vendor/github.com/go-playground/validator/v10/struct_level.go b/vendor/github.com/go-playground/validator/v10/struct_level.go
index 57691ee38..c0d89cfbe 100644
--- a/vendor/github.com/go-playground/validator/v10/struct_level.go
+++ b/vendor/github.com/go-playground/validator/v10/struct_level.go
@@ -23,18 +23,18 @@ func wrapStructLevelFunc(fn StructLevelFunc) StructLevelFuncCtx {
// to validate a struct
type StructLevel interface {
- // returns the main validation object, in case one wants to call validations internally.
+ // Validator returns the main validation object, in case one wants to call validations internally.
// this is so you don't have to use anonymous functions to get access to the validate
// instance.
Validator() *Validate
- // returns the top level struct, if any
+ // Top returns the top level struct, if any
Top() reflect.Value
- // returns the current fields parent struct, if any
+ // Parent returns the current fields parent struct, if any
Parent() reflect.Value
- // returns the current struct.
+ // Current returns the current struct.
Current() reflect.Value
// ExtractType gets the actual underlying type of field value.
@@ -42,7 +42,7 @@ type StructLevel interface {
// underlying value and its kind.
ExtractType(field reflect.Value) (value reflect.Value, kind reflect.Kind, nullable bool)
- // reports an error just by passing the field and tag information
+ // ReportError reports an error just by passing the field and tag information
//
// NOTES:
//
@@ -54,7 +54,7 @@ type StructLevel interface {
// and process on the flip side it's up to you.
ReportError(field interface{}, fieldName, structFieldName string, tag, param string)
- // reports an error just by passing ValidationErrors
+ // ReportValidationErrors reports an error just by passing ValidationErrors
//
// NOTES:
//
diff --git a/vendor/github.com/go-playground/validator/v10/util.go b/vendor/github.com/go-playground/validator/v10/util.go
index 0d3a18103..56420f430 100644
--- a/vendor/github.com/go-playground/validator/v10/util.go
+++ b/vendor/github.com/go-playground/validator/v10/util.go
@@ -4,6 +4,7 @@ import (
"reflect"
"strconv"
"strings"
+ "time"
)
// extractTypeInternal gets the actual underlying type of field value.
@@ -222,13 +223,34 @@ BEGIN:
// asInt returns the parameter as a int64
// or panics if it can't convert
func asInt(param string) int64 {
-
i, err := strconv.ParseInt(param, 0, 64)
panicIf(err)
return i
}
+// asIntFromTimeDuration parses param as time.Duration and returns it as int64
+// or panics on error.
+func asIntFromTimeDuration(param string) int64 {
+ d, err := time.ParseDuration(param)
+ if err != nil {
+ // attempt parsing as an an integer assuming nanosecond precision
+ return asInt(param)
+ }
+ return int64(d)
+}
+
+// asIntFromType calls the proper function to parse param as int64,
+// given a field's Type t.
+func asIntFromType(t reflect.Type, param string) int64 {
+ switch t {
+ case timeDurationType:
+ return asIntFromTimeDuration(param)
+ default:
+ return asInt(param)
+ }
+}
+
// asUint returns the parameter as a uint64
// or panics if it can't convert
func asUint(param string) uint64 {
diff --git a/vendor/github.com/go-playground/validator/v10/validator.go b/vendor/github.com/go-playground/validator/v10/validator.go
index 342e72e31..2a4fad022 100644
--- a/vendor/github.com/go-playground/validator/v10/validator.go
+++ b/vendor/github.com/go-playground/validator/v10/validator.go
@@ -74,7 +74,7 @@ func (v *validate) validateStruct(ctx context.Context, parent reflect.Value, cur
}
}
- v.traverseField(ctx, parent, current.Field(f.idx), ns, structNs, f, f.cTags)
+ v.traverseField(ctx, current, current.Field(f.idx), ns, structNs, f, f.cTags)
}
}
@@ -222,12 +222,12 @@ func (v *validate) traverseField(ctx context.Context, parent reflect.Value, curr
structNs = append(append(structNs, cf.name...), '.')
}
- v.validateStruct(ctx, current, current, typ, ns, structNs, ct)
+ v.validateStruct(ctx, parent, current, typ, ns, structNs, ct)
return
}
}
- if !ct.hasTag {
+ if ct == nil || !ct.hasTag {
return
}
@@ -249,7 +249,7 @@ OUTER:
v.cf = cf
v.ct = ct
- if !v.fldIsPointer && !hasValue(v) {
+ if !hasValue(v) {
return
}
diff --git a/vendor/github.com/go-playground/validator/v10/validator_instance.go b/vendor/github.com/go-playground/validator/v10/validator_instance.go
index 4a89d4061..973964fc2 100644
--- a/vendor/github.com/go-playground/validator/v10/validator_instance.go
+++ b/vendor/github.com/go-playground/validator/v10/validator_instance.go
@@ -27,6 +27,12 @@ const (
requiredWithoutTag = "required_without"
requiredWithTag = "required_with"
requiredWithAllTag = "required_with_all"
+ requiredIfTag = "required_if"
+ requiredUnlessTag = "required_unless"
+ excludedWithoutAllTag = "excluded_without_all"
+ excludedWithoutTag = "excluded_without"
+ excludedWithTag = "excluded_with"
+ excludedWithAllTag = "excluded_with_all"
skipValidationTag = "-"
diveTag = "dive"
keysTag = "keys"
@@ -41,7 +47,9 @@ const (
)
var (
- timeType = reflect.TypeOf(time.Time{})
+ timeDurationType = reflect.TypeOf(time.Duration(0))
+ timeType = reflect.TypeOf(time.Time{})
+
defaultCField = &cField{namesEqual: true}
)
@@ -81,6 +89,10 @@ type Validate struct {
}
// New returns a new instance of 'validate' with sane defaults.
+// Validate is designed to be thread-safe and used as a singleton instance.
+// It caches information about your struct and validations,
+// in essence only parsing your validation tags once per struct type.
+// Using multiple instances neglects the benefit of caching.
func New() *Validate {
tc := new(tagCache)
@@ -107,7 +119,8 @@ func New() *Validate {
switch k {
// these require that even if the value is nil that the validation should run, omitempty still overrides this behaviour
- case requiredWithTag, requiredWithAllTag, requiredWithoutTag, requiredWithoutAllTag:
+ case requiredIfTag, requiredUnlessTag, requiredWithTag, requiredWithAllTag, requiredWithoutTag, requiredWithoutAllTag,
+ excludedWithTag, excludedWithAllTag, excludedWithoutTag, excludedWithoutAllTag:
_ = v.registerValidation(k, wrapFunc(val), true, true)
default:
// no need to error check here, baked in will always be valid
@@ -134,6 +147,33 @@ func (v *Validate) SetTagName(name string) {
v.tagName = name
}
+// ValidateMapCtx validates a map using a map of validation rules and allows passing of contextual
+// validation validation information via context.Context.
+func (v Validate) ValidateMapCtx(ctx context.Context, data map[string]interface{}, rules map[string]interface{}) map[string]interface{} {
+ errs := make(map[string]interface{})
+ for field, rule := range rules {
+ if reflect.ValueOf(rule).Kind() == reflect.Map && reflect.ValueOf(data[field]).Kind() == reflect.Map {
+ err := v.ValidateMapCtx(ctx, data[field].(map[string]interface{}), rule.(map[string]interface{}))
+ if len(err) > 0 {
+ errs[field] = err
+ }
+ } else if reflect.ValueOf(rule).Kind() == reflect.Map {
+ errs[field] = errors.New("The field: '" + field + "' is not a map to dive")
+ } else {
+ err := v.VarCtx(ctx, data[field], rule.(string))
+ if err != nil {
+ errs[field] = err
+ }
+ }
+ }
+ return errs
+}
+
+// ValidateMap validates map data form a map of tags
+func (v *Validate) ValidateMap(data map[string]interface{}, rules map[string]interface{}) map[string]interface{} {
+ return v.ValidateMapCtx(context.Background(), data, rules)
+}
+
// RegisterTagNameFunc registers a function to get alternate names for StructFields.
//
// eg. to use the names which have been specified for JSON representations of structs, rather than normal Go field names:
@@ -171,11 +211,11 @@ func (v *Validate) RegisterValidationCtx(tag string, fn FuncCtx, callValidationE
func (v *Validate) registerValidation(tag string, fn FuncCtx, bakedIn bool, nilCheckable bool) error {
if len(tag) == 0 {
- return errors.New("Function Key cannot be empty")
+ return errors.New("function Key cannot be empty")
}
if fn == nil {
- return errors.New("Function cannot be empty")
+ return errors.New("function cannot be empty")
}
_, ok := restrictedTags[tag]
@@ -405,7 +445,10 @@ func (v *Validate) StructPartialCtx(ctx context.Context, s interface{}, fields .
if len(flds) > 0 {
vd.misc = append(vd.misc[0:0], name...)
- vd.misc = append(vd.misc, '.')
+ // Don't append empty name for unnamed structs
+ if len(vd.misc) != 0 {
+ vd.misc = append(vd.misc, '.')
+ }
for _, s := range flds {
diff --git a/vendor/github.com/go-sql-driver/mysql/.travis.yml b/vendor/github.com/go-sql-driver/mysql/.travis.yml
deleted file mode 100644
index 56fcf25f2..000000000
--- a/vendor/github.com/go-sql-driver/mysql/.travis.yml
+++ /dev/null
@@ -1,129 +0,0 @@
-sudo: false
-language: go
-go:
- - 1.10.x
- - 1.11.x
- - 1.12.x
- - 1.13.x
- - master
-
-before_install:
- - go get golang.org/x/tools/cmd/cover
- - go get github.com/mattn/goveralls
-
-before_script:
- - echo -e "[server]\ninnodb_log_file_size=256MB\ninnodb_buffer_pool_size=512MB\nmax_allowed_packet=16MB" | sudo tee -a /etc/mysql/my.cnf
- - sudo service mysql restart
- - .travis/wait_mysql.sh
- - mysql -e 'create database gotest;'
-
-matrix:
- include:
- - env: DB=MYSQL8
- sudo: required
- dist: trusty
- go: 1.10.x
- services:
- - docker
- before_install:
- - go get golang.org/x/tools/cmd/cover
- - go get github.com/mattn/goveralls
- - docker pull mysql:8.0
- - docker run -d -p 127.0.0.1:3307:3306 --name mysqld -e MYSQL_DATABASE=gotest -e MYSQL_USER=gotest -e MYSQL_PASSWORD=secret -e MYSQL_ROOT_PASSWORD=verysecret
- mysql:8.0 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1
- - cp .travis/docker.cnf ~/.my.cnf
- - .travis/wait_mysql.sh
- before_script:
- - export MYSQL_TEST_USER=gotest
- - export MYSQL_TEST_PASS=secret
- - export MYSQL_TEST_ADDR=127.0.0.1:3307
- - export MYSQL_TEST_CONCURRENT=1
-
- - env: DB=MYSQL57
- sudo: required
- dist: trusty
- go: 1.10.x
- services:
- - docker
- before_install:
- - go get golang.org/x/tools/cmd/cover
- - go get github.com/mattn/goveralls
- - docker pull mysql:5.7
- - docker run -d -p 127.0.0.1:3307:3306 --name mysqld -e MYSQL_DATABASE=gotest -e MYSQL_USER=gotest -e MYSQL_PASSWORD=secret -e MYSQL_ROOT_PASSWORD=verysecret
- mysql:5.7 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1
- - cp .travis/docker.cnf ~/.my.cnf
- - .travis/wait_mysql.sh
- before_script:
- - export MYSQL_TEST_USER=gotest
- - export MYSQL_TEST_PASS=secret
- - export MYSQL_TEST_ADDR=127.0.0.1:3307
- - export MYSQL_TEST_CONCURRENT=1
-
- - env: DB=MARIA55
- sudo: required
- dist: trusty
- go: 1.10.x
- services:
- - docker
- before_install:
- - go get golang.org/x/tools/cmd/cover
- - go get github.com/mattn/goveralls
- - docker pull mariadb:5.5
- - docker run -d -p 127.0.0.1:3307:3306 --name mysqld -e MYSQL_DATABASE=gotest -e MYSQL_USER=gotest -e MYSQL_PASSWORD=secret -e MYSQL_ROOT_PASSWORD=verysecret
- mariadb:5.5 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1
- - cp .travis/docker.cnf ~/.my.cnf
- - .travis/wait_mysql.sh
- before_script:
- - export MYSQL_TEST_USER=gotest
- - export MYSQL_TEST_PASS=secret
- - export MYSQL_TEST_ADDR=127.0.0.1:3307
- - export MYSQL_TEST_CONCURRENT=1
-
- - env: DB=MARIA10_1
- sudo: required
- dist: trusty
- go: 1.10.x
- services:
- - docker
- before_install:
- - go get golang.org/x/tools/cmd/cover
- - go get github.com/mattn/goveralls
- - docker pull mariadb:10.1
- - docker run -d -p 127.0.0.1:3307:3306 --name mysqld -e MYSQL_DATABASE=gotest -e MYSQL_USER=gotest -e MYSQL_PASSWORD=secret -e MYSQL_ROOT_PASSWORD=verysecret
- mariadb:10.1 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1
- - cp .travis/docker.cnf ~/.my.cnf
- - .travis/wait_mysql.sh
- before_script:
- - export MYSQL_TEST_USER=gotest
- - export MYSQL_TEST_PASS=secret
- - export MYSQL_TEST_ADDR=127.0.0.1:3307
- - export MYSQL_TEST_CONCURRENT=1
-
- - os: osx
- osx_image: xcode10.1
- addons:
- homebrew:
- packages:
- - mysql
- update: true
- go: 1.12.x
- before_install:
- - go get golang.org/x/tools/cmd/cover
- - go get github.com/mattn/goveralls
- before_script:
- - echo -e "[server]\ninnodb_log_file_size=256MB\ninnodb_buffer_pool_size=512MB\nmax_allowed_packet=16MB\nlocal_infile=1" >> /usr/local/etc/my.cnf
- - mysql.server start
- - mysql -uroot -e 'CREATE USER gotest IDENTIFIED BY "secret"'
- - mysql -uroot -e 'GRANT ALL ON *.* TO gotest'
- - mysql -uroot -e 'create database gotest;'
- - export MYSQL_TEST_USER=gotest
- - export MYSQL_TEST_PASS=secret
- - export MYSQL_TEST_ADDR=127.0.0.1:3306
- - export MYSQL_TEST_CONCURRENT=1
-
-script:
- - go test -v -covermode=count -coverprofile=coverage.out
- - go vet ./...
- - .travis/gofmt.sh
-after_script:
- - $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci
diff --git a/vendor/github.com/go-sql-driver/mysql/AUTHORS b/vendor/github.com/go-sql-driver/mysql/AUTHORS
index ad5989800..50afa2c85 100644
--- a/vendor/github.com/go-sql-driver/mysql/AUTHORS
+++ b/vendor/github.com/go-sql-driver/mysql/AUTHORS
@@ -13,11 +13,15 @@
Aaron Hopkins
Achille Roussel
+Alex Snast
Alexey Palazhchenko
Andrew Reid
+Animesh Ray
Arne Hormann
+Ariel Mashraki
Asta Xie
Bulat Gaifullin
+Caine Jette
Carlos Nieto
Chris Moos
Craig Wilson
@@ -52,6 +56,7 @@ Julien Schmidt
Justin Li
Justin Nuß
Kamil Dziedzic
+Kei Kamikawa
Kevin Malachowski
Kieron Woodhouse
Lennart Rudolph
@@ -74,20 +79,26 @@ Reed Allman
Richard Wilkes
Robert Russell
Runrioter Wung
+Sho Iizuka
+Sho Ikeda
Shuode Li
Simon J Mudd
Soroush Pour
Stan Putrya
Stanley Gunawan
Steven Hartland
+Tan Jinhua <312841925 at qq.com>
Thomas Wodarek
Tim Ruffles
Tom Jenkinson
Vladimir Kovpak
+Vladyslav Zhelezniak
Xiangyu Hu
Xiaobing Jiang
Xiuming Chen
+Xuehong Chan
Zhenye Xie
+Zhixin Wen
# Organizations
@@ -103,3 +114,4 @@ Multiplay Ltd.
Percona LLC
Pivotal Inc.
Stripe Inc.
+Zendesk Inc.
diff --git a/vendor/github.com/go-sql-driver/mysql/CHANGELOG.md b/vendor/github.com/go-sql-driver/mysql/CHANGELOG.md
index 9cb97b38d..72a738ed5 100644
--- a/vendor/github.com/go-sql-driver/mysql/CHANGELOG.md
+++ b/vendor/github.com/go-sql-driver/mysql/CHANGELOG.md
@@ -1,3 +1,29 @@
+## Version 1.6 (2021-04-01)
+
+Changes:
+
+ - Migrate the CI service from travis-ci to GitHub Actions (#1176, #1183, #1190)
+ - `NullTime` is deprecated (#960, #1144)
+ - Reduce allocations when building SET command (#1111)
+ - Performance improvement for time formatting (#1118)
+ - Performance improvement for time parsing (#1098, #1113)
+
+New Features:
+
+ - Implement `driver.Validator` interface (#1106, #1174)
+ - Support returning `uint64` from `Valuer` in `ConvertValue` (#1143)
+ - Add `json.RawMessage` for converter and prepared statement (#1059)
+ - Interpolate `json.RawMessage` as `string` (#1058)
+ - Implements `CheckNamedValue` (#1090)
+
+Bugfixes:
+
+ - Stop rounding times (#1121, #1172)
+ - Put zero filler into the SSL handshake packet (#1066)
+ - Fix checking cancelled connections back into the connection pool (#1095)
+ - Fix remove last 0 byte for mysql_old_password when password is empty (#1133)
+
+
## Version 1.5 (2020-01-07)
Changes:
diff --git a/vendor/github.com/go-sql-driver/mysql/README.md b/vendor/github.com/go-sql-driver/mysql/README.md
index d2627a41a..0b13154fc 100644
--- a/vendor/github.com/go-sql-driver/mysql/README.md
+++ b/vendor/github.com/go-sql-driver/mysql/README.md
@@ -35,7 +35,7 @@ A MySQL-Driver for Go's [database/sql](https://golang.org/pkg/database/sql/) pac
* Supports queries larger than 16MB
* Full [`sql.RawBytes`](https://golang.org/pkg/database/sql/#RawBytes) support.
* Intelligent `LONG DATA` handling in prepared statements
- * Secure `LOAD DATA LOCAL INFILE` support with file Whitelisting and `io.Reader` support
+ * Secure `LOAD DATA LOCAL INFILE` support with file allowlisting and `io.Reader` support
* Optional `time.Time` parsing
* Optional placeholder interpolation
@@ -56,15 +56,37 @@ Make sure [Git is installed](https://git-scm.com/downloads) on your machine and
_Go MySQL Driver_ is an implementation of Go's `database/sql/driver` interface. You only need to import the driver and can use the full [`database/sql`](https://golang.org/pkg/database/sql/) API then.
Use `mysql` as `driverName` and a valid [DSN](#dsn-data-source-name) as `dataSourceName`:
+
```go
-import "database/sql"
-import _ "github.com/go-sql-driver/mysql"
+import (
+ "database/sql"
+ "time"
+
+ _ "github.com/go-sql-driver/mysql"
+)
+
+// ...
db, err := sql.Open("mysql", "user:password@/dbname")
+if err != nil {
+ panic(err)
+}
+// See "Important settings" section.
+db.SetConnMaxLifetime(time.Minute * 3)
+db.SetMaxOpenConns(10)
+db.SetMaxIdleConns(10)
```
[Examples are available in our Wiki](https://github.com/go-sql-driver/mysql/wiki/Examples "Go-MySQL-Driver Examples").
+### Important settings
+
+`db.SetConnMaxLifetime()` is required to ensure connections are closed by the driver safely before connection is closed by MySQL server, OS, or other middlewares. Since some middlewares close idle connections by 5 minutes, we recommend timeout shorter than 5 minutes. This setting helps load balancing and changing system variables too.
+
+`db.SetMaxOpenConns()` is highly recommended to limit the number of connection used by the application. There is no recommended limit number because it depends on application and MySQL server.
+
+`db.SetMaxIdleConns()` is recommended to be set same to (or greater than) `db.SetMaxOpenConns()`. When it is smaller than `SetMaxOpenConns()`, connections can be opened and closed very frequently than you expect. Idle connections can be closed by the `db.SetConnMaxLifetime()`. If you want to close idle connections more rapidly, you can use `db.SetConnMaxIdleTime()` since Go 1.15.
+
### DSN (Data Source Name)
@@ -122,7 +144,7 @@ Valid Values: true, false
Default: false
```
-`allowAllFiles=true` disables the file Whitelist for `LOAD DATA LOCAL INFILE` and allows *all* files.
+`allowAllFiles=true` disables the file allowlist for `LOAD DATA LOCAL INFILE` and allows *all* files.
[*Might be insecure!*](http://dev.mysql.com/doc/refman/5.7/en/load-data-local.html)
##### `allowCleartextPasswords`
@@ -133,7 +155,7 @@ Valid Values: true, false
Default: false
```
-`allowCleartextPasswords=true` allows using the [cleartext client side plugin](http://dev.mysql.com/doc/en/cleartext-authentication-plugin.html) if required by an account, such as one defined with the [PAM authentication plugin](http://dev.mysql.com/doc/en/pam-authentication-plugin.html). Sending passwords in clear text may be a security problem in some configurations. To avoid problems if there is any possibility that the password would be intercepted, clients should connect to MySQL Server using a method that protects the password. Possibilities include [TLS / SSL](#tls), IPsec, or a private network.
+`allowCleartextPasswords=true` allows using the [cleartext client side plugin](https://dev.mysql.com/doc/en/cleartext-pluggable-authentication.html) if required by an account, such as one defined with the [PAM authentication plugin](http://dev.mysql.com/doc/en/pam-authentication-plugin.html). Sending passwords in clear text may be a security problem in some configurations. To avoid problems if there is any possibility that the password would be intercepted, clients should connect to MySQL Server using a method that protects the password. Possibilities include [TLS / SSL](#tls), IPsec, or a private network.
##### `allowNativePasswords`
@@ -230,7 +252,7 @@ Default: false
If `interpolateParams` is true, placeholders (`?`) in calls to `db.Query()` and `db.Exec()` are interpolated into a single query string with given parameters. This reduces the number of roundtrips, since the driver has to prepare a statement, execute it with given parameters and close the statement again with `interpolateParams=false`.
-*This can not be used together with the multibyte encodings BIG5, CP932, GB2312, GBK or SJIS. These are blacklisted as they may [introduce a SQL injection vulnerability](http://stackoverflow.com/a/12118602/3430118)!*
+*This can not be used together with the multibyte encodings BIG5, CP932, GB2312, GBK or SJIS. These are rejected as they may [introduce a SQL injection vulnerability](http://stackoverflow.com/a/12118602/3430118)!*
##### `loc`
@@ -376,7 +398,7 @@ Rules:
Examples:
* `autocommit=1`: `SET autocommit=1`
* [`time_zone=%27Europe%2FParis%27`](https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html): `SET time_zone='Europe/Paris'`
- * [`tx_isolation=%27REPEATABLE-READ%27`](https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_tx_isolation): `SET tx_isolation='REPEATABLE-READ'`
+ * [`transaction_isolation=%27REPEATABLE-READ%27`](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_transaction_isolation): `SET transaction_isolation='REPEATABLE-READ'`
#### Examples
@@ -445,7 +467,7 @@ For this feature you need direct access to the package. Therefore you must chang
import "github.com/go-sql-driver/mysql"
```
-Files must be whitelisted by registering them with `mysql.RegisterLocalFile(filepath)` (recommended) or the Whitelist check must be deactivated by using the DSN parameter `allowAllFiles=true` ([*Might be insecure!*](http://dev.mysql.com/doc/refman/5.7/en/load-data-local.html)).
+Files must be explicitly allowed by registering them with `mysql.RegisterLocalFile(filepath)` (recommended) or the allowlist check must be deactivated by using the DSN parameter `allowAllFiles=true` ([*Might be insecure!*](http://dev.mysql.com/doc/refman/5.7/en/load-data-local.html)).
To use a `io.Reader` a handler function must be registered with `mysql.RegisterReaderHandler(name, handler)` which returns a `io.Reader` or `io.ReadCloser`. The Reader is available with the filepath `Reader::` then. Choose different names for different handlers and `DeregisterReaderHandler` when you don't need it anymore.
@@ -459,8 +481,6 @@ However, many want to scan MySQL `DATE` and `DATETIME` values into `time.Time` v
**Caution:** As of Go 1.1, this makes `time.Time` the only variable type you can scan `DATE` and `DATETIME` values into. This breaks for example [`sql.RawBytes` support](https://github.com/go-sql-driver/mysql/wiki/Examples#rawbytes).
-Alternatively you can use the [`NullTime`](https://godoc.org/github.com/go-sql-driver/mysql#NullTime) type as the scan destination, which works with both `time.Time` and `string` / `[]byte`.
-
### Unicode support
Since version 1.5 Go-MySQL-Driver automatically uses the collation ` utf8mb4_general_ci` by default.
@@ -477,7 +497,7 @@ To run the driver tests you may need to adjust the configuration. See the [Testi
Go-MySQL-Driver is not feature-complete yet. Your help is very appreciated.
If you want to contribute, you can work on an [open issue](https://github.com/go-sql-driver/mysql/issues?state=open) or review a [pull request](https://github.com/go-sql-driver/mysql/pulls).
-See the [Contribution Guidelines](https://github.com/go-sql-driver/mysql/blob/master/CONTRIBUTING.md) for details.
+See the [Contribution Guidelines](https://github.com/go-sql-driver/mysql/blob/master/.github/CONTRIBUTING.md) for details.
---------------------------------------
@@ -498,4 +518,3 @@ Please read the [MPL 2.0 FAQ](https://www.mozilla.org/en-US/MPL/2.0/FAQ/) if you
You can read the full terms here: [LICENSE](https://raw.github.com/go-sql-driver/mysql/master/LICENSE).
![Go Gopher and MySQL Dolphin](https://raw.github.com/wiki/go-sql-driver/mysql/go-mysql-driver_m.jpg "Golang Gopher transporting the MySQL Dolphin in a wheelbarrow")
-
diff --git a/vendor/github.com/go-sql-driver/mysql/auth.go b/vendor/github.com/go-sql-driver/mysql/auth.go
index fec7040d4..b2f19e8f0 100644
--- a/vendor/github.com/go-sql-driver/mysql/auth.go
+++ b/vendor/github.com/go-sql-driver/mysql/auth.go
@@ -15,6 +15,7 @@ import (
"crypto/sha256"
"crypto/x509"
"encoding/pem"
+ "fmt"
"sync"
)
@@ -136,10 +137,6 @@ func pwHash(password []byte) (result [2]uint32) {
// Hash password using insecure pre 4.1 method
func scrambleOldPassword(scramble []byte, password string) []byte {
- if len(password) == 0 {
- return nil
- }
-
scramble = scramble[:8]
hashPw := pwHash([]byte(password))
@@ -247,6 +244,9 @@ func (mc *mysqlConn) auth(authData []byte, plugin string) ([]byte, error) {
if !mc.cfg.AllowOldPasswords {
return nil, ErrOldPassword
}
+ if len(mc.cfg.Passwd) == 0 {
+ return nil, nil
+ }
// Note: there are edge cases where this should work but doesn't;
// this is currently "wontfix":
// https://github.com/go-sql-driver/mysql/issues/184
@@ -372,7 +372,10 @@ func (mc *mysqlConn) handleAuthResult(oldAuthData []byte, plugin string) error {
return err
}
- block, _ := pem.Decode(data[1:])
+ block, rest := pem.Decode(data[1:])
+ if block == nil {
+ return fmt.Errorf("No Pem data found, data: %s", rest)
+ }
pkix, err := x509.ParsePKIXPublicKey(block.Bytes)
if err != nil {
return err
diff --git a/vendor/github.com/go-sql-driver/mysql/collations.go b/vendor/github.com/go-sql-driver/mysql/collations.go
index 8d2b55676..326a9f7fa 100644
--- a/vendor/github.com/go-sql-driver/mysql/collations.go
+++ b/vendor/github.com/go-sql-driver/mysql/collations.go
@@ -247,7 +247,7 @@ var collations = map[string]byte{
"utf8mb4_0900_ai_ci": 255,
}
-// A blacklist of collations which is unsafe to interpolate parameters.
+// A denylist of collations which is unsafe to interpolate parameters.
// These multibyte encodings may contains 0x5c (`\`) in their trailing bytes.
var unsafeCollations = map[string]bool{
"big5_chinese_ci": true,
diff --git a/vendor/github.com/go-sql-driver/mysql/connection.go b/vendor/github.com/go-sql-driver/mysql/connection.go
index e4bb59e67..835f89729 100644
--- a/vendor/github.com/go-sql-driver/mysql/connection.go
+++ b/vendor/github.com/go-sql-driver/mysql/connection.go
@@ -12,6 +12,7 @@ import (
"context"
"database/sql"
"database/sql/driver"
+ "encoding/json"
"io"
"net"
"strconv"
@@ -46,9 +47,10 @@ type mysqlConn struct {
// Handles parameters set in DSN after the connection is established
func (mc *mysqlConn) handleParams() (err error) {
+ var cmdSet strings.Builder
for param, val := range mc.cfg.Params {
switch param {
- // Charset
+ // Charset: character_set_connection, character_set_client, character_set_results
case "charset":
charsets := strings.Split(val, ",")
for i := range charsets {
@@ -62,12 +64,25 @@ func (mc *mysqlConn) handleParams() (err error) {
return
}
- // System Vars
+ // Other system vars accumulated in a single SET command
default:
- err = mc.exec("SET " + param + "=" + val + "")
- if err != nil {
- return
+ if cmdSet.Len() == 0 {
+ // Heuristic: 29 chars for each other key=value to reduce reallocations
+ cmdSet.Grow(4 + len(param) + 1 + len(val) + 30*(len(mc.cfg.Params)-1))
+ cmdSet.WriteString("SET ")
+ } else {
+ cmdSet.WriteByte(',')
}
+ cmdSet.WriteString(param)
+ cmdSet.WriteByte('=')
+ cmdSet.WriteString(val)
+ }
+ }
+
+ if cmdSet.Len() > 0 {
+ err = mc.exec(cmdSet.String())
+ if err != nil {
+ return
}
}
@@ -230,47 +245,21 @@ func (mc *mysqlConn) interpolateParams(query string, args []driver.Value) (strin
if v.IsZero() {
buf = append(buf, "'0000-00-00'"...)
} else {
- v := v.In(mc.cfg.Loc)
- v = v.Add(time.Nanosecond * 500) // To round under microsecond
- year := v.Year()
- year100 := year / 100
- year1 := year % 100
- month := v.Month()
- day := v.Day()
- hour := v.Hour()
- minute := v.Minute()
- second := v.Second()
- micro := v.Nanosecond() / 1000
-
- buf = append(buf, []byte{
- '\'',
- digits10[year100], digits01[year100],
- digits10[year1], digits01[year1],
- '-',
- digits10[month], digits01[month],
- '-',
- digits10[day], digits01[day],
- ' ',
- digits10[hour], digits01[hour],
- ':',
- digits10[minute], digits01[minute],
- ':',
- digits10[second], digits01[second],
- }...)
-
- if micro != 0 {
- micro10000 := micro / 10000
- micro100 := micro / 100 % 100
- micro1 := micro % 100
- buf = append(buf, []byte{
- '.',
- digits10[micro10000], digits01[micro10000],
- digits10[micro100], digits01[micro100],
- digits10[micro1], digits01[micro1],
- }...)
+ buf = append(buf, '\'')
+ buf, err = appendDateTime(buf, v.In(mc.cfg.Loc))
+ if err != nil {
+ return "", err
}
buf = append(buf, '\'')
}
+ case json.RawMessage:
+ buf = append(buf, '\'')
+ if mc.status&statusNoBackslashEscapes == 0 {
+ buf = escapeBytesBackslash(buf, v)
+ } else {
+ buf = escapeBytesQuotes(buf, v)
+ }
+ buf = append(buf, '\'')
case []byte:
if v == nil {
buf = append(buf, "NULL"...)
@@ -480,6 +469,10 @@ func (mc *mysqlConn) Ping(ctx context.Context) (err error) {
// BeginTx implements driver.ConnBeginTx interface
func (mc *mysqlConn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error) {
+ if mc.closed.IsSet() {
+ return nil, driver.ErrBadConn
+ }
+
if err := mc.watchCancel(ctx); err != nil {
return nil, err
}
@@ -649,3 +642,9 @@ func (mc *mysqlConn) ResetSession(ctx context.Context) error {
mc.reset = true
return nil
}
+
+// IsValid implements driver.Validator interface
+// (From Go 1.15)
+func (mc *mysqlConn) IsValid() bool {
+ return !mc.closed.IsSet()
+}
diff --git a/vendor/github.com/go-sql-driver/mysql/dsn.go b/vendor/github.com/go-sql-driver/mysql/dsn.go
index 75c8c2489..93f3548cb 100644
--- a/vendor/github.com/go-sql-driver/mysql/dsn.go
+++ b/vendor/github.com/go-sql-driver/mysql/dsn.go
@@ -375,7 +375,7 @@ func parseDSNParams(cfg *Config, params string) (err error) {
// cfg params
switch value := param[1]; param[0] {
- // Disable INFILE whitelist / enable all files
+ // Disable INFILE allowlist / enable all files
case "allowAllFiles":
var isBool bool
cfg.AllowAllFiles, isBool = readBool(value)
diff --git a/vendor/github.com/go-sql-driver/mysql/fields.go b/vendor/github.com/go-sql-driver/mysql/fields.go
index e1e2ece4b..ed6c7a37d 100644
--- a/vendor/github.com/go-sql-driver/mysql/fields.go
+++ b/vendor/github.com/go-sql-driver/mysql/fields.go
@@ -106,7 +106,7 @@ var (
scanTypeInt64 = reflect.TypeOf(int64(0))
scanTypeNullFloat = reflect.TypeOf(sql.NullFloat64{})
scanTypeNullInt = reflect.TypeOf(sql.NullInt64{})
- scanTypeNullTime = reflect.TypeOf(NullTime{})
+ scanTypeNullTime = reflect.TypeOf(nullTime{})
scanTypeUint8 = reflect.TypeOf(uint8(0))
scanTypeUint16 = reflect.TypeOf(uint16(0))
scanTypeUint32 = reflect.TypeOf(uint32(0))
diff --git a/vendor/github.com/go-sql-driver/mysql/fuzz.go b/vendor/github.com/go-sql-driver/mysql/fuzz.go
new file mode 100644
index 000000000..fa75adf6a
--- /dev/null
+++ b/vendor/github.com/go-sql-driver/mysql/fuzz.go
@@ -0,0 +1,24 @@
+// Go MySQL Driver - A MySQL-Driver for Go's database/sql package.
+//
+// Copyright 2020 The Go-MySQL-Driver Authors. All rights reserved.
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this file,
+// You can obtain one at http://mozilla.org/MPL/2.0/.
+
+// +build gofuzz
+
+package mysql
+
+import (
+ "database/sql"
+)
+
+func Fuzz(data []byte) int {
+ db, err := sql.Open("mysql", string(data))
+ if err != nil {
+ return 0
+ }
+ db.Close()
+ return 1
+}
diff --git a/vendor/github.com/go-sql-driver/mysql/infile.go b/vendor/github.com/go-sql-driver/mysql/infile.go
index 273cb0ba5..60effdfc2 100644
--- a/vendor/github.com/go-sql-driver/mysql/infile.go
+++ b/vendor/github.com/go-sql-driver/mysql/infile.go
@@ -23,7 +23,7 @@ var (
readerRegisterLock sync.RWMutex
)
-// RegisterLocalFile adds the given file to the file whitelist,
+// RegisterLocalFile adds the given file to the file allowlist,
// so that it can be used by "LOAD DATA LOCAL INFILE ".
// Alternatively you can allow the use of all local files with
// the DSN parameter 'allowAllFiles=true'
@@ -45,7 +45,7 @@ func RegisterLocalFile(filePath string) {
fileRegisterLock.Unlock()
}
-// DeregisterLocalFile removes the given filepath from the whitelist.
+// DeregisterLocalFile removes the given filepath from the allowlist.
func DeregisterLocalFile(filePath string) {
fileRegisterLock.Lock()
delete(fileRegister, strings.Trim(filePath, `"`))
diff --git a/vendor/github.com/go-sql-driver/mysql/nulltime.go b/vendor/github.com/go-sql-driver/mysql/nulltime.go
index afa8a89e9..651723a96 100644
--- a/vendor/github.com/go-sql-driver/mysql/nulltime.go
+++ b/vendor/github.com/go-sql-driver/mysql/nulltime.go
@@ -28,11 +28,11 @@ func (nt *NullTime) Scan(value interface{}) (err error) {
nt.Time, nt.Valid = v, true
return
case []byte:
- nt.Time, err = parseDateTime(string(v), time.UTC)
+ nt.Time, err = parseDateTime(v, time.UTC)
nt.Valid = (err == nil)
return
case string:
- nt.Time, err = parseDateTime(v, time.UTC)
+ nt.Time, err = parseDateTime([]byte(v), time.UTC)
nt.Valid = (err == nil)
return
}
diff --git a/vendor/github.com/go-sql-driver/mysql/nulltime_go113.go b/vendor/github.com/go-sql-driver/mysql/nulltime_go113.go
index c392594dd..453b4b394 100644
--- a/vendor/github.com/go-sql-driver/mysql/nulltime_go113.go
+++ b/vendor/github.com/go-sql-driver/mysql/nulltime_go113.go
@@ -28,4 +28,13 @@ import (
// }
//
// This NullTime implementation is not driver-specific
+//
+// Deprecated: NullTime doesn't honor the loc DSN parameter.
+// NullTime.Scan interprets a time as UTC, not the loc DSN parameter.
+// Use sql.NullTime instead.
type NullTime sql.NullTime
+
+// for internal use.
+// the mysql package uses sql.NullTime if it is available.
+// if not, the package uses mysql.NullTime.
+type nullTime = sql.NullTime // sql.NullTime is available
diff --git a/vendor/github.com/go-sql-driver/mysql/nulltime_legacy.go b/vendor/github.com/go-sql-driver/mysql/nulltime_legacy.go
index 86d159d44..9f7ae27a8 100644
--- a/vendor/github.com/go-sql-driver/mysql/nulltime_legacy.go
+++ b/vendor/github.com/go-sql-driver/mysql/nulltime_legacy.go
@@ -32,3 +32,8 @@ type NullTime struct {
Time time.Time
Valid bool // Valid is true if Time is not NULL
}
+
+// for internal use.
+// the mysql package uses sql.NullTime if it is available.
+// if not, the package uses mysql.NullTime.
+type nullTime = NullTime // sql.NullTime is not available
diff --git a/vendor/github.com/go-sql-driver/mysql/packets.go b/vendor/github.com/go-sql-driver/mysql/packets.go
index 82ad7a200..6664e5ae5 100644
--- a/vendor/github.com/go-sql-driver/mysql/packets.go
+++ b/vendor/github.com/go-sql-driver/mysql/packets.go
@@ -13,6 +13,7 @@ import (
"crypto/tls"
"database/sql/driver"
"encoding/binary"
+ "encoding/json"
"errors"
"fmt"
"io"
@@ -348,6 +349,12 @@ func (mc *mysqlConn) writeHandshakeResponsePacket(authResp []byte, plugin string
return errors.New("unknown collation")
}
+ // Filler [23 bytes] (all 0x00)
+ pos := 13
+ for ; pos < 13+23; pos++ {
+ data[pos] = 0
+ }
+
// SSL Connection Request Packet
// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::SSLRequest
if mc.cfg.tls != nil {
@@ -366,12 +373,6 @@ func (mc *mysqlConn) writeHandshakeResponsePacket(authResp []byte, plugin string
mc.buf.nc = tlsConn
}
- // Filler [23 bytes] (all 0x00)
- pos := 13
- for ; pos < 13+23; pos++ {
- data[pos] = 0
- }
-
// User [null terminated string]
if len(mc.cfg.User) > 0 {
pos += copy(data[pos:], mc.cfg.User)
@@ -777,7 +778,7 @@ func (rows *textRows) readRow(dest []driver.Value) error {
case fieldTypeTimestamp, fieldTypeDateTime,
fieldTypeDate, fieldTypeNewDate:
dest[i], err = parseDateTime(
- string(dest[i].([]byte)),
+ dest[i].([]byte),
mc.cfg.Loc,
)
if err == nil {
@@ -1003,6 +1004,9 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
continue
}
+ if v, ok := arg.(json.RawMessage); ok {
+ arg = []byte(v)
+ }
// cache types and values
switch v := arg.(type) {
case int64:
@@ -1112,7 +1116,10 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
if v.IsZero() {
b = append(b, "0000-00-00"...)
} else {
- b = v.In(mc.cfg.Loc).AppendFormat(b, timeFormat)
+ b, err = appendDateTime(b, v.In(mc.cfg.Loc))
+ if err != nil {
+ return err
+ }
}
paramValues = appendLengthEncodedInteger(paramValues,
diff --git a/vendor/github.com/go-sql-driver/mysql/statement.go b/vendor/github.com/go-sql-driver/mysql/statement.go
index f7e370939..18a3ae498 100644
--- a/vendor/github.com/go-sql-driver/mysql/statement.go
+++ b/vendor/github.com/go-sql-driver/mysql/statement.go
@@ -10,6 +10,7 @@ package mysql
import (
"database/sql/driver"
+ "encoding/json"
"fmt"
"io"
"reflect"
@@ -43,6 +44,11 @@ func (stmt *mysqlStmt) ColumnConverter(idx int) driver.ValueConverter {
return converter{}
}
+func (stmt *mysqlStmt) CheckNamedValue(nv *driver.NamedValue) (err error) {
+ nv.Value, err = converter{}.ConvertValue(nv.Value)
+ return
+}
+
func (stmt *mysqlStmt) Exec(args []driver.Value) (driver.Result, error) {
if stmt.mc.closed.IsSet() {
errLog.Print(ErrInvalidConn)
@@ -129,6 +135,8 @@ func (stmt *mysqlStmt) query(args []driver.Value) (*binaryRows, error) {
return rows, err
}
+var jsonType = reflect.TypeOf(json.RawMessage{})
+
type converter struct{}
// ConvertValue mirrors the reference/default converter in database/sql/driver
@@ -146,12 +154,17 @@ func (c converter) ConvertValue(v interface{}) (driver.Value, error) {
if err != nil {
return nil, err
}
- if !driver.IsValue(sv) {
- return nil, fmt.Errorf("non-Value type %T returned from Value", sv)
+ if driver.IsValue(sv) {
+ return sv, nil
}
- return sv, nil
+ // A value returend from the Valuer interface can be "a type handled by
+ // a database driver's NamedValueChecker interface" so we should accept
+ // uint64 here as well.
+ if u, ok := sv.(uint64); ok {
+ return u, nil
+ }
+ return nil, fmt.Errorf("non-Value type %T returned from Value", sv)
}
-
rv := reflect.ValueOf(v)
switch rv.Kind() {
case reflect.Ptr:
@@ -170,11 +183,14 @@ func (c converter) ConvertValue(v interface{}) (driver.Value, error) {
case reflect.Bool:
return rv.Bool(), nil
case reflect.Slice:
- ek := rv.Type().Elem().Kind()
- if ek == reflect.Uint8 {
+ switch t := rv.Type(); {
+ case t == jsonType:
+ return v, nil
+ case t.Elem().Kind() == reflect.Uint8:
return rv.Bytes(), nil
+ default:
+ return nil, fmt.Errorf("unsupported type %T, a slice of %s", v, t.Elem().Kind())
}
- return nil, fmt.Errorf("unsupported type %T, a slice of %s", v, ek)
case reflect.String:
return rv.String(), nil
}
diff --git a/vendor/github.com/go-sql-driver/mysql/utils.go b/vendor/github.com/go-sql-driver/mysql/utils.go
index 9552e80b5..d6545f5be 100644
--- a/vendor/github.com/go-sql-driver/mysql/utils.go
+++ b/vendor/github.com/go-sql-driver/mysql/utils.go
@@ -106,27 +106,136 @@ func readBool(input string) (value bool, valid bool) {
* Time related utils *
******************************************************************************/
-func parseDateTime(str string, loc *time.Location) (t time.Time, err error) {
- base := "0000-00-00 00:00:00.0000000"
- switch len(str) {
+func parseDateTime(b []byte, loc *time.Location) (time.Time, error) {
+ const base = "0000-00-00 00:00:00.000000"
+ switch len(b) {
case 10, 19, 21, 22, 23, 24, 25, 26: // up to "YYYY-MM-DD HH:MM:SS.MMMMMM"
- if str == base[:len(str)] {
- return
+ if string(b) == base[:len(b)] {
+ return time.Time{}, nil
}
- t, err = time.Parse(timeFormat[:len(str)], str)
+
+ year, err := parseByteYear(b)
+ if err != nil {
+ return time.Time{}, err
+ }
+ if year <= 0 {
+ year = 1
+ }
+
+ if b[4] != '-' {
+ return time.Time{}, fmt.Errorf("bad value for field: `%c`", b[4])
+ }
+
+ m, err := parseByte2Digits(b[5], b[6])
+ if err != nil {
+ return time.Time{}, err
+ }
+ if m <= 0 {
+ m = 1
+ }
+ month := time.Month(m)
+
+ if b[7] != '-' {
+ return time.Time{}, fmt.Errorf("bad value for field: `%c`", b[7])
+ }
+
+ day, err := parseByte2Digits(b[8], b[9])
+ if err != nil {
+ return time.Time{}, err
+ }
+ if day <= 0 {
+ day = 1
+ }
+ if len(b) == 10 {
+ return time.Date(year, month, day, 0, 0, 0, 0, loc), nil
+ }
+
+ if b[10] != ' ' {
+ return time.Time{}, fmt.Errorf("bad value for field: `%c`", b[10])
+ }
+
+ hour, err := parseByte2Digits(b[11], b[12])
+ if err != nil {
+ return time.Time{}, err
+ }
+ if b[13] != ':' {
+ return time.Time{}, fmt.Errorf("bad value for field: `%c`", b[13])
+ }
+
+ min, err := parseByte2Digits(b[14], b[15])
+ if err != nil {
+ return time.Time{}, err
+ }
+ if b[16] != ':' {
+ return time.Time{}, fmt.Errorf("bad value for field: `%c`", b[16])
+ }
+
+ sec, err := parseByte2Digits(b[17], b[18])
+ if err != nil {
+ return time.Time{}, err
+ }
+ if len(b) == 19 {
+ return time.Date(year, month, day, hour, min, sec, 0, loc), nil
+ }
+
+ if b[19] != '.' {
+ return time.Time{}, fmt.Errorf("bad value for field: `%c`", b[19])
+ }
+ nsec, err := parseByteNanoSec(b[20:])
+ if err != nil {
+ return time.Time{}, err
+ }
+ return time.Date(year, month, day, hour, min, sec, nsec, loc), nil
default:
- err = fmt.Errorf("invalid time string: %s", str)
- return
+ return time.Time{}, fmt.Errorf("invalid time bytes: %s", b)
}
+}
- // Adjust location
- if err == nil && loc != time.UTC {
- y, mo, d := t.Date()
- h, mi, s := t.Clock()
- t, err = time.Date(y, mo, d, h, mi, s, t.Nanosecond(), loc), nil
+func parseByteYear(b []byte) (int, error) {
+ year, n := 0, 1000
+ for i := 0; i < 4; i++ {
+ v, err := bToi(b[i])
+ if err != nil {
+ return 0, err
+ }
+ year += v * n
+ n = n / 10
}
+ return year, nil
+}
- return
+func parseByte2Digits(b1, b2 byte) (int, error) {
+ d1, err := bToi(b1)
+ if err != nil {
+ return 0, err
+ }
+ d2, err := bToi(b2)
+ if err != nil {
+ return 0, err
+ }
+ return d1*10 + d2, nil
+}
+
+func parseByteNanoSec(b []byte) (int, error) {
+ ns, digit := 0, 100000 // max is 6-digits
+ for i := 0; i < len(b); i++ {
+ v, err := bToi(b[i])
+ if err != nil {
+ return 0, err
+ }
+ ns += v * digit
+ digit /= 10
+ }
+ // nanoseconds has 10-digits. (needs to scale digits)
+ // 10 - 6 = 4, so we have to multiple 1000.
+ return ns * 1000, nil
+}
+
+func bToi(b byte) (int, error) {
+ if b < '0' || b > '9' {
+ return 0, errors.New("not [0-9]")
+ }
+ return int(b - '0'), nil
}
func parseBinaryDateTime(num uint64, data []byte, loc *time.Location) (driver.Value, error) {
@@ -167,6 +276,64 @@ func parseBinaryDateTime(num uint64, data []byte, loc *time.Location) (driver.Va
return nil, fmt.Errorf("invalid DATETIME packet length %d", num)
}
+func appendDateTime(buf []byte, t time.Time) ([]byte, error) {
+ year, month, day := t.Date()
+ hour, min, sec := t.Clock()
+ nsec := t.Nanosecond()
+
+ if year < 1 || year > 9999 {
+ return buf, errors.New("year is not in the range [1, 9999]: " + strconv.Itoa(year)) // use errors.New instead of fmt.Errorf to avoid year escape to heap
+ }
+ year100 := year / 100
+ year1 := year % 100
+
+ var localBuf [len("2006-01-02T15:04:05.999999999")]byte // does not escape
+ localBuf[0], localBuf[1], localBuf[2], localBuf[3] = digits10[year100], digits01[year100], digits10[year1], digits01[year1]
+ localBuf[4] = '-'
+ localBuf[5], localBuf[6] = digits10[month], digits01[month]
+ localBuf[7] = '-'
+ localBuf[8], localBuf[9] = digits10[day], digits01[day]
+
+ if hour == 0 && min == 0 && sec == 0 && nsec == 0 {
+ return append(buf, localBuf[:10]...), nil
+ }
+
+ localBuf[10] = ' '
+ localBuf[11], localBuf[12] = digits10[hour], digits01[hour]
+ localBuf[13] = ':'
+ localBuf[14], localBuf[15] = digits10[min], digits01[min]
+ localBuf[16] = ':'
+ localBuf[17], localBuf[18] = digits10[sec], digits01[sec]
+
+ if nsec == 0 {
+ return append(buf, localBuf[:19]...), nil
+ }
+ nsec100000000 := nsec / 100000000
+ nsec1000000 := (nsec / 1000000) % 100
+ nsec10000 := (nsec / 10000) % 100
+ nsec100 := (nsec / 100) % 100
+ nsec1 := nsec % 100
+ localBuf[19] = '.'
+
+ // milli second
+ localBuf[20], localBuf[21], localBuf[22] =
+ digits01[nsec100000000], digits10[nsec1000000], digits01[nsec1000000]
+ // micro second
+ localBuf[23], localBuf[24], localBuf[25] =
+ digits10[nsec10000], digits01[nsec10000], digits10[nsec100]
+ // nano second
+ localBuf[26], localBuf[27], localBuf[28] =
+ digits01[nsec100], digits10[nsec1], digits01[nsec1]
+
+ // trim trailing zeros
+ n := len(localBuf)
+ for n > 0 && localBuf[n-1] == '0' {
+ n--
+ }
+
+ return append(buf, localBuf[:n]...), nil
+}
+
// zeroDateTime is used in formatBinaryDateTime to avoid an allocation
// if the DATE or DATETIME has the zero value.
// It must never be changed.
diff --git a/vendor/github.com/json-iterator/go/README.md b/vendor/github.com/json-iterator/go/README.md
index 50d56ffbf..c589addf9 100644
--- a/vendor/github.com/json-iterator/go/README.md
+++ b/vendor/github.com/json-iterator/go/README.md
@@ -1,5 +1,5 @@
[![Sourcegraph](https://sourcegraph.com/github.com/json-iterator/go/-/badge.svg)](https://sourcegraph.com/github.com/json-iterator/go?badge)
-[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/json-iterator/go)
+[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/json-iterator/go)
[![Build Status](https://travis-ci.org/json-iterator/go.svg?branch=master)](https://travis-ci.org/json-iterator/go)
[![codecov](https://codecov.io/gh/json-iterator/go/branch/master/graph/badge.svg)](https://codecov.io/gh/json-iterator/go)
[![rcard](https://goreportcard.com/badge/github.com/json-iterator/go)](https://goreportcard.com/report/github.com/json-iterator/go)
@@ -8,8 +8,6 @@
A high-performance 100% compatible drop-in replacement of "encoding/json"
-You can also use thrift like JSON using [thrift-iterator](https://github.com/thrift-iterator/go)
-
# Benchmark
![benchmark](http://jsoniter.com/benchmarks/go-benchmark.png)
@@ -18,16 +16,16 @@ Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/githu
Raw Result (easyjson requires static code generation)
-| | ns/op | allocation bytes | allocation times |
-| --- | --- | --- | --- |
-| std decode | 35510 ns/op | 1960 B/op | 99 allocs/op |
-| easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op |
-| jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op |
-| std encode | 2213 ns/op | 712 B/op | 5 allocs/op |
-| easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op |
-| jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op |
+| | ns/op | allocation bytes | allocation times |
+| --------------- | ----------- | ---------------- | ---------------- |
+| std decode | 35510 ns/op | 1960 B/op | 99 allocs/op |
+| easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op |
+| jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op |
+| std encode | 2213 ns/op | 712 B/op | 5 allocs/op |
+| easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op |
+| jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op |
-Always benchmark with your own workload.
+Always benchmark with your own workload.
The result depends heavily on the data input.
# Usage
@@ -41,10 +39,10 @@ import "encoding/json"
json.Marshal(&data)
```
-with
+with
```go
-import "github.com/json-iterator/go"
+import jsoniter "github.com/json-iterator/go"
var json = jsoniter.ConfigCompatibleWithStandardLibrary
json.Marshal(&data)
@@ -60,7 +58,7 @@ json.Unmarshal(input, &data)
with
```go
-import "github.com/json-iterator/go"
+import jsoniter "github.com/json-iterator/go"
var json = jsoniter.ConfigCompatibleWithStandardLibrary
json.Unmarshal(input, &data)
@@ -78,10 +76,10 @@ go get github.com/json-iterator/go
Contributors
-* [thockin](https://github.com/thockin)
-* [mattn](https://github.com/mattn)
-* [cch123](https://github.com/cch123)
-* [Oleg Shaldybin](https://github.com/olegshaldybin)
-* [Jason Toffaletti](https://github.com/toffaletti)
+- [thockin](https://github.com/thockin)
+- [mattn](https://github.com/mattn)
+- [cch123](https://github.com/cch123)
+- [Oleg Shaldybin](https://github.com/olegshaldybin)
+- [Jason Toffaletti](https://github.com/toffaletti)
Report issue or pull request, or email taowen@gmail.com, or [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby)
diff --git a/vendor/github.com/json-iterator/go/any_str.go b/vendor/github.com/json-iterator/go/any_str.go
index a4b93c78c..1f12f6612 100644
--- a/vendor/github.com/json-iterator/go/any_str.go
+++ b/vendor/github.com/json-iterator/go/any_str.go
@@ -64,7 +64,6 @@ func (any *stringAny) ToInt64() int64 {
flag := 1
startPos := 0
- endPos := 0
if any.val[0] == '+' || any.val[0] == '-' {
startPos = 1
}
@@ -73,6 +72,7 @@ func (any *stringAny) ToInt64() int64 {
flag = -1
}
+ endPos := startPos
for i := startPos; i < len(any.val); i++ {
if any.val[i] >= '0' && any.val[i] <= '9' {
endPos = i + 1
@@ -98,7 +98,6 @@ func (any *stringAny) ToUint64() uint64 {
}
startPos := 0
- endPos := 0
if any.val[0] == '-' {
return 0
@@ -107,6 +106,7 @@ func (any *stringAny) ToUint64() uint64 {
startPos = 1
}
+ endPos := startPos
for i := startPos; i < len(any.val); i++ {
if any.val[i] >= '0' && any.val[i] <= '9' {
endPos = i + 1
diff --git a/vendor/github.com/json-iterator/go/config.go b/vendor/github.com/json-iterator/go/config.go
index 8c58fcba5..2adcdc3b7 100644
--- a/vendor/github.com/json-iterator/go/config.go
+++ b/vendor/github.com/json-iterator/go/config.go
@@ -183,11 +183,11 @@ func (cfg *frozenConfig) validateJsonRawMessage(extension EncoderExtension) {
encoder := &funcEncoder{func(ptr unsafe.Pointer, stream *Stream) {
rawMessage := *(*json.RawMessage)(ptr)
iter := cfg.BorrowIterator([]byte(rawMessage))
+ defer cfg.ReturnIterator(iter)
iter.Read()
- if iter.Error != nil {
+ if iter.Error != nil && iter.Error != io.EOF {
stream.WriteRaw("null")
} else {
- cfg.ReturnIterator(iter)
stream.WriteRaw(string(rawMessage))
}
}, func(ptr unsafe.Pointer) bool {
diff --git a/vendor/github.com/json-iterator/go/go.mod b/vendor/github.com/json-iterator/go/go.mod
index e05c42ff5..e817cccbf 100644
--- a/vendor/github.com/json-iterator/go/go.mod
+++ b/vendor/github.com/json-iterator/go/go.mod
@@ -6,6 +6,6 @@ require (
github.com/davecgh/go-spew v1.1.1
github.com/google/gofuzz v1.0.0
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421
- github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
+ github.com/modern-go/reflect2 v1.0.2
github.com/stretchr/testify v1.3.0
)
diff --git a/vendor/github.com/json-iterator/go/go.sum b/vendor/github.com/json-iterator/go/go.sum
index d778b5a14..4b7bb8a29 100644
--- a/vendor/github.com/json-iterator/go/go.sum
+++ b/vendor/github.com/json-iterator/go/go.sum
@@ -5,8 +5,8 @@ github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
-github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
+github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
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.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
diff --git a/vendor/github.com/json-iterator/go/iter_float.go b/vendor/github.com/json-iterator/go/iter_float.go
index b9754638e..8a3d8b6fb 100644
--- a/vendor/github.com/json-iterator/go/iter_float.go
+++ b/vendor/github.com/json-iterator/go/iter_float.go
@@ -288,6 +288,9 @@ non_decimal_loop:
return iter.readFloat64SlowPath()
}
value = (value << 3) + (value << 1) + uint64(ind)
+ if value > maxFloat64 {
+ return iter.readFloat64SlowPath()
+ }
}
}
return iter.readFloat64SlowPath()
diff --git a/vendor/github.com/json-iterator/go/iter_int.go b/vendor/github.com/json-iterator/go/iter_int.go
index 214232035..d786a89fe 100644
--- a/vendor/github.com/json-iterator/go/iter_int.go
+++ b/vendor/github.com/json-iterator/go/iter_int.go
@@ -9,6 +9,7 @@ var intDigits []int8
const uint32SafeToMultiply10 = uint32(0xffffffff)/10 - 1
const uint64SafeToMultiple10 = uint64(0xffffffffffffffff)/10 - 1
+const maxFloat64 = 1<<53 - 1
func init() {
intDigits = make([]int8, 256)
@@ -339,7 +340,7 @@ func (iter *Iterator) readUint64(c byte) (ret uint64) {
}
func (iter *Iterator) assertInteger() {
- if iter.head < len(iter.buf) && iter.buf[iter.head] == '.' {
+ if iter.head < iter.tail && iter.buf[iter.head] == '.' {
iter.ReportError("assertInteger", "can not decode float as int")
}
}
diff --git a/vendor/github.com/json-iterator/go/iter_object.go b/vendor/github.com/json-iterator/go/iter_object.go
index b65137114..58ee89c84 100644
--- a/vendor/github.com/json-iterator/go/iter_object.go
+++ b/vendor/github.com/json-iterator/go/iter_object.go
@@ -150,7 +150,7 @@ func (iter *Iterator) ReadObjectCB(callback func(*Iterator, string) bool) bool {
if c == '}' {
return iter.decrementDepth()
}
- iter.ReportError("ReadObjectCB", `expect " after }, but found `+string([]byte{c}))
+ iter.ReportError("ReadObjectCB", `expect " after {, but found `+string([]byte{c}))
iter.decrementDepth()
return false
}
@@ -206,7 +206,7 @@ func (iter *Iterator) ReadMapCB(callback func(*Iterator, string) bool) bool {
if c == '}' {
return iter.decrementDepth()
}
- iter.ReportError("ReadMapCB", `expect " after }, but found `+string([]byte{c}))
+ iter.ReportError("ReadMapCB", `expect " after {, but found `+string([]byte{c}))
iter.decrementDepth()
return false
}
diff --git a/vendor/github.com/json-iterator/go/reflect.go b/vendor/github.com/json-iterator/go/reflect.go
index 74974ba74..39acb320a 100644
--- a/vendor/github.com/json-iterator/go/reflect.go
+++ b/vendor/github.com/json-iterator/go/reflect.go
@@ -65,7 +65,7 @@ func (iter *Iterator) ReadVal(obj interface{}) {
decoder := iter.cfg.getDecoderFromCache(cacheKey)
if decoder == nil {
typ := reflect2.TypeOf(obj)
- if typ.Kind() != reflect.Ptr {
+ if typ == nil || typ.Kind() != reflect.Ptr {
iter.ReportError("ReadVal", "can only unmarshal into pointer")
return
}
diff --git a/vendor/github.com/json-iterator/go/reflect_extension.go b/vendor/github.com/json-iterator/go/reflect_extension.go
index 80320cd64..74a97bfe5 100644
--- a/vendor/github.com/json-iterator/go/reflect_extension.go
+++ b/vendor/github.com/json-iterator/go/reflect_extension.go
@@ -475,7 +475,7 @@ func calcFieldNames(originalFieldName string, tagProvidedFieldName string, whole
fieldNames = []string{tagProvidedFieldName}
}
// private?
- isNotExported := unicode.IsLower(rune(originalFieldName[0]))
+ isNotExported := unicode.IsLower(rune(originalFieldName[0])) || originalFieldName[0] == '_'
if isNotExported {
fieldNames = []string{}
}
diff --git a/vendor/github.com/json-iterator/go/reflect_json_raw_message.go b/vendor/github.com/json-iterator/go/reflect_json_raw_message.go
index f2619936c..eba434f2f 100644
--- a/vendor/github.com/json-iterator/go/reflect_json_raw_message.go
+++ b/vendor/github.com/json-iterator/go/reflect_json_raw_message.go
@@ -33,11 +33,19 @@ type jsonRawMessageCodec struct {
}
func (codec *jsonRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- *((*json.RawMessage)(ptr)) = json.RawMessage(iter.SkipAndReturnBytes())
+ if iter.ReadNil() {
+ *((*json.RawMessage)(ptr)) = nil
+ } else {
+ *((*json.RawMessage)(ptr)) = iter.SkipAndReturnBytes()
+ }
}
func (codec *jsonRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteRaw(string(*((*json.RawMessage)(ptr))))
+ if *((*json.RawMessage)(ptr)) == nil {
+ stream.WriteNil()
+ } else {
+ stream.WriteRaw(string(*((*json.RawMessage)(ptr))))
+ }
}
func (codec *jsonRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
@@ -48,11 +56,19 @@ type jsoniterRawMessageCodec struct {
}
func (codec *jsoniterRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- *((*RawMessage)(ptr)) = RawMessage(iter.SkipAndReturnBytes())
+ if iter.ReadNil() {
+ *((*RawMessage)(ptr)) = nil
+ } else {
+ *((*RawMessage)(ptr)) = iter.SkipAndReturnBytes()
+ }
}
func (codec *jsoniterRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteRaw(string(*((*RawMessage)(ptr))))
+ if *((*RawMessage)(ptr)) == nil {
+ stream.WriteNil()
+ } else {
+ stream.WriteRaw(string(*((*RawMessage)(ptr))))
+ }
}
func (codec *jsoniterRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
diff --git a/vendor/github.com/json-iterator/go/reflect_map.go b/vendor/github.com/json-iterator/go/reflect_map.go
index 9e2b623fe..582967130 100644
--- a/vendor/github.com/json-iterator/go/reflect_map.go
+++ b/vendor/github.com/json-iterator/go/reflect_map.go
@@ -49,6 +49,33 @@ func decoderOfMapKey(ctx *ctx, typ reflect2.Type) ValDecoder {
return decoder
}
}
+
+ ptrType := reflect2.PtrTo(typ)
+ if ptrType.Implements(unmarshalerType) {
+ return &referenceDecoder{
+ &unmarshalerDecoder{
+ valType: ptrType,
+ },
+ }
+ }
+ if typ.Implements(unmarshalerType) {
+ return &unmarshalerDecoder{
+ valType: typ,
+ }
+ }
+ if ptrType.Implements(textUnmarshalerType) {
+ return &referenceDecoder{
+ &textUnmarshalerDecoder{
+ valType: ptrType,
+ },
+ }
+ }
+ if typ.Implements(textUnmarshalerType) {
+ return &textUnmarshalerDecoder{
+ valType: typ,
+ }
+ }
+
switch typ.Kind() {
case reflect.String:
return decoderOfType(ctx, reflect2.DefaultTypeOfKind(reflect.String))
@@ -63,31 +90,6 @@ func decoderOfMapKey(ctx *ctx, typ reflect2.Type) ValDecoder {
typ = reflect2.DefaultTypeOfKind(typ.Kind())
return &numericMapKeyDecoder{decoderOfType(ctx, typ)}
default:
- ptrType := reflect2.PtrTo(typ)
- if ptrType.Implements(unmarshalerType) {
- return &referenceDecoder{
- &unmarshalerDecoder{
- valType: ptrType,
- },
- }
- }
- if typ.Implements(unmarshalerType) {
- return &unmarshalerDecoder{
- valType: typ,
- }
- }
- if ptrType.Implements(textUnmarshalerType) {
- return &referenceDecoder{
- &textUnmarshalerDecoder{
- valType: ptrType,
- },
- }
- }
- if typ.Implements(textUnmarshalerType) {
- return &textUnmarshalerDecoder{
- valType: typ,
- }
- }
return &lazyErrorDecoder{err: fmt.Errorf("unsupported map key type: %v", typ)}
}
}
@@ -103,6 +105,19 @@ func encoderOfMapKey(ctx *ctx, typ reflect2.Type) ValEncoder {
return encoder
}
}
+
+ if typ == textMarshalerType {
+ return &directTextMarshalerEncoder{
+ stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
+ }
+ }
+ if typ.Implements(textMarshalerType) {
+ return &textMarshalerEncoder{
+ valType: typ,
+ stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
+ }
+ }
+
switch typ.Kind() {
case reflect.String:
return encoderOfType(ctx, reflect2.DefaultTypeOfKind(reflect.String))
@@ -117,17 +132,6 @@ func encoderOfMapKey(ctx *ctx, typ reflect2.Type) ValEncoder {
typ = reflect2.DefaultTypeOfKind(typ.Kind())
return &numericMapKeyEncoder{encoderOfType(ctx, typ)}
default:
- if typ == textMarshalerType {
- return &directTextMarshalerEncoder{
- stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
- }
- }
- if typ.Implements(textMarshalerType) {
- return &textMarshalerEncoder{
- valType: typ,
- stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
- }
- }
if typ.Kind() == reflect.Interface {
return &dynamicMapKeyEncoder{ctx, typ}
}
@@ -163,10 +167,6 @@ func (decoder *mapDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
if c == '}' {
return
}
- if c != '"' {
- iter.ReportError("ReadMapCB", `expect " after }, but found `+string([]byte{c}))
- return
- }
iter.unreadByte()
key := decoder.keyType.UnsafeNew()
decoder.keyDecoder.Decode(key, iter)
diff --git a/vendor/github.com/json-iterator/go/reflect_optional.go b/vendor/github.com/json-iterator/go/reflect_optional.go
index 43ec71d6d..fa71f4748 100644
--- a/vendor/github.com/json-iterator/go/reflect_optional.go
+++ b/vendor/github.com/json-iterator/go/reflect_optional.go
@@ -2,7 +2,6 @@ package jsoniter
import (
"github.com/modern-go/reflect2"
- "reflect"
"unsafe"
)
@@ -10,9 +9,6 @@ func decoderOfOptional(ctx *ctx, typ reflect2.Type) ValDecoder {
ptrType := typ.(*reflect2.UnsafePtrType)
elemType := ptrType.Elem()
decoder := decoderOfType(ctx, elemType)
- if ctx.prefix == "" && elemType.Kind() == reflect.Ptr {
- return &dereferenceDecoder{elemType, decoder}
- }
return &OptionalDecoder{elemType, decoder}
}
diff --git a/vendor/github.com/json-iterator/go/reflect_struct_decoder.go b/vendor/github.com/json-iterator/go/reflect_struct_decoder.go
index 5ad5cc561..92ae912dc 100644
--- a/vendor/github.com/json-iterator/go/reflect_struct_decoder.go
+++ b/vendor/github.com/json-iterator/go/reflect_struct_decoder.go
@@ -507,7 +507,7 @@ func (decoder *generalStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator)
for c = ','; c == ','; c = iter.nextToken() {
decoder.decodeOneField(ptr, iter)
}
- if iter.Error != nil && iter.Error != io.EOF {
+ if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
}
if c != '}' {
@@ -588,7 +588,7 @@ func (decoder *oneFieldStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator)
break
}
}
- if iter.Error != nil && iter.Error != io.EOF {
+ if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
}
iter.decrementDepth()
@@ -622,7 +622,7 @@ func (decoder *twoFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator
break
}
}
- if iter.Error != nil && iter.Error != io.EOF {
+ if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
}
iter.decrementDepth()
@@ -660,7 +660,7 @@ func (decoder *threeFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat
break
}
}
- if iter.Error != nil && iter.Error != io.EOF {
+ if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
}
iter.decrementDepth()
@@ -702,7 +702,7 @@ func (decoder *fourFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato
break
}
}
- if iter.Error != nil && iter.Error != io.EOF {
+ if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
}
iter.decrementDepth()
@@ -748,7 +748,7 @@ func (decoder *fiveFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato
break
}
}
- if iter.Error != nil && iter.Error != io.EOF {
+ if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
}
iter.decrementDepth()
@@ -798,7 +798,7 @@ func (decoder *sixFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator
break
}
}
- if iter.Error != nil && iter.Error != io.EOF {
+ if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
}
iter.decrementDepth()
@@ -852,7 +852,7 @@ func (decoder *sevenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat
break
}
}
- if iter.Error != nil && iter.Error != io.EOF {
+ if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
}
iter.decrementDepth()
@@ -910,7 +910,7 @@ func (decoder *eightFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat
break
}
}
- if iter.Error != nil && iter.Error != io.EOF {
+ if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
}
iter.decrementDepth()
@@ -972,7 +972,7 @@ func (decoder *nineFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato
break
}
}
- if iter.Error != nil && iter.Error != io.EOF {
+ if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
}
iter.decrementDepth()
@@ -1038,7 +1038,7 @@ func (decoder *tenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator
break
}
}
- if iter.Error != nil && iter.Error != io.EOF {
+ if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
}
iter.decrementDepth()
@@ -1075,6 +1075,11 @@ type stringModeNumberDecoder struct {
}
func (decoder *stringModeNumberDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if iter.WhatIsNext() == NilValue {
+ decoder.elemDecoder.Decode(ptr, iter)
+ return
+ }
+
c := iter.nextToken()
if c != '"' {
iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c}))
diff --git a/vendor/github.com/json-iterator/go/stream.go b/vendor/github.com/json-iterator/go/stream.go
index 17662fded..23d8a3ad6 100644
--- a/vendor/github.com/json-iterator/go/stream.go
+++ b/vendor/github.com/json-iterator/go/stream.go
@@ -103,14 +103,14 @@ func (stream *Stream) Flush() error {
if stream.Error != nil {
return stream.Error
}
- n, err := stream.out.Write(stream.buf)
+ _, err := stream.out.Write(stream.buf)
if err != nil {
if stream.Error == nil {
stream.Error = err
}
return err
}
- stream.buf = stream.buf[n:]
+ stream.buf = stream.buf[:0]
return nil
}
@@ -177,7 +177,6 @@ func (stream *Stream) WriteEmptyObject() {
func (stream *Stream) WriteMore() {
stream.writeByte(',')
stream.writeIndention(0)
- stream.Flush()
}
// WriteArrayStart write [ with possible indention
diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE b/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE
deleted file mode 100644
index 14127cd83..000000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE
+++ /dev/null
@@ -1,9 +0,0 @@
-(The MIT License)
-
-Copyright (c) 2017 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/README.md b/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md
deleted file mode 100644
index 09a4a35c9..000000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# 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
-* Nicolas Perraut
-* @dirty49374
-
-## 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
deleted file mode 100644
index 716c61312..000000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod
+++ /dev/null
@@ -1 +0,0 @@
-module github.com/konsorten/go-windows-terminal-sequences
diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go b/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go
deleted file mode 100644
index 57f530ae8..000000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go
+++ /dev/null
@@ -1,35 +0,0 @@
-// +build windows
-
-package sequences
-
-import (
- "syscall"
-)
-
-var (
- kernel32Dll *syscall.LazyDLL = syscall.NewLazyDLL("Kernel32.dll")
- setConsoleMode *syscall.LazyProc = kernel32Dll.NewProc("SetConsoleMode")
-)
-
-func EnableVirtualTerminalProcessing(stream syscall.Handle, enable bool) error {
- const ENABLE_VIRTUAL_TERMINAL_PROCESSING uint32 = 0x4
-
- var mode uint32
- err := syscall.GetConsoleMode(syscall.Stdout, &mode)
- if err != nil {
- return err
- }
-
- if enable {
- mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING
- } else {
- mode &^= ENABLE_VIRTUAL_TERMINAL_PROCESSING
- }
-
- ret, _, err := setConsoleMode.Call(uintptr(stream), uintptr(mode))
- if ret == 0 {
- return err
- }
-
- return nil
-}
diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go b/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go
deleted file mode 100644
index df61a6f2f..000000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// +build linux darwin
-
-package sequences
-
-import (
- "fmt"
-)
-
-func EnableVirtualTerminalProcessing(stream uintptr, enable bool) error {
- return fmt.Errorf("windows only package")
-}
diff --git a/vendor/github.com/kr/pretty/diff.go b/vendor/github.com/kr/pretty/diff.go
index 6aa7f743a..40a09dc64 100644
--- a/vendor/github.com/kr/pretty/diff.go
+++ b/vendor/github.com/kr/pretty/diff.go
@@ -41,7 +41,12 @@ type Printfer interface {
// It calls Printf once for each difference, with no trailing newline.
// The standard library log.Logger is a Printfer.
func Pdiff(p Printfer, a, b interface{}) {
- diffPrinter{w: p}.diff(reflect.ValueOf(a), reflect.ValueOf(b))
+ d := diffPrinter{
+ w: p,
+ aVisited: make(map[visit]visit),
+ bVisited: make(map[visit]visit),
+ }
+ d.diff(reflect.ValueOf(a), reflect.ValueOf(b))
}
type Logfer interface {
@@ -66,6 +71,9 @@ func Ldiff(l Logfer, a, b interface{}) {
type diffPrinter struct {
w Printfer
l string // label
+
+ aVisited map[visit]visit
+ bVisited map[visit]visit
}
func (w diffPrinter) printf(f string, a ...interface{}) {
@@ -96,6 +104,28 @@ func (w diffPrinter) diff(av, bv reflect.Value) {
return
}
+ if av.CanAddr() && bv.CanAddr() {
+ avis := visit{av.UnsafeAddr(), at}
+ bvis := visit{bv.UnsafeAddr(), bt}
+ var cycle bool
+
+ // Have we seen this value before?
+ if vis, ok := w.aVisited[avis]; ok {
+ cycle = true
+ if vis != bvis {
+ w.printf("%# v (previously visited) != %# v", formatter{v: av, quote: true}, formatter{v: bv, quote: true})
+ }
+ } else if _, ok := w.bVisited[bvis]; ok {
+ cycle = true
+ w.printf("%# v != %# v (previously visited)", formatter{v: av, quote: true}, formatter{v: bv, quote: true})
+ }
+ w.aVisited[avis] = bvis
+ w.bVisited[bvis] = avis
+ if cycle {
+ return
+ }
+ }
+
switch kind := at.Kind(); kind {
case reflect.Bool:
if a, b := av.Bool(), bv.Bool(); a != b {
diff --git a/vendor/github.com/kr/pretty/formatter.go b/vendor/github.com/kr/pretty/formatter.go
index bf4b598d0..249f089ef 100644
--- a/vendor/github.com/kr/pretty/formatter.go
+++ b/vendor/github.com/kr/pretty/formatter.go
@@ -8,6 +8,7 @@ import (
"text/tabwriter"
"github.com/kr/text"
+ "github.com/rogpeppe/go-internal/fmtsort"
)
type formatter struct {
@@ -97,6 +98,14 @@ func (p *printer) printValue(v reflect.Value, showType, quote bool) {
return
}
+ if v.IsValid() && v.CanInterface() {
+ i := v.Interface()
+ if goStringer, ok := i.(fmt.GoStringer); ok {
+ io.WriteString(p, goStringer.GoString())
+ return
+ }
+ }
+
switch v.Kind() {
case reflect.Bool:
p.printInline(v, v.Bool(), showType)
@@ -123,10 +132,10 @@ func (p *printer) printValue(v reflect.Value, showType, quote bool) {
writeByte(p, '\n')
pp = p.indent()
}
- keys := v.MapKeys()
+ sm := fmtsort.Sort(v)
for i := 0; i < v.Len(); i++ {
- k := keys[i]
- mv := v.MapIndex(k)
+ k := sm.Key[i]
+ mv := sm.Value[i]
pp.printValue(k, false, true)
writeByte(pp, ':')
if expand {
diff --git a/vendor/github.com/kr/pretty/go.mod b/vendor/github.com/kr/pretty/go.mod
index 9a27b6e96..d6b299df0 100644
--- a/vendor/github.com/kr/pretty/go.mod
+++ b/vendor/github.com/kr/pretty/go.mod
@@ -2,4 +2,7 @@ module github.com/kr/pretty
go 1.12
-require github.com/kr/text v0.1.0
+require (
+ github.com/kr/text v0.2.0
+ github.com/rogpeppe/go-internal v1.6.1
+)
diff --git a/vendor/github.com/kr/pretty/go.sum b/vendor/github.com/kr/pretty/go.sum
index 714f82a20..0d561dea9 100644
--- a/vendor/github.com/kr/pretty/go.sum
+++ b/vendor/github.com/kr/pretty/go.sum
@@ -1,3 +1,11 @@
+github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
+github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
diff --git a/vendor/github.com/leodido/go-urn/.travis.yml b/vendor/github.com/leodido/go-urn/.travis.yml
index e56cf7cc0..21f348d65 100644
--- a/vendor/github.com/leodido/go-urn/.travis.yml
+++ b/vendor/github.com/leodido/go-urn/.travis.yml
@@ -1,11 +1,9 @@
language: go
go:
- - 1.9.x
- - 1.10.x
- - 1.11.x
- - 1.12.x
- 1.13.x
+ - 1.14.x
+ - 1.15.x
- tip
before_install:
diff --git a/vendor/github.com/leodido/go-urn/go.mod b/vendor/github.com/leodido/go-urn/go.mod
index 65bc1caf2..98cf196df 100644
--- a/vendor/github.com/leodido/go-urn/go.mod
+++ b/vendor/github.com/leodido/go-urn/go.mod
@@ -2,4 +2,4 @@ module github.com/leodido/go-urn
go 1.13
-require github.com/stretchr/testify v1.4.0
+require github.com/stretchr/testify v1.6.1
diff --git a/vendor/github.com/leodido/go-urn/go.sum b/vendor/github.com/leodido/go-urn/go.sum
index 8fdee5854..afe7890c9 100644
--- a/vendor/github.com/leodido/go-urn/go.sum
+++ b/vendor/github.com/leodido/go-urn/go.sum
@@ -3,9 +3,9 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
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.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
-github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
+github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
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/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
-gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/vendor/github.com/leodido/go-urn/urn.go b/vendor/github.com/leodido/go-urn/urn.go
index b903b7b3c..d51a6c915 100644
--- a/vendor/github.com/leodido/go-urn/urn.go
+++ b/vendor/github.com/leodido/go-urn/urn.go
@@ -1,9 +1,13 @@
package urn
import (
+ "encoding/json"
+ "fmt"
"strings"
)
+const errInvalidURN = "invalid URN: %s"
+
// URN represents an Uniform Resource Name.
//
// The general form represented is:
@@ -61,3 +65,22 @@ func Parse(u []byte) (*URN, bool) {
return urn, true
}
+
+// MarshalJSON marshals the URN to JSON string form (e.g. `"urn:oid:1.2.3.4"`).
+func (u URN) MarshalJSON() ([]byte, error) {
+ return json.Marshal(u.String())
+}
+
+// MarshalJSON unmarshals a URN from JSON string form (e.g. `"urn:oid:1.2.3.4"`).
+func (u *URN) UnmarshalJSON(bytes []byte) error {
+ var str string
+ if err := json.Unmarshal(bytes, &str); err != nil {
+ return err
+ }
+ if value, ok := Parse([]byte(str)); !ok {
+ return fmt.Errorf(errInvalidURN, str)
+ } else {
+ *u = *value
+ }
+ return nil
+}
\ No newline at end of file
diff --git a/vendor/github.com/mattn/go-isatty/.travis.yml b/vendor/github.com/mattn/go-isatty/.travis.yml
deleted file mode 100644
index 604314dd4..000000000
--- a/vendor/github.com/mattn/go-isatty/.travis.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-language: go
-sudo: false
-go:
- - 1.13.x
- - tip
-
-before_install:
- - go get -t -v ./...
-
-script:
- - ./go.test.sh
-
-after_success:
- - bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/github.com/mattn/go-isatty/go.mod b/vendor/github.com/mattn/go-isatty/go.mod
index 605c4c221..c9a20b7f3 100644
--- a/vendor/github.com/mattn/go-isatty/go.mod
+++ b/vendor/github.com/mattn/go-isatty/go.mod
@@ -2,4 +2,4 @@ module github.com/mattn/go-isatty
go 1.12
-require golang.org/x/sys v0.0.0-20200116001909-b77594299b42
+require golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
diff --git a/vendor/github.com/mattn/go-isatty/isatty_bsd.go b/vendor/github.com/mattn/go-isatty/isatty_bsd.go
index 711f28808..39bbcf00f 100644
--- a/vendor/github.com/mattn/go-isatty/isatty_bsd.go
+++ b/vendor/github.com/mattn/go-isatty/isatty_bsd.go
@@ -1,3 +1,4 @@
+//go:build (darwin || freebsd || openbsd || netbsd || dragonfly) && !appengine
// +build darwin freebsd openbsd netbsd dragonfly
// +build !appengine
diff --git a/vendor/github.com/mattn/go-isatty/isatty_others.go b/vendor/github.com/mattn/go-isatty/isatty_others.go
index ff714a376..31503226f 100644
--- a/vendor/github.com/mattn/go-isatty/isatty_others.go
+++ b/vendor/github.com/mattn/go-isatty/isatty_others.go
@@ -1,4 +1,5 @@
-// +build appengine js nacl
+//go:build appengine || js || nacl || wasm
+// +build appengine js nacl wasm
package isatty
diff --git a/vendor/github.com/mattn/go-isatty/isatty_plan9.go b/vendor/github.com/mattn/go-isatty/isatty_plan9.go
index c5b6e0c08..bae7f9bb3 100644
--- a/vendor/github.com/mattn/go-isatty/isatty_plan9.go
+++ b/vendor/github.com/mattn/go-isatty/isatty_plan9.go
@@ -1,3 +1,4 @@
+//go:build plan9
// +build plan9
package isatty
diff --git a/vendor/github.com/mattn/go-isatty/isatty_solaris.go b/vendor/github.com/mattn/go-isatty/isatty_solaris.go
index bdd5c79a0..0c3acf2dc 100644
--- a/vendor/github.com/mattn/go-isatty/isatty_solaris.go
+++ b/vendor/github.com/mattn/go-isatty/isatty_solaris.go
@@ -1,5 +1,5 @@
-// +build solaris
-// +build !appengine
+//go:build solaris && !appengine
+// +build solaris,!appengine
package isatty
@@ -8,10 +8,9 @@ import (
)
// IsTerminal returns true if the given file descriptor is a terminal.
-// see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c
+// see: https://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/isatty.c
func IsTerminal(fd uintptr) bool {
- var termio unix.Termio
- err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio)
+ _, err := unix.IoctlGetTermio(int(fd), unix.TCGETA)
return err == nil
}
diff --git a/vendor/github.com/mattn/go-isatty/isatty_tcgets.go b/vendor/github.com/mattn/go-isatty/isatty_tcgets.go
index 31a1ca973..67787657f 100644
--- a/vendor/github.com/mattn/go-isatty/isatty_tcgets.go
+++ b/vendor/github.com/mattn/go-isatty/isatty_tcgets.go
@@ -1,4 +1,5 @@
-// +build linux aix
+//go:build (linux || aix || zos) && !appengine
+// +build linux aix zos
// +build !appengine
package isatty
diff --git a/vendor/github.com/mattn/go-isatty/isatty_windows.go b/vendor/github.com/mattn/go-isatty/isatty_windows.go
index 1fa869154..8e3c99171 100644
--- a/vendor/github.com/mattn/go-isatty/isatty_windows.go
+++ b/vendor/github.com/mattn/go-isatty/isatty_windows.go
@@ -1,5 +1,5 @@
-// +build windows
-// +build !appengine
+//go:build windows && !appengine
+// +build windows,!appengine
package isatty
@@ -76,7 +76,7 @@ func isCygwinPipeName(name string) bool {
}
// getFileNameByHandle use the undocomented ntdll NtQueryObject to get file full name from file handler
-// since GetFileInformationByHandleEx is not avilable under windows Vista and still some old fashion
+// since GetFileInformationByHandleEx is not available under windows Vista and still some old fashion
// guys are using Windows XP, this is a workaround for those guys, it will also work on system from
// Windows vista to 10
// see https://stackoverflow.com/a/18792477 for details
diff --git a/vendor/github.com/mattn/go-isatty/renovate.json b/vendor/github.com/mattn/go-isatty/renovate.json
deleted file mode 100644
index 5ae9d96b7..000000000
--- a/vendor/github.com/mattn/go-isatty/renovate.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": [
- "config:base"
- ],
- "postUpdateOptions": [
- "gomodTidy"
- ]
-}
diff --git a/vendor/github.com/modern-go/reflect2/.travis.yml b/vendor/github.com/modern-go/reflect2/.travis.yml
index fbb43744d..b097728db 100644
--- a/vendor/github.com/modern-go/reflect2/.travis.yml
+++ b/vendor/github.com/modern-go/reflect2/.travis.yml
@@ -1,7 +1,7 @@
language: go
go:
- - 1.8.x
+ - 1.9.x
- 1.x
before_install:
diff --git a/vendor/github.com/modern-go/reflect2/Gopkg.lock b/vendor/github.com/modern-go/reflect2/Gopkg.lock
index 2a3a69893..10ef81118 100644
--- a/vendor/github.com/modern-go/reflect2/Gopkg.lock
+++ b/vendor/github.com/modern-go/reflect2/Gopkg.lock
@@ -1,15 +1,9 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
-[[projects]]
- name = "github.com/modern-go/concurrent"
- packages = ["."]
- revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a"
- version = "1.0.0"
-
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
- inputs-digest = "daee8a88b3498b61c5640056665b8b9eea062006f5e596bbb6a3ed9119a11ec7"
+ input-imports = []
solver-name = "gps-cdcl"
solver-version = 1
diff --git a/vendor/github.com/modern-go/reflect2/Gopkg.toml b/vendor/github.com/modern-go/reflect2/Gopkg.toml
index 2f4f4dbdc..a9bc5061b 100644
--- a/vendor/github.com/modern-go/reflect2/Gopkg.toml
+++ b/vendor/github.com/modern-go/reflect2/Gopkg.toml
@@ -26,10 +26,6 @@
ignored = []
-[[constraint]]
- name = "github.com/modern-go/concurrent"
- version = "1.0.0"
-
[prune]
go-tests = true
unused-packages = true
diff --git a/vendor/github.com/modern-go/reflect2/go.mod b/vendor/github.com/modern-go/reflect2/go.mod
new file mode 100644
index 000000000..9057e9b33
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/go.mod
@@ -0,0 +1,3 @@
+module github.com/modern-go/reflect2
+
+go 1.12
diff --git a/vendor/github.com/modern-go/reflect2/go_above_118.go b/vendor/github.com/modern-go/reflect2/go_above_118.go
new file mode 100644
index 000000000..2b4116f6c
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/go_above_118.go
@@ -0,0 +1,23 @@
+//+build go1.18
+
+package reflect2
+
+import (
+ "unsafe"
+)
+
+// m escapes into the return value, but the caller of mapiterinit
+// doesn't let the return value escape.
+//go:noescape
+//go:linkname mapiterinit reflect.mapiterinit
+func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer, it *hiter)
+
+func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator {
+ var it hiter
+ mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj), &it)
+ return &UnsafeMapIterator{
+ hiter: &it,
+ pKeyRType: type2.pKeyRType,
+ pElemRType: type2.pElemRType,
+ }
+}
\ No newline at end of file
diff --git a/vendor/github.com/modern-go/reflect2/go_above_17.go b/vendor/github.com/modern-go/reflect2/go_above_17.go
deleted file mode 100644
index 5c1cea868..000000000
--- a/vendor/github.com/modern-go/reflect2/go_above_17.go
+++ /dev/null
@@ -1,8 +0,0 @@
-//+build go1.7
-
-package reflect2
-
-import "unsafe"
-
-//go:linkname resolveTypeOff reflect.resolveTypeOff
-func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer
diff --git a/vendor/github.com/modern-go/reflect2/go_above_19.go b/vendor/github.com/modern-go/reflect2/go_above_19.go
index c7e3b7801..974f7685e 100644
--- a/vendor/github.com/modern-go/reflect2/go_above_19.go
+++ b/vendor/github.com/modern-go/reflect2/go_above_19.go
@@ -6,6 +6,9 @@ import (
"unsafe"
)
+//go:linkname resolveTypeOff reflect.resolveTypeOff
+func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer
+
//go:linkname makemap reflect.makemap
func makemap(rtype unsafe.Pointer, cap int) (m unsafe.Pointer)
diff --git a/vendor/github.com/modern-go/reflect2/go_below_118.go b/vendor/github.com/modern-go/reflect2/go_below_118.go
new file mode 100644
index 000000000..00003dbd7
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/go_below_118.go
@@ -0,0 +1,21 @@
+//+build !go1.18
+
+package reflect2
+
+import (
+ "unsafe"
+)
+
+// m escapes into the return value, but the caller of mapiterinit
+// doesn't let the return value escape.
+//go:noescape
+//go:linkname mapiterinit reflect.mapiterinit
+func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer) (val *hiter)
+
+func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator {
+ return &UnsafeMapIterator{
+ hiter: mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj)),
+ pKeyRType: type2.pKeyRType,
+ pElemRType: type2.pElemRType,
+ }
+}
\ No newline at end of file
diff --git a/vendor/github.com/modern-go/reflect2/go_below_17.go b/vendor/github.com/modern-go/reflect2/go_below_17.go
deleted file mode 100644
index 65a93c889..000000000
--- a/vendor/github.com/modern-go/reflect2/go_below_17.go
+++ /dev/null
@@ -1,9 +0,0 @@
-//+build !go1.7
-
-package reflect2
-
-import "unsafe"
-
-func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer {
- return nil
-}
diff --git a/vendor/github.com/modern-go/reflect2/go_below_19.go b/vendor/github.com/modern-go/reflect2/go_below_19.go
deleted file mode 100644
index b050ef70c..000000000
--- a/vendor/github.com/modern-go/reflect2/go_below_19.go
+++ /dev/null
@@ -1,14 +0,0 @@
-//+build !go1.9
-
-package reflect2
-
-import (
- "unsafe"
-)
-
-//go:linkname makemap reflect.makemap
-func makemap(rtype unsafe.Pointer) (m unsafe.Pointer)
-
-func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer {
- return makemap(rtype)
-}
diff --git a/vendor/github.com/modern-go/reflect2/reflect2.go b/vendor/github.com/modern-go/reflect2/reflect2.go
index 63b49c799..c43c8b9d6 100644
--- a/vendor/github.com/modern-go/reflect2/reflect2.go
+++ b/vendor/github.com/modern-go/reflect2/reflect2.go
@@ -1,8 +1,9 @@
package reflect2
import (
- "github.com/modern-go/concurrent"
"reflect"
+ "runtime"
+ "sync"
"unsafe"
)
@@ -130,13 +131,13 @@ var ConfigSafe = Config{UseSafeImplementation: true}.Froze()
type frozenConfig struct {
useSafeImplementation bool
- cache *concurrent.Map
+ cache *sync.Map
}
func (cfg Config) Froze() *frozenConfig {
return &frozenConfig{
useSafeImplementation: cfg.UseSafeImplementation,
- cache: concurrent.NewMap(),
+ cache: new(sync.Map),
}
}
@@ -288,11 +289,12 @@ func NoEscape(p unsafe.Pointer) unsafe.Pointer {
}
func UnsafeCastString(str string) []byte {
+ bytes := make([]byte, 0)
stringHeader := (*reflect.StringHeader)(unsafe.Pointer(&str))
- sliceHeader := &reflect.SliceHeader{
- Data: stringHeader.Data,
- Cap: stringHeader.Len,
- Len: stringHeader.Len,
- }
- return *(*[]byte)(unsafe.Pointer(sliceHeader))
+ sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&bytes))
+ sliceHeader.Data = stringHeader.Data
+ sliceHeader.Cap = stringHeader.Len
+ sliceHeader.Len = stringHeader.Len
+ runtime.KeepAlive(str)
+ return bytes
}
diff --git a/vendor/github.com/modern-go/reflect2/test.sh b/vendor/github.com/modern-go/reflect2/test.sh
deleted file mode 100644
index 3d2b9768c..000000000
--- a/vendor/github.com/modern-go/reflect2/test.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-echo "" > coverage.txt
-
-for d in $(go list github.com/modern-go/reflect2-tests/... | grep -v vendor); do
- go test -coverprofile=profile.out -coverpkg=github.com/modern-go/reflect2 $d
- if [ -f profile.out ]; then
- cat profile.out >> coverage.txt
- rm profile.out
- fi
-done
diff --git a/vendor/github.com/modern-go/reflect2/type_map.go b/vendor/github.com/modern-go/reflect2/type_map.go
index 3acfb5580..4b13c3155 100644
--- a/vendor/github.com/modern-go/reflect2/type_map.go
+++ b/vendor/github.com/modern-go/reflect2/type_map.go
@@ -1,17 +1,13 @@
+// +build !gccgo
+
package reflect2
import (
"reflect"
- "runtime"
- "strings"
"sync"
"unsafe"
)
-// typelinks1 for 1.5 ~ 1.6
-//go:linkname typelinks1 reflect.typelinks
-func typelinks1() [][]unsafe.Pointer
-
// typelinks2 for 1.7 ~
//go:linkname typelinks2 reflect.typelinks
func typelinks2() (sections []unsafe.Pointer, offset [][]int32)
@@ -27,49 +23,10 @@ func discoverTypes() {
types = make(map[string]reflect.Type)
packages = make(map[string]map[string]reflect.Type)
- ver := runtime.Version()
- if ver == "go1.5" || strings.HasPrefix(ver, "go1.5.") {
- loadGo15Types()
- } else if ver == "go1.6" || strings.HasPrefix(ver, "go1.6.") {
- loadGo15Types()
- } else {
- loadGo17Types()
- }
+ loadGoTypes()
}
-func loadGo15Types() {
- var obj interface{} = reflect.TypeOf(0)
- typePtrss := typelinks1()
- for _, typePtrs := range typePtrss {
- for _, typePtr := range typePtrs {
- (*emptyInterface)(unsafe.Pointer(&obj)).word = typePtr
- typ := obj.(reflect.Type)
- if typ.Kind() == reflect.Ptr && typ.Elem().Kind() == reflect.Struct {
- loadedType := typ.Elem()
- pkgTypes := packages[loadedType.PkgPath()]
- if pkgTypes == nil {
- pkgTypes = map[string]reflect.Type{}
- packages[loadedType.PkgPath()] = pkgTypes
- }
- types[loadedType.String()] = loadedType
- pkgTypes[loadedType.Name()] = loadedType
- }
- if typ.Kind() == reflect.Slice && typ.Elem().Kind() == reflect.Ptr &&
- typ.Elem().Elem().Kind() == reflect.Struct {
- loadedType := typ.Elem().Elem()
- pkgTypes := packages[loadedType.PkgPath()]
- if pkgTypes == nil {
- pkgTypes = map[string]reflect.Type{}
- packages[loadedType.PkgPath()] = pkgTypes
- }
- types[loadedType.String()] = loadedType
- pkgTypes[loadedType.Name()] = loadedType
- }
- }
- }
-}
-
-func loadGo17Types() {
+func loadGoTypes() {
var obj interface{} = reflect.TypeOf(0)
sections, offset := typelinks2()
for i, offs := range offset {
diff --git a/vendor/github.com/modern-go/reflect2/unsafe_link.go b/vendor/github.com/modern-go/reflect2/unsafe_link.go
index 57229c8db..b49f614ef 100644
--- a/vendor/github.com/modern-go/reflect2/unsafe_link.go
+++ b/vendor/github.com/modern-go/reflect2/unsafe_link.go
@@ -19,18 +19,12 @@ func typedslicecopy(elemType unsafe.Pointer, dst, src sliceHeader) int
//go:linkname mapassign reflect.mapassign
//go:noescape
-func mapassign(rtype unsafe.Pointer, m unsafe.Pointer, key, val unsafe.Pointer)
+func mapassign(rtype unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer, val unsafe.Pointer)
//go:linkname mapaccess reflect.mapaccess
//go:noescape
func mapaccess(rtype unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer) (val unsafe.Pointer)
-// m escapes into the return value, but the caller of mapiterinit
-// doesn't let the return value escape.
-//go:noescape
-//go:linkname mapiterinit reflect.mapiterinit
-func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer) *hiter
-
//go:noescape
//go:linkname mapiternext reflect.mapiternext
func mapiternext(it *hiter)
@@ -42,9 +36,21 @@ func ifaceE2I(rtype unsafe.Pointer, src interface{}, dst unsafe.Pointer)
// If you modify hiter, also change cmd/internal/gc/reflect.go to indicate
// the layout of this structure.
type hiter struct {
- key unsafe.Pointer // Must be in first position. Write nil to indicate iteration end (see cmd/internal/gc/range.go).
- value unsafe.Pointer // Must be in second position (see cmd/internal/gc/range.go).
- // rest fields are ignored
+ key unsafe.Pointer
+ value unsafe.Pointer
+ t unsafe.Pointer
+ h unsafe.Pointer
+ buckets unsafe.Pointer
+ bptr unsafe.Pointer
+ overflow *[]unsafe.Pointer
+ oldoverflow *[]unsafe.Pointer
+ startBucket uintptr
+ offset uint8
+ wrapped bool
+ B uint8
+ i uint8
+ bucket uintptr
+ checkBucket uintptr
}
// add returns p+x.
diff --git a/vendor/github.com/modern-go/reflect2/unsafe_map.go b/vendor/github.com/modern-go/reflect2/unsafe_map.go
index f2e76e6bb..37872da81 100644
--- a/vendor/github.com/modern-go/reflect2/unsafe_map.go
+++ b/vendor/github.com/modern-go/reflect2/unsafe_map.go
@@ -107,14 +107,6 @@ func (type2 *UnsafeMapType) Iterate(obj interface{}) MapIterator {
return type2.UnsafeIterate(objEFace.data)
}
-func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator {
- return &UnsafeMapIterator{
- hiter: mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj)),
- pKeyRType: type2.pKeyRType,
- pElemRType: type2.pElemRType,
- }
-}
-
type UnsafeMapIterator struct {
*hiter
pKeyRType unsafe.Pointer
diff --git a/vendor/github.com/rogpeppe/go-internal/LICENSE b/vendor/github.com/rogpeppe/go-internal/LICENSE
new file mode 100644
index 000000000..49ea0f928
--- /dev/null
+++ b/vendor/github.com/rogpeppe/go-internal/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2018 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/rogpeppe/go-internal/fmtsort/mapelem.go b/vendor/github.com/rogpeppe/go-internal/fmtsort/mapelem.go
new file mode 100644
index 000000000..af6124f10
--- /dev/null
+++ b/vendor/github.com/rogpeppe/go-internal/fmtsort/mapelem.go
@@ -0,0 +1,22 @@
+// +build go1.12
+
+package fmtsort
+
+import "reflect"
+
+const brokenNaNs = false
+
+func mapElems(mapValue reflect.Value) ([]reflect.Value, []reflect.Value) {
+ // Note: this code is arranged to not panic even in the presence
+ // of a concurrent map update. The runtime is responsible for
+ // yelling loudly if that happens. See issue 33275.
+ n := mapValue.Len()
+ key := make([]reflect.Value, 0, n)
+ value := make([]reflect.Value, 0, n)
+ iter := mapValue.MapRange()
+ for iter.Next() {
+ key = append(key, iter.Key())
+ value = append(value, iter.Value())
+ }
+ return key, value
+}
diff --git a/vendor/github.com/rogpeppe/go-internal/fmtsort/mapelem_1.11.go b/vendor/github.com/rogpeppe/go-internal/fmtsort/mapelem_1.11.go
new file mode 100644
index 000000000..6c2b02220
--- /dev/null
+++ b/vendor/github.com/rogpeppe/go-internal/fmtsort/mapelem_1.11.go
@@ -0,0 +1,23 @@
+// +build !go1.12
+
+package fmtsort
+
+import "reflect"
+
+const brokenNaNs = true
+
+func mapElems(mapValue reflect.Value) ([]reflect.Value, []reflect.Value) {
+ key := mapValue.MapKeys()
+ value := make([]reflect.Value, 0, len(key))
+ for _, k := range key {
+ v := mapValue.MapIndex(k)
+ if !v.IsValid() {
+ // Note: we can't retrieve the value, probably because
+ // the key is NaN, so just do the best we can and
+ // add a zero value of the correct type in that case.
+ v = reflect.Zero(mapValue.Type().Elem())
+ }
+ value = append(value, v)
+ }
+ return key, value
+}
diff --git a/vendor/github.com/rogpeppe/go-internal/fmtsort/sort.go b/vendor/github.com/rogpeppe/go-internal/fmtsort/sort.go
new file mode 100644
index 000000000..0fb5187dd
--- /dev/null
+++ b/vendor/github.com/rogpeppe/go-internal/fmtsort/sort.go
@@ -0,0 +1,210 @@
+// Copyright 2018 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 fmtsort provides a general stable ordering mechanism
+// for maps, on behalf of the fmt and text/template packages.
+// It is not guaranteed to be efficient and works only for types
+// that are valid map keys.
+package fmtsort
+
+import (
+ "reflect"
+ "sort"
+)
+
+// Note: Throughout this package we avoid calling reflect.Value.Interface as
+// it is not always legal to do so and it's easier to avoid the issue than to face it.
+
+// SortedMap represents a map's keys and values. The keys and values are
+// aligned in index order: Value[i] is the value in the map corresponding to Key[i].
+type SortedMap struct {
+ Key []reflect.Value
+ Value []reflect.Value
+}
+
+func (o *SortedMap) Len() int { return len(o.Key) }
+func (o *SortedMap) Less(i, j int) bool { return compare(o.Key[i], o.Key[j]) < 0 }
+func (o *SortedMap) Swap(i, j int) {
+ o.Key[i], o.Key[j] = o.Key[j], o.Key[i]
+ o.Value[i], o.Value[j] = o.Value[j], o.Value[i]
+}
+
+// Sort accepts a map and returns a SortedMap that has the same keys and
+// values but in a stable sorted order according to the keys, modulo issues
+// raised by unorderable key values such as NaNs.
+//
+// The ordering rules are more general than with Go's < operator:
+//
+// - when applicable, nil compares low
+// - ints, floats, and strings order by <
+// - NaN compares less than non-NaN floats
+// - bool compares false before true
+// - complex compares real, then imag
+// - pointers compare by machine address
+// - channel values compare by machine address
+// - structs compare each field in turn
+// - arrays compare each element in turn.
+// Otherwise identical arrays compare by length.
+// - interface values compare first by reflect.Type describing the concrete type
+// and then by concrete value as described in the previous rules.
+//
+func Sort(mapValue reflect.Value) *SortedMap {
+ if mapValue.Type().Kind() != reflect.Map {
+ return nil
+ }
+ key, value := mapElems(mapValue)
+ sorted := &SortedMap{
+ Key: key,
+ Value: value,
+ }
+ sort.Stable(sorted)
+ return sorted
+}
+
+// compare compares two values of the same type. It returns -1, 0, 1
+// according to whether a > b (1), a == b (0), or a < b (-1).
+// If the types differ, it returns -1.
+// See the comment on Sort for the comparison rules.
+func compare(aVal, bVal reflect.Value) int {
+ aType, bType := aVal.Type(), bVal.Type()
+ if aType != bType {
+ return -1 // No good answer possible, but don't return 0: they're not equal.
+ }
+ switch aVal.Kind() {
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ a, b := aVal.Int(), bVal.Int()
+ switch {
+ case a < b:
+ return -1
+ case a > b:
+ return 1
+ default:
+ return 0
+ }
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
+ a, b := aVal.Uint(), bVal.Uint()
+ switch {
+ case a < b:
+ return -1
+ case a > b:
+ return 1
+ default:
+ return 0
+ }
+ case reflect.String:
+ a, b := aVal.String(), bVal.String()
+ switch {
+ case a < b:
+ return -1
+ case a > b:
+ return 1
+ default:
+ return 0
+ }
+ case reflect.Float32, reflect.Float64:
+ return floatCompare(aVal.Float(), bVal.Float())
+ case reflect.Complex64, reflect.Complex128:
+ a, b := aVal.Complex(), bVal.Complex()
+ if c := floatCompare(real(a), real(b)); c != 0 {
+ return c
+ }
+ return floatCompare(imag(a), imag(b))
+ case reflect.Bool:
+ a, b := aVal.Bool(), bVal.Bool()
+ switch {
+ case a == b:
+ return 0
+ case a:
+ return 1
+ default:
+ return -1
+ }
+ case reflect.Ptr:
+ a, b := aVal.Pointer(), bVal.Pointer()
+ switch {
+ case a < b:
+ return -1
+ case a > b:
+ return 1
+ default:
+ return 0
+ }
+ case reflect.Chan:
+ if c, ok := nilCompare(aVal, bVal); ok {
+ return c
+ }
+ ap, bp := aVal.Pointer(), bVal.Pointer()
+ switch {
+ case ap < bp:
+ return -1
+ case ap > bp:
+ return 1
+ default:
+ return 0
+ }
+ case reflect.Struct:
+ for i := 0; i < aVal.NumField(); i++ {
+ if c := compare(aVal.Field(i), bVal.Field(i)); c != 0 {
+ return c
+ }
+ }
+ return 0
+ case reflect.Array:
+ for i := 0; i < aVal.Len(); i++ {
+ if c := compare(aVal.Index(i), bVal.Index(i)); c != 0 {
+ return c
+ }
+ }
+ return 0
+ case reflect.Interface:
+ if c, ok := nilCompare(aVal, bVal); ok {
+ return c
+ }
+ c := compare(reflect.ValueOf(aVal.Elem().Type()), reflect.ValueOf(bVal.Elem().Type()))
+ if c != 0 {
+ return c
+ }
+ return compare(aVal.Elem(), bVal.Elem())
+ default:
+ // Certain types cannot appear as keys (maps, funcs, slices), but be explicit.
+ panic("bad type in compare: " + aType.String())
+ }
+}
+
+// nilCompare checks whether either value is nil. If not, the boolean is false.
+// If either value is nil, the boolean is true and the integer is the comparison
+// value. The comparison is defined to be 0 if both are nil, otherwise the one
+// nil value compares low. Both arguments must represent a chan, func,
+// interface, map, pointer, or slice.
+func nilCompare(aVal, bVal reflect.Value) (int, bool) {
+ if aVal.IsNil() {
+ if bVal.IsNil() {
+ return 0, true
+ }
+ return -1, true
+ }
+ if bVal.IsNil() {
+ return 1, true
+ }
+ return 0, false
+}
+
+// floatCompare compares two floating-point values. NaNs compare low.
+func floatCompare(a, b float64) int {
+ switch {
+ case isNaN(a):
+ return -1 // No good answer if b is a NaN so don't bother checking.
+ case isNaN(b):
+ return 1
+ case a < b:
+ return -1
+ case a > b:
+ return 1
+ }
+ return 0
+}
+
+func isNaN(a float64) bool {
+ return a != a
+}
diff --git a/vendor/github.com/rs/zerolog/.travis.yml b/vendor/github.com/rs/zerolog/.travis.yml
deleted file mode 100644
index 70b67c963..000000000
--- a/vendor/github.com/rs/zerolog/.travis.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-language: go
-go:
-- "1.7"
-- "1.8"
-- "1.9"
-- "1.10"
-- "1.11"
-- "1.12"
-- "master"
-matrix:
- allow_failures:
- - go: "master"
-script:
- - go test -v -race -cpu=1,2,4 -bench . -benchmem ./...
- - go test -v -tags binary_log -race -cpu=1,2,4 -bench . -benchmem ./...
diff --git a/vendor/github.com/rs/zerolog/README.md b/vendor/github.com/rs/zerolog/README.md
index bd28c29a5..536e3e412 100644
--- a/vendor/github.com/rs/zerolog/README.md
+++ b/vendor/github.com/rs/zerolog/README.md
@@ -18,16 +18,17 @@ Find out [who uses zerolog](https://github.com/rs/zerolog/wiki/Who-uses-zerolog)
## Features
-* Blazing fast
-* Low to zero allocation
-* Level logging
-* Sampling
-* Hooks
-* Contextual fields
+* [Blazing fast](#benchmarks)
+* [Low to zero allocation](#benchmarks)
+* [Leveled logging](#leveled-logging)
+* [Sampling](#log-sampling)
+* [Hooks](#hooks)
+* [Contextual fields](#contextual-logging)
* `context.Context` integration
-* `net/http` helpers
-* JSON and CBOR encoding formats
-* Pretty logging for development
+* [Integration with `net/http`](#integration-with-nethttp)
+* [JSON and CBOR encoding formats](#binary-encoding)
+* [Pretty logging for development](#pretty-logging)
+* [Error Logging (with optional Stacktrace)](#error-logging)
## Installation
@@ -51,8 +52,6 @@ import (
func main() {
// UNIX Time is faster and smaller than most timestamps
- // If you set zerolog.TimeFieldFormat to an empty string,
- // logs will write with UNIX time
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
log.Print("hello world")
@@ -205,6 +204,80 @@ func main() {
// Output: {"time":1494567715,"foo":"bar"}
```
+### Error Logging
+
+You can log errors using the `Err` method
+
+```go
+package main
+
+import (
+ "errors"
+
+ "github.com/rs/zerolog"
+ "github.com/rs/zerolog/log"
+)
+
+func main() {
+ zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
+
+ err := errors.New("seems we have an error here")
+ log.Error().Err(err).Msg("")
+}
+
+// Output: {"level":"error","error":"seems we have an error here","time":1609085256}
+```
+
+> The default field name for errors is `error`, you can change this by setting `zerolog.ErrorFieldName` to meet your needs.
+
+#### Error Logging with Stacktrace
+
+Using `github.com/pkg/errors`, you can add a formatted stacktrace to your errors.
+
+```go
+package main
+
+import (
+ "github.com/pkg/errors"
+ "github.com/rs/zerolog/pkgerrors"
+
+ "github.com/rs/zerolog"
+ "github.com/rs/zerolog/log"
+)
+
+func main() {
+ zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
+ zerolog.ErrorStackMarshaler = pkgerrors.MarshalStack
+
+ err := outer()
+ log.Error().Stack().Err(err).Msg("")
+}
+
+func inner() error {
+ return errors.New("seems we have an error here")
+}
+
+func middle() error {
+ err := inner()
+ if err != nil {
+ return err
+ }
+ return nil
+}
+
+func outer() error {
+ err := middle()
+ if err != nil {
+ return err
+ }
+ return nil
+}
+
+// Output: {"level":"error","stack":[{"func":"inner","line":"20","source":"errors.go"},{"func":"middle","line":"24","source":"errors.go"},{"func":"outer","line":"32","source":"errors.go"},{"func":"main","line":"15","source":"errors.go"},{"func":"main","line":"204","source":"proc.go"},{"func":"goexit","line":"1374","source":"asm_amd64.s"}],"error":"seems we have an error here","time":1609086683}
+```
+
+> zerolog.ErrorStackMarshaler must be set in order for the stack to output anything.
+
#### Logging Fatal Messages
```go
@@ -235,6 +308,7 @@ func main() {
> NOTE: Using `Msgf` generates one allocation even when the logger is disabled.
+
### Create logger instance to manage different outputs
```go
@@ -341,7 +415,7 @@ If your writer might be slow or not thread-safe and you need your log producers
wr := diode.NewWriter(os.Stdout, 1000, 10*time.Millisecond, func(missed int) {
fmt.Printf("Logger Dropped %d messages", missed)
})
-log := zerolog.New(w)
+log := zerolog.New(wr)
log.Print("test")
```
@@ -435,11 +509,11 @@ c := alice.New()
c = c.Append(hlog.NewHandler(log))
// Install some provided extra handler to set some request's context fields.
-// Thanks to those handler, all our logs will come with some pre-populated fields.
+// Thanks to that handler, all our logs will come with some prepopulated fields.
c = c.Append(hlog.AccessHandler(func(r *http.Request, status, size int, duration time.Duration) {
hlog.FromRequest(r).Info().
Str("method", r.Method).
- Str("url", r.URL.String()).
+ Stringer("url", r.URL).
Int("status", status).
Int("size", size).
Dur("duration", duration).
@@ -469,12 +543,31 @@ if err := http.ListenAndServe(":8080", nil); err != nil {
}
```
+## Multiple Log Output
+`zerolog.MultiLevelWriter` may be used to send the log message to multiple outputs.
+In this example, we send the log message to both `os.Stdout` and the in-built ConsoleWriter.
+```go
+func main() {
+ consoleWriter := zerolog.ConsoleWriter{Out: os.Stdout}
+
+ multi := zerolog.MultiLevelWriter(consoleWriter, os.Stdout)
+
+ logger := zerolog.New(multi).With().Timestamp().Logger()
+
+ logger.Info().Msg("Hello World!")
+}
+
+// Output (Line 1: Console; Line 2: Stdout)
+// 12:36PM INF Hello World!
+// {"level":"info","time":"2019-11-07T12:36:38+03:00","message":"Hello World!"}
+```
+
## Global Settings
Some settings can be changed and will by applied to all loggers:
* `log.Logger`: You can set this value to customize the global logger (the one used by package level methods).
-* `zerolog.SetGlobalLevel`: Can raise the minimum level of all loggers. Set this to `zerolog.Disabled` to disable logging altogether (quiet mode).
+* `zerolog.SetGlobalLevel`: Can raise the minimum level of all loggers. Call this with `zerolog.Disabled` to disable logging altogether (quiet mode).
* `zerolog.DisableSampling`: If argument is `true`, all sampled loggers will stop sampling and issue 100% of their log events.
* `zerolog.TimestampFieldName`: Can be set to customize `Timestamp` field name.
* `zerolog.LevelFieldName`: Can be set to customize level field name.
@@ -497,13 +590,18 @@ Some settings can be changed and will by applied to all loggers:
### Advanced Fields
-* `Err`: Takes an `error` and render it as a string using the `zerolog.ErrorFieldName` field name.
-* `Timestamp`: Insert a timestamp field with `zerolog.TimestampFieldName` field name and formatted using `zerolog.TimeFieldFormat`.
-* `Time`: Adds a field with the time formated with the `zerolog.TimeFieldFormat`.
-* `Dur`: Adds a field with a `time.Duration`.
+* `Err`: Takes an `error` and renders it as a string using the `zerolog.ErrorFieldName` field name.
+* `Func`: Run a `func` only if the level is enabled.
+* `Timestamp`: Inserts a timestamp field with `zerolog.TimestampFieldName` field name, formatted using `zerolog.TimeFieldFormat`.
+* `Time`: Adds a field with time formatted with `zerolog.TimeFieldFormat`.
+* `Dur`: Adds a field with `time.Duration`.
* `Dict`: Adds a sub-key/value as a field of the event.
+* `RawJSON`: Adds a field with an already encoded JSON (`[]byte`)
+* `Hex`: Adds a field with value formatted as a hexadecimal string (`[]byte`)
* `Interface`: Uses reflection to marshal the type.
+Most fields are also available in the slice format (`Strs` for `[]string`, `Errs` for `[]error` etc.)
+
## Binary Encoding
In addition to the default JSON encoding, `zerolog` can produce binary logs using [CBOR](http://cbor.io) encoding. The choice of encoding can be decided at compile time using the build tag `binary_log` as follows:
@@ -518,6 +616,8 @@ with zerolog library is [CSD](https://github.com/toravir/csd/).
## Related Projects
* [grpc-zerolog](https://github.com/cheapRoc/grpc-zerolog): Implementation of `grpclog.LoggerV2` interface using `zerolog`
+* [overlog](https://github.com/Trendyol/overlog): Implementation of `Mapped Diagnostic Context` interface using `zerolog`
+* [zerologr](https://github.com/hn8/zerologr): Implementation of `logr.LogSink` interface using `zerolog`
## Benchmarks
diff --git a/vendor/github.com/rs/zerolog/console.go b/vendor/github.com/rs/zerolog/console.go
index 54f799457..c07838242 100644
--- a/vendor/github.com/rs/zerolog/console.go
+++ b/vendor/github.com/rs/zerolog/console.go
@@ -6,6 +6,7 @@ import (
"fmt"
"io"
"os"
+ "path/filepath"
"sort"
"strconv"
"strings"
@@ -57,6 +58,9 @@ type ConsoleWriter struct {
// PartsOrder defines the order of parts in output.
PartsOrder []string
+ // PartsExclude defines parts to not display in output.
+ PartsExclude []string
+
FormatTimestamp Formatter
FormatLevel Formatter
FormatCaller Formatter
@@ -208,6 +212,14 @@ func (w ConsoleWriter) writeFields(evt map[string]interface{}, buf *bytes.Buffer
func (w ConsoleWriter) writePart(buf *bytes.Buffer, evt map[string]interface{}, p string) {
var f Formatter
+ if w.PartsExclude != nil && len(w.PartsExclude) > 0 {
+ for _, exclude := range w.PartsExclude {
+ if exclude == p {
+ return
+ }
+ }
+ }
+
switch p {
case LevelFieldName:
if w.FormatLevel == nil {
@@ -321,19 +333,19 @@ func consoleDefaultFormatLevel(noColor bool) Formatter {
var l string
if ll, ok := i.(string); ok {
switch ll {
- case "trace":
+ case LevelTraceValue:
l = colorize("TRC", colorMagenta, noColor)
- case "debug":
+ case LevelDebugValue:
l = colorize("DBG", colorYellow, noColor)
- case "info":
+ case LevelInfoValue:
l = colorize("INF", colorGreen, noColor)
- case "warn":
+ case LevelWarnValue:
l = colorize("WRN", colorRed, noColor)
- case "error":
+ case LevelErrorValue:
l = colorize(colorize("ERR", colorRed, noColor), colorBold, noColor)
- case "fatal":
+ case LevelFatalValue:
l = colorize(colorize("FTL", colorRed, noColor), colorBold, noColor)
- case "panic":
+ case LevelPanicValue:
l = colorize(colorize("PNC", colorRed, noColor), colorBold, noColor)
default:
l = colorize("???", colorBold, noColor)
@@ -356,10 +368,10 @@ func consoleDefaultFormatCaller(noColor bool) Formatter {
c = cc
}
if len(c) > 0 {
- cwd, err := os.Getwd()
- if err == nil {
- c = strings.TrimPrefix(c, cwd)
- c = strings.TrimPrefix(c, "/")
+ if cwd, err := os.Getwd(); err == nil {
+ if rel, err := filepath.Rel(cwd, c); err == nil {
+ c = rel
+ }
}
c = colorize(c, colorBold, noColor) + colorize(" >", colorCyan, noColor)
}
diff --git a/vendor/github.com/rs/zerolog/context.go b/vendor/github.com/rs/zerolog/context.go
index 27f0d9a1a..f398e3197 100644
--- a/vendor/github.com/rs/zerolog/context.go
+++ b/vendor/github.com/rs/zerolog/context.go
@@ -1,6 +1,7 @@
package zerolog
import (
+ "fmt"
"io/ioutil"
"math"
"net"
@@ -17,8 +18,10 @@ func (c Context) Logger() Logger {
return c.l
}
-// Fields is a helper function to use a map to set fields using type assertion.
-func (c Context) Fields(fields map[string]interface{}) Context {
+// Fields is a helper function to use a map or slice to set fields using type assertion.
+// Only map[string]interface{} and []interface{} are accepted. []interface{} must
+// alternate string keys and arbitrary values, and extraneous ones are ignored.
+func (c Context) Fields(fields interface{}) Context {
c.l.context = appendFields(c.l.context, fields)
return c
}
@@ -81,6 +84,17 @@ func (c Context) Strs(key string, vals []string) Context {
return c
}
+// Stringer adds the field key with val.String() (or null if val is nil) to the logger context.
+func (c Context) Stringer(key string, val fmt.Stringer) Context {
+ if val != nil {
+ c.l.context = enc.AppendString(enc.AppendKey(c.l.context, key), val.String())
+ return c
+ }
+
+ c.l.context = enc.AppendInterface(enc.AppendKey(c.l.context, key), nil)
+ return c
+}
+
// Bytes adds the field key with val as a []byte to the logger context.
func (c Context) Bytes(key string, val []byte) Context {
c.l.context = enc.AppendBytes(enc.AppendKey(c.l.context, key), val)
@@ -394,17 +408,9 @@ func (c Context) CallerWithSkipFrameCount(skipFrameCount int) Context {
return c
}
-type stackTraceHook struct{}
-
-func (sh stackTraceHook) Run(e *Event, level Level, msg string) {
- e.Stack()
-}
-
-var sh = stackTraceHook{}
-
// Stack enables stack trace printing for the error passed to Err().
func (c Context) Stack() Context {
- c.l = c.l.Hook(sh)
+ c.l.stack = true
return c
}
diff --git a/vendor/github.com/rs/zerolog/ctx.go b/vendor/github.com/rs/zerolog/ctx.go
index ce18a32cb..966d17ed8 100644
--- a/vendor/github.com/rs/zerolog/ctx.go
+++ b/vendor/github.com/rs/zerolog/ctx.go
@@ -39,10 +39,13 @@ func (l *Logger) WithContext(ctx context.Context) context.Context {
}
// Ctx returns the Logger associated with the ctx. If no logger
-// is associated, a disabled logger is returned.
+// is associated, DefaultContextLogger is returned, unless DefaultContextLogger
+// is nil, in which case a disabled logger is returned.
func Ctx(ctx context.Context) *Logger {
if l, ok := ctx.Value(ctxKey{}).(*Logger); ok {
return l
+ } else if l = DefaultContextLogger; l != nil {
+ return l
}
return disabledLogger
}
diff --git a/vendor/github.com/rs/zerolog/encoder_cbor.go b/vendor/github.com/rs/zerolog/encoder_cbor.go
index f8d3fe9e7..7b0dafef8 100644
--- a/vendor/github.com/rs/zerolog/encoder_cbor.go
+++ b/vendor/github.com/rs/zerolog/encoder_cbor.go
@@ -14,6 +14,13 @@ var (
enc = cbor.Encoder{}
)
+func init() {
+ // using closure to reflect the changes at runtime.
+ cbor.JSONMarshalFunc = func(v interface{}) ([]byte, error) {
+ return InterfaceMarshalFunc(v)
+ }
+}
+
func appendJSON(dst []byte, j []byte) []byte {
return cbor.AppendEmbeddedJSON(dst, j)
}
diff --git a/vendor/github.com/rs/zerolog/encoder_json.go b/vendor/github.com/rs/zerolog/encoder_json.go
index fe580f5f6..0e0450e26 100644
--- a/vendor/github.com/rs/zerolog/encoder_json.go
+++ b/vendor/github.com/rs/zerolog/encoder_json.go
@@ -15,6 +15,13 @@ var (
enc = json.Encoder{}
)
+func init() {
+ // using closure to reflect the changes at runtime.
+ json.JSONMarshalFunc = func(v interface{}) ([]byte, error) {
+ return InterfaceMarshalFunc(v)
+ }
+}
+
func appendJSON(dst []byte, j []byte) []byte {
return append(dst, j...)
}
diff --git a/vendor/github.com/rs/zerolog/event.go b/vendor/github.com/rs/zerolog/event.go
index 224799c8b..6aaa618ec 100644
--- a/vendor/github.com/rs/zerolog/event.go
+++ b/vendor/github.com/rs/zerolog/event.go
@@ -20,12 +20,13 @@ var eventPool = &sync.Pool{
// Event represents a log event. It is instanced by one of the level method of
// Logger and finalized by the Msg or Msgf method.
type Event struct {
- buf []byte
- w LevelWriter
- level Level
- done func(msg string)
- stack bool // enable error stack trace
- ch []Hook // hooks from context
+ buf []byte
+ w LevelWriter
+ level Level
+ done func(msg string)
+ stack bool // enable error stack trace
+ ch []Hook // hooks from context
+ skipFrame int // The number of additional frames to skip when printing the caller.
}
func putEvent(e *Event) {
@@ -61,6 +62,8 @@ func newEvent(w LevelWriter, level Level) *Event {
e.buf = enc.AppendBeginMarker(e.buf)
e.w = w
e.level = level
+ e.stack = false
+ e.skipFrame = 0
return e
}
@@ -145,8 +148,10 @@ func (e *Event) msg(msg string) {
}
}
-// Fields is a helper function to use a map to set fields using type assertion.
-func (e *Event) Fields(fields map[string]interface{}) *Event {
+// Fields is a helper function to use a map or slice to set fields using type assertion.
+// Only map[string]interface{} and []interface{} are accepted. []interface{} must
+// alternate string keys and arbitrary values, and extraneous ones are ignored.
+func (e *Event) Fields(fields interface{}) *Event {
if e == nil {
return e
}
@@ -204,15 +209,32 @@ func (e *Event) Object(key string, obj LogObjectMarshaler) *Event {
return e
}
e.buf = enc.AppendKey(e.buf, key)
+ if obj == nil {
+ e.buf = enc.AppendNil(e.buf)
+
+ return e
+ }
+
e.appendObject(obj)
return e
}
+// Func allows an anonymous func to run only if the event is enabled.
+func (e *Event) Func(f func(e *Event)) *Event {
+ if e != nil && e.Enabled() {
+ f(e)
+ }
+ return e
+}
+
// EmbedObject marshals an object that implement the LogObjectMarshaler interface.
func (e *Event) EmbedObject(obj LogObjectMarshaler) *Event {
if e == nil {
return e
}
+ if obj == nil {
+ return e
+ }
obj.MarshalZerologObject(e)
return e
}
@@ -235,6 +257,21 @@ func (e *Event) Strs(key string, vals []string) *Event {
return e
}
+// Stringer adds the field key with val.String() (or null if val is nil) to the *Event context.
+func (e *Event) Stringer(key string, val fmt.Stringer) *Event {
+ if e == nil {
+ return e
+ }
+
+ if val != nil {
+ e.buf = enc.AppendString(enc.AppendKey(e.buf, key), val.String())
+ return e
+ }
+
+ e.buf = enc.AppendInterface(enc.AppendKey(e.buf, key), nil)
+ return e
+}
+
// Bytes adds the field key with val as a string to the *Event context.
//
// Runes outside of normal ASCII ranges will be hex-encoded in the resulting
@@ -317,7 +354,6 @@ func (e *Event) Errs(key string, errs []error) *Event {
// Err adds the field "error" with serialized err to the *Event context.
// If err is nil, no field is added.
-// To customize the key name, change zerolog.ErrorFieldName.
//
// To customize the key name, change zerolog.ErrorFieldName.
//
@@ -670,6 +706,16 @@ func (e *Event) Interface(key string, i interface{}) *Event {
return e
}
+// CallerSkipFrame instructs any future Caller calls to skip the specified number of frames.
+// This includes those added via hooks from the context.
+func (e *Event) CallerSkipFrame(skip int) *Event {
+ if e == nil {
+ return e
+ }
+ e.skipFrame += skip
+ return e
+}
+
// Caller adds the file:line of the caller with the zerolog.CallerFieldName key.
// The argument skip is the number of stack frames to ascend
// Skip If not passed, use the global variable CallerSkipFrameCount
@@ -685,7 +731,7 @@ func (e *Event) caller(skip int) *Event {
if e == nil {
return e
}
- _, file, line, ok := runtime.Caller(skip)
+ _, file, line, ok := runtime.Caller(skip + e.skipFrame)
if !ok {
return e
}
diff --git a/vendor/github.com/rs/zerolog/fields.go b/vendor/github.com/rs/zerolog/fields.go
index cf3c3e918..c1eb5ce79 100644
--- a/vendor/github.com/rs/zerolog/fields.go
+++ b/vendor/github.com/rs/zerolog/fields.go
@@ -1,6 +1,7 @@
package zerolog
import (
+ "encoding/json"
"net"
"sort"
"time"
@@ -11,15 +12,36 @@ func isNilValue(i interface{}) bool {
return (*[2]uintptr)(unsafe.Pointer(&i))[1] == 0
}
-func appendFields(dst []byte, fields map[string]interface{}) []byte {
- keys := make([]string, 0, len(fields))
- for key := range fields {
- keys = append(keys, key)
+func appendFields(dst []byte, fields interface{}) []byte {
+ switch fields := fields.(type) {
+ case []interface{}:
+ if n := len(fields); n&0x1 == 1 { // odd number
+ fields = fields[:n-1]
+ }
+ dst = appendFieldList(dst, fields)
+ case map[string]interface{}:
+ keys := make([]string, 0, len(fields))
+ for key := range fields {
+ keys = append(keys, key)
+ }
+ sort.Strings(keys)
+ kv := make([]interface{}, 2)
+ for _, key := range keys {
+ kv[0], kv[1] = key, fields[key]
+ dst = appendFieldList(dst, kv)
+ }
}
- sort.Strings(keys)
- for _, key := range keys {
- dst = enc.AppendKey(dst, key)
- val := fields[key]
+ return dst
+}
+
+func appendFieldList(dst []byte, kvList []interface{}) []byte {
+ for i, n := 0, len(kvList); i < n; i += 2 {
+ key, val := kvList[i], kvList[i+1]
+ if key, ok := key.(string); ok {
+ dst = enc.AppendKey(dst, key)
+ } else {
+ continue
+ }
if val, ok := val.(LogObjectMarshaler); ok {
e := newEvent(nil, 0)
e.buf = e.buf[:0]
@@ -245,6 +267,8 @@ func appendFields(dst []byte, fields map[string]interface{}) []byte {
dst = enc.AppendIPPrefix(dst, val)
case net.HardwareAddr:
dst = enc.AppendMACAddr(dst, val)
+ case json.RawMessage:
+ dst = appendJSON(dst, val)
default:
dst = enc.AppendInterface(dst, val)
}
diff --git a/vendor/github.com/rs/zerolog/globals.go b/vendor/github.com/rs/zerolog/globals.go
index 421429a52..e561d8f3b 100644
--- a/vendor/github.com/rs/zerolog/globals.go
+++ b/vendor/github.com/rs/zerolog/globals.go
@@ -1,6 +1,7 @@
package zerolog
import (
+ "encoding/json"
"strconv"
"sync/atomic"
"time"
@@ -27,7 +28,22 @@ var (
// LevelFieldName is the field name used for the level field.
LevelFieldName = "level"
- // LevelFieldMarshalFunc allows customization of global level field marshaling
+ // LevelTraceValue is the value used for the trace level field.
+ LevelTraceValue = "trace"
+ // LevelDebugValue is the value used for the debug level field.
+ LevelDebugValue = "debug"
+ // LevelInfoValue is the value used for the info level field.
+ LevelInfoValue = "info"
+ // LevelWarnValue is the value used for the warn level field.
+ LevelWarnValue = "warn"
+ // LevelErrorValue is the value used for the error level field.
+ LevelErrorValue = "error"
+ // LevelFatalValue is the value used for the fatal level field.
+ LevelFatalValue = "fatal"
+ // LevelPanicValue is the value used for the panic level field.
+ LevelPanicValue = "panic"
+
+ // LevelFieldMarshalFunc allows customization of global level field marshaling.
LevelFieldMarshalFunc = func(l Level) string {
return l.String()
}
@@ -60,6 +76,10 @@ var (
return err
}
+ // InterfaceMarshalFunc allows customization of interface marshaling.
+ // Default: "encoding/json.Marshal"
+ InterfaceMarshalFunc = json.Marshal
+
// TimeFieldFormat defines the time format of the Time field type. If set to
// TimeFormatUnix, TimeFormatUnixMs or TimeFormatUnixMicro, the time is formatted as an UNIX
// timestamp as integer.
@@ -80,6 +100,10 @@ var (
// output. If not set, an error is printed on the stderr. This handler must
// be thread safe and non-blocking.
ErrorHandler func(err error)
+
+ // DefaultContextLogger is returned from Ctx() if there is no logger associated
+ // with the context.
+ DefaultContextLogger *Logger
)
var (
diff --git a/vendor/github.com/rs/zerolog/go.mod b/vendor/github.com/rs/zerolog/go.mod
index 8c42ba88f..8d9865361 100644
--- a/vendor/github.com/rs/zerolog/go.mod
+++ b/vendor/github.com/rs/zerolog/go.mod
@@ -1,9 +1,10 @@
module github.com/rs/zerolog
+go 1.15
+
require (
- github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e
- github.com/pkg/errors v0.8.1
- github.com/rs/xid v1.2.1
- github.com/zenazn/goji v0.9.0
- golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74
+ github.com/coreos/go-systemd/v22 v22.3.2
+ github.com/pkg/errors v0.9.1
+ github.com/rs/xid v1.3.0
+ golang.org/x/tools v0.1.5
)
diff --git a/vendor/github.com/rs/zerolog/go.sum b/vendor/github.com/rs/zerolog/go.sum
index b14fd2b66..990e427be 100644
--- a/vendor/github.com/rs/zerolog/go.sum
+++ b/vendor/github.com/rs/zerolog/go.sum
@@ -1,16 +1,34 @@
-github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8=
-github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
-github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
-github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc=
-github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
-github.com/zenazn/goji v0.9.0 h1:RSQQAbXGArQ0dIDEq+PI6WqN6if+5KHu6x2Cx/GXLTQ=
-github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
+github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=
+github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
+github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
+github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
+github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/rs/xid v1.3.0 h1:6NjYksEUlhurdVehpc7S7dk6DAmcKv8V9gG0FsVN2U4=
+github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
+github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
+golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
+golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74 h1:4cFkmztxtMslUX2SctSl+blCyXfpzhGOy9LhKAqSMA4=
-golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA=
+golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
diff --git a/vendor/github.com/rs/zerolog/internal/cbor/base.go b/vendor/github.com/rs/zerolog/internal/cbor/base.go
index 58cd0822b..51fe86c9b 100644
--- a/vendor/github.com/rs/zerolog/internal/cbor/base.go
+++ b/vendor/github.com/rs/zerolog/internal/cbor/base.go
@@ -1,5 +1,13 @@
package cbor
+// JSONMarshalFunc is used to marshal interface to JSON encoded byte slice.
+// Making it package level instead of embedded in Encoder brings
+// some extra efforts at importing, but avoids value copy when the functions
+// of Encoder being invoked.
+// DO REMEMBER to set this variable at importing, or
+// you might get a nil pointer dereference panic at runtime.
+var JSONMarshalFunc func(v interface{}) ([]byte, error)
+
type Encoder struct{}
// AppendKey adds a key (string) to the binary encoded log message
@@ -8,4 +16,4 @@ func (e Encoder) AppendKey(dst []byte, key string) []byte {
dst = e.AppendBeginMarker(dst)
}
return e.AppendString(dst, key)
-}
\ No newline at end of file
+}
diff --git a/vendor/github.com/rs/zerolog/internal/cbor/types.go b/vendor/github.com/rs/zerolog/internal/cbor/types.go
index 3d76ea08e..a41c79763 100644
--- a/vendor/github.com/rs/zerolog/internal/cbor/types.go
+++ b/vendor/github.com/rs/zerolog/internal/cbor/types.go
@@ -1,7 +1,6 @@
package cbor
import (
- "encoding/json"
"fmt"
"math"
"net"
@@ -432,7 +431,7 @@ func (e Encoder) AppendFloats64(dst []byte, vals []float64) []byte {
// AppendInterface takes an arbitrary object and converts it to JSON and embeds it dst.
func (e Encoder) AppendInterface(dst []byte, i interface{}) []byte {
- marshaled, err := json.Marshal(i)
+ marshaled, err := JSONMarshalFunc(i)
if err != nil {
return e.AppendString(dst, fmt.Sprintf("marshaling error: %v", err))
}
diff --git a/vendor/github.com/rs/zerolog/internal/json/base.go b/vendor/github.com/rs/zerolog/internal/json/base.go
index d6f8839e3..09ec59f4e 100644
--- a/vendor/github.com/rs/zerolog/internal/json/base.go
+++ b/vendor/github.com/rs/zerolog/internal/json/base.go
@@ -1,12 +1,19 @@
package json
+// JSONMarshalFunc is used to marshal interface to JSON encoded byte slice.
+// Making it package level instead of embedded in Encoder brings
+// some extra efforts at importing, but avoids value copy when the functions
+// of Encoder being invoked.
+// DO REMEMBER to set this variable at importing, or
+// you might get a nil pointer dereference panic at runtime.
+var JSONMarshalFunc func(v interface{}) ([]byte, error)
+
type Encoder struct{}
// AppendKey appends a new key to the output JSON.
func (e Encoder) AppendKey(dst []byte, key string) []byte {
- if len(dst) > 1 && dst[len(dst)-1] != '{' {
+ if dst[len(dst)-1] != '{' {
dst = append(dst, ',')
}
- dst = e.AppendString(dst, key)
- return append(dst, ':')
-}
\ No newline at end of file
+ return append(e.AppendString(dst, key), ':')
+}
diff --git a/vendor/github.com/rs/zerolog/internal/json/types.go b/vendor/github.com/rs/zerolog/internal/json/types.go
index bc8bc0957..9e3526666 100644
--- a/vendor/github.com/rs/zerolog/internal/json/types.go
+++ b/vendor/github.com/rs/zerolog/internal/json/types.go
@@ -1,7 +1,6 @@
package json
import (
- "encoding/json"
"fmt"
"math"
"net"
@@ -350,7 +349,7 @@ func (Encoder) AppendFloats64(dst []byte, vals []float64) []byte {
return append(dst, '[', ']')
}
dst = append(dst, '[')
- dst = appendFloat(dst, vals[0], 32)
+ dst = appendFloat(dst, vals[0], 64)
if len(vals) > 1 {
for _, val := range vals[1:] {
dst = appendFloat(append(dst, ','), val, 64)
@@ -363,7 +362,7 @@ func (Encoder) AppendFloats64(dst []byte, vals []float64) []byte {
// AppendInterface marshals the input interface to a string and
// appends the encoded string to the input byte slice.
func (e Encoder) AppendInterface(dst []byte, i interface{}) []byte {
- marshaled, err := json.Marshal(i)
+ marshaled, err := JSONMarshalFunc(i)
if err != nil {
return e.AppendString(dst, fmt.Sprintf("marshaling error: %v", err))
}
@@ -379,11 +378,10 @@ func (Encoder) AppendObjectData(dst []byte, o []byte) []byte {
// to separate with existing content OR
// 3. existing content has already other fields
if o[0] == '{' {
- if len(dst) == 0 {
- o = o[1:]
- } else {
- o[0] = ','
+ if len(dst) > 1 {
+ dst = append(dst, ',')
}
+ o = o[1:]
} else if len(dst) > 1 {
dst = append(dst, ',')
}
diff --git a/vendor/github.com/rs/zerolog/log.go b/vendor/github.com/rs/zerolog/log.go
index b1e7ac136..6227386d9 100644
--- a/vendor/github.com/rs/zerolog/log.go
+++ b/vendor/github.com/rs/zerolog/log.go
@@ -129,28 +129,31 @@ const (
// TraceLevel defines trace log level.
TraceLevel Level = -1
+ // Values less than TraceLevel are handled as numbers.
)
func (l Level) String() string {
switch l {
case TraceLevel:
- return "trace"
+ return LevelTraceValue
case DebugLevel:
- return "debug"
+ return LevelDebugValue
case InfoLevel:
- return "info"
+ return LevelInfoValue
case WarnLevel:
- return "warn"
+ return LevelWarnValue
case ErrorLevel:
- return "error"
+ return LevelErrorValue
case FatalLevel:
- return "fatal"
+ return LevelFatalValue
case PanicLevel:
- return "panic"
+ return LevelPanicValue
+ case Disabled:
+ return "disabled"
case NoLevel:
return ""
}
- return ""
+ return strconv.Itoa(int(l))
}
// ParseLevel converts a level string into a zerolog Level value.
@@ -171,10 +174,19 @@ func ParseLevel(levelStr string) (Level, error) {
return FatalLevel, nil
case LevelFieldMarshalFunc(PanicLevel):
return PanicLevel, nil
+ case LevelFieldMarshalFunc(Disabled):
+ return Disabled, nil
case LevelFieldMarshalFunc(NoLevel):
return NoLevel, nil
}
- return NoLevel, fmt.Errorf("Unknown Level String: '%s', defaulting to NoLevel", levelStr)
+ i, err := strconv.Atoi(levelStr)
+ if err != nil {
+ return NoLevel, fmt.Errorf("Unknown Level String: '%s', defaulting to NoLevel", levelStr)
+ }
+ if i > 127 || i < -128 {
+ return NoLevel, fmt.Errorf("Out-Of-Bounds Level: '%d', defaulting to NoLevel", i)
+ }
+ return Level(i), nil
}
// A Logger represents an active logging object that generates lines
@@ -188,6 +200,7 @@ type Logger struct {
sampler Sampler
context []byte
hooks []Hook
+ stack bool
}
// New creates a root logger with given output writer. If the output writer implements
@@ -218,6 +231,7 @@ func (l Logger) Output(w io.Writer) Logger {
l2 := New(w)
l2.level = l.level
l2.sampler = l.sampler
+ l2.stack = l.stack
if len(l.hooks) > 0 {
l2.hooks = append(l2.hooks, l.hooks...)
}
@@ -234,6 +248,10 @@ func (l Logger) With() Context {
l.context = make([]byte, 0, 500)
if context != nil {
l.context = append(l.context, context...)
+ } else {
+ // This is needed for AppendKey to not check len of input
+ // thus making it inlinable
+ l.context = enc.AppendBeginMarker(l.context)
}
return Context{l}
}
@@ -248,6 +266,9 @@ func (l *Logger) UpdateContext(update func(c Context) Context) {
if cap(l.context) == 0 {
l.context = make([]byte, 0, 500)
}
+ if len(l.context) == 0 {
+ l.context = enc.AppendBeginMarker(l.context)
+ }
c := update(Context{*l})
l.context = c.l.context
}
@@ -364,7 +385,7 @@ func (l *Logger) WithLevel(level Level) *Event {
case Disabled:
return nil
default:
- panic("zerolog: WithLevel(): invalid level: " + strconv.Itoa(int(level)))
+ return l.newEvent(level, nil)
}
}
@@ -380,7 +401,7 @@ func (l *Logger) Log() *Event {
// Arguments are handled in the manner of fmt.Print.
func (l *Logger) Print(v ...interface{}) {
if e := l.Debug(); e.Enabled() {
- e.Msg(fmt.Sprint(v...))
+ e.CallerSkipFrame(1).Msg(fmt.Sprint(v...))
}
}
@@ -388,7 +409,7 @@ func (l *Logger) Print(v ...interface{}) {
// Arguments are handled in the manner of fmt.Printf.
func (l *Logger) Printf(format string, v ...interface{}) {
if e := l.Debug(); e.Enabled() {
- e.Msg(fmt.Sprintf(format, v...))
+ e.CallerSkipFrame(1).Msg(fmt.Sprintf(format, v...))
}
}
@@ -400,7 +421,7 @@ func (l Logger) Write(p []byte) (n int, err error) {
// Trim CR added by stdlog.
p = p[0 : n-1]
}
- l.Log().Msg(string(p))
+ l.Log().CallerSkipFrame(1).Msg(string(p))
return
}
@@ -412,12 +433,15 @@ func (l *Logger) newEvent(level Level, done func(string)) *Event {
e := newEvent(l.w, level)
e.done = done
e.ch = l.hooks
- if level != NoLevel {
+ if level != NoLevel && LevelFieldName != "" {
e.Str(LevelFieldName, LevelFieldMarshalFunc(level))
}
- if l.context != nil && len(l.context) > 0 {
+ if l.context != nil && len(l.context) > 1 {
e.buf = enc.AppendObjectData(e.buf, l.context)
}
+ if l.stack {
+ e.Stack()
+ }
return e
}
diff --git a/vendor/github.com/rs/zerolog/log/log.go b/vendor/github.com/rs/zerolog/log/log.go
index b96f1c144..a96ec5067 100644
--- a/vendor/github.com/rs/zerolog/log/log.go
+++ b/vendor/github.com/rs/zerolog/log/log.go
@@ -3,6 +3,7 @@ package log
import (
"context"
+ "fmt"
"io"
"os"
@@ -114,13 +115,13 @@ func Log() *zerolog.Event {
// Print sends a log event using debug level and no extra field.
// Arguments are handled in the manner of fmt.Print.
func Print(v ...interface{}) {
- Logger.Print(v...)
+ Logger.Debug().CallerSkipFrame(1).Msg(fmt.Sprint(v...))
}
// Printf sends a log event using debug level and no extra field.
// Arguments are handled in the manner of fmt.Printf.
func Printf(format string, v ...interface{}) {
- Logger.Printf(format, v...)
+ Logger.Debug().CallerSkipFrame(1).Msgf(format, v...)
}
// Ctx returns the Logger associated with the ctx. If no logger
diff --git a/vendor/github.com/rs/zerolog/pretty.png b/vendor/github.com/rs/zerolog/pretty.png
index 34e43085f..242033686 100644
Binary files a/vendor/github.com/rs/zerolog/pretty.png and b/vendor/github.com/rs/zerolog/pretty.png differ
diff --git a/vendor/github.com/rs/zerolog/sampler.go b/vendor/github.com/rs/zerolog/sampler.go
index a99629eb0..1be98c4f9 100644
--- a/vendor/github.com/rs/zerolog/sampler.go
+++ b/vendor/github.com/rs/zerolog/sampler.go
@@ -38,7 +38,7 @@ func (s RandomSampler) Sample(lvl Level) bool {
}
// BasicSampler is a sampler that will send every Nth events, regardless of
-// there level.
+// their level.
type BasicSampler struct {
N uint32
counter uint32
diff --git a/vendor/github.com/rs/zerolog/syslog.go b/vendor/github.com/rs/zerolog/syslog.go
index ef3b2c83b..c40828307 100644
--- a/vendor/github.com/rs/zerolog/syslog.go
+++ b/vendor/github.com/rs/zerolog/syslog.go
@@ -7,6 +7,10 @@ import (
"io"
)
+// See http://cee.mitre.org/language/1.0-beta1/clt.html#syslog
+// or https://www.rsyslog.com/json-elasticsearch/
+const ceePrefix = "@cee:"
+
// SyslogWriter is an interface matching a syslog.Writer struct.
type SyslogWriter interface {
io.Writer
@@ -19,17 +23,34 @@ type SyslogWriter interface {
}
type syslogWriter struct {
- w SyslogWriter
+ w SyslogWriter
+ prefix string
}
// SyslogLevelWriter wraps a SyslogWriter and call the right syslog level
// method matching the zerolog level.
func SyslogLevelWriter(w SyslogWriter) LevelWriter {
- return syslogWriter{w}
+ return syslogWriter{w, ""}
+}
+
+// SyslogCEEWriter wraps a SyslogWriter with a SyslogLevelWriter that adds a
+// MITRE CEE prefix for JSON syslog entries, compatible with rsyslog
+// and syslog-ng JSON logging support.
+// See https://www.rsyslog.com/json-elasticsearch/
+func SyslogCEEWriter(w SyslogWriter) LevelWriter {
+ return syslogWriter{w, ceePrefix}
}
func (sw syslogWriter) Write(p []byte) (n int, err error) {
- return sw.w.Write(p)
+ var pn int
+ if sw.prefix != "" {
+ pn, err = sw.w.Write([]byte(sw.prefix))
+ if err != nil {
+ return pn, err
+ }
+ }
+ n, err = sw.w.Write(p)
+ return pn + n, err
}
// WriteLevel implements LevelWriter interface.
@@ -37,22 +58,23 @@ func (sw syslogWriter) WriteLevel(level Level, p []byte) (n int, err error) {
switch level {
case TraceLevel:
case DebugLevel:
- err = sw.w.Debug(string(p))
+ err = sw.w.Debug(sw.prefix + string(p))
case InfoLevel:
- err = sw.w.Info(string(p))
+ err = sw.w.Info(sw.prefix + string(p))
case WarnLevel:
- err = sw.w.Warning(string(p))
+ err = sw.w.Warning(sw.prefix + string(p))
case ErrorLevel:
- err = sw.w.Err(string(p))
+ err = sw.w.Err(sw.prefix + string(p))
case FatalLevel:
- err = sw.w.Emerg(string(p))
+ err = sw.w.Emerg(sw.prefix + string(p))
case PanicLevel:
- err = sw.w.Crit(string(p))
+ err = sw.w.Crit(sw.prefix + string(p))
case NoLevel:
- err = sw.w.Info(string(p))
+ err = sw.w.Info(sw.prefix + string(p))
default:
panic("invalid level")
}
+ // Any CEE prefix is not part of the message, so we don't include its length
n = len(p)
return
}
diff --git a/vendor/github.com/rs/zerolog/writer.go b/vendor/github.com/rs/zerolog/writer.go
index a58d71776..98c932ea5 100644
--- a/vendor/github.com/rs/zerolog/writer.go
+++ b/vendor/github.com/rs/zerolog/writer.go
@@ -26,11 +26,9 @@ type syncWriter struct {
}
// SyncWriter wraps w so that each call to Write is synchronized with a mutex.
-// This syncer can be the call to writer's Write method is not thread safe.
-// Note that os.File Write operation is using write() syscall which is supposed
-// to be thread-safe on POSIX systems. So there is no need to use this with
-// os.File on such systems as zerolog guaranties to issue a single Write call
-// per log event.
+// This syncer can be used to wrap the call to writer's Write method if it is
+// not thread safe. Note that you do not need this wrapper for os.File Write
+// operations on POSIX and Windows systems as they are already thread-safe.
func SyncWriter(w io.Writer) io.Writer {
if lw, ok := w.(LevelWriter); ok {
return &syncWriter{lw: lw}
@@ -58,30 +56,30 @@ type multiLevelWriter struct {
func (t multiLevelWriter) Write(p []byte) (n int, err error) {
for _, w := range t.writers {
- n, err = w.Write(p)
- if err != nil {
- return
- }
- if n != len(p) {
- err = io.ErrShortWrite
- return
+ if _n, _err := w.Write(p); err == nil {
+ n = _n
+ if _err != nil {
+ err = _err
+ } else if _n != len(p) {
+ err = io.ErrShortWrite
+ }
}
}
- return len(p), nil
+ return n, err
}
func (t multiLevelWriter) WriteLevel(l Level, p []byte) (n int, err error) {
for _, w := range t.writers {
- n, err = w.WriteLevel(l, p)
- if err != nil {
- return
- }
- if n != len(p) {
- err = io.ErrShortWrite
- return
+ if _n, _err := w.WriteLevel(l, p); err == nil {
+ n = _n
+ if _err != nil {
+ err = _err
+ } else if _n != len(p) {
+ err = io.ErrShortWrite
+ }
}
}
- return len(p), nil
+ return n, err
}
// MultiLevelWriter creates a writer that duplicates its writes to all the
diff --git a/vendor/github.com/russross/meddler/go.mod b/vendor/github.com/russross/meddler/go.mod
index 4ed7addb4..61677b2d3 100644
--- a/vendor/github.com/russross/meddler/go.mod
+++ b/vendor/github.com/russross/meddler/go.mod
@@ -2,4 +2,4 @@ module github.com/russross/meddler
go 1.13
-require github.com/mattn/go-sqlite3 v2.0.3+incompatible
+require github.com/mattn/go-sqlite3 v1.14.7
diff --git a/vendor/github.com/russross/meddler/go.sum b/vendor/github.com/russross/meddler/go.sum
index d67442906..96ff82415 100644
--- a/vendor/github.com/russross/meddler/go.sum
+++ b/vendor/github.com/russross/meddler/go.sum
@@ -1,2 +1,2 @@
-github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
-github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
+github.com/mattn/go-sqlite3 v1.14.7 h1:fxWBnXkxfM6sRiuH3bqJ4CfzZojMOLVc0UTsTglEghA=
+github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
diff --git a/vendor/github.com/sirupsen/logrus/.gitignore b/vendor/github.com/sirupsen/logrus/.gitignore
index 6b7d7d1e8..1fb13abeb 100644
--- a/vendor/github.com/sirupsen/logrus/.gitignore
+++ b/vendor/github.com/sirupsen/logrus/.gitignore
@@ -1,2 +1,4 @@
logrus
vendor
+
+.idea/
diff --git a/vendor/github.com/sirupsen/logrus/.travis.yml b/vendor/github.com/sirupsen/logrus/.travis.yml
index 5e20aa414..c1dbd5a3a 100644
--- a/vendor/github.com/sirupsen/logrus/.travis.yml
+++ b/vendor/github.com/sirupsen/logrus/.travis.yml
@@ -4,14 +4,12 @@ git:
depth: 1
env:
- GO111MODULE=on
-go: [1.13.x, 1.14.x]
-os: [linux, osx]
+go: 1.15.x
+os: linux
install:
- ./travis/install.sh
script:
- - ./travis/cross_build.sh
- - ./travis/lint.sh
- - export GOMAXPROCS=4
- - export GORACE=halt_on_error=1
- - go test -race -v ./...
- - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then go test -race -v -tags appengine ./... ; fi
+ - cd ci
+ - go run mage.go -v -w ../ crossBuild
+ - go run mage.go -v -w ../ lint
+ - go run mage.go -v -w ../ test
diff --git a/vendor/github.com/sirupsen/logrus/CHANGELOG.md b/vendor/github.com/sirupsen/logrus/CHANGELOG.md
index 584026d67..7567f6128 100644
--- a/vendor/github.com/sirupsen/logrus/CHANGELOG.md
+++ b/vendor/github.com/sirupsen/logrus/CHANGELOG.md
@@ -1,3 +1,39 @@
+# 1.8.1
+Code quality:
+ * move magefile in its own subdir/submodule to remove magefile dependency on logrus consumer
+ * improve timestamp format documentation
+
+Fixes:
+ * fix race condition on logger hooks
+
+
+# 1.8.0
+
+Correct versioning number replacing v1.7.1.
+
+# 1.7.1
+
+Beware this release has introduced a new public API and its semver is therefore incorrect.
+
+Code quality:
+ * use go 1.15 in travis
+ * use magefile as task runner
+
+Fixes:
+ * small fixes about new go 1.13 error formatting system
+ * Fix for long time race condiction with mutating data hooks
+
+Features:
+ * build support for zos
+
+# 1.7.0
+Fixes:
+ * the dependency toward a windows terminal library has been removed
+
+Features:
+ * a new buffer pool management API has been added
+ * a set of `Fn()` functions have been added
+
# 1.6.0
Fixes:
* end of line cleanup
diff --git a/vendor/github.com/sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md
index 5796706db..5152b6aa4 100644
--- a/vendor/github.com/sirupsen/logrus/README.md
+++ b/vendor/github.com/sirupsen/logrus/README.md
@@ -402,7 +402,7 @@ func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) {
// 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 nil, fmt.Errorf("Failed to marshal fields to JSON, %w", err)
}
return append(serialized, '\n'), nil
}
diff --git a/vendor/github.com/sirupsen/logrus/buffer_pool.go b/vendor/github.com/sirupsen/logrus/buffer_pool.go
new file mode 100644
index 000000000..4545dec07
--- /dev/null
+++ b/vendor/github.com/sirupsen/logrus/buffer_pool.go
@@ -0,0 +1,52 @@
+package logrus
+
+import (
+ "bytes"
+ "sync"
+)
+
+var (
+ bufferPool BufferPool
+)
+
+type BufferPool interface {
+ Put(*bytes.Buffer)
+ Get() *bytes.Buffer
+}
+
+type defaultPool struct {
+ pool *sync.Pool
+}
+
+func (p *defaultPool) Put(buf *bytes.Buffer) {
+ p.pool.Put(buf)
+}
+
+func (p *defaultPool) Get() *bytes.Buffer {
+ return p.pool.Get().(*bytes.Buffer)
+}
+
+func getBuffer() *bytes.Buffer {
+ return bufferPool.Get()
+}
+
+func putBuffer(buf *bytes.Buffer) {
+ buf.Reset()
+ bufferPool.Put(buf)
+}
+
+// SetBufferPool allows to replace the default logrus buffer pool
+// to better meets the specific needs of an application.
+func SetBufferPool(bp BufferPool) {
+ bufferPool = bp
+}
+
+func init() {
+ SetBufferPool(&defaultPool{
+ pool: &sync.Pool{
+ New: func() interface{} {
+ return new(bytes.Buffer)
+ },
+ },
+ })
+}
diff --git a/vendor/github.com/sirupsen/logrus/entry.go b/vendor/github.com/sirupsen/logrus/entry.go
index f6e062a34..07a1e5fa7 100644
--- a/vendor/github.com/sirupsen/logrus/entry.go
+++ b/vendor/github.com/sirupsen/logrus/entry.go
@@ -13,7 +13,6 @@ import (
)
var (
- bufferPool *sync.Pool
// qualified package name, cached at first use
logrusPackage string
@@ -31,12 +30,6 @@ const (
)
func init() {
- bufferPool = &sync.Pool{
- New: func() interface{} {
- return new(bytes.Buffer)
- },
- }
-
// start at the bottom of the stack before the package-name cache is primed
minimumCallerDepth = 1
}
@@ -85,6 +78,14 @@ func NewEntry(logger *Logger) *Entry {
}
}
+func (entry *Entry) Dup() *Entry {
+ data := make(Fields, len(entry.Data))
+ for k, v := range entry.Data {
+ data[k] = v
+ }
+ return &Entry{Logger: entry.Logger, Data: data, Time: entry.Time, Context: entry.Context, err: entry.err}
+}
+
// Returns the bytes representation of this entry from the formatter.
func (entry *Entry) Bytes() ([]byte, error) {
return entry.Logger.Formatter.Format(entry)
@@ -130,11 +131,9 @@ func (entry *Entry) WithFields(fields Fields) *Entry {
for k, v := range fields {
isErrField := false
if t := reflect.TypeOf(v); t != nil {
- switch t.Kind() {
- case reflect.Func:
+ switch {
+ case t.Kind() == reflect.Func, t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Func:
isErrField = true
- case reflect.Ptr:
- isErrField = t.Elem().Kind() == reflect.Func
}
}
if isErrField {
@@ -219,65 +218,72 @@ func (entry Entry) HasCaller() (has bool) {
entry.Caller != nil
}
-// This function is not declared with a pointer value because otherwise
-// race conditions will occur when using multiple goroutines
-func (entry Entry) log(level Level, msg string) {
+func (entry *Entry) log(level Level, msg string) {
var buffer *bytes.Buffer
- // Default to now, but allow users to override if they want.
- //
- // We don't have to worry about polluting future calls to Entry#log()
- // with this assignment because this function is declared with a
- // non-pointer receiver.
- if entry.Time.IsZero() {
- entry.Time = time.Now()
+ newEntry := entry.Dup()
+
+ if newEntry.Time.IsZero() {
+ newEntry.Time = time.Now()
}
- entry.Level = level
- entry.Message = msg
- entry.Logger.mu.Lock()
- if entry.Logger.ReportCaller {
- entry.Caller = getCaller()
+ newEntry.Level = level
+ newEntry.Message = msg
+
+ newEntry.Logger.mu.Lock()
+ reportCaller := newEntry.Logger.ReportCaller
+ newEntry.Logger.mu.Unlock()
+
+ if reportCaller {
+ newEntry.Caller = getCaller()
}
- entry.Logger.mu.Unlock()
- entry.fireHooks()
+ newEntry.fireHooks()
- buffer = bufferPool.Get().(*bytes.Buffer)
+ buffer = getBuffer()
+ defer func() {
+ newEntry.Buffer = nil
+ putBuffer(buffer)
+ }()
buffer.Reset()
- defer bufferPool.Put(buffer)
- entry.Buffer = buffer
+ newEntry.Buffer = buffer
- entry.write()
+ newEntry.write()
- entry.Buffer = nil
+ newEntry.Buffer = nil
// To avoid Entry#log() returning a value that only would make sense for
// panic() to use in Entry#Panic(), we avoid the allocation by checking
// directly here.
if level <= PanicLevel {
- panic(&entry)
+ panic(newEntry)
}
}
func (entry *Entry) fireHooks() {
+ var tmpHooks LevelHooks
entry.Logger.mu.Lock()
- defer entry.Logger.mu.Unlock()
- err := entry.Logger.Hooks.Fire(entry.Level, entry)
+ tmpHooks = make(LevelHooks, len(entry.Logger.Hooks))
+ for k, v := range entry.Logger.Hooks {
+ tmpHooks[k] = v
+ }
+ entry.Logger.mu.Unlock()
+
+ err := tmpHooks.Fire(entry.Level, entry)
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err)
}
}
func (entry *Entry) write() {
- entry.Logger.mu.Lock()
- defer entry.Logger.mu.Unlock()
serialized, err := entry.Logger.Formatter.Format(entry)
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err)
return
}
- if _, err = entry.Logger.Out.Write(serialized); err != nil {
+ entry.Logger.mu.Lock()
+ defer entry.Logger.mu.Unlock()
+ if _, err := entry.Logger.Out.Write(serialized); err != nil {
fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err)
}
}
@@ -323,7 +329,6 @@ func (entry *Entry) Fatal(args ...interface{}) {
func (entry *Entry) Panic(args ...interface{}) {
entry.Log(PanicLevel, args...)
- panic(fmt.Sprint(args...))
}
// Entry Printf family functions
diff --git a/vendor/github.com/sirupsen/logrus/exported.go b/vendor/github.com/sirupsen/logrus/exported.go
index 42b04f6c8..017c30ce6 100644
--- a/vendor/github.com/sirupsen/logrus/exported.go
+++ b/vendor/github.com/sirupsen/logrus/exported.go
@@ -134,6 +134,51 @@ func Fatal(args ...interface{}) {
std.Fatal(args...)
}
+// TraceFn logs a message from a func at level Trace on the standard logger.
+func TraceFn(fn LogFunction) {
+ std.TraceFn(fn)
+}
+
+// DebugFn logs a message from a func at level Debug on the standard logger.
+func DebugFn(fn LogFunction) {
+ std.DebugFn(fn)
+}
+
+// PrintFn logs a message from a func at level Info on the standard logger.
+func PrintFn(fn LogFunction) {
+ std.PrintFn(fn)
+}
+
+// InfoFn logs a message from a func at level Info on the standard logger.
+func InfoFn(fn LogFunction) {
+ std.InfoFn(fn)
+}
+
+// WarnFn logs a message from a func at level Warn on the standard logger.
+func WarnFn(fn LogFunction) {
+ std.WarnFn(fn)
+}
+
+// WarningFn logs a message from a func at level Warn on the standard logger.
+func WarningFn(fn LogFunction) {
+ std.WarningFn(fn)
+}
+
+// ErrorFn logs a message from a func at level Error on the standard logger.
+func ErrorFn(fn LogFunction) {
+ std.ErrorFn(fn)
+}
+
+// PanicFn logs a message from a func at level Panic on the standard logger.
+func PanicFn(fn LogFunction) {
+ std.PanicFn(fn)
+}
+
+// FatalFn logs a message from a func at level Fatal on the standard logger then the process will exit with status set to 1.
+func FatalFn(fn LogFunction) {
+ std.FatalFn(fn)
+}
+
// Tracef logs a message at level Trace on the standard logger.
func Tracef(format string, args ...interface{}) {
std.Tracef(format, args...)
diff --git a/vendor/github.com/sirupsen/logrus/go.mod b/vendor/github.com/sirupsen/logrus/go.mod
index d41329679..b3919d5ea 100644
--- a/vendor/github.com/sirupsen/logrus/go.mod
+++ b/vendor/github.com/sirupsen/logrus/go.mod
@@ -2,10 +2,9 @@ module github.com/sirupsen/logrus
require (
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/konsorten/go-windows-terminal-sequences v1.0.3
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/testify v1.2.2
- golang.org/x/sys v0.0.0-20190422165155-953cdadca894
+ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037
)
go 1.13
diff --git a/vendor/github.com/sirupsen/logrus/go.sum b/vendor/github.com/sirupsen/logrus/go.sum
index 49c690f23..694c18b84 100644
--- a/vendor/github.com/sirupsen/logrus/go.sum
+++ b/vendor/github.com/sirupsen/logrus/go.sum
@@ -1,12 +1,8 @@
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 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/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
-github.com/konsorten/go-windows-terminal-sequences v1.0.3/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/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
-golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
diff --git a/vendor/github.com/sirupsen/logrus/json_formatter.go b/vendor/github.com/sirupsen/logrus/json_formatter.go
index ba7f23711..c96dc5636 100644
--- a/vendor/github.com/sirupsen/logrus/json_formatter.go
+++ b/vendor/github.com/sirupsen/logrus/json_formatter.go
@@ -23,6 +23,9 @@ func (f FieldMap) resolve(key fieldKey) string {
// JSONFormatter formats logs into parsable json
type JSONFormatter struct {
// TimestampFormat sets the format used for marshaling timestamps.
+ // The format to use is the same than for time.Format or time.Parse from the standard
+ // library.
+ // The standard Library already provides a set of predefined format.
TimestampFormat string
// DisableTimestamp allows disabling automatic timestamps in output
@@ -118,7 +121,7 @@ func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) {
encoder.SetIndent("", " ")
}
if err := encoder.Encode(data); err != nil {
- return nil, fmt.Errorf("failed to marshal fields to JSON, %v", err)
+ return nil, fmt.Errorf("failed to marshal fields to JSON, %w", err)
}
return b.Bytes(), nil
diff --git a/vendor/github.com/sirupsen/logrus/logger.go b/vendor/github.com/sirupsen/logrus/logger.go
index 6fdda748e..337704457 100644
--- a/vendor/github.com/sirupsen/logrus/logger.go
+++ b/vendor/github.com/sirupsen/logrus/logger.go
@@ -9,6 +9,11 @@ import (
"time"
)
+// LogFunction For big messages, it can be more efficient to pass a function
+// and only call it if the log level is actually enables rather than
+// generating the log message and then checking if the level is enabled
+type LogFunction func() []interface{}
+
type Logger struct {
// The logs are `io.Copy`'d to this in a mutex. It's common to set this to a
// file, or leave it default which is `os.Stderr`. You can also set this to
@@ -70,7 +75,7 @@ func (mw *MutexWrap) Disable() {
//
// var log = &logrus.Logger{
// Out: os.Stderr,
-// Formatter: new(logrus.JSONFormatter),
+// Formatter: new(logrus.TextFormatter),
// Hooks: make(logrus.LevelHooks),
// Level: logrus.DebugLevel,
// }
@@ -195,6 +200,14 @@ func (logger *Logger) Log(level Level, args ...interface{}) {
}
}
+func (logger *Logger) LogFn(level Level, fn LogFunction) {
+ if logger.IsLevelEnabled(level) {
+ entry := logger.newEntry()
+ entry.Log(level, fn()...)
+ logger.releaseEntry(entry)
+ }
+}
+
func (logger *Logger) Trace(args ...interface{}) {
logger.Log(TraceLevel, args...)
}
@@ -234,6 +247,45 @@ func (logger *Logger) Panic(args ...interface{}) {
logger.Log(PanicLevel, args...)
}
+func (logger *Logger) TraceFn(fn LogFunction) {
+ logger.LogFn(TraceLevel, fn)
+}
+
+func (logger *Logger) DebugFn(fn LogFunction) {
+ logger.LogFn(DebugLevel, fn)
+}
+
+func (logger *Logger) InfoFn(fn LogFunction) {
+ logger.LogFn(InfoLevel, fn)
+}
+
+func (logger *Logger) PrintFn(fn LogFunction) {
+ entry := logger.newEntry()
+ entry.Print(fn()...)
+ logger.releaseEntry(entry)
+}
+
+func (logger *Logger) WarnFn(fn LogFunction) {
+ logger.LogFn(WarnLevel, fn)
+}
+
+func (logger *Logger) WarningFn(fn LogFunction) {
+ logger.WarnFn(fn)
+}
+
+func (logger *Logger) ErrorFn(fn LogFunction) {
+ logger.LogFn(ErrorLevel, fn)
+}
+
+func (logger *Logger) FatalFn(fn LogFunction) {
+ logger.LogFn(FatalLevel, fn)
+ logger.Exit(1)
+}
+
+func (logger *Logger) PanicFn(fn LogFunction) {
+ logger.LogFn(PanicLevel, fn)
+}
+
func (logger *Logger) Logln(level Level, args ...interface{}) {
if logger.IsLevelEnabled(level) {
entry := logger.newEntry()
diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go
index cc4fe6e31..04748b851 100644
--- a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go
+++ b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go
@@ -1,4 +1,4 @@
-// +build linux aix
+// +build linux aix zos
// +build !js
package logrus
diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go b/vendor/github.com/sirupsen/logrus/terminal_check_windows.go
index 572889db2..2879eb50e 100644
--- a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go
+++ b/vendor/github.com/sirupsen/logrus/terminal_check_windows.go
@@ -5,30 +5,23 @@ package logrus
import (
"io"
"os"
- "syscall"
- sequences "github.com/konsorten/go-windows-terminal-sequences"
+ "golang.org/x/sys/windows"
)
-func initTerminal(w io.Writer) {
- switch v := w.(type) {
- case *os.File:
- sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true)
- }
-}
-
func checkIfTerminal(w io.Writer) bool {
- var ret bool
switch v := w.(type) {
case *os.File:
+ handle := windows.Handle(v.Fd())
var mode uint32
- err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode)
- ret = (err == nil)
- default:
- ret = false
+ if err := windows.GetConsoleMode(handle, &mode); err != nil {
+ return false
+ }
+ mode |= windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING
+ if err := windows.SetConsoleMode(handle, mode); err != nil {
+ return false
+ }
+ return true
}
- if ret {
- initTerminal(w)
- }
- return ret
+ return false
}
diff --git a/vendor/github.com/sirupsen/logrus/text_formatter.go b/vendor/github.com/sirupsen/logrus/text_formatter.go
index 3c28b54ca..be2c6efe5 100644
--- a/vendor/github.com/sirupsen/logrus/text_formatter.go
+++ b/vendor/github.com/sirupsen/logrus/text_formatter.go
@@ -53,7 +53,10 @@ type TextFormatter struct {
// the time passed since beginning of execution.
FullTimestamp bool
- // TimestampFormat to use for display when a full timestamp is printed
+ // TimestampFormat to use for display when a full timestamp is printed.
+ // The format to use is the same than for time.Format or time.Parse from the standard
+ // library.
+ // The standard Library already provides a set of predefined format.
TimestampFormat string
// The fields are sorted by default for a consistent output. For applications
@@ -235,6 +238,8 @@ func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []strin
levelColor = yellow
case ErrorLevel, FatalLevel, PanicLevel:
levelColor = red
+ case InfoLevel:
+ levelColor = blue
default:
levelColor = blue
}
diff --git a/vendor/github.com/stretchr/objx/accessors.go b/vendor/github.com/stretchr/objx/accessors.go
index 676316281..80ad16740 100644
--- a/vendor/github.com/stretchr/objx/accessors.go
+++ b/vendor/github.com/stretchr/objx/accessors.go
@@ -1,6 +1,7 @@
package objx
import (
+ "reflect"
"regexp"
"strconv"
"strings"
@@ -16,11 +17,18 @@ const (
// arrayAccesRegexString is the regex used to extract the array number
// from the access path
arrayAccesRegexString = `^(.+)\[([0-9]+)\]$`
+
+ // mapAccessRegexString is the regex used to extract the map key
+ // from the access path
+ mapAccessRegexString = `^([^\[]*)\[([^\]]+)\](.*)$`
)
// arrayAccesRegex is the compiled arrayAccesRegexString
var arrayAccesRegex = regexp.MustCompile(arrayAccesRegexString)
+// mapAccessRegex is the compiled mapAccessRegexString
+var mapAccessRegex = regexp.MustCompile(mapAccessRegexString)
+
// Get gets the value using the specified selector and
// returns it inside a new Obj object.
//
@@ -70,13 +78,45 @@ func getIndex(s string) (int, string) {
return -1, s
}
+// getKey returns the key which is held in s by two brackets.
+// It also returns the next selector.
+func getKey(s string) (string, string) {
+ selSegs := strings.SplitN(s, PathSeparator, 2)
+ thisSel := selSegs[0]
+ nextSel := ""
+
+ if len(selSegs) > 1 {
+ nextSel = selSegs[1]
+ }
+
+ mapMatches := mapAccessRegex.FindStringSubmatch(s)
+ if len(mapMatches) > 0 {
+ if _, err := strconv.Atoi(mapMatches[2]); err != nil {
+ thisSel = mapMatches[1]
+ nextSel = "[" + mapMatches[2] + "]" + mapMatches[3]
+
+ if thisSel == "" {
+ thisSel = mapMatches[2]
+ nextSel = mapMatches[3]
+ }
+
+ if nextSel == "" {
+ selSegs = []string{"", ""}
+ } else if nextSel[0] == '.' {
+ nextSel = nextSel[1:]
+ }
+ }
+ }
+
+ return thisSel, nextSel
+}
+
// access accesses the object using the selector and performs the
// appropriate action.
func access(current interface{}, selector string, value interface{}, isSet bool) interface{} {
- selSegs := strings.SplitN(selector, PathSeparator, 2)
- thisSel := selSegs[0]
- index := -1
+ thisSel, nextSel := getKey(selector)
+ index := -1
if strings.Contains(thisSel, "[") {
index, thisSel = getIndex(thisSel)
}
@@ -88,7 +128,7 @@ func access(current interface{}, selector string, value interface{}, isSet bool)
switch current.(type) {
case map[string]interface{}:
curMSI := current.(map[string]interface{})
- if len(selSegs) <= 1 && isSet {
+ if nextSel == "" && isSet {
curMSI[thisSel] = value
return nil
}
@@ -102,9 +142,10 @@ func access(current interface{}, selector string, value interface{}, isSet bool)
default:
current = nil
}
+
// do we need to access the item of an array?
if index > -1 {
- if array, ok := current.([]interface{}); ok {
+ if array, ok := interSlice(current); ok {
if index < len(array) {
current = array[index]
} else {
@@ -112,8 +153,27 @@ func access(current interface{}, selector string, value interface{}, isSet bool)
}
}
}
- if len(selSegs) > 1 {
- current = access(current, selSegs[1], value, isSet)
+ if nextSel != "" {
+ current = access(current, nextSel, value, isSet)
}
return current
}
+
+func interSlice(slice interface{}) ([]interface{}, bool) {
+ if array, ok := slice.([]interface{}); ok {
+ return array, ok
+ }
+
+ s := reflect.ValueOf(slice)
+ if s.Kind() != reflect.Slice {
+ return nil, false
+ }
+
+ ret := make([]interface{}, s.Len())
+
+ for i := 0; i < s.Len(); i++ {
+ ret[i] = s.Index(i).Interface()
+ }
+
+ return ret, true
+}
diff --git a/vendor/github.com/stretchr/testify/LICENSE b/vendor/github.com/stretchr/testify/LICENSE
index f38ec5956..4b0421cf9 100644
--- a/vendor/github.com/stretchr/testify/LICENSE
+++ b/vendor/github.com/stretchr/testify/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2012-2018 Mat Ryer and Tyler Bunnell
+Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_compare.go b/vendor/github.com/stretchr/testify/assert/assertion_compare.go
new file mode 100644
index 000000000..41649d267
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/assert/assertion_compare.go
@@ -0,0 +1,394 @@
+package assert
+
+import (
+ "fmt"
+ "reflect"
+)
+
+type CompareType int
+
+const (
+ compareLess CompareType = iota - 1
+ compareEqual
+ compareGreater
+)
+
+var (
+ intType = reflect.TypeOf(int(1))
+ int8Type = reflect.TypeOf(int8(1))
+ int16Type = reflect.TypeOf(int16(1))
+ int32Type = reflect.TypeOf(int32(1))
+ int64Type = reflect.TypeOf(int64(1))
+
+ uintType = reflect.TypeOf(uint(1))
+ uint8Type = reflect.TypeOf(uint8(1))
+ uint16Type = reflect.TypeOf(uint16(1))
+ uint32Type = reflect.TypeOf(uint32(1))
+ uint64Type = reflect.TypeOf(uint64(1))
+
+ float32Type = reflect.TypeOf(float32(1))
+ float64Type = reflect.TypeOf(float64(1))
+
+ stringType = reflect.TypeOf("")
+)
+
+func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) {
+ obj1Value := reflect.ValueOf(obj1)
+ obj2Value := reflect.ValueOf(obj2)
+
+ // throughout this switch we try and avoid calling .Convert() if possible,
+ // as this has a pretty big performance impact
+ switch kind {
+ case reflect.Int:
+ {
+ intobj1, ok := obj1.(int)
+ if !ok {
+ intobj1 = obj1Value.Convert(intType).Interface().(int)
+ }
+ intobj2, ok := obj2.(int)
+ if !ok {
+ intobj2 = obj2Value.Convert(intType).Interface().(int)
+ }
+ if intobj1 > intobj2 {
+ return compareGreater, true
+ }
+ if intobj1 == intobj2 {
+ return compareEqual, true
+ }
+ if intobj1 < intobj2 {
+ return compareLess, true
+ }
+ }
+ case reflect.Int8:
+ {
+ int8obj1, ok := obj1.(int8)
+ if !ok {
+ int8obj1 = obj1Value.Convert(int8Type).Interface().(int8)
+ }
+ int8obj2, ok := obj2.(int8)
+ if !ok {
+ int8obj2 = obj2Value.Convert(int8Type).Interface().(int8)
+ }
+ if int8obj1 > int8obj2 {
+ return compareGreater, true
+ }
+ if int8obj1 == int8obj2 {
+ return compareEqual, true
+ }
+ if int8obj1 < int8obj2 {
+ return compareLess, true
+ }
+ }
+ case reflect.Int16:
+ {
+ int16obj1, ok := obj1.(int16)
+ if !ok {
+ int16obj1 = obj1Value.Convert(int16Type).Interface().(int16)
+ }
+ int16obj2, ok := obj2.(int16)
+ if !ok {
+ int16obj2 = obj2Value.Convert(int16Type).Interface().(int16)
+ }
+ if int16obj1 > int16obj2 {
+ return compareGreater, true
+ }
+ if int16obj1 == int16obj2 {
+ return compareEqual, true
+ }
+ if int16obj1 < int16obj2 {
+ return compareLess, true
+ }
+ }
+ case reflect.Int32:
+ {
+ int32obj1, ok := obj1.(int32)
+ if !ok {
+ int32obj1 = obj1Value.Convert(int32Type).Interface().(int32)
+ }
+ int32obj2, ok := obj2.(int32)
+ if !ok {
+ int32obj2 = obj2Value.Convert(int32Type).Interface().(int32)
+ }
+ if int32obj1 > int32obj2 {
+ return compareGreater, true
+ }
+ if int32obj1 == int32obj2 {
+ return compareEqual, true
+ }
+ if int32obj1 < int32obj2 {
+ return compareLess, true
+ }
+ }
+ case reflect.Int64:
+ {
+ int64obj1, ok := obj1.(int64)
+ if !ok {
+ int64obj1 = obj1Value.Convert(int64Type).Interface().(int64)
+ }
+ int64obj2, ok := obj2.(int64)
+ if !ok {
+ int64obj2 = obj2Value.Convert(int64Type).Interface().(int64)
+ }
+ if int64obj1 > int64obj2 {
+ return compareGreater, true
+ }
+ if int64obj1 == int64obj2 {
+ return compareEqual, true
+ }
+ if int64obj1 < int64obj2 {
+ return compareLess, true
+ }
+ }
+ case reflect.Uint:
+ {
+ uintobj1, ok := obj1.(uint)
+ if !ok {
+ uintobj1 = obj1Value.Convert(uintType).Interface().(uint)
+ }
+ uintobj2, ok := obj2.(uint)
+ if !ok {
+ uintobj2 = obj2Value.Convert(uintType).Interface().(uint)
+ }
+ if uintobj1 > uintobj2 {
+ return compareGreater, true
+ }
+ if uintobj1 == uintobj2 {
+ return compareEqual, true
+ }
+ if uintobj1 < uintobj2 {
+ return compareLess, true
+ }
+ }
+ case reflect.Uint8:
+ {
+ uint8obj1, ok := obj1.(uint8)
+ if !ok {
+ uint8obj1 = obj1Value.Convert(uint8Type).Interface().(uint8)
+ }
+ uint8obj2, ok := obj2.(uint8)
+ if !ok {
+ uint8obj2 = obj2Value.Convert(uint8Type).Interface().(uint8)
+ }
+ if uint8obj1 > uint8obj2 {
+ return compareGreater, true
+ }
+ if uint8obj1 == uint8obj2 {
+ return compareEqual, true
+ }
+ if uint8obj1 < uint8obj2 {
+ return compareLess, true
+ }
+ }
+ case reflect.Uint16:
+ {
+ uint16obj1, ok := obj1.(uint16)
+ if !ok {
+ uint16obj1 = obj1Value.Convert(uint16Type).Interface().(uint16)
+ }
+ uint16obj2, ok := obj2.(uint16)
+ if !ok {
+ uint16obj2 = obj2Value.Convert(uint16Type).Interface().(uint16)
+ }
+ if uint16obj1 > uint16obj2 {
+ return compareGreater, true
+ }
+ if uint16obj1 == uint16obj2 {
+ return compareEqual, true
+ }
+ if uint16obj1 < uint16obj2 {
+ return compareLess, true
+ }
+ }
+ case reflect.Uint32:
+ {
+ uint32obj1, ok := obj1.(uint32)
+ if !ok {
+ uint32obj1 = obj1Value.Convert(uint32Type).Interface().(uint32)
+ }
+ uint32obj2, ok := obj2.(uint32)
+ if !ok {
+ uint32obj2 = obj2Value.Convert(uint32Type).Interface().(uint32)
+ }
+ if uint32obj1 > uint32obj2 {
+ return compareGreater, true
+ }
+ if uint32obj1 == uint32obj2 {
+ return compareEqual, true
+ }
+ if uint32obj1 < uint32obj2 {
+ return compareLess, true
+ }
+ }
+ case reflect.Uint64:
+ {
+ uint64obj1, ok := obj1.(uint64)
+ if !ok {
+ uint64obj1 = obj1Value.Convert(uint64Type).Interface().(uint64)
+ }
+ uint64obj2, ok := obj2.(uint64)
+ if !ok {
+ uint64obj2 = obj2Value.Convert(uint64Type).Interface().(uint64)
+ }
+ if uint64obj1 > uint64obj2 {
+ return compareGreater, true
+ }
+ if uint64obj1 == uint64obj2 {
+ return compareEqual, true
+ }
+ if uint64obj1 < uint64obj2 {
+ return compareLess, true
+ }
+ }
+ case reflect.Float32:
+ {
+ float32obj1, ok := obj1.(float32)
+ if !ok {
+ float32obj1 = obj1Value.Convert(float32Type).Interface().(float32)
+ }
+ float32obj2, ok := obj2.(float32)
+ if !ok {
+ float32obj2 = obj2Value.Convert(float32Type).Interface().(float32)
+ }
+ if float32obj1 > float32obj2 {
+ return compareGreater, true
+ }
+ if float32obj1 == float32obj2 {
+ return compareEqual, true
+ }
+ if float32obj1 < float32obj2 {
+ return compareLess, true
+ }
+ }
+ case reflect.Float64:
+ {
+ float64obj1, ok := obj1.(float64)
+ if !ok {
+ float64obj1 = obj1Value.Convert(float64Type).Interface().(float64)
+ }
+ float64obj2, ok := obj2.(float64)
+ if !ok {
+ float64obj2 = obj2Value.Convert(float64Type).Interface().(float64)
+ }
+ if float64obj1 > float64obj2 {
+ return compareGreater, true
+ }
+ if float64obj1 == float64obj2 {
+ return compareEqual, true
+ }
+ if float64obj1 < float64obj2 {
+ return compareLess, true
+ }
+ }
+ case reflect.String:
+ {
+ stringobj1, ok := obj1.(string)
+ if !ok {
+ stringobj1 = obj1Value.Convert(stringType).Interface().(string)
+ }
+ stringobj2, ok := obj2.(string)
+ if !ok {
+ stringobj2 = obj2Value.Convert(stringType).Interface().(string)
+ }
+ if stringobj1 > stringobj2 {
+ return compareGreater, true
+ }
+ if stringobj1 == stringobj2 {
+ return compareEqual, true
+ }
+ if stringobj1 < stringobj2 {
+ return compareLess, true
+ }
+ }
+ }
+
+ return compareEqual, false
+}
+
+// Greater asserts that the first element is greater than the second
+//
+// assert.Greater(t, 2, 1)
+// assert.Greater(t, float64(2), float64(1))
+// assert.Greater(t, "b", "a")
+func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
+ return compareTwoValues(t, e1, e2, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs)
+}
+
+// GreaterOrEqual asserts that the first element is greater than or equal to the second
+//
+// assert.GreaterOrEqual(t, 2, 1)
+// assert.GreaterOrEqual(t, 2, 2)
+// assert.GreaterOrEqual(t, "b", "a")
+// assert.GreaterOrEqual(t, "b", "b")
+func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
+ return compareTwoValues(t, e1, e2, []CompareType{compareGreater, compareEqual}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs)
+}
+
+// Less asserts that the first element is less than the second
+//
+// assert.Less(t, 1, 2)
+// assert.Less(t, float64(1), float64(2))
+// assert.Less(t, "a", "b")
+func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
+ return compareTwoValues(t, e1, e2, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs)
+}
+
+// LessOrEqual asserts that the first element is less than or equal to the second
+//
+// assert.LessOrEqual(t, 1, 2)
+// assert.LessOrEqual(t, 2, 2)
+// assert.LessOrEqual(t, "a", "b")
+// assert.LessOrEqual(t, "b", "b")
+func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
+ return compareTwoValues(t, e1, e2, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs)
+}
+
+// Positive asserts that the specified element is positive
+//
+// assert.Positive(t, 1)
+// assert.Positive(t, 1.23)
+func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool {
+ zero := reflect.Zero(reflect.TypeOf(e))
+ return compareTwoValues(t, e, zero.Interface(), []CompareType{compareGreater}, "\"%v\" is not positive", msgAndArgs)
+}
+
+// Negative asserts that the specified element is negative
+//
+// assert.Negative(t, -1)
+// assert.Negative(t, -1.23)
+func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) bool {
+ zero := reflect.Zero(reflect.TypeOf(e))
+ return compareTwoValues(t, e, zero.Interface(), []CompareType{compareLess}, "\"%v\" is not negative", msgAndArgs)
+}
+
+func compareTwoValues(t TestingT, e1 interface{}, e2 interface{}, allowedComparesResults []CompareType, failMessage string, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+
+ e1Kind := reflect.ValueOf(e1).Kind()
+ e2Kind := reflect.ValueOf(e2).Kind()
+ if e1Kind != e2Kind {
+ return Fail(t, "Elements should be the same type", msgAndArgs...)
+ }
+
+ compareResult, isComparable := compare(e1, e2, e1Kind)
+ if !isComparable {
+ return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...)
+ }
+
+ if !containsValue(allowedComparesResults, compareResult) {
+ return Fail(t, fmt.Sprintf(failMessage, e1, e2), msgAndArgs...)
+ }
+
+ return true
+}
+
+func containsValue(values []CompareType, value CompareType) bool {
+ for _, v := range values {
+ if v == value {
+ return true
+ }
+ }
+
+ return false
+}
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_format.go b/vendor/github.com/stretchr/testify/assert/assertion_format.go
index bf89ecd21..4dfd1229a 100644
--- a/vendor/github.com/stretchr/testify/assert/assertion_format.go
+++ b/vendor/github.com/stretchr/testify/assert/assertion_format.go
@@ -93,7 +93,7 @@ func EqualErrorf(t TestingT, theError error, errString string, msg string, args
// EqualValuesf asserts that two objects are equal or convertable to the same types
// and equal.
//
-// assert.EqualValuesf(t, uint32(123, "error message %s", "formatted"), int32(123))
+// assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted")
func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -114,6 +114,24 @@ func Errorf(t TestingT, err error, msg string, args ...interface{}) bool {
return Error(t, err, append([]interface{}{msg}, args...)...)
}
+// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
+// This is a wrapper for errors.As.
+func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return ErrorAs(t, err, target, append([]interface{}{msg}, args...)...)
+}
+
+// ErrorIsf asserts that at least one of the errors in err's chain matches target.
+// This is a wrapper for errors.Is.
+func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return ErrorIs(t, err, target, append([]interface{}{msg}, args...)...)
+}
+
// Eventuallyf asserts that given condition will be met in waitFor time,
// periodically checking target function each tick.
//
@@ -127,7 +145,7 @@ func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick
// Exactlyf asserts that two objects are equal in value and type.
//
-// assert.Exactlyf(t, int32(123, "error message %s", "formatted"), int64(123))
+// assert.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted")
func Exactlyf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -173,7 +191,7 @@ func FileExistsf(t TestingT, path string, msg string, args ...interface{}) bool
// Greaterf asserts that the first element is greater than the second
//
// assert.Greaterf(t, 2, 1, "error message %s", "formatted")
-// assert.Greaterf(t, float64(2, "error message %s", "formatted"), float64(1))
+// assert.Greaterf(t, float64(2), float64(1), "error message %s", "formatted")
// assert.Greaterf(t, "b", "a", "error message %s", "formatted")
func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
@@ -225,7 +243,7 @@ func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, u
//
// assert.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
-// Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false).
+// Returns whether the assertion was successful (true) or not (false).
func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -237,7 +255,7 @@ func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string,
//
// assert.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
-// Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false).
+// Returns whether the assertion was successful (true) or not (false).
func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -245,6 +263,18 @@ func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url stri
return HTTPRedirect(t, handler, method, url, values, append([]interface{}{msg}, args...)...)
}
+// HTTPStatusCodef asserts that a specified handler returns a specified status code.
+//
+// assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted")
+//
+// Returns whether the assertion was successful (true) or not (false).
+func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return HTTPStatusCode(t, handler, method, url, values, statuscode, append([]interface{}{msg}, args...)...)
+}
+
// HTTPSuccessf asserts that a specified handler returns a success status code.
//
// assert.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted")
@@ -259,7 +289,7 @@ func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url strin
// Implementsf asserts that an object is implemented by the specified interface.
//
-// assert.Implementsf(t, (*MyInterface, "error message %s", "formatted")(nil), new(MyObject))
+// assert.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted")
func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -309,6 +339,54 @@ func InEpsilonSlicef(t TestingT, expected interface{}, actual interface{}, epsil
return InEpsilonSlice(t, expected, actual, epsilon, append([]interface{}{msg}, args...)...)
}
+// IsDecreasingf asserts that the collection is decreasing
+//
+// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted")
+// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted")
+// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted")
+func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return IsDecreasing(t, object, append([]interface{}{msg}, args...)...)
+}
+
+// IsIncreasingf asserts that the collection is increasing
+//
+// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted")
+// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted")
+// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted")
+func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return IsIncreasing(t, object, append([]interface{}{msg}, args...)...)
+}
+
+// IsNonDecreasingf asserts that the collection is not decreasing
+//
+// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted")
+// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted")
+// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted")
+func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return IsNonDecreasing(t, object, append([]interface{}{msg}, args...)...)
+}
+
+// IsNonIncreasingf asserts that the collection is not increasing
+//
+// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted")
+// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted")
+// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted")
+func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return IsNonIncreasing(t, object, append([]interface{}{msg}, args...)...)
+}
+
// IsTypef asserts that the specified objects are of the same type.
func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
@@ -341,7 +419,7 @@ func Lenf(t TestingT, object interface{}, length int, msg string, args ...interf
// Lessf asserts that the first element is less than the second
//
// assert.Lessf(t, 1, 2, "error message %s", "formatted")
-// assert.Lessf(t, float64(1, "error message %s", "formatted"), float64(2))
+// assert.Lessf(t, float64(1), float64(2), "error message %s", "formatted")
// assert.Lessf(t, "a", "b", "error message %s", "formatted")
func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
@@ -363,6 +441,17 @@ func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args .
return LessOrEqual(t, e1, e2, append([]interface{}{msg}, args...)...)
}
+// Negativef asserts that the specified element is negative
+//
+// assert.Negativef(t, -1, "error message %s", "formatted")
+// assert.Negativef(t, -1.23, "error message %s", "formatted")
+func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return Negative(t, e, append([]interface{}{msg}, args...)...)
+}
+
// Neverf asserts that the given condition doesn't satisfy in waitFor time,
// periodically checking the target function each tick.
//
@@ -454,6 +543,25 @@ func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string,
return NotEqual(t, expected, actual, append([]interface{}{msg}, args...)...)
}
+// NotEqualValuesf asserts that two objects are not equal even when converted to the same type
+//
+// assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted")
+func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return NotEqualValues(t, expected, actual, append([]interface{}{msg}, args...)...)
+}
+
+// NotErrorIsf asserts that at none of the errors in err's chain matches target.
+// This is a wrapper for errors.Is.
+func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return NotErrorIs(t, err, target, append([]interface{}{msg}, args...)...)
+}
+
// NotNilf asserts that the specified object is not nil.
//
// assert.NotNilf(t, err, "error message %s", "formatted")
@@ -476,7 +584,7 @@ func NotPanicsf(t TestingT, f PanicTestFunc, msg string, args ...interface{}) bo
// NotRegexpf asserts that a specified regexp does not match a string.
//
-// assert.NotRegexpf(t, regexp.MustCompile("starts", "error message %s", "formatted"), "it's starting")
+// assert.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted")
// assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted")
func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
@@ -550,9 +658,20 @@ func PanicsWithValuef(t TestingT, expected interface{}, f PanicTestFunc, msg str
return PanicsWithValue(t, expected, f, append([]interface{}{msg}, args...)...)
}
+// Positivef asserts that the specified element is positive
+//
+// assert.Positivef(t, 1, "error message %s", "formatted")
+// assert.Positivef(t, 1.23, "error message %s", "formatted")
+func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return Positive(t, e, append([]interface{}{msg}, args...)...)
+}
+
// Regexpf asserts that a specified regexp matches a string.
//
-// assert.Regexpf(t, regexp.MustCompile("start", "error message %s", "formatted"), "it's starting")
+// assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted")
// assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted")
func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_forward.go b/vendor/github.com/stretchr/testify/assert/assertion_forward.go
index 75ecdcaa2..25337a6f0 100644
--- a/vendor/github.com/stretchr/testify/assert/assertion_forward.go
+++ b/vendor/github.com/stretchr/testify/assert/assertion_forward.go
@@ -169,7 +169,7 @@ func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAn
// EqualValuesf asserts that two objects are equal or convertable to the same types
// and equal.
//
-// a.EqualValuesf(uint32(123, "error message %s", "formatted"), int32(123))
+// a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted")
func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -204,6 +204,42 @@ func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool {
return Error(a.t, err, msgAndArgs...)
}
+// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
+// This is a wrapper for errors.As.
+func (a *Assertions) ErrorAs(err error, target interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return ErrorAs(a.t, err, target, msgAndArgs...)
+}
+
+// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
+// This is a wrapper for errors.As.
+func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return ErrorAsf(a.t, err, target, msg, args...)
+}
+
+// ErrorIs asserts that at least one of the errors in err's chain matches target.
+// This is a wrapper for errors.Is.
+func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return ErrorIs(a.t, err, target, msgAndArgs...)
+}
+
+// ErrorIsf asserts that at least one of the errors in err's chain matches target.
+// This is a wrapper for errors.Is.
+func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return ErrorIsf(a.t, err, target, msg, args...)
+}
+
// Errorf asserts that a function returned an error (i.e. not `nil`).
//
// actualObj, err := SomeFunction()
@@ -251,7 +287,7 @@ func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArg
// Exactlyf asserts that two objects are equal in value and type.
//
-// a.Exactlyf(int32(123, "error message %s", "formatted"), int64(123))
+// a.Exactlyf(int32(123), int64(123), "error message %s", "formatted")
func (a *Assertions) Exactlyf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -370,7 +406,7 @@ func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string,
// Greaterf asserts that the first element is greater than the second
//
// a.Greaterf(2, 1, "error message %s", "formatted")
-// a.Greaterf(float64(2, "error message %s", "formatted"), float64(1))
+// a.Greaterf(float64(2), float64(1), "error message %s", "formatted")
// a.Greaterf("b", "a", "error message %s", "formatted")
func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
@@ -447,7 +483,7 @@ func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url stri
//
// a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
-// Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false).
+// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -471,7 +507,7 @@ func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url s
//
// a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
-// Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false).
+// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -479,6 +515,30 @@ func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url
return HTTPRedirectf(a.t, handler, method, url, values, msg, args...)
}
+// HTTPStatusCode asserts that a specified handler returns a specified status code.
+//
+// a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501)
+//
+// Returns whether the assertion was successful (true) or not (false).
+func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return HTTPStatusCode(a.t, handler, method, url, values, statuscode, msgAndArgs...)
+}
+
+// HTTPStatusCodef asserts that a specified handler returns a specified status code.
+//
+// a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted")
+//
+// Returns whether the assertion was successful (true) or not (false).
+func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return HTTPStatusCodef(a.t, handler, method, url, values, statuscode, msg, args...)
+}
+
// HTTPSuccess asserts that a specified handler returns a success status code.
//
// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil)
@@ -515,7 +575,7 @@ func (a *Assertions) Implements(interfaceObject interface{}, object interface{},
// Implementsf asserts that an object is implemented by the specified interface.
//
-// a.Implementsf((*MyInterface, "error message %s", "formatted")(nil), new(MyObject))
+// a.Implementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted")
func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -607,6 +667,102 @@ func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilo
return InEpsilonf(a.t, expected, actual, epsilon, msg, args...)
}
+// IsDecreasing asserts that the collection is decreasing
+//
+// a.IsDecreasing([]int{2, 1, 0})
+// a.IsDecreasing([]float{2, 1})
+// a.IsDecreasing([]string{"b", "a"})
+func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return IsDecreasing(a.t, object, msgAndArgs...)
+}
+
+// IsDecreasingf asserts that the collection is decreasing
+//
+// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted")
+// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted")
+// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted")
+func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return IsDecreasingf(a.t, object, msg, args...)
+}
+
+// IsIncreasing asserts that the collection is increasing
+//
+// a.IsIncreasing([]int{1, 2, 3})
+// a.IsIncreasing([]float{1, 2})
+// a.IsIncreasing([]string{"a", "b"})
+func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return IsIncreasing(a.t, object, msgAndArgs...)
+}
+
+// IsIncreasingf asserts that the collection is increasing
+//
+// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted")
+// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted")
+// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted")
+func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return IsIncreasingf(a.t, object, msg, args...)
+}
+
+// IsNonDecreasing asserts that the collection is not decreasing
+//
+// a.IsNonDecreasing([]int{1, 1, 2})
+// a.IsNonDecreasing([]float{1, 2})
+// a.IsNonDecreasing([]string{"a", "b"})
+func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return IsNonDecreasing(a.t, object, msgAndArgs...)
+}
+
+// IsNonDecreasingf asserts that the collection is not decreasing
+//
+// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted")
+// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted")
+// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted")
+func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return IsNonDecreasingf(a.t, object, msg, args...)
+}
+
+// IsNonIncreasing asserts that the collection is not increasing
+//
+// a.IsNonIncreasing([]int{2, 1, 1})
+// a.IsNonIncreasing([]float{2, 1})
+// a.IsNonIncreasing([]string{"b", "a"})
+func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return IsNonIncreasing(a.t, object, msgAndArgs...)
+}
+
+// IsNonIncreasingf asserts that the collection is not increasing
+//
+// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted")
+// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted")
+// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted")
+func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return IsNonIncreasingf(a.t, object, msg, args...)
+}
+
// IsType asserts that the specified objects are of the same type.
func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
@@ -706,7 +862,7 @@ func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, ar
// Lessf asserts that the first element is less than the second
//
// a.Lessf(1, 2, "error message %s", "formatted")
-// a.Lessf(float64(1, "error message %s", "formatted"), float64(2))
+// a.Lessf(float64(1), float64(2), "error message %s", "formatted")
// a.Lessf("a", "b", "error message %s", "formatted")
func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
@@ -715,6 +871,28 @@ func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...i
return Lessf(a.t, e1, e2, msg, args...)
}
+// Negative asserts that the specified element is negative
+//
+// a.Negative(-1)
+// a.Negative(-1.23)
+func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return Negative(a.t, e, msgAndArgs...)
+}
+
+// Negativef asserts that the specified element is negative
+//
+// a.Negativef(-1, "error message %s", "formatted")
+// a.Negativef(-1.23, "error message %s", "formatted")
+func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return Negativef(a.t, e, msg, args...)
+}
+
// Never asserts that the given condition doesn't satisfy in waitFor time,
// periodically checking the target function each tick.
//
@@ -884,6 +1062,26 @@ func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndAr
return NotEqual(a.t, expected, actual, msgAndArgs...)
}
+// NotEqualValues asserts that two objects are not equal even when converted to the same type
+//
+// a.NotEqualValues(obj1, obj2)
+func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return NotEqualValues(a.t, expected, actual, msgAndArgs...)
+}
+
+// NotEqualValuesf asserts that two objects are not equal even when converted to the same type
+//
+// a.NotEqualValuesf(obj1, obj2, "error message %s", "formatted")
+func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return NotEqualValuesf(a.t, expected, actual, msg, args...)
+}
+
// NotEqualf asserts that the specified values are NOT equal.
//
// a.NotEqualf(obj1, obj2, "error message %s", "formatted")
@@ -897,6 +1095,24 @@ func (a *Assertions) NotEqualf(expected interface{}, actual interface{}, msg str
return NotEqualf(a.t, expected, actual, msg, args...)
}
+// NotErrorIs asserts that at none of the errors in err's chain matches target.
+// This is a wrapper for errors.Is.
+func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return NotErrorIs(a.t, err, target, msgAndArgs...)
+}
+
+// NotErrorIsf asserts that at none of the errors in err's chain matches target.
+// This is a wrapper for errors.Is.
+func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return NotErrorIsf(a.t, err, target, msg, args...)
+}
+
// NotNil asserts that the specified object is not nil.
//
// a.NotNil(err)
@@ -950,7 +1166,7 @@ func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...in
// NotRegexpf asserts that a specified regexp does not match a string.
//
-// a.NotRegexpf(regexp.MustCompile("starts", "error message %s", "formatted"), "it's starting")
+// a.NotRegexpf(regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted")
// a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted")
func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
@@ -1089,6 +1305,28 @@ func (a *Assertions) Panicsf(f PanicTestFunc, msg string, args ...interface{}) b
return Panicsf(a.t, f, msg, args...)
}
+// Positive asserts that the specified element is positive
+//
+// a.Positive(1)
+// a.Positive(1.23)
+func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return Positive(a.t, e, msgAndArgs...)
+}
+
+// Positivef asserts that the specified element is positive
+//
+// a.Positivef(1, "error message %s", "formatted")
+// a.Positivef(1.23, "error message %s", "formatted")
+func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return Positivef(a.t, e, msg, args...)
+}
+
// Regexp asserts that a specified regexp matches a string.
//
// a.Regexp(regexp.MustCompile("start"), "it's starting")
@@ -1102,7 +1340,7 @@ func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...inter
// Regexpf asserts that a specified regexp matches a string.
//
-// a.Regexpf(regexp.MustCompile("start", "error message %s", "formatted"), "it's starting")
+// a.Regexpf(regexp.MustCompile("start"), "it's starting", "error message %s", "formatted")
// a.Regexpf("start...$", "it's not starting", "error message %s", "formatted")
func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_order.go b/vendor/github.com/stretchr/testify/assert/assertion_order.go
index 15a486ca6..1c3b47182 100644
--- a/vendor/github.com/stretchr/testify/assert/assertion_order.go
+++ b/vendor/github.com/stretchr/testify/assert/assertion_order.go
@@ -5,305 +5,77 @@ import (
"reflect"
)
-func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) {
- switch kind {
- case reflect.Int:
- {
- intobj1 := obj1.(int)
- intobj2 := obj2.(int)
- if intobj1 > intobj2 {
- return -1, true
- }
- if intobj1 == intobj2 {
- return 0, true
- }
- if intobj1 < intobj2 {
- return 1, true
- }
- }
- case reflect.Int8:
- {
- int8obj1 := obj1.(int8)
- int8obj2 := obj2.(int8)
- if int8obj1 > int8obj2 {
- return -1, true
- }
- if int8obj1 == int8obj2 {
- return 0, true
- }
- if int8obj1 < int8obj2 {
- return 1, true
- }
- }
- case reflect.Int16:
- {
- int16obj1 := obj1.(int16)
- int16obj2 := obj2.(int16)
- if int16obj1 > int16obj2 {
- return -1, true
- }
- if int16obj1 == int16obj2 {
- return 0, true
- }
- if int16obj1 < int16obj2 {
- return 1, true
- }
- }
- case reflect.Int32:
- {
- int32obj1 := obj1.(int32)
- int32obj2 := obj2.(int32)
- if int32obj1 > int32obj2 {
- return -1, true
- }
- if int32obj1 == int32obj2 {
- return 0, true
- }
- if int32obj1 < int32obj2 {
- return 1, true
- }
- }
- case reflect.Int64:
- {
- int64obj1 := obj1.(int64)
- int64obj2 := obj2.(int64)
- if int64obj1 > int64obj2 {
- return -1, true
- }
- if int64obj1 == int64obj2 {
- return 0, true
- }
- if int64obj1 < int64obj2 {
- return 1, true
- }
- }
- case reflect.Uint:
- {
- uintobj1 := obj1.(uint)
- uintobj2 := obj2.(uint)
- if uintobj1 > uintobj2 {
- return -1, true
- }
- if uintobj1 == uintobj2 {
- return 0, true
- }
- if uintobj1 < uintobj2 {
- return 1, true
- }
- }
- case reflect.Uint8:
- {
- uint8obj1 := obj1.(uint8)
- uint8obj2 := obj2.(uint8)
- if uint8obj1 > uint8obj2 {
- return -1, true
- }
- if uint8obj1 == uint8obj2 {
- return 0, true
- }
- if uint8obj1 < uint8obj2 {
- return 1, true
- }
- }
- case reflect.Uint16:
- {
- uint16obj1 := obj1.(uint16)
- uint16obj2 := obj2.(uint16)
- if uint16obj1 > uint16obj2 {
- return -1, true
- }
- if uint16obj1 == uint16obj2 {
- return 0, true
- }
- if uint16obj1 < uint16obj2 {
- return 1, true
- }
- }
- case reflect.Uint32:
- {
- uint32obj1 := obj1.(uint32)
- uint32obj2 := obj2.(uint32)
- if uint32obj1 > uint32obj2 {
- return -1, true
- }
- if uint32obj1 == uint32obj2 {
- return 0, true
- }
- if uint32obj1 < uint32obj2 {
- return 1, true
- }
- }
- case reflect.Uint64:
- {
- uint64obj1 := obj1.(uint64)
- uint64obj2 := obj2.(uint64)
- if uint64obj1 > uint64obj2 {
- return -1, true
- }
- if uint64obj1 == uint64obj2 {
- return 0, true
- }
- if uint64obj1 < uint64obj2 {
- return 1, true
- }
- }
- case reflect.Float32:
- {
- float32obj1 := obj1.(float32)
- float32obj2 := obj2.(float32)
- if float32obj1 > float32obj2 {
- return -1, true
- }
- if float32obj1 == float32obj2 {
- return 0, true
- }
- if float32obj1 < float32obj2 {
- return 1, true
- }
- }
- case reflect.Float64:
- {
- float64obj1 := obj1.(float64)
- float64obj2 := obj2.(float64)
- if float64obj1 > float64obj2 {
- return -1, true
- }
- if float64obj1 == float64obj2 {
- return 0, true
- }
- if float64obj1 < float64obj2 {
- return 1, true
- }
- }
- case reflect.String:
- {
- stringobj1 := obj1.(string)
- stringobj2 := obj2.(string)
- if stringobj1 > stringobj2 {
- return -1, true
- }
- if stringobj1 == stringobj2 {
- return 0, true
- }
- if stringobj1 < stringobj2 {
- return 1, true
- }
- }
+// isOrdered checks that collection contains orderable elements.
+func isOrdered(t TestingT, object interface{}, allowedComparesResults []CompareType, failMessage string, msgAndArgs ...interface{}) bool {
+ objKind := reflect.TypeOf(object).Kind()
+ if objKind != reflect.Slice && objKind != reflect.Array {
+ return false
}
- return 0, false
-}
+ objValue := reflect.ValueOf(object)
+ objLen := objValue.Len()
-// Greater asserts that the first element is greater than the second
-//
-// assert.Greater(t, 2, 1)
-// assert.Greater(t, float64(2), float64(1))
-// assert.Greater(t, "b", "a")
-func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
- if h, ok := t.(tHelper); ok {
- h.Helper()
+ if objLen <= 1 {
+ return true
}
- e1Kind := reflect.ValueOf(e1).Kind()
- e2Kind := reflect.ValueOf(e2).Kind()
- if e1Kind != e2Kind {
- return Fail(t, "Elements should be the same type", msgAndArgs...)
- }
+ value := objValue.Index(0)
+ valueInterface := value.Interface()
+ firstValueKind := value.Kind()
- res, isComparable := compare(e1, e2, e1Kind)
- if !isComparable {
- return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...)
- }
+ for i := 1; i < objLen; i++ {
+ prevValue := value
+ prevValueInterface := valueInterface
- if res != -1 {
- return Fail(t, fmt.Sprintf("\"%v\" is not greater than \"%v\"", e1, e2), msgAndArgs...)
+ value = objValue.Index(i)
+ valueInterface = value.Interface()
+
+ compareResult, isComparable := compare(prevValueInterface, valueInterface, firstValueKind)
+
+ if !isComparable {
+ return Fail(t, fmt.Sprintf("Can not compare type \"%s\" and \"%s\"", reflect.TypeOf(value), reflect.TypeOf(prevValue)), msgAndArgs...)
+ }
+
+ if !containsValue(allowedComparesResults, compareResult) {
+ return Fail(t, fmt.Sprintf(failMessage, prevValue, value), msgAndArgs...)
+ }
}
return true
}
-// GreaterOrEqual asserts that the first element is greater than or equal to the second
+// IsIncreasing asserts that the collection is increasing
//
-// assert.GreaterOrEqual(t, 2, 1)
-// assert.GreaterOrEqual(t, 2, 2)
-// assert.GreaterOrEqual(t, "b", "a")
-// assert.GreaterOrEqual(t, "b", "b")
-func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
- if h, ok := t.(tHelper); ok {
- h.Helper()
- }
-
- e1Kind := reflect.ValueOf(e1).Kind()
- e2Kind := reflect.ValueOf(e2).Kind()
- if e1Kind != e2Kind {
- return Fail(t, "Elements should be the same type", msgAndArgs...)
- }
-
- res, isComparable := compare(e1, e2, e1Kind)
- if !isComparable {
- return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...)
- }
-
- if res != -1 && res != 0 {
- return Fail(t, fmt.Sprintf("\"%v\" is not greater than or equal to \"%v\"", e1, e2), msgAndArgs...)
- }
-
- return true
+// assert.IsIncreasing(t, []int{1, 2, 3})
+// assert.IsIncreasing(t, []float{1, 2})
+// assert.IsIncreasing(t, []string{"a", "b"})
+func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
+ return isOrdered(t, object, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs)
}
-// Less asserts that the first element is less than the second
+// IsNonIncreasing asserts that the collection is not increasing
//
-// assert.Less(t, 1, 2)
-// assert.Less(t, float64(1), float64(2))
-// assert.Less(t, "a", "b")
-func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
- if h, ok := t.(tHelper); ok {
- h.Helper()
- }
-
- e1Kind := reflect.ValueOf(e1).Kind()
- e2Kind := reflect.ValueOf(e2).Kind()
- if e1Kind != e2Kind {
- return Fail(t, "Elements should be the same type", msgAndArgs...)
- }
-
- res, isComparable := compare(e1, e2, e1Kind)
- if !isComparable {
- return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...)
- }
-
- if res != 1 {
- return Fail(t, fmt.Sprintf("\"%v\" is not less than \"%v\"", e1, e2), msgAndArgs...)
- }
-
- return true
+// assert.IsNonIncreasing(t, []int{2, 1, 1})
+// assert.IsNonIncreasing(t, []float{2, 1})
+// assert.IsNonIncreasing(t, []string{"b", "a"})
+func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
+ return isOrdered(t, object, []CompareType{compareEqual, compareGreater}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs)
}
-// LessOrEqual asserts that the first element is less than or equal to the second
+// IsDecreasing asserts that the collection is decreasing
//
-// assert.LessOrEqual(t, 1, 2)
-// assert.LessOrEqual(t, 2, 2)
-// assert.LessOrEqual(t, "a", "b")
-// assert.LessOrEqual(t, "b", "b")
-func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
- if h, ok := t.(tHelper); ok {
- h.Helper()
- }
-
- e1Kind := reflect.ValueOf(e1).Kind()
- e2Kind := reflect.ValueOf(e2).Kind()
- if e1Kind != e2Kind {
- return Fail(t, "Elements should be the same type", msgAndArgs...)
- }
-
- res, isComparable := compare(e1, e2, e1Kind)
- if !isComparable {
- return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...)
- }
-
- if res != 1 && res != 0 {
- return Fail(t, fmt.Sprintf("\"%v\" is not less than or equal to \"%v\"", e1, e2), msgAndArgs...)
- }
-
- return true
+// assert.IsDecreasing(t, []int{2, 1, 0})
+// assert.IsDecreasing(t, []float{2, 1})
+// assert.IsDecreasing(t, []string{"b", "a"})
+func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
+ return isOrdered(t, object, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs)
+}
+
+// IsNonDecreasing asserts that the collection is not decreasing
+//
+// assert.IsNonDecreasing(t, []int{1, 1, 2})
+// assert.IsNonDecreasing(t, []float{1, 2})
+// assert.IsNonDecreasing(t, []string{"a", "b"})
+func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
+ return isOrdered(t, object, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs)
}
diff --git a/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/stretchr/testify/assert/assertions.go
index bdd81389a..bcac4401f 100644
--- a/vendor/github.com/stretchr/testify/assert/assertions.go
+++ b/vendor/github.com/stretchr/testify/assert/assertions.go
@@ -19,7 +19,7 @@ import (
"github.com/davecgh/go-spew/spew"
"github.com/pmezard/go-difflib/difflib"
- yaml "gopkg.in/yaml.v2"
+ yaml "gopkg.in/yaml.v3"
)
//go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_format.go.tmpl"
@@ -45,7 +45,7 @@ type BoolAssertionFunc func(TestingT, bool, ...interface{}) bool
// for table driven tests.
type ErrorAssertionFunc func(TestingT, error, ...interface{}) bool
-// Comparison a custom function that returns true on success and false on failure
+// Comparison is a custom function that returns true on success and false on failure
type Comparison func() (success bool)
/*
@@ -104,11 +104,11 @@ the problem actually occurred in calling code.*/
// failed.
func CallerInfo() []string {
- pc := uintptr(0)
- file := ""
- line := 0
- ok := false
- name := ""
+ var pc uintptr
+ var ok bool
+ var file string
+ var line int
+ var name string
callers := []string{}
for i := 0; ; i++ {
@@ -172,8 +172,8 @@ func isTest(name, prefix string) bool {
if len(name) == len(prefix) { // "Test" is ok
return true
}
- rune, _ := utf8.DecodeRuneInString(name[len(prefix):])
- return !unicode.IsLower(rune)
+ r, _ := utf8.DecodeRuneInString(name[len(prefix):])
+ return !unicode.IsLower(r)
}
func messageFromMsgAndArgs(msgAndArgs ...interface{}) string {
@@ -429,14 +429,27 @@ func samePointers(first, second interface{}) bool {
// to a type conversion in the Go grammar.
func formatUnequalValues(expected, actual interface{}) (e string, a string) {
if reflect.TypeOf(expected) != reflect.TypeOf(actual) {
- return fmt.Sprintf("%T(%#v)", expected, expected),
- fmt.Sprintf("%T(%#v)", actual, actual)
+ return fmt.Sprintf("%T(%s)", expected, truncatingFormat(expected)),
+ fmt.Sprintf("%T(%s)", actual, truncatingFormat(actual))
}
switch expected.(type) {
case time.Duration:
return fmt.Sprintf("%v", expected), fmt.Sprintf("%v", actual)
}
- return fmt.Sprintf("%#v", expected), fmt.Sprintf("%#v", actual)
+ return truncatingFormat(expected), truncatingFormat(actual)
+}
+
+// truncatingFormat formats the data and truncates it if it's too long.
+//
+// This helps keep formatted error messages lines from exceeding the
+// bufio.MaxScanTokenSize max line length that the go testing framework imposes.
+func truncatingFormat(data interface{}) string {
+ value := fmt.Sprintf("%#v", data)
+ max := bufio.MaxScanTokenSize - 100 // Give us some space the type info too if needed.
+ if len(value) > max {
+ value = value[0:max] + "<... truncated>"
+ }
+ return value
}
// EqualValues asserts that two objects are equal or convertable to the same types
@@ -483,12 +496,12 @@ func Exactly(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}
//
// assert.NotNil(t, err)
func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
- if h, ok := t.(tHelper); ok {
- h.Helper()
- }
if !isNil(object) {
return true
}
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
return Fail(t, "Expected value not to be nil.", msgAndArgs...)
}
@@ -529,12 +542,12 @@ func isNil(object interface{}) bool {
//
// assert.Nil(t, err)
func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
- if h, ok := t.(tHelper); ok {
- h.Helper()
- }
if isNil(object) {
return true
}
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
return Fail(t, fmt.Sprintf("Expected nil, but got: %#v", object), msgAndArgs...)
}
@@ -571,12 +584,11 @@ func isEmpty(object interface{}) bool {
//
// assert.Empty(t, obj)
func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
- if h, ok := t.(tHelper); ok {
- h.Helper()
- }
-
pass := isEmpty(object)
if !pass {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
Fail(t, fmt.Sprintf("Should be empty, but was %v", object), msgAndArgs...)
}
@@ -591,12 +603,11 @@ func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
// assert.Equal(t, "two", obj[1])
// }
func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
- if h, ok := t.(tHelper); ok {
- h.Helper()
- }
-
pass := !isEmpty(object)
if !pass {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
Fail(t, fmt.Sprintf("Should NOT be empty, but was %v", object), msgAndArgs...)
}
@@ -639,16 +650,10 @@ func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{})
//
// assert.True(t, myBool)
func True(t TestingT, value bool, msgAndArgs ...interface{}) bool {
- if h, ok := t.(tHelper); ok {
- h.Helper()
- }
- if h, ok := t.(interface {
- Helper()
- }); ok {
- h.Helper()
- }
-
- if value != true {
+ if !value {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
return Fail(t, "Should be true", msgAndArgs...)
}
@@ -660,11 +665,10 @@ func True(t TestingT, value bool, msgAndArgs ...interface{}) bool {
//
// assert.False(t, myBool)
func False(t TestingT, value bool, msgAndArgs ...interface{}) bool {
- if h, ok := t.(tHelper); ok {
- h.Helper()
- }
-
- if value != false {
+ if value {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
return Fail(t, "Should be false", msgAndArgs...)
}
@@ -695,6 +699,21 @@ func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{
}
+// NotEqualValues asserts that two objects are not equal even when converted to the same type
+//
+// assert.NotEqualValues(t, obj1, obj2)
+func NotEqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+
+ if ObjectsAreEqualValues(expected, actual) {
+ return Fail(t, fmt.Sprintf("Should not be: %#v\n", actual), msgAndArgs...)
+ }
+
+ return true
+}
+
// containsElement try loop over the list check if the list includes the element.
// return (false, false) if impossible.
// return (true, false) if element was not found.
@@ -747,10 +766,10 @@ func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bo
ok, found := includeElement(s, contains)
if !ok {
- return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...)
}
if !found {
- return Fail(t, fmt.Sprintf("\"%s\" does not contain \"%s\"", s, contains), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%#v does not contain %#v", s, contains), msgAndArgs...)
}
return true
@@ -881,27 +900,39 @@ func ElementsMatch(t TestingT, listA, listB interface{}, msgAndArgs ...interface
return true
}
- aKind := reflect.TypeOf(listA).Kind()
- bKind := reflect.TypeOf(listB).Kind()
-
- if aKind != reflect.Array && aKind != reflect.Slice {
- return Fail(t, fmt.Sprintf("%q has an unsupported type %s", listA, aKind), msgAndArgs...)
+ if !isList(t, listA, msgAndArgs...) || !isList(t, listB, msgAndArgs...) {
+ return false
}
- if bKind != reflect.Array && bKind != reflect.Slice {
- return Fail(t, fmt.Sprintf("%q has an unsupported type %s", listB, bKind), msgAndArgs...)
+ extraA, extraB := diffLists(listA, listB)
+
+ if len(extraA) == 0 && len(extraB) == 0 {
+ return true
}
+ return Fail(t, formatListDiff(listA, listB, extraA, extraB), msgAndArgs...)
+}
+
+// isList checks that the provided value is array or slice.
+func isList(t TestingT, list interface{}, msgAndArgs ...interface{}) (ok bool) {
+ kind := reflect.TypeOf(list).Kind()
+ if kind != reflect.Array && kind != reflect.Slice {
+ return Fail(t, fmt.Sprintf("%q has an unsupported type %s, expecting array or slice", list, kind),
+ msgAndArgs...)
+ }
+ return true
+}
+
+// diffLists diffs two arrays/slices and returns slices of elements that are only in A and only in B.
+// If some element is present multiple times, each instance is counted separately (e.g. if something is 2x in A and
+// 5x in B, it will be 0x in extraA and 3x in extraB). The order of items in both lists is ignored.
+func diffLists(listA, listB interface{}) (extraA, extraB []interface{}) {
aValue := reflect.ValueOf(listA)
bValue := reflect.ValueOf(listB)
aLen := aValue.Len()
bLen := bValue.Len()
- if aLen != bLen {
- return Fail(t, fmt.Sprintf("lengths don't match: %d != %d", aLen, bLen), msgAndArgs...)
- }
-
// Mark indexes in bValue that we already used
visited := make([]bool, bLen)
for i := 0; i < aLen; i++ {
@@ -918,11 +949,38 @@ func ElementsMatch(t TestingT, listA, listB interface{}, msgAndArgs ...interface
}
}
if !found {
- return Fail(t, fmt.Sprintf("element %s appears more times in %s than in %s", element, aValue, bValue), msgAndArgs...)
+ extraA = append(extraA, element)
}
}
- return true
+ for j := 0; j < bLen; j++ {
+ if visited[j] {
+ continue
+ }
+ extraB = append(extraB, bValue.Index(j).Interface())
+ }
+
+ return
+}
+
+func formatListDiff(listA, listB interface{}, extraA, extraB []interface{}) string {
+ var msg bytes.Buffer
+
+ msg.WriteString("elements differ")
+ if len(extraA) > 0 {
+ msg.WriteString("\n\nextra elements in list A:\n")
+ msg.WriteString(spewConfig.Sdump(extraA))
+ }
+ if len(extraB) > 0 {
+ msg.WriteString("\n\nextra elements in list B:\n")
+ msg.WriteString(spewConfig.Sdump(extraB))
+ }
+ msg.WriteString("\n\nlistA:\n")
+ msg.WriteString(spewConfig.Sdump(listA))
+ msg.WriteString("\n\nlistB:\n")
+ msg.WriteString(spewConfig.Sdump(listB))
+
+ return msg.String()
}
// Condition uses a Comparison to assert a complex condition.
@@ -1058,6 +1116,8 @@ func toFloat(x interface{}) (float64, bool) {
xok := true
switch xn := x.(type) {
+ case uint:
+ xf = float64(xn)
case uint8:
xf = float64(xn)
case uint16:
@@ -1079,7 +1139,7 @@ func toFloat(x interface{}) (float64, bool) {
case float32:
xf = float64(xn)
case float64:
- xf = float64(xn)
+ xf = xn
case time.Duration:
xf = float64(xn)
default:
@@ -1193,6 +1253,9 @@ func calcRelativeError(expected, actual interface{}) (float64, error) {
if !aok {
return 0, fmt.Errorf("expected value %q cannot be converted to float", expected)
}
+ if math.IsNaN(af) {
+ return 0, errors.New("expected value must not be NaN")
+ }
if af == 0 {
return 0, fmt.Errorf("expected value must have a value other than zero to calculate the relative error")
}
@@ -1200,6 +1263,9 @@ func calcRelativeError(expected, actual interface{}) (float64, error) {
if !bok {
return 0, fmt.Errorf("actual value %q cannot be converted to float", actual)
}
+ if math.IsNaN(bf) {
+ return 0, errors.New("actual value must not be NaN")
+ }
return math.Abs(af-bf) / math.Abs(af), nil
}
@@ -1209,6 +1275,9 @@ func InEpsilon(t TestingT, expected, actual interface{}, epsilon float64, msgAnd
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if math.IsNaN(epsilon) {
+ return Fail(t, "epsilon must not be NaN")
+ }
actualEpsilon, err := calcRelativeError(expected, actual)
if err != nil {
return Fail(t, err.Error(), msgAndArgs...)
@@ -1256,10 +1325,10 @@ func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, m
// assert.Equal(t, expectedObj, actualObj)
// }
func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool {
- if h, ok := t.(tHelper); ok {
- h.Helper()
- }
if err != nil {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
return Fail(t, fmt.Sprintf("Received unexpected error:\n%+v", err), msgAndArgs...)
}
@@ -1273,11 +1342,10 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool {
// assert.Equal(t, expectedError, err)
// }
func Error(t TestingT, err error, msgAndArgs ...interface{}) bool {
- if h, ok := t.(tHelper); ok {
- h.Helper()
- }
-
if err == nil {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
return Fail(t, "An error is expected but got nil.", msgAndArgs...)
}
@@ -1553,6 +1621,8 @@ var spewConfig = spew.ConfigState{
DisablePointerAddresses: true,
DisableCapacities: true,
SortKeys: true,
+ DisableMethods: true,
+ MaxDepth: 10,
}
type tHelper interface {
@@ -1624,3 +1694,81 @@ func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.D
}
}
}
+
+// ErrorIs asserts that at least one of the errors in err's chain matches target.
+// This is a wrapper for errors.Is.
+func ErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if errors.Is(err, target) {
+ return true
+ }
+
+ var expectedText string
+ if target != nil {
+ expectedText = target.Error()
+ }
+
+ chain := buildErrorChainString(err)
+
+ return Fail(t, fmt.Sprintf("Target error should be in err chain:\n"+
+ "expected: %q\n"+
+ "in chain: %s", expectedText, chain,
+ ), msgAndArgs...)
+}
+
+// NotErrorIs asserts that at none of the errors in err's chain matches target.
+// This is a wrapper for errors.Is.
+func NotErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if !errors.Is(err, target) {
+ return true
+ }
+
+ var expectedText string
+ if target != nil {
+ expectedText = target.Error()
+ }
+
+ chain := buildErrorChainString(err)
+
+ return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+
+ "found: %q\n"+
+ "in chain: %s", expectedText, chain,
+ ), msgAndArgs...)
+}
+
+// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
+// This is a wrapper for errors.As.
+func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if errors.As(err, target) {
+ return true
+ }
+
+ chain := buildErrorChainString(err)
+
+ return Fail(t, fmt.Sprintf("Should be in error chain:\n"+
+ "expected: %q\n"+
+ "in chain: %s", target, chain,
+ ), msgAndArgs...)
+}
+
+func buildErrorChainString(err error) string {
+ if err == nil {
+ return ""
+ }
+
+ e := errors.Unwrap(err)
+ chain := fmt.Sprintf("%q", err.Error())
+ for e != nil {
+ chain += fmt.Sprintf("\n\t%q", e.Error())
+ e = errors.Unwrap(e)
+ }
+ return chain
+}
diff --git a/vendor/github.com/stretchr/testify/assert/http_assertions.go b/vendor/github.com/stretchr/testify/assert/http_assertions.go
index df46fa777..4ed341dd2 100644
--- a/vendor/github.com/stretchr/testify/assert/http_assertions.go
+++ b/vendor/github.com/stretchr/testify/assert/http_assertions.go
@@ -33,7 +33,6 @@ func HTTPSuccess(t TestingT, handler http.HandlerFunc, method, url string, value
code, err := httpCode(handler, method, url, values)
if err != nil {
Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err))
- return false
}
isSuccessCode := code >= http.StatusOK && code <= http.StatusPartialContent
@@ -56,7 +55,6 @@ func HTTPRedirect(t TestingT, handler http.HandlerFunc, method, url string, valu
code, err := httpCode(handler, method, url, values)
if err != nil {
Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err))
- return false
}
isRedirectCode := code >= http.StatusMultipleChoices && code <= http.StatusTemporaryRedirect
@@ -79,7 +77,6 @@ func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values
code, err := httpCode(handler, method, url, values)
if err != nil {
Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err))
- return false
}
isErrorCode := code >= http.StatusBadRequest
@@ -90,6 +87,28 @@ func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values
return isErrorCode
}
+// HTTPStatusCode asserts that a specified handler returns a specified status code.
+//
+// assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501)
+//
+// Returns whether the assertion was successful (true) or not (false).
+func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ code, err := httpCode(handler, method, url, values)
+ if err != nil {
+ Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err))
+ }
+
+ successful := code == statuscode
+ if !successful {
+ Fail(t, fmt.Sprintf("Expected HTTP status code %d for %q but received %d", statuscode, url+"?"+values.Encode(), code))
+ }
+
+ return successful
+}
+
// HTTPBody is a helper that returns HTTP body of the response. It returns
// empty string if building a new request fails.
func HTTPBody(handler http.HandlerFunc, method, url string, values url.Values) string {
diff --git a/vendor/github.com/stretchr/testify/mock/mock.go b/vendor/github.com/stretchr/testify/mock/mock.go
index 58e0798da..e2e6a2d23 100644
--- a/vendor/github.com/stretchr/testify/mock/mock.go
+++ b/vendor/github.com/stretchr/testify/mock/mock.go
@@ -65,6 +65,11 @@ type Call struct {
// reference. It's useful when mocking methods such as unmarshalers or
// decoders.
RunFn func(Arguments)
+
+ // PanicMsg holds msg to be used to mock panic on the function call
+ // if the PanicMsg is set to a non nil string the function call will panic
+ // irrespective of other settings
+ PanicMsg *string
}
func newCall(parent *Mock, methodName string, callerInfo []string, methodArguments ...interface{}) *Call {
@@ -77,6 +82,7 @@ func newCall(parent *Mock, methodName string, callerInfo []string, methodArgumen
Repeatability: 0,
WaitFor: nil,
RunFn: nil,
+ PanicMsg: nil,
}
}
@@ -100,6 +106,18 @@ func (c *Call) Return(returnArguments ...interface{}) *Call {
return c
}
+// Panic specifies if the functon call should fail and the panic message
+//
+// Mock.On("DoSomething").Panic("test panic")
+func (c *Call) Panic(msg string) *Call {
+ c.lock()
+ defer c.unlock()
+
+ c.PanicMsg = &msg
+
+ return c
+}
+
// Once indicates that that the mock should only return the value once.
//
// Mock.On("MyMethod", arg1, arg2).Return(returnArg1, returnArg2).Once()
@@ -150,7 +168,7 @@ func (c *Call) After(d time.Duration) *Call {
// mocking a method (such as an unmarshaler) that takes a pointer to a struct and
// sets properties in such struct
//
-// Mock.On("Unmarshal", AnythingOfType("*map[string]interface{}").Return().Run(func(args Arguments) {
+// Mock.On("Unmarshal", AnythingOfType("*map[string]interface{}")).Return().Run(func(args Arguments) {
// arg := args.Get(0).(*map[string]interface{})
// arg["foo"] = "bar"
// })
@@ -279,25 +297,52 @@ func (m *Mock) findExpectedCall(method string, arguments ...interface{}) (int, *
return -1, expectedCall
}
+type matchCandidate struct {
+ call *Call
+ mismatch string
+ diffCount int
+}
+
+func (c matchCandidate) isBetterMatchThan(other matchCandidate) bool {
+ if c.call == nil {
+ return false
+ }
+ if other.call == nil {
+ return true
+ }
+
+ if c.diffCount > other.diffCount {
+ return false
+ }
+ if c.diffCount < other.diffCount {
+ return true
+ }
+
+ if c.call.Repeatability > 0 && other.call.Repeatability <= 0 {
+ return true
+ }
+ return false
+}
+
func (m *Mock) findClosestCall(method string, arguments ...interface{}) (*Call, string) {
- var diffCount int
- var closestCall *Call
- var err string
+ var bestMatch matchCandidate
for _, call := range m.expectedCalls() {
if call.Method == method {
errInfo, tempDiffCount := call.Arguments.Diff(arguments)
- if tempDiffCount < diffCount || diffCount == 0 {
- diffCount = tempDiffCount
- closestCall = call
- err = errInfo
+ tempCandidate := matchCandidate{
+ call: call,
+ mismatch: errInfo,
+ diffCount: tempDiffCount,
+ }
+ if tempCandidate.isBetterMatchThan(bestMatch) {
+ bestMatch = tempCandidate
}
-
}
}
- return closestCall, err
+ return bestMatch.call, bestMatch.mismatch
}
func callString(method string, arguments Arguments, includeArgumentValues bool) string {
@@ -392,6 +437,13 @@ func (m *Mock) MethodCalled(methodName string, arguments ...interface{}) Argumen
time.Sleep(call.waitTime)
}
+ m.mutex.Lock()
+ panicMsg := call.PanicMsg
+ m.mutex.Unlock()
+ if panicMsg != nil {
+ panic(*panicMsg)
+ }
+
m.mutex.Lock()
runFn := call.RunFn
m.mutex.Unlock()
@@ -527,6 +579,45 @@ func (m *Mock) AssertNotCalled(t TestingT, methodName string, arguments ...inter
return true
}
+// IsMethodCallable checking that the method can be called
+// If the method was called more than `Repeatability` return false
+func (m *Mock) IsMethodCallable(t TestingT, methodName string, arguments ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ m.mutex.Lock()
+ defer m.mutex.Unlock()
+
+ for _, v := range m.ExpectedCalls {
+ if v.Method != methodName {
+ continue
+ }
+ if len(arguments) != len(v.Arguments) {
+ continue
+ }
+ if v.Repeatability < v.totalCalls {
+ continue
+ }
+ if isArgsEqual(v.Arguments, arguments) {
+ return true
+ }
+ }
+ return false
+}
+
+// isArgsEqual compares arguments
+func isArgsEqual(expected Arguments, args []interface{}) bool {
+ if len(expected) != len(args) {
+ return false
+ }
+ for i, v := range args {
+ if !reflect.DeepEqual(expected[i], v) {
+ return false
+ }
+ }
+ return true
+}
+
func (m *Mock) methodWasCalled(methodName string, expected []interface{}) bool {
for _, call := range m.calls() {
if call.Method == methodName {
@@ -791,7 +882,7 @@ func (args Arguments) String(indexOrNil ...int) string {
// normal String() method - return a string representation of the args
var argsStr []string
for _, arg := range args {
- argsStr = append(argsStr, fmt.Sprintf("%s", reflect.TypeOf(arg)))
+ argsStr = append(argsStr, fmt.Sprintf("%T", arg)) // handles nil nicely
}
return strings.Join(argsStr, ",")
} else if len(indexOrNil) == 1 {
diff --git a/vendor/github.com/ugorji/go/codec/LICENSE b/vendor/github.com/ugorji/go/codec/LICENSE
index 95a0f0541..36a8bcf10 100644
--- a/vendor/github.com/ugorji/go/codec/LICENSE
+++ b/vendor/github.com/ugorji/go/codec/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2012-2015 Ugorji Nwoke.
+Copyright (c) 2012-2020 Ugorji Nwoke.
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
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 000000000..138a5fc9c
--- /dev/null
+++ b/vendor/github.com/ugorji/go/codec/README.md
@@ -0,0 +1,283 @@
+# Package Documentation for github.com/ugorji/go/codec
+
+Package codec provides a High Performance, Feature-Rich Idiomatic Go 1.4+
+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:
+
+This package will carefully use 'package 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=codec.safe ...'.
+
+This library works with both the standard `gc` and the `gccgo` compilers.
+
+For detailed usage information, read the primer at
+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 go 1.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% safe mode supported, where 'unsafe' is not used at all.
+ - Lock-free (sans mutex) concurrency for scaling to 100's of cores
+ - In-place updates during decode, with option to zero value in maps and slices prior to decode
+ - 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 using existence of `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, supported in go 1.6+
+ - 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.
+ - Detect and error when encoding a cyclic reference (instead of stack overflow shutdown)
+ - 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:
+
+```go
+ 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.
+
+There is also seamless support provided for registering an extension (with a
+tag) but letting the encoding mechanism default to the standard way.
+
+
+## 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 there an extension registered for the type?
+ - is type a codec.Selfer?
+ - 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 and TextUnmarshaler?
+ - 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
+
+The Handle is SAFE for concurrent READ, but NOT SAFE for concurrent
+modification.
+
+The Encoder and Decoder are NOT safe for concurrent use.
+
+Consequently, the usage model is basically:
+
+ - Create and initialize the Handle before any use.
+ Once created, DO NOT modify it.
+ - Multiple Encoders or Decoders can now use the Handle concurrently.
+ They only read information off the Handle (never write).
+ - However, each Encoder or Decoder MUST not be used concurrently
+ - To re-use an Encoder/Decoder, call Reset(...) on it first.
+ This allows you use state maintained on the Encoder/Decoder.
+
+Sample usage model:
+
+```go
+ // 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 'codec.safe' to run tests or build in safe mode. e.g.
+
+```
+ go test -tags codec.safe -run Json
+ go test -tags "alltests codec.safe" -run Suite
+```
+
+## Running Benchmarks
+
+```
+ cd bench
+ go test -bench . -benchmem -benchtime 1s
+```
+
+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.
+
+## Exported Package API
+
+```go
+const CborStreamBytes byte = 0x5f ...
+const GenVersion = 25
+var SelfExt = &extFailWrapper{}
+var GoRpc goRpc
+var MsgpackSpecRpc msgpackSpecRpc
+func GenHelper() (g genHelper)
+type BasicHandle struct{ ... }
+type BincHandle struct{ ... }
+type BytesExt interface{ ... }
+type CborHandle struct{ ... }
+type DecodeOptions struct{ ... }
+type Decoder struct{ ... }
+ func NewDecoder(r io.Reader, h Handle) *Decoder
+ func NewDecoderBytes(in []byte, h Handle) *Decoder
+ func NewDecoderString(s string, h Handle) *Decoder
+type EncodeOptions struct{ ... }
+type Encoder struct{ ... }
+ func NewEncoder(w io.Writer, h Handle) *Encoder
+ func NewEncoderBytes(out *[]byte, h Handle) *Encoder
+type Ext interface{ ... }
+type Handle interface{ ... }
+type InterfaceExt interface{ ... }
+type JsonHandle struct{ ... }
+type MapBySlice interface{ ... }
+type MissingFielder interface{ ... }
+type MsgpackHandle struct{ ... }
+type MsgpackSpecRpcMultiArgs []interface{}
+type RPCOptions struct{ ... }
+type Raw []byte
+type RawExt struct{ ... }
+type Rpc interface{ ... }
+type Selfer interface{ ... }
+type SimpleHandle struct{ ... }
+type TypeInfos struct{ ... }
+ func NewTypeInfos(tags []string) *TypeInfos
+```
diff --git a/vendor/github.com/ugorji/go/codec/binc.go b/vendor/github.com/ugorji/go/codec/binc.go
index 802b32cfc..93d85cb4a 100644
--- a/vendor/github.com/ugorji/go/codec/binc.go
+++ b/vendor/github.com/ugorji/go/codec/binc.go
@@ -1,14 +1,19 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
import (
"math"
+ "reflect"
"time"
)
-const bincDoPrune = true // No longer needed. Needed before as C lib did not support pruning.
+// Symbol management:
+// - symbols are stored in a symbol map during encoding and decoding.
+// - the symbols persist until the (En|De)coder ResetXXX method is called.
+
+const bincDoPrune = true
// vd as low 4 bits (there are 16 slots)
const (
@@ -24,10 +29,10 @@ const (
bincVdTimestamp
bincVdSmallInt
- bincVdUnicodeOther
+ _ // bincVdUnicodeOther
bincVdSymbol
- bincVdDecimal
+ _ // bincVdDecimal
_ // open slot
_ // open slot
bincVdCustomExt = 0x0f
@@ -46,7 +51,7 @@ const (
)
const (
- bincFlBin16 byte = iota
+ _ byte = iota // bincFlBin16
bincFlBin32
_ // bincFlBin32e
bincFlBin64
@@ -54,58 +59,66 @@ const (
// others not currently supported
)
-func bincdesc(vd, vs byte) string {
- switch vd {
- case bincVdSpecial:
- switch vs {
- case bincSpNil:
- return "nil"
- case bincSpFalse:
- return "false"
- case bincSpTrue:
- return "true"
- case bincSpNan, bincSpPosInf, bincSpNegInf, bincSpZeroFloat:
- return "float"
- case bincSpZero:
- return "uint"
- case bincSpNegOne:
- return "int"
- default:
- return "unknown"
- }
- case bincVdSmallInt, bincVdPosInt:
- return "uint"
- case bincVdNegInt:
- return "int"
- case bincVdFloat:
- return "float"
- case bincVdSymbol:
- return "string"
- case bincVdString:
- return "string"
- case bincVdByteArray:
- return "bytes"
- case bincVdTimestamp:
- return "time"
- case bincVdCustomExt:
- return "ext"
- case bincVdArray:
- return "array"
- case bincVdMap:
- return "map"
- default:
- return "unknown"
+const bincBdNil = 0 // bincVdSpecial<<4 | bincSpNil // staticcheck barfs on this (SA4016)
+
+var (
+ bincdescSpecialVsNames = map[byte]string{
+ bincSpNil: "nil",
+ bincSpFalse: "false",
+ bincSpTrue: "true",
+ bincSpNan: "float",
+ bincSpPosInf: "float",
+ bincSpNegInf: "float",
+ bincSpZeroFloat: "float",
+ bincSpZero: "uint",
+ bincSpNegOne: "int",
}
+ bincdescVdNames = map[byte]string{
+ bincVdSpecial: "special",
+ bincVdSmallInt: "uint",
+ bincVdPosInt: "uint",
+ bincVdFloat: "float",
+ bincVdSymbol: "string",
+ bincVdString: "string",
+ bincVdByteArray: "bytes",
+ bincVdTimestamp: "time",
+ bincVdCustomExt: "ext",
+ bincVdArray: "array",
+ bincVdMap: "map",
+ }
+)
+
+func bincdescbd(bd byte) (s string) {
+ return bincdesc(bd>>4, bd&0x0f)
}
+func bincdesc(vd, vs byte) (s string) {
+ if vd == bincVdSpecial {
+ s = bincdescSpecialVsNames[vs]
+ } else {
+ s = bincdescVdNames[vd]
+ }
+ if s == "" {
+ s = "unknown"
+ }
+ return
+}
+
+type bincEncState struct {
+ m map[string]uint16 // symbols
+}
+
+func (e bincEncState) captureState() interface{} { return e.m }
+func (e *bincEncState) resetState() { e.m = nil }
+func (e *bincEncState) reset() { e.resetState() }
+func (e *bincEncState) restoreState(v interface{}) { e.m = v.(map[string]uint16) }
+
type bincEncDriver struct {
noBuiltInTypes
encDriverNoopContainerWriter
h *BincHandle
- m map[string]uint16 // symbols
- b [8]byte // scratch, used for encoding numbers - bigendian style
- s uint16 // symbols sequencer
- _ [4]uint64 // padding
+ bincEncState
+
e Encoder
}
@@ -114,7 +127,7 @@ func (e *bincEncDriver) encoder() *Encoder {
}
func (e *bincEncDriver) EncodeNil() {
- e.e.encWr.writen1(bincVdSpecial<<4 | bincSpNil)
+ e.e.encWr.writen1(bincBdNil)
}
func (e *bincEncDriver) EncodeTime(t time.Time) {
@@ -135,55 +148,74 @@ func (e *bincEncDriver) EncodeBool(b bool) {
}
}
-func (e *bincEncDriver) EncodeFloat32(f float32) {
+func (e *bincEncDriver) encSpFloat(f float64) (done bool) {
if f == 0 {
e.e.encWr.writen1(bincVdSpecial<<4 | bincSpZeroFloat)
+ } else if math.IsNaN(float64(f)) {
+ e.e.encWr.writen1(bincVdSpecial<<4 | bincSpNan)
+ } else if math.IsInf(float64(f), +1) {
+ e.e.encWr.writen1(bincVdSpecial<<4 | bincSpPosInf)
+ } else if math.IsInf(float64(f), -1) {
+ e.e.encWr.writen1(bincVdSpecial<<4 | bincSpNegInf)
+ } else {
return
}
- e.e.encWr.writen1(bincVdFloat<<4 | bincFlBin32)
- bigenHelper{e.b[:4], e.e.w()}.writeUint32(math.Float32bits(f))
+ return true
+}
+
+func (e *bincEncDriver) EncodeFloat32(f float32) {
+ if !e.encSpFloat(float64(f)) {
+ e.e.encWr.writen1(bincVdFloat<<4 | bincFlBin32)
+ bigen.writeUint32(e.e.w(), math.Float32bits(f))
+ }
}
func (e *bincEncDriver) EncodeFloat64(f float64) {
- if f == 0 {
- e.e.encWr.writen1(bincVdSpecial<<4 | bincSpZeroFloat)
+ if e.encSpFloat(f) {
return
}
- bigen.PutUint64(e.b[:8], math.Float64bits(f))
+ b := bigen.PutUint64(math.Float64bits(f))
if bincDoPrune {
i := 7
- for ; i >= 0 && (e.b[i] == 0); i-- {
+ for ; i >= 0 && (b[i] == 0); i-- {
}
i++
if i <= 6 {
e.e.encWr.writen1(bincVdFloat<<4 | 0x8 | bincFlBin64)
e.e.encWr.writen1(byte(i))
- e.e.encWr.writeb(e.b[:i])
+ e.e.encWr.writeb(b[:i])
return
}
}
e.e.encWr.writen1(bincVdFloat<<4 | bincFlBin64)
- e.e.encWr.writeb(e.b[:8])
+ e.e.encWr.writen8(b)
}
-func (e *bincEncDriver) encIntegerPrune(bd byte, pos bool, v uint64, lim uint8) {
- if lim == 4 {
- bigen.PutUint32(e.b[:lim], uint32(v))
- } else {
- bigen.PutUint64(e.b[:lim], v)
- }
+func (e *bincEncDriver) encIntegerPrune32(bd byte, pos bool, v uint64) {
+ b := bigen.PutUint32(uint32(v))
if bincDoPrune {
- i := pruneSignExt(e.b[:lim], pos)
- e.e.encWr.writen1(bd | lim - 1 - byte(i))
- e.e.encWr.writeb(e.b[i:lim])
+ i := byte(pruneSignExt(b[:], pos))
+ e.e.encWr.writen1(bd | 3 - i)
+ e.e.encWr.writeb(b[i:])
} else {
- e.e.encWr.writen1(bd | lim - 1)
- e.e.encWr.writeb(e.b[:lim])
+ e.e.encWr.writen1(bd | 3)
+ e.e.encWr.writen4(b)
+ }
+}
+
+func (e *bincEncDriver) encIntegerPrune64(bd byte, pos bool, v uint64) {
+ b := bigen.PutUint64(v)
+ if bincDoPrune {
+ i := byte(pruneSignExt(b[:], pos))
+ e.e.encWr.writen1(bd | 7 - i)
+ e.e.encWr.writeb(b[i:])
+ } else {
+ e.e.encWr.writen1(bd | 7)
+ e.e.encWr.writen8(b)
}
}
func (e *bincEncDriver) EncodeInt(v int64) {
- // const nbd byte = bincVdNegInt << 4
if v >= 0 {
e.encUint(bincVdPosInt<<4, true, uint64(v))
} else if v == -1 {
@@ -206,30 +238,35 @@ func (e *bincEncDriver) encUint(bd byte, pos bool, v uint64) {
e.e.encWr.writen2(bd|0x0, byte(v))
} else if v <= math.MaxUint16 {
e.e.encWr.writen1(bd | 0x01)
- bigenHelper{e.b[:2], e.e.w()}.writeUint16(uint16(v))
+ bigen.writeUint16(e.e.w(), uint16(v))
} else if v <= math.MaxUint32 {
- e.encIntegerPrune(bd, pos, v, 4)
+ e.encIntegerPrune32(bd, pos, v)
} else {
- e.encIntegerPrune(bd, pos, v, 8)
+ e.encIntegerPrune64(bd, pos, v)
}
}
-func (e *bincEncDriver) EncodeExt(v interface{}, xtag uint64, ext Ext) {
- var bs []byte
+func (e *bincEncDriver) EncodeExt(v interface{}, basetype reflect.Type, xtag uint64, ext Ext) {
+ var bs0, bs []byte
if ext == SelfExt {
- bs = e.e.blist.get(1024)[:0]
- e.e.sideEncode(v, &bs)
+ bs0 = e.e.blist.get(1024)
+ bs = bs0
+ e.e.sideEncode(v, basetype, &bs)
} else {
bs = ext.WriteExt(v)
}
if bs == nil {
e.EncodeNil()
- return
+ goto END
}
e.encodeExtPreamble(uint8(xtag), len(bs))
e.e.encWr.writeb(bs)
+END:
if ext == SelfExt {
e.e.blist.put(bs)
+ if !byteSliceSameData(bs0, bs) {
+ e.e.blist.put(bs0)
+ }
}
}
@@ -252,11 +289,6 @@ func (e *bincEncDriver) WriteMapStart(length int) {
}
func (e *bincEncDriver) EncodeSymbol(v string) {
- // if WriteSymbolsNoRefs {
- // e.encodeString(cUTF8, v)
- // return
- // }
-
//symbols only offer benefit when string length > 1.
//This is because strings with length 1 take only 2 bytes to store
//(bd with embedded length, and single byte for string val).
@@ -279,12 +311,11 @@ func (e *bincEncDriver) EncodeSymbol(v string) {
e.e.encWr.writen2(bincVdSymbol<<4, byte(ui))
} else {
e.e.encWr.writen1(bincVdSymbol<<4 | 0x8)
- bigenHelper{e.b[:2], e.e.w()}.writeUint16(ui)
+ bigen.writeUint16(e.e.w(), ui)
}
} else {
- e.s++
- ui = e.s
- //ui = uint16(atomic.AddUint32(&e.s, 1))
+ e.e.seq++
+ ui = e.e.seq
e.m[v] = ui
var lenprec uint8
if l <= math.MaxUint8 {
@@ -300,16 +331,16 @@ func (e *bincEncDriver) EncodeSymbol(v string) {
e.e.encWr.writen2(bincVdSymbol<<4|0x0|0x4|lenprec, byte(ui))
} else {
e.e.encWr.writen1(bincVdSymbol<<4 | 0x8 | 0x4 | lenprec)
- bigenHelper{e.b[:2], e.e.w()}.writeUint16(ui)
+ bigen.writeUint16(e.e.w(), ui)
}
if lenprec == 0 {
e.e.encWr.writen1(byte(l))
} else if lenprec == 1 {
- bigenHelper{e.b[:2], e.e.w()}.writeUint16(uint16(l))
+ bigen.writeUint16(e.e.w(), uint16(l))
} else if lenprec == 2 {
- bigenHelper{e.b[:4], e.e.w()}.writeUint32(uint32(l))
+ bigen.writeUint32(e.e.w(), uint32(l))
} else {
- bigenHelper{e.b[:8], e.e.w()}.writeUint64(uint64(l))
+ bigen.writeUint64(e.e.w(), uint64(l))
}
e.e.encWr.writestr(v)
}
@@ -317,7 +348,7 @@ func (e *bincEncDriver) EncodeSymbol(v string) {
func (e *bincEncDriver) EncodeString(v string) {
if e.h.StringToRaw {
- e.encLen(bincVdByteArray<<4, uint64(len(v))) // e.encBytesLen(c, l)
+ e.encLen(bincVdByteArray<<4, uint64(len(v)))
if len(v) > 0 {
e.e.encWr.writestr(v)
}
@@ -331,7 +362,7 @@ func (e *bincEncDriver) EncodeStringEnc(c charEncoding, v string) {
e.EncodeSymbol(v)
return
}
- e.encLen(bincVdString<<4, uint64(len(v))) // e.encBytesLen(c, l)
+ e.encLen(bincVdString<<4, uint64(len(v)))
if len(v) > 0 {
e.e.encWr.writestr(v)
}
@@ -342,14 +373,14 @@ func (e *bincEncDriver) EncodeStringBytesRaw(v []byte) {
e.EncodeNil()
return
}
- e.encLen(bincVdByteArray<<4, uint64(len(v))) // e.encBytesLen(c, l)
+ e.encLen(bincVdByteArray<<4, uint64(len(v)))
if len(v) > 0 {
e.e.encWr.writeb(v)
}
}
func (e *bincEncDriver) encBytesLen(c charEncoding, length uint64) {
- // NOTE: we currently only support UTF-8 (string) and RAW (bytearray).
+ // MARKER: we currently only support UTF-8 (string) and RAW (bytearray).
// We should consider supporting bincUnicodeOther.
if c == cRAW {
@@ -372,37 +403,42 @@ func (e *bincEncDriver) encLenNumber(bd byte, v uint64) {
e.e.encWr.writen2(bd, byte(v))
} else if v <= math.MaxUint16 {
e.e.encWr.writen1(bd | 0x01)
- bigenHelper{e.b[:2], e.e.w()}.writeUint16(uint16(v))
+ bigen.writeUint16(e.e.w(), uint16(v))
} else if v <= math.MaxUint32 {
e.e.encWr.writen1(bd | 0x02)
- bigenHelper{e.b[:4], e.e.w()}.writeUint32(uint32(v))
+ bigen.writeUint32(e.e.w(), uint32(v))
} else {
e.e.encWr.writen1(bd | 0x03)
- bigenHelper{e.b[:8], e.e.w()}.writeUint64(uint64(v))
+ bigen.writeUint64(e.e.w(), uint64(v))
}
}
//------------------------------------
-type bincDecDriver struct {
- decDriverNoopContainerReader
- noBuiltInTypes
-
- h *BincHandle
+type bincDecState struct {
bdRead bool
bd byte
vd byte
vs byte
- fnil bool
- // _ [3]byte // padding
- // linear searching on this slice is ok,
- // because we typically expect < 32 symbols in each stream.
- s map[uint16][]byte // []bincDecSymbol
+ _ bool
+ // MARKER: consider using binary search here instead of a map (ie bincDecSymbol)
+ s map[uint16][]byte
+}
- b [8]byte // scratch for decoding numbers - big endian style
- _ [4]uint64 // padding cache-aligned
+func (x bincDecState) captureState() interface{} { return x }
+func (x *bincDecState) resetState() { *x = bincDecState{} }
+func (x *bincDecState) reset() { x.resetState() }
+func (x *bincDecState) restoreState(v interface{}) { *x = v.(bincDecState) }
+type bincDecDriver struct {
+ decDriverNoopContainerReader
+ decDriverNoopNumberHelper
+ noBuiltInTypes
+
+ h *BincHandle
+
+ bincDecState
d Decoder
}
@@ -410,6 +446,10 @@ func (d *bincDecDriver) decoder() *Decoder {
return &d.d
}
+func (d *bincDecDriver) descBd() string {
+ return sprintf("%v (%s)", d.bd, bincdescbd(d.bd))
+}
+
func (d *bincDecDriver) readNextBd() {
d.bd = d.d.decRd.readn1()
d.vd = d.bd >> 4
@@ -417,30 +457,17 @@ func (d *bincDecDriver) readNextBd() {
d.bdRead = true
}
-func (d *bincDecDriver) uncacheRead() {
- if d.bdRead {
- d.d.decRd.unreadn1()
- d.bdRead = false
- }
-}
-
func (d *bincDecDriver) advanceNil() (null bool) {
- d.fnil = false
if !d.bdRead {
d.readNextBd()
}
- if d.bd == bincVdSpecial<<4|bincSpNil {
+ if d.bd == bincBdNil {
d.bdRead = false
- d.fnil = true
- null = true
+ return true // null = true
}
return
}
-func (d *bincDecDriver) Nil() bool {
- return d.fnil
-}
-
func (d *bincDecDriver) TryNil() bool {
return d.advanceNil()
}
@@ -449,11 +476,8 @@ func (d *bincDecDriver) ContainerType() (vt valueType) {
if !d.bdRead {
d.readNextBd()
}
- d.fnil = false
- // if d.vd == bincVdSpecial && d.vs == bincSpNil {
- if d.bd == bincVdSpecial<<4|bincSpNil {
+ if d.bd == bincBdNil {
d.bdRead = false
- d.fnil = true
return valueTypeNil
} else if d.vd == bincVdByteArray {
return valueTypeBytes
@@ -473,81 +497,111 @@ func (d *bincDecDriver) DecodeTime() (t time.Time) {
}
if d.vd != bincVdTimestamp {
d.d.errorf("cannot decode time - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs))
- return
}
t, err := bincDecodeTime(d.d.decRd.readx(uint(d.vs)))
- if err != nil {
- panic(err)
- }
+ halt.onerror(err)
d.bdRead = false
return
}
-func (d *bincDecDriver) decFloatPre(vs, defaultLen byte) {
- if vs&0x8 == 0 {
- d.d.decRd.readb(d.b[0:defaultLen])
- } else {
- l := d.d.decRd.readn1()
- if l > 8 {
- d.d.errorf("cannot read float - at most 8 bytes used to represent float - received %v bytes", l)
- return
- }
- for i := l; i < 8; i++ {
- d.b[i] = 0
- }
- d.d.decRd.readb(d.b[0:l])
+func (d *bincDecDriver) decFloatPruned(maxlen uint8) {
+ l := d.d.decRd.readn1()
+ if l > maxlen {
+ d.d.errorf("cannot read float - at most %v bytes used to represent float - received %v bytes", maxlen, l)
}
+ for i := l; i < maxlen; i++ {
+ d.d.b[i] = 0
+ }
+ d.d.decRd.readb(d.d.b[0:l])
}
-func (d *bincDecDriver) decFloat() (f float64) {
- //if true { f = math.Float64frombits(bigen.Uint64(d.d.decRd.readx(8))); break; }
- if x := d.vs & 0x7; x == bincFlBin32 {
- d.decFloatPre(d.vs, 4)
- f = float64(math.Float32frombits(bigen.Uint32(d.b[0:4])))
- } else if x == bincFlBin64 {
- d.decFloatPre(d.vs, 8)
- f = math.Float64frombits(bigen.Uint64(d.b[0:8]))
+func (d *bincDecDriver) decFloatPre32() (b [4]byte) {
+ if d.vs&0x8 == 0 {
+ b = d.d.decRd.readn4()
} else {
- d.d.errorf("read float - only float32 and float64 are supported - %s %x-%x/%s",
- msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs))
- return
+ d.decFloatPruned(4)
+ copy(b[:], d.d.b[:])
+ }
+ return
+}
+
+func (d *bincDecDriver) decFloatPre64() (b [8]byte) {
+ if d.vs&0x8 == 0 {
+ b = d.d.decRd.readn8()
+ } else {
+ d.decFloatPruned(8)
+ copy(b[:], d.d.b[:])
+ }
+ return
+}
+
+func (d *bincDecDriver) decFloatVal() (f float64) {
+ switch d.vs & 0x7 {
+ case bincFlBin32:
+ f = float64(math.Float32frombits(bigen.Uint32(d.decFloatPre32())))
+ case bincFlBin64:
+ f = math.Float64frombits(bigen.Uint64(d.decFloatPre64()))
+ default:
+ // ok = false
+ d.d.errorf("read float supports only float32/64 - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs))
}
return
}
func (d *bincDecDriver) decUint() (v uint64) {
- // need to inline the code (interface conversion and type assertion expensive)
switch d.vs {
case 0:
v = uint64(d.d.decRd.readn1())
case 1:
- d.d.decRd.readb(d.b[6:8])
- v = uint64(bigen.Uint16(d.b[6:8]))
+ v = uint64(bigen.Uint16(d.d.decRd.readn2()))
case 2:
- d.b[4] = 0
- d.d.decRd.readb(d.b[5:8])
- v = uint64(bigen.Uint32(d.b[4:8]))
+ v = uint64(bigen.Uint32(d.d.decRd.readn3()))
case 3:
- d.d.decRd.readb(d.b[4:8])
- v = uint64(bigen.Uint32(d.b[4:8]))
+ v = uint64(bigen.Uint32(d.d.decRd.readn4()))
case 4, 5, 6:
+ var b [8]byte
lim := 7 - d.vs
- d.d.decRd.readb(d.b[lim:8])
- for i := uint8(0); i < lim; i++ {
- d.b[i] = 0
- }
- v = uint64(bigen.Uint64(d.b[:8]))
+ bs := d.d.b[lim:8]
+ d.d.decRd.readb(bs)
+ copy(b[lim:], bs)
+ v = bigen.Uint64(b)
case 7:
- d.d.decRd.readb(d.b[:8])
- v = uint64(bigen.Uint64(d.b[:8]))
+ v = bigen.Uint64(d.d.decRd.readn8())
default:
- d.d.errorf("unsigned integers with greater than 64 bits of precision not supported")
- return
+ d.d.errorf("unsigned integers with greater than 64 bits of precision not supported: d.vs: %v %x", d.vs, d.vs)
}
return
}
-func (d *bincDecDriver) decCheckInteger() (ui uint64, neg bool) {
+func (d *bincDecDriver) uintBytes() (bs []byte) {
+ switch d.vs {
+ case 0:
+ bs = d.d.b[:1]
+ bs[0] = d.d.decRd.readn1()
+ case 1:
+ bs = d.d.b[:2]
+ d.d.decRd.readb(bs)
+ case 2:
+ bs = d.d.b[:3]
+ d.d.decRd.readb(bs)
+ case 3:
+ bs = d.d.b[:4]
+ d.d.decRd.readb(bs)
+ case 4, 5, 6:
+ lim := 7 - d.vs
+ bs = d.d.b[lim:8]
+ d.d.decRd.readb(bs)
+ case 7:
+ bs = d.d.b[:8]
+ d.d.decRd.readb(bs)
+ default:
+ d.d.errorf("unsigned integers with greater than 64 bits of precision not supported: d.vs: %v %x", d.vs, d.vs)
+ }
+ return
+}
+
+func (d *bincDecDriver) decInteger() (ui uint64, neg, ok bool) {
+ ok = true
vd, vs := d.vd, d.vs
if vd == bincVdPosInt {
ui = d.decUint()
@@ -558,18 +612,41 @@ func (d *bincDecDriver) decCheckInteger() (ui uint64, neg bool) {
ui = uint64(d.vs) + 1
} else if vd == bincVdSpecial {
if vs == bincSpZero {
- //i = 0
+ // i = 0
} else if vs == bincSpNegOne {
neg = true
ui = 1
} else {
- d.d.errorf("integer decode fails - invalid special value from descriptor %x-%x/%s",
- d.vd, d.vs, bincdesc(d.vd, d.vs))
- return
+ ok = false
+ // d.d.errorf("integer decode has invalid special value %x-%x/%s", d.vd, d.vs, bincdesc(d.vd, d.vs))
}
} else {
- d.d.errorf("integer can only be decoded from int/uint. d.bd: 0x%x, d.vd: 0x%x", d.bd, d.vd)
- return
+ ok = false
+ // d.d.errorf("integer can only be decoded from int/uint. d.bd: 0x%x, d.vd: 0x%x", d.bd, d.vd)
+ }
+ return
+}
+
+func (d *bincDecDriver) decFloat() (f float64, ok bool) {
+ ok = true
+ vd, vs := d.vd, d.vs
+ if vd == bincVdSpecial {
+ if vs == bincSpNan {
+ f = math.NaN()
+ } else if vs == bincSpPosInf {
+ f = math.Inf(1)
+ } else if vs == bincSpZeroFloat || vs == bincSpZero {
+
+ } else if vs == bincSpNegInf {
+ f = math.Inf(-1)
+ } else {
+ ok = false
+ // d.d.errorf("float - invalid special value %x-%x/%s", d.vd, d.vs, bincdesc(d.vd, d.vs))
+ }
+ } else if vd == bincVdFloat {
+ f = d.decFloatVal()
+ } else {
+ ok = false
}
return
}
@@ -578,11 +655,7 @@ func (d *bincDecDriver) DecodeInt64() (i int64) {
if d.advanceNil() {
return
}
- ui, neg := d.decCheckInteger()
- i = chkOvf.SignedIntV(ui)
- if neg {
- i = -i
- }
+ i = decNegintPosintFloatNumberHelper{&d.d}.int64(d.decInteger())
d.bdRead = false
return
}
@@ -591,11 +664,7 @@ func (d *bincDecDriver) DecodeUint64() (ui uint64) {
if d.advanceNil() {
return
}
- ui, neg := d.decCheckInteger()
- if neg {
- d.d.errorf("assigning negative signed value to unsigned integer type")
- return
- }
+ ui = decNegintPosintFloatNumberHelper{&d.d}.uint64(d.decInteger())
d.bdRead = false
return
}
@@ -604,32 +673,11 @@ func (d *bincDecDriver) DecodeFloat64() (f float64) {
if d.advanceNil() {
return
}
- vd, vs := d.vd, d.vs
- if vd == bincVdSpecial {
- d.bdRead = false
- if vs == bincSpNan {
- return math.NaN()
- } else if vs == bincSpPosInf {
- return math.Inf(1)
- } else if vs == bincSpZeroFloat || vs == bincSpZero {
- return
- } else if vs == bincSpNegInf {
- return math.Inf(-1)
- } else {
- d.d.errorf("float - invalid special value from descriptor %x-%x/%s",
- d.vd, d.vs, bincdesc(d.vd, d.vs))
- return
- }
- } else if vd == bincVdFloat {
- f = d.decFloat()
- } else {
- f = float64(d.DecodeInt64())
- }
+ f = decNegintPosintFloatNumberHelper{&d.d}.float64(d.decFloat())
d.bdRead = false
return
}
-// bool can be decoded from bool only (single byte).
func (d *bincDecDriver) DecodeBool() (b bool) {
if d.advanceNil() {
return
@@ -640,7 +688,6 @@ func (d *bincDecDriver) DecodeBool() (b bool) {
b = true
} else {
d.d.errorf("bool - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs))
- return
}
d.bdRead = false
return
@@ -648,11 +695,10 @@ func (d *bincDecDriver) DecodeBool() (b bool) {
func (d *bincDecDriver) ReadMapStart() (length int) {
if d.advanceNil() {
- return decContainerLenNil
+ return containerLenNil
}
if d.vd != bincVdMap {
d.d.errorf("map - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs))
- return
}
length = d.decLen()
d.bdRead = false
@@ -661,11 +707,10 @@ func (d *bincDecDriver) ReadMapStart() (length int) {
func (d *bincDecDriver) ReadArrayStart() (length int) {
if d.advanceNil() {
- return decContainerLenNil
+ return containerLenNil
}
if d.vd != bincVdArray {
d.d.errorf("array - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs))
- return
}
length = d.decLen()
d.bdRead = false
@@ -683,55 +728,43 @@ func (d *bincDecDriver) decLenNumber() (v uint64) {
if x := d.vs; x == 0 {
v = uint64(d.d.decRd.readn1())
} else if x == 1 {
- d.d.decRd.readb(d.b[6:8])
- v = uint64(bigen.Uint16(d.b[6:8]))
+ v = uint64(bigen.Uint16(d.d.decRd.readn2()))
} else if x == 2 {
- d.d.decRd.readb(d.b[4:8])
- v = uint64(bigen.Uint32(d.b[4:8]))
+ v = uint64(bigen.Uint32(d.d.decRd.readn4()))
} else {
- d.d.decRd.readb(d.b[:8])
- v = bigen.Uint64(d.b[:8])
+ v = bigen.Uint64(d.d.decRd.readn8())
}
return
}
-func (d *bincDecDriver) decStringBytes(bs []byte, zerocopy bool) (bs2 []byte) {
+// func (d *bincDecDriver) decStringBytes(bs []byte, zerocopy bool) (bs2 []byte) {
+func (d *bincDecDriver) DecodeStringAsBytes() (bs2 []byte) {
+ d.d.decByteState = decByteStateNone
if d.advanceNil() {
return
}
var slen = -1
- // var ok bool
switch d.vd {
case bincVdString, bincVdByteArray:
slen = d.decLen()
- if zerocopy {
- if d.d.bytes {
- bs2 = d.d.decRd.readx(uint(slen))
- } else if len(bs) == 0 {
- bs2 = decByteSlice(d.d.r(), slen, d.d.h.MaxInitLen, d.d.b[:])
- } else {
- bs2 = decByteSlice(d.d.r(), slen, d.d.h.MaxInitLen, bs)
- }
+ if d.d.bytes {
+ d.d.decByteState = decByteStateZerocopy
+ bs2 = d.d.decRd.rb.readx(uint(slen))
} else {
- bs2 = decByteSlice(d.d.r(), slen, d.d.h.MaxInitLen, bs)
+ d.d.decByteState = decByteStateReuseBuf
+ bs2 = decByteSlice(d.d.r(), slen, d.d.h.MaxInitLen, d.d.b[:])
}
case bincVdSymbol:
// zerocopy doesn't apply for symbols,
// as the values must be stored in a table for later use.
- //
- //from vs: extract numSymbolBytes, containsStringVal, strLenPrecision,
- //extract symbol
- //if containsStringVal, read it and put in map
- //else look in map for string value
var symbol uint16
vs := d.vs
if vs&0x8 == 0 {
symbol = uint16(d.d.decRd.readn1())
} else {
- symbol = uint16(bigen.Uint16(d.d.decRd.readx(2)))
+ symbol = uint16(bigen.Uint16(d.d.decRd.readn2()))
}
if d.s == nil {
- // d.s = pool4mapU16Bytes.Get().(map[uint16][]byte) // make([]bincDecSymbol, 0, 16)
d.s = make(map[uint16][]byte, 16)
}
@@ -742,43 +775,39 @@ func (d *bincDecDriver) decStringBytes(bs []byte, zerocopy bool) (bs2 []byte) {
case 0:
slen = int(d.d.decRd.readn1())
case 1:
- slen = int(bigen.Uint16(d.d.decRd.readx(2)))
+ slen = int(bigen.Uint16(d.d.decRd.readn2()))
case 2:
- slen = int(bigen.Uint32(d.d.decRd.readx(4)))
+ slen = int(bigen.Uint32(d.d.decRd.readn4()))
case 3:
- slen = int(bigen.Uint64(d.d.decRd.readx(8)))
+ slen = int(bigen.Uint64(d.d.decRd.readn8()))
}
- // since using symbols, do not store any part of
+ // As we are using symbols, do not store any part of
// the parameter bs in the map, as it might be a shared buffer.
- // bs2 = decByteSlice(d.d.r(), slen, bs)
bs2 = decByteSlice(d.d.r(), slen, d.d.h.MaxInitLen, nil)
d.s[symbol] = bs2
- // d.s = append(d.s, bincDecSymbol{i: symbol, s: s, b: bs2})
}
default:
d.d.errorf("string/bytes - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs))
- return
}
d.bdRead = false
return
}
-func (d *bincDecDriver) DecodeStringAsBytes() (s []byte) {
- return d.decStringBytes(d.d.b[:], true)
-}
-
-func (d *bincDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) {
+func (d *bincDecDriver) DecodeBytes(bs []byte) (bsOut []byte) {
+ d.d.decByteState = decByteStateNone
if d.advanceNil() {
return
}
- // check if an "array" of uint8's (see ContainerType for how to infer if an array)
if d.vd == bincVdArray {
- if zerocopy && len(bs) == 0 {
+ if bs == nil {
bs = d.d.b[:]
+ d.d.decByteState = decByteStateReuseBuf
}
- // bsOut, _ = fastpathTV.DecSliceUint8V(bs, true, d.d)
slen := d.ReadArrayStart()
- bs = usableByteSlice(bs, slen)
+ var changed bool
+ if bs, changed = usableByteSlice(bs, slen); changed {
+ d.d.decByteState = decByteStateNone
+ }
for i := 0; i < slen; i++ {
bs[i] = uint8(chkOvf.UintV(d.DecodeUint64(), 8))
}
@@ -789,59 +818,56 @@ func (d *bincDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) {
clen = d.decLen()
} else {
d.d.errorf("bytes - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs))
- return
}
d.bdRead = false
- if zerocopy {
- if d.d.bytes {
- return d.d.decRd.readx(uint(clen))
- } else if len(bs) == 0 {
- bs = d.d.b[:]
- }
+ if d.d.zerocopy() {
+ d.d.decByteState = decByteStateZerocopy
+ return d.d.decRd.rb.readx(uint(clen))
+ }
+ if bs == nil {
+ bs = d.d.b[:]
+ d.d.decByteState = decByteStateReuseBuf
}
return decByteSlice(d.d.r(), clen, d.d.h.MaxInitLen, bs)
}
-func (d *bincDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) {
+func (d *bincDecDriver) DecodeExt(rv interface{}, basetype reflect.Type, xtag uint64, ext Ext) {
if xtag > 0xff {
d.d.errorf("ext: tag must be <= 0xff; got: %v", xtag)
- return
}
if d.advanceNil() {
return
}
- realxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag))
+ xbs, realxtag1, zerocopy := d.decodeExtV(ext != nil, uint8(xtag))
realxtag := uint64(realxtag1)
if ext == nil {
re := rv.(*RawExt)
re.Tag = realxtag
- re.Data = detachZeroCopyBytes(d.d.bytes, re.Data, xbs)
+ re.setData(xbs, zerocopy)
} else if ext == SelfExt {
- d.d.sideDecode(rv, xbs)
+ d.d.sideDecode(rv, basetype, xbs)
} else {
ext.ReadExt(rv, xbs)
}
}
-func (d *bincDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []byte) {
+func (d *bincDecDriver) decodeExtV(verifyTag bool, tag byte) (xbs []byte, xtag byte, zerocopy bool) {
if d.vd == bincVdCustomExt {
l := d.decLen()
xtag = d.d.decRd.readn1()
if verifyTag && xtag != tag {
d.d.errorf("wrong extension tag - got %b, expecting: %v", xtag, tag)
- return
}
if d.d.bytes {
- xbs = d.d.decRd.readx(uint(l))
+ xbs = d.d.decRd.rb.readx(uint(l))
+ zerocopy = true
} else {
xbs = decByteSlice(d.d.r(), l, d.d.h.MaxInitLen, d.d.b[:])
}
} else if d.vd == bincVdByteArray {
- xbs = d.DecodeBytes(nil, true)
+ xbs = d.DecodeBytes(nil)
} else {
- d.d.errorf("ext - expecting extensions or byte array - %s %x-%x/%s",
- msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs))
- return
+ d.d.errorf("ext expects extensions or byte array - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs))
}
d.bdRead = false
return
@@ -852,7 +878,6 @@ func (d *bincDecDriver) DecodeNaked() {
d.readNextBd()
}
- d.fnil = false
n := d.d.naked()
var decodeFurther bool
@@ -861,7 +886,6 @@ func (d *bincDecDriver) DecodeNaked() {
switch d.vs {
case bincSpNil:
n.v = valueTypeNil
- d.fnil = true
case bincSpFalse:
n.v = valueTypeBool
n.b = false
@@ -887,8 +911,7 @@ func (d *bincDecDriver) DecodeNaked() {
n.v = valueTypeInt
n.i = int64(-1) // int8(-1)
default:
- d.d.errorf("cannot infer value - unrecognized special value from descriptor %x-%x/%s",
- d.vd, d.vs, bincdesc(d.vd, d.vs))
+ d.d.errorf("cannot infer value - unrecognized special value %x-%x/%s", d.vd, d.vs, bincdesc(d.vd, d.vs))
}
case bincVdSmallInt:
n.v = valueTypeUint
@@ -901,28 +924,26 @@ func (d *bincDecDriver) DecodeNaked() {
n.i = -(int64(d.decUint()))
case bincVdFloat:
n.v = valueTypeFloat
- n.f = d.decFloat()
- case bincVdSymbol:
- n.v = valueTypeSymbol
- n.s = string(d.DecodeStringAsBytes())
+ n.f = d.decFloatVal()
case bincVdString:
n.v = valueTypeString
- n.s = string(d.DecodeStringAsBytes())
+ n.s = d.d.stringZC(d.DecodeStringAsBytes())
case bincVdByteArray:
- decNakedReadRawBytes(d, &d.d, n, d.h.RawToString)
+ d.d.fauxUnionReadRawBytes(false)
+ case bincVdSymbol:
+ n.v = valueTypeSymbol
+ n.s = d.d.stringZC(d.DecodeStringAsBytes())
case bincVdTimestamp:
n.v = valueTypeTime
tt, err := bincDecodeTime(d.d.decRd.readx(uint(d.vs)))
- if err != nil {
- panic(err)
- }
+ halt.onerror(err)
n.t = tt
case bincVdCustomExt:
n.v = valueTypeExt
l := d.decLen()
n.u = uint64(d.d.decRd.readn1())
if d.d.bytes {
- n.l = d.d.decRd.readx(uint(l))
+ n.l = d.d.decRd.rb.readx(uint(l))
} else {
n.l = decByteSlice(d.d.r(), l, d.d.h.MaxInitLen, d.d.b[:])
}
@@ -945,6 +966,125 @@ func (d *bincDecDriver) DecodeNaked() {
}
}
+func (d *bincDecDriver) nextValueBytes(v0 []byte) (v []byte) {
+ if !d.bdRead {
+ d.readNextBd()
+ }
+ v = v0
+ var h = decNextValueBytesHelper{d: &d.d}
+ var cursor = d.d.rb.c - 1
+ h.append1(&v, d.bd)
+ v = d.nextValueBytesBdReadR(v)
+ d.bdRead = false
+ h.bytesRdV(&v, cursor)
+ return
+}
+
+func (d *bincDecDriver) nextValueBytesR(v0 []byte) (v []byte) {
+ d.readNextBd()
+ v = v0
+ var h = decNextValueBytesHelper{d: &d.d}
+ h.append1(&v, d.bd)
+ return d.nextValueBytesBdReadR(v)
+}
+
+func (d *bincDecDriver) nextValueBytesBdReadR(v0 []byte) (v []byte) {
+ v = v0
+ var h = decNextValueBytesHelper{d: &d.d}
+
+ fnLen := func(vs byte) uint {
+ switch vs {
+ case 0:
+ x := d.d.decRd.readn1()
+ h.append1(&v, x)
+ return uint(x)
+ case 1:
+ x := d.d.decRd.readn2()
+ h.appendN(&v, x[:]...)
+ return uint(bigen.Uint16(x))
+ case 2:
+ x := d.d.decRd.readn4()
+ h.appendN(&v, x[:]...)
+ return uint(bigen.Uint32(x))
+ case 3:
+ x := d.d.decRd.readn8()
+ h.appendN(&v, x[:]...)
+ return uint(bigen.Uint64(x))
+ default:
+ return uint(vs - 4)
+ }
+ }
+
+ var clen uint
+
+ switch d.vd {
+ case bincVdSpecial:
+ switch d.vs {
+ case bincSpNil, bincSpFalse, bincSpTrue, bincSpNan, bincSpPosInf: // pass
+ case bincSpNegInf, bincSpZeroFloat, bincSpZero, bincSpNegOne: // pass
+ default:
+ d.d.errorf("cannot infer value - unrecognized special value %x-%x/%s", d.vd, d.vs, bincdesc(d.vd, d.vs))
+ }
+ case bincVdSmallInt: // pass
+ case bincVdPosInt, bincVdNegInt:
+ bs := d.uintBytes()
+ h.appendN(&v, bs...)
+ case bincVdFloat:
+ fn := func(xlen byte) {
+ if d.vs&0x8 != 0 {
+ xlen = d.d.decRd.readn1()
+ h.append1(&v, xlen)
+ if xlen > 8 {
+ d.d.errorf("cannot read float - at most 8 bytes used to represent float - received %v bytes", xlen)
+ }
+ }
+ d.d.decRd.readb(d.d.b[:xlen])
+ h.appendN(&v, d.d.b[:xlen]...)
+ }
+ switch d.vs & 0x7 {
+ case bincFlBin32:
+ fn(4)
+ case bincFlBin64:
+ fn(8)
+ default:
+ d.d.errorf("read float supports only float32/64 - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs))
+ }
+ case bincVdString, bincVdByteArray:
+ clen = fnLen(d.vs)
+ h.appendN(&v, d.d.decRd.readx(clen)...)
+ case bincVdSymbol:
+ if d.vs&0x8 == 0 {
+ h.append1(&v, d.d.decRd.readn1())
+ } else {
+ h.appendN(&v, d.d.decRd.rb.readx(2)...)
+ }
+ if d.vs&0x4 != 0 {
+ clen = fnLen(d.vs & 0x3)
+ h.appendN(&v, d.d.decRd.readx(clen)...)
+ }
+ case bincVdTimestamp:
+ h.appendN(&v, d.d.decRd.readx(uint(d.vs))...)
+ case bincVdCustomExt:
+ clen = fnLen(d.vs)
+ h.append1(&v, d.d.decRd.readn1()) // tag
+ h.appendN(&v, d.d.decRd.readx(clen)...)
+ case bincVdArray:
+ clen = fnLen(d.vs)
+ for i := uint(0); i < clen; i++ {
+ v = d.nextValueBytesR(v)
+ }
+ case bincVdMap:
+ clen = fnLen(d.vs)
+ for i := uint(0); i < clen; i++ {
+ v = d.nextValueBytesR(v)
+ v = d.nextValueBytesR(v)
+ }
+ default:
+ d.d.errorf("cannot infer value - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs))
+ }
+ return
+}
+
//------------------------------------
//BincHandle is a Handle for the Binc Schema-Free Encoding Format
@@ -984,12 +1124,14 @@ type BincHandle struct {
// - n: none
// - a: all: same as m, s, ...
- _ [7]uint64 // padding (cache-aligned)
+ // _ [7]uint64 // padding (cache-aligned)
}
// Name returns the name of the handle: binc
func (h *BincHandle) Name() string { return "binc" }
+func (h *BincHandle) desc(bd byte) string { return bincdesc(bd>>4, bd&0x0f) }
+
func (h *BincHandle) newEncDriver() encDriver {
var e = &bincEncDriver{h: h}
e.e.e = e
@@ -1006,33 +1148,6 @@ func (h *BincHandle) newDecDriver() decDriver {
return d
}
-func (e *bincEncDriver) reset() {
- e.s = 0
- e.m = nil
-}
-
-func (e *bincEncDriver) atEndOfEncode() {
- if e.m != nil {
- for k := range e.m {
- delete(e.m, k)
- }
- }
-}
-
-func (d *bincDecDriver) reset() {
- d.s = nil
- d.bd, d.bdRead, d.vd, d.vs = 0, false, 0, 0
- d.fnil = false
-}
-
-func (d *bincDecDriver) atEndOfDecode() {
- if d.s != nil {
- for k := range d.s {
- delete(d.s, k)
- }
- }
-}
-
// var timeDigits = [...]byte{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
// EncodeTime encodes a time.Time as a []byte, including
@@ -1088,10 +1203,9 @@ func bincEncodeTime(t time.Time) []byte {
// t := rv2i(rv).(time.Time)
tsecs, tnsecs := t.Unix(), t.Nanosecond()
var (
- bd byte
- btmp [8]byte
- bs [16]byte
- i int = 1
+ bd byte
+ bs [16]byte
+ i int = 1
)
l := t.Location()
if l == time.UTC {
@@ -1099,7 +1213,7 @@ func bincEncodeTime(t time.Time) []byte {
}
if tsecs != 0 {
bd = bd | 0x80
- bigen.PutUint64(btmp[:], uint64(tsecs))
+ btmp := bigen.PutUint64(uint64(tsecs))
f := pruneSignExt(btmp[:], tsecs >= 0)
bd = bd | (byte(7-f) << 2)
copy(bs[i:], btmp[f:])
@@ -1107,7 +1221,7 @@ func bincEncodeTime(t time.Time) []byte {
}
if tnsecs != 0 {
bd = bd | 0x40
- bigen.PutUint32(btmp[:4], uint32(tnsecs))
+ btmp := bigen.PutUint32(uint32(tnsecs))
f := pruneSignExt(btmp[:4], true)
bd = bd | byte(3-f)
copy(bs[i:], btmp[f:4])
@@ -1120,7 +1234,7 @@ func bincEncodeTime(t time.Time) []byte {
// zoneName, zoneOffset := t.Zone()
zoneOffset /= 60
z := uint16(zoneOffset)
- bigen.PutUint16(btmp[:2], z)
+ btmp := bigen.PutUint16(z)
// clear dst flags
bs[i] = btmp[0] & 0x3f
bs[i+1] = btmp[1]
@@ -1149,10 +1263,9 @@ func bincDecodeTime(bs []byte) (tt time.Time, err error) {
// if first bit of bs[i] is set, then fill btmp[0..8-n] with 0xff (ie sign extend it)
if bs[i]&(1<<7) != 0 {
copy(btmp[0:8-n], bsAll0xff)
- // for j,k := byte(0), 8-n; j < k; j++ { btmp[j] = 0xff }
}
i = i2
- tsec = int64(bigen.Uint64(btmp[:]))
+ tsec = int64(bigen.Uint64(btmp))
}
if bd&(1<<6) != 0 {
var btmp [4]byte
@@ -1160,7 +1273,7 @@ func bincDecodeTime(bs []byte) (tt time.Time, err error) {
i2 = i + n
copy(btmp[4-n:], bs[i:i2])
i = i2
- tnsec = bigen.Uint32(btmp[:])
+ tnsec = bigen.Uint32(btmp)
}
if bd&(1<<5) == 0 {
tt = time.Unix(tsec, int64(tnsec)).UTC()
@@ -1171,9 +1284,7 @@ func bincDecodeTime(bs []byte) (tt time.Time, err error) {
// Zone name is in form: UTC-08:00.
// Note that Go Libs do not give access to dst flag, so we ignore dst bits
- i2 = i + 2
- tz = bigen.Uint16(bs[i:i2])
- // i = i2
+ tz = bigen.Uint16([2]byte{bs[i], bs[i+1]})
// sign extend sign bit into top 2 MSB (which were dst bits):
if tz&(1<<13) == 0 { // positive
tz = tz & 0x3fff //clear 2 MSBs: dst bits
@@ -1193,27 +1304,5 @@ func bincDecodeTime(bs []byte) (tt time.Time, err error) {
return
}
-// func timeLocUTCName(tzint int16) string {
-// if tzint == 0 {
-// return "UTC"
-// }
-// var tzname = []byte("UTC+00:00")
-// //tzname := fmt.Sprintf("UTC%s%02d:%02d", tzsign, tz/60, tz%60) //perf issue using Sprintf.. inline below.
-// //tzhr, tzmin := tz/60, tz%60 //faster if u convert to int first
-// var tzhr, tzmin int16
-// if tzint < 0 {
-// tzname[3] = '-'
-// tzhr, tzmin = -tzint/60, (-tzint)%60
-// } else {
-// tzhr, tzmin = tzint/60, tzint%60
-// }
-// tzname[4] = timeDigits[tzhr/10]
-// tzname[5] = timeDigits[tzhr%10]
-// tzname[7] = timeDigits[tzmin/10]
-// tzname[8] = timeDigits[tzmin%10]
-// return string(tzname)
-// //return time.FixedZone(string(tzname), int(tzint)*60)
-// }
-
var _ decDriver = (*bincDecDriver)(nil)
var _ encDriver = (*bincEncDriver)(nil)
diff --git a/vendor/github.com/ugorji/go/codec/build.sh b/vendor/github.com/ugorji/go/codec/build.sh
index a71227fb2..c7704f758 100644
--- a/vendor/github.com/ugorji/go/codec/build.sh
+++ b/vendor/github.com/ugorji/go/codec/build.sh
@@ -5,24 +5,56 @@
_tests() {
local vet="" # TODO: make it off
- local gover=$( go version | cut -f 3 -d ' ' )
- # note that codecgen requires fastpath, so you cannot do "codecgen notfastpath"
- local a=( "" "safe" "notfastpath" "notfastpath safe" "codecgen" "codecgen safe" )
+ local gover=$( ${gocmd} version | cut -f 3 -d ' ' )
+ [[ $( ${gocmd} version ) == *"gccgo"* ]] && zcover=0
+ [[ $( ${gocmd} version ) == *"gollvm"* ]] && zcover=0
+ case $gover in
+ go1.[7-9]*|go1.1[0-9]*|go2.*|devel*) true ;;
+ *) return 1
+ esac
+ # note that codecgen requires fastpath, so you cannot do "codecgen codec.notfastpath"
+ # we test the following permutations wnich all execute different code paths as below.
+ echo "TestCodecSuite: (fastpath/unsafe), (!fastpath/unsafe), (fastpath/!unsafe), (!fastpath/!unsafe), (codecgen/unsafe)"
+ local echo=1
+ local nc=2 # count
+ local cpus="1,$(nproc)"
+ # if using the race detector, then set nc to
+ if [[ " ${zargs[@]} " =~ "-race" ]]; then
+ cpus="$(nproc)"
+ fi
+ local a=( "" "codec.notfastpath" "codec.safe" "codec.notfastpath codec.safe" "codecgen" )
+ local b=()
+ local c=()
for i in "${a[@]}"
do
- echo ">>>> TAGS: $i"
local i2=${i:-default}
- case $gover in
- go1.[0-6]*) go test ${zargs[*]} -tags "$i" "$@" ;;
- *) go vet -printfuncs "errorf" "$@" &&
- go test ${zargs[*]} -vet "$vet" -tags "alltests $i" -run "Suite" -coverprofile "${i2// /-}.cov.out" "$@" ;;
- esac
- if [[ "$?" != 0 ]]; then return 1; fi
+ [[ "$zwait" == "1" ]] && echo ">>>> TAGS: 'alltests $i'; RUN: 'TestCodecSuite'"
+ [[ "$zcover" == "1" ]] && c=( -coverprofile "${i2// /-}.cov.out" )
+ true &&
+ ${gocmd} vet -printfuncs "errorf" "$@" &&
+ if [[ "$echo" == 1 ]]; then set -o xtrace; fi &&
+ ${gocmd} test ${zargs[*]} ${ztestargs[*]} -vet "$vet" -tags "alltests $i" -count $nc -cpu $cpus -run "TestCodecSuite" "${c[@]}" "$@" &
+ if [[ "$echo" == 1 ]]; then set +o xtrace; fi
+ b+=("${i2// /-}.cov.out")
+ [[ "$zwait" == "1" ]] && wait
+
+ # if [[ "$?" != 0 ]]; then return 1; fi
done
- echo "++++++++ TEST SUITES ALL PASSED ++++++++"
+ if [[ "$zextra" == "1" ]]; then
+ [[ "$zwait" == "1" ]] && echo ">>>> TAGS: 'codec.notfastpath x'; RUN: 'Test.*X$'"
+ [[ "$zcover" == "1" ]] && c=( -coverprofile "x.cov.out" )
+ ${gocmd} test ${zargs[*]} ${ztestargs[*]} -vet "$vet" -tags "codec.notfastpath x" -count $nc -run 'Test.*X$' "${c[@]}" &
+ b+=("x.cov.out")
+ [[ "$zwait" == "1" ]] && wait
+ fi
+ wait
+ # go tool cover is not supported for gccgo, gollvm, other non-standard go compilers
+ [[ "$zcover" == "1" ]] &&
+ command -v gocovmerge &&
+ gocovmerge "${b[@]}" > __merge.cov.out &&
+ ${gocmd} tool cover -html=__merge.cov.out
}
-
# is a generation needed?
_ng() {
local a="$1"
@@ -59,7 +91,7 @@ _build() {
cat > gen.generated.go < gen-from-tmpl.codec.generated.go < gen-from-tmpl.generated.go < gen-from-tmpl.sort-slice-stubs.generated.go < " + fnameOut + " ______")
-fin, err := os.Open(fnameIn)
-if err != nil { panic(err) }
-defer fin.Close()
-fout, err := os.Create(fnameOut)
-if err != nil { panic(err) }
-defer fout.Close()
-err = codec.GenInternalGoFile(fin, fout)
-if err != nil { panic(err) }
-}
+import "reflect"
+import "time"
-func main() {
-run("fast-path.go.tmpl", "fast-path.generated.go")
-run("gen-helper.go.tmpl", "gen-helper.generated.go")
-run("mammoth-test.go.tmpl", "mammoth_generated_test.go")
-run("mammoth2-test.go.tmpl", "mammoth2_generated_test.go")
-// run("sort-slice.go.tmpl", "sort-slice.generated.go")
-}
EOF
+ for i in string bool uint64 int64 float64 bytes time; do
+ local i2=$i
+ case $i in
+ 'time' ) i2="time.Time";;
+ 'bytes' ) i2="[]byte";;
+ esac
+
+ cat >> gen-from-tmpl.sort-slice-stubs.generated.go < bench/shared_test.go
# explicitly return 0 if this passes, else return 1
- go run -tags "prebuild" prebuild.go || return 1
- go run -tags "notfastpath safe codecgen.exec" gen-from-tmpl.generated.go || return 1
+ local btags="codec.notfastpath codec.safe codecgen.exec"
+ rm -f sort-slice.generated.go fast-path.generated.go gen-helper.generated.go mammoth_generated_test.go mammoth2_generated_test.go
+
+ cat > gen-from-tmpl.sort-slice.generated.go < gen-from-tmpl.generated.go < [tests, make, prebuild (force) (external), inlining diagnostics, mid-stack inlining, race detector]
- -v -> verbose
+ -[tesow m n l d] -> [t=tests (e=extra, s=short, o=cover, w=wait), m=make, n=inlining diagnostics, l=mid-stack inlining, d=race detector]
+ -v -> v=verbose
EOF
if [[ "$(type -t _usage_run)" = "function" ]]; then _usage_run ; fi
}
_main() {
if [[ -z "$1" ]]; then _usage; return 1; fi
- local x
- local zforce
+ local x # determines the main action to run in this build
+ local zforce # force
+ local zcover # generate cover profile and show in browser when done
+ local zwait # run tests in sequence, not parallel ie wait for one to finish before starting another
+ local zextra # means run extra (python based tests, etc) during testing
+
+ local ztestargs=()
local zargs=()
local zverbose=()
local zbenchflags=""
+
+ local gocmd=${MYGOCMD:-go}
+
OPTIND=1
- while getopts ":ctmnrgpfvlyzdb:" flag
+ while getopts ":cetmnrgpfvldsowkxyzb:" flag
do
case "x$flag" in
+ 'xo') zcover=1 ;;
+ 'xe') zextra=1 ;;
+ 'xw') zwait=1 ;;
'xf') zforce=1 ;;
+ 'xs') ztestargs+=("-short") ;;
'xv') zverbose+=(1) ;;
'xl') zargs+=("-gcflags"); zargs+=("-l=4") ;;
'xn') zargs+=("-gcflags"); zargs+=("-m=2") ;;
@@ -261,8 +355,10 @@ _main() {
'xg') _go ;;
'xp') _prebuild "$@" ;;
'xc') _clean "$@" ;;
- 'xy') _analyze_extra "$@" ;;
- 'xz') _analyze "$@" ;;
+ 'xx') _analyze_checks "$@" ;;
+ 'xy') _analyze_debug_types "$@" ;;
+ 'xz') _analyze_do_inlining_and_more "$@" ;;
+ 'xk') _go_compiler_validation_suite ;;
'xb') _bench "$@" ;;
esac
# unset zforce zargs zbenchflags
diff --git a/vendor/github.com/ugorji/go/codec/cbor.go b/vendor/github.com/ugorji/go/codec/cbor.go
index d84fbb226..0be358ec4 100644
--- a/vendor/github.com/ugorji/go/codec/cbor.go
+++ b/vendor/github.com/ugorji/go/codec/cbor.go
@@ -1,10 +1,11 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
import (
"math"
+ "reflect"
"time"
)
@@ -69,55 +70,58 @@ const (
// cborSelfDesrTag3 byte = 0xf7
// )
-func cbordesc(bd byte) string {
- switch bd >> 5 {
- case cborMajorUint:
- return "(u)int"
- case cborMajorNegInt:
- return "int"
- case cborMajorBytes:
- return "bytes"
- case cborMajorString:
- return "string"
- case cborMajorArray:
- return "array"
- case cborMajorMap:
- return "map"
- case cborMajorTag:
- return "tag"
- case cborMajorSimpleOrFloat: // default
- switch bd {
- case cborBdNil:
- return "nil"
- case cborBdFalse:
- return "false"
- case cborBdTrue:
- return "true"
- case cborBdFloat16, cborBdFloat32, cborBdFloat64:
- return "float"
- case cborBdIndefiniteBytes:
- return "bytes*"
- case cborBdIndefiniteString:
- return "string*"
- case cborBdIndefiniteArray:
- return "array*"
- case cborBdIndefiniteMap:
- return "map*"
- default:
- return "unknown(simple)"
+var (
+ cbordescSimpleNames = map[byte]string{
+ cborBdNil: "nil",
+ cborBdFalse: "false",
+ cborBdTrue: "true",
+ cborBdFloat16: "float",
+ cborBdFloat32: "float",
+ cborBdFloat64: "float",
+ cborBdBreak: "break",
+ }
+ cbordescIndefNames = map[byte]string{
+ cborBdIndefiniteBytes: "bytes*",
+ cborBdIndefiniteString: "string*",
+ cborBdIndefiniteArray: "array*",
+ cborBdIndefiniteMap: "map*",
+ }
+ cbordescMajorNames = map[byte]string{
+ cborMajorUint: "(u)int",
+ cborMajorNegInt: "int",
+ cborMajorBytes: "bytes",
+ cborMajorString: "string",
+ cborMajorArray: "array",
+ cborMajorMap: "map",
+ cborMajorTag: "tag",
+ cborMajorSimpleOrFloat: "simple",
+ }
+)
+
+func cbordesc(bd byte) (s string) {
+ bm := bd >> 5
+ if bm == cborMajorSimpleOrFloat {
+ s = cbordescSimpleNames[bd]
+ } else {
+ s = cbordescMajorNames[bm]
+ if s == "" {
+ s = cbordescIndefNames[bd]
}
}
- return "unknown"
+ if s == "" {
+ s = "unknown"
+ }
+ return
}
// -------------------
type cborEncDriver struct {
noBuiltInTypes
+ encDriverNoState
encDriverNoopContainerWriter
h *CborHandle
- x [8]byte
- _ [6]uint64 // padding
+
e Encoder
}
@@ -138,13 +142,27 @@ func (e *cborEncDriver) EncodeBool(b bool) {
}
func (e *cborEncDriver) EncodeFloat32(f float32) {
+ b := math.Float32bits(f)
+ if e.h.OptimumSize {
+ if h := floatToHalfFloatBits(b); halfFloatToFloatBits(h) == b {
+ e.e.encWr.writen1(cborBdFloat16)
+ bigen.writeUint16(e.e.w(), h)
+ return
+ }
+ }
e.e.encWr.writen1(cborBdFloat32)
- bigenHelper{e.x[:4], e.e.w()}.writeUint32(math.Float32bits(f))
+ bigen.writeUint32(e.e.w(), b)
}
func (e *cborEncDriver) EncodeFloat64(f float64) {
+ if e.h.OptimumSize {
+ if f32 := float32(f); float64(f32) == f {
+ e.EncodeFloat32(f32)
+ return
+ }
+ }
e.e.encWr.writen1(cborBdFloat64)
- bigenHelper{e.x[:8], e.e.w()}.writeUint64(math.Float64bits(f))
+ bigen.writeUint64(e.e.w(), math.Float64bits(f))
}
func (e *cborEncDriver) encUint(v uint64, bd byte) {
@@ -154,13 +172,13 @@ func (e *cborEncDriver) encUint(v uint64, bd byte) {
e.e.encWr.writen2(bd+0x18, uint8(v))
} else if v <= math.MaxUint16 {
e.e.encWr.writen1(bd + 0x19)
- bigenHelper{e.x[:2], e.e.w()}.writeUint16(uint16(v))
+ bigen.writeUint16(e.e.w(), uint16(v))
} else if v <= math.MaxUint32 {
e.e.encWr.writen1(bd + 0x1a)
- bigenHelper{e.x[:4], e.e.w()}.writeUint32(uint32(v))
+ bigen.writeUint32(e.e.w(), uint32(v))
} else { // if v <= math.MaxUint64 {
e.e.encWr.writen1(bd + 0x1b)
- bigenHelper{e.x[:8], e.e.w()}.writeUint64(v)
+ bigen.writeUint64(e.e.w(), v)
}
}
@@ -198,11 +216,10 @@ func (e *cborEncDriver) EncodeTime(t time.Time) {
}
}
-func (e *cborEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext) {
+func (e *cborEncDriver) EncodeExt(rv interface{}, basetype reflect.Type, xtag uint64, ext Ext) {
e.encUint(uint64(xtag), cborBaseTag)
if ext == SelfExt {
- rv2 := baseRV(rv)
- e.e.encodeValue(rv2, e.h.fnNoExt(rv2.Type()))
+ e.e.encodeValue(baseRV(rv), e.h.fnNoExt(basetype))
} else if v := ext.ConvertExt(rv); v == nil {
e.EncodeNil()
} else {
@@ -249,11 +266,11 @@ func (e *cborEncDriver) WriteArrayEnd() {
}
func (e *cborEncDriver) EncodeString(v string) {
+ bb := cborBaseString
if e.h.StringToRaw {
- e.EncodeStringBytesRaw(bytesView(v))
- return
+ bb = cborBaseBytes
}
- e.encStringBytesS(cborBaseString, v)
+ e.encStringBytesS(bb, v)
}
func (e *cborEncDriver) EncodeStringBytesRaw(v []byte) {
@@ -301,13 +318,12 @@ func (e *cborEncDriver) encStringBytesS(bb byte, v string) {
type cborDecDriver struct {
decDriverNoopContainerReader
- h *CborHandle
- bdRead bool
- bd byte
- st bool // skip tags
- fnil bool // found nil
+ decDriverNoopNumberHelper
+ h *CborHandle
+ bdAndBdread
+ st bool // skip tags
+ _ bool // found nil
noBuiltInTypes
- _ [6]uint64 // padding cache-aligned
d Decoder
}
@@ -315,24 +331,30 @@ func (d *cborDecDriver) decoder() *Decoder {
return &d.d
}
+func (d *cborDecDriver) descBd() string {
+ return sprintf("%v (%s)", d.bd, cbordesc(d.bd))
+}
+
func (d *cborDecDriver) readNextBd() {
d.bd = d.d.decRd.readn1()
d.bdRead = true
}
func (d *cborDecDriver) advanceNil() (null bool) {
- d.fnil = false
if !d.bdRead {
d.readNextBd()
}
if d.bd == cborBdNil || d.bd == cborBdUndefined {
d.bdRead = false
- d.fnil = true
- null = true
+ return true // null = true
}
return
}
+func (d *cborDecDriver) TryNil() bool {
+ return d.advanceNil()
+}
+
// skipTags is called to skip any tags in the stream.
//
// Since any value can be tagged, then we should call skipTags
@@ -347,15 +369,7 @@ func (d *cborDecDriver) skipTags() {
}
}
-func (d *cborDecDriver) uncacheRead() {
- if d.bdRead {
- d.d.decRd.unreadn1()
- d.bdRead = false
- }
-}
-
func (d *cborDecDriver) ContainerType() (vt valueType) {
- d.fnil = false
if !d.bdRead {
d.readNextBd()
}
@@ -364,28 +378,21 @@ func (d *cborDecDriver) ContainerType() (vt valueType) {
}
if d.bd == cborBdNil {
d.bdRead = false // always consume nil after seeing it in container type
- d.fnil = true
return valueTypeNil
- } else if d.bd == cborBdIndefiniteBytes || (d.bd>>5 == cborMajorBytes) {
+ }
+ major := d.bd >> 5
+ if major == cborMajorBytes {
return valueTypeBytes
- } else if d.bd == cborBdIndefiniteString || (d.bd>>5 == cborMajorString) {
+ } else if major == cborMajorString {
return valueTypeString
- } else if d.bd == cborBdIndefiniteArray || (d.bd>>5 == cborMajorArray) {
+ } else if major == cborMajorArray {
return valueTypeArray
- } else if d.bd == cborBdIndefiniteMap || (d.bd>>5 == cborMajorMap) {
+ } else if major == cborMajorMap {
return valueTypeMap
}
return valueTypeUnset
}
-func (d *cborDecDriver) Nil() bool {
- return d.fnil
-}
-
-func (d *cborDecDriver) TryNil() bool {
- return d.advanceNil()
-}
-
func (d *cborDecDriver) CheckBreak() (v bool) {
if !d.bdRead {
d.readNextBd()
@@ -401,44 +408,16 @@ func (d *cborDecDriver) decUint() (ui uint64) {
v := d.bd & 0x1f
if v <= 0x17 {
ui = uint64(v)
+ } else if v == 0x18 {
+ ui = uint64(d.d.decRd.readn1())
+ } else if v == 0x19 {
+ ui = uint64(bigen.Uint16(d.d.decRd.readn2()))
+ } else if v == 0x1a {
+ ui = uint64(bigen.Uint32(d.d.decRd.readn4()))
+ } else if v == 0x1b {
+ ui = uint64(bigen.Uint64(d.d.decRd.readn8()))
} else {
- if v == 0x18 {
- ui = uint64(d.d.decRd.readn1())
- } else if v == 0x19 {
- ui = uint64(bigen.Uint16(d.d.decRd.readx(2)))
- } else if v == 0x1a {
- ui = uint64(bigen.Uint32(d.d.decRd.readx(4)))
- } else if v == 0x1b {
- ui = uint64(bigen.Uint64(d.d.decRd.readx(8)))
- } else {
- d.d.errorf("invalid descriptor decoding uint: %x/%s", d.bd, cbordesc(d.bd))
- return
- }
- }
- return
-}
-
-func (d *cborDecDriver) decCheckInteger() (neg bool) {
- if d.st {
- d.skipTags()
- }
- major := d.bd >> 5
- if major == cborMajorUint {
- } else if major == cborMajorNegInt {
- neg = true
- } else {
- d.d.errorf("invalid integer; got major %v from descriptor %x/%s, expected %v or %v",
- major, d.bd, cbordesc(d.bd), cborMajorUint, cborMajorNegInt)
- }
- return
-}
-
-func cborDecInt64(ui uint64, neg bool) (i int64) {
- // check if this number can be converted to an int without overflow
- if neg {
- i = -(chkOvf.SignedIntV(ui + 1))
- } else {
- i = chkOvf.SignedIntV(ui)
+ d.d.errorf("invalid descriptor decoding uint: %x/%s", d.bd, cbordesc(d.bd))
}
return
}
@@ -451,8 +430,8 @@ func (d *cborDecDriver) decAppendIndefiniteBytes(bs []byte) []byte {
d.bdRead = false
for !d.CheckBreak() {
if major := d.bd >> 5; major != cborMajorBytes && major != cborMajorString {
- d.d.errorf("invalid indefinite string/bytes; got major %v, expected %x/%s",
- major, d.bd, cbordesc(d.bd))
+ d.d.errorf("invalid indefinite string/bytes %x (%s); got major %v, expected %v or %v",
+ d.bd, cbordesc(d.bd), major, cborMajorBytes, cborMajorString)
}
n := uint(d.decLen())
oldLen := uint(len(bs))
@@ -465,31 +444,61 @@ func (d *cborDecDriver) decAppendIndefiniteBytes(bs []byte) []byte {
bs = bs[:newLen]
}
d.d.decRd.readb(bs[oldLen:newLen])
- // bs = append(bs, d.d.decRd.readn()...)
d.bdRead = false
}
d.bdRead = false
return bs
}
+func (d *cborDecDriver) decFloat() (f float64, ok bool) {
+ ok = true
+ switch d.bd {
+ case cborBdFloat16:
+ f = float64(math.Float32frombits(halfFloatToFloatBits(bigen.Uint16(d.d.decRd.readn2()))))
+ case cborBdFloat32:
+ f = float64(math.Float32frombits(bigen.Uint32(d.d.decRd.readn4())))
+ case cborBdFloat64:
+ f = math.Float64frombits(bigen.Uint64(d.d.decRd.readn8()))
+ default:
+ ok = false
+ }
+ return
+}
+
+func (d *cborDecDriver) decInteger() (ui uint64, neg, ok bool) {
+ ok = true
+ switch d.bd >> 5 {
+ case cborMajorUint:
+ ui = d.decUint()
+ case cborMajorNegInt:
+ ui = d.decUint()
+ neg = true
+ default:
+ ok = false
+ }
+ return
+}
+
func (d *cborDecDriver) DecodeInt64() (i int64) {
if d.advanceNil() {
return
}
- neg := d.decCheckInteger()
- ui := d.decUint()
+ if d.st {
+ d.skipTags()
+ }
+ i = decNegintPosintFloatNumberHelper{&d.d}.int64(d.decInteger())
d.bdRead = false
- return cborDecInt64(ui, neg)
+ return
}
func (d *cborDecDriver) DecodeUint64() (ui uint64) {
if d.advanceNil() {
return
}
- if d.decCheckInteger() {
- d.d.errorf("cannot assign negative signed value to unsigned type")
+ if d.st {
+ d.skipTags()
}
- ui = d.decUint()
+ ui = decNegintPosintFloatNumberHelper{&d.d}.uint64(d.decInteger())
d.bdRead = false
return
}
@@ -501,24 +510,7 @@ func (d *cborDecDriver) DecodeFloat64() (f float64) {
if d.st {
d.skipTags()
}
- switch d.bd {
- case cborBdFloat16:
- f = float64(math.Float32frombits(halfFloatToFloatBits(bigen.Uint16(d.d.decRd.readx(2)))))
- case cborBdFloat32:
- f = float64(math.Float32frombits(bigen.Uint32(d.d.decRd.readx(4))))
- case cborBdFloat64:
- f = math.Float64frombits(bigen.Uint64(d.d.decRd.readx(8)))
- default:
- major := d.bd >> 5
- if major == cborMajorUint {
- f = float64(cborDecInt64(d.decUint(), false))
- } else if major == cborMajorNegInt {
- f = float64(cborDecInt64(d.decUint(), true))
- } else {
- d.d.errorf("invalid float descriptor; got %d/%s, expected float16/32/64 or (-)int",
- d.bd, cbordesc(d.bd))
- }
- }
+ f = decNegintPosintFloatNumberHelper{&d.d}.float64(d.decFloat())
d.bdRead = false
return
}
@@ -536,7 +528,6 @@ func (d *cborDecDriver) DecodeBool() (b bool) {
} else if d.bd == cborBdFalse {
} else {
d.d.errorf("not bool - %s %x/%s", msgBadDesc, d.bd, cbordesc(d.bd))
- return
}
d.bdRead = false
return
@@ -544,41 +535,40 @@ func (d *cborDecDriver) DecodeBool() (b bool) {
func (d *cborDecDriver) ReadMapStart() (length int) {
if d.advanceNil() {
- return decContainerLenNil
+ return containerLenNil
}
if d.st {
d.skipTags()
}
d.bdRead = false
if d.bd == cborBdIndefiniteMap {
- return decContainerLenUnknown
+ return containerLenUnknown
}
if d.bd>>5 != cborMajorMap {
- d.d.errorf("error reading map; got major type: %x, expected %x/%s",
- d.bd>>5, cborMajorMap, cbordesc(d.bd))
+ d.d.errorf("error reading map; got major type: %x, expected %x/%s", d.bd>>5, cborMajorMap, cbordesc(d.bd))
}
return d.decLen()
}
func (d *cborDecDriver) ReadArrayStart() (length int) {
if d.advanceNil() {
- return decContainerLenNil
+ return containerLenNil
}
if d.st {
d.skipTags()
}
d.bdRead = false
if d.bd == cborBdIndefiniteArray {
- return decContainerLenUnknown
+ return containerLenUnknown
}
if d.bd>>5 != cborMajorArray {
- d.d.errorf("invalid array; got major type: %x, expect: %x/%s",
- d.bd>>5, cborMajorArray, cbordesc(d.bd))
+ d.d.errorf("invalid array; got major type: %x, expect: %x/%s", d.bd>>5, cborMajorArray, cbordesc(d.bd))
}
return d.decLen()
}
-func (d *cborDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) {
+func (d *cborDecDriver) DecodeBytes(bs []byte) (bsOut []byte) {
+ d.d.decByteState = decByteStateNone
if d.advanceNil() {
return
}
@@ -588,20 +578,16 @@ func (d *cborDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) {
if d.bd == cborBdIndefiniteBytes || d.bd == cborBdIndefiniteString {
d.bdRead = false
if bs == nil {
- if zerocopy {
- return d.decAppendIndefiniteBytes(d.d.b[:0])
- }
- return d.decAppendIndefiniteBytes(zeroByteSlice)
+ d.d.decByteState = decByteStateReuseBuf
+ return d.decAppendIndefiniteBytes(d.d.b[:0])
}
return d.decAppendIndefiniteBytes(bs[:0])
}
if d.bd == cborBdIndefiniteArray {
d.bdRead = false
- if zerocopy && len(bs) == 0 {
- bs = d.d.b[:]
- }
if bs == nil {
- bs = []byte{}
+ d.d.decByteState = decByteStateReuseBuf
+ bs = d.d.b[:0]
} else {
bs = bs[:0]
}
@@ -612,11 +598,15 @@ func (d *cborDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) {
}
if d.bd>>5 == cborMajorArray {
d.bdRead = false
- if zerocopy && len(bs) == 0 {
+ if bs == nil {
+ d.d.decByteState = decByteStateReuseBuf
bs = d.d.b[:]
}
slen := d.decLen()
- bs = usableByteSlice(bs, slen)
+ var changed bool
+ if bs, changed = usableByteSlice(bs, slen); changed {
+ d.d.decByteState = decByteStateNone
+ }
for i := 0; i < len(bs); i++ {
bs[i] = uint8(chkOvf.UintV(d.DecodeUint64(), 8))
}
@@ -624,18 +614,19 @@ func (d *cborDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) {
}
clen := d.decLen()
d.bdRead = false
- if zerocopy {
- if d.d.bytes {
- return d.d.decRd.readx(uint(clen))
- } else if len(bs) == 0 {
- bs = d.d.b[:]
- }
+ if d.d.zerocopy() {
+ d.d.decByteState = decByteStateZerocopy
+ return d.d.decRd.rb.readx(uint(clen))
+ }
+ if bs == nil {
+ d.d.decByteState = decByteStateReuseBuf
+ bs = d.d.b[:]
}
return decByteSlice(d.d.r(), clen, d.h.MaxInitLen, bs)
}
func (d *cborDecDriver) DecodeStringAsBytes() (s []byte) {
- return d.DecodeBytes(d.d.b[:], true)
+ return d.DecodeBytes(nil)
}
func (d *cborDecDriver) DecodeTime() (t time.Time) {
@@ -654,9 +645,8 @@ func (d *cborDecDriver) decodeTime(xtag uint64) (t time.Time) {
switch xtag {
case 0:
var err error
- if t, err = time.Parse(time.RFC3339, stringView(d.DecodeStringAsBytes())); err != nil {
- d.d.errorv(err)
- }
+ t, err = time.Parse(time.RFC3339, stringView(d.DecodeStringAsBytes()))
+ d.d.onerror(err)
case 1:
f1, f2 := math.Modf(d.DecodeFloat64())
t = time.Unix(int64(f1), int64(f2*1e9))
@@ -667,7 +657,7 @@ func (d *cborDecDriver) decodeTime(xtag uint64) (t time.Time) {
return
}
-func (d *cborDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) {
+func (d *cborDecDriver) DecodeExt(rv interface{}, basetype reflect.Type, xtag uint64, ext Ext) {
if d.advanceNil() {
return
}
@@ -682,10 +672,8 @@ func (d *cborDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) {
d.d.decode(&re.Value)
} else if xtag != realxtag {
d.d.errorf("Wrong extension tag. Got %b. Expecting: %v", realxtag, xtag)
- return
} else if ext == SelfExt {
- rv2 := baseRV(rv)
- d.d.decodeValue(rv2, d.h.fnNoExt(rv2.Type()))
+ d.d.decodeValue(baseRV(rv), d.h.fnNoExt(basetype))
} else {
d.d.interfaceExtConvertAndDecode(rv, ext)
}
@@ -697,7 +685,6 @@ func (d *cborDecDriver) DecodeNaked() {
d.readNextBd()
}
- d.fnil = false
n := d.d.naked()
var decodeFurther bool
@@ -714,10 +701,10 @@ func (d *cborDecDriver) DecodeNaked() {
n.v = valueTypeInt
n.i = d.DecodeInt64()
case cborMajorBytes:
- decNakedReadRawBytes(d, &d.d, n, d.h.RawToString)
+ d.d.fauxUnionReadRawBytes(false)
case cborMajorString:
n.v = valueTypeString
- n.s = string(d.DecodeStringAsBytes())
+ n.s = d.d.stringZC(d.DecodeStringAsBytes())
case cborMajorArray:
n.v = valueTypeArray
decodeFurther = true
@@ -742,7 +729,6 @@ func (d *cborDecDriver) DecodeNaked() {
switch d.bd {
case cborBdNil, cborBdUndefined:
n.v = valueTypeNil
- d.fnil = true
case cborBdFalse:
n.v = valueTypeBool
n.b = false
@@ -752,17 +738,6 @@ func (d *cborDecDriver) DecodeNaked() {
case cborBdFloat16, cborBdFloat32, cborBdFloat64:
n.v = valueTypeFloat
n.f = d.DecodeFloat64()
- case cborBdIndefiniteBytes:
- decNakedReadRawBytes(d, &d.d, n, d.h.RawToString)
- case cborBdIndefiniteString:
- n.v = valueTypeString
- n.s = string(d.DecodeStringAsBytes())
- case cborBdIndefiniteArray:
- n.v = valueTypeArray
- decodeFurther = true
- case cborBdIndefiniteMap:
- n.v = valueTypeMap
- decodeFurther = true
default:
d.d.errorf("decodeNaked: Unrecognized d.bd: 0x%x", d.bd)
}
@@ -774,6 +749,139 @@ func (d *cborDecDriver) DecodeNaked() {
}
}
+func (d *cborDecDriver) uintBytes() (v []byte, ui uint64) {
+ // this is only used by nextValueBytes, so it's ok to
+ // use readx and bigenstd here.
+ switch vv := d.bd & 0x1f; vv {
+ case 0x18:
+ v = d.d.decRd.readx(1)
+ ui = uint64(v[0])
+ case 0x19:
+ v = d.d.decRd.readx(2)
+ ui = uint64(bigenstd.Uint16(v))
+ case 0x1a:
+ v = d.d.decRd.readx(4)
+ ui = uint64(bigenstd.Uint32(v))
+ case 0x1b:
+ v = d.d.decRd.readx(8)
+ ui = uint64(bigenstd.Uint64(v))
+ default:
+ if vv > 0x1b {
+ d.d.errorf("invalid descriptor decoding uint: %x/%s", d.bd, cbordesc(d.bd))
+ }
+ ui = uint64(vv)
+ }
+ return
+}
+
+func (d *cborDecDriver) nextValueBytes(v0 []byte) (v []byte) {
+ if !d.bdRead {
+ d.readNextBd()
+ }
+ v = v0
+ var h = decNextValueBytesHelper{d: &d.d}
+ var cursor = d.d.rb.c - 1
+ h.append1(&v, d.bd)
+ v = d.nextValueBytesBdReadR(v)
+ d.bdRead = false
+ h.bytesRdV(&v, cursor)
+ return
+}
+
+func (d *cborDecDriver) nextValueBytesR(v0 []byte) (v []byte) {
+ d.readNextBd()
+ v = v0
+ var h = decNextValueBytesHelper{d: &d.d}
+ h.append1(&v, d.bd)
+ return d.nextValueBytesBdReadR(v)
+}
+
+func (d *cborDecDriver) nextValueBytesBdReadR(v0 []byte) (v []byte) {
+ v = v0
+ var h = decNextValueBytesHelper{d: &d.d}
+
+ var bs []byte
+ var ui uint64
+
+ switch d.bd >> 5 {
+ case cborMajorUint, cborMajorNegInt:
+ bs, _ = d.uintBytes()
+ h.appendN(&v, bs...)
+ case cborMajorString, cborMajorBytes:
+ if d.bd == cborBdIndefiniteBytes || d.bd == cborBdIndefiniteString {
+ for {
+ d.readNextBd()
+ h.append1(&v, d.bd)
+ if d.bd == cborBdBreak {
+ break
+ }
+ bs, ui = d.uintBytes()
+ h.appendN(&v, bs...)
+ h.appendN(&v, d.d.decRd.readx(uint(ui))...)
+ }
+ } else {
+ bs, ui = d.uintBytes()
+ h.appendN(&v, bs...)
+ h.appendN(&v, d.d.decRd.readx(uint(ui))...)
+ }
+ case cborMajorArray:
+ if d.bd == cborBdIndefiniteArray {
+ for {
+ d.readNextBd()
+ h.append1(&v, d.bd)
+ if d.bd == cborBdBreak {
+ break
+ }
+ v = d.nextValueBytesBdReadR(v)
+ }
+ } else {
+ bs, ui = d.uintBytes()
+ h.appendN(&v, bs...)
+ for i := uint64(0); i < ui; i++ {
+ v = d.nextValueBytesR(v)
+ }
+ }
+ case cborMajorMap:
+ if d.bd == cborBdIndefiniteMap {
+ for {
+ d.readNextBd()
+ h.append1(&v, d.bd)
+ if d.bd == cborBdBreak {
+ break
+ }
+ v = d.nextValueBytesBdReadR(v)
+ v = d.nextValueBytesR(v)
+ }
+ } else {
+ bs, ui = d.uintBytes()
+ h.appendN(&v, bs...)
+ for i := uint64(0); i < ui; i++ {
+ v = d.nextValueBytesR(v)
+ v = d.nextValueBytesR(v)
+ }
+ }
+ case cborMajorTag:
+ bs, _ = d.uintBytes()
+ h.appendN(&v, bs...)
+ v = d.nextValueBytesR(v)
+ case cborMajorSimpleOrFloat:
+ switch d.bd {
+ case cborBdNil, cborBdUndefined, cborBdFalse, cborBdTrue: // pass
+ case cborBdFloat16:
+ h.appendN(&v, d.d.decRd.readx(2)...)
+ case cborBdFloat32:
+ h.appendN(&v, d.d.decRd.readx(4)...)
+ case cborBdFloat64:
+ h.appendN(&v, d.d.decRd.readx(8)...)
+ default:
+ d.d.errorf("nextValueBytes: Unrecognized d.bd: 0x%x", d.bd)
+ }
+ default: // should never happen
+ d.d.errorf("nextValueBytes: Unrecognized d.bd: 0x%x", d.bd)
+ }
+ return
+}
+
// -------------------------
// CborHandle is a Handle for the CBOR encoding format,
@@ -808,13 +916,13 @@ type CborHandle struct {
//
// Furthermore, this allows the skipping over of the Self Describing Tag 0xd9d9f7.
SkipUnexpectedTags bool
-
- _ [7]uint64 // padding (cache-aligned)
}
// Name returns the name of the handle: cbor
func (h *CborHandle) Name() string { return "cbor" }
+func (h *CborHandle) desc(bd byte) string { return cbordesc(bd) }
+
func (h *CborHandle) newEncDriver() encDriver {
var e = &cborEncDriver{h: h}
e.e.e = e
@@ -832,13 +940,8 @@ func (h *CborHandle) newDecDriver() decDriver {
return d
}
-func (e *cborEncDriver) reset() {
-}
-
func (d *cborDecDriver) reset() {
- d.bd = 0
- d.bdRead = false
- d.fnil = false
+ d.bdAndBdread.reset()
d.st = d.h.SkipUnexpectedTags
}
diff --git a/vendor/github.com/ugorji/go/codec/codecgen.go b/vendor/github.com/ugorji/go/codec/codecgen.go
index cc5ecec6d..49fb8e515 100644
--- a/vendor/github.com/ugorji/go/codec/codecgen.go
+++ b/vendor/github.com/ugorji/go/codec/codecgen.go
@@ -1,12 +1,16 @@
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
+// Use of this source code is governed by a MIT license found in the LICENSE file.
+
+//go:build codecgen || generated
// +build codecgen generated
package codec
-// this file is here, to set the codecgen variable to true
+// this file sets the codecgen variable to true
// when the build tag codecgen is set.
//
-// this allows us do specific things e.g. skip missing fields tests,
-// when running in codecgen mode.
+// some tests depend on knowing whether in the context of codecgen or not.
+// For example, some tests should be skipped during codecgen e.g. missing fields tests.
func init() {
codecgen = true
diff --git a/vendor/github.com/ugorji/go/codec/decimal.go b/vendor/github.com/ugorji/go/codec/decimal.go
new file mode 100644
index 000000000..6b617f5a9
--- /dev/null
+++ b/vendor/github.com/ugorji/go/codec/decimal.go
@@ -0,0 +1,491 @@
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
+// Use of this source code is governed by a MIT license found in the LICENSE file.
+
+package codec
+
+import (
+ "math"
+ "strconv"
+)
+
+// Per go spec, floats are represented in memory as
+// IEEE single or double precision floating point values.
+//
+// We also looked at the source for stdlib math/modf.go,
+// reviewed https://github.com/chewxy/math32
+// and read wikipedia documents describing the formats.
+//
+// It became clear that we could easily look at the bits to determine
+// whether any fraction exists.
+
+func parseFloat32(b []byte) (f float32, err error) {
+ return parseFloat32_custom(b)
+}
+
+func parseFloat64(b []byte) (f float64, err error) {
+ return parseFloat64_custom(b)
+}
+
+func parseFloat32_strconv(b []byte) (f float32, err error) {
+ f64, err := strconv.ParseFloat(stringView(b), 32)
+ f = float32(f64)
+ return
+}
+
+func parseFloat64_strconv(b []byte) (f float64, err error) {
+ return strconv.ParseFloat(stringView(b), 64)
+}
+
+// ------ parseFloat custom below --------
+
+// JSON really supports decimal numbers in base 10 notation, with exponent support.
+//
+// We assume the following:
+// - a lot of floating point numbers in json files will have defined precision
+// (in terms of number of digits after decimal point), etc.
+// - these (referenced above) can be written in exact format.
+//
+// strconv.ParseFloat has some unnecessary overhead which we can do without
+// for the common case:
+//
+// - expensive char-by-char check to see if underscores are in right place
+// - testing for and skipping underscores
+// - check if the string matches ignorecase +/- inf, +/- infinity, nan
+// - support for base 16 (0xFFFF...)
+//
+// The functions below will try a fast-path for floats which can be decoded
+// without any loss of precision, meaning they:
+//
+// - fits within the significand bits of the 32-bits or 64-bits
+// - exponent fits within the exponent value
+// - there is no truncation (any extra numbers are all trailing zeros)
+//
+// To figure out what the values are for maxMantDigits, use this idea below:
+//
+// 2^23 = 838 8608 (between 10^ 6 and 10^ 7) (significand bits of uint32)
+// 2^32 = 42 9496 7296 (between 10^ 9 and 10^10) (full uint32)
+// 2^52 = 4503 5996 2737 0496 (between 10^15 and 10^16) (significand bits of uint64)
+// 2^64 = 1844 6744 0737 0955 1616 (between 10^19 and 10^20) (full uint64)
+//
+// Note: we only allow for up to what can comfortably fit into the significand
+// ignoring the exponent, and we only try to parse iff significand fits.
+
+const (
+ fMaxMultiplierForExactPow10_64 = 1e15
+ fMaxMultiplierForExactPow10_32 = 1e7
+
+ fUint64Cutoff = (1<<64-1)/10 + 1
+ // fUint32Cutoff = (1<<32-1)/10 + 1
+
+ fBase = 10
+)
+
+const (
+ thousand = 1000
+ million = thousand * thousand
+ billion = thousand * million
+ trillion = thousand * billion
+ quadrillion = thousand * trillion
+ quintillion = thousand * quadrillion
+)
+
+// Exact powers of 10.
+var uint64pow10 = [...]uint64{
+ 1, 10, 100,
+ 1 * thousand, 10 * thousand, 100 * thousand,
+ 1 * million, 10 * million, 100 * million,
+ 1 * billion, 10 * billion, 100 * billion,
+ 1 * trillion, 10 * trillion, 100 * trillion,
+ 1 * quadrillion, 10 * quadrillion, 100 * quadrillion,
+ 1 * quintillion, 10 * quintillion,
+}
+var float64pow10 = [...]float64{
+ 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,
+ 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,
+ 1e20, 1e21, 1e22,
+}
+var float32pow10 = [...]float32{
+ 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10,
+}
+
+type floatinfo struct {
+ mantbits uint8
+
+ // expbits uint8 // (unused)
+ // bias int16 // (unused)
+ // is32bit bool // (unused)
+
+ exactPow10 int8 // Exact powers of ten are <= 10^N (32: 10, 64: 22)
+
+ exactInts int8 // Exact integers are <= 10^N (for non-float, set to 0)
+
+ // maxMantDigits int8 // 10^19 fits in uint64, while 10^9 fits in uint32
+
+ mantCutoffIsUint64Cutoff bool
+
+ mantCutoff uint64
+}
+
+var fi32 = floatinfo{23, 10, 7, false, 1<<23 - 1}
+var fi64 = floatinfo{52, 22, 15, false, 1<<52 - 1}
+
+var fi64u = floatinfo{0, 19, 0, true, fUint64Cutoff}
+
+func noFrac64(fbits uint64) bool {
+ exp := uint64(fbits>>52)&0x7FF - 1023 // uint(x>>shift)&mask - bias
+ // clear top 12+e bits, the integer part; if the rest is 0, then no fraction.
+ return exp < 52 && fbits<<(12+exp) == 0 // means there's no fractional part
+}
+
+func noFrac32(fbits uint32) bool {
+ exp := uint32(fbits>>23)&0xFF - 127 // uint(x>>shift)&mask - bias
+ // clear top 9+e bits, the integer part; if the rest is 0, then no fraction.
+ return exp < 23 && fbits<<(9+exp) == 0 // means there's no fractional part
+}
+
+func strconvParseErr(b []byte, fn string) error {
+ return &strconv.NumError{
+ Func: fn,
+ Err: strconv.ErrSyntax,
+ Num: string(b),
+ }
+}
+
+func parseFloat32_reader(r readFloatResult) (f float32, fail bool) {
+ f = float32(r.mantissa)
+ if r.exp == 0 {
+ } else if r.exp < 0 { // int / 10^k
+ f /= float32pow10[uint8(-r.exp)]
+ } else { // exp > 0
+ if r.exp > fi32.exactPow10 {
+ f *= float32pow10[r.exp-fi32.exactPow10]
+ if f > fMaxMultiplierForExactPow10_32 { // exponent too large - outside range
+ fail = true
+ return // ok = false
+ }
+ f *= float32pow10[fi32.exactPow10]
+ } else {
+ f *= float32pow10[uint8(r.exp)]
+ }
+ }
+ if r.neg {
+ f = -f
+ }
+ return
+}
+
+func parseFloat32_custom(b []byte) (f float32, err error) {
+ r := readFloat(b, fi32)
+ if r.bad {
+ return 0, strconvParseErr(b, "ParseFloat")
+ }
+ if r.ok {
+ f, r.bad = parseFloat32_reader(r)
+ if !r.bad {
+ return
+ }
+ }
+ return parseFloat32_strconv(b)
+}
+
+func parseFloat64_reader(r readFloatResult) (f float64, fail bool) {
+ f = float64(r.mantissa)
+ if r.exp == 0 {
+ } else if r.exp < 0 { // int / 10^k
+ f /= float64pow10[-uint8(r.exp)]
+ } else { // exp > 0
+ if r.exp > fi64.exactPow10 {
+ f *= float64pow10[r.exp-fi64.exactPow10]
+ if f > fMaxMultiplierForExactPow10_64 { // exponent too large - outside range
+ fail = true
+ return
+ }
+ f *= float64pow10[fi64.exactPow10]
+ } else {
+ f *= float64pow10[uint8(r.exp)]
+ }
+ }
+ if r.neg {
+ f = -f
+ }
+ return
+}
+
+func parseFloat64_custom(b []byte) (f float64, err error) {
+ r := readFloat(b, fi64)
+ if r.bad {
+ return 0, strconvParseErr(b, "ParseFloat")
+ }
+ if r.ok {
+ f, r.bad = parseFloat64_reader(r)
+ if !r.bad {
+ return
+ }
+ }
+ return parseFloat64_strconv(b)
+}
+
+func parseUint64_simple(b []byte) (n uint64, ok bool) {
+ var i int
+ var n1 uint64
+ var c uint8
+LOOP:
+ if i < len(b) {
+ c = b[i]
+ // unsigned integers don't overflow well on multiplication, so check cutoff here
+ // e.g. (maxUint64-5)*10 doesn't overflow well ...
+ // if n >= fUint64Cutoff || !isDigitChar(b[i]) { // if c < '0' || c > '9' {
+ if n >= fUint64Cutoff || c < '0' || c > '9' {
+ return
+ } else if c == '0' {
+ n *= fBase
+ } else {
+ n1 = n
+ n = n*fBase + uint64(c-'0')
+ if n < n1 {
+ return
+ }
+ }
+ i++
+ goto LOOP
+ }
+ ok = true
+ return
+}
+
+func parseUint64_reader(r readFloatResult) (f uint64, fail bool) {
+ f = r.mantissa
+ if r.exp == 0 {
+ } else if r.exp < 0 { // int / 10^k
+ if f%uint64pow10[uint8(-r.exp)] != 0 {
+ fail = true
+ } else {
+ f /= uint64pow10[uint8(-r.exp)]
+ }
+ } else { // exp > 0
+ f *= uint64pow10[uint8(r.exp)]
+ }
+ return
+}
+
+func parseInteger_bytes(b []byte) (u uint64, neg, ok bool) {
+ if len(b) == 0 {
+ ok = true
+ return
+ }
+ if b[0] == '-' {
+ if len(b) == 1 {
+ return
+ }
+ neg = true
+ b = b[1:]
+ }
+
+ u, ok = parseUint64_simple(b)
+ if ok {
+ return
+ }
+
+ r := readFloat(b, fi64u)
+ if r.ok {
+ var fail bool
+ u, fail = parseUint64_reader(r)
+ if fail {
+ f, err := parseFloat64(b)
+ if err != nil {
+ return
+ }
+ if !noFrac64(math.Float64bits(f)) {
+ return
+ }
+ u = uint64(f)
+ }
+ ok = true
+ return
+ }
+ return
+}
+
+// parseNumber will return an integer if only composed of [-]?[0-9]+
+// Else it will return a float.
+func parseNumber(b []byte, z *fauxUnion, preferSignedInt bool) (err error) {
+ var ok, neg bool
+ var f uint64
+
+ if len(b) == 0 {
+ return
+ }
+
+ if b[0] == '-' {
+ neg = true
+ f, ok = parseUint64_simple(b[1:])
+ } else {
+ f, ok = parseUint64_simple(b)
+ }
+
+ if ok {
+ if neg {
+ z.v = valueTypeInt
+ if chkOvf.Uint2Int(f, neg) {
+ return strconvParseErr(b, "ParseInt")
+ }
+ z.i = -int64(f)
+ } else if preferSignedInt {
+ z.v = valueTypeInt
+ if chkOvf.Uint2Int(f, neg) {
+ return strconvParseErr(b, "ParseInt")
+ }
+ z.i = int64(f)
+ } else {
+ z.v = valueTypeUint
+ z.u = f
+ }
+ return
+ }
+
+ z.v = valueTypeFloat
+ z.f, err = parseFloat64_custom(b)
+ return
+}
+
+type readFloatResult struct {
+ mantissa uint64
+ exp int8
+ neg bool
+ trunc bool
+ bad bool // bad decimal string
+ hardexp bool // exponent is hard to handle (> 2 digits, etc)
+ ok bool
+ // sawdot bool
+ // sawexp bool
+ //_ [2]bool // padding
+}
+
+func readFloat(s []byte, y floatinfo) (r readFloatResult) {
+ var i uint // uint, so that we eliminate bounds checking
+ var slen = uint(len(s))
+ if slen == 0 {
+ // read an empty string as the zero value
+ // r.bad = true
+ r.ok = true
+ return
+ }
+
+ if s[0] == '-' {
+ r.neg = true
+ i++
+ }
+
+ // we considered punting early if string has length > maxMantDigits, but this doesn't account
+ // for trailing 0's e.g. 700000000000000000000 can be encoded exactly as it is 7e20
+
+ var nd, ndMant, dp int8
+ var sawdot, sawexp bool
+ var xu uint64
+
+LOOP:
+ for ; i < slen; i++ {
+ switch s[i] {
+ case '.':
+ if sawdot {
+ r.bad = true
+ return
+ }
+ sawdot = true
+ dp = nd
+ case 'e', 'E':
+ sawexp = true
+ break LOOP
+ case '0':
+ if nd == 0 {
+ dp--
+ continue LOOP
+ }
+ nd++
+ if r.mantissa < y.mantCutoff {
+ r.mantissa *= fBase
+ ndMant++
+ }
+ case '1', '2', '3', '4', '5', '6', '7', '8', '9':
+ nd++
+ if y.mantCutoffIsUint64Cutoff && r.mantissa < fUint64Cutoff {
+ r.mantissa *= fBase
+ xu = r.mantissa + uint64(s[i]-'0')
+ if xu < r.mantissa {
+ r.trunc = true
+ return
+ }
+ r.mantissa = xu
+ } else if r.mantissa < y.mantCutoff {
+ // mantissa = (mantissa << 1) + (mantissa << 3) + uint64(c-'0')
+ r.mantissa = r.mantissa*fBase + uint64(s[i]-'0')
+ } else {
+ r.trunc = true
+ return
+ }
+ ndMant++
+ default:
+ r.bad = true
+ return
+ }
+ }
+
+ if !sawdot {
+ dp = nd
+ }
+
+ if sawexp {
+ i++
+ if i < slen {
+ var eneg bool
+ if s[i] == '+' {
+ i++
+ } else if s[i] == '-' {
+ i++
+ eneg = true
+ }
+ if i < slen {
+ // for exact match, exponent is 1 or 2 digits (float64: -22 to 37, float32: -1 to 17).
+ // exit quick if exponent is more than 2 digits.
+ if i+2 < slen {
+ r.hardexp = true
+ return
+ }
+ var e int8
+ if s[i] < '0' || s[i] > '9' { // !isDigitChar(s[i]) { //
+ r.bad = true
+ return
+ }
+ e = int8(s[i] - '0')
+ i++
+ if i < slen {
+ if s[i] < '0' || s[i] > '9' { // !isDigitChar(s[i]) { //
+ r.bad = true
+ return
+ }
+ e = e*fBase + int8(s[i]-'0') // (e << 1) + (e << 3) + int8(s[i]-'0')
+ i++
+ }
+ if eneg {
+ dp -= e
+ } else {
+ dp += e
+ }
+ }
+ }
+ }
+
+ if r.mantissa != 0 {
+ r.exp = dp - ndMant
+ // do not set ok=true for cases we cannot handle
+ if r.exp < -y.exactPow10 ||
+ r.exp > y.exactInts+y.exactPow10 ||
+ (y.mantbits != 0 && r.mantissa>>y.mantbits != 0) {
+ r.hardexp = true
+ return
+ }
+ }
+
+ r.ok = true
+ return
+}
diff --git a/vendor/github.com/ugorji/go/codec/decode.go b/vendor/github.com/ugorji/go/codec/decode.go
index a33252bd4..d454db09c 100644
--- a/vendor/github.com/ugorji/go/codec/decode.go
+++ b/vendor/github.com/ugorji/go/codec/decode.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
@@ -6,7 +6,6 @@ package codec
import (
"encoding"
"errors"
- "fmt"
"io"
"math"
"reflect"
@@ -14,26 +13,14 @@ import (
"time"
)
-// Some tagging information for error messages.
-const (
- msgBadDesc = "unrecognized descriptor byte"
- // msgDecCannotExpandArr = "cannot expand go array from %v to stream length: %v"
-)
+const msgBadDesc = "unrecognized descriptor byte"
const (
- decDefMaxDepth = 1024 // maximum depth
- decDefSliceCap = 8
- decDefChanCap = 64 // should be large, as cap cannot be expanded
- decScratchByteArrayLen = (6 * 8) // ??? cacheLineSize +
+ decDefMaxDepth = 1024 // maximum depth
+ decDefChanCap = 64 // should be large, as cap cannot be expanded
+ decScratchByteArrayLen = (8 + 2 + 2) * 8 // around cacheLineSize ie ~64, depending on Decoder size
- // decContainerLenUnknown is length returned from Read(Map|Array)Len
- // when a format doesn't know apiori.
- // For example, json doesn't pre-determine the length of a container (sequence/map).
- decContainerLenUnknown = -1
-
- // decContainerLenNil is length returned from Read(Map|Array)Len
- // when a 'nil' was encountered in the stream.
- decContainerLenNil = math.MinInt32
+ // MARKER: massage decScratchByteArrayLen to ensure xxxDecDriver structs fit within cacheLine*N
// decFailNonEmptyIntf configures whether we error
// when decoding naked into a non-empty interface.
@@ -47,14 +34,21 @@ const (
//
// Consequently, we should relax this. Put it behind a const flag for now.
decFailNonEmptyIntf = false
+
+ // decUseTransient says that we should not use the transient optimization.
+ //
+ // There's potential for GC corruption or memory overwrites if transient isn't
+ // used carefully, so this flag helps turn it off quickly if needed.
+ //
+ // Use it everywhere needed so we can completely remove unused code blocks.
+ decUseTransient = true
)
var (
- errstrOnlyMapOrArrayCanDecodeIntoStruct = "only encoded map or array can be decoded into a struct"
- errstrCannotDecodeIntoNil = "cannot decode into nil"
+ errNeedMapOrArrayDecodeToStruct = errors.New("only encoded map or array can decode into struct")
+ errCannotDecodeIntoNil = errors.New("cannot decode into nil")
- // errmsgExpandSliceOverflow = "expand slice: slice overflow"
- errmsgExpandSliceCannotChange = "expand slice: cannot change"
+ errExpandSliceCannotChange = errors.New("expand slice: cannot change")
errDecoderNotInitialized = errors.New("Decoder not initialized")
@@ -62,8 +56,26 @@ var (
errDecUnreadByteLastByteNotRead = errors.New("cannot unread - last byte has not been read")
errDecUnreadByteUnknown = errors.New("cannot unread - reason unknown")
errMaxDepthExceeded = errors.New("maximum decoding depth exceeded")
+)
- errBytesDecReaderCannotUnread = errors.New("cannot unread last byte read")
+// decByteState tracks where the []byte returned by the last call
+// to DecodeBytes or DecodeStringAsByte came from
+type decByteState uint8
+
+const (
+ decByteStateNone decByteState = iota
+ decByteStateZerocopy // view into []byte that we are decoding from
+ decByteStateReuseBuf // view into transient buffer used internally by decDriver
+ // decByteStateNewAlloc
+)
+
+type decNotDecodeableReason uint8
+
+const (
+ decNotDecodeableReasonUnknown decNotDecodeableReason = iota
+ decNotDecodeableReasonBadKind
+ decNotDecodeableReasonNonAddrValue
+ decNotDecodeableReasonNilReference
)
type decDriver interface {
@@ -71,6 +83,9 @@ type decDriver interface {
CheckBreak() bool
// TryNil tries to decode as nil.
+ // If a nil is in the stream, it consumes it and returns true.
+ //
+ // Note: if TryNil returns true, that must be handled.
TryNil() bool
// ContainerType returns one of: Bytes, String, Nil, Slice or Map.
@@ -82,7 +97,7 @@ type decDriver interface {
// DecodeNaked will decode primitives (number, bool, string, []byte) and RawExt.
// For maps and arrays, it will not do the decoding in-band, but will signal
- // the decoder, so that is done later, by setting the decNaked.valueType field.
+ // the decoder, so that is done later, by setting the fauxUnion.valueType field.
//
// Note: Numbers are decoded as int64, uint64, float64 only (no smaller sized number types).
// for extensions, DecodeNaked must read the tag and the []byte if it exists.
@@ -100,41 +115,71 @@ type decDriver interface {
DecodeBool() (b bool)
// DecodeStringAsBytes returns the bytes representing a string.
- // By definition, it will return a view into a scratch buffer.
+ // It will return a view into scratch buffer or input []byte (if applicable).
//
// Note: This can also decode symbols, if supported.
//
// Users should consume it right away and not store it for later use.
DecodeStringAsBytes() (v []byte)
- // DecodeBytes may be called directly, without going through reflection.
- // Consequently, it must be designed to handle possible nil.
- DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte)
+ // DecodeBytes returns the bytes representing a binary value.
+ // It will return a view into scratch buffer or input []byte (if applicable).
+ //
+ // All implementations must honor the contract below:
+ // if ZeroCopy and applicable, return a view into input []byte we are decoding from
+ // else if in == nil, return a view into scratch buffer
+ // else append decoded value to in[:0] and return that
+ // (this can be simulated by passing []byte{} as in parameter)
+ //
+ // Implementations must also update Decoder.decByteState on each call to
+ // DecodeBytes or DecodeStringAsBytes. Some callers may check that and work appropriately.
+ //
+ // Note: DecodeBytes may decode past the length of the passed byte slice, up to the cap.
+ // Consequently, it is ok to pass a zero-len slice to DecodeBytes, as the returned
+ // byte slice will have the appropriate length.
+ DecodeBytes(in []byte) (out []byte)
// DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte)
// DecodeExt will decode into a *RawExt or into an extension.
- DecodeExt(v interface{}, xtag uint64, ext Ext)
+ DecodeExt(v interface{}, basetype reflect.Type, xtag uint64, ext Ext)
// decodeExt(verifyTag bool, tag byte) (xtag byte, xbs []byte)
DecodeTime() (t time.Time)
// ReadArrayStart will return the length of the array.
- // If the format doesn't prefix the length, it returns decContainerLenUnknown.
- // If the expected array was a nil in the stream, it returns decContainerLenNil.
+ // If the format doesn't prefix the length, it returns containerLenUnknown.
+ // If the expected array was a nil in the stream, it returns containerLenNil.
ReadArrayStart() int
ReadArrayEnd()
// ReadMapStart will return the length of the array.
- // If the format doesn't prefix the length, it returns decContainerLenUnknown.
- // If the expected array was a nil in the stream, it returns decContainerLenNil.
+ // If the format doesn't prefix the length, it returns containerLenUnknown.
+ // If the expected array was a nil in the stream, it returns containerLenNil.
ReadMapStart() int
ReadMapEnd()
reset()
- atEndOfDecode()
- uncacheRead()
+
+ // atEndOfDecode()
+
+ // nextValueBytes will return the bytes representing the next value in the stream.
+ //
+ // if start is nil, then treat it as a request to discard the next set of bytes,
+ // and the return response does not matter.
+ // Typically, this means that the returned []byte is nil/empty/undefined.
+ //
+ // Optimize for decoding from a []byte, where the nextValueBytes will just be a sub-slice
+ // of the input slice. Callers that need to use this to not be a view into the input bytes
+ // should handle it appropriately.
+ nextValueBytes(start []byte) []byte
+
+ // descBd will describe the token descriptor that signifies what type was decoded
+ descBd() string
decoder() *Decoder
+
+ driverStateManager
+ decNegintPosintFloatNumber
}
type decDriverContainerTracker interface {
@@ -143,28 +188,30 @@ type decDriverContainerTracker interface {
ReadMapElemValue()
}
-type decodeError struct {
- codecError
- pos int
+type decNegintPosintFloatNumber interface {
+ decInteger() (ui uint64, neg, ok bool)
+ decFloat() (f float64, ok bool)
}
-func (d decodeError) Error() string {
- return fmt.Sprintf("%s decode error [pos %d]: %v", d.name, d.pos, d.err)
+type decDriverNoopNumberHelper struct{}
+
+func (x decDriverNoopNumberHelper) decInteger() (ui uint64, neg, ok bool) {
+ panic("decInteger unsupported")
}
+func (x decDriverNoopNumberHelper) decFloat() (f float64, ok bool) { panic("decFloat unsupported") }
type decDriverNoopContainerReader struct{}
-func (x decDriverNoopContainerReader) ReadArrayStart() (v int) { return }
+func (x decDriverNoopContainerReader) ReadArrayStart() (v int) { panic("ReadArrayStart unsupported") }
func (x decDriverNoopContainerReader) ReadArrayEnd() {}
-func (x decDriverNoopContainerReader) ReadMapStart() (v int) { return }
+func (x decDriverNoopContainerReader) ReadMapStart() (v int) { panic("ReadMapStart unsupported") }
func (x decDriverNoopContainerReader) ReadMapEnd() {}
func (x decDriverNoopContainerReader) CheckBreak() (v bool) { return }
-func (x decDriverNoopContainerReader) atEndOfDecode() {}
// DecodeOptions captures configuration options during decode.
type DecodeOptions struct {
// MapType specifies type to use during schema-less decoding of a map in the stream.
- // If nil (unset), we default to map[string]interface{} iff json handle and MapStringAsKey=true,
+ // If nil (unset), we default to map[string]interface{} iff json handle and MapKeyAsString=true,
// else map[interface{}]interface{}.
MapType reflect.Type
@@ -269,16 +316,35 @@ type DecodeOptions struct {
// RawToString controls how raw bytes in a stream are decoded into a nil interface{}.
// By default, they are decoded as []byte, but can be decoded as string (if configured).
RawToString bool
+
+ // ZeroCopy controls whether decoded values of []byte or string type
+ // point into the input []byte parameter passed to a NewDecoderBytes/ResetBytes(...) call.
+ //
+ // To illustrate, if ZeroCopy and decoding from a []byte (not io.Writer),
+ // then a []byte or string in the output result may just be a slice of (point into)
+ // the input bytes.
+ //
+ // This optimization prevents unnecessary copying.
+ //
+ // However, it is made optional, as the caller MUST ensure that the input parameter []byte is
+ // not modified after the Decode() happens, as any changes are mirrored in the decoded result.
+ ZeroCopy bool
+
+ // PreferPointerForStructOrArray controls whether a struct or array
+ // is stored in a nil interface{}, or a pointer to it.
+ //
+ // This mostly impacts when we decode registered extensions.
+ PreferPointerForStructOrArray bool
}
// ----------------------------------------
func (d *Decoder) rawExt(f *codecFnInfo, rv reflect.Value) {
- d.d.DecodeExt(rv2i(rv), 0, nil)
+ d.d.DecodeExt(rv2i(rv), f.ti.rt, 0, nil)
}
func (d *Decoder) ext(f *codecFnInfo, rv reflect.Value) {
- d.d.DecodeExt(rv2i(rv), f.xfTag, f.xfFn)
+ d.d.DecodeExt(rv2i(rv), f.ti.rt, f.xfTag, f.xfFn)
}
func (d *Decoder) selferUnmarshal(f *codecFnInfo, rv reflect.Value) {
@@ -287,28 +353,36 @@ func (d *Decoder) selferUnmarshal(f *codecFnInfo, rv reflect.Value) {
func (d *Decoder) binaryUnmarshal(f *codecFnInfo, rv reflect.Value) {
bm := rv2i(rv).(encoding.BinaryUnmarshaler)
- xbs := d.d.DecodeBytes(nil, true)
- if fnerr := bm.UnmarshalBinary(xbs); fnerr != nil {
- panic(fnerr)
- }
+ xbs := d.d.DecodeBytes(nil)
+ fnerr := bm.UnmarshalBinary(xbs)
+ d.onerror(fnerr)
}
func (d *Decoder) textUnmarshal(f *codecFnInfo, rv reflect.Value) {
tm := rv2i(rv).(encoding.TextUnmarshaler)
fnerr := tm.UnmarshalText(d.d.DecodeStringAsBytes())
- if fnerr != nil {
- panic(fnerr)
- }
+ d.onerror(fnerr)
}
func (d *Decoder) jsonUnmarshal(f *codecFnInfo, rv reflect.Value) {
- tm := rv2i(rv).(jsonUnmarshaler)
- // bs := d.d.DecodeBytes(d.b[:], true, true)
+ d.jsonUnmarshalV(rv2i(rv).(jsonUnmarshaler))
+}
+
+func (d *Decoder) jsonUnmarshalV(tm jsonUnmarshaler) {
// grab the bytes to be read, as UnmarshalJSON needs the full JSON so as to unmarshal it itself.
- fnerr := tm.UnmarshalJSON(d.nextValueBytes())
- if fnerr != nil {
- panic(fnerr)
+ var bs0 = []byte{}
+ if !d.bytes {
+ bs0 = d.blist.get(256)
}
+ bs := d.d.nextValueBytes(bs0)
+ fnerr := tm.UnmarshalJSON(bs)
+ if !d.bytes {
+ d.blist.put(bs)
+ if !byteSliceSameData(bs0, bs) {
+ d.blist.put(bs0)
+ }
+ }
+ d.onerror(fnerr)
}
func (d *Decoder) kErr(f *codecFnInfo, rv reflect.Value) {
@@ -320,7 +394,7 @@ func (d *Decoder) raw(f *codecFnInfo, rv reflect.Value) {
}
func (d *Decoder) kString(f *codecFnInfo, rv reflect.Value) {
- rvSetString(rv, string(d.d.DecodeStringAsBytes()))
+ rvSetString(rv, d.stringZC(d.d.DecodeStringAsBytes()))
}
func (d *Decoder) kBool(f *codecFnInfo, rv reflect.Value) {
@@ -339,6 +413,14 @@ func (d *Decoder) kFloat64(f *codecFnInfo, rv reflect.Value) {
rvSetFloat64(rv, d.d.DecodeFloat64())
}
+func (d *Decoder) kComplex64(f *codecFnInfo, rv reflect.Value) {
+ rvSetComplex64(rv, complex(d.decodeFloat32(), 0))
+}
+
+func (d *Decoder) kComplex128(f *codecFnInfo, rv reflect.Value) {
+ rvSetComplex128(rv, complex(d.d.DecodeFloat64(), 0))
+}
+
func (d *Decoder) kInt(f *codecFnInfo, rv reflect.Value) {
rvSetInt(rv, int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize)))
}
@@ -399,51 +481,45 @@ func (d *Decoder) kInterfaceNaked(f *codecFnInfo) (rvn reflect.Value) {
// Consequently, we should relax this. Put it behind a const flag for now.
if decFailNonEmptyIntf && f.ti.numMeth > 0 {
d.errorf("cannot decode non-nil codec value into nil %v (%v methods)", f.ti.rt, f.ti.numMeth)
- return
}
switch n.v {
case valueTypeMap:
- // if json, default to a map type with string keys
mtid := d.mtid
if mtid == 0 {
- if d.jsms {
- mtid = mapStrIntfTypId
+ if d.jsms { // if json, default to a map type with string keys
+ mtid = mapStrIntfTypId // for json performance
} else {
mtid = mapIntfIntfTypId
}
}
- if mtid == mapIntfIntfTypId {
- var v2 map[interface{}]interface{}
- d.decode(&v2)
- rvn = rv4i(&v2).Elem()
- } else if mtid == mapStrIntfTypId { // for json performance
+ if mtid == mapStrIntfTypId {
var v2 map[string]interface{}
d.decode(&v2)
- rvn = rv4i(&v2).Elem()
+ rvn = rv4iptr(&v2).Elem()
+ } else if mtid == mapIntfIntfTypId {
+ var v2 map[interface{}]interface{}
+ d.decode(&v2)
+ rvn = rv4iptr(&v2).Elem()
+ } else if d.mtr {
+ rvn = reflect.New(d.h.MapType)
+ d.decode(rv2i(rvn))
+ rvn = rvn.Elem()
} else {
- if d.mtr {
- rvn = reflect.New(d.h.MapType)
- d.decode(rv2i(rvn))
- rvn = rvn.Elem()
- } else {
- rvn = rvZeroAddrK(d.h.MapType, reflect.Map)
- d.decodeValue(rvn, nil)
- }
+ rvn = rvZeroAddrK(d.h.MapType, reflect.Map)
+ d.decodeValue(rvn, nil)
}
case valueTypeArray:
if d.stid == 0 || d.stid == intfSliceTypId {
var v2 []interface{}
d.decode(&v2)
- rvn = rv4i(&v2).Elem()
+ rvn = rv4iptr(&v2).Elem()
+ } else if d.str {
+ rvn = reflect.New(d.h.SliceType)
+ d.decode(rv2i(rvn))
+ rvn = rvn.Elem()
} else {
- if d.str {
- rvn = reflect.New(d.h.SliceType)
- d.decode(rv2i(rvn))
- rvn = rvn.Elem()
- } else {
- rvn = rvZeroAddrK(d.h.SliceType, reflect.Slice)
- d.decodeValue(rvn, nil)
- }
+ rvn = rvZeroAddrK(d.h.SliceType, reflect.Slice)
+ d.decodeValue(rvn, nil)
}
if reflectArrayOfSupported && d.h.PreferArrayOverSlice {
rvn = rvGetArray4Slice(rvn)
@@ -457,7 +533,7 @@ func (d *Decoder) kInterfaceNaked(f *codecFnInfo) (rvn reflect.Value) {
// most likely cbor, as json decoding never reveals valueTypeExt (no tagging support)
if bfn == nil {
d.decode(&re.Value)
- rvn = rv4i(&re).Elem()
+ rvn = rv4iptr(&re).Elem()
} else {
if bfn.ext == SelfExt {
rvn = rvZeroAddrK(bfn.rt, bfn.rt.Kind())
@@ -471,18 +547,24 @@ func (d *Decoder) kInterfaceNaked(f *codecFnInfo) (rvn reflect.Value) {
} else {
// one of the BytesExt ones: binc, msgpack, simple
if bfn == nil {
- re.Data = detachZeroCopyBytes(d.bytes, nil, bytes)
- rvn = rv4i(&re).Elem()
+ re.setData(bytes, false)
+ rvn = rv4iptr(&re).Elem()
} else {
rvn = reflect.New(bfn.rt)
if bfn.ext == SelfExt {
- d.sideDecode(rv2i(rvn), bytes)
+ d.sideDecode(rv2i(rvn), bfn.rt, bytes)
} else {
bfn.ext.ReadExt(rv2i(rvn), bytes)
}
rvn = rvn.Elem()
}
}
+ // if struct/array, directly store pointer into the interface
+ if d.h.PreferPointerForStructOrArray && rvn.CanAddr() {
+ if rk := rvn.Kind(); rk == reflect.Array || rk == reflect.Struct {
+ rvn = rvn.Addr()
+ }
+ }
case valueTypeNil:
// rvn = reflect.Zero(f.ti.rt)
// no-op
@@ -501,35 +583,44 @@ func (d *Decoder) kInterfaceNaked(f *codecFnInfo) (rvn reflect.Value) {
case valueTypeTime:
rvn = n.rt()
default:
- panicv.errorf("kInterfaceNaked: unexpected valueType: %d", n.v)
+ halt.errorf("kInterfaceNaked: unexpected valueType: %d", n.v)
}
return
}
func (d *Decoder) kInterface(f *codecFnInfo, rv reflect.Value) {
- // Note:
- // A consequence of how kInterface works, is that
+ // Note: A consequence of how kInterface works, is that
// if an interface already contains something, we try
// to decode into what was there before.
// We do not replace with a generic value (as got from decodeNaked).
-
+ //
// every interface passed here MUST be settable.
+ //
+ // ensure you call rvSetIntf(...) before returning.
+
+ isnilrv := rvIsNil(rv)
+
var rvn reflect.Value
- if rvIsNil(rv) || d.h.InterfaceReset {
+
+ if d.h.InterfaceReset {
// check if mapping to a type: if so, initialize it and move on
rvn = d.h.intf2impl(f.ti.rtid)
- if rvn.IsValid() {
- rv.Set(rvn)
- } else {
+ if !rvn.IsValid() {
rvn = d.kInterfaceNaked(f)
- // xdebugf("kInterface: %v", rvn)
if rvn.IsValid() {
- rv.Set(rvn)
- } else if d.h.InterfaceReset {
- // reset to zero value based on current type in there.
- if rvelem := rv.Elem(); rvelem.IsValid() {
- rv.Set(reflect.Zero(rvelem.Type()))
- }
+ rvSetIntf(rv, rvn)
+ } else if !isnilrv {
+ decSetNonNilRV2Zero4Intf(rv)
+ }
+ return
+ }
+ } else if isnilrv {
+ // check if mapping to a type: if so, initialize it and move on
+ rvn = d.h.intf2impl(f.ti.rtid)
+ if !rvn.IsValid() {
+ rvn = d.kInterfaceNaked(f)
+ if rvn.IsValid() {
+ rvSetIntf(rv, rvn)
}
return
}
@@ -538,90 +629,84 @@ func (d *Decoder) kInterface(f *codecFnInfo, rv reflect.Value) {
rvn = rv.Elem()
}
- // Note: interface{} is settable, but underlying type may not be.
- // Consequently, we MAY have to create a decodable value out of the underlying value,
- // decode into it, and reset the interface itself.
- // fmt.Printf(">>>> kInterface: rvn type: %v, rv type: %v\n", rvn.Type(), rv.Type())
+ // rvn is now a non-interface type
- if isDecodeable(rvn) {
- d.decodeValue(rvn, nil)
- return
+ canDecode, _ := isDecodeable(rvn)
+
+ // Note: interface{} is settable, but underlying type may not be.
+ // Consequently, we MAY have to allocate a value (containing the underlying value),
+ // decode into it, and reset the interface to that new value.
+
+ if !canDecode {
+ rvn2 := d.oneShotAddrRV(rvType(rvn), rvn.Kind())
+ rvSetDirect(rvn2, rvn)
+ rvn = rvn2
}
- rvn2 := rvZeroAddrK(rvn.Type(), rvn.Kind())
- rvSetDirect(rvn2, rvn)
- d.decodeValue(rvn2, nil)
- rv.Set(rvn2)
+ d.decodeValue(rvn, nil)
+ rvSetIntf(rv, rvn)
}
-func decStructFieldKey(dd decDriver, keyType valueType, b *[decScratchByteArrayLen]byte) (rvkencname []byte) {
- // use if-else-if, not switch (which compiles to binary-search)
- // since keyType is typically valueTypeString, branch prediction is pretty good.
-
- if keyType == valueTypeString {
- rvkencname = dd.DecodeStringAsBytes()
- } else if keyType == valueTypeInt {
+func decStructFieldKeyNotString(dd decDriver, keyType valueType, b *[decScratchByteArrayLen]byte) (rvkencname []byte) {
+ if keyType == valueTypeInt {
rvkencname = strconv.AppendInt(b[:0], dd.DecodeInt64(), 10)
} else if keyType == valueTypeUint {
rvkencname = strconv.AppendUint(b[:0], dd.DecodeUint64(), 10)
} else if keyType == valueTypeFloat {
rvkencname = strconv.AppendFloat(b[:0], dd.DecodeFloat64(), 'f', -1, 64)
} else {
- rvkencname = dd.DecodeStringAsBytes()
+ halt.errorf("invalid struct key type: %v", keyType)
}
return
}
func (d *Decoder) kStruct(f *codecFnInfo, rv reflect.Value) {
- sfn := structFieldNode{v: rv, update: true}
ctyp := d.d.ContainerType()
- if ctyp == valueTypeNil {
- rvSetDirect(rv, f.ti.rv0)
- return
- }
+ ti := f.ti
var mf MissingFielder
- if f.ti.isFlag(tiflagMissingFielder) {
+ if ti.flagMissingFielder {
mf = rv2i(rv).(MissingFielder)
- } else if f.ti.isFlag(tiflagMissingFielderPtr) {
- mf = rv2i(rv.Addr()).(MissingFielder)
+ } else if ti.flagMissingFielderPtr {
+ mf = rv2i(rvAddr(rv, ti.ptr)).(MissingFielder)
}
if ctyp == valueTypeMap {
- containerLen := d.mapStart()
+ containerLen := d.mapStart(d.d.ReadMapStart())
if containerLen == 0 {
d.mapEnd()
return
}
- tisfi := f.ti.sfiSort
hasLen := containerLen >= 0
-
+ var name2 []byte
+ if mf != nil {
+ var namearr2 [16]byte
+ name2 = namearr2[:0]
+ }
var rvkencname []byte
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
+ for j := 0; d.containerNext(j, containerLen, hasLen); j++ {
d.mapElemKey()
- rvkencname = decStructFieldKey(d.d, f.ti.keyType, &d.b)
+ if ti.keyType == valueTypeString {
+ rvkencname = d.d.DecodeStringAsBytes()
+ } else {
+ rvkencname = decStructFieldKeyNotString(d.d, ti.keyType, &d.b)
+ }
d.mapElemValue()
- if k := f.ti.indexForEncName(rvkencname); k > -1 {
- si := tisfi[k]
- d.decodeValue(sfn.field(si), nil)
+ if si := ti.siForEncName(rvkencname); si != nil {
+ d.decodeValue(si.path.fieldAlloc(rv), nil)
} else if mf != nil {
// store rvkencname in new []byte, as it previously shares Decoder.b, which is used in decode
- name2 := rvkencname
- rvkencname = make([]byte, len(rvkencname))
- copy(rvkencname, name2)
-
+ name2 = append(name2[:0], rvkencname...)
var f interface{}
d.decode(&f)
- if !mf.CodecMissingField(rvkencname, f) && d.h.ErrorIfNoField {
- d.errorf("no matching struct field found when decoding stream map with key: %s ",
- stringView(rvkencname))
+ if !mf.CodecMissingField(name2, f) && d.h.ErrorIfNoField {
+ d.errorf("no matching struct field when decoding stream map with key: %s ", stringView(name2))
}
} else {
d.structFieldNotFound(-1, stringView(rvkencname))
}
- // keepAlive4StringView(rvkencnameB) // not needed, as reference is outside loop
}
d.mapEnd()
} else if ctyp == valueTypeArray {
- containerLen := d.arrayStart()
+ containerLen := d.arrayStart(d.d.ReadArrayStart())
if containerLen == 0 {
d.arrayEnd()
return
@@ -630,21 +715,30 @@ func (d *Decoder) kStruct(f *codecFnInfo, rv reflect.Value) {
// Arrays are not used as much for structs.
hasLen := containerLen >= 0
var checkbreak bool
- for j, si := range f.ti.sfiSrc {
- if hasLen && j == containerLen {
- break
- }
- if !hasLen && d.checkBreak() {
+ tisfi := ti.sfi.source()
+ for j, si := range tisfi {
+ if hasLen {
+ if j == containerLen {
+ break
+ }
+ } else if d.checkBreak() {
checkbreak = true
break
}
d.arrayElem()
- d.decodeValue(sfn.field(si), nil)
+ d.decodeValue(si.path.fieldAlloc(rv), nil)
}
- if (hasLen && containerLen > len(f.ti.sfiSrc)) || (!hasLen && !checkbreak) {
+ var proceed bool
+ if hasLen {
+ proceed = containerLen > len(tisfi)
+ } else {
+ proceed = !checkbreak
+ }
+ // if (hasLen && containerLen > len(tisfi)) || (!hasLen && !checkbreak) {
+ if proceed {
// read remaining values and throw away
- for j := len(f.ti.sfiSrc); ; j++ {
- if (hasLen && j == containerLen) || (!hasLen && d.checkBreak()) {
+ for j := len(tisfi); ; j++ {
+ if !d.containerNext(j, containerLen, hasLen) {
break
}
d.arrayElem()
@@ -653,8 +747,7 @@ func (d *Decoder) kStruct(f *codecFnInfo, rv reflect.Value) {
}
d.arrayEnd()
} else {
- d.errorstr(errstrOnlyMapOrArrayCanDecodeIntoStruct)
- return
+ d.onerror(errNeedMapOrArrayDecodeToStruct)
}
}
@@ -664,24 +757,24 @@ func (d *Decoder) kSlice(f *codecFnInfo, rv reflect.Value) {
// Note: rv is a slice type here - guaranteed
- rtelem0 := f.ti.elem
+ ti := f.ti
+ rvCanset := rv.CanSet()
+
ctyp := d.d.ContainerType()
- if ctyp == valueTypeNil {
- if rv.CanSet() {
- rvSetDirect(rv, f.ti.rv0)
- }
- return
- }
if ctyp == valueTypeBytes || ctyp == valueTypeString {
// you can only decode bytes or string in the stream into a slice or array of bytes
- if !(f.ti.rtid == uint8SliceTypId || rtelem0.Kind() == reflect.Uint8) {
- d.errorf("bytes/string in stream must decode into slice/array of bytes, not %v", f.ti.rt)
+ if !(ti.rtid == uint8SliceTypId || ti.elemkind == uint8(reflect.Uint8)) {
+ d.errorf("bytes/string in stream must decode into slice/array of bytes, not %v", ti.rt)
}
rvbs := rvGetBytes(rv)
- bs2 := d.d.DecodeBytes(rvbs, false)
- // if rvbs == nil && bs2 != nil || rvbs != nil && bs2 == nil || len(bs2) != len(rvbs) {
+ if !rvCanset {
+ // not addressable byte slice, so do not decode into it past the length
+ rvbs = rvbs[:len(rvbs):len(rvbs)]
+ }
+ bs2 := d.decodeBytesInto(rvbs)
+ // if !(len(bs2) == len(rvbs) && byteSliceSameData(rvbs, bs2)) {
if !(len(bs2) > 0 && len(bs2) == len(rvbs) && &bs2[0] == &rvbs[0]) {
- if rv.CanSet() {
+ if rvCanset {
rvSetBytes(rv, bs2)
} else if len(rvbs) > 0 && len(bs2) > 0 {
copy(rvbs, bs2)
@@ -694,9 +787,9 @@ func (d *Decoder) kSlice(f *codecFnInfo, rv reflect.Value) {
// an array can never return a nil slice. so no need to check f.array here.
if containerLenS == 0 {
- if rv.CanSet() {
+ if rvCanset {
if rvIsNil(rv) {
- rvSetDirect(rv, reflect.MakeSlice(f.ti.rt, 0, 0))
+ rvSetDirect(rv, rvSliceZeroCap(ti.rt))
} else {
rvSetSliceLen(rv, 0)
}
@@ -705,123 +798,181 @@ func (d *Decoder) kSlice(f *codecFnInfo, rv reflect.Value) {
return
}
- rtelem0Size := int(rtelem0.Size())
- rtElem0Kind := rtelem0.Kind()
- rtelem0Mut := !isImmutableKind(rtElem0Kind)
- rtelem := rtelem0
- rtelemkind := rtelem.Kind()
- for rtelemkind == reflect.Ptr {
+ rtelem0Mut := !scalarBitset.isset(ti.elemkind)
+ rtelem := ti.elem
+
+ for k := reflect.Kind(ti.elemkind); k == reflect.Ptr; k = rtelem.Kind() {
rtelem = rtelem.Elem()
- rtelemkind = rtelem.Kind()
}
var fn *codecFn
- var rv0 = rv
var rvChanged bool
- var rvCanset = rv.CanSet()
+
+ var rv0 = rv
var rv9 reflect.Value
- rvlen := rvGetSliceLen(rv)
- rvcap := rvGetSliceCap(rv)
+ rvlen := rvLenSlice(rv)
+ rvcap := rvCapSlice(rv)
hasLen := containerLenS > 0
if hasLen {
if containerLenS > rvcap {
oldRvlenGtZero := rvlen > 0
- rvlen = decInferLen(containerLenS, d.h.MaxInitLen, int(rtelem0.Size()))
- if rvlen <= rvcap {
+ rvlen1 := decInferLen(containerLenS, d.h.MaxInitLen, int(ti.elemsize))
+ if rvlen1 == rvlen {
+ } else if rvlen1 <= rvcap {
if rvCanset {
+ rvlen = rvlen1
rvSetSliceLen(rv, rvlen)
}
- } else if rvCanset {
- rv = reflect.MakeSlice(f.ti.rt, rvlen, rvlen)
+ } else if rvCanset { // rvlen1 > rvcap
+ rvlen = rvlen1
+ rv, rvCanset = rvMakeSlice(rv, f.ti, rvlen, rvlen)
rvcap = rvlen
- rvChanged = true
- } else {
+ rvChanged = !rvCanset
+ } else { // rvlen1 > rvcap && !canSet
d.errorf("cannot decode into non-settable slice")
}
- if rvChanged && oldRvlenGtZero && rtelem0Mut { // !isImmutableKind(rtelem0.Kind()) {
- rvCopySlice(rv, rv0) // only copy up to length NOT cap i.e. rv0.Slice(0, rvcap)
+ if rvChanged && oldRvlenGtZero && rtelem0Mut {
+ rvCopySlice(rv, rv0, rtelem) // only copy up to length NOT cap i.e. rv0.Slice(0, rvcap)
}
} else if containerLenS != rvlen {
- rvlen = containerLenS
if rvCanset {
+ rvlen = containerLenS
rvSetSliceLen(rv, rvlen)
}
}
}
// consider creating new element once, and just decoding into it.
- var rtelem0Zero reflect.Value
- var rtelem0ZeroValid bool
+ var elemReset = d.h.SliceElementReset
+
var j int
- for ; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && f.seq == seqTypeSlice && rvIsNil(rv) {
- if hasLen {
- rvlen = decInferLen(containerLenS, d.h.MaxInitLen, rtelem0Size)
- } else {
- rvlen = decDefSliceCap
+ for ; d.containerNext(j, containerLenS, hasLen); j++ {
+ if j == 0 {
+ if rvIsNil(rv) { // means hasLen = false
+ if rvCanset {
+ rvlen = decInferLen(containerLenS, d.h.MaxInitLen, int(ti.elemsize))
+ rv, rvCanset = rvMakeSlice(rv, f.ti, rvlen, rvlen)
+ rvcap = rvlen
+ rvChanged = !rvCanset
+ } else {
+ d.errorf("cannot decode into non-settable slice")
+ }
}
- if rvCanset {
- rv = reflect.MakeSlice(f.ti.rt, rvlen, rvlen)
- rvcap = rvlen
- rvChanged = true
- } else {
- d.errorf("cannot decode into non-settable slice")
+ if fn == nil {
+ fn = d.h.fn(rtelem)
}
}
- slh.ElemContainerState(j)
// if indefinite, etc, then expand the slice if necessary
if j >= rvlen {
- if f.seq == seqTypeArray {
- d.arrayCannotExpand(rvlen, j+1)
- // drain completely and return
- d.swallow()
- j++
- for ; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- slh.ElemContainerState(j)
- d.swallow()
- }
- slh.End()
- return
- }
- // rv = reflect.Append(rv, reflect.Zero(rtelem0)) // append logic + varargs
+ slh.ElemContainerState(j)
// expand the slice up to the cap.
// Note that we did, so we have to reset it later.
if rvlen < rvcap {
- if rv.CanSet() {
- rvSetSliceLen(rv, rvcap)
- } else if rvCanset {
- rv = rvSlice(rv, rvcap)
- rvChanged = true
+ rvlen = rvcap
+ if rvCanset {
+ rvSetSliceLen(rv, rvlen)
+ } else if rvChanged {
+ rv = rvSlice(rv, rvlen)
} else {
- d.errorf(errmsgExpandSliceCannotChange)
- return
+ d.onerror(errExpandSliceCannotChange)
}
- rvlen = rvcap
} else {
- if !rvCanset {
- d.errorf(errmsgExpandSliceCannotChange)
- return
+ if !(rvCanset || rvChanged) {
+ d.onerror(errExpandSliceCannotChange)
}
- rvcap = growCap(rvcap, rtelem0Size, rvcap)
- rv9 = reflect.MakeSlice(f.ti.rt, rvcap, rvcap)
- rvCopySlice(rv9, rv)
- rv = rv9
- rvChanged = true
+ rv, rvcap, rvCanset = rvGrowSlice(rv, f.ti, rvcap, 1)
rvlen = rvcap
+ rvChanged = !rvCanset
}
+ } else {
+ slh.ElemContainerState(j)
}
rv9 = rvSliceIndex(rv, j, f.ti)
- if d.h.SliceElementReset {
- if !rtelem0ZeroValid {
- rtelem0ZeroValid = true
- rtelem0Zero = reflect.Zero(rtelem0)
- }
- rv9.Set(rtelem0Zero)
+ if elemReset {
+ rvSetZero(rv9)
+ }
+ d.decodeValue(rv9, fn)
+ }
+ if j < rvlen {
+ if rvCanset {
+ rvSetSliceLen(rv, j)
+ } else if rvChanged {
+ rv = rvSlice(rv, j)
+ }
+ // rvlen = j
+ } else if j == 0 && rvIsNil(rv) {
+ if rvCanset {
+ rv = rvSliceZeroCap(ti.rt)
+ rvCanset = false
+ rvChanged = true
+ }
+ }
+ slh.End()
+
+ if rvChanged { // infers rvCanset=true, so it can be reset
+ rvSetDirect(rv0, rv)
+ }
+}
+
+func (d *Decoder) kArray(f *codecFnInfo, rv reflect.Value) {
+ // An array can be set from a map or array in stream.
+
+ ctyp := d.d.ContainerType()
+ if handleBytesWithinKArray && (ctyp == valueTypeBytes || ctyp == valueTypeString) {
+ // you can only decode bytes or string in the stream into a slice or array of bytes
+ if f.ti.elemkind != uint8(reflect.Uint8) {
+ d.errorf("bytes/string in stream can decode into array of bytes, but not %v", f.ti.rt)
+ }
+ rvbs := rvGetArrayBytes(rv, nil)
+ bs2 := d.decodeBytesInto(rvbs)
+ if !byteSliceSameData(rvbs, bs2) && len(rvbs) > 0 && len(bs2) > 0 {
+ copy(rvbs, bs2)
+ }
+ return
+ }
+
+ slh, containerLenS := d.decSliceHelperStart() // only expects valueType(Array|Map) - never Nil
+
+ // an array can never return a nil slice. so no need to check f.array here.
+ if containerLenS == 0 {
+ slh.End()
+ return
+ }
+
+ rtelem := f.ti.elem
+ for k := reflect.Kind(f.ti.elemkind); k == reflect.Ptr; k = rtelem.Kind() {
+ rtelem = rtelem.Elem()
+ }
+
+ var fn *codecFn
+
+ var rv9 reflect.Value
+
+ rvlen := rv.Len() // same as cap
+ hasLen := containerLenS > 0
+ if hasLen && containerLenS > rvlen {
+ d.errorf("cannot decode into array with length: %v, less than container length: %v", rvlen, containerLenS)
+ }
+
+ // consider creating new element once, and just decoding into it.
+ var elemReset = d.h.SliceElementReset
+
+ for j := 0; d.containerNext(j, containerLenS, hasLen); j++ {
+ // note that you cannot expand the array if indefinite and we go past array length
+ if j >= rvlen {
+ slh.arrayCannotExpand(hasLen, rvlen, j, containerLenS)
+ return
+ }
+
+ slh.ElemContainerState(j)
+ rv9 = rvArrayIndex(rv, j, f.ti)
+ if elemReset {
+ rvSetZero(rv9)
}
if fn == nil {
@@ -829,47 +980,24 @@ func (d *Decoder) kSlice(f *codecFnInfo, rv reflect.Value) {
}
d.decodeValue(rv9, fn)
}
- if j < rvlen {
- if rv.CanSet() {
- rvSetSliceLen(rv, j)
- } else if rvCanset {
- rv = rvSlice(rv, j)
- rvChanged = true
- }
- rvlen = j
- } else if j == 0 && rvIsNil(rv) {
- if rvCanset {
- rv = reflect.MakeSlice(f.ti.rt, 0, 0)
- rvChanged = true
- }
- }
slh.End()
-
- if rvChanged { // infers rvCanset=true, so it can be reset
- rv0.Set(rv)
- }
-
}
-func (d *Decoder) kSliceForChan(f *codecFnInfo, rv reflect.Value) {
+func (d *Decoder) kChan(f *codecFnInfo, rv reflect.Value) {
// A slice can be set from a map or array in stream.
// This way, the order can be kept (as order is lost with map).
- if f.ti.chandir&uint8(reflect.SendDir) == 0 {
+ ti := f.ti
+ if ti.chandir&uint8(reflect.SendDir) == 0 {
d.errorf("receive-only channel cannot be decoded")
}
- rtelem0 := f.ti.elem
ctyp := d.d.ContainerType()
- if ctyp == valueTypeNil {
- rvSetDirect(rv, f.ti.rv0)
- return
- }
if ctyp == valueTypeBytes || ctyp == valueTypeString {
// you can only decode bytes or string in the stream into a slice or array of bytes
- if !(f.ti.rtid == uint8SliceTypId || rtelem0.Kind() == reflect.Uint8) {
- d.errorf("bytes/string in stream must decode into slice/array of bytes, not %v", f.ti.rt)
+ if !(ti.rtid == uint8SliceTypId || ti.elemkind == uint8(reflect.Uint8)) {
+ d.errorf("bytes/string in stream must decode into slice/array of bytes, not %v", ti.rt)
}
- bs2 := d.d.DecodeBytes(nil, true)
+ bs2 := d.d.DecodeBytes(nil)
irv := rv2i(rv)
ch, ok := irv.(chan<- byte)
if !ok {
@@ -881,81 +1009,81 @@ func (d *Decoder) kSliceForChan(f *codecFnInfo, rv reflect.Value) {
return
}
+ var rvCanset = rv.CanSet()
+
// only expects valueType(Array|Map - nil handled above)
slh, containerLenS := d.decSliceHelperStart()
// an array can never return a nil slice. so no need to check f.array here.
if containerLenS == 0 {
- if rv.CanSet() && rvIsNil(rv) {
- rvSetDirect(rv, reflect.MakeChan(f.ti.rt, 0))
+ if rvCanset && rvIsNil(rv) {
+ rvSetDirect(rv, reflect.MakeChan(ti.rt, 0))
}
slh.End()
return
}
- rtelem0Size := int(rtelem0.Size())
- rtElem0Kind := rtelem0.Kind()
- rtelem0Mut := !isImmutableKind(rtElem0Kind)
- rtelem := rtelem0
- rtelemkind := rtelem.Kind()
- for rtelemkind == reflect.Ptr {
+ rtelem := ti.elem
+ useTransient := decUseTransient && ti.elemkind != byte(reflect.Ptr) && ti.tielem.flagCanTransient
+
+ for k := reflect.Kind(ti.elemkind); k == reflect.Ptr; k = rtelem.Kind() {
rtelem = rtelem.Elem()
- rtelemkind = rtelem.Kind()
}
var fn *codecFn
- var rvCanset = rv.CanSet()
var rvChanged bool
var rv0 = rv
var rv9 reflect.Value
- var rvlen int // := rv.Len()
+ var rvlen int // = rv.Len()
hasLen := containerLenS > 0
- var j int
-
- for ; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && rvIsNil(rv) {
- if hasLen {
- rvlen = decInferLen(containerLenS, d.h.MaxInitLen, rtelem0Size)
- } else {
- rvlen = decDefChanCap
+ for j := 0; d.containerNext(j, containerLenS, hasLen); j++ {
+ if j == 0 {
+ if rvIsNil(rv) {
+ if hasLen {
+ rvlen = decInferLen(containerLenS, d.h.MaxInitLen, int(ti.elemsize))
+ } else {
+ rvlen = decDefChanCap
+ }
+ if rvCanset {
+ rv = reflect.MakeChan(ti.rt, rvlen)
+ rvChanged = true
+ } else {
+ d.errorf("cannot decode into non-settable chan")
+ }
}
- if rvCanset {
- rv = reflect.MakeChan(f.ti.rt, rvlen)
- rvChanged = true
- } else {
- d.errorf("cannot decode into non-settable chan")
+ if fn == nil {
+ fn = d.h.fn(rtelem)
}
}
slh.ElemContainerState(j)
- if rtelem0Mut || !rv9.IsValid() { // || (rtElem0Kind == reflect.Ptr && rvIsNil(rv9)) {
- rv9 = rvZeroAddrK(rtelem0, rtElem0Kind)
+ if rv9.IsValid() {
+ rvSetZero(rv9)
+ } else if decUseTransient && useTransient {
+ rv9 = d.perType.TransientAddrK(ti.elem, reflect.Kind(ti.elemkind))
+ } else {
+ rv9 = rvZeroAddrK(ti.elem, reflect.Kind(ti.elemkind))
}
- if fn == nil {
- fn = d.h.fn(rtelem)
+ if !d.d.TryNil() {
+ d.decodeValueNoCheckNil(rv9, fn)
}
- d.decodeValue(rv9, fn)
rv.Send(rv9)
}
slh.End()
if rvChanged { // infers rvCanset=true, so it can be reset
- rv0.Set(rv)
+ rvSetDirect(rv0, rv)
}
}
func (d *Decoder) kMap(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- rvSetDirect(rv, f.ti.rv0)
- return
- }
+ containerLen := d.mapStart(d.d.ReadMapStart())
ti := f.ti
if rvIsNil(rv) {
- rvlen := decInferLen(containerLen, d.h.MaxInitLen, int(ti.key.Size()+ti.elem.Size()))
+ rvlen := decInferLen(containerLen, d.h.MaxInitLen, int(ti.keysize+ti.elemsize))
rvSetDirect(rv, makeMapReflect(ti.rt, rvlen))
}
@@ -966,167 +1094,222 @@ func (d *Decoder) kMap(f *codecFnInfo, rv reflect.Value) {
ktype, vtype := ti.key, ti.elem
ktypeId := rt2id(ktype)
- vtypeKind := vtype.Kind()
- ktypeKind := ktype.Kind()
+ vtypeKind := reflect.Kind(ti.elemkind)
+ ktypeKind := reflect.Kind(ti.keykind)
+ kfast := mapKeyFastKindFor(ktypeKind)
+ visindirect := mapStoresElemIndirect(uintptr(ti.elemsize))
+ visref := refBitset.isset(ti.elemkind)
+
+ vtypePtr := vtypeKind == reflect.Ptr
+ ktypePtr := ktypeKind == reflect.Ptr
+
+ vTransient := decUseTransient && !vtypePtr && ti.tielem.flagCanTransient
+ kTransient := decUseTransient && !ktypePtr && ti.tikey.flagCanTransient
var vtypeElem reflect.Type
var keyFn, valFn *codecFn
- var ktypeLo, vtypeLo reflect.Type
+ var ktypeLo, vtypeLo = ktype, vtype
- for ktypeLo = ktype; ktypeLo.Kind() == reflect.Ptr; ktypeLo = ktypeLo.Elem() {
+ if ktypeKind == reflect.Ptr {
+ for ktypeLo = ktype.Elem(); ktypeLo.Kind() == reflect.Ptr; ktypeLo = ktypeLo.Elem() {
+ }
}
- for vtypeLo = vtype; vtypeLo.Kind() == reflect.Ptr; vtypeLo = vtypeLo.Elem() {
+ if vtypePtr {
+ vtypeElem = vtype.Elem()
+ for vtypeLo = vtypeElem; vtypeLo.Kind() == reflect.Ptr; vtypeLo = vtypeLo.Elem() {
+ }
}
- rvvMut := !isImmutableKind(vtypeKind)
+ rvkMut := !scalarBitset.isset(ti.keykind) // if ktype is immutable, then re-use the same rvk.
+ rvvMut := !scalarBitset.isset(ti.elemkind)
+ rvvCanNil := isnilBitset.isset(ti.elemkind)
+
+ // rvk: key
+ // rvkn: if non-mutable, on each iteration of loop, set rvk to this
+ // rvv: value
+ // rvvn: if non-mutable, on each iteration of loop, set rvv to this
+ // if mutable, may be used as a temporary value for local-scoped operations
+ // rvva: if mutable, used as transient value for use for key lookup
+ // rvvz: zero value of map value type, used to do a map set when nil is found in stream
+ var rvk, rvkn, rvv, rvvn, rvva, rvvz reflect.Value
// we do a doMapGet if kind is mutable, and InterfaceReset=true if interface
var doMapGet, doMapSet bool
+
if !d.h.MapValueReset {
- if rvvMut {
- if vtypeKind == reflect.Interface {
- if !d.h.InterfaceReset {
- doMapGet = true
- }
- } else {
- doMapGet = true
- }
+ if rvvMut && (vtypeKind != reflect.Interface || !d.h.InterfaceReset) {
+ doMapGet = true
+ rvva = mapAddrLoopvarRV(vtype, vtypeKind)
}
}
- var rvk, rvkn, rvv, rvvn, rvva reflect.Value
- var rvvaSet bool
- rvkMut := !isImmutableKind(ktype.Kind()) // if ktype is immutable, then re-use the same rvk.
ktypeIsString := ktypeId == stringTypId
ktypeIsIntf := ktypeId == intfTypId
- hasLen := containerLen > 0
- var kstrbs []byte
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
+ hasLen := containerLen > 0
+
+ // kstrbs is used locally for the key bytes, so we can reduce allocation.
+ // When we read keys, we copy to this local bytes array, and use a stringView for lookup.
+ // We only convert it into a true string if we have to do a set on the map.
+
+ // Since kstr2bs will usually escape to the heap, declaring a [64]byte array may be wasteful.
+ // It is only valuable if we are sure that it is declared on the stack.
+ // var kstrarr [64]byte // most keys are less than 32 bytes, and even more less than 64
+ // var kstrbs = kstrarr[:0]
+ var kstrbs []byte
+ var kstr2bs []byte
+ var s string
+
+ var callFnRvk bool
+
+ fnRvk2 := func() (s string) {
+ callFnRvk = false
+ if len(kstr2bs) < 2 {
+ return string(kstr2bs)
+ }
+ return d.mapKeyString(&callFnRvk, &kstrbs, &kstr2bs)
+ }
+
+ // Use a possibly transient (map) value (and key), to reduce allocation
+
+ for j := 0; d.containerNext(j, containerLen, hasLen); j++ {
+ callFnRvk = false
if j == 0 {
+ // if vtypekind is a scalar and thus value will be decoded using TransientAddrK,
+ // then it is ok to use TransientAddr2K for the map key.
+ if decUseTransient && vTransient && kTransient {
+ rvk = d.perType.TransientAddr2K(ktype, ktypeKind)
+ } else {
+ rvk = rvZeroAddrK(ktype, ktypeKind)
+ }
if !rvkMut {
- rvkn = rvZeroAddrK(ktype, ktypeKind)
+ rvkn = rvk
}
if !rvvMut {
- rvvn = rvZeroAddrK(vtype, vtypeKind)
+ if decUseTransient && vTransient {
+ rvvn = d.perType.TransientAddrK(vtype, vtypeKind)
+ } else {
+ rvvn = rvZeroAddrK(vtype, vtypeKind)
+ }
}
- }
-
- if rvkMut {
- rvk = rvZeroAddrK(ktype, ktypeKind)
+ if !ktypeIsString && keyFn == nil {
+ keyFn = d.h.fn(ktypeLo)
+ }
+ if valFn == nil {
+ valFn = d.h.fn(vtypeLo)
+ }
+ } else if rvkMut {
+ rvSetZero(rvk)
} else {
rvk = rvkn
}
d.mapElemKey()
-
if ktypeIsString {
- kstrbs = d.d.DecodeStringAsBytes()
- rvk.SetString(stringView(kstrbs)) // NOTE: if doing an insert, use real string (not stringview)
+ kstr2bs = d.d.DecodeStringAsBytes()
+ rvSetString(rvk, fnRvk2())
} else {
- if keyFn == nil {
- keyFn = d.h.fn(ktypeLo)
- }
+ d.decByteState = decByteStateNone
d.decodeValue(rvk, keyFn)
- }
-
- // special case if interface wrapping a byte array.
- if ktypeIsIntf {
- if rvk2 := rvk.Elem(); rvk2.IsValid() && rvk2.Type() == uint8SliceTyp {
- rvk.Set(rv4i(d.string(rvGetBytes(rvk2))))
+ // special case if interface wrapping a byte slice
+ if ktypeIsIntf {
+ if rvk2 := rvk.Elem(); rvk2.IsValid() && rvType(rvk2) == uint8SliceTyp {
+ kstr2bs = rvGetBytes(rvk2)
+ rvSetIntf(rvk, rv4istr(fnRvk2()))
+ }
+ // NOTE: consider failing early if map/slice/func
}
- // NOTE: consider failing early if map/slice/func
}
d.mapElemValue()
- doMapSet = true // set to false if u do a get, and its a non-nil pointer
- if doMapGet {
- if !rvvaSet {
- rvva = mapAddressableRV(vtype, vtypeKind)
- rvvaSet = true
+ if d.d.TryNil() {
+ // since a map, we have to set zero value if needed
+ if !rvvz.IsValid() {
+ rvvz = rvZeroK(vtype, vtypeKind)
}
- rvv = mapGet(rv, rvk, rvva) // reflect.Value{})
- if vtypeKind == reflect.Ptr {
- if rvv.IsValid() && !rvIsNil(rvv) {
- doMapSet = false
- } else {
- if vtypeElem == nil {
- vtypeElem = vtype.Elem()
- }
- rvv = reflect.New(vtypeElem)
+ if callFnRvk {
+ s = d.string(kstr2bs)
+ if ktypeIsString {
+ rvSetString(rvk, s)
+ } else { // ktypeIsIntf
+ rvSetIntf(rvk, rv4istr(s))
}
- } else if rvv.IsValid() && vtypeKind == reflect.Interface && !rvIsNil(rvv) {
+ }
+ mapSet(rv, rvk, rvvz, kfast, visindirect, visref)
+ continue
+ }
+
+ // there is non-nil content in the stream to decode ...
+ // consequently, it's ok to just directly create new value to the pointer (if vtypePtr)
+
+ // set doMapSet to false iff u do a get, and the return value is a non-nil pointer
+ doMapSet = true
+
+ if !rvvMut {
+ rvv = rvvn
+ } else if !doMapGet {
+ goto NEW_RVV
+ } else {
+ rvv = mapGet(rv, rvk, rvva, kfast, visindirect, visref)
+ if !rvv.IsValid() || (rvvCanNil && rvIsNil(rvv)) {
+ goto NEW_RVV
+ }
+ switch vtypeKind {
+ case reflect.Ptr, reflect.Map: // ok to decode directly into map
+ doMapSet = false
+ case reflect.Interface:
+ // if an interface{}, just decode into it iff a non-nil ptr/map, else allocate afresh
+ rvvn = rvv.Elem()
+ if k := rvvn.Kind(); (k == reflect.Ptr || k == reflect.Map) && !rvIsNil(rvvn) {
+ d.decodeValueNoCheckNil(rvvn, nil) // valFn is incorrect here
+ continue
+ }
+ // make addressable (so we can set the interface)
rvvn = rvZeroAddrK(vtype, vtypeKind)
- rvvn.Set(rvv)
+ rvSetIntf(rvvn, rvv)
rvv = rvvn
- } else if rvvMut {
- rvv = rvZeroAddrK(vtype, vtypeKind)
- } else {
+ default:
+ // make addressable (so you can set the slice/array elements, etc)
+ if decUseTransient && vTransient {
+ rvvn = d.perType.TransientAddrK(vtype, vtypeKind)
+ } else {
+ rvvn = rvZeroAddrK(vtype, vtypeKind)
+ }
+ rvSetDirect(rvvn, rvv)
rvv = rvvn
}
- } else if rvvMut {
- rvv = rvZeroAddrK(vtype, vtypeKind)
+ }
+ goto DECODE_VALUE_NO_CHECK_NIL
+
+ NEW_RVV:
+ if vtypePtr {
+ rvv = reflect.New(vtypeElem) // non-nil in stream, so allocate value
+ } else if decUseTransient && vTransient {
+ rvv = d.perType.TransientAddrK(vtype, vtypeKind)
} else {
- rvv = rvvn
+ rvv = rvZeroAddrK(vtype, vtypeKind)
}
- if valFn == nil {
- valFn = d.h.fn(vtypeLo)
- }
+ DECODE_VALUE_NO_CHECK_NIL:
+ d.decodeValueNoCheckNil(rvv, valFn)
- // We MUST be done with the stringview of the key, BEFORE decoding the value (rvv)
- // so that we don't unknowingly reuse the rvk backing buffer during rvv decode.
- if doMapSet && ktypeIsString { // set to a real string (not string view)
- rvk.SetString(d.string(kstrbs))
- }
- d.decodeValue(rvv, valFn)
if doMapSet {
- mapSet(rv, rvk, rvv)
+ if callFnRvk {
+ s = d.string(kstr2bs)
+ if ktypeIsString {
+ rvSetString(rvk, s)
+ } else { // ktypeIsIntf
+ rvSetIntf(rvk, rv4istr(s))
+ }
+ }
+ mapSet(rv, rvk, rvv, kfast, visindirect, visref)
}
}
d.mapEnd()
-
-}
-
-// decNaked is used to keep track of the primitives decoded.
-// Without it, we would have to decode each primitive and wrap it
-// in an interface{}, causing an allocation.
-// In this model, the primitives are decoded in a "pseudo-atomic" fashion,
-// so we can rest assured that no other decoding happens while these
-// primitives are being decoded.
-//
-// maps and arrays are not handled by this mechanism.
-// However, RawExt is, and we accommodate for extensions that decode
-// RawExt from DecodeNaked, but need to decode the value subsequently.
-// kInterfaceNaked and swallow, which call DecodeNaked, handle this caveat.
-//
-// However, decNaked also keeps some arrays of default maps and slices
-// used in DecodeNaked. This way, we can get a pointer to it
-// without causing a new heap allocation.
-//
-// kInterfaceNaked will ensure that there is no allocation for the common
-// uses.
-
-type decNaked struct {
- // r RawExt // used for RawExt, uint, []byte.
-
- // primitives below
- u uint64
- i int64
- f float64
- l []byte
- s string
-
- // ---- cpu cache line boundary?
- t time.Time
- b bool
-
- // state
- v valueType
}
// Decoder reads and decodes an object from an input stream in a supported format.
@@ -1139,8 +1322,6 @@ type decNaked struct {
// This is the idiomatic way to use.
type Decoder struct {
panicHdl
- // hopefully, reduce derefencing cost by laying the decReader inside the Decoder.
- // Try to put things that go together to fit within a cache line (8 words).
d decDriver
@@ -1156,14 +1337,17 @@ type Decoder struct {
decRd
// ---- cpu cache line boundary?
- n decNaked
+ n fauxUnion
hh Handle
err error
- // ---- cpu cache line boundary?
- is map[string]string // used for interning strings
+ perType decPerType
+ // used for interning strings
+ is internerMap
+
+ // ---- cpu cache line boundary?
// ---- writable fields during execution --- *try* to keep in sep cache line
maxdepth int16
depth int16
@@ -1174,9 +1358,8 @@ type Decoder struct {
calls uint16 // what depth in mustDecode are we in now.
c containerState
- _ [1]byte // padding
- // ---- cpu cache line boundary?
+ decByteState
// b is an always-available scratch buffer used by Decoder and decDrivers.
// By being always-available, it can be used for one-off things without
@@ -1190,7 +1373,9 @@ type Decoder struct {
// OR pass in a memory buffered reader (eg bufio.Reader, bytes.Buffer).
func NewDecoder(r io.Reader, h Handle) *Decoder {
d := h.newDecDriver().decoder()
- d.Reset(r)
+ if r != nil {
+ d.Reset(r)
+ }
return d
}
@@ -1198,45 +1383,63 @@ func NewDecoder(r io.Reader, h Handle) *Decoder {
// from a byte slice with zero copying.
func NewDecoderBytes(in []byte, h Handle) *Decoder {
d := h.newDecDriver().decoder()
- d.ResetBytes(in)
+ if in != nil {
+ d.ResetBytes(in)
+ }
return d
}
+// NewDecoderString returns a Decoder which efficiently decodes directly
+// from a string with zero copying.
+//
+// It is a convenience function that calls NewDecoderBytes with a
+// []byte view into the string.
+//
+// This can be an efficient zero-copy if using default mode i.e. without codec.safe tag.
+func NewDecoderString(s string, h Handle) *Decoder {
+ return NewDecoderBytes(bytesView(s), h)
+}
+
func (d *Decoder) r() *decRd {
return &d.decRd
}
func (d *Decoder) init(h Handle) {
+ initHandle(h)
d.bytes = true
d.err = errDecoderNotInitialized
- d.h = basicHandle(h)
+ d.h = h.getBasicHandle()
d.hh = h
d.be = h.isBinary()
- // NOTE: do not initialize d.n here. It is lazily initialized in d.naked()
- if d.h.InternString {
- d.is = make(map[string]string, 32)
+ if d.h.InternString && d.is == nil {
+ d.is.init()
}
+ // NOTE: do not initialize d.n here. It is lazily initialized in d.naked()
}
func (d *Decoder) resetCommon() {
d.d.reset()
d.err = nil
+ d.c = 0
+ d.decByteState = decByteStateNone
d.depth = 0
d.calls = 0
- d.maxdepth = d.h.MaxDepth
- if d.maxdepth <= 0 {
- d.maxdepth = decDefMaxDepth
- }
// reset all things which were cached from the Handle, but could change
- d.mtid, d.stid = 0, 0
- d.mtr, d.str = false, false
+ d.maxdepth = decDefMaxDepth
+ if d.h.MaxDepth > 0 {
+ d.maxdepth = d.h.MaxDepth
+ }
+ d.mtid = 0
+ d.stid = 0
+ d.mtr = false
+ d.str = false
if d.h.MapType != nil {
d.mtid = rt2id(d.h.MapType)
- d.mtr = fastpathAV.index(d.mtid) != -1
+ d.mtr = fastpathAvIndex(d.mtid) != -1
}
if d.h.SliceType != nil {
d.stid = rt2id(d.h.SliceType)
- d.str = fastpathAV.index(d.stid) != -1
+ d.str = fastpathAvIndex(d.stid) != -1
}
}
@@ -1244,7 +1447,7 @@ func (d *Decoder) resetCommon() {
// clearing all state from last run(s).
func (d *Decoder) Reset(r io.Reader) {
if r == nil {
- return
+ r = &eofReader
}
d.bytes = false
if d.h.ReaderBufferSize > 0 {
@@ -1253,12 +1456,14 @@ func (d *Decoder) Reset(r io.Reader) {
}
d.bi.reset(r, d.h.ReaderBufferSize, &d.blist)
d.bufio = true
+ d.decReader = d.bi
} else {
if d.ri == nil {
d.ri = new(ioDecReader)
}
d.ri.reset(r, &d.blist)
d.bufio = false
+ d.decReader = d.ri
}
d.resetCommon()
}
@@ -1267,15 +1472,27 @@ func (d *Decoder) Reset(r io.Reader) {
// clearing all state from last run(s).
func (d *Decoder) ResetBytes(in []byte) {
if in == nil {
- return
+ in = []byte{}
}
- d.bytes = true
d.bufio = false
+ d.bytes = true
+ d.decReader = &d.rb
d.rb.reset(in)
d.resetCommon()
}
-func (d *Decoder) naked() *decNaked {
+// ResetString resets the Decoder with a new string to decode from,
+// clearing all state from last run(s).
+//
+// It is a convenience function that calls ResetBytes with a
+// []byte view into the string.
+//
+// This can be an efficient zero-copy if using default mode i.e. without codec.safe tag.
+func (d *Decoder) ResetString(s string) {
+ d.ResetBytes(bytesView(s))
+}
+
+func (d *Decoder) naked() *fauxUnion {
return &d.n
}
@@ -1344,47 +1561,32 @@ func (d *Decoder) Decode(v interface{}) (err error) {
// tried to use closure, as runtime optimizes defer with no params.
// This seemed to be causing weird issues (like circular reference found, unexpected panic, etc).
// Also, see https://github.com/golang/go/issues/14939#issuecomment-417836139
- // defer func() { d.deferred(&err) }()
- // { x, y := d, &err; defer func() { x.deferred(y) }() }
- if d.err != nil {
- return d.err
- }
- if recoverPanicToErr {
+ if !debugging {
defer func() {
if x := recover(); x != nil {
panicValToErr(d, x, &d.err)
- if d.err != err {
- err = d.err
- }
+ err = d.err
}
}()
}
- // defer d.deferred(&err)
- d.mustDecode(v)
+ d.MustDecode(v)
return
}
// MustDecode is like Decode, but panics if unable to Decode.
-// This provides insight to the code location that triggered the error.
+//
+// Note: This provides insight to the code location that triggered the error.
func (d *Decoder) MustDecode(v interface{}) {
- if d.err != nil {
- panic(d.err)
+ halt.onerror(d.err)
+ if d.hh == nil {
+ halt.onerror(errNoFormatHandle)
}
- d.mustDecode(v)
-}
-// MustDecode is like Decode, but panics if unable to Decode.
-// This provides insight to the code location that triggered the error.
-func (d *Decoder) mustDecode(v interface{}) {
// Top-level: v is a pointer and not nil.
-
d.calls++
d.decode(v)
d.calls--
- if d.calls == 0 {
- d.d.atEndOfDecode()
- }
}
// Release releases shared (pooled) resources.
@@ -1400,47 +1602,27 @@ func (d *Decoder) Release() {
}
func (d *Decoder) swallow() {
- switch d.d.ContainerType() {
- case valueTypeNil:
- case valueTypeMap:
- containerLen := d.mapStart()
- hasLen := containerLen >= 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- d.swallow()
- d.mapElemValue()
- d.swallow()
- }
- d.mapEnd()
- case valueTypeArray:
- containerLen := d.arrayStart()
- hasLen := containerLen >= 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.arrayElem()
- d.swallow()
- }
- d.arrayEnd()
- case valueTypeBytes:
- d.d.DecodeBytes(d.b[:], true)
- case valueTypeString:
- d.d.DecodeStringAsBytes()
- default:
- // these are all primitives, which we can get from decodeNaked
- // if RawExt using Value, complete the processing.
- n := d.naked()
- d.d.DecodeNaked()
- if n.v == valueTypeExt && n.l == nil {
- var v2 interface{}
- d.decode(&v2)
- }
+ d.d.nextValueBytes(nil)
+}
+
+func (d *Decoder) swallowErr() (err error) {
+ if !debugging {
+ defer func() {
+ if x := recover(); x != nil {
+ panicValToErr(d, x, &err)
+ }
+ }()
}
+ d.swallow()
+ return
}
func setZero(iv interface{}) {
if iv == nil {
return
}
- if _, ok := isNil(iv); ok {
+ rv, ok := isNil(iv)
+ if ok {
return
}
// var canDecode bool
@@ -1473,23 +1655,28 @@ func setZero(iv interface{}) {
*v = 0
case *float64:
*v = 0
- case *[]uint8:
+ case *complex64:
+ *v = 0
+ case *complex128:
+ *v = 0
+ case *[]byte:
*v = nil
case *Raw:
*v = nil
case *time.Time:
*v = time.Time{}
case reflect.Value:
- setZeroRV(v)
+ decSetNonNilRV2Zero(v)
default:
if !fastpathDecodeSetZeroTypeSwitch(iv) {
- setZeroRV(rv4i(iv))
+ decSetNonNilRV2Zero(rv)
}
}
}
-func setZeroRV(v reflect.Value) {
- // It not decodeable, we do not touch it.
+// decSetNonNilRV2Zero will set the non-nil value to its zero value.
+func decSetNonNilRV2Zero(v reflect.Value) {
+ // If not decodeable (settable), we do not touch it.
// We considered empty'ing it if not decodeable e.g.
// - if chan, drain it
// - if map, clear it
@@ -1497,13 +1684,32 @@ func setZeroRV(v reflect.Value) {
//
// However, we decided instead that we either will set the
// whole value to the zero value, or leave AS IS.
- if isDecodeable(v) {
- if v.Kind() == reflect.Ptr {
- v = v.Elem()
- }
- if v.CanSet() {
- v.Set(reflect.Zero(v.Type()))
- }
+
+ k := v.Kind()
+ if k == reflect.Interface {
+ decSetNonNilRV2Zero4Intf(v)
+ } else if k == reflect.Ptr {
+ decSetNonNilRV2Zero4Ptr(v)
+ } else if v.CanSet() {
+ rvSetDirectZero(v)
+ }
+}
+
+func decSetNonNilRV2Zero4Ptr(v reflect.Value) {
+ ve := v.Elem()
+ if ve.CanSet() {
+ rvSetZero(ve) // we can have a pointer to an interface
+ } else if v.CanSet() {
+ rvSetZero(v)
+ }
+}
+
+func decSetNonNilRV2Zero4Intf(v reflect.Value) {
+ ve := v.Elem()
+ if ve.CanSet() {
+ rvSetDirectZero(ve) // interfaces always have element as a non-interface
+ } else if v.CanSet() {
+ rvSetZero(v)
}
}
@@ -1512,19 +1718,19 @@ func (d *Decoder) decode(iv interface{}) {
// consequently, we deal with nil and interfaces outside the switch.
if iv == nil {
- d.errorstr(errstrCannotDecodeIntoNil)
- return
+ d.onerror(errCannotDecodeIntoNil)
}
switch v := iv.(type) {
// case nil:
// case Selfer:
case reflect.Value:
- d.ensureDecodeable(v)
+ if x, _ := isDecodeable(v); !x {
+ d.haltAsNotDecodeable(v)
+ }
d.decodeValue(v, nil)
-
case *string:
- *v = string(d.d.DecodeStringAsBytes())
+ *v = d.stringZC(d.d.DecodeStringAsBytes())
case *bool:
*v = d.d.DecodeBool()
case *int:
@@ -1548,14 +1754,19 @@ func (d *Decoder) decode(iv interface{}) {
case *uint64:
*v = d.d.DecodeUint64()
case *float32:
- *v = float32(d.decodeFloat32())
+ *v = d.decodeFloat32()
case *float64:
*v = d.d.DecodeFloat64()
- case *[]uint8:
- *v = d.d.DecodeBytes(*v, false)
- case []uint8:
- b := d.d.DecodeBytes(v, false)
- if !(len(b) > 0 && len(b) == len(v) && &b[0] == &v[0]) {
+ case *complex64:
+ *v = complex(d.decodeFloat32(), 0)
+ case *complex128:
+ *v = complex(d.d.DecodeFloat64(), 0)
+ case *[]byte:
+ *v = d.decodeBytesInto(*v)
+ case []byte:
+ // not addressable byte slice, so do not decode into it past the length
+ b := d.decodeBytesInto(v[:len(v):len(v)])
+ if !(len(b) > 0 && len(b) == len(v) && &b[0] == &v[0]) { // not same slice
copy(v, b)
}
case *time.Time:
@@ -1564,14 +1775,15 @@ func (d *Decoder) decode(iv interface{}) {
*v = d.rawBytes()
case *interface{}:
- d.decodeValue(rv4i(iv), nil)
+ d.decodeValue(rv4iptr(v), nil)
default:
- if v, ok := iv.(Selfer); ok {
- v.CodecDecodeSelf(d)
- } else if !fastpathDecodeTypeSwitch(iv, d) {
- v := rv4i(iv)
- d.ensureDecodeable(v)
+ // we can't check non-predefined types, as they might be a Selfer or extension.
+ if skipFastpathTypeSwitchInDirectCall || !fastpathDecodeTypeSwitch(iv, d) {
+ v := reflect.ValueOf(iv)
+ if x, _ := isDecodeable(v); !x {
+ d.haltAsNotDecodeable(v)
+ }
d.decodeValue(v, nil)
}
}
@@ -1582,55 +1794,57 @@ func (d *Decoder) decode(iv interface{}) {
//
// This way, we know if it is itself a pointer, and can handle nil in
// the stream effectively.
+//
+// Note that decodeValue will handle nil in the stream early, so that the
+// subsequent calls i.e. kXXX methods, etc do not have to handle it themselves.
func (d *Decoder) decodeValue(rv reflect.Value, fn *codecFn) {
+ if d.d.TryNil() {
+ decSetNonNilRV2Zero(rv)
+ return
+ }
+ d.decodeValueNoCheckNil(rv, fn)
+}
+
+func (d *Decoder) decodeValueNoCheckNil(rv reflect.Value, fn *codecFn) {
// If stream is not containing a nil value, then we can deref to the base
// non-pointer value, and decode into that.
var rvp reflect.Value
var rvpValid bool
+PTR:
if rv.Kind() == reflect.Ptr {
- if d.d.TryNil() {
- if rvelem := rv.Elem(); rvelem.CanSet() {
- rvelem.Set(reflect.Zero(rvelem.Type()))
- }
- return
- }
rvpValid = true
- for rv.Kind() == reflect.Ptr {
- if rvIsNil(rv) {
- rvSetDirect(rv, reflect.New(rv.Type().Elem()))
- }
- rvp = rv
- rv = rv.Elem()
+ if rvIsNil(rv) {
+ rvSetDirect(rv, reflect.New(rvType(rv).Elem()))
}
+ rvp = rv
+ rv = rv.Elem()
+ goto PTR
}
if fn == nil {
- fn = d.h.fn(rv.Type())
+ fn = d.h.fn(rvType(rv))
}
if fn.i.addrD {
if rvpValid {
- fn.fd(d, &fn.i, rvp)
+ rv = rvp
} else if rv.CanAddr() {
- fn.fd(d, &fn.i, rv.Addr())
- } else if !fn.i.addrF {
- fn.fd(d, &fn.i, rv)
- } else {
+ rv = rvAddr(rv, fn.i.ti.ptr)
+ } else if fn.i.addrDf {
d.errorf("cannot decode into a non-pointer value")
}
- } else {
- fn.fd(d, &fn.i, rv)
}
+ fn.fd(d, &fn.i, rv)
}
func (d *Decoder) structFieldNotFound(index int, rvkencname string) {
- // NOTE: rvkencname may be a stringView, so don't pass it to another function.
+ // Note: rvkencname is used only if there is an error, to pass into d.errorf.
+ // Consequently, it is ok to pass in a stringView
+ // Since rvkencname may be a stringView, do NOT pass it to another function.
if d.h.ErrorIfNoField {
if index >= 0 {
d.errorf("no matching struct field found when decoding stream array at index %v", index)
- return
} else if rvkencname != "" {
d.errorf("no matching struct field found when decoding stream map with key " + rvkencname)
- return
}
}
d.swallow()
@@ -1642,49 +1856,21 @@ func (d *Decoder) arrayCannotExpand(sliceLen, streamLen int) {
}
}
-func isDecodeable(rv reflect.Value) (canDecode bool) {
- switch rv.Kind() {
- case reflect.Array:
- return rv.CanAddr()
- case reflect.Ptr:
- if !rvIsNil(rv) {
- return true
- }
- case reflect.Slice, reflect.Chan, reflect.Map:
- if !rvIsNil(rv) {
- return true
- }
- }
- return
-}
-
-func (d *Decoder) ensureDecodeable(rv reflect.Value) {
- // decode can take any reflect.Value that is a inherently addressable i.e.
- // - array
- // - non-nil chan (we will SEND to it)
- // - non-nil slice (we will set its elements)
- // - non-nil map (we will put into it)
- // - non-nil pointer (we can "update" it)
- if isDecodeable(rv) {
- return
- }
+func (d *Decoder) haltAsNotDecodeable(rv reflect.Value) {
if !rv.IsValid() {
- d.errorstr(errstrCannotDecodeIntoNil)
- return
+ d.onerror(errCannotDecodeIntoNil)
}
+ // check if an interface can be retrieved, before grabbing an interface
if !rv.CanInterface() {
d.errorf("cannot decode into a value without an interface: %v", rv)
- return
}
- rvi := rv2i(rv)
- rvk := rv.Kind()
- d.errorf("cannot decode into value of kind: %v, type: %T, %#v", rvk, rvi, rvi)
+ d.errorf("cannot decode into value of kind: %v, %#v", rv.Kind(), rv2i(rv))
}
func (d *Decoder) depthIncr() {
d.depth++
if d.depth >= d.maxdepth {
- panic(errMaxDepthExceeded)
+ d.onerror(errMaxDepthExceeded)
}
}
@@ -1692,45 +1878,45 @@ func (d *Decoder) depthDecr() {
d.depth--
}
-// Possibly get an interned version of a string
+// Possibly get an interned version of a string, iff InternString=true and decoding a map key.
//
// This should mostly be used for map keys, where the key type is string.
// This is because keys of a map/struct are typically reused across many objects.
func (d *Decoder) string(v []byte) (s string) {
- if v == nil {
- return
+ if d.is == nil || d.c != containerMapKey || len(v) < 2 || len(v) > internMaxStrLen {
+ return string(v)
}
- if d.is == nil {
- return string(v) // don't return stringView, as we need a real string here.
- }
- s, ok := d.is[string(v)] // no allocation here, per go implementation
- if !ok {
- s = string(v) // new allocation here
- d.is[s] = s
- }
- return
+ return d.is.string(v)
}
-// nextValueBytes returns the next value in the stream as a set of bytes.
-func (d *Decoder) nextValueBytes() (bs []byte) {
- d.d.uncacheRead()
- d.r().track()
- d.swallow()
- bs = d.r().stopTrack()
- return
+func (d *Decoder) zerocopy() bool {
+ return d.bytes && d.h.ZeroCopy
}
-func (d *Decoder) rawBytes() []byte {
+// decodeBytesInto is a convenience delegate function to decDriver.DecodeBytes.
+// It ensures that `in` is not a nil byte, before calling decDriver.DecodeBytes,
+// as decDriver.DecodeBytes treats a nil as a hint to use its internal scratch buffer.
+func (d *Decoder) decodeBytesInto(in []byte) (v []byte) {
+ if in == nil {
+ in = []byte{}
+ }
+ return d.d.DecodeBytes(in)
+}
+
+func (d *Decoder) rawBytes() (v []byte) {
// ensure that this is not a view into the bytes
- // i.e. make new copy always.
- bs := d.nextValueBytes()
- bs2 := make([]byte, len(bs))
- copy(bs2, bs)
- return bs2
+ // i.e. if necessary, make new copy always.
+ v = d.d.nextValueBytes([]byte{})
+ if d.bytes && !d.h.ZeroCopy {
+ v0 := v
+ v = make([]byte, len(v))
+ copy(v, v0)
+ }
+ return
}
-func (d *Decoder) wrapErr(v interface{}, err *error) {
- *err = decodeError{codecError: codecError{name: d.hh.Name(), err: v}, pos: d.NumBytesRead()}
+func (d *Decoder) wrapErr(v error, err *error) {
+ *err = wrapCodecErr(v, d.hh.Name(), d.NumBytesRead(), false)
}
// NumBytesRead returns the number of bytes read
@@ -1753,16 +1939,22 @@ func (d *Decoder) decodeFloat32() float32 {
// Note: We update the .c after calling the callback.
// This way, the callback can know what the last status was.
-// Note: if you call mapStart and it returns decContainerLenNil,
-// then do NOT call mapEnd.
+// MARKER: do not call mapEnd if mapStart returns containerLenNil.
-func (d *Decoder) mapStart() (v int) {
- v = d.d.ReadMapStart()
- if v != decContainerLenNil {
+func (d *Decoder) containerNext(j, containerLen int, hasLen bool) bool {
+ // return (hasLen && j < containerLen) || !(hasLen || slh.d.checkBreak())
+ if hasLen {
+ return j < containerLen
+ }
+ return !d.checkBreak()
+}
+
+func (d *Decoder) mapStart(v int) int {
+ if v != containerLenNil {
d.depthIncr()
d.c = containerMapStart
}
- return
+ return v
}
func (d *Decoder) mapElemKey() {
@@ -1782,17 +1974,15 @@ func (d *Decoder) mapElemValue() {
func (d *Decoder) mapEnd() {
d.d.ReadMapEnd()
d.depthDecr()
- // d.c = containerMapEnd
d.c = 0
}
-func (d *Decoder) arrayStart() (v int) {
- v = d.d.ReadArrayStart()
- if v != decContainerLenNil {
+func (d *Decoder) arrayStart(v int) int {
+ if v != containerLenNil {
d.depthIncr()
d.c = containerArrayStart
}
- return
+ return v
}
func (d *Decoder) arrayElem() {
@@ -1805,11 +1995,10 @@ func (d *Decoder) arrayElem() {
func (d *Decoder) arrayEnd() {
d.d.ReadArrayEnd()
d.depthDecr()
- // d.c = containerArrayEnd
d.c = 0
}
-func (d *Decoder) interfaceExtConvertAndDecode(v interface{}, ext Ext) {
+func (d *Decoder) interfaceExtConvertAndDecode(v interface{}, ext InterfaceExt) {
// var v interface{} = ext.ConvertExt(rv)
// d.d.decode(&v)
// ext.UpdateExt(rv, v)
@@ -1823,7 +2012,7 @@ func (d *Decoder) interfaceExtConvertAndDecode(v interface{}, ext Ext) {
// - interface should be a pointer if struct|array, else a value
var s interface{}
- rv := rv4i(v)
+ rv := reflect.ValueOf(v)
rv2 := rv.Elem()
rvk := rv2.Kind()
if rvk == reflect.Struct || rvk == reflect.Array {
@@ -1831,23 +2020,73 @@ func (d *Decoder) interfaceExtConvertAndDecode(v interface{}, ext Ext) {
} else {
s = ext.ConvertExt(rv2i(rv2))
}
- rv = rv4i(s)
+ rv = reflect.ValueOf(s)
+
+ // We cannot use isDecodeable here, as the value converted may be nil,
+ // or it may not be nil but is not addressable and thus we cannot extend it, etc.
+ // Instead, we just ensure that the value is addressable.
+
if !rv.CanAddr() {
- if rv.Kind() == reflect.Ptr {
- rv2 = reflect.New(rv.Type().Elem())
+ rvk = rv.Kind()
+ rv2 = d.oneShotAddrRV(rvType(rv), rvk)
+ if rvk == reflect.Interface {
+ rvSetIntf(rv2, rv)
} else {
- rv2 = rvZeroAddrK(rv.Type(), rv.Kind())
+ rvSetDirect(rv2, rv)
}
- rvSetDirect(rv2, rv)
rv = rv2
}
+
d.decodeValue(rv, nil)
ext.UpdateExt(v, rv2i(rv))
}
-func (d *Decoder) sideDecode(v interface{}, bs []byte) {
- rv := baseRV(v)
- NewDecoderBytes(bs, d.hh).decodeValue(rv, d.h.fnNoExt(rv.Type()))
+func (d *Decoder) sideDecode(v interface{}, basetype reflect.Type, bs []byte) {
+ // NewDecoderBytes(bs, d.hh).decodeValue(baseRV(v), d.h.fnNoExt(basetype))
+
+ defer func(rb bytesDecReader, bytes bool,
+ c containerState, dbs decByteState, depth int16, r decReader, state interface{}) {
+ d.rb = rb
+ d.bytes = bytes
+ d.c = c
+ d.decByteState = dbs
+ d.depth = depth
+ d.decReader = r
+ d.d.restoreState(state)
+ }(d.rb, d.bytes, d.c, d.decByteState, d.depth, d.decReader, d.d.captureState())
+
+ // d.rb.reset(in)
+ d.rb = bytesDecReader{bs[:len(bs):len(bs)], 0}
+ d.bytes = true
+ d.decReader = &d.rb
+ d.d.resetState()
+ d.c = 0
+ d.decByteState = decByteStateNone
+ d.depth = 0
+
+ // must call using fnNoExt
+ d.decodeValue(baseRV(v), d.h.fnNoExt(basetype))
+}
+
+func (d *Decoder) fauxUnionReadRawBytes(asString bool) {
+ if asString || d.h.RawToString {
+ d.n.v = valueTypeString
+ // fauxUnion is only used within DecodeNaked calls; consequently, we should try to intern.
+ d.n.s = d.stringZC(d.d.DecodeBytes(nil))
+ } else {
+ d.n.v = valueTypeBytes
+ d.n.l = d.d.DecodeBytes([]byte{})
+ }
+}
+
+func (d *Decoder) oneShotAddrRV(rvt reflect.Type, rvk reflect.Kind) reflect.Value {
+ if decUseTransient &&
+ (numBoolStrSliceBitset.isset(byte(rvk)) ||
+ ((rvk == reflect.Struct || rvk == reflect.Array) &&
+ d.h.getTypeInfo(rt2id(rvt), rvt).flagCanTransient)) {
+ return d.perType.TransientAddrK(rvt, rvk)
+ }
+ return rvZeroAddrK(rvt, rvk)
}
// --------------------------------------------------
@@ -1871,9 +2110,10 @@ func (d *Decoder) decSliceHelperStart() (x decSliceHelper, clen int) {
x.IsNil = true
case valueTypeArray:
x.Array = true
- clen = d.arrayStart()
+ clen = d.arrayStart(d.d.ReadArrayStart())
case valueTypeMap:
- clen = d.mapStart() * 2
+ clen = d.mapStart(d.d.ReadMapStart())
+ clen += clen
default:
d.errorf("only encoded map or array can be decoded into a slice (%d)", x.ct)
}
@@ -1894,15 +2134,152 @@ func (x decSliceHelper) ElemContainerState(index int) {
if x.Array {
x.d.arrayElem()
+ } else if index&1 == 0 { // index%2 == 0 {
+ x.d.mapElemKey()
} else {
- if index%2 == 0 {
- x.d.mapElemKey()
- } else {
- x.d.mapElemValue()
- }
+ x.d.mapElemValue()
}
}
+func (x decSliceHelper) arrayCannotExpand(hasLen bool, lenv, j, containerLenS int) {
+ x.d.arrayCannotExpand(lenv, j+1)
+ // drain completely and return
+ x.ElemContainerState(j)
+ x.d.swallow()
+ j++
+ for ; x.d.containerNext(j, containerLenS, hasLen); j++ {
+ x.ElemContainerState(j)
+ x.d.swallow()
+ }
+ x.End()
+}
+
+// decNextValueBytesHelper helps with NextValueBytes calls.
+//
+// Typical usage:
+// - each Handle's decDriver will implement a high level nextValueBytes,
+// which will track the current cursor, delegate to a nextValueBytesR
+// method, and then potentially call bytesRdV at the end.
+//
+// See simple.go for typical usage model.
+type decNextValueBytesHelper struct {
+ d *Decoder
+}
+
+func (x decNextValueBytesHelper) append1(v *[]byte, b byte) {
+ if *v != nil && !x.d.bytes {
+ *v = append(*v, b)
+ }
+}
+
+func (x decNextValueBytesHelper) appendN(v *[]byte, b ...byte) {
+ if *v != nil && !x.d.bytes {
+ *v = append(*v, b...)
+ }
+}
+
+func (x decNextValueBytesHelper) bytesRdV(v *[]byte, startpos uint) {
+ if x.d.bytes {
+ *v = x.d.rb.b[startpos:x.d.rb.c]
+ }
+}
+
+// decNegintPosintFloatNumberHelper is used for formats that are binary
+// and have distinct ways of storing positive integers vs negative integers
+// vs floats, which are uniquely identified by the byte descriptor.
+//
+// Currently, these formats are binc, cbor and simple.
+type decNegintPosintFloatNumberHelper struct {
+ d *Decoder
+}
+
+func (x decNegintPosintFloatNumberHelper) uint64(ui uint64, neg, ok bool) uint64 {
+ if ok && !neg {
+ return ui
+ }
+ return x.uint64TryFloat(ok)
+}
+
+func (x decNegintPosintFloatNumberHelper) uint64TryFloat(ok bool) (ui uint64) {
+ if ok { // neg = true
+ x.d.errorf("assigning negative signed value to unsigned type")
+ }
+ f, ok := x.d.d.decFloat()
+ if ok && f >= 0 && noFrac64(math.Float64bits(f)) {
+ ui = uint64(f)
+ } else {
+ x.d.errorf("invalid number loading uint64, with descriptor: %v", x.d.d.descBd())
+ }
+ return ui
+}
+
+func decNegintPosintFloatNumberHelperInt64v(ui uint64, neg, incrIfNeg bool) (i int64) {
+ if neg && incrIfNeg {
+ ui++
+ }
+ i = chkOvf.SignedIntV(ui)
+ if neg {
+ i = -i
+ }
+ return
+}
+
+func (x decNegintPosintFloatNumberHelper) int64(ui uint64, neg, ok bool) (i int64) {
+ if ok {
+ return decNegintPosintFloatNumberHelperInt64v(ui, neg, x.d.cbor)
+ }
+ // return x.int64TryFloat()
+ // }
+ // func (x decNegintPosintFloatNumberHelper) int64TryFloat() (i int64) {
+ f, ok := x.d.d.decFloat()
+ if ok && noFrac64(math.Float64bits(f)) {
+ i = int64(f)
+ } else {
+ x.d.errorf("invalid number loading uint64, with descriptor: %v", x.d.d.descBd())
+ }
+ return
+}
+
+func (x decNegintPosintFloatNumberHelper) float64(f float64, ok bool) float64 {
+ if ok {
+ return f
+ }
+ return x.float64TryInteger()
+}
+
+func (x decNegintPosintFloatNumberHelper) float64TryInteger() float64 {
+ ui, neg, ok := x.d.d.decInteger()
+ if !ok {
+ x.d.errorf("invalid descriptor for float: %v", x.d.d.descBd())
+ }
+ return float64(decNegintPosintFloatNumberHelperInt64v(ui, neg, x.d.cbor))
+}
+
+// isDecodeable checks if value can be decoded into
+//
+// decode can take any reflect.Value that is a inherently addressable i.e.
+// - non-nil chan (we will SEND to it)
+// - non-nil slice (we will set its elements)
+// - non-nil map (we will put into it)
+// - non-nil pointer (we can "update" it)
+// - func: no
+// - interface: no
+// - array: if canAddr=true
+// - any other value pointer: if canAddr=true
+func isDecodeable(rv reflect.Value) (canDecode bool, reason decNotDecodeableReason) {
+ switch rv.Kind() {
+ case reflect.Ptr, reflect.Slice, reflect.Chan, reflect.Map:
+ canDecode = !rvIsNil(rv)
+ reason = decNotDecodeableReasonNilReference
+ case reflect.Func, reflect.Interface, reflect.Invalid, reflect.UnsafePointer:
+ reason = decNotDecodeableReasonBadKind
+ default:
+ canDecode = rv.CanAddr()
+ reason = decNotDecodeableReasonNonAddrValue
+ }
+ return
+}
+
func decByteSlice(r *decRd, clen, maxInitLen int, bs []byte) (bsOut []byte) {
if clen == 0 {
return zeroByteSlice
@@ -1914,9 +2291,7 @@ func decByteSlice(r *decRd, clen, maxInitLen int, bs []byte) (bsOut []byte) {
bsOut = bs[:clen]
r.readb(bsOut)
} else {
- len2 := decInferLen(clen, maxInitLen, 1)
- bsOut = make([]byte, len2)
- r.readb(bsOut)
+ var len2 int
for len2 < clen {
len3 := decInferLen(clen-len2, maxInitLen, 1)
bs3 := bsOut
@@ -1929,40 +2304,20 @@ func decByteSlice(r *decRd, clen, maxInitLen int, bs []byte) (bsOut []byte) {
return
}
-// detachZeroCopyBytes will copy the in bytes into dest,
-// or create a new one if not large enough.
-//
-// It is used to ensure that the []byte returned is not
-// part of the input stream or input stream buffers.
-func detachZeroCopyBytes(isBytesReader bool, dest []byte, in []byte) (out []byte) {
- if len(in) > 0 {
- // if isBytesReader || len(in) <= scratchByteArrayLen {
- // if cap(dest) >= len(in) {
- // out = dest[:len(in)]
- // } else {
- // out = make([]byte, len(in))
- // }
- // copy(out, in)
- // return
- // }
- if cap(dest) >= len(in) {
- out = dest[:len(in)]
- } else {
- out = make([]byte, len(in))
- }
- copy(out, in)
- return
- }
- return in
-}
-
// decInferLen will infer a sensible length, given the following:
// - clen: length wanted.
// - maxlen: max length to be returned.
// if <= 0, it is unset, and we infer it based on the unit size
// - unit: number of bytes for each element of the collection
-func decInferLen(clen, maxlen, unit int) (rvlen int) {
- const maxLenIfUnset = 8 // 64
+func decInferLen(clen, maxlen, unit int) int {
+ // anecdotal testing showed increase in allocation with map length of 16.
+ // We saw same typical alloc from 0-8, then a 20% increase at 16.
+ // Thus, we set it to 8.
+ const (
+ minLenIfUnset = 8
+ maxMem = 256 * 1024 // 256Kb Memory
+ )
+
// handle when maxlen is not set i.e. <= 0
// clen==0: use 0
@@ -1971,64 +2326,25 @@ func decInferLen(clen, maxlen, unit int) (rvlen int) {
// maxlen<=0, clen>0: infer maxlen, and cap on it
// maxlen> 0, clen>0: cap at maxlen
- if clen == 0 {
- return
+ if clen == 0 || clen == containerLenNil {
+ return 0
}
if clen < 0 {
- if clen == decContainerLenNil {
- return 0
+ // if unspecified, return 64 for bytes, ... 8 for uint64, ... and everything else
+ clen = 64 / unit
+ if clen > minLenIfUnset {
+ return clen
}
- return maxLenIfUnset
+ return minLenIfUnset
}
- if unit == 0 {
+ if unit <= 0 {
return clen
}
if maxlen <= 0 {
- // no maxlen defined. Use maximum of 256K memory, with a floor of 4K items.
- // maxlen = 256 * 1024 / unit
- // if maxlen < (4 * 1024) {
- // maxlen = 4 * 1024
- // }
- if unit < (256 / 4) {
- maxlen = 256 * 1024 / unit
- } else {
- maxlen = 4 * 1024
- }
- // if maxlen > maxLenIfUnset {
- // maxlen = maxLenIfUnset
- // }
+ maxlen = maxMem / unit
}
- if clen > maxlen {
- rvlen = maxlen
- } else {
- rvlen = clen
- }
- return
-}
-
-func decReadFull(r io.Reader, bs []byte) (n uint, err error) {
- var nn int
- for n < uint(len(bs)) && err == nil {
- nn, err = r.Read(bs[n:])
- if nn > 0 {
- if err == io.EOF {
- // leave EOF for next time
- err = nil
- }
- n += uint(nn)
- }
- }
- // do not do this - it serves no purpose
- // if n != len(bs) && err == io.EOF { err = io.ErrUnexpectedEOF }
- return
-}
-
-func decNakedReadRawBytes(dr decDriver, d *Decoder, n *decNaked, rawToString bool) {
- if rawToString {
- n.v = valueTypeString
- n.s = string(dr.DecodeBytes(d.b[:], true))
- } else {
- n.v = valueTypeBytes
- n.l = dr.DecodeBytes(nil, false)
+ if clen < maxlen {
+ return clen
}
+ return maxlen
}
diff --git a/vendor/github.com/ugorji/go/codec/doc.go b/vendor/github.com/ugorji/go/codec/doc.go
index e987fa6ba..b390f9a8f 100644
--- a/vendor/github.com/ugorji/go/codec/doc.go
+++ b/vendor/github.com/ugorji/go/codec/doc.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
/*
@@ -16,7 +16,9 @@ Supported Serialization formats are:
This package will carefully use 'package 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 ...'.
+i.e. 'go install -tags=codec.safe ...'.
+
+This library works with both the standard `gc` and the `gccgo` compilers.
For detailed usage information, read the primer at http://ugorji.net/blog/go-codec-primer .
@@ -44,7 +46,7 @@ Rich Feature Set includes:
(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.
+ - Support using existence of `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
@@ -196,16 +198,16 @@ 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.
+You can run the tag 'codec.safe' to run tests or build in safe mode. e.g.
- go test -tags safe -run Json
- go test -tags "alltests safe" -run Suite
+ go test -tags codec.safe -run Json
+ go test -tags "alltests codec.safe" -run Suite
Running Benchmarks
cd bench
go test -bench . -benchmem -benchtime 1s
-
+
Please see http://github.com/ugorji/go-codec-bench .
Caveats
diff --git a/vendor/github.com/ugorji/go/codec/encode.go b/vendor/github.com/ugorji/go/codec/encode.go
index 351dd2d0b..e411bdb81 100644
--- a/vendor/github.com/ugorji/go/codec/encode.go
+++ b/vendor/github.com/ugorji/go/codec/encode.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
@@ -6,7 +6,6 @@ package codec
import (
"encoding"
"errors"
- "fmt"
"io"
"reflect"
"sort"
@@ -29,7 +28,7 @@ type encDriver interface {
EncodeFloat32(f float32)
EncodeFloat64(f float64)
EncodeRawExt(re *RawExt)
- EncodeExt(v interface{}, xtag uint64, ext Ext)
+ EncodeExt(v interface{}, basetype reflect.Type, xtag uint64, ext Ext)
// EncodeString using cUTF8, honor'ing StringToRaw flag
EncodeString(v string)
EncodeStringBytesRaw(v []byte)
@@ -39,9 +38,12 @@ type encDriver interface {
WriteMapStart(length int)
WriteMapEnd()
+ // reset will reset current encoding runtime state, and cached information from the handle
reset()
- atEndOfEncode()
+
encoder() *Encoder
+
+ driverStateManager
}
type encDriverContainerTracker interface {
@@ -50,13 +52,12 @@ type encDriverContainerTracker interface {
WriteMapElemValue()
}
-type encodeError struct {
- codecError
-}
+type encDriverNoState struct{}
-func (e encodeError) Error() string {
- return fmt.Sprintf("%s encode error: %v", e.name, e.err)
-}
+func (encDriverNoState) captureState() interface{} { return nil }
+func (encDriverNoState) reset() {}
+func (encDriverNoState) resetState() {}
+func (encDriverNoState) restoreState(v interface{}) {}
type encDriverNoopContainerWriter struct{}
@@ -64,7 +65,23 @@ func (encDriverNoopContainerWriter) WriteArrayStart(length int) {}
func (encDriverNoopContainerWriter) WriteArrayEnd() {}
func (encDriverNoopContainerWriter) WriteMapStart(length int) {}
func (encDriverNoopContainerWriter) WriteMapEnd() {}
-func (encDriverNoopContainerWriter) atEndOfEncode() {}
+
+// encStructFieldObj[Slice] is used for sorting when there are missing fields and canonical flag is set
+type encStructFieldObj struct {
+ key string
+ rv reflect.Value
+ intf interface{}
+ ascii bool
+ isRv bool
+}
+
+type encStructFieldObjSlice []encStructFieldObj
+
+func (p encStructFieldObjSlice) Len() int { return len(p) }
+func (p encStructFieldObjSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p encStructFieldObjSlice) Less(i, j int) bool {
+ return p[uint(i)].key < p[uint(j)].key
+}
// EncodeOptions captures configuration options during encode.
type EncodeOptions struct {
@@ -109,10 +126,16 @@ type EncodeOptions struct {
// This is opt-in, as there may be a performance hit to checking circular references.
CheckCircularRef bool
- // RecursiveEmptyCheck controls whether we descend into interfaces, structs and pointers
- // when checking if a value is empty.
+ // RecursiveEmptyCheck controls how we determine whether a value is empty.
//
- // Note that this may make OmitEmpty more expensive, as it incurs a lot more reflect calls.
+ // If true, we descend into interfaces and pointers to reursively check if value is empty.
+ //
+ // We *might* check struct fields one by one to see if empty
+ // (if we cannot directly check if a struct value is equal to its zero value).
+ // If so, we honor IsZero, Comparable, IsCodecEmpty(), etc.
+ // Note: This *may* make OmitEmpty more expensive due to the large number of reflect calls.
+ //
+ // If false, we check if the value is equal to its zero value (newly allocated state).
RecursiveEmptyCheck bool
// Raw controls whether we encode Raw values.
@@ -135,20 +158,23 @@ type EncodeOptions struct {
// These include encoding.TextMarshaler, time.Format calls, struct field names, etc.
StringToRaw bool
- // // AsSymbols defines what should be encoded as symbols.
- // //
- // // Encoding as symbols can reduce the encoded size significantly.
- // //
- // // However, during decoding, each string to be encoded as a symbol must
- // // be checked to see if it has been seen before. Consequently, encoding time
- // // will increase if using symbols, because string comparisons has a clear cost.
- // //
- // // Sample values:
- // // AsSymbolNone
- // // AsSymbolAll
- // // AsSymbolMapStringKeys
- // // AsSymbolMapStringKeysFlag | AsSymbolStructFieldNameFlag
- // AsSymbols AsSymbolFlag
+ // OptimumSize controls whether we optimize for the smallest size.
+ //
+ // Some formats will use this flag to determine whether to encode
+ // in the smallest size possible, even if it takes slightly longer.
+ //
+ // For example, some formats that support half-floats might check if it is possible
+ // to store a float64 as a half float. Doing this check has a small performance cost,
+ // but the benefit is that the encoded message will be smaller.
+ OptimumSize bool
+
+ // NoAddressableReadonly controls whether we try to force a non-addressable value
+ // to be addressable so we can call a pointer method on it e.g. for types
+ // that support Selfer, json.Marshaler, etc.
+ //
+ // Use it in the very rare occurrence that your types modify a pointer value when calling
+ // an encode callback function e.g. JsonMarshal, TextMarshal, BinaryMarshal or CodecEncodeSelf.
+ NoAddressableReadonly bool
}
// ---------------------------------------------
@@ -158,7 +184,7 @@ func (e *Encoder) rawExt(f *codecFnInfo, rv reflect.Value) {
}
func (e *Encoder) ext(f *codecFnInfo, rv reflect.Value) {
- e.e.EncodeExt(rv2i(rv), f.xfTag, f.xfFn)
+ e.e.EncodeExt(rv2i(rv), f.ti.rt, f.xfTag, f.xfFn)
}
func (e *Encoder) selferMarshal(f *codecFnInfo, rv reflect.Value) {
@@ -184,6 +210,20 @@ func (e *Encoder) raw(f *codecFnInfo, rv reflect.Value) {
e.rawBytes(rv2i(rv).(Raw))
}
+func (e *Encoder) encodeComplex64(v complex64) {
+ if imag(v) != 0 {
+ e.errorf("cannot encode complex number: %v, with imaginary values: %v", v, imag(v))
+ }
+ e.e.EncodeFloat32(real(v))
+}
+
+func (e *Encoder) encodeComplex128(v complex128) {
+ if imag(v) != 0 {
+ e.errorf("cannot encode complex number: %v, with imaginary values: %v", v, imag(v))
+ }
+ e.e.EncodeFloat64(real(v))
+}
+
func (e *Encoder) kBool(f *codecFnInfo, rv reflect.Value) {
e.e.EncodeBool(rvGetBool(rv))
}
@@ -196,12 +236,20 @@ func (e *Encoder) kString(f *codecFnInfo, rv reflect.Value) {
e.e.EncodeString(rvGetString(rv))
}
+func (e *Encoder) kFloat32(f *codecFnInfo, rv reflect.Value) {
+ e.e.EncodeFloat32(rvGetFloat32(rv))
+}
+
func (e *Encoder) kFloat64(f *codecFnInfo, rv reflect.Value) {
e.e.EncodeFloat64(rvGetFloat64(rv))
}
-func (e *Encoder) kFloat32(f *codecFnInfo, rv reflect.Value) {
- e.e.EncodeFloat32(rvGetFloat32(rv))
+func (e *Encoder) kComplex64(f *codecFnInfo, rv reflect.Value) {
+ e.encodeComplex64(rvGetComplex64(rv))
+}
+
+func (e *Encoder) kComplex128(f *codecFnInfo, rv reflect.Value) {
+ e.encodeComplex128(rvGetComplex128(rv))
}
func (e *Encoder) kInt(f *codecFnInfo, rv reflect.Value) {
@@ -248,16 +296,12 @@ func (e *Encoder) kUintptr(f *codecFnInfo, rv reflect.Value) {
e.e.EncodeUint(uint64(rvGetUintptr(rv)))
}
-func (e *Encoder) kInvalid(f *codecFnInfo, rv reflect.Value) {
- e.e.EncodeNil()
-}
-
func (e *Encoder) kErr(f *codecFnInfo, rv reflect.Value) {
e.errorf("unsupported kind %s, for %#v", rv.Kind(), rv)
}
func chanToSlice(rv reflect.Value, rtslice reflect.Type, timeout time.Duration) (rvcs reflect.Value) {
- rvcs = reflect.Zero(rtslice)
+ rvcs = rvZeroK(rtslice, reflect.Slice)
if timeout < 0 { // consume until close
for {
recv, recvOk := rv.Recv()
@@ -273,7 +317,7 @@ func chanToSlice(rv reflect.Value, rtslice reflect.Type, timeout time.Duration)
cases[1] = reflect.SelectCase{Dir: reflect.SelectDefault}
} else {
tt := time.NewTimer(timeout)
- cases[1] = reflect.SelectCase{Dir: reflect.SelectRecv, Chan: rv4i(tt.C)}
+ cases[1] = reflect.SelectCase{Dir: reflect.SelectRecv, Chan: reflect.ValueOf(tt.C)}
}
for {
chosen, recv, recvOk := reflect.Select(cases)
@@ -290,9 +334,8 @@ func (e *Encoder) kSeqFn(rtelem reflect.Type) (fn *codecFn) {
for rtelem.Kind() == reflect.Ptr {
rtelem = rtelem.Elem()
}
- // if kind is reflect.Interface, do not pre-determine the
- // encoding type, because preEncodeValue may break it down to
- // a concrete type and kInterface will bomb.
+ // if kind is reflect.Interface, do not pre-determine the encoding type,
+ // because preEncodeValue may break it down to a concrete type and kInterface will bomb.
if rtelem.Kind() != reflect.Interface {
fn = e.h.fn(rtelem)
}
@@ -300,18 +343,15 @@ func (e *Encoder) kSeqFn(rtelem reflect.Type) (fn *codecFn) {
}
func (e *Encoder) kSliceWMbs(rv reflect.Value, ti *typeInfo) {
- var l = rvGetSliceLen(rv)
+ var l = rvLenSlice(rv)
if l == 0 {
e.mapStart(0)
} else {
- if l%2 == 1 {
- e.errorf("mapBySlice requires even slice length, but got %v", l)
- return
- }
- e.mapStart(l / 2)
+ e.haltOnMbsOddLen(l)
+ e.mapStart(l >> 1) // e.mapStart(l / 2)
fn := e.kSeqFn(ti.elem)
for j := 0; j < l; j++ {
- if j%2 == 0 {
+ if j&1 == 0 { // j%2 == 0 {
e.mapElemKey()
} else {
e.mapElemValue()
@@ -323,7 +363,7 @@ func (e *Encoder) kSliceWMbs(rv reflect.Value, ti *typeInfo) {
}
func (e *Encoder) kSliceW(rv reflect.Value, ti *typeInfo) {
- var l = rvGetSliceLen(rv)
+ var l = rvLenSlice(rv)
e.arrayStart(l)
if l > 0 {
fn := e.kSeqFn(ti.elem)
@@ -335,19 +375,16 @@ func (e *Encoder) kSliceW(rv reflect.Value, ti *typeInfo) {
e.arrayEnd()
}
-func (e *Encoder) kSeqWMbs(rv reflect.Value, ti *typeInfo) {
+func (e *Encoder) kArrayWMbs(rv reflect.Value, ti *typeInfo) {
var l = rv.Len()
if l == 0 {
e.mapStart(0)
} else {
- if l%2 == 1 {
- e.errorf("mapBySlice requires even slice length, but got %v", l)
- return
- }
- e.mapStart(l / 2)
+ e.haltOnMbsOddLen(l)
+ e.mapStart(l >> 1) // e.mapStart(l / 2)
fn := e.kSeqFn(ti.elem)
for j := 0; j < l; j++ {
- if j%2 == 0 {
+ if j&1 == 0 { // j%2 == 0 {
e.mapElemKey()
} else {
e.mapElemValue()
@@ -358,7 +395,7 @@ func (e *Encoder) kSeqWMbs(rv reflect.Value, ti *typeInfo) {
e.mapEnd()
}
-func (e *Encoder) kSeqW(rv reflect.Value, ti *typeInfo) {
+func (e *Encoder) kArrayW(rv reflect.Value, ti *typeInfo) {
var l = rv.Len()
e.arrayStart(l)
if l > 0 {
@@ -372,13 +409,8 @@ func (e *Encoder) kSeqW(rv reflect.Value, ti *typeInfo) {
}
func (e *Encoder) kChan(f *codecFnInfo, rv reflect.Value) {
- if rvIsNil(rv) {
- e.e.EncodeNil()
- return
- }
if f.ti.chandir&uint8(reflect.RecvDir) == 0 {
e.errorf("send-only channel cannot be encoded")
- return
}
if !f.ti.mbs && uint8TypId == rt2id(f.ti.elem) {
e.kSliceBytesChan(rv)
@@ -395,30 +427,22 @@ func (e *Encoder) kChan(f *codecFnInfo, rv reflect.Value) {
}
func (e *Encoder) kSlice(f *codecFnInfo, rv reflect.Value) {
- if rvIsNil(rv) {
- e.e.EncodeNil()
- return
- }
if f.ti.mbs {
e.kSliceWMbs(rv, f.ti)
+ } else if f.ti.rtid == uint8SliceTypId || uint8TypId == rt2id(f.ti.elem) {
+ e.e.EncodeStringBytesRaw(rvGetBytes(rv))
} else {
- if f.ti.rtid == uint8SliceTypId || uint8TypId == rt2id(f.ti.elem) {
- e.e.EncodeStringBytesRaw(rvGetBytes(rv))
- } else {
- e.kSliceW(rv, f.ti)
- }
+ e.kSliceW(rv, f.ti)
}
}
func (e *Encoder) kArray(f *codecFnInfo, rv reflect.Value) {
if f.ti.mbs {
- e.kSeqWMbs(rv, f.ti)
+ e.kArrayWMbs(rv, f.ti)
+ } else if handleBytesWithinKArray && uint8TypId == rt2id(f.ti.elem) {
+ e.e.EncodeStringBytesRaw(rvGetArrayBytes(rv, []byte{}))
} else {
- if uint8TypId == rt2id(f.ti.elem) {
- e.e.EncodeStringBytesRaw(rvGetArrayBytesRO(rv, e.b[:]))
- } else {
- e.kSeqW(rv, f.ti)
- }
+ e.kArrayW(rv, f.ti)
}
}
@@ -426,10 +450,9 @@ func (e *Encoder) kSliceBytesChan(rv reflect.Value) {
// do not use range, so that the number of elements encoded
// does not change, and encoding does not hang waiting on someone to close chan.
- // for b := range rv2i(rv).(<-chan byte) { bs = append(bs, b) }
- // ch := rv2i(rv).(<-chan byte) // fix error - that this is a chan byte, not a <-chan byte.
+ bs0 := e.blist.peek(32, true)
+ bs := bs0
- bs := e.b[:0]
irv := rv2i(rv)
ch, ok := irv.(<-chan byte)
if !ok {
@@ -465,24 +488,38 @@ L1:
}
e.e.EncodeStringBytesRaw(bs)
+ e.blist.put(bs)
+ if !byteSliceSameData(bs0, bs) {
+ e.blist.put(bs0)
+ }
+}
+
+func (e *Encoder) kStructSfi(f *codecFnInfo) []*structFieldInfo {
+ if e.h.Canonical {
+ return f.ti.sfi.sorted()
+ }
+ return f.ti.sfi.source()
}
func (e *Encoder) kStructNoOmitempty(f *codecFnInfo, rv reflect.Value) {
- sfn := structFieldNode{v: rv, update: false}
+ var tisfi []*structFieldInfo
if f.ti.toArray || e.h.StructToArray { // toArray
- e.arrayStart(len(f.ti.sfiSrc))
- for _, si := range f.ti.sfiSrc {
+ tisfi = f.ti.sfi.source()
+ e.arrayStart(len(tisfi))
+ for _, si := range tisfi {
e.arrayElem()
- e.encodeValue(sfn.field(si), nil)
+ e.encodeValue(si.path.field(rv), nil)
}
e.arrayEnd()
} else {
- e.mapStart(len(f.ti.sfiSort))
- for _, si := range f.ti.sfiSort {
+ tisfi = e.kStructSfi(f)
+ e.mapStart(len(tisfi))
+ keytyp := f.ti.keyType
+ for _, si := range tisfi {
e.mapElemKey()
- e.kStructFieldKey(f.ti.keyType, si.encNameAsciiAlphaNum, si.encName)
+ e.kStructFieldKey(keytyp, si.path.encNameAsciiAlphaNum, si.encName)
e.mapElemValue()
- e.encodeValue(sfn.field(si), nil)
+ e.encodeValue(si.path.field(rv), nil)
}
e.mapEnd()
}
@@ -494,80 +531,106 @@ func (e *Encoder) kStructFieldKey(keyType valueType, encNameAsciiAlphaNum bool,
func (e *Encoder) kStruct(f *codecFnInfo, rv reflect.Value) {
var newlen int
- toMap := !(f.ti.toArray || e.h.StructToArray)
+ ti := f.ti
+ toMap := !(ti.toArray || e.h.StructToArray)
var mf map[string]interface{}
- if f.ti.isFlag(tiflagMissingFielder) {
+ if ti.flagMissingFielder {
mf = rv2i(rv).(MissingFielder).CodecMissingFields()
toMap = true
newlen += len(mf)
- } else if f.ti.isFlag(tiflagMissingFielderPtr) {
- if rv.CanAddr() {
- mf = rv2i(rv.Addr()).(MissingFielder).CodecMissingFields()
- } else {
- // make a new addressable value of same one, and use it
- rv2 := reflect.New(rv.Type())
- rvSetDirect(rv2.Elem(), rv)
- mf = rv2i(rv2).(MissingFielder).CodecMissingFields()
- }
+ } else if ti.flagMissingFielderPtr {
+ rv2 := e.addrRV(rv, ti.rt, ti.ptr)
+ mf = rv2i(rv2).(MissingFielder).CodecMissingFields()
toMap = true
newlen += len(mf)
}
- newlen += len(f.ti.sfiSrc)
+ tisfi := ti.sfi.source()
+ newlen += len(tisfi)
- var fkvs = e.slist.get(newlen)
+ var fkvs = e.slist.get(newlen)[:newlen]
recur := e.h.RecursiveEmptyCheck
- sfn := structFieldNode{v: rv, update: false}
var kv sfiRv
var j int
if toMap {
newlen = 0
- for _, si := range f.ti.sfiSort { // use sorted array
- kv.r = sfn.field(si)
- if si.omitEmpty() && isEmptyValue(kv.r, e.h.TypeInfos, recur, recur) {
+ for _, si := range e.kStructSfi(f) {
+ kv.r = si.path.field(rv)
+ if si.path.omitEmpty && isEmptyValue(kv.r, e.h.TypeInfos, recur) {
continue
}
- kv.v = si // si.encName
+ kv.v = si
fkvs[newlen] = kv
newlen++
}
- var mflen int
- for k, v := range mf {
- if k == "" {
- delete(mf, k)
- continue
+
+ var mf2s []stringIntf
+ if len(mf) > 0 {
+ mf2s = make([]stringIntf, 0, len(mf))
+ for k, v := range mf {
+ if k == "" {
+ continue
+ }
+ if ti.infoFieldOmitempty && isEmptyValue(reflect.ValueOf(v), e.h.TypeInfos, recur) {
+ continue
+ }
+ mf2s = append(mf2s, stringIntf{k, v})
}
- if f.ti.infoFieldOmitempty && isEmptyValue(rv4i(v), e.h.TypeInfos, recur, recur) {
- delete(mf, k)
- continue
+ }
+
+ e.mapStart(newlen + len(mf2s))
+
+ // When there are missing fields, and Canonical flag is set,
+ // we cannot have the missing fields and struct fields sorted independently.
+ // We have to capture them together and sort as a unit.
+
+ if len(mf2s) > 0 && e.h.Canonical {
+ mf2w := make([]encStructFieldObj, newlen+len(mf2s))
+ for j = 0; j < newlen; j++ {
+ kv = fkvs[j]
+ mf2w[j] = encStructFieldObj{kv.v.encName, kv.r, nil, kv.v.path.encNameAsciiAlphaNum, true}
+ }
+ for _, v := range mf2s {
+ mf2w[j] = encStructFieldObj{v.v, reflect.Value{}, v.i, false, false}
+ j++
+ }
+ sort.Sort((encStructFieldObjSlice)(mf2w))
+ for _, v := range mf2w {
+ e.mapElemKey()
+ e.kStructFieldKey(ti.keyType, v.ascii, v.key)
+ e.mapElemValue()
+ if v.isRv {
+ e.encodeValue(v.rv, nil)
+ } else {
+ e.encode(v.intf)
+ }
+ }
+ } else {
+ keytyp := ti.keyType
+ for j = 0; j < newlen; j++ {
+ kv = fkvs[j]
+ e.mapElemKey()
+ e.kStructFieldKey(keytyp, kv.v.path.encNameAsciiAlphaNum, kv.v.encName)
+ e.mapElemValue()
+ e.encodeValue(kv.r, nil)
+ }
+ for _, v := range mf2s {
+ e.mapElemKey()
+ e.kStructFieldKey(keytyp, false, v.v)
+ e.mapElemValue()
+ e.encode(v.i)
}
- mflen++
- }
- // encode it all
- e.mapStart(newlen + mflen)
- for j = 0; j < newlen; j++ {
- kv = fkvs[j]
- e.mapElemKey()
- e.kStructFieldKey(f.ti.keyType, kv.v.encNameAsciiAlphaNum, kv.v.encName)
- e.mapElemValue()
- e.encodeValue(kv.r, nil)
- }
- // now, add the others
- for k, v := range mf {
- e.mapElemKey()
- e.kStructFieldKey(f.ti.keyType, false, k)
- e.mapElemValue()
- e.encode(v)
}
+
e.mapEnd()
} else {
- newlen = len(f.ti.sfiSrc)
- for i, si := range f.ti.sfiSrc { // use unsorted array (to match sequence in struct)
- kv.r = sfn.field(si)
+ newlen = len(tisfi)
+ for i, si := range tisfi { // use unsorted array (to match sequence in struct)
+ kv.r = si.path.field(rv)
// use the zero value.
// if a reference or struct, set to nil (so you do not output too much)
- if si.omitEmpty() && isEmptyValue(kv.r, e.h.TypeInfos, recur, recur) {
+ if si.path.omitEmpty && isEmptyValue(kv.r, e.h.TypeInfos, recur) {
switch kv.r.Kind() {
case reflect.Struct, reflect.Interface, reflect.Ptr, reflect.Array, reflect.Map, reflect.Slice:
kv.r = reflect.Value{} //encode as nil
@@ -587,17 +650,11 @@ func (e *Encoder) kStruct(f *codecFnInfo, rv reflect.Value) {
// do not use defer. Instead, use explicit pool return at end of function.
// defer has a cost we are trying to avoid.
// If there is a panic and these slices are not returned, it is ok.
- // spool.end()
e.slist.put(fkvs)
}
func (e *Encoder) kMap(f *codecFnInfo, rv reflect.Value) {
- if rvIsNil(rv) {
- e.e.EncodeNil()
- return
- }
-
- l := rv.Len()
+ l := rvLenMap(rv)
e.mapStart(l)
if l == 0 {
e.mapEnd()
@@ -614,8 +671,8 @@ func (e *Encoder) kMap(f *codecFnInfo, rv reflect.Value) {
var keyFn, valFn *codecFn
- ktypeKind := f.ti.key.Kind()
- vtypeKind := f.ti.elem.Kind()
+ ktypeKind := reflect.Kind(f.ti.keykind)
+ vtypeKind := reflect.Kind(f.ti.elemkind)
rtval := f.ti.elem
rtvalkind := vtypeKind
@@ -627,10 +684,10 @@ func (e *Encoder) kMap(f *codecFnInfo, rv reflect.Value) {
valFn = e.h.fn(rtval)
}
- var rvv = mapAddressableRV(f.ti.elem, vtypeKind)
+ var rvv = mapAddrLoopvarRV(f.ti.elem, vtypeKind)
if e.h.Canonical {
- e.kMapCanonical(f.ti.key, f.ti.elem, rv, rvv, valFn)
+ e.kMapCanonical(f.ti, rv, rvv, valFn)
e.mapEnd()
return
}
@@ -646,43 +703,38 @@ func (e *Encoder) kMap(f *codecFnInfo, rv reflect.Value) {
}
}
- var rvk = mapAddressableRV(f.ti.key, ktypeKind)
+ var rvk = mapAddrLoopvarRV(f.ti.key, ktypeKind)
var it mapIter
mapRange(&it, rv, rvk, rvv, true)
- validKV := it.ValidKV()
- var vx reflect.Value
+
for it.Next() {
e.mapElemKey()
- if validKV {
- vx = it.Key()
- } else {
- vx = rvk
- }
if keyTypeIsString {
- e.e.EncodeString(vx.String())
+ e.e.EncodeString(it.Key().String())
} else {
- e.encodeValue(vx, keyFn)
+ e.encodeValue(it.Key(), keyFn)
}
e.mapElemValue()
- if validKV {
- vx = it.Value()
- } else {
- vx = rvv
- }
- e.encodeValue(vx, valFn)
+ e.encodeValue(it.Value(), valFn)
}
it.Done()
e.mapEnd()
}
-func (e *Encoder) kMapCanonical(rtkey, rtval reflect.Type, rv, rvv reflect.Value, valFn *codecFn) {
+func (e *Encoder) kMapCanonical(ti *typeInfo, rv, rvv reflect.Value, valFn *codecFn) {
// we previously did out-of-band if an extension was registered.
// This is not necessary, as the natural kind is sufficient for ordering.
+ rtkey := ti.key
mks := rv.MapKeys()
- switch rtkey.Kind() {
+ rtkeyKind := rtkey.Kind()
+ kfast := mapKeyFastKindFor(rtkeyKind)
+ visindirect := mapStoresElemIndirect(uintptr(ti.elemsize))
+ visref := refBitset.isset(ti.elemkind)
+
+ switch rtkeyKind {
case reflect.Bool:
mksv := make([]boolRv, len(mks))
for i, k := range mks {
@@ -695,7 +747,7 @@ func (e *Encoder) kMapCanonical(rtkey, rtval reflect.Type, rv, rvv reflect.Value
e.mapElemKey()
e.e.EncodeBool(mksv[i].v)
e.mapElemValue()
- e.encodeValue(mapGet(rv, mksv[i].r, rvv), valFn)
+ e.encodeValue(mapGet(rv, mksv[i].r, rvv, kfast, visindirect, visref), valFn)
}
case reflect.String:
mksv := make([]stringRv, len(mks))
@@ -709,7 +761,7 @@ func (e *Encoder) kMapCanonical(rtkey, rtval reflect.Type, rv, rvv reflect.Value
e.mapElemKey()
e.e.EncodeString(mksv[i].v)
e.mapElemValue()
- e.encodeValue(mapGet(rv, mksv[i].r, rvv), valFn)
+ e.encodeValue(mapGet(rv, mksv[i].r, rvv, kfast, visindirect, visref), valFn)
}
case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint, reflect.Uintptr:
mksv := make([]uint64Rv, len(mks))
@@ -723,7 +775,7 @@ func (e *Encoder) kMapCanonical(rtkey, rtval reflect.Type, rv, rvv reflect.Value
e.mapElemKey()
e.e.EncodeUint(mksv[i].v)
e.mapElemValue()
- e.encodeValue(mapGet(rv, mksv[i].r, rvv), valFn)
+ e.encodeValue(mapGet(rv, mksv[i].r, rvv, kfast, visindirect, visref), valFn)
}
case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
mksv := make([]int64Rv, len(mks))
@@ -737,7 +789,7 @@ func (e *Encoder) kMapCanonical(rtkey, rtval reflect.Type, rv, rvv reflect.Value
e.mapElemKey()
e.e.EncodeInt(mksv[i].v)
e.mapElemValue()
- e.encodeValue(mapGet(rv, mksv[i].r, rvv), valFn)
+ e.encodeValue(mapGet(rv, mksv[i].r, rvv, kfast, visindirect, visref), valFn)
}
case reflect.Float32:
mksv := make([]float64Rv, len(mks))
@@ -751,7 +803,7 @@ func (e *Encoder) kMapCanonical(rtkey, rtval reflect.Type, rv, rvv reflect.Value
e.mapElemKey()
e.e.EncodeFloat32(float32(mksv[i].v))
e.mapElemValue()
- e.encodeValue(mapGet(rv, mksv[i].r, rvv), valFn)
+ e.encodeValue(mapGet(rv, mksv[i].r, rvv, kfast, visindirect, visref), valFn)
}
case reflect.Float64:
mksv := make([]float64Rv, len(mks))
@@ -765,7 +817,7 @@ func (e *Encoder) kMapCanonical(rtkey, rtval reflect.Type, rv, rvv reflect.Value
e.mapElemKey()
e.e.EncodeFloat64(mksv[i].v)
e.mapElemValue()
- e.encodeValue(mapGet(rv, mksv[i].r, rvv), valFn)
+ e.encodeValue(mapGet(rv, mksv[i].r, rvv, kfast, visindirect, visref), valFn)
}
case reflect.Struct:
if rtkey == timeTyp {
@@ -780,7 +832,7 @@ func (e *Encoder) kMapCanonical(rtkey, rtval reflect.Type, rv, rvv reflect.Value
e.mapElemKey()
e.e.EncodeTime(mksv[i].v)
e.mapElemValue()
- e.encodeValue(mapGet(rv, mksv[i].r, rvv), valFn)
+ e.encodeValue(mapGet(rv, mksv[i].r, rvv, kfast, visindirect, visref), valFn)
}
break
}
@@ -788,24 +840,49 @@ func (e *Encoder) kMapCanonical(rtkey, rtval reflect.Type, rv, rvv reflect.Value
default:
// out-of-band
// first encode each key to a []byte first, then sort them, then record
- var mksv []byte = e.blist.get(len(mks) * 16)[:0]
- e2 := NewEncoderBytes(&mksv, e.hh)
+ bs0 := e.blist.get(len(mks) * 16)
+ mksv := bs0
mksbv := make([]bytesRv, len(mks))
- for i, k := range mks {
- v := &mksbv[i]
- l := len(mksv)
- e2.MustEncode(k)
- v.r = k
- v.v = mksv[l:]
- }
+
+ func() {
+ // replicate sideEncode logic
+ defer func(wb bytesEncAppender, bytes bool, c containerState, state interface{}) {
+ e.wb = wb
+ e.bytes = bytes
+ e.c = c
+ e.e.restoreState(state)
+ }(e.wb, e.bytes, e.c, e.e.captureState())
+
+ // e2 := NewEncoderBytes(&mksv, e.hh)
+ e.wb = bytesEncAppender{mksv[:0], &mksv}
+ e.bytes = true
+ e.c = 0
+ e.e.resetState()
+
+ for i, k := range mks {
+ v := &mksbv[i]
+ l := len(mksv)
+
+ e.encodeValue(k, nil)
+ e.atEndOfEncode()
+ e.w().end()
+
+ v.r = k
+ v.v = mksv[l:]
+ }
+ }()
+
sort.Sort(bytesRvSlice(mksbv))
for j := range mksbv {
e.mapElemKey()
- e.encWr.writeb(mksbv[j].v) // e.asis(mksbv[j].v)
+ e.encWr.writeb(mksbv[j].v)
e.mapElemValue()
- e.encodeValue(mapGet(rv, mksbv[j].r, rvv), valFn)
+ e.encodeValue(mapGet(rv, mksbv[j].r, rvv, kfast, visindirect, visref), valFn)
}
e.blist.put(mksv)
+ if !byteSliceSameData(bs0, mksv) {
+ e.blist.put(bs0)
+ }
}
}
@@ -836,13 +913,19 @@ type Encoder struct {
// ---- cpu cache line boundary
// ---- writable fields during execution --- *try* to keep in sep cache line
- ci set // holds set of addresses found during an encoding (if CheckCircularRef=true)
+
+ // ci holds interfaces during an encoding (if CheckCircularRef=true)
+ //
+ // We considered using a []uintptr (slice of pointer addresses) retrievable via rv.UnsafeAddr.
+ // However, it is possible for the same pointer to point to 2 different types e.g.
+ // type T struct { tHelper }
+ // Here, for var v T; &v and &v.tHelper are the same pointer.
+ // Consequently, we need a tuple of type and pointer, which interface{} natively provides.
+ ci []interface{} // []uintptr
+
+ perType encPerType
slist sfiRvFreelist
-
- b [(2 * 8)]byte // for encoding chan byte, (non-addressable) [N]byte, etc
-
- // ---- cpu cache line boundary?
}
// NewEncoder returns an Encoder for encoding into an io.Writer.
@@ -851,7 +934,9 @@ type Encoder struct {
// OR pass in a memory buffered writer (eg bufio.Writer, bytes.Buffer).
func NewEncoder(w io.Writer, h Handle) *Encoder {
e := h.newEncDriver().encoder()
- e.Reset(w)
+ if w != nil {
+ e.Reset(w)
+ }
return e
}
@@ -862,15 +947,18 @@ func NewEncoder(w io.Writer, h Handle) *Encoder {
// After encoding, the out parameter contains the encoded contents.
func NewEncoderBytes(out *[]byte, h Handle) *Encoder {
e := h.newEncDriver().encoder()
- e.ResetBytes(out)
+ if out != nil {
+ e.ResetBytes(out)
+ }
return e
}
func (e *Encoder) init(h Handle) {
+ initHandle(h)
e.err = errEncoderNotInitialized
e.bytes = true
e.hh = h
- e.h = basicHandle(h)
+ e.h = h.getBasicHandle()
e.be = e.hh.isBinary()
}
@@ -880,12 +968,12 @@ func (e *Encoder) w() *encWr {
func (e *Encoder) resetCommon() {
e.e.reset()
- if e.ci == nil {
- // e.ci = (set)(e.cidef[:0])
- } else {
+ if e.ci != nil {
e.ci = e.ci[:0]
}
e.c = 0
+ e.calls = 0
+ e.seq = 0
e.err = nil
}
@@ -894,9 +982,6 @@ func (e *Encoder) resetCommon() {
// This accommodates using the state of the Encoder,
// where it has "cached" information about sub-engines.
func (e *Encoder) Reset(w io.Writer) {
- if w == nil {
- return
- }
e.bytes = false
if e.wf == nil {
e.wf = new(bufioEncWriter)
@@ -907,15 +992,8 @@ func (e *Encoder) Reset(w io.Writer) {
// ResetBytes resets the Encoder with a new destination output []byte.
func (e *Encoder) ResetBytes(out *[]byte) {
- if out == nil {
- return
- }
- var in []byte = *out
- if in == nil {
- in = make([]byte, defEncByteBufSize)
- }
e.bytes = true
- e.wb.reset(in, out)
+ e.wb.reset(encInBytes(out), out)
e.resetCommon()
}
@@ -1006,51 +1084,35 @@ func (e *Encoder) Encode(v interface{}) (err error) {
// tried to use closure, as runtime optimizes defer with no params.
// This seemed to be causing weird issues (like circular reference found, unexpected panic, etc).
// Also, see https://github.com/golang/go/issues/14939#issuecomment-417836139
- // defer func() { e.deferred(&err) }() }
- // { x, y := e, &err; defer func() { x.deferred(y) }() }
-
- if e.err != nil {
- return e.err
- }
- if recoverPanicToErr {
+ if !debugging {
defer func() {
// if error occurred during encoding, return that error;
// else if error occurred on end'ing (i.e. during flush), return that error.
- err = e.w().endErr()
- x := recover()
- if x == nil {
- if e.err != err {
- e.err = err
- }
- } else {
+ if x := recover(); x != nil {
panicValToErr(e, x, &e.err)
- if e.err != err {
- err = e.err
- }
+ err = e.err
}
}()
}
- // defer e.deferred(&err)
- e.mustEncode(v)
+ e.MustEncode(v)
return
}
// MustEncode is like Encode, but panics if unable to Encode.
-// This provides insight to the code location that triggered the error.
+//
+// Note: This provides insight to the code location that triggered the error.
func (e *Encoder) MustEncode(v interface{}) {
- if e.err != nil {
- panic(e.err)
+ halt.onerror(e.err)
+ if e.hh == nil {
+ halt.onerror(errNoFormatHandle)
}
- e.mustEncode(v)
-}
-func (e *Encoder) mustEncode(v interface{}) {
e.calls++
e.encode(v)
e.calls--
if e.calls == 0 {
- e.e.atEndOfEncode()
+ e.atEndOfEncode()
e.w().end()
}
}
@@ -1066,7 +1128,7 @@ func (e *Encoder) Release() {
}
func (e *Encoder) encode(iv interface{}) {
- // a switch with only concrete types can be optimized.
+ // MARKER: a switch with only concrete types can be optimized.
// consequently, we deal with nil and interfaces outside the switch.
if iv == nil {
@@ -1080,8 +1142,6 @@ func (e *Encoder) encode(iv interface{}) {
return
}
- var vself Selfer
-
switch v := iv.(type) {
// case nil:
// case Selfer:
@@ -1120,9 +1180,13 @@ func (e *Encoder) encode(iv interface{}) {
e.e.EncodeFloat32(v)
case float64:
e.e.EncodeFloat64(v)
+ case complex64:
+ e.encodeComplex64(v)
+ case complex128:
+ e.encodeComplex128(v)
case time.Time:
e.e.EncodeTime(v)
- case []uint8:
+ case []byte:
e.e.EncodeStringBytesRaw(v)
case *Raw:
e.rawBytes(*v)
@@ -1156,35 +1220,36 @@ func (e *Encoder) encode(iv interface{}) {
e.e.EncodeFloat32(*v)
case *float64:
e.e.EncodeFloat64(*v)
+ case *complex64:
+ e.encodeComplex64(*v)
+ case *complex128:
+ e.encodeComplex128(*v)
case *time.Time:
e.e.EncodeTime(*v)
- case *[]uint8:
+ case *[]byte:
if *v == nil {
e.e.EncodeNil()
} else {
e.e.EncodeStringBytesRaw(*v)
}
default:
- if vself, ok = iv.(Selfer); ok {
- vself.CodecEncodeSelf(e)
- } else if !fastpathEncodeTypeSwitch(iv, e) {
- if !rv.IsValid() {
- rv = rv4i(iv)
- }
+ // we can't check non-predefined types, as they might be a Selfer or extension.
+ if skipFastpathTypeSwitchInDirectCall || !fastpathEncodeTypeSwitch(iv, e) {
e.encodeValue(rv, nil)
}
}
}
+// encodeValue will encode a value.
+//
+// Note that encodeValue will handle nil in the stream early, so that the
+// subsequent calls i.e. kXXX methods, etc do not have to handle it themselves.
func (e *Encoder) encodeValue(rv reflect.Value, fn *codecFn) {
// if a valid fn is passed, it MUST BE for the dereferenced type of rv
- // We considered using a uintptr (a pointer) retrievable via rv.UnsafeAddr.
- // However, it is possible for the same pointer to point to 2 different types e.g.
- // type T struct { tHelper }
- // Here, for var v T; &v and &v.tHelper are the same pointer.
- // Consequently, we need a tuple of type and pointer, which interface{} natively provides.
- var sptr interface{} // uintptr
+ // MARKER: We check if value is nil here, so that the kXXX method do not have to.
+
+ var sptr interface{}
var rvp reflect.Value
var rvpValid bool
TOP:
@@ -1197,19 +1262,27 @@ TOP:
rvpValid = true
rvp = rv
rv = rv.Elem()
- if e.h.CheckCircularRef && rv.Kind() == reflect.Struct {
- sptr = rv2i(rvp) // rv.UnsafeAddr()
- break TOP
- }
goto TOP
case reflect.Interface:
if rvIsNil(rv) {
e.e.EncodeNil()
return
}
+ rvpValid = false
+ rvp = reflect.Value{}
rv = rv.Elem()
goto TOP
- case reflect.Slice, reflect.Map:
+ case reflect.Struct:
+ if rvpValid && e.h.CheckCircularRef {
+ sptr = rv2i(rvp)
+ for _, vv := range e.ci {
+ if eq4i(sptr, vv) { // error if sptr already seen
+ e.errorf("circular reference found: %p, %T", sptr, sptr)
+ }
+ }
+ e.ci = append(e.ci, sptr)
+ }
+ case reflect.Slice, reflect.Map, reflect.Chan:
if rvIsNil(rv) {
e.e.EncodeNil()
return
@@ -1219,52 +1292,48 @@ TOP:
return
}
- if sptr != nil && (&e.ci).add(sptr) {
- e.errorf("circular reference found: # %p, %T", sptr, sptr)
+ if fn == nil {
+ fn = e.h.fn(rvType(rv))
}
- var rt reflect.Type
- if fn == nil {
- rt = rv.Type()
- fn = e.h.fn(rt)
- }
- if fn.i.addrE {
- if rvpValid {
- fn.fe(e, &fn.i, rvp)
- } else if rv.CanAddr() {
- fn.fe(e, &fn.i, rv.Addr())
- } else {
- if rt == nil {
- rt = rv.Type()
- }
- rv2 := reflect.New(rt)
- rvSetDirect(rv2.Elem(), rv)
- fn.fe(e, &fn.i, rv2)
- }
+ if !fn.i.addrE { // typically, addrE = false, so check it first
+ // keep rv same
+ } else if rvpValid {
+ rv = rvp
} else {
- fn.fe(e, &fn.i, rv)
+ rv = e.addrRV(rv, fn.i.ti.rt, fn.i.ti.ptr)
}
- if sptr != 0 {
- (&e.ci).remove(sptr)
+ fn.fe(e, &fn.i, rv)
+
+ if sptr != nil { // remove sptr
+ e.ci = e.ci[:len(e.ci)-1]
}
}
-func (e *Encoder) marshalUtf8(bs []byte, fnerr error) {
- if fnerr != nil {
- panic(fnerr)
+// addrRV returns a addressable value which may be readonly
+func (e *Encoder) addrRV(rv reflect.Value, typ, ptrType reflect.Type) (rva reflect.Value) {
+ if rv.CanAddr() {
+ return rvAddr(rv, ptrType)
}
+ if e.h.NoAddressableReadonly {
+ rva = reflect.New(typ)
+ rvSetDirect(rva.Elem(), rv)
+ return
+ }
+ return rvAddr(e.perType.AddressableRO(rv), ptrType)
+}
+
+func (e *Encoder) marshalUtf8(bs []byte, fnerr error) {
+ e.onerror(fnerr)
if bs == nil {
e.e.EncodeNil()
} else {
e.e.EncodeString(stringView(bs))
- // e.e.EncodeStringEnc(cUTF8, stringView(bs))
}
}
func (e *Encoder) marshalAsis(bs []byte, fnerr error) {
- if fnerr != nil {
- panic(fnerr)
- }
+ e.onerror(fnerr)
if bs == nil {
e.e.EncodeNil()
} else {
@@ -1273,9 +1342,7 @@ func (e *Encoder) marshalAsis(bs []byte, fnerr error) {
}
func (e *Encoder) marshalRaw(bs []byte, fnerr error) {
- if fnerr != nil {
- panic(fnerr)
- }
+ e.onerror(fnerr)
if bs == nil {
e.e.EncodeNil()
} else {
@@ -1288,11 +1355,11 @@ func (e *Encoder) rawBytes(vv Raw) {
if !e.h.Raw {
e.errorf("Raw values cannot be encoded: %v", v)
}
- e.encWr.writeb(v) // e.asis(v)
+ e.encWr.writeb(v)
}
-func (e *Encoder) wrapErr(v interface{}, err *error) {
- *err = encodeError{codecError{name: e.hh.Name(), err: v}}
+func (e *Encoder) wrapErr(v error, err *error) {
+ *err = wrapCodecErr(v, e.hh.Name(), 0, true)
}
// ---- container tracker methods
@@ -1320,7 +1387,6 @@ func (e *Encoder) mapElemValue() {
func (e *Encoder) mapEnd() {
e.e.WriteMapEnd()
- // e.c = containerMapEnd
e.c = 0
}
@@ -1339,24 +1405,62 @@ func (e *Encoder) arrayElem() {
func (e *Encoder) arrayEnd() {
e.e.WriteArrayEnd()
e.c = 0
- // e.c = containerArrayEnd
}
// ----------
-func (e *Encoder) sideEncode(v interface{}, bs *[]byte) {
+func (e *Encoder) haltOnMbsOddLen(length int) {
+ if length&1 != 0 { // similar to &1==1 or %2 == 1
+ e.errorf("mapBySlice requires even slice length, but got %v", length)
+ }
+}
+
+func (e *Encoder) atEndOfEncode() {
+ // e.e.atEndOfEncode()
+ if e.js {
+ e.jsondriver().atEndOfEncode()
+ }
+}
+
+func (e *Encoder) sideEncode(v interface{}, basetype reflect.Type, bs *[]byte) {
+ // rv := baseRV(v)
+ // e2 := NewEncoderBytes(bs, e.hh)
+ // e2.encodeValue(rv, e2.h.fnNoExt(basetype))
+ // e2.atEndOfEncode()
+ // e2.w().end()
+
+ defer func(wb bytesEncAppender, bytes bool, c containerState, state interface{}) {
+ e.wb = wb
+ e.bytes = bytes
+ e.c = c
+ e.e.restoreState(state)
+ }(e.wb, e.bytes, e.c, e.e.captureState())
+
+ e.wb = bytesEncAppender{encInBytes(bs)[:0], bs}
+ e.bytes = true
+ e.c = 0
+ e.e.resetState()
+
+ // must call using fnNoExt
rv := baseRV(v)
- e2 := NewEncoderBytes(bs, e.hh)
- e2.encodeValue(rv, e.h.fnNoExt(rv.Type()))
- e2.e.atEndOfEncode()
- e2.w().end()
+ e.encodeValue(rv, e.h.fnNoExt(basetype))
+ e.atEndOfEncode()
+ e.w().end()
+}
+
+func encInBytes(out *[]byte) (in []byte) {
+ in = *out
+ if in == nil {
+ in = make([]byte, defEncByteBufSize)
+ }
+ return
}
func encStructFieldKey(encName string, ee encDriver, w *encWr,
keyType valueType, encNameAsciiAlphaNum bool, js bool) {
- var m must
// use if-else-if, not switch (which compiles to binary-search)
// since keyType is typically valueTypeString, branch prediction is pretty good.
+
if keyType == valueTypeString {
if js && encNameAsciiAlphaNum { // keyType == valueTypeString
w.writeqstr(encName)
@@ -1364,10 +1468,12 @@ func encStructFieldKey(encName string, ee encDriver, w *encWr,
ee.EncodeString(encName)
}
} else if keyType == valueTypeInt {
- ee.EncodeInt(m.Int(strconv.ParseInt(encName, 10, 64)))
+ ee.EncodeInt(must.Int(strconv.ParseInt(encName, 10, 64)))
} else if keyType == valueTypeUint {
- ee.EncodeUint(m.Uint(strconv.ParseUint(encName, 10, 64)))
+ ee.EncodeUint(must.Uint(strconv.ParseUint(encName, 10, 64)))
} else if keyType == valueTypeFloat {
- ee.EncodeFloat64(m.Float(strconv.ParseFloat(encName, 64)))
+ ee.EncodeFloat64(must.Float(strconv.ParseFloat(encName, 64)))
+ } else {
+ halt.errorf("invalid struct key type: %v", keyType)
}
}
diff --git a/vendor/github.com/ugorji/go/codec/fast-path.generated.go b/vendor/github.com/ugorji/go/codec/fast-path.generated.go
index e9b7f230f..a2c258196 100644
--- a/vendor/github.com/ugorji/go/codec/fast-path.generated.go
+++ b/vendor/github.com/ugorji/go/codec/fast-path.generated.go
@@ -1,6 +1,7 @@
-// +build !notfastpath
+//go:build !notfastpath && !codec.notfastpath
+// +build !notfastpath,!codec.notfastpath
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
// Code generated from fast-path.go.tmpl - DO NOT EDIT.
@@ -38,51 +39,55 @@ import (
const fastpathEnabled = true
-const fastpathMapBySliceErrMsg = "mapBySlice requires even slice length, but got %v"
-
type fastpathT struct{}
var fastpathTV fastpathT
type fastpathE struct {
- rtid uintptr
rt reflect.Type
encfn func(*Encoder, *codecFnInfo, reflect.Value)
decfn func(*Decoder, *codecFnInfo, reflect.Value)
}
-type fastpathA [81]fastpathE
+type fastpathA [56]fastpathE
+type fastpathARtid [56]uintptr
-func (x *fastpathA) index(rtid uintptr) int {
+var fastpathAv fastpathA
+var fastpathAvRtid fastpathARtid
+
+type fastpathAslice struct{}
+
+func (fastpathAslice) Len() int { return 56 }
+func (fastpathAslice) Less(i, j int) bool {
+ return fastpathAvRtid[uint(i)] < fastpathAvRtid[uint(j)]
+}
+func (fastpathAslice) Swap(i, j int) {
+ fastpathAvRtid[uint(i)], fastpathAvRtid[uint(j)] = fastpathAvRtid[uint(j)], fastpathAvRtid[uint(i)]
+ fastpathAv[uint(i)], fastpathAv[uint(j)] = fastpathAv[uint(j)], fastpathAv[uint(i)]
+}
+
+func fastpathAvIndex(rtid uintptr) int {
// use binary search to grab the index (adapted from sort/search.go)
// Note: we use goto (instead of for loop) so this can be inlined.
- // h, i, j := 0, 0, len(x)
+ // h, i, j := 0, 0, 56
var h, i uint
- var j = uint(len(x))
+ var j uint = 56
LOOP:
if i < j {
- h = i + (j-i)/2
- if x[h].rtid < rtid {
+ h = (i + j) >> 1 // avoid overflow when computing h // h = i + (j-i)/2
+ if fastpathAvRtid[h] < rtid {
i = h + 1
} else {
j = h
}
goto LOOP
}
- if i < uint(len(x)) && x[i].rtid == rtid {
+ if i < 56 && fastpathAvRtid[i] == rtid {
return int(i)
}
return -1
}
-type fastpathAslice []fastpathE
-
-func (x fastpathAslice) Len() int { return len(x) }
-func (x fastpathAslice) Less(i, j int) bool { return x[uint(i)].rtid < x[uint(j)].rtid }
-func (x fastpathAslice) Swap(i, j int) { x[uint(i)], x[uint(j)] = x[uint(j)], x[uint(i)] }
-
-var fastpathAV fastpathA
-
// due to possible initialization loop error, make fastpath in an init()
func init() {
var i uint = 0
@@ -91,7 +96,8 @@ func init() {
fd func(*Decoder, *codecFnInfo, reflect.Value)) {
xrt := reflect.TypeOf(v)
xptr := rt2id(xrt)
- fastpathAV[i] = fastpathE{xptr, xrt, fe, fd}
+ fastpathAvRtid[i] = xptr
+ fastpathAv[i] = fastpathE{xrt, fe, fd}
i++
}
@@ -100,13 +106,9 @@ func init() {
fn([][]byte(nil), (*Encoder).fastpathEncSliceBytesR, (*Decoder).fastpathDecSliceBytesR)
fn([]float32(nil), (*Encoder).fastpathEncSliceFloat32R, (*Decoder).fastpathDecSliceFloat32R)
fn([]float64(nil), (*Encoder).fastpathEncSliceFloat64R, (*Decoder).fastpathDecSliceFloat64R)
- fn([]uint(nil), (*Encoder).fastpathEncSliceUintR, (*Decoder).fastpathDecSliceUintR)
- fn([]uint16(nil), (*Encoder).fastpathEncSliceUint16R, (*Decoder).fastpathDecSliceUint16R)
- fn([]uint32(nil), (*Encoder).fastpathEncSliceUint32R, (*Decoder).fastpathDecSliceUint32R)
+ fn([]uint8(nil), (*Encoder).fastpathEncSliceUint8R, (*Decoder).fastpathDecSliceUint8R)
fn([]uint64(nil), (*Encoder).fastpathEncSliceUint64R, (*Decoder).fastpathDecSliceUint64R)
fn([]int(nil), (*Encoder).fastpathEncSliceIntR, (*Decoder).fastpathDecSliceIntR)
- fn([]int8(nil), (*Encoder).fastpathEncSliceInt8R, (*Decoder).fastpathDecSliceInt8R)
- fn([]int16(nil), (*Encoder).fastpathEncSliceInt16R, (*Decoder).fastpathDecSliceInt16R)
fn([]int32(nil), (*Encoder).fastpathEncSliceInt32R, (*Decoder).fastpathDecSliceInt32R)
fn([]int64(nil), (*Encoder).fastpathEncSliceInt64R, (*Decoder).fastpathDecSliceInt64R)
fn([]bool(nil), (*Encoder).fastpathEncSliceBoolR, (*Decoder).fastpathDecSliceBoolR)
@@ -114,71 +116,50 @@ func init() {
fn(map[string]interface{}(nil), (*Encoder).fastpathEncMapStringIntfR, (*Decoder).fastpathDecMapStringIntfR)
fn(map[string]string(nil), (*Encoder).fastpathEncMapStringStringR, (*Decoder).fastpathDecMapStringStringR)
fn(map[string][]byte(nil), (*Encoder).fastpathEncMapStringBytesR, (*Decoder).fastpathDecMapStringBytesR)
- fn(map[string]uint(nil), (*Encoder).fastpathEncMapStringUintR, (*Decoder).fastpathDecMapStringUintR)
fn(map[string]uint8(nil), (*Encoder).fastpathEncMapStringUint8R, (*Decoder).fastpathDecMapStringUint8R)
fn(map[string]uint64(nil), (*Encoder).fastpathEncMapStringUint64R, (*Decoder).fastpathDecMapStringUint64R)
fn(map[string]int(nil), (*Encoder).fastpathEncMapStringIntR, (*Decoder).fastpathDecMapStringIntR)
- fn(map[string]int64(nil), (*Encoder).fastpathEncMapStringInt64R, (*Decoder).fastpathDecMapStringInt64R)
- fn(map[string]float32(nil), (*Encoder).fastpathEncMapStringFloat32R, (*Decoder).fastpathDecMapStringFloat32R)
+ fn(map[string]int32(nil), (*Encoder).fastpathEncMapStringInt32R, (*Decoder).fastpathDecMapStringInt32R)
fn(map[string]float64(nil), (*Encoder).fastpathEncMapStringFloat64R, (*Decoder).fastpathDecMapStringFloat64R)
fn(map[string]bool(nil), (*Encoder).fastpathEncMapStringBoolR, (*Decoder).fastpathDecMapStringBoolR)
- fn(map[uint]interface{}(nil), (*Encoder).fastpathEncMapUintIntfR, (*Decoder).fastpathDecMapUintIntfR)
- fn(map[uint]string(nil), (*Encoder).fastpathEncMapUintStringR, (*Decoder).fastpathDecMapUintStringR)
- fn(map[uint][]byte(nil), (*Encoder).fastpathEncMapUintBytesR, (*Decoder).fastpathDecMapUintBytesR)
- fn(map[uint]uint(nil), (*Encoder).fastpathEncMapUintUintR, (*Decoder).fastpathDecMapUintUintR)
- fn(map[uint]uint8(nil), (*Encoder).fastpathEncMapUintUint8R, (*Decoder).fastpathDecMapUintUint8R)
- fn(map[uint]uint64(nil), (*Encoder).fastpathEncMapUintUint64R, (*Decoder).fastpathDecMapUintUint64R)
- fn(map[uint]int(nil), (*Encoder).fastpathEncMapUintIntR, (*Decoder).fastpathDecMapUintIntR)
- fn(map[uint]int64(nil), (*Encoder).fastpathEncMapUintInt64R, (*Decoder).fastpathDecMapUintInt64R)
- fn(map[uint]float32(nil), (*Encoder).fastpathEncMapUintFloat32R, (*Decoder).fastpathDecMapUintFloat32R)
- fn(map[uint]float64(nil), (*Encoder).fastpathEncMapUintFloat64R, (*Decoder).fastpathDecMapUintFloat64R)
- fn(map[uint]bool(nil), (*Encoder).fastpathEncMapUintBoolR, (*Decoder).fastpathDecMapUintBoolR)
fn(map[uint8]interface{}(nil), (*Encoder).fastpathEncMapUint8IntfR, (*Decoder).fastpathDecMapUint8IntfR)
fn(map[uint8]string(nil), (*Encoder).fastpathEncMapUint8StringR, (*Decoder).fastpathDecMapUint8StringR)
fn(map[uint8][]byte(nil), (*Encoder).fastpathEncMapUint8BytesR, (*Decoder).fastpathDecMapUint8BytesR)
- fn(map[uint8]uint(nil), (*Encoder).fastpathEncMapUint8UintR, (*Decoder).fastpathDecMapUint8UintR)
fn(map[uint8]uint8(nil), (*Encoder).fastpathEncMapUint8Uint8R, (*Decoder).fastpathDecMapUint8Uint8R)
fn(map[uint8]uint64(nil), (*Encoder).fastpathEncMapUint8Uint64R, (*Decoder).fastpathDecMapUint8Uint64R)
fn(map[uint8]int(nil), (*Encoder).fastpathEncMapUint8IntR, (*Decoder).fastpathDecMapUint8IntR)
- fn(map[uint8]int64(nil), (*Encoder).fastpathEncMapUint8Int64R, (*Decoder).fastpathDecMapUint8Int64R)
- fn(map[uint8]float32(nil), (*Encoder).fastpathEncMapUint8Float32R, (*Decoder).fastpathDecMapUint8Float32R)
+ fn(map[uint8]int32(nil), (*Encoder).fastpathEncMapUint8Int32R, (*Decoder).fastpathDecMapUint8Int32R)
fn(map[uint8]float64(nil), (*Encoder).fastpathEncMapUint8Float64R, (*Decoder).fastpathDecMapUint8Float64R)
fn(map[uint8]bool(nil), (*Encoder).fastpathEncMapUint8BoolR, (*Decoder).fastpathDecMapUint8BoolR)
fn(map[uint64]interface{}(nil), (*Encoder).fastpathEncMapUint64IntfR, (*Decoder).fastpathDecMapUint64IntfR)
fn(map[uint64]string(nil), (*Encoder).fastpathEncMapUint64StringR, (*Decoder).fastpathDecMapUint64StringR)
fn(map[uint64][]byte(nil), (*Encoder).fastpathEncMapUint64BytesR, (*Decoder).fastpathDecMapUint64BytesR)
- fn(map[uint64]uint(nil), (*Encoder).fastpathEncMapUint64UintR, (*Decoder).fastpathDecMapUint64UintR)
fn(map[uint64]uint8(nil), (*Encoder).fastpathEncMapUint64Uint8R, (*Decoder).fastpathDecMapUint64Uint8R)
fn(map[uint64]uint64(nil), (*Encoder).fastpathEncMapUint64Uint64R, (*Decoder).fastpathDecMapUint64Uint64R)
fn(map[uint64]int(nil), (*Encoder).fastpathEncMapUint64IntR, (*Decoder).fastpathDecMapUint64IntR)
- fn(map[uint64]int64(nil), (*Encoder).fastpathEncMapUint64Int64R, (*Decoder).fastpathDecMapUint64Int64R)
- fn(map[uint64]float32(nil), (*Encoder).fastpathEncMapUint64Float32R, (*Decoder).fastpathDecMapUint64Float32R)
+ fn(map[uint64]int32(nil), (*Encoder).fastpathEncMapUint64Int32R, (*Decoder).fastpathDecMapUint64Int32R)
fn(map[uint64]float64(nil), (*Encoder).fastpathEncMapUint64Float64R, (*Decoder).fastpathDecMapUint64Float64R)
fn(map[uint64]bool(nil), (*Encoder).fastpathEncMapUint64BoolR, (*Decoder).fastpathDecMapUint64BoolR)
fn(map[int]interface{}(nil), (*Encoder).fastpathEncMapIntIntfR, (*Decoder).fastpathDecMapIntIntfR)
fn(map[int]string(nil), (*Encoder).fastpathEncMapIntStringR, (*Decoder).fastpathDecMapIntStringR)
fn(map[int][]byte(nil), (*Encoder).fastpathEncMapIntBytesR, (*Decoder).fastpathDecMapIntBytesR)
- fn(map[int]uint(nil), (*Encoder).fastpathEncMapIntUintR, (*Decoder).fastpathDecMapIntUintR)
fn(map[int]uint8(nil), (*Encoder).fastpathEncMapIntUint8R, (*Decoder).fastpathDecMapIntUint8R)
fn(map[int]uint64(nil), (*Encoder).fastpathEncMapIntUint64R, (*Decoder).fastpathDecMapIntUint64R)
fn(map[int]int(nil), (*Encoder).fastpathEncMapIntIntR, (*Decoder).fastpathDecMapIntIntR)
- fn(map[int]int64(nil), (*Encoder).fastpathEncMapIntInt64R, (*Decoder).fastpathDecMapIntInt64R)
- fn(map[int]float32(nil), (*Encoder).fastpathEncMapIntFloat32R, (*Decoder).fastpathDecMapIntFloat32R)
+ fn(map[int]int32(nil), (*Encoder).fastpathEncMapIntInt32R, (*Decoder).fastpathDecMapIntInt32R)
fn(map[int]float64(nil), (*Encoder).fastpathEncMapIntFloat64R, (*Decoder).fastpathDecMapIntFloat64R)
fn(map[int]bool(nil), (*Encoder).fastpathEncMapIntBoolR, (*Decoder).fastpathDecMapIntBoolR)
- fn(map[int64]interface{}(nil), (*Encoder).fastpathEncMapInt64IntfR, (*Decoder).fastpathDecMapInt64IntfR)
- fn(map[int64]string(nil), (*Encoder).fastpathEncMapInt64StringR, (*Decoder).fastpathDecMapInt64StringR)
- fn(map[int64][]byte(nil), (*Encoder).fastpathEncMapInt64BytesR, (*Decoder).fastpathDecMapInt64BytesR)
- fn(map[int64]uint(nil), (*Encoder).fastpathEncMapInt64UintR, (*Decoder).fastpathDecMapInt64UintR)
- fn(map[int64]uint8(nil), (*Encoder).fastpathEncMapInt64Uint8R, (*Decoder).fastpathDecMapInt64Uint8R)
- fn(map[int64]uint64(nil), (*Encoder).fastpathEncMapInt64Uint64R, (*Decoder).fastpathDecMapInt64Uint64R)
- fn(map[int64]int(nil), (*Encoder).fastpathEncMapInt64IntR, (*Decoder).fastpathDecMapInt64IntR)
- fn(map[int64]int64(nil), (*Encoder).fastpathEncMapInt64Int64R, (*Decoder).fastpathDecMapInt64Int64R)
- fn(map[int64]float32(nil), (*Encoder).fastpathEncMapInt64Float32R, (*Decoder).fastpathDecMapInt64Float32R)
- fn(map[int64]float64(nil), (*Encoder).fastpathEncMapInt64Float64R, (*Decoder).fastpathDecMapInt64Float64R)
- fn(map[int64]bool(nil), (*Encoder).fastpathEncMapInt64BoolR, (*Decoder).fastpathDecMapInt64BoolR)
+ fn(map[int32]interface{}(nil), (*Encoder).fastpathEncMapInt32IntfR, (*Decoder).fastpathDecMapInt32IntfR)
+ fn(map[int32]string(nil), (*Encoder).fastpathEncMapInt32StringR, (*Decoder).fastpathDecMapInt32StringR)
+ fn(map[int32][]byte(nil), (*Encoder).fastpathEncMapInt32BytesR, (*Decoder).fastpathDecMapInt32BytesR)
+ fn(map[int32]uint8(nil), (*Encoder).fastpathEncMapInt32Uint8R, (*Decoder).fastpathDecMapInt32Uint8R)
+ fn(map[int32]uint64(nil), (*Encoder).fastpathEncMapInt32Uint64R, (*Decoder).fastpathDecMapInt32Uint64R)
+ fn(map[int32]int(nil), (*Encoder).fastpathEncMapInt32IntR, (*Decoder).fastpathDecMapInt32IntR)
+ fn(map[int32]int32(nil), (*Encoder).fastpathEncMapInt32Int32R, (*Decoder).fastpathDecMapInt32Int32R)
+ fn(map[int32]float64(nil), (*Encoder).fastpathEncMapInt32Float64R, (*Decoder).fastpathDecMapInt32Float64R)
+ fn(map[int32]bool(nil), (*Encoder).fastpathEncMapInt32BoolR, (*Decoder).fastpathDecMapInt32BoolR)
- sort.Sort(fastpathAslice(fastpathAV[:]))
+ sort.Sort(fastpathAslice{})
}
// -- encode
@@ -226,29 +207,13 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
} else {
fastpathTV.EncSliceFloat64V(*v, e)
}
- case []uint:
- fastpathTV.EncSliceUintV(v, e)
- case *[]uint:
+ case []uint8:
+ fastpathTV.EncSliceUint8V(v, e)
+ case *[]uint8:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncSliceUintV(*v, e)
- }
- case []uint16:
- fastpathTV.EncSliceUint16V(v, e)
- case *[]uint16:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncSliceUint16V(*v, e)
- }
- case []uint32:
- fastpathTV.EncSliceUint32V(v, e)
- case *[]uint32:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncSliceUint32V(*v, e)
+ fastpathTV.EncSliceUint8V(*v, e)
}
case []uint64:
fastpathTV.EncSliceUint64V(v, e)
@@ -266,22 +231,6 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
} else {
fastpathTV.EncSliceIntV(*v, e)
}
- case []int8:
- fastpathTV.EncSliceInt8V(v, e)
- case *[]int8:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncSliceInt8V(*v, e)
- }
- case []int16:
- fastpathTV.EncSliceInt16V(v, e)
- case *[]int16:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncSliceInt16V(*v, e)
- }
case []int32:
fastpathTV.EncSliceInt32V(v, e)
case *[]int32:
@@ -330,14 +279,6 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
} else {
fastpathTV.EncMapStringBytesV(*v, e)
}
- case map[string]uint:
- fastpathTV.EncMapStringUintV(v, e)
- case *map[string]uint:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapStringUintV(*v, e)
- }
case map[string]uint8:
fastpathTV.EncMapStringUint8V(v, e)
case *map[string]uint8:
@@ -362,21 +303,13 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
} else {
fastpathTV.EncMapStringIntV(*v, e)
}
- case map[string]int64:
- fastpathTV.EncMapStringInt64V(v, e)
- case *map[string]int64:
+ case map[string]int32:
+ fastpathTV.EncMapStringInt32V(v, e)
+ case *map[string]int32:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncMapStringInt64V(*v, e)
- }
- case map[string]float32:
- fastpathTV.EncMapStringFloat32V(v, e)
- case *map[string]float32:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapStringFloat32V(*v, e)
+ fastpathTV.EncMapStringInt32V(*v, e)
}
case map[string]float64:
fastpathTV.EncMapStringFloat64V(v, e)
@@ -394,94 +327,6 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
} else {
fastpathTV.EncMapStringBoolV(*v, e)
}
- case map[uint]interface{}:
- fastpathTV.EncMapUintIntfV(v, e)
- case *map[uint]interface{}:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUintIntfV(*v, e)
- }
- case map[uint]string:
- fastpathTV.EncMapUintStringV(v, e)
- case *map[uint]string:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUintStringV(*v, e)
- }
- case map[uint][]byte:
- fastpathTV.EncMapUintBytesV(v, e)
- case *map[uint][]byte:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUintBytesV(*v, e)
- }
- case map[uint]uint:
- fastpathTV.EncMapUintUintV(v, e)
- case *map[uint]uint:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUintUintV(*v, e)
- }
- case map[uint]uint8:
- fastpathTV.EncMapUintUint8V(v, e)
- case *map[uint]uint8:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUintUint8V(*v, e)
- }
- case map[uint]uint64:
- fastpathTV.EncMapUintUint64V(v, e)
- case *map[uint]uint64:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUintUint64V(*v, e)
- }
- case map[uint]int:
- fastpathTV.EncMapUintIntV(v, e)
- case *map[uint]int:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUintIntV(*v, e)
- }
- case map[uint]int64:
- fastpathTV.EncMapUintInt64V(v, e)
- case *map[uint]int64:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUintInt64V(*v, e)
- }
- case map[uint]float32:
- fastpathTV.EncMapUintFloat32V(v, e)
- case *map[uint]float32:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUintFloat32V(*v, e)
- }
- case map[uint]float64:
- fastpathTV.EncMapUintFloat64V(v, e)
- case *map[uint]float64:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUintFloat64V(*v, e)
- }
- case map[uint]bool:
- fastpathTV.EncMapUintBoolV(v, e)
- case *map[uint]bool:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUintBoolV(*v, e)
- }
case map[uint8]interface{}:
fastpathTV.EncMapUint8IntfV(v, e)
case *map[uint8]interface{}:
@@ -506,14 +351,6 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
} else {
fastpathTV.EncMapUint8BytesV(*v, e)
}
- case map[uint8]uint:
- fastpathTV.EncMapUint8UintV(v, e)
- case *map[uint8]uint:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUint8UintV(*v, e)
- }
case map[uint8]uint8:
fastpathTV.EncMapUint8Uint8V(v, e)
case *map[uint8]uint8:
@@ -538,21 +375,13 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
} else {
fastpathTV.EncMapUint8IntV(*v, e)
}
- case map[uint8]int64:
- fastpathTV.EncMapUint8Int64V(v, e)
- case *map[uint8]int64:
+ case map[uint8]int32:
+ fastpathTV.EncMapUint8Int32V(v, e)
+ case *map[uint8]int32:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncMapUint8Int64V(*v, e)
- }
- case map[uint8]float32:
- fastpathTV.EncMapUint8Float32V(v, e)
- case *map[uint8]float32:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUint8Float32V(*v, e)
+ fastpathTV.EncMapUint8Int32V(*v, e)
}
case map[uint8]float64:
fastpathTV.EncMapUint8Float64V(v, e)
@@ -594,14 +423,6 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
} else {
fastpathTV.EncMapUint64BytesV(*v, e)
}
- case map[uint64]uint:
- fastpathTV.EncMapUint64UintV(v, e)
- case *map[uint64]uint:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUint64UintV(*v, e)
- }
case map[uint64]uint8:
fastpathTV.EncMapUint64Uint8V(v, e)
case *map[uint64]uint8:
@@ -626,21 +447,13 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
} else {
fastpathTV.EncMapUint64IntV(*v, e)
}
- case map[uint64]int64:
- fastpathTV.EncMapUint64Int64V(v, e)
- case *map[uint64]int64:
+ case map[uint64]int32:
+ fastpathTV.EncMapUint64Int32V(v, e)
+ case *map[uint64]int32:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncMapUint64Int64V(*v, e)
- }
- case map[uint64]float32:
- fastpathTV.EncMapUint64Float32V(v, e)
- case *map[uint64]float32:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapUint64Float32V(*v, e)
+ fastpathTV.EncMapUint64Int32V(*v, e)
}
case map[uint64]float64:
fastpathTV.EncMapUint64Float64V(v, e)
@@ -682,14 +495,6 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
} else {
fastpathTV.EncMapIntBytesV(*v, e)
}
- case map[int]uint:
- fastpathTV.EncMapIntUintV(v, e)
- case *map[int]uint:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapIntUintV(*v, e)
- }
case map[int]uint8:
fastpathTV.EncMapIntUint8V(v, e)
case *map[int]uint8:
@@ -714,21 +519,13 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
} else {
fastpathTV.EncMapIntIntV(*v, e)
}
- case map[int]int64:
- fastpathTV.EncMapIntInt64V(v, e)
- case *map[int]int64:
+ case map[int]int32:
+ fastpathTV.EncMapIntInt32V(v, e)
+ case *map[int]int32:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncMapIntInt64V(*v, e)
- }
- case map[int]float32:
- fastpathTV.EncMapIntFloat32V(v, e)
- case *map[int]float32:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapIntFloat32V(*v, e)
+ fastpathTV.EncMapIntInt32V(*v, e)
}
case map[int]float64:
fastpathTV.EncMapIntFloat64V(v, e)
@@ -746,93 +543,77 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
} else {
fastpathTV.EncMapIntBoolV(*v, e)
}
- case map[int64]interface{}:
- fastpathTV.EncMapInt64IntfV(v, e)
- case *map[int64]interface{}:
+ case map[int32]interface{}:
+ fastpathTV.EncMapInt32IntfV(v, e)
+ case *map[int32]interface{}:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncMapInt64IntfV(*v, e)
+ fastpathTV.EncMapInt32IntfV(*v, e)
}
- case map[int64]string:
- fastpathTV.EncMapInt64StringV(v, e)
- case *map[int64]string:
+ case map[int32]string:
+ fastpathTV.EncMapInt32StringV(v, e)
+ case *map[int32]string:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncMapInt64StringV(*v, e)
+ fastpathTV.EncMapInt32StringV(*v, e)
}
- case map[int64][]byte:
- fastpathTV.EncMapInt64BytesV(v, e)
- case *map[int64][]byte:
+ case map[int32][]byte:
+ fastpathTV.EncMapInt32BytesV(v, e)
+ case *map[int32][]byte:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncMapInt64BytesV(*v, e)
+ fastpathTV.EncMapInt32BytesV(*v, e)
}
- case map[int64]uint:
- fastpathTV.EncMapInt64UintV(v, e)
- case *map[int64]uint:
+ case map[int32]uint8:
+ fastpathTV.EncMapInt32Uint8V(v, e)
+ case *map[int32]uint8:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncMapInt64UintV(*v, e)
+ fastpathTV.EncMapInt32Uint8V(*v, e)
}
- case map[int64]uint8:
- fastpathTV.EncMapInt64Uint8V(v, e)
- case *map[int64]uint8:
+ case map[int32]uint64:
+ fastpathTV.EncMapInt32Uint64V(v, e)
+ case *map[int32]uint64:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncMapInt64Uint8V(*v, e)
+ fastpathTV.EncMapInt32Uint64V(*v, e)
}
- case map[int64]uint64:
- fastpathTV.EncMapInt64Uint64V(v, e)
- case *map[int64]uint64:
+ case map[int32]int:
+ fastpathTV.EncMapInt32IntV(v, e)
+ case *map[int32]int:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncMapInt64Uint64V(*v, e)
+ fastpathTV.EncMapInt32IntV(*v, e)
}
- case map[int64]int:
- fastpathTV.EncMapInt64IntV(v, e)
- case *map[int64]int:
+ case map[int32]int32:
+ fastpathTV.EncMapInt32Int32V(v, e)
+ case *map[int32]int32:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncMapInt64IntV(*v, e)
+ fastpathTV.EncMapInt32Int32V(*v, e)
}
- case map[int64]int64:
- fastpathTV.EncMapInt64Int64V(v, e)
- case *map[int64]int64:
+ case map[int32]float64:
+ fastpathTV.EncMapInt32Float64V(v, e)
+ case *map[int32]float64:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncMapInt64Int64V(*v, e)
+ fastpathTV.EncMapInt32Float64V(*v, e)
}
- case map[int64]float32:
- fastpathTV.EncMapInt64Float32V(v, e)
- case *map[int64]float32:
+ case map[int32]bool:
+ fastpathTV.EncMapInt32BoolV(v, e)
+ case *map[int32]bool:
if *v == nil {
e.e.EncodeNil()
} else {
- fastpathTV.EncMapInt64Float32V(*v, e)
- }
- case map[int64]float64:
- fastpathTV.EncMapInt64Float64V(v, e)
- case *map[int64]float64:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapInt64Float64V(*v, e)
- }
- case map[int64]bool:
- fastpathTV.EncMapInt64BoolV(v, e)
- case *map[int64]bool:
- if *v == nil {
- e.e.EncodeNil()
- } else {
- fastpathTV.EncMapInt64BoolV(*v, e)
+ fastpathTV.EncMapInt32BoolV(*v, e)
}
default:
_ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4
@@ -843,10 +624,16 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
// -- -- fast path functions
func (e *Encoder) fastpathEncSliceIntfR(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceIntfV(rv2i(rv).([]interface{}), e)
+ var v []interface{}
+ if rv.Kind() == reflect.Array {
+ rvGetSlice4Array(rv, &v)
} else {
- fastpathTV.EncSliceIntfV(rv2i(rv).([]interface{}), e)
+ v = rv2i(rv).([]interface{})
+ }
+ if f.ti.mbs {
+ fastpathTV.EncAsMapSliceIntfV(v, e)
+ } else {
+ fastpathTV.EncSliceIntfV(v, e)
}
}
func (fastpathT) EncSliceIntfV(v []interface{}, e *Encoder) {
@@ -858,26 +645,29 @@ func (fastpathT) EncSliceIntfV(v []interface{}, e *Encoder) {
e.arrayEnd()
}
func (fastpathT) EncAsMapSliceIntfV(v []interface{}, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.encode(v[j])
+ e.haltOnMbsOddLen(len(v))
+ e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2)
+ for j := range v {
+ if j&1 == 0 { // if j%2 == 0 {
+ e.mapElemKey()
+ } else {
+ e.mapElemValue()
}
- e.mapEnd()
+ e.encode(v[j])
}
+ e.mapEnd()
}
func (e *Encoder) fastpathEncSliceStringR(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceStringV(rv2i(rv).([]string), e)
+ var v []string
+ if rv.Kind() == reflect.Array {
+ rvGetSlice4Array(rv, &v)
} else {
- fastpathTV.EncSliceStringV(rv2i(rv).([]string), e)
+ v = rv2i(rv).([]string)
+ }
+ if f.ti.mbs {
+ fastpathTV.EncAsMapSliceStringV(v, e)
+ } else {
+ fastpathTV.EncSliceStringV(v, e)
}
}
func (fastpathT) EncSliceStringV(v []string, e *Encoder) {
@@ -889,26 +679,29 @@ func (fastpathT) EncSliceStringV(v []string, e *Encoder) {
e.arrayEnd()
}
func (fastpathT) EncAsMapSliceStringV(v []string, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeString(v[j])
+ e.haltOnMbsOddLen(len(v))
+ e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2)
+ for j := range v {
+ if j&1 == 0 { // if j%2 == 0 {
+ e.mapElemKey()
+ } else {
+ e.mapElemValue()
}
- e.mapEnd()
+ e.e.EncodeString(v[j])
}
+ e.mapEnd()
}
func (e *Encoder) fastpathEncSliceBytesR(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceBytesV(rv2i(rv).([][]byte), e)
+ var v [][]byte
+ if rv.Kind() == reflect.Array {
+ rvGetSlice4Array(rv, &v)
} else {
- fastpathTV.EncSliceBytesV(rv2i(rv).([][]byte), e)
+ v = rv2i(rv).([][]byte)
+ }
+ if f.ti.mbs {
+ fastpathTV.EncAsMapSliceBytesV(v, e)
+ } else {
+ fastpathTV.EncSliceBytesV(v, e)
}
}
func (fastpathT) EncSliceBytesV(v [][]byte, e *Encoder) {
@@ -920,26 +713,29 @@ func (fastpathT) EncSliceBytesV(v [][]byte, e *Encoder) {
e.arrayEnd()
}
func (fastpathT) EncAsMapSliceBytesV(v [][]byte, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeStringBytesRaw(v[j])
+ e.haltOnMbsOddLen(len(v))
+ e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2)
+ for j := range v {
+ if j&1 == 0 { // if j%2 == 0 {
+ e.mapElemKey()
+ } else {
+ e.mapElemValue()
}
- e.mapEnd()
+ e.e.EncodeStringBytesRaw(v[j])
}
+ e.mapEnd()
}
func (e *Encoder) fastpathEncSliceFloat32R(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceFloat32V(rv2i(rv).([]float32), e)
+ var v []float32
+ if rv.Kind() == reflect.Array {
+ rvGetSlice4Array(rv, &v)
} else {
- fastpathTV.EncSliceFloat32V(rv2i(rv).([]float32), e)
+ v = rv2i(rv).([]float32)
+ }
+ if f.ti.mbs {
+ fastpathTV.EncAsMapSliceFloat32V(v, e)
+ } else {
+ fastpathTV.EncSliceFloat32V(v, e)
}
}
func (fastpathT) EncSliceFloat32V(v []float32, e *Encoder) {
@@ -951,26 +747,29 @@ func (fastpathT) EncSliceFloat32V(v []float32, e *Encoder) {
e.arrayEnd()
}
func (fastpathT) EncAsMapSliceFloat32V(v []float32, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeFloat32(v[j])
+ e.haltOnMbsOddLen(len(v))
+ e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2)
+ for j := range v {
+ if j&1 == 0 { // if j%2 == 0 {
+ e.mapElemKey()
+ } else {
+ e.mapElemValue()
}
- e.mapEnd()
+ e.e.EncodeFloat32(v[j])
}
+ e.mapEnd()
}
func (e *Encoder) fastpathEncSliceFloat64R(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceFloat64V(rv2i(rv).([]float64), e)
+ var v []float64
+ if rv.Kind() == reflect.Array {
+ rvGetSlice4Array(rv, &v)
} else {
- fastpathTV.EncSliceFloat64V(rv2i(rv).([]float64), e)
+ v = rv2i(rv).([]float64)
+ }
+ if f.ti.mbs {
+ fastpathTV.EncAsMapSliceFloat64V(v, e)
+ } else {
+ fastpathTV.EncSliceFloat64V(v, e)
}
}
func (fastpathT) EncSliceFloat64V(v []float64, e *Encoder) {
@@ -982,119 +781,58 @@ func (fastpathT) EncSliceFloat64V(v []float64, e *Encoder) {
e.arrayEnd()
}
func (fastpathT) EncAsMapSliceFloat64V(v []float64, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeFloat64(v[j])
- }
- e.mapEnd()
- }
-}
-func (e *Encoder) fastpathEncSliceUintR(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceUintV(rv2i(rv).([]uint), e)
- } else {
- fastpathTV.EncSliceUintV(rv2i(rv).([]uint), e)
- }
-}
-func (fastpathT) EncSliceUintV(v []uint, e *Encoder) {
- e.arrayStart(len(v))
+ e.haltOnMbsOddLen(len(v))
+ e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2)
for j := range v {
- e.arrayElem()
+ if j&1 == 0 { // if j%2 == 0 {
+ e.mapElemKey()
+ } else {
+ e.mapElemValue()
+ }
+ e.e.EncodeFloat64(v[j])
+ }
+ e.mapEnd()
+}
+func (e *Encoder) fastpathEncSliceUint8R(f *codecFnInfo, rv reflect.Value) {
+ var v []uint8
+ if rv.Kind() == reflect.Array {
+ rvGetSlice4Array(rv, &v)
+ } else {
+ v = rv2i(rv).([]uint8)
+ }
+ if f.ti.mbs {
+ fastpathTV.EncAsMapSliceUint8V(v, e)
+ } else {
+ fastpathTV.EncSliceUint8V(v, e)
+ }
+}
+func (fastpathT) EncSliceUint8V(v []uint8, e *Encoder) {
+ e.e.EncodeStringBytesRaw(v)
+}
+func (fastpathT) EncAsMapSliceUint8V(v []uint8, e *Encoder) {
+ e.haltOnMbsOddLen(len(v))
+ e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2)
+ for j := range v {
+ if j&1 == 0 { // if j%2 == 0 {
+ e.mapElemKey()
+ } else {
+ e.mapElemValue()
+ }
e.e.EncodeUint(uint64(v[j]))
}
- e.arrayEnd()
-}
-func (fastpathT) EncAsMapSliceUintV(v []uint, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeUint(uint64(v[j]))
- }
- e.mapEnd()
- }
-}
-func (e *Encoder) fastpathEncSliceUint16R(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceUint16V(rv2i(rv).([]uint16), e)
- } else {
- fastpathTV.EncSliceUint16V(rv2i(rv).([]uint16), e)
- }
-}
-func (fastpathT) EncSliceUint16V(v []uint16, e *Encoder) {
- e.arrayStart(len(v))
- for j := range v {
- e.arrayElem()
- e.e.EncodeUint(uint64(v[j]))
- }
- e.arrayEnd()
-}
-func (fastpathT) EncAsMapSliceUint16V(v []uint16, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeUint(uint64(v[j]))
- }
- e.mapEnd()
- }
-}
-func (e *Encoder) fastpathEncSliceUint32R(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceUint32V(rv2i(rv).([]uint32), e)
- } else {
- fastpathTV.EncSliceUint32V(rv2i(rv).([]uint32), e)
- }
-}
-func (fastpathT) EncSliceUint32V(v []uint32, e *Encoder) {
- e.arrayStart(len(v))
- for j := range v {
- e.arrayElem()
- e.e.EncodeUint(uint64(v[j]))
- }
- e.arrayEnd()
-}
-func (fastpathT) EncAsMapSliceUint32V(v []uint32, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeUint(uint64(v[j]))
- }
- e.mapEnd()
- }
+ e.mapEnd()
}
func (e *Encoder) fastpathEncSliceUint64R(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceUint64V(rv2i(rv).([]uint64), e)
+ var v []uint64
+ if rv.Kind() == reflect.Array {
+ rvGetSlice4Array(rv, &v)
} else {
- fastpathTV.EncSliceUint64V(rv2i(rv).([]uint64), e)
+ v = rv2i(rv).([]uint64)
+ }
+ if f.ti.mbs {
+ fastpathTV.EncAsMapSliceUint64V(v, e)
+ } else {
+ fastpathTV.EncSliceUint64V(v, e)
}
}
func (fastpathT) EncSliceUint64V(v []uint64, e *Encoder) {
@@ -1106,26 +844,29 @@ func (fastpathT) EncSliceUint64V(v []uint64, e *Encoder) {
e.arrayEnd()
}
func (fastpathT) EncAsMapSliceUint64V(v []uint64, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeUint(v[j])
+ e.haltOnMbsOddLen(len(v))
+ e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2)
+ for j := range v {
+ if j&1 == 0 { // if j%2 == 0 {
+ e.mapElemKey()
+ } else {
+ e.mapElemValue()
}
- e.mapEnd()
+ e.e.EncodeUint(v[j])
}
+ e.mapEnd()
}
func (e *Encoder) fastpathEncSliceIntR(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceIntV(rv2i(rv).([]int), e)
+ var v []int
+ if rv.Kind() == reflect.Array {
+ rvGetSlice4Array(rv, &v)
} else {
- fastpathTV.EncSliceIntV(rv2i(rv).([]int), e)
+ v = rv2i(rv).([]int)
+ }
+ if f.ti.mbs {
+ fastpathTV.EncAsMapSliceIntV(v, e)
+ } else {
+ fastpathTV.EncSliceIntV(v, e)
}
}
func (fastpathT) EncSliceIntV(v []int, e *Encoder) {
@@ -1137,88 +878,29 @@ func (fastpathT) EncSliceIntV(v []int, e *Encoder) {
e.arrayEnd()
}
func (fastpathT) EncAsMapSliceIntV(v []int, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeInt(int64(v[j]))
- }
- e.mapEnd()
- }
-}
-func (e *Encoder) fastpathEncSliceInt8R(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceInt8V(rv2i(rv).([]int8), e)
- } else {
- fastpathTV.EncSliceInt8V(rv2i(rv).([]int8), e)
- }
-}
-func (fastpathT) EncSliceInt8V(v []int8, e *Encoder) {
- e.arrayStart(len(v))
+ e.haltOnMbsOddLen(len(v))
+ e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2)
for j := range v {
- e.arrayElem()
+ if j&1 == 0 { // if j%2 == 0 {
+ e.mapElemKey()
+ } else {
+ e.mapElemValue()
+ }
e.e.EncodeInt(int64(v[j]))
}
- e.arrayEnd()
-}
-func (fastpathT) EncAsMapSliceInt8V(v []int8, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeInt(int64(v[j]))
- }
- e.mapEnd()
- }
-}
-func (e *Encoder) fastpathEncSliceInt16R(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceInt16V(rv2i(rv).([]int16), e)
- } else {
- fastpathTV.EncSliceInt16V(rv2i(rv).([]int16), e)
- }
-}
-func (fastpathT) EncSliceInt16V(v []int16, e *Encoder) {
- e.arrayStart(len(v))
- for j := range v {
- e.arrayElem()
- e.e.EncodeInt(int64(v[j]))
- }
- e.arrayEnd()
-}
-func (fastpathT) EncAsMapSliceInt16V(v []int16, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeInt(int64(v[j]))
- }
- e.mapEnd()
- }
+ e.mapEnd()
}
func (e *Encoder) fastpathEncSliceInt32R(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceInt32V(rv2i(rv).([]int32), e)
+ var v []int32
+ if rv.Kind() == reflect.Array {
+ rvGetSlice4Array(rv, &v)
} else {
- fastpathTV.EncSliceInt32V(rv2i(rv).([]int32), e)
+ v = rv2i(rv).([]int32)
+ }
+ if f.ti.mbs {
+ fastpathTV.EncAsMapSliceInt32V(v, e)
+ } else {
+ fastpathTV.EncSliceInt32V(v, e)
}
}
func (fastpathT) EncSliceInt32V(v []int32, e *Encoder) {
@@ -1230,26 +912,29 @@ func (fastpathT) EncSliceInt32V(v []int32, e *Encoder) {
e.arrayEnd()
}
func (fastpathT) EncAsMapSliceInt32V(v []int32, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeInt(int64(v[j]))
+ e.haltOnMbsOddLen(len(v))
+ e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2)
+ for j := range v {
+ if j&1 == 0 { // if j%2 == 0 {
+ e.mapElemKey()
+ } else {
+ e.mapElemValue()
}
- e.mapEnd()
+ e.e.EncodeInt(int64(v[j]))
}
+ e.mapEnd()
}
func (e *Encoder) fastpathEncSliceInt64R(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceInt64V(rv2i(rv).([]int64), e)
+ var v []int64
+ if rv.Kind() == reflect.Array {
+ rvGetSlice4Array(rv, &v)
} else {
- fastpathTV.EncSliceInt64V(rv2i(rv).([]int64), e)
+ v = rv2i(rv).([]int64)
+ }
+ if f.ti.mbs {
+ fastpathTV.EncAsMapSliceInt64V(v, e)
+ } else {
+ fastpathTV.EncSliceInt64V(v, e)
}
}
func (fastpathT) EncSliceInt64V(v []int64, e *Encoder) {
@@ -1261,26 +946,29 @@ func (fastpathT) EncSliceInt64V(v []int64, e *Encoder) {
e.arrayEnd()
}
func (fastpathT) EncAsMapSliceInt64V(v []int64, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeInt(v[j])
+ e.haltOnMbsOddLen(len(v))
+ e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2)
+ for j := range v {
+ if j&1 == 0 { // if j%2 == 0 {
+ e.mapElemKey()
+ } else {
+ e.mapElemValue()
}
- e.mapEnd()
+ e.e.EncodeInt(v[j])
}
+ e.mapEnd()
}
func (e *Encoder) fastpathEncSliceBoolR(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.EncAsMapSliceBoolV(rv2i(rv).([]bool), e)
+ var v []bool
+ if rv.Kind() == reflect.Array {
+ rvGetSlice4Array(rv, &v)
} else {
- fastpathTV.EncSliceBoolV(rv2i(rv).([]bool), e)
+ v = rv2i(rv).([]bool)
+ }
+ if f.ti.mbs {
+ fastpathTV.EncAsMapSliceBoolV(v, e)
+ } else {
+ fastpathTV.EncSliceBoolV(v, e)
}
}
func (fastpathT) EncSliceBoolV(v []bool, e *Encoder) {
@@ -1292,20 +980,17 @@ func (fastpathT) EncSliceBoolV(v []bool, e *Encoder) {
e.arrayEnd()
}
func (fastpathT) EncAsMapSliceBoolV(v []bool, e *Encoder) {
- if len(v)%2 == 1 {
- e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- e.e.EncodeBool(v[j])
+ e.haltOnMbsOddLen(len(v))
+ e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2)
+ for j := range v {
+ if j&1 == 0 { // if j%2 == 0 {
+ e.mapElemKey()
+ } else {
+ e.mapElemValue()
}
- e.mapEnd()
+ e.e.EncodeBool(v[j])
}
+ e.mapEnd()
}
func (e *Encoder) fastpathEncMapStringIntfR(f *codecFnInfo, rv reflect.Value) {
fastpathTV.EncMapStringIntfV(rv2i(rv).(map[string]interface{}), e)
@@ -1394,35 +1079,6 @@ func (fastpathT) EncMapStringBytesV(v map[string][]byte, e *Encoder) {
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapStringUintR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapStringUintV(rv2i(rv).(map[string]uint), e)
-}
-func (fastpathT) EncMapStringUintV(v map[string]uint, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]string, len(v))
- var i uint
- for k := range v {
- v2[i] = k
- i++
- }
- sort.Sort(stringSlice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeString(k2)
- e.mapElemValue()
- e.e.EncodeUint(uint64(v[k2]))
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeString(k2)
- e.mapElemValue()
- e.e.EncodeUint(uint64(v2))
- }
- }
- e.mapEnd()
-}
func (e *Encoder) fastpathEncMapStringUint8R(f *codecFnInfo, rv reflect.Value) {
fastpathTV.EncMapStringUint8V(rv2i(rv).(map[string]uint8), e)
}
@@ -1510,10 +1166,10 @@ func (fastpathT) EncMapStringIntV(v map[string]int, e *Encoder) {
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapStringInt64R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapStringInt64V(rv2i(rv).(map[string]int64), e)
+func (e *Encoder) fastpathEncMapStringInt32R(f *codecFnInfo, rv reflect.Value) {
+ fastpathTV.EncMapStringInt32V(rv2i(rv).(map[string]int32), e)
}
-func (fastpathT) EncMapStringInt64V(v map[string]int64, e *Encoder) {
+func (fastpathT) EncMapStringInt32V(v map[string]int32, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
v2 := make([]string, len(v))
@@ -1527,43 +1183,14 @@ func (fastpathT) EncMapStringInt64V(v map[string]int64, e *Encoder) {
e.mapElemKey()
e.e.EncodeString(k2)
e.mapElemValue()
- e.e.EncodeInt(v[k2])
+ e.e.EncodeInt(int64(v[k2]))
}
} else {
for k2, v2 := range v {
e.mapElemKey()
e.e.EncodeString(k2)
e.mapElemValue()
- e.e.EncodeInt(v2)
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapStringFloat32R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapStringFloat32V(rv2i(rv).(map[string]float32), e)
-}
-func (fastpathT) EncMapStringFloat32V(v map[string]float32, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]string, len(v))
- var i uint
- for k := range v {
- v2[i] = k
- i++
- }
- sort.Sort(stringSlice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeString(k2)
- e.mapElemValue()
- e.e.EncodeFloat32(v[k2])
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeString(k2)
- e.mapElemValue()
- e.e.EncodeFloat32(v2)
+ e.e.EncodeInt(int64(v2))
}
}
e.mapEnd()
@@ -1626,343 +1253,24 @@ func (fastpathT) EncMapStringBoolV(v map[string]bool, e *Encoder) {
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapUintIntfR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUintIntfV(rv2i(rv).(map[uint]interface{}), e)
-}
-func (fastpathT) EncMapUintIntfV(v map[uint]interface{}, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = uint64(k)
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(uint64(uint(k2)))
- e.mapElemValue()
- e.encode(v[uint(k2)])
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(uint64(k2))
- e.mapElemValue()
- e.encode(v2)
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapUintStringR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUintStringV(rv2i(rv).(map[uint]string), e)
-}
-func (fastpathT) EncMapUintStringV(v map[uint]string, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = uint64(k)
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(uint64(uint(k2)))
- e.mapElemValue()
- e.e.EncodeString(v[uint(k2)])
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(uint64(k2))
- e.mapElemValue()
- e.e.EncodeString(v2)
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapUintBytesR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUintBytesV(rv2i(rv).(map[uint][]byte), e)
-}
-func (fastpathT) EncMapUintBytesV(v map[uint][]byte, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = uint64(k)
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(uint64(uint(k2)))
- e.mapElemValue()
- e.e.EncodeStringBytesRaw(v[uint(k2)])
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(uint64(k2))
- e.mapElemValue()
- e.e.EncodeStringBytesRaw(v2)
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapUintUintR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUintUintV(rv2i(rv).(map[uint]uint), e)
-}
-func (fastpathT) EncMapUintUintV(v map[uint]uint, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = uint64(k)
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(uint64(uint(k2)))
- e.mapElemValue()
- e.e.EncodeUint(uint64(v[uint(k2)]))
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(uint64(k2))
- e.mapElemValue()
- e.e.EncodeUint(uint64(v2))
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapUintUint8R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUintUint8V(rv2i(rv).(map[uint]uint8), e)
-}
-func (fastpathT) EncMapUintUint8V(v map[uint]uint8, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = uint64(k)
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(uint64(uint(k2)))
- e.mapElemValue()
- e.e.EncodeUint(uint64(v[uint(k2)]))
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(uint64(k2))
- e.mapElemValue()
- e.e.EncodeUint(uint64(v2))
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapUintUint64R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUintUint64V(rv2i(rv).(map[uint]uint64), e)
-}
-func (fastpathT) EncMapUintUint64V(v map[uint]uint64, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = uint64(k)
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(uint64(uint(k2)))
- e.mapElemValue()
- e.e.EncodeUint(v[uint(k2)])
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(uint64(k2))
- e.mapElemValue()
- e.e.EncodeUint(v2)
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapUintIntR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUintIntV(rv2i(rv).(map[uint]int), e)
-}
-func (fastpathT) EncMapUintIntV(v map[uint]int, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = uint64(k)
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(uint64(uint(k2)))
- e.mapElemValue()
- e.e.EncodeInt(int64(v[uint(k2)]))
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(uint64(k2))
- e.mapElemValue()
- e.e.EncodeInt(int64(v2))
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapUintInt64R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUintInt64V(rv2i(rv).(map[uint]int64), e)
-}
-func (fastpathT) EncMapUintInt64V(v map[uint]int64, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = uint64(k)
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(uint64(uint(k2)))
- e.mapElemValue()
- e.e.EncodeInt(v[uint(k2)])
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(uint64(k2))
- e.mapElemValue()
- e.e.EncodeInt(v2)
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapUintFloat32R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUintFloat32V(rv2i(rv).(map[uint]float32), e)
-}
-func (fastpathT) EncMapUintFloat32V(v map[uint]float32, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = uint64(k)
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(uint64(uint(k2)))
- e.mapElemValue()
- e.e.EncodeFloat32(v[uint(k2)])
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(uint64(k2))
- e.mapElemValue()
- e.e.EncodeFloat32(v2)
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapUintFloat64R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUintFloat64V(rv2i(rv).(map[uint]float64), e)
-}
-func (fastpathT) EncMapUintFloat64V(v map[uint]float64, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = uint64(k)
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(uint64(uint(k2)))
- e.mapElemValue()
- e.e.EncodeFloat64(v[uint(k2)])
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(uint64(k2))
- e.mapElemValue()
- e.e.EncodeFloat64(v2)
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapUintBoolR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUintBoolV(rv2i(rv).(map[uint]bool), e)
-}
-func (fastpathT) EncMapUintBoolV(v map[uint]bool, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = uint64(k)
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(uint64(uint(k2)))
- e.mapElemValue()
- e.e.EncodeBool(v[uint(k2)])
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(uint64(k2))
- e.mapElemValue()
- e.e.EncodeBool(v2)
- }
- }
- e.mapEnd()
-}
func (e *Encoder) fastpathEncMapUint8IntfR(f *codecFnInfo, rv reflect.Value) {
fastpathTV.EncMapUint8IntfV(rv2i(rv).(map[uint8]interface{}), e)
}
func (fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]uint64, len(v))
+ v2 := make([]uint8, len(v))
var i uint
for k := range v {
- v2[i] = uint64(k)
+ v2[i] = k
i++
}
- sort.Sort(uint64Slice(v2))
+ sort.Sort(uint8Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeUint(uint64(uint8(k2)))
+ e.e.EncodeUint(uint64(k2))
e.mapElemValue()
- e.encode(v[uint8(k2)])
+ e.encode(v[k2])
}
} else {
for k2, v2 := range v {
@@ -1980,18 +1288,18 @@ func (e *Encoder) fastpathEncMapUint8StringR(f *codecFnInfo, rv reflect.Value) {
func (fastpathT) EncMapUint8StringV(v map[uint8]string, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]uint64, len(v))
+ v2 := make([]uint8, len(v))
var i uint
for k := range v {
- v2[i] = uint64(k)
+ v2[i] = k
i++
}
- sort.Sort(uint64Slice(v2))
+ sort.Sort(uint8Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeUint(uint64(uint8(k2)))
+ e.e.EncodeUint(uint64(k2))
e.mapElemValue()
- e.e.EncodeString(v[uint8(k2)])
+ e.e.EncodeString(v[k2])
}
} else {
for k2, v2 := range v {
@@ -2009,18 +1317,18 @@ func (e *Encoder) fastpathEncMapUint8BytesR(f *codecFnInfo, rv reflect.Value) {
func (fastpathT) EncMapUint8BytesV(v map[uint8][]byte, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]uint64, len(v))
+ v2 := make([]uint8, len(v))
var i uint
for k := range v {
- v2[i] = uint64(k)
+ v2[i] = k
i++
}
- sort.Sort(uint64Slice(v2))
+ sort.Sort(uint8Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeUint(uint64(uint8(k2)))
+ e.e.EncodeUint(uint64(k2))
e.mapElemValue()
- e.e.EncodeStringBytesRaw(v[uint8(k2)])
+ e.e.EncodeStringBytesRaw(v[k2])
}
} else {
for k2, v2 := range v {
@@ -2032,53 +1340,24 @@ func (fastpathT) EncMapUint8BytesV(v map[uint8][]byte, e *Encoder) {
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapUint8UintR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUint8UintV(rv2i(rv).(map[uint8]uint), e)
-}
-func (fastpathT) EncMapUint8UintV(v map[uint8]uint, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = uint64(k)
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(uint64(uint8(k2)))
- e.mapElemValue()
- e.e.EncodeUint(uint64(v[uint8(k2)]))
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(uint64(k2))
- e.mapElemValue()
- e.e.EncodeUint(uint64(v2))
- }
- }
- e.mapEnd()
-}
func (e *Encoder) fastpathEncMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) {
fastpathTV.EncMapUint8Uint8V(rv2i(rv).(map[uint8]uint8), e)
}
func (fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]uint64, len(v))
+ v2 := make([]uint8, len(v))
var i uint
for k := range v {
- v2[i] = uint64(k)
+ v2[i] = k
i++
}
- sort.Sort(uint64Slice(v2))
+ sort.Sort(uint8Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeUint(uint64(uint8(k2)))
+ e.e.EncodeUint(uint64(k2))
e.mapElemValue()
- e.e.EncodeUint(uint64(v[uint8(k2)]))
+ e.e.EncodeUint(uint64(v[k2]))
}
} else {
for k2, v2 := range v {
@@ -2096,18 +1375,18 @@ func (e *Encoder) fastpathEncMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) {
func (fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]uint64, len(v))
+ v2 := make([]uint8, len(v))
var i uint
for k := range v {
- v2[i] = uint64(k)
+ v2[i] = k
i++
}
- sort.Sort(uint64Slice(v2))
+ sort.Sort(uint8Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeUint(uint64(uint8(k2)))
+ e.e.EncodeUint(uint64(k2))
e.mapElemValue()
- e.e.EncodeUint(v[uint8(k2)])
+ e.e.EncodeUint(v[k2])
}
} else {
for k2, v2 := range v {
@@ -2125,18 +1404,18 @@ func (e *Encoder) fastpathEncMapUint8IntR(f *codecFnInfo, rv reflect.Value) {
func (fastpathT) EncMapUint8IntV(v map[uint8]int, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]uint64, len(v))
+ v2 := make([]uint8, len(v))
var i uint
for k := range v {
- v2[i] = uint64(k)
+ v2[i] = k
i++
}
- sort.Sort(uint64Slice(v2))
+ sort.Sort(uint8Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeUint(uint64(uint8(k2)))
+ e.e.EncodeUint(uint64(k2))
e.mapElemValue()
- e.e.EncodeInt(int64(v[uint8(k2)]))
+ e.e.EncodeInt(int64(v[k2]))
}
} else {
for k2, v2 := range v {
@@ -2148,60 +1427,31 @@ func (fastpathT) EncMapUint8IntV(v map[uint8]int, e *Encoder) {
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapUint8Int64R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUint8Int64V(rv2i(rv).(map[uint8]int64), e)
+func (e *Encoder) fastpathEncMapUint8Int32R(f *codecFnInfo, rv reflect.Value) {
+ fastpathTV.EncMapUint8Int32V(rv2i(rv).(map[uint8]int32), e)
}
-func (fastpathT) EncMapUint8Int64V(v map[uint8]int64, e *Encoder) {
+func (fastpathT) EncMapUint8Int32V(v map[uint8]int32, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]uint64, len(v))
+ v2 := make([]uint8, len(v))
var i uint
for k := range v {
- v2[i] = uint64(k)
+ v2[i] = k
i++
}
- sort.Sort(uint64Slice(v2))
+ sort.Sort(uint8Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeUint(uint64(uint8(k2)))
+ e.e.EncodeUint(uint64(k2))
e.mapElemValue()
- e.e.EncodeInt(v[uint8(k2)])
+ e.e.EncodeInt(int64(v[k2]))
}
} else {
for k2, v2 := range v {
e.mapElemKey()
e.e.EncodeUint(uint64(k2))
e.mapElemValue()
- e.e.EncodeInt(v2)
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapUint8Float32R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUint8Float32V(rv2i(rv).(map[uint8]float32), e)
-}
-func (fastpathT) EncMapUint8Float32V(v map[uint8]float32, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = uint64(k)
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(uint64(uint8(k2)))
- e.mapElemValue()
- e.e.EncodeFloat32(v[uint8(k2)])
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(uint64(k2))
- e.mapElemValue()
- e.e.EncodeFloat32(v2)
+ e.e.EncodeInt(int64(v2))
}
}
e.mapEnd()
@@ -2212,18 +1462,18 @@ func (e *Encoder) fastpathEncMapUint8Float64R(f *codecFnInfo, rv reflect.Value)
func (fastpathT) EncMapUint8Float64V(v map[uint8]float64, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]uint64, len(v))
+ v2 := make([]uint8, len(v))
var i uint
for k := range v {
- v2[i] = uint64(k)
+ v2[i] = k
i++
}
- sort.Sort(uint64Slice(v2))
+ sort.Sort(uint8Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeUint(uint64(uint8(k2)))
+ e.e.EncodeUint(uint64(k2))
e.mapElemValue()
- e.e.EncodeFloat64(v[uint8(k2)])
+ e.e.EncodeFloat64(v[k2])
}
} else {
for k2, v2 := range v {
@@ -2241,18 +1491,18 @@ func (e *Encoder) fastpathEncMapUint8BoolR(f *codecFnInfo, rv reflect.Value) {
func (fastpathT) EncMapUint8BoolV(v map[uint8]bool, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]uint64, len(v))
+ v2 := make([]uint8, len(v))
var i uint
for k := range v {
- v2[i] = uint64(k)
+ v2[i] = k
i++
}
- sort.Sort(uint64Slice(v2))
+ sort.Sort(uint8Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeUint(uint64(uint8(k2)))
+ e.e.EncodeUint(uint64(k2))
e.mapElemValue()
- e.e.EncodeBool(v[uint8(k2)])
+ e.e.EncodeBool(v[k2])
}
} else {
for k2, v2 := range v {
@@ -2351,35 +1601,6 @@ func (fastpathT) EncMapUint64BytesV(v map[uint64][]byte, e *Encoder) {
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapUint64UintR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUint64UintV(rv2i(rv).(map[uint64]uint), e)
-}
-func (fastpathT) EncMapUint64UintV(v map[uint64]uint, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = k
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(k2)
- e.mapElemValue()
- e.e.EncodeUint(uint64(v[k2]))
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(k2)
- e.mapElemValue()
- e.e.EncodeUint(uint64(v2))
- }
- }
- e.mapEnd()
-}
func (e *Encoder) fastpathEncMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) {
fastpathTV.EncMapUint64Uint8V(rv2i(rv).(map[uint64]uint8), e)
}
@@ -2467,10 +1688,10 @@ func (fastpathT) EncMapUint64IntV(v map[uint64]int, e *Encoder) {
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapUint64Int64R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUint64Int64V(rv2i(rv).(map[uint64]int64), e)
+func (e *Encoder) fastpathEncMapUint64Int32R(f *codecFnInfo, rv reflect.Value) {
+ fastpathTV.EncMapUint64Int32V(rv2i(rv).(map[uint64]int32), e)
}
-func (fastpathT) EncMapUint64Int64V(v map[uint64]int64, e *Encoder) {
+func (fastpathT) EncMapUint64Int32V(v map[uint64]int32, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
v2 := make([]uint64, len(v))
@@ -2484,43 +1705,14 @@ func (fastpathT) EncMapUint64Int64V(v map[uint64]int64, e *Encoder) {
e.mapElemKey()
e.e.EncodeUint(k2)
e.mapElemValue()
- e.e.EncodeInt(v[k2])
+ e.e.EncodeInt(int64(v[k2]))
}
} else {
for k2, v2 := range v {
e.mapElemKey()
e.e.EncodeUint(k2)
e.mapElemValue()
- e.e.EncodeInt(v2)
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapUint64Float32R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapUint64Float32V(rv2i(rv).(map[uint64]float32), e)
-}
-func (fastpathT) EncMapUint64Float32V(v map[uint64]float32, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]uint64, len(v))
- var i uint
- for k := range v {
- v2[i] = k
- i++
- }
- sort.Sort(uint64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeUint(k2)
- e.mapElemValue()
- e.e.EncodeFloat32(v[k2])
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeUint(k2)
- e.mapElemValue()
- e.e.EncodeFloat32(v2)
+ e.e.EncodeInt(int64(v2))
}
}
e.mapEnd()
@@ -2589,18 +1781,18 @@ func (e *Encoder) fastpathEncMapIntIntfR(f *codecFnInfo, rv reflect.Value) {
func (fastpathT) EncMapIntIntfV(v map[int]interface{}, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int, len(v))
var i uint
for k := range v {
- v2[i] = int64(k)
+ v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(intSlice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(int64(int(k2)))
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
- e.encode(v[int(k2)])
+ e.encode(v[k2])
}
} else {
for k2, v2 := range v {
@@ -2618,18 +1810,18 @@ func (e *Encoder) fastpathEncMapIntStringR(f *codecFnInfo, rv reflect.Value) {
func (fastpathT) EncMapIntStringV(v map[int]string, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int, len(v))
var i uint
for k := range v {
- v2[i] = int64(k)
+ v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(intSlice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(int64(int(k2)))
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
- e.e.EncodeString(v[int(k2)])
+ e.e.EncodeString(v[k2])
}
} else {
for k2, v2 := range v {
@@ -2647,18 +1839,18 @@ func (e *Encoder) fastpathEncMapIntBytesR(f *codecFnInfo, rv reflect.Value) {
func (fastpathT) EncMapIntBytesV(v map[int][]byte, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int, len(v))
var i uint
for k := range v {
- v2[i] = int64(k)
+ v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(intSlice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(int64(int(k2)))
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
- e.e.EncodeStringBytesRaw(v[int(k2)])
+ e.e.EncodeStringBytesRaw(v[k2])
}
} else {
for k2, v2 := range v {
@@ -2670,53 +1862,24 @@ func (fastpathT) EncMapIntBytesV(v map[int][]byte, e *Encoder) {
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapIntUintR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapIntUintV(rv2i(rv).(map[int]uint), e)
-}
-func (fastpathT) EncMapIntUintV(v map[int]uint, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]int64, len(v))
- var i uint
- for k := range v {
- v2[i] = int64(k)
- i++
- }
- sort.Sort(int64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeInt(int64(int(k2)))
- e.mapElemValue()
- e.e.EncodeUint(uint64(v[int(k2)]))
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeInt(int64(k2))
- e.mapElemValue()
- e.e.EncodeUint(uint64(v2))
- }
- }
- e.mapEnd()
-}
func (e *Encoder) fastpathEncMapIntUint8R(f *codecFnInfo, rv reflect.Value) {
fastpathTV.EncMapIntUint8V(rv2i(rv).(map[int]uint8), e)
}
func (fastpathT) EncMapIntUint8V(v map[int]uint8, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int, len(v))
var i uint
for k := range v {
- v2[i] = int64(k)
+ v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(intSlice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(int64(int(k2)))
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
- e.e.EncodeUint(uint64(v[int(k2)]))
+ e.e.EncodeUint(uint64(v[k2]))
}
} else {
for k2, v2 := range v {
@@ -2734,18 +1897,18 @@ func (e *Encoder) fastpathEncMapIntUint64R(f *codecFnInfo, rv reflect.Value) {
func (fastpathT) EncMapIntUint64V(v map[int]uint64, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int, len(v))
var i uint
for k := range v {
- v2[i] = int64(k)
+ v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(intSlice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(int64(int(k2)))
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
- e.e.EncodeUint(v[int(k2)])
+ e.e.EncodeUint(v[k2])
}
} else {
for k2, v2 := range v {
@@ -2763,18 +1926,18 @@ func (e *Encoder) fastpathEncMapIntIntR(f *codecFnInfo, rv reflect.Value) {
func (fastpathT) EncMapIntIntV(v map[int]int, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int, len(v))
var i uint
for k := range v {
- v2[i] = int64(k)
+ v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(intSlice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(int64(int(k2)))
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
- e.e.EncodeInt(int64(v[int(k2)]))
+ e.e.EncodeInt(int64(v[k2]))
}
} else {
for k2, v2 := range v {
@@ -2786,60 +1949,31 @@ func (fastpathT) EncMapIntIntV(v map[int]int, e *Encoder) {
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapIntInt64R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapIntInt64V(rv2i(rv).(map[int]int64), e)
+func (e *Encoder) fastpathEncMapIntInt32R(f *codecFnInfo, rv reflect.Value) {
+ fastpathTV.EncMapIntInt32V(rv2i(rv).(map[int]int32), e)
}
-func (fastpathT) EncMapIntInt64V(v map[int]int64, e *Encoder) {
+func (fastpathT) EncMapIntInt32V(v map[int]int32, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int, len(v))
var i uint
for k := range v {
- v2[i] = int64(k)
+ v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(intSlice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(int64(int(k2)))
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
- e.e.EncodeInt(v[int(k2)])
+ e.e.EncodeInt(int64(v[k2]))
}
} else {
for k2, v2 := range v {
e.mapElemKey()
e.e.EncodeInt(int64(k2))
e.mapElemValue()
- e.e.EncodeInt(v2)
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapIntFloat32R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapIntFloat32V(rv2i(rv).(map[int]float32), e)
-}
-func (fastpathT) EncMapIntFloat32V(v map[int]float32, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]int64, len(v))
- var i uint
- for k := range v {
- v2[i] = int64(k)
- i++
- }
- sort.Sort(int64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeInt(int64(int(k2)))
- e.mapElemValue()
- e.e.EncodeFloat32(v[int(k2)])
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeInt(int64(k2))
- e.mapElemValue()
- e.e.EncodeFloat32(v2)
+ e.e.EncodeInt(int64(v2))
}
}
e.mapEnd()
@@ -2850,18 +1984,18 @@ func (e *Encoder) fastpathEncMapIntFloat64R(f *codecFnInfo, rv reflect.Value) {
func (fastpathT) EncMapIntFloat64V(v map[int]float64, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int, len(v))
var i uint
for k := range v {
- v2[i] = int64(k)
+ v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(intSlice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(int64(int(k2)))
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
- e.e.EncodeFloat64(v[int(k2)])
+ e.e.EncodeFloat64(v[k2])
}
} else {
for k2, v2 := range v {
@@ -2879,18 +2013,18 @@ func (e *Encoder) fastpathEncMapIntBoolR(f *codecFnInfo, rv reflect.Value) {
func (fastpathT) EncMapIntBoolV(v map[int]bool, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int, len(v))
var i uint
for k := range v {
- v2[i] = int64(k)
+ v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(intSlice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(int64(int(k2)))
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
- e.e.EncodeBool(v[int(k2)])
+ e.e.EncodeBool(v[k2])
}
} else {
for k2, v2 := range v {
@@ -2902,319 +2036,261 @@ func (fastpathT) EncMapIntBoolV(v map[int]bool, e *Encoder) {
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapInt64IntfR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapInt64IntfV(rv2i(rv).(map[int64]interface{}), e)
+func (e *Encoder) fastpathEncMapInt32IntfR(f *codecFnInfo, rv reflect.Value) {
+ fastpathTV.EncMapInt32IntfV(rv2i(rv).(map[int32]interface{}), e)
}
-func (fastpathT) EncMapInt64IntfV(v map[int64]interface{}, e *Encoder) {
+func (fastpathT) EncMapInt32IntfV(v map[int32]interface{}, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int32, len(v))
var i uint
for k := range v {
v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(int32Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.encode(v[k2])
}
} else {
for k2, v2 := range v {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.encode(v2)
}
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapInt64StringR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapInt64StringV(rv2i(rv).(map[int64]string), e)
+func (e *Encoder) fastpathEncMapInt32StringR(f *codecFnInfo, rv reflect.Value) {
+ fastpathTV.EncMapInt32StringV(rv2i(rv).(map[int32]string), e)
}
-func (fastpathT) EncMapInt64StringV(v map[int64]string, e *Encoder) {
+func (fastpathT) EncMapInt32StringV(v map[int32]string, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int32, len(v))
var i uint
for k := range v {
v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(int32Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeString(v[k2])
}
} else {
for k2, v2 := range v {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeString(v2)
}
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapInt64BytesR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapInt64BytesV(rv2i(rv).(map[int64][]byte), e)
+func (e *Encoder) fastpathEncMapInt32BytesR(f *codecFnInfo, rv reflect.Value) {
+ fastpathTV.EncMapInt32BytesV(rv2i(rv).(map[int32][]byte), e)
}
-func (fastpathT) EncMapInt64BytesV(v map[int64][]byte, e *Encoder) {
+func (fastpathT) EncMapInt32BytesV(v map[int32][]byte, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int32, len(v))
var i uint
for k := range v {
v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(int32Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeStringBytesRaw(v[k2])
}
} else {
for k2, v2 := range v {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeStringBytesRaw(v2)
}
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapInt64UintR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapInt64UintV(rv2i(rv).(map[int64]uint), e)
+func (e *Encoder) fastpathEncMapInt32Uint8R(f *codecFnInfo, rv reflect.Value) {
+ fastpathTV.EncMapInt32Uint8V(rv2i(rv).(map[int32]uint8), e)
}
-func (fastpathT) EncMapInt64UintV(v map[int64]uint, e *Encoder) {
+func (fastpathT) EncMapInt32Uint8V(v map[int32]uint8, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int32, len(v))
var i uint
for k := range v {
v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(int32Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeUint(uint64(v[k2]))
}
} else {
for k2, v2 := range v {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeUint(uint64(v2))
}
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapInt64Uint8R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapInt64Uint8V(rv2i(rv).(map[int64]uint8), e)
+func (e *Encoder) fastpathEncMapInt32Uint64R(f *codecFnInfo, rv reflect.Value) {
+ fastpathTV.EncMapInt32Uint64V(rv2i(rv).(map[int32]uint64), e)
}
-func (fastpathT) EncMapInt64Uint8V(v map[int64]uint8, e *Encoder) {
+func (fastpathT) EncMapInt32Uint64V(v map[int32]uint64, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int32, len(v))
var i uint
for k := range v {
v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(int32Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(k2)
- e.mapElemValue()
- e.e.EncodeUint(uint64(v[k2]))
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeInt(k2)
- e.mapElemValue()
- e.e.EncodeUint(uint64(v2))
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapInt64Uint64R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapInt64Uint64V(rv2i(rv).(map[int64]uint64), e)
-}
-func (fastpathT) EncMapInt64Uint64V(v map[int64]uint64, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]int64, len(v))
- var i uint
- for k := range v {
- v2[i] = k
- i++
- }
- sort.Sort(int64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeUint(v[k2])
}
} else {
for k2, v2 := range v {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeUint(v2)
}
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapInt64IntR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapInt64IntV(rv2i(rv).(map[int64]int), e)
+func (e *Encoder) fastpathEncMapInt32IntR(f *codecFnInfo, rv reflect.Value) {
+ fastpathTV.EncMapInt32IntV(rv2i(rv).(map[int32]int), e)
}
-func (fastpathT) EncMapInt64IntV(v map[int64]int, e *Encoder) {
+func (fastpathT) EncMapInt32IntV(v map[int32]int, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int32, len(v))
var i uint
for k := range v {
v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(int32Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeInt(int64(v[k2]))
}
} else {
for k2, v2 := range v {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeInt(int64(v2))
}
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapInt64Int64R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapInt64Int64V(rv2i(rv).(map[int64]int64), e)
+func (e *Encoder) fastpathEncMapInt32Int32R(f *codecFnInfo, rv reflect.Value) {
+ fastpathTV.EncMapInt32Int32V(rv2i(rv).(map[int32]int32), e)
}
-func (fastpathT) EncMapInt64Int64V(v map[int64]int64, e *Encoder) {
+func (fastpathT) EncMapInt32Int32V(v map[int32]int32, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int32, len(v))
var i uint
for k := range v {
v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(int32Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
- e.e.EncodeInt(v[k2])
+ e.e.EncodeInt(int64(v[k2]))
}
} else {
for k2, v2 := range v {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
- e.e.EncodeInt(v2)
+ e.e.EncodeInt(int64(v2))
}
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapInt64Float32R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapInt64Float32V(rv2i(rv).(map[int64]float32), e)
+func (e *Encoder) fastpathEncMapInt32Float64R(f *codecFnInfo, rv reflect.Value) {
+ fastpathTV.EncMapInt32Float64V(rv2i(rv).(map[int32]float64), e)
}
-func (fastpathT) EncMapInt64Float32V(v map[int64]float32, e *Encoder) {
+func (fastpathT) EncMapInt32Float64V(v map[int32]float64, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int32, len(v))
var i uint
for k := range v {
v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(int32Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(k2)
- e.mapElemValue()
- e.e.EncodeFloat32(v[k2])
- }
- } else {
- for k2, v2 := range v {
- e.mapElemKey()
- e.e.EncodeInt(k2)
- e.mapElemValue()
- e.e.EncodeFloat32(v2)
- }
- }
- e.mapEnd()
-}
-func (e *Encoder) fastpathEncMapInt64Float64R(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapInt64Float64V(rv2i(rv).(map[int64]float64), e)
-}
-func (fastpathT) EncMapInt64Float64V(v map[int64]float64, e *Encoder) {
- e.mapStart(len(v))
- if e.h.Canonical {
- v2 := make([]int64, len(v))
- var i uint
- for k := range v {
- v2[i] = k
- i++
- }
- sort.Sort(int64Slice(v2))
- for _, k2 := range v2 {
- e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeFloat64(v[k2])
}
} else {
for k2, v2 := range v {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeFloat64(v2)
}
}
e.mapEnd()
}
-func (e *Encoder) fastpathEncMapInt64BoolR(f *codecFnInfo, rv reflect.Value) {
- fastpathTV.EncMapInt64BoolV(rv2i(rv).(map[int64]bool), e)
+func (e *Encoder) fastpathEncMapInt32BoolR(f *codecFnInfo, rv reflect.Value) {
+ fastpathTV.EncMapInt32BoolV(rv2i(rv).(map[int32]bool), e)
}
-func (fastpathT) EncMapInt64BoolV(v map[int64]bool, e *Encoder) {
+func (fastpathT) EncMapInt32BoolV(v map[int32]bool, e *Encoder) {
e.mapStart(len(v))
if e.h.Canonical {
- v2 := make([]int64, len(v))
+ v2 := make([]int32, len(v))
var i uint
for k := range v {
v2[i] = k
i++
}
- sort.Sort(int64Slice(v2))
+ sort.Sort(int32Slice(v2))
for _, k2 := range v2 {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeBool(v[k2])
}
} else {
for k2, v2 := range v {
e.mapElemKey()
- e.e.EncodeInt(k2)
+ e.e.EncodeInt(int64(k2))
e.mapElemValue()
e.e.EncodeBool(v2)
}
@@ -3264,25 +2340,11 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
if v2, changed = fastpathTV.DecSliceFloat64Y(*v, d); changed {
*v = v2
}
- case []uint:
- fastpathTV.DecSliceUintN(v, d)
- case *[]uint:
- var v2 []uint
- if v2, changed = fastpathTV.DecSliceUintY(*v, d); changed {
- *v = v2
- }
- case []uint16:
- fastpathTV.DecSliceUint16N(v, d)
- case *[]uint16:
- var v2 []uint16
- if v2, changed = fastpathTV.DecSliceUint16Y(*v, d); changed {
- *v = v2
- }
- case []uint32:
- fastpathTV.DecSliceUint32N(v, d)
- case *[]uint32:
- var v2 []uint32
- if v2, changed = fastpathTV.DecSliceUint32Y(*v, d); changed {
+ case []uint8:
+ fastpathTV.DecSliceUint8N(v, d)
+ case *[]uint8:
+ var v2 []uint8
+ if v2, changed = fastpathTV.DecSliceUint8Y(*v, d); changed {
*v = v2
}
case []uint64:
@@ -3299,20 +2361,6 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
if v2, changed = fastpathTV.DecSliceIntY(*v, d); changed {
*v = v2
}
- case []int8:
- fastpathTV.DecSliceInt8N(v, d)
- case *[]int8:
- var v2 []int8
- if v2, changed = fastpathTV.DecSliceInt8Y(*v, d); changed {
- *v = v2
- }
- case []int16:
- fastpathTV.DecSliceInt16N(v, d)
- case *[]int16:
- var v2 []int16
- if v2, changed = fastpathTV.DecSliceInt16Y(*v, d); changed {
- *v = v2
- }
case []int32:
fastpathTV.DecSliceInt32N(v, d)
case *[]int32:
@@ -3335,8 +2383,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
*v = v2
}
case map[string]interface{}:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapStringIntfL(v, containerLen, d)
}
@@ -3345,8 +2393,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[string]interface{}:
fastpathTV.DecMapStringIntfX(v, d)
case map[string]string:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapStringStringL(v, containerLen, d)
}
@@ -3355,8 +2403,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[string]string:
fastpathTV.DecMapStringStringX(v, d)
case map[string][]byte:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapStringBytesL(v, containerLen, d)
}
@@ -3364,19 +2412,9 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
}
case *map[string][]byte:
fastpathTV.DecMapStringBytesX(v, d)
- case map[string]uint:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapStringUintL(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[string]uint:
- fastpathTV.DecMapStringUintX(v, d)
case map[string]uint8:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapStringUint8L(v, containerLen, d)
}
@@ -3385,8 +2423,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[string]uint8:
fastpathTV.DecMapStringUint8X(v, d)
case map[string]uint64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapStringUint64L(v, containerLen, d)
}
@@ -3395,8 +2433,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[string]uint64:
fastpathTV.DecMapStringUint64X(v, d)
case map[string]int:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapStringIntL(v, containerLen, d)
}
@@ -3404,29 +2442,19 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
}
case *map[string]int:
fastpathTV.DecMapStringIntX(v, d)
- case map[string]int64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ case map[string]int32:
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
- fastpathTV.DecMapStringInt64L(v, containerLen, d)
+ fastpathTV.DecMapStringInt32L(v, containerLen, d)
}
d.mapEnd()
}
- case *map[string]int64:
- fastpathTV.DecMapStringInt64X(v, d)
- case map[string]float32:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapStringFloat32L(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[string]float32:
- fastpathTV.DecMapStringFloat32X(v, d)
+ case *map[string]int32:
+ fastpathTV.DecMapStringInt32X(v, d)
case map[string]float64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapStringFloat64L(v, containerLen, d)
}
@@ -3435,8 +2463,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[string]float64:
fastpathTV.DecMapStringFloat64X(v, d)
case map[string]bool:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapStringBoolL(v, containerLen, d)
}
@@ -3444,119 +2472,9 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
}
case *map[string]bool:
fastpathTV.DecMapStringBoolX(v, d)
- case map[uint]interface{}:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUintIntfL(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint]interface{}:
- fastpathTV.DecMapUintIntfX(v, d)
- case map[uint]string:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUintStringL(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint]string:
- fastpathTV.DecMapUintStringX(v, d)
- case map[uint][]byte:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUintBytesL(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint][]byte:
- fastpathTV.DecMapUintBytesX(v, d)
- case map[uint]uint:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUintUintL(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint]uint:
- fastpathTV.DecMapUintUintX(v, d)
- case map[uint]uint8:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUintUint8L(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint]uint8:
- fastpathTV.DecMapUintUint8X(v, d)
- case map[uint]uint64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUintUint64L(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint]uint64:
- fastpathTV.DecMapUintUint64X(v, d)
- case map[uint]int:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUintIntL(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint]int:
- fastpathTV.DecMapUintIntX(v, d)
- case map[uint]int64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUintInt64L(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint]int64:
- fastpathTV.DecMapUintInt64X(v, d)
- case map[uint]float32:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUintFloat32L(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint]float32:
- fastpathTV.DecMapUintFloat32X(v, d)
- case map[uint]float64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUintFloat64L(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint]float64:
- fastpathTV.DecMapUintFloat64X(v, d)
- case map[uint]bool:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUintBoolL(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint]bool:
- fastpathTV.DecMapUintBoolX(v, d)
case map[uint8]interface{}:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint8IntfL(v, containerLen, d)
}
@@ -3565,8 +2483,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[uint8]interface{}:
fastpathTV.DecMapUint8IntfX(v, d)
case map[uint8]string:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint8StringL(v, containerLen, d)
}
@@ -3575,8 +2493,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[uint8]string:
fastpathTV.DecMapUint8StringX(v, d)
case map[uint8][]byte:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint8BytesL(v, containerLen, d)
}
@@ -3584,19 +2502,9 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
}
case *map[uint8][]byte:
fastpathTV.DecMapUint8BytesX(v, d)
- case map[uint8]uint:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUint8UintL(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint8]uint:
- fastpathTV.DecMapUint8UintX(v, d)
case map[uint8]uint8:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint8Uint8L(v, containerLen, d)
}
@@ -3605,8 +2513,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[uint8]uint8:
fastpathTV.DecMapUint8Uint8X(v, d)
case map[uint8]uint64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint8Uint64L(v, containerLen, d)
}
@@ -3615,8 +2523,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[uint8]uint64:
fastpathTV.DecMapUint8Uint64X(v, d)
case map[uint8]int:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint8IntL(v, containerLen, d)
}
@@ -3624,29 +2532,19 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
}
case *map[uint8]int:
fastpathTV.DecMapUint8IntX(v, d)
- case map[uint8]int64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ case map[uint8]int32:
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
- fastpathTV.DecMapUint8Int64L(v, containerLen, d)
+ fastpathTV.DecMapUint8Int32L(v, containerLen, d)
}
d.mapEnd()
}
- case *map[uint8]int64:
- fastpathTV.DecMapUint8Int64X(v, d)
- case map[uint8]float32:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUint8Float32L(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint8]float32:
- fastpathTV.DecMapUint8Float32X(v, d)
+ case *map[uint8]int32:
+ fastpathTV.DecMapUint8Int32X(v, d)
case map[uint8]float64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint8Float64L(v, containerLen, d)
}
@@ -3655,8 +2553,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[uint8]float64:
fastpathTV.DecMapUint8Float64X(v, d)
case map[uint8]bool:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint8BoolL(v, containerLen, d)
}
@@ -3665,8 +2563,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[uint8]bool:
fastpathTV.DecMapUint8BoolX(v, d)
case map[uint64]interface{}:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint64IntfL(v, containerLen, d)
}
@@ -3675,8 +2573,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[uint64]interface{}:
fastpathTV.DecMapUint64IntfX(v, d)
case map[uint64]string:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint64StringL(v, containerLen, d)
}
@@ -3685,8 +2583,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[uint64]string:
fastpathTV.DecMapUint64StringX(v, d)
case map[uint64][]byte:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint64BytesL(v, containerLen, d)
}
@@ -3694,19 +2592,9 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
}
case *map[uint64][]byte:
fastpathTV.DecMapUint64BytesX(v, d)
- case map[uint64]uint:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUint64UintL(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint64]uint:
- fastpathTV.DecMapUint64UintX(v, d)
case map[uint64]uint8:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint64Uint8L(v, containerLen, d)
}
@@ -3715,8 +2603,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[uint64]uint8:
fastpathTV.DecMapUint64Uint8X(v, d)
case map[uint64]uint64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint64Uint64L(v, containerLen, d)
}
@@ -3725,8 +2613,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[uint64]uint64:
fastpathTV.DecMapUint64Uint64X(v, d)
case map[uint64]int:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint64IntL(v, containerLen, d)
}
@@ -3734,29 +2622,19 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
}
case *map[uint64]int:
fastpathTV.DecMapUint64IntX(v, d)
- case map[uint64]int64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ case map[uint64]int32:
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
- fastpathTV.DecMapUint64Int64L(v, containerLen, d)
+ fastpathTV.DecMapUint64Int32L(v, containerLen, d)
}
d.mapEnd()
}
- case *map[uint64]int64:
- fastpathTV.DecMapUint64Int64X(v, d)
- case map[uint64]float32:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapUint64Float32L(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[uint64]float32:
- fastpathTV.DecMapUint64Float32X(v, d)
+ case *map[uint64]int32:
+ fastpathTV.DecMapUint64Int32X(v, d)
case map[uint64]float64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint64Float64L(v, containerLen, d)
}
@@ -3765,8 +2643,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[uint64]float64:
fastpathTV.DecMapUint64Float64X(v, d)
case map[uint64]bool:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapUint64BoolL(v, containerLen, d)
}
@@ -3775,8 +2653,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[uint64]bool:
fastpathTV.DecMapUint64BoolX(v, d)
case map[int]interface{}:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapIntIntfL(v, containerLen, d)
}
@@ -3785,8 +2663,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[int]interface{}:
fastpathTV.DecMapIntIntfX(v, d)
case map[int]string:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapIntStringL(v, containerLen, d)
}
@@ -3795,8 +2673,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[int]string:
fastpathTV.DecMapIntStringX(v, d)
case map[int][]byte:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapIntBytesL(v, containerLen, d)
}
@@ -3804,19 +2682,9 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
}
case *map[int][]byte:
fastpathTV.DecMapIntBytesX(v, d)
- case map[int]uint:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapIntUintL(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[int]uint:
- fastpathTV.DecMapIntUintX(v, d)
case map[int]uint8:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapIntUint8L(v, containerLen, d)
}
@@ -3825,8 +2693,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[int]uint8:
fastpathTV.DecMapIntUint8X(v, d)
case map[int]uint64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapIntUint64L(v, containerLen, d)
}
@@ -3835,8 +2703,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[int]uint64:
fastpathTV.DecMapIntUint64X(v, d)
case map[int]int:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapIntIntL(v, containerLen, d)
}
@@ -3844,29 +2712,19 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
}
case *map[int]int:
fastpathTV.DecMapIntIntX(v, d)
- case map[int]int64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ case map[int]int32:
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
- fastpathTV.DecMapIntInt64L(v, containerLen, d)
+ fastpathTV.DecMapIntInt32L(v, containerLen, d)
}
d.mapEnd()
}
- case *map[int]int64:
- fastpathTV.DecMapIntInt64X(v, d)
- case map[int]float32:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapIntFloat32L(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[int]float32:
- fastpathTV.DecMapIntFloat32X(v, d)
+ case *map[int]int32:
+ fastpathTV.DecMapIntInt32X(v, d)
case map[int]float64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapIntFloat64L(v, containerLen, d)
}
@@ -3875,8 +2733,8 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
case *map[int]float64:
fastpathTV.DecMapIntFloat64X(v, d)
case map[int]bool:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.DecMapIntBoolL(v, containerLen, d)
}
@@ -3884,116 +2742,96 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
}
case *map[int]bool:
fastpathTV.DecMapIntBoolX(v, d)
- case map[int64]interface{}:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ case map[int32]interface{}:
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
- fastpathTV.DecMapInt64IntfL(v, containerLen, d)
+ fastpathTV.DecMapInt32IntfL(v, containerLen, d)
}
d.mapEnd()
}
- case *map[int64]interface{}:
- fastpathTV.DecMapInt64IntfX(v, d)
- case map[int64]string:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ case *map[int32]interface{}:
+ fastpathTV.DecMapInt32IntfX(v, d)
+ case map[int32]string:
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
- fastpathTV.DecMapInt64StringL(v, containerLen, d)
+ fastpathTV.DecMapInt32StringL(v, containerLen, d)
}
d.mapEnd()
}
- case *map[int64]string:
- fastpathTV.DecMapInt64StringX(v, d)
- case map[int64][]byte:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ case *map[int32]string:
+ fastpathTV.DecMapInt32StringX(v, d)
+ case map[int32][]byte:
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
- fastpathTV.DecMapInt64BytesL(v, containerLen, d)
+ fastpathTV.DecMapInt32BytesL(v, containerLen, d)
}
d.mapEnd()
}
- case *map[int64][]byte:
- fastpathTV.DecMapInt64BytesX(v, d)
- case map[int64]uint:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ case *map[int32][]byte:
+ fastpathTV.DecMapInt32BytesX(v, d)
+ case map[int32]uint8:
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
- fastpathTV.DecMapInt64UintL(v, containerLen, d)
+ fastpathTV.DecMapInt32Uint8L(v, containerLen, d)
}
d.mapEnd()
}
- case *map[int64]uint:
- fastpathTV.DecMapInt64UintX(v, d)
- case map[int64]uint8:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ case *map[int32]uint8:
+ fastpathTV.DecMapInt32Uint8X(v, d)
+ case map[int32]uint64:
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
- fastpathTV.DecMapInt64Uint8L(v, containerLen, d)
+ fastpathTV.DecMapInt32Uint64L(v, containerLen, d)
}
d.mapEnd()
}
- case *map[int64]uint8:
- fastpathTV.DecMapInt64Uint8X(v, d)
- case map[int64]uint64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ case *map[int32]uint64:
+ fastpathTV.DecMapInt32Uint64X(v, d)
+ case map[int32]int:
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
- fastpathTV.DecMapInt64Uint64L(v, containerLen, d)
+ fastpathTV.DecMapInt32IntL(v, containerLen, d)
}
d.mapEnd()
}
- case *map[int64]uint64:
- fastpathTV.DecMapInt64Uint64X(v, d)
- case map[int64]int:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ case *map[int32]int:
+ fastpathTV.DecMapInt32IntX(v, d)
+ case map[int32]int32:
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
- fastpathTV.DecMapInt64IntL(v, containerLen, d)
+ fastpathTV.DecMapInt32Int32L(v, containerLen, d)
}
d.mapEnd()
}
- case *map[int64]int:
- fastpathTV.DecMapInt64IntX(v, d)
- case map[int64]int64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ case *map[int32]int32:
+ fastpathTV.DecMapInt32Int32X(v, d)
+ case map[int32]float64:
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
- fastpathTV.DecMapInt64Int64L(v, containerLen, d)
+ fastpathTV.DecMapInt32Float64L(v, containerLen, d)
}
d.mapEnd()
}
- case *map[int64]int64:
- fastpathTV.DecMapInt64Int64X(v, d)
- case map[int64]float32:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ case *map[int32]float64:
+ fastpathTV.DecMapInt32Float64X(v, d)
+ case map[int32]bool:
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
- fastpathTV.DecMapInt64Float32L(v, containerLen, d)
+ fastpathTV.DecMapInt32BoolL(v, containerLen, d)
}
d.mapEnd()
}
- case *map[int64]float32:
- fastpathTV.DecMapInt64Float32X(v, d)
- case map[int64]float64:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapInt64Float64L(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[int64]float64:
- fastpathTV.DecMapInt64Float64X(v, d)
- case map[int64]bool:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
- if containerLen != 0 {
- fastpathTV.DecMapInt64BoolL(v, containerLen, d)
- }
- d.mapEnd()
- }
- case *map[int64]bool:
- fastpathTV.DecMapInt64BoolX(v, d)
+ case *map[int32]bool:
+ fastpathTV.DecMapInt32BoolX(v, d)
default:
_ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4
return false
@@ -4013,20 +2851,12 @@ func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool {
*v = nil
case *[]float64:
*v = nil
- case *[]uint:
- *v = nil
- case *[]uint16:
- *v = nil
- case *[]uint32:
+ case *[]uint8:
*v = nil
case *[]uint64:
*v = nil
case *[]int:
*v = nil
- case *[]int8:
- *v = nil
- case *[]int16:
- *v = nil
case *[]int32:
*v = nil
case *[]int64:
@@ -4040,61 +2870,31 @@ func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool {
*v = nil
case *map[string][]byte:
*v = nil
- case *map[string]uint:
- *v = nil
case *map[string]uint8:
*v = nil
case *map[string]uint64:
*v = nil
case *map[string]int:
*v = nil
- case *map[string]int64:
- *v = nil
- case *map[string]float32:
+ case *map[string]int32:
*v = nil
case *map[string]float64:
*v = nil
case *map[string]bool:
*v = nil
- case *map[uint]interface{}:
- *v = nil
- case *map[uint]string:
- *v = nil
- case *map[uint][]byte:
- *v = nil
- case *map[uint]uint:
- *v = nil
- case *map[uint]uint8:
- *v = nil
- case *map[uint]uint64:
- *v = nil
- case *map[uint]int:
- *v = nil
- case *map[uint]int64:
- *v = nil
- case *map[uint]float32:
- *v = nil
- case *map[uint]float64:
- *v = nil
- case *map[uint]bool:
- *v = nil
case *map[uint8]interface{}:
*v = nil
case *map[uint8]string:
*v = nil
case *map[uint8][]byte:
*v = nil
- case *map[uint8]uint:
- *v = nil
case *map[uint8]uint8:
*v = nil
case *map[uint8]uint64:
*v = nil
case *map[uint8]int:
*v = nil
- case *map[uint8]int64:
- *v = nil
- case *map[uint8]float32:
+ case *map[uint8]int32:
*v = nil
case *map[uint8]float64:
*v = nil
@@ -4106,17 +2906,13 @@ func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool {
*v = nil
case *map[uint64][]byte:
*v = nil
- case *map[uint64]uint:
- *v = nil
case *map[uint64]uint8:
*v = nil
case *map[uint64]uint64:
*v = nil
case *map[uint64]int:
*v = nil
- case *map[uint64]int64:
- *v = nil
- case *map[uint64]float32:
+ case *map[uint64]int32:
*v = nil
case *map[uint64]float64:
*v = nil
@@ -4128,43 +2924,35 @@ func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool {
*v = nil
case *map[int][]byte:
*v = nil
- case *map[int]uint:
- *v = nil
case *map[int]uint8:
*v = nil
case *map[int]uint64:
*v = nil
case *map[int]int:
*v = nil
- case *map[int]int64:
- *v = nil
- case *map[int]float32:
+ case *map[int]int32:
*v = nil
case *map[int]float64:
*v = nil
case *map[int]bool:
*v = nil
- case *map[int64]interface{}:
+ case *map[int32]interface{}:
*v = nil
- case *map[int64]string:
+ case *map[int32]string:
*v = nil
- case *map[int64][]byte:
+ case *map[int32][]byte:
*v = nil
- case *map[int64]uint:
+ case *map[int32]uint8:
*v = nil
- case *map[int64]uint8:
+ case *map[int32]uint64:
*v = nil
- case *map[int64]uint64:
+ case *map[int32]int:
*v = nil
- case *map[int64]int:
+ case *map[int32]int32:
*v = nil
- case *map[int64]int64:
+ case *map[int32]float64:
*v = nil
- case *map[int64]float32:
- *v = nil
- case *map[int64]float64:
- *v = nil
- case *map[int64]bool:
+ case *map[int32]bool:
*v = nil
default:
@@ -4177,12 +2965,18 @@ func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool {
// -- -- fast path functions
func (d *Decoder) fastpathDecSliceIntfR(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
+ var v []interface{}
+ switch rv.Kind() {
+ case reflect.Ptr:
vp := rv2i(rv).(*[]interface{})
- if v, changed := fastpathTV.DecSliceIntfY(*vp, d); changed {
+ var changed bool
+ if v, changed = fastpathTV.DecSliceIntfY(*vp, d); changed {
*vp = v
}
- } else {
+ case reflect.Array:
+ rvGetSlice4Array(rv, &v)
+ fastpathTV.DecSliceIntfN(v, d)
+ default:
fastpathTV.DecSliceIntfN(rv2i(rv).([]interface{}), d)
}
}
@@ -4191,7 +2985,7 @@ func (f fastpathT) DecSliceIntfX(vp *[]interface{}, d *Decoder) {
*vp = v
}
}
-func (fastpathT) DecSliceIntfY(v []interface{}, d *Decoder) (_ []interface{}, changed bool) {
+func (fastpathT) DecSliceIntfY(v []interface{}, d *Decoder) (v2 []interface{}, changed bool) {
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
if v == nil {
@@ -4226,12 +3020,8 @@ func (fastpathT) DecSliceIntfY(v []interface{}, d *Decoder) (_ []interface{}, ch
}
var j int
for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
- } else {
- xlen = 8
- }
+ if j == 0 && len(v) == 0 { // means hasLen == false
+ xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
v = make([]interface{}, uint(xlen))
changed = true
}
@@ -4264,7 +3054,7 @@ func (fastpathT) DecSliceIntfN(v []interface{}, d *Decoder) {
hasLen := containerLenS > 0
for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
+ slh.arrayCannotExpand(hasLen, len(v), j, containerLenS)
return
}
slh.ElemContainerState(j)
@@ -4274,12 +3064,18 @@ func (fastpathT) DecSliceIntfN(v []interface{}, d *Decoder) {
}
func (d *Decoder) fastpathDecSliceStringR(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
+ var v []string
+ switch rv.Kind() {
+ case reflect.Ptr:
vp := rv2i(rv).(*[]string)
- if v, changed := fastpathTV.DecSliceStringY(*vp, d); changed {
+ var changed bool
+ if v, changed = fastpathTV.DecSliceStringY(*vp, d); changed {
*vp = v
}
- } else {
+ case reflect.Array:
+ rvGetSlice4Array(rv, &v)
+ fastpathTV.DecSliceStringN(v, d)
+ default:
fastpathTV.DecSliceStringN(rv2i(rv).([]string), d)
}
}
@@ -4288,7 +3084,7 @@ func (f fastpathT) DecSliceStringX(vp *[]string, d *Decoder) {
*vp = v
}
}
-func (fastpathT) DecSliceStringY(v []string, d *Decoder) (_ []string, changed bool) {
+func (fastpathT) DecSliceStringY(v []string, d *Decoder) (v2 []string, changed bool) {
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
if v == nil {
@@ -4323,12 +3119,8 @@ func (fastpathT) DecSliceStringY(v []string, d *Decoder) (_ []string, changed bo
}
var j int
for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
- } else {
- xlen = 8
- }
+ if j == 0 && len(v) == 0 { // means hasLen == false
+ xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
v = make([]string, uint(xlen))
changed = true
}
@@ -4337,7 +3129,7 @@ func (fastpathT) DecSliceStringY(v []string, d *Decoder) (_ []string, changed bo
changed = true
}
slh.ElemContainerState(j)
- v[uint(j)] = string(d.d.DecodeStringAsBytes())
+ v[uint(j)] = d.stringZC(d.d.DecodeStringAsBytes())
}
if j < len(v) {
v = v[:uint(j)]
@@ -4361,22 +3153,28 @@ func (fastpathT) DecSliceStringN(v []string, d *Decoder) {
hasLen := containerLenS > 0
for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
+ slh.arrayCannotExpand(hasLen, len(v), j, containerLenS)
return
}
slh.ElemContainerState(j)
- v[uint(j)] = string(d.d.DecodeStringAsBytes())
+ v[uint(j)] = d.stringZC(d.d.DecodeStringAsBytes())
}
slh.End()
}
func (d *Decoder) fastpathDecSliceBytesR(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
+ var v [][]byte
+ switch rv.Kind() {
+ case reflect.Ptr:
vp := rv2i(rv).(*[][]byte)
- if v, changed := fastpathTV.DecSliceBytesY(*vp, d); changed {
+ var changed bool
+ if v, changed = fastpathTV.DecSliceBytesY(*vp, d); changed {
*vp = v
}
- } else {
+ case reflect.Array:
+ rvGetSlice4Array(rv, &v)
+ fastpathTV.DecSliceBytesN(v, d)
+ default:
fastpathTV.DecSliceBytesN(rv2i(rv).([][]byte), d)
}
}
@@ -4385,7 +3183,7 @@ func (f fastpathT) DecSliceBytesX(vp *[][]byte, d *Decoder) {
*vp = v
}
}
-func (fastpathT) DecSliceBytesY(v [][]byte, d *Decoder) (_ [][]byte, changed bool) {
+func (fastpathT) DecSliceBytesY(v [][]byte, d *Decoder) (v2 [][]byte, changed bool) {
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
if v == nil {
@@ -4420,12 +3218,8 @@ func (fastpathT) DecSliceBytesY(v [][]byte, d *Decoder) (_ [][]byte, changed boo
}
var j int
for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 24)
- } else {
- xlen = 8
- }
+ if j == 0 && len(v) == 0 { // means hasLen == false
+ xlen = decInferLen(containerLenS, d.h.MaxInitLen, 24)
v = make([][]byte, uint(xlen))
changed = true
}
@@ -4434,7 +3228,7 @@ func (fastpathT) DecSliceBytesY(v [][]byte, d *Decoder) (_ [][]byte, changed boo
changed = true
}
slh.ElemContainerState(j)
- v[uint(j)] = d.d.DecodeBytes(nil, false)
+ v[uint(j)] = d.d.DecodeBytes([]byte{})
}
if j < len(v) {
v = v[:uint(j)]
@@ -4458,22 +3252,28 @@ func (fastpathT) DecSliceBytesN(v [][]byte, d *Decoder) {
hasLen := containerLenS > 0
for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
+ slh.arrayCannotExpand(hasLen, len(v), j, containerLenS)
return
}
slh.ElemContainerState(j)
- v[uint(j)] = d.d.DecodeBytes(nil, false)
+ v[uint(j)] = d.d.DecodeBytes([]byte{})
}
slh.End()
}
func (d *Decoder) fastpathDecSliceFloat32R(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
+ var v []float32
+ switch rv.Kind() {
+ case reflect.Ptr:
vp := rv2i(rv).(*[]float32)
- if v, changed := fastpathTV.DecSliceFloat32Y(*vp, d); changed {
+ var changed bool
+ if v, changed = fastpathTV.DecSliceFloat32Y(*vp, d); changed {
*vp = v
}
- } else {
+ case reflect.Array:
+ rvGetSlice4Array(rv, &v)
+ fastpathTV.DecSliceFloat32N(v, d)
+ default:
fastpathTV.DecSliceFloat32N(rv2i(rv).([]float32), d)
}
}
@@ -4482,7 +3282,7 @@ func (f fastpathT) DecSliceFloat32X(vp *[]float32, d *Decoder) {
*vp = v
}
}
-func (fastpathT) DecSliceFloat32Y(v []float32, d *Decoder) (_ []float32, changed bool) {
+func (fastpathT) DecSliceFloat32Y(v []float32, d *Decoder) (v2 []float32, changed bool) {
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
if v == nil {
@@ -4517,12 +3317,8 @@ func (fastpathT) DecSliceFloat32Y(v []float32, d *Decoder) (_ []float32, changed
}
var j int
for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
- } else {
- xlen = 8
- }
+ if j == 0 && len(v) == 0 { // means hasLen == false
+ xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
v = make([]float32, uint(xlen))
changed = true
}
@@ -4555,7 +3351,7 @@ func (fastpathT) DecSliceFloat32N(v []float32, d *Decoder) {
hasLen := containerLenS > 0
for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
+ slh.arrayCannotExpand(hasLen, len(v), j, containerLenS)
return
}
slh.ElemContainerState(j)
@@ -4565,12 +3361,18 @@ func (fastpathT) DecSliceFloat32N(v []float32, d *Decoder) {
}
func (d *Decoder) fastpathDecSliceFloat64R(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
+ var v []float64
+ switch rv.Kind() {
+ case reflect.Ptr:
vp := rv2i(rv).(*[]float64)
- if v, changed := fastpathTV.DecSliceFloat64Y(*vp, d); changed {
+ var changed bool
+ if v, changed = fastpathTV.DecSliceFloat64Y(*vp, d); changed {
*vp = v
}
- } else {
+ case reflect.Array:
+ rvGetSlice4Array(rv, &v)
+ fastpathTV.DecSliceFloat64N(v, d)
+ default:
fastpathTV.DecSliceFloat64N(rv2i(rv).([]float64), d)
}
}
@@ -4579,7 +3381,7 @@ func (f fastpathT) DecSliceFloat64X(vp *[]float64, d *Decoder) {
*vp = v
}
}
-func (fastpathT) DecSliceFloat64Y(v []float64, d *Decoder) (_ []float64, changed bool) {
+func (fastpathT) DecSliceFloat64Y(v []float64, d *Decoder) (v2 []float64, changed bool) {
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
if v == nil {
@@ -4614,12 +3416,8 @@ func (fastpathT) DecSliceFloat64Y(v []float64, d *Decoder) (_ []float64, changed
}
var j int
for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
- } else {
- xlen = 8
- }
+ if j == 0 && len(v) == 0 { // means hasLen == false
+ xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
v = make([]float64, uint(xlen))
changed = true
}
@@ -4652,7 +3450,7 @@ func (fastpathT) DecSliceFloat64N(v []float64, d *Decoder) {
hasLen := containerLenS > 0
for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
+ slh.arrayCannotExpand(hasLen, len(v), j, containerLenS)
return
}
slh.ElemContainerState(j)
@@ -4661,22 +3459,36 @@ func (fastpathT) DecSliceFloat64N(v []float64, d *Decoder) {
slh.End()
}
-func (d *Decoder) fastpathDecSliceUintR(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
- vp := rv2i(rv).(*[]uint)
- if v, changed := fastpathTV.DecSliceUintY(*vp, d); changed {
+func (d *Decoder) fastpathDecSliceUint8R(f *codecFnInfo, rv reflect.Value) {
+ var v []uint8
+ switch rv.Kind() {
+ case reflect.Ptr:
+ vp := rv2i(rv).(*[]uint8)
+ var changed bool
+ if v, changed = fastpathTV.DecSliceUint8Y(*vp, d); changed {
*vp = v
}
- } else {
- fastpathTV.DecSliceUintN(rv2i(rv).([]uint), d)
+ case reflect.Array:
+ rvGetSlice4Array(rv, &v)
+ fastpathTV.DecSliceUint8N(v, d)
+ default:
+ fastpathTV.DecSliceUint8N(rv2i(rv).([]uint8), d)
}
}
-func (f fastpathT) DecSliceUintX(vp *[]uint, d *Decoder) {
- if v, changed := f.DecSliceUintY(*vp, d); changed {
+func (f fastpathT) DecSliceUint8X(vp *[]uint8, d *Decoder) {
+ if v, changed := f.DecSliceUint8Y(*vp, d); changed {
*vp = v
}
}
-func (fastpathT) DecSliceUintY(v []uint, d *Decoder) (_ []uint, changed bool) {
+func (fastpathT) DecSliceUint8Y(v []uint8, d *Decoder) (v2 []uint8, changed bool) {
+ switch d.d.ContainerType() {
+ case valueTypeNil, valueTypeMap:
+ break
+ default:
+ v2 = d.decodeBytesInto(v[:len(v):len(v)])
+ changed = !(len(v2) > 0 && len(v2) == len(v) && &v2[0] == &v[0]) // not same slice
+ return
+ }
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
if v == nil {
@@ -4686,7 +3498,7 @@ func (fastpathT) DecSliceUintY(v []uint, d *Decoder) (_ []uint, changed bool) {
}
if containerLenS == 0 {
if v == nil {
- v = []uint{}
+ v = []uint8{}
} else if len(v) != 0 {
v = v[:0]
}
@@ -4697,11 +3509,11 @@ func (fastpathT) DecSliceUintY(v []uint, d *Decoder) (_ []uint, changed bool) {
var xlen int
if hasLen {
if containerLenS > cap(v) {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
+ xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
if xlen <= cap(v) {
v = v[:uint(xlen)]
} else {
- v = make([]uint, uint(xlen))
+ v = make([]uint8, uint(xlen))
}
changed = true
} else if containerLenS != len(v) {
@@ -4711,13 +3523,9 @@ func (fastpathT) DecSliceUintY(v []uint, d *Decoder) (_ []uint, changed bool) {
}
var j int
for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
- } else {
- xlen = 8
- }
- v = make([]uint, uint(xlen))
+ if j == 0 && len(v) == 0 { // means hasLen == false
+ xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
+ v = make([]uint8, uint(xlen))
changed = true
}
if j >= len(v) {
@@ -4725,19 +3533,29 @@ func (fastpathT) DecSliceUintY(v []uint, d *Decoder) (_ []uint, changed bool) {
changed = true
}
slh.ElemContainerState(j)
- v[uint(j)] = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
+ v[uint(j)] = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
}
if j < len(v) {
v = v[:uint(j)]
changed = true
} else if j == 0 && v == nil {
- v = []uint{}
+ v = []uint8{}
changed = true
}
slh.End()
return v, changed
}
-func (fastpathT) DecSliceUintN(v []uint, d *Decoder) {
+func (fastpathT) DecSliceUint8N(v []uint8, d *Decoder) {
+ switch d.d.ContainerType() {
+ case valueTypeNil, valueTypeMap:
+ break
+ default:
+ v2 := d.decodeBytesInto(v[:len(v):len(v)])
+ if !(len(v2) > 0 && len(v2) == len(v) && &v2[0] == &v[0]) { // not same slice
+ copy(v, v2)
+ }
+ return
+ }
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
return
@@ -4749,216 +3567,28 @@ func (fastpathT) DecSliceUintN(v []uint, d *Decoder) {
hasLen := containerLenS > 0
for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
+ slh.arrayCannotExpand(hasLen, len(v), j, containerLenS)
return
}
slh.ElemContainerState(j)
- v[uint(j)] = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- }
- slh.End()
-}
-
-func (d *Decoder) fastpathDecSliceUint16R(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
- vp := rv2i(rv).(*[]uint16)
- if v, changed := fastpathTV.DecSliceUint16Y(*vp, d); changed {
- *vp = v
- }
- } else {
- fastpathTV.DecSliceUint16N(rv2i(rv).([]uint16), d)
- }
-}
-func (f fastpathT) DecSliceUint16X(vp *[]uint16, d *Decoder) {
- if v, changed := f.DecSliceUint16Y(*vp, d); changed {
- *vp = v
- }
-}
-func (fastpathT) DecSliceUint16Y(v []uint16, d *Decoder) (_ []uint16, changed bool) {
- slh, containerLenS := d.decSliceHelperStart()
- if slh.IsNil {
- if v == nil {
- return
- }
- return nil, true
- }
- if containerLenS == 0 {
- if v == nil {
- v = []uint16{}
- } else if len(v) != 0 {
- v = v[:0]
- }
- slh.End()
- return v, true
- }
- hasLen := containerLenS > 0
- var xlen int
- if hasLen {
- if containerLenS > cap(v) {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
- if xlen <= cap(v) {
- v = v[:uint(xlen)]
- } else {
- v = make([]uint16, uint(xlen))
- }
- changed = true
- } else if containerLenS != len(v) {
- v = v[:containerLenS]
- changed = true
- }
- }
- var j int
- for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
- } else {
- xlen = 8
- }
- v = make([]uint16, uint(xlen))
- changed = true
- }
- if j >= len(v) {
- v = append(v, 0)
- changed = true
- }
- slh.ElemContainerState(j)
- v[uint(j)] = uint16(chkOvf.UintV(d.d.DecodeUint64(), 16))
- }
- if j < len(v) {
- v = v[:uint(j)]
- changed = true
- } else if j == 0 && v == nil {
- v = []uint16{}
- changed = true
- }
- slh.End()
- return v, changed
-}
-func (fastpathT) DecSliceUint16N(v []uint16, d *Decoder) {
- slh, containerLenS := d.decSliceHelperStart()
- if slh.IsNil {
- return
- }
- if containerLenS == 0 {
- slh.End()
- return
- }
- hasLen := containerLenS > 0
- for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
- return
- }
- slh.ElemContainerState(j)
- v[uint(j)] = uint16(chkOvf.UintV(d.d.DecodeUint64(), 16))
- }
- slh.End()
-}
-
-func (d *Decoder) fastpathDecSliceUint32R(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
- vp := rv2i(rv).(*[]uint32)
- if v, changed := fastpathTV.DecSliceUint32Y(*vp, d); changed {
- *vp = v
- }
- } else {
- fastpathTV.DecSliceUint32N(rv2i(rv).([]uint32), d)
- }
-}
-func (f fastpathT) DecSliceUint32X(vp *[]uint32, d *Decoder) {
- if v, changed := f.DecSliceUint32Y(*vp, d); changed {
- *vp = v
- }
-}
-func (fastpathT) DecSliceUint32Y(v []uint32, d *Decoder) (_ []uint32, changed bool) {
- slh, containerLenS := d.decSliceHelperStart()
- if slh.IsNil {
- if v == nil {
- return
- }
- return nil, true
- }
- if containerLenS == 0 {
- if v == nil {
- v = []uint32{}
- } else if len(v) != 0 {
- v = v[:0]
- }
- slh.End()
- return v, true
- }
- hasLen := containerLenS > 0
- var xlen int
- if hasLen {
- if containerLenS > cap(v) {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
- if xlen <= cap(v) {
- v = v[:uint(xlen)]
- } else {
- v = make([]uint32, uint(xlen))
- }
- changed = true
- } else if containerLenS != len(v) {
- v = v[:containerLenS]
- changed = true
- }
- }
- var j int
- for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
- } else {
- xlen = 8
- }
- v = make([]uint32, uint(xlen))
- changed = true
- }
- if j >= len(v) {
- v = append(v, 0)
- changed = true
- }
- slh.ElemContainerState(j)
- v[uint(j)] = uint32(chkOvf.UintV(d.d.DecodeUint64(), 32))
- }
- if j < len(v) {
- v = v[:uint(j)]
- changed = true
- } else if j == 0 && v == nil {
- v = []uint32{}
- changed = true
- }
- slh.End()
- return v, changed
-}
-func (fastpathT) DecSliceUint32N(v []uint32, d *Decoder) {
- slh, containerLenS := d.decSliceHelperStart()
- if slh.IsNil {
- return
- }
- if containerLenS == 0 {
- slh.End()
- return
- }
- hasLen := containerLenS > 0
- for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
- return
- }
- slh.ElemContainerState(j)
- v[uint(j)] = uint32(chkOvf.UintV(d.d.DecodeUint64(), 32))
+ v[uint(j)] = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
}
slh.End()
}
func (d *Decoder) fastpathDecSliceUint64R(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
+ var v []uint64
+ switch rv.Kind() {
+ case reflect.Ptr:
vp := rv2i(rv).(*[]uint64)
- if v, changed := fastpathTV.DecSliceUint64Y(*vp, d); changed {
+ var changed bool
+ if v, changed = fastpathTV.DecSliceUint64Y(*vp, d); changed {
*vp = v
}
- } else {
+ case reflect.Array:
+ rvGetSlice4Array(rv, &v)
+ fastpathTV.DecSliceUint64N(v, d)
+ default:
fastpathTV.DecSliceUint64N(rv2i(rv).([]uint64), d)
}
}
@@ -4967,7 +3597,7 @@ func (f fastpathT) DecSliceUint64X(vp *[]uint64, d *Decoder) {
*vp = v
}
}
-func (fastpathT) DecSliceUint64Y(v []uint64, d *Decoder) (_ []uint64, changed bool) {
+func (fastpathT) DecSliceUint64Y(v []uint64, d *Decoder) (v2 []uint64, changed bool) {
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
if v == nil {
@@ -5002,12 +3632,8 @@ func (fastpathT) DecSliceUint64Y(v []uint64, d *Decoder) (_ []uint64, changed bo
}
var j int
for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
- } else {
- xlen = 8
- }
+ if j == 0 && len(v) == 0 { // means hasLen == false
+ xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
v = make([]uint64, uint(xlen))
changed = true
}
@@ -5040,7 +3666,7 @@ func (fastpathT) DecSliceUint64N(v []uint64, d *Decoder) {
hasLen := containerLenS > 0
for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
+ slh.arrayCannotExpand(hasLen, len(v), j, containerLenS)
return
}
slh.ElemContainerState(j)
@@ -5050,12 +3676,18 @@ func (fastpathT) DecSliceUint64N(v []uint64, d *Decoder) {
}
func (d *Decoder) fastpathDecSliceIntR(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
+ var v []int
+ switch rv.Kind() {
+ case reflect.Ptr:
vp := rv2i(rv).(*[]int)
- if v, changed := fastpathTV.DecSliceIntY(*vp, d); changed {
+ var changed bool
+ if v, changed = fastpathTV.DecSliceIntY(*vp, d); changed {
*vp = v
}
- } else {
+ case reflect.Array:
+ rvGetSlice4Array(rv, &v)
+ fastpathTV.DecSliceIntN(v, d)
+ default:
fastpathTV.DecSliceIntN(rv2i(rv).([]int), d)
}
}
@@ -5064,7 +3696,7 @@ func (f fastpathT) DecSliceIntX(vp *[]int, d *Decoder) {
*vp = v
}
}
-func (fastpathT) DecSliceIntY(v []int, d *Decoder) (_ []int, changed bool) {
+func (fastpathT) DecSliceIntY(v []int, d *Decoder) (v2 []int, changed bool) {
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
if v == nil {
@@ -5099,12 +3731,8 @@ func (fastpathT) DecSliceIntY(v []int, d *Decoder) (_ []int, changed bool) {
}
var j int
for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
- } else {
- xlen = 8
- }
+ if j == 0 && len(v) == 0 { // means hasLen == false
+ xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
v = make([]int, uint(xlen))
changed = true
}
@@ -5137,7 +3765,7 @@ func (fastpathT) DecSliceIntN(v []int, d *Decoder) {
hasLen := containerLenS > 0
for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
+ slh.arrayCannotExpand(hasLen, len(v), j, containerLenS)
return
}
slh.ElemContainerState(j)
@@ -5146,207 +3774,19 @@ func (fastpathT) DecSliceIntN(v []int, d *Decoder) {
slh.End()
}
-func (d *Decoder) fastpathDecSliceInt8R(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
- vp := rv2i(rv).(*[]int8)
- if v, changed := fastpathTV.DecSliceInt8Y(*vp, d); changed {
- *vp = v
- }
- } else {
- fastpathTV.DecSliceInt8N(rv2i(rv).([]int8), d)
- }
-}
-func (f fastpathT) DecSliceInt8X(vp *[]int8, d *Decoder) {
- if v, changed := f.DecSliceInt8Y(*vp, d); changed {
- *vp = v
- }
-}
-func (fastpathT) DecSliceInt8Y(v []int8, d *Decoder) (_ []int8, changed bool) {
- slh, containerLenS := d.decSliceHelperStart()
- if slh.IsNil {
- if v == nil {
- return
- }
- return nil, true
- }
- if containerLenS == 0 {
- if v == nil {
- v = []int8{}
- } else if len(v) != 0 {
- v = v[:0]
- }
- slh.End()
- return v, true
- }
- hasLen := containerLenS > 0
- var xlen int
- if hasLen {
- if containerLenS > cap(v) {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
- if xlen <= cap(v) {
- v = v[:uint(xlen)]
- } else {
- v = make([]int8, uint(xlen))
- }
- changed = true
- } else if containerLenS != len(v) {
- v = v[:containerLenS]
- changed = true
- }
- }
- var j int
- for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
- } else {
- xlen = 8
- }
- v = make([]int8, uint(xlen))
- changed = true
- }
- if j >= len(v) {
- v = append(v, 0)
- changed = true
- }
- slh.ElemContainerState(j)
- v[uint(j)] = int8(chkOvf.IntV(d.d.DecodeInt64(), 8))
- }
- if j < len(v) {
- v = v[:uint(j)]
- changed = true
- } else if j == 0 && v == nil {
- v = []int8{}
- changed = true
- }
- slh.End()
- return v, changed
-}
-func (fastpathT) DecSliceInt8N(v []int8, d *Decoder) {
- slh, containerLenS := d.decSliceHelperStart()
- if slh.IsNil {
- return
- }
- if containerLenS == 0 {
- slh.End()
- return
- }
- hasLen := containerLenS > 0
- for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
- return
- }
- slh.ElemContainerState(j)
- v[uint(j)] = int8(chkOvf.IntV(d.d.DecodeInt64(), 8))
- }
- slh.End()
-}
-
-func (d *Decoder) fastpathDecSliceInt16R(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
- vp := rv2i(rv).(*[]int16)
- if v, changed := fastpathTV.DecSliceInt16Y(*vp, d); changed {
- *vp = v
- }
- } else {
- fastpathTV.DecSliceInt16N(rv2i(rv).([]int16), d)
- }
-}
-func (f fastpathT) DecSliceInt16X(vp *[]int16, d *Decoder) {
- if v, changed := f.DecSliceInt16Y(*vp, d); changed {
- *vp = v
- }
-}
-func (fastpathT) DecSliceInt16Y(v []int16, d *Decoder) (_ []int16, changed bool) {
- slh, containerLenS := d.decSliceHelperStart()
- if slh.IsNil {
- if v == nil {
- return
- }
- return nil, true
- }
- if containerLenS == 0 {
- if v == nil {
- v = []int16{}
- } else if len(v) != 0 {
- v = v[:0]
- }
- slh.End()
- return v, true
- }
- hasLen := containerLenS > 0
- var xlen int
- if hasLen {
- if containerLenS > cap(v) {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
- if xlen <= cap(v) {
- v = v[:uint(xlen)]
- } else {
- v = make([]int16, uint(xlen))
- }
- changed = true
- } else if containerLenS != len(v) {
- v = v[:containerLenS]
- changed = true
- }
- }
- var j int
- for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
- } else {
- xlen = 8
- }
- v = make([]int16, uint(xlen))
- changed = true
- }
- if j >= len(v) {
- v = append(v, 0)
- changed = true
- }
- slh.ElemContainerState(j)
- v[uint(j)] = int16(chkOvf.IntV(d.d.DecodeInt64(), 16))
- }
- if j < len(v) {
- v = v[:uint(j)]
- changed = true
- } else if j == 0 && v == nil {
- v = []int16{}
- changed = true
- }
- slh.End()
- return v, changed
-}
-func (fastpathT) DecSliceInt16N(v []int16, d *Decoder) {
- slh, containerLenS := d.decSliceHelperStart()
- if slh.IsNil {
- return
- }
- if containerLenS == 0 {
- slh.End()
- return
- }
- hasLen := containerLenS > 0
- for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
- return
- }
- slh.ElemContainerState(j)
- v[uint(j)] = int16(chkOvf.IntV(d.d.DecodeInt64(), 16))
- }
- slh.End()
-}
-
func (d *Decoder) fastpathDecSliceInt32R(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
+ var v []int32
+ switch rv.Kind() {
+ case reflect.Ptr:
vp := rv2i(rv).(*[]int32)
- if v, changed := fastpathTV.DecSliceInt32Y(*vp, d); changed {
+ var changed bool
+ if v, changed = fastpathTV.DecSliceInt32Y(*vp, d); changed {
*vp = v
}
- } else {
+ case reflect.Array:
+ rvGetSlice4Array(rv, &v)
+ fastpathTV.DecSliceInt32N(v, d)
+ default:
fastpathTV.DecSliceInt32N(rv2i(rv).([]int32), d)
}
}
@@ -5355,7 +3795,7 @@ func (f fastpathT) DecSliceInt32X(vp *[]int32, d *Decoder) {
*vp = v
}
}
-func (fastpathT) DecSliceInt32Y(v []int32, d *Decoder) (_ []int32, changed bool) {
+func (fastpathT) DecSliceInt32Y(v []int32, d *Decoder) (v2 []int32, changed bool) {
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
if v == nil {
@@ -5390,12 +3830,8 @@ func (fastpathT) DecSliceInt32Y(v []int32, d *Decoder) (_ []int32, changed bool)
}
var j int
for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
- } else {
- xlen = 8
- }
+ if j == 0 && len(v) == 0 { // means hasLen == false
+ xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
v = make([]int32, uint(xlen))
changed = true
}
@@ -5428,7 +3864,7 @@ func (fastpathT) DecSliceInt32N(v []int32, d *Decoder) {
hasLen := containerLenS > 0
for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
+ slh.arrayCannotExpand(hasLen, len(v), j, containerLenS)
return
}
slh.ElemContainerState(j)
@@ -5438,12 +3874,18 @@ func (fastpathT) DecSliceInt32N(v []int32, d *Decoder) {
}
func (d *Decoder) fastpathDecSliceInt64R(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
+ var v []int64
+ switch rv.Kind() {
+ case reflect.Ptr:
vp := rv2i(rv).(*[]int64)
- if v, changed := fastpathTV.DecSliceInt64Y(*vp, d); changed {
+ var changed bool
+ if v, changed = fastpathTV.DecSliceInt64Y(*vp, d); changed {
*vp = v
}
- } else {
+ case reflect.Array:
+ rvGetSlice4Array(rv, &v)
+ fastpathTV.DecSliceInt64N(v, d)
+ default:
fastpathTV.DecSliceInt64N(rv2i(rv).([]int64), d)
}
}
@@ -5452,7 +3894,7 @@ func (f fastpathT) DecSliceInt64X(vp *[]int64, d *Decoder) {
*vp = v
}
}
-func (fastpathT) DecSliceInt64Y(v []int64, d *Decoder) (_ []int64, changed bool) {
+func (fastpathT) DecSliceInt64Y(v []int64, d *Decoder) (v2 []int64, changed bool) {
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
if v == nil {
@@ -5487,12 +3929,8 @@ func (fastpathT) DecSliceInt64Y(v []int64, d *Decoder) (_ []int64, changed bool)
}
var j int
for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
- } else {
- xlen = 8
- }
+ if j == 0 && len(v) == 0 { // means hasLen == false
+ xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
v = make([]int64, uint(xlen))
changed = true
}
@@ -5525,7 +3963,7 @@ func (fastpathT) DecSliceInt64N(v []int64, d *Decoder) {
hasLen := containerLenS > 0
for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
+ slh.arrayCannotExpand(hasLen, len(v), j, containerLenS)
return
}
slh.ElemContainerState(j)
@@ -5535,12 +3973,18 @@ func (fastpathT) DecSliceInt64N(v []int64, d *Decoder) {
}
func (d *Decoder) fastpathDecSliceBoolR(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
+ var v []bool
+ switch rv.Kind() {
+ case reflect.Ptr:
vp := rv2i(rv).(*[]bool)
- if v, changed := fastpathTV.DecSliceBoolY(*vp, d); changed {
+ var changed bool
+ if v, changed = fastpathTV.DecSliceBoolY(*vp, d); changed {
*vp = v
}
- } else {
+ case reflect.Array:
+ rvGetSlice4Array(rv, &v)
+ fastpathTV.DecSliceBoolN(v, d)
+ default:
fastpathTV.DecSliceBoolN(rv2i(rv).([]bool), d)
}
}
@@ -5549,7 +3993,7 @@ func (f fastpathT) DecSliceBoolX(vp *[]bool, d *Decoder) {
*vp = v
}
}
-func (fastpathT) DecSliceBoolY(v []bool, d *Decoder) (_ []bool, changed bool) {
+func (fastpathT) DecSliceBoolY(v []bool, d *Decoder) (v2 []bool, changed bool) {
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
if v == nil {
@@ -5584,12 +4028,8 @@ func (fastpathT) DecSliceBoolY(v []bool, d *Decoder) (_ []bool, changed bool) {
}
var j int
for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
- } else {
- xlen = 8
- }
+ if j == 0 && len(v) == 0 { // means hasLen == false
+ xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
v = make([]bool, uint(xlen))
changed = true
}
@@ -5622,7 +4062,7 @@ func (fastpathT) DecSliceBoolN(v []bool, d *Decoder) {
hasLen := containerLenS > 0
for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
+ slh.arrayCannotExpand(hasLen, len(v), j, containerLenS)
return
}
slh.ElemContainerState(j)
@@ -5630,42 +4070,24 @@ func (fastpathT) DecSliceBoolN(v []bool, d *Decoder) {
}
slh.End()
}
-func fastpathDecArrayCannotExpand(slh decSliceHelper, hasLen bool, lenv, j, containerLenS int) {
- slh.d.arrayCannotExpand(lenv, j+1)
- slh.ElemContainerState(j)
- slh.d.swallow()
- j++
- for ; (hasLen && j < containerLenS) || !(hasLen || slh.d.checkBreak()); j++ {
- slh.ElemContainerState(j)
- slh.d.swallow()
- }
- slh.End()
-}
-
func (d *Decoder) fastpathDecMapStringIntfR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[string]interface{})) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[string]interface{})
+ if *vp == nil {
+ *vp = make(map[string]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 32))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[string]interface{})
- if *vp == nil {
- *vp = make(map[string]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 32))
- }
- if containerLen != 0 {
- fastpathTV.DecMapStringIntfL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapStringIntfL(rv2i(rv).(map[string]interface{}), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapStringIntfL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapStringIntfL(rv2i(rv).(map[string]interface{}), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapStringIntfX(vp *map[string]interface{}, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -5678,13 +4100,17 @@ func (f fastpathT) DecMapStringIntfX(vp *map[string]interface{}, d *Decoder) {
}
}
func (fastpathT) DecMapStringIntfL(v map[string]interface{}, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[string]interface{} given stream length: %v", containerLen)
+ return
+ }
mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
var mk string
var mv interface{}
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = string(d.d.DecodeStringAsBytes())
+ mk = d.stringZC(d.d.DecodeStringAsBytes())
d.mapElemValue()
if mapGet {
mv = v[mk]
@@ -5692,35 +4118,27 @@ func (fastpathT) DecMapStringIntfL(v map[string]interface{}, containerLen int, d
mv = nil
}
d.decode(&mv)
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapStringStringR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[string]string)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[string]string)
+ if *vp == nil {
+ *vp = make(map[string]string, decInferLen(containerLen, d.h.MaxInitLen, 32))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[string]string)
- if *vp == nil {
- *vp = make(map[string]string, decInferLen(containerLen, d.h.MaxInitLen, 32))
- }
- if containerLen != 0 {
- fastpathTV.DecMapStringStringL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapStringStringL(rv2i(rv).(map[string]string), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapStringStringL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapStringStringL(rv2i(rv).(map[string]string), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapStringStringX(vp *map[string]string, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -5733,43 +4151,39 @@ func (f fastpathT) DecMapStringStringX(vp *map[string]string, d *Decoder) {
}
}
func (fastpathT) DecMapStringStringL(v map[string]string, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[string]string given stream length: %v", containerLen)
+ return
+ }
var mk string
var mv string
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = string(d.d.DecodeStringAsBytes())
+ mk = d.stringZC(d.d.DecodeStringAsBytes())
d.mapElemValue()
- mv = string(d.d.DecodeStringAsBytes())
- if v != nil {
- v[mk] = mv
- }
+ mv = d.stringZC(d.d.DecodeStringAsBytes())
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapStringBytesR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[string][]byte)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[string][]byte)
+ if *vp == nil {
+ *vp = make(map[string][]byte, decInferLen(containerLen, d.h.MaxInitLen, 40))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[string][]byte)
- if *vp == nil {
- *vp = make(map[string][]byte, decInferLen(containerLen, d.h.MaxInitLen, 40))
- }
- if containerLen != 0 {
- fastpathTV.DecMapStringBytesL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapStringBytesL(rv2i(rv).(map[string][]byte), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapStringBytesL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapStringBytesL(rv2i(rv).(map[string][]byte), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapStringBytesX(vp *map[string][]byte, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -5782,98 +4196,45 @@ func (f fastpathT) DecMapStringBytesX(vp *map[string][]byte, d *Decoder) {
}
}
func (fastpathT) DecMapStringBytesL(v map[string][]byte, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[string][]byte given stream length: %v", containerLen)
+ return
+ }
mapGet := v != nil && !d.h.MapValueReset
var mk string
var mv []byte
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = string(d.d.DecodeStringAsBytes())
+ mk = d.stringZC(d.d.DecodeStringAsBytes())
d.mapElemValue()
if mapGet {
mv = v[mk]
} else {
mv = nil
}
- mv = d.d.DecodeBytes(mv, false)
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapStringUintR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[string]uint)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[string]uint)
- if *vp == nil {
- *vp = make(map[string]uint, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- fastpathTV.DecMapStringUintL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapStringUintL(rv2i(rv).(map[string]uint), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapStringUintX(vp *map[string]uint, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[string]uint, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- f.DecMapStringUintL(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapStringUintL(v map[string]uint, containerLen int, d *Decoder) {
- var mk string
- var mv uint
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = string(d.d.DecodeStringAsBytes())
- d.mapElemValue()
- mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- if v != nil {
- v[mk] = mv
- }
+ mv = d.decodeBytesInto(mv)
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapStringUint8R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[string]uint8)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[string]uint8)
+ if *vp == nil {
+ *vp = make(map[string]uint8, decInferLen(containerLen, d.h.MaxInitLen, 17))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[string]uint8)
- if *vp == nil {
- *vp = make(map[string]uint8, decInferLen(containerLen, d.h.MaxInitLen, 17))
- }
- if containerLen != 0 {
- fastpathTV.DecMapStringUint8L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapStringUint8L(rv2i(rv).(map[string]uint8), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapStringUint8L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapStringUint8L(rv2i(rv).(map[string]uint8), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapStringUint8X(vp *map[string]uint8, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -5886,43 +4247,39 @@ func (f fastpathT) DecMapStringUint8X(vp *map[string]uint8, d *Decoder) {
}
}
func (fastpathT) DecMapStringUint8L(v map[string]uint8, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[string]uint8 given stream length: %v", containerLen)
+ return
+ }
var mk string
var mv uint8
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = string(d.d.DecodeStringAsBytes())
+ mk = d.stringZC(d.d.DecodeStringAsBytes())
d.mapElemValue()
mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapStringUint64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[string]uint64)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[string]uint64)
+ if *vp == nil {
+ *vp = make(map[string]uint64, decInferLen(containerLen, d.h.MaxInitLen, 24))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[string]uint64)
- if *vp == nil {
- *vp = make(map[string]uint64, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- fastpathTV.DecMapStringUint64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapStringUint64L(rv2i(rv).(map[string]uint64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapStringUint64L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapStringUint64L(rv2i(rv).(map[string]uint64), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapStringUint64X(vp *map[string]uint64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -5935,43 +4292,39 @@ func (f fastpathT) DecMapStringUint64X(vp *map[string]uint64, d *Decoder) {
}
}
func (fastpathT) DecMapStringUint64L(v map[string]uint64, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[string]uint64 given stream length: %v", containerLen)
+ return
+ }
var mk string
var mv uint64
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = string(d.d.DecodeStringAsBytes())
+ mk = d.stringZC(d.d.DecodeStringAsBytes())
d.mapElemValue()
mv = d.d.DecodeUint64()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapStringIntR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[string]int)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[string]int)
+ if *vp == nil {
+ *vp = make(map[string]int, decInferLen(containerLen, d.h.MaxInitLen, 24))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[string]int)
- if *vp == nil {
- *vp = make(map[string]int, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- fastpathTV.DecMapStringIntL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapStringIntL(rv2i(rv).(map[string]int), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapStringIntL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapStringIntL(rv2i(rv).(map[string]int), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapStringIntX(vp *map[string]int, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -5984,141 +4337,84 @@ func (f fastpathT) DecMapStringIntX(vp *map[string]int, d *Decoder) {
}
}
func (fastpathT) DecMapStringIntL(v map[string]int, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[string]int given stream length: %v", containerLen)
+ return
+ }
var mk string
var mv int
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = string(d.d.DecodeStringAsBytes())
+ mk = d.stringZC(d.d.DecodeStringAsBytes())
d.mapElemValue()
mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
-func (d *Decoder) fastpathDecMapStringInt64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[string]int64)) = nil
+func (d *Decoder) fastpathDecMapStringInt32R(f *codecFnInfo, rv reflect.Value) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[string]int32)
+ if *vp == nil {
+ *vp = make(map[string]int32, decInferLen(containerLen, d.h.MaxInitLen, 20))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[string]int64)
- if *vp == nil {
- *vp = make(map[string]int64, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- fastpathTV.DecMapStringInt64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapStringInt64L(rv2i(rv).(map[string]int64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapStringInt32L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapStringInt32L(rv2i(rv).(map[string]int32), containerLen, d)
}
+ d.mapEnd()
}
-func (f fastpathT) DecMapStringInt64X(vp *map[string]int64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+func (f fastpathT) DecMapStringInt32X(vp *map[string]int32, d *Decoder) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
- *vp = make(map[string]int64, decInferLen(containerLen, d.h.MaxInitLen, 24))
+ *vp = make(map[string]int32, decInferLen(containerLen, d.h.MaxInitLen, 20))
}
if containerLen != 0 {
- f.DecMapStringInt64L(*vp, containerLen, d)
+ f.DecMapStringInt32L(*vp, containerLen, d)
}
d.mapEnd()
}
}
-func (fastpathT) DecMapStringInt64L(v map[string]int64, containerLen int, d *Decoder) {
+func (fastpathT) DecMapStringInt32L(v map[string]int32, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[string]int32 given stream length: %v", containerLen)
+ return
+ }
var mk string
- var mv int64
+ var mv int32
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = string(d.d.DecodeStringAsBytes())
+ mk = d.stringZC(d.d.DecodeStringAsBytes())
d.mapElemValue()
- mv = d.d.DecodeInt64()
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapStringFloat32R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[string]float32)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[string]float32)
- if *vp == nil {
- *vp = make(map[string]float32, decInferLen(containerLen, d.h.MaxInitLen, 20))
- }
- if containerLen != 0 {
- fastpathTV.DecMapStringFloat32L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapStringFloat32L(rv2i(rv).(map[string]float32), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapStringFloat32X(vp *map[string]float32, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[string]float32, decInferLen(containerLen, d.h.MaxInitLen, 20))
- }
- if containerLen != 0 {
- f.DecMapStringFloat32L(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapStringFloat32L(v map[string]float32, containerLen int, d *Decoder) {
- var mk string
- var mv float32
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = string(d.d.DecodeStringAsBytes())
- d.mapElemValue()
- mv = float32(d.decodeFloat32())
- if v != nil {
- v[mk] = mv
- }
+ mv = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapStringFloat64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[string]float64)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[string]float64)
+ if *vp == nil {
+ *vp = make(map[string]float64, decInferLen(containerLen, d.h.MaxInitLen, 24))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[string]float64)
- if *vp == nil {
- *vp = make(map[string]float64, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- fastpathTV.DecMapStringFloat64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapStringFloat64L(rv2i(rv).(map[string]float64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapStringFloat64L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapStringFloat64L(rv2i(rv).(map[string]float64), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapStringFloat64X(vp *map[string]float64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -6131,43 +4427,39 @@ func (f fastpathT) DecMapStringFloat64X(vp *map[string]float64, d *Decoder) {
}
}
func (fastpathT) DecMapStringFloat64L(v map[string]float64, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[string]float64 given stream length: %v", containerLen)
+ return
+ }
var mk string
var mv float64
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = string(d.d.DecodeStringAsBytes())
+ mk = d.stringZC(d.d.DecodeStringAsBytes())
d.mapElemValue()
mv = d.d.DecodeFloat64()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapStringBoolR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[string]bool)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[string]bool)
+ if *vp == nil {
+ *vp = make(map[string]bool, decInferLen(containerLen, d.h.MaxInitLen, 17))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[string]bool)
- if *vp == nil {
- *vp = make(map[string]bool, decInferLen(containerLen, d.h.MaxInitLen, 17))
- }
- if containerLen != 0 {
- fastpathTV.DecMapStringBoolL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapStringBoolL(rv2i(rv).(map[string]bool), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapStringBoolL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapStringBoolL(rv2i(rv).(map[string]bool), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapStringBoolX(vp *map[string]bool, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -6180,594 +4472,39 @@ func (f fastpathT) DecMapStringBoolX(vp *map[string]bool, d *Decoder) {
}
}
func (fastpathT) DecMapStringBoolL(v map[string]bool, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[string]bool given stream length: %v", containerLen)
+ return
+ }
var mk string
var mv bool
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = string(d.d.DecodeStringAsBytes())
+ mk = d.stringZC(d.d.DecodeStringAsBytes())
d.mapElemValue()
mv = d.d.DecodeBool()
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUintIntfR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint]interface{})) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint]interface{})
- if *vp == nil {
- *vp = make(map[uint]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUintIntfL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUintIntfL(rv2i(rv).(map[uint]interface{}), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUintIntfX(vp *map[uint]interface{}, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- f.DecMapUintIntfL(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUintIntfL(v map[uint]interface{}, containerLen int, d *Decoder) {
- mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
- var mk uint
- var mv interface{}
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- d.mapElemValue()
- if mapGet {
- mv = v[mk]
- } else {
- mv = nil
- }
- d.decode(&mv)
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUintStringR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint]string)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint]string)
- if *vp == nil {
- *vp = make(map[uint]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUintStringL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUintStringL(rv2i(rv).(map[uint]string), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUintStringX(vp *map[uint]string, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- f.DecMapUintStringL(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUintStringL(v map[uint]string, containerLen int, d *Decoder) {
- var mk uint
- var mv string
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- d.mapElemValue()
- mv = string(d.d.DecodeStringAsBytes())
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUintBytesR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint][]byte)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint][]byte)
- if *vp == nil {
- *vp = make(map[uint][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUintBytesL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUintBytesL(rv2i(rv).(map[uint][]byte), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUintBytesX(vp *map[uint][]byte, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
- }
- if containerLen != 0 {
- f.DecMapUintBytesL(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUintBytesL(v map[uint][]byte, containerLen int, d *Decoder) {
- mapGet := v != nil && !d.h.MapValueReset
- var mk uint
- var mv []byte
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- d.mapElemValue()
- if mapGet {
- mv = v[mk]
- } else {
- mv = nil
- }
- mv = d.d.DecodeBytes(mv, false)
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUintUintR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint]uint)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint]uint)
- if *vp == nil {
- *vp = make(map[uint]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUintUintL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUintUintL(rv2i(rv).(map[uint]uint), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUintUintX(vp *map[uint]uint, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- f.DecMapUintUintL(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUintUintL(v map[uint]uint, containerLen int, d *Decoder) {
- var mk uint
- var mv uint
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- d.mapElemValue()
- mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUintUint8R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint]uint8)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint]uint8)
- if *vp == nil {
- *vp = make(map[uint]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUintUint8L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUintUint8L(rv2i(rv).(map[uint]uint8), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUintUint8X(vp *map[uint]uint8, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- f.DecMapUintUint8L(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUintUint8L(v map[uint]uint8, containerLen int, d *Decoder) {
- var mk uint
- var mv uint8
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- d.mapElemValue()
- mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUintUint64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint]uint64)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint]uint64)
- if *vp == nil {
- *vp = make(map[uint]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUintUint64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUintUint64L(rv2i(rv).(map[uint]uint64), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUintUint64X(vp *map[uint]uint64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- f.DecMapUintUint64L(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUintUint64L(v map[uint]uint64, containerLen int, d *Decoder) {
- var mk uint
- var mv uint64
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- d.mapElemValue()
- mv = d.d.DecodeUint64()
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUintIntR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint]int)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint]int)
- if *vp == nil {
- *vp = make(map[uint]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUintIntL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUintIntL(rv2i(rv).(map[uint]int), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUintIntX(vp *map[uint]int, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- f.DecMapUintIntL(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUintIntL(v map[uint]int, containerLen int, d *Decoder) {
- var mk uint
- var mv int
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- d.mapElemValue()
- mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUintInt64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint]int64)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint]int64)
- if *vp == nil {
- *vp = make(map[uint]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUintInt64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUintInt64L(rv2i(rv).(map[uint]int64), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUintInt64X(vp *map[uint]int64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- f.DecMapUintInt64L(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUintInt64L(v map[uint]int64, containerLen int, d *Decoder) {
- var mk uint
- var mv int64
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- d.mapElemValue()
- mv = d.d.DecodeInt64()
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUintFloat32R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint]float32)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint]float32)
- if *vp == nil {
- *vp = make(map[uint]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUintFloat32L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUintFloat32L(rv2i(rv).(map[uint]float32), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUintFloat32X(vp *map[uint]float32, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
- }
- if containerLen != 0 {
- f.DecMapUintFloat32L(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUintFloat32L(v map[uint]float32, containerLen int, d *Decoder) {
- var mk uint
- var mv float32
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- d.mapElemValue()
- mv = float32(d.decodeFloat32())
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUintFloat64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint]float64)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint]float64)
- if *vp == nil {
- *vp = make(map[uint]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUintFloat64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUintFloat64L(rv2i(rv).(map[uint]float64), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUintFloat64X(vp *map[uint]float64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- f.DecMapUintFloat64L(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUintFloat64L(v map[uint]float64, containerLen int, d *Decoder) {
- var mk uint
- var mv float64
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- d.mapElemValue()
- mv = d.d.DecodeFloat64()
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUintBoolR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint]bool)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint]bool)
- if *vp == nil {
- *vp = make(map[uint]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUintBoolL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUintBoolL(rv2i(rv).(map[uint]bool), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUintBoolX(vp *map[uint]bool, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- f.DecMapUintBoolL(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUintBoolL(v map[uint]bool, containerLen int, d *Decoder) {
- var mk uint
- var mv bool
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- d.mapElemValue()
- mv = d.d.DecodeBool()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint8IntfR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint8]interface{})) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint8]interface{})
+ if *vp == nil {
+ *vp = make(map[uint8]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 17))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint8]interface{})
- if *vp == nil {
- *vp = make(map[uint8]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 17))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint8IntfL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint8IntfL(rv2i(rv).(map[uint8]interface{}), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint8IntfL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint8IntfL(rv2i(rv).(map[uint8]interface{}), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint8IntfX(vp *map[uint8]interface{}, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -6780,6 +4517,10 @@ func (f fastpathT) DecMapUint8IntfX(vp *map[uint8]interface{}, d *Decoder) {
}
}
func (fastpathT) DecMapUint8IntfL(v map[uint8]interface{}, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint8]interface{} given stream length: %v", containerLen)
+ return
+ }
mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
var mk uint8
var mv interface{}
@@ -6794,35 +4535,27 @@ func (fastpathT) DecMapUint8IntfL(v map[uint8]interface{}, containerLen int, d *
mv = nil
}
d.decode(&mv)
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint8StringR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint8]string)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint8]string)
+ if *vp == nil {
+ *vp = make(map[uint8]string, decInferLen(containerLen, d.h.MaxInitLen, 17))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint8]string)
- if *vp == nil {
- *vp = make(map[uint8]string, decInferLen(containerLen, d.h.MaxInitLen, 17))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint8StringL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint8StringL(rv2i(rv).(map[uint8]string), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint8StringL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint8StringL(rv2i(rv).(map[uint8]string), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint8StringX(vp *map[uint8]string, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -6835,6 +4568,10 @@ func (f fastpathT) DecMapUint8StringX(vp *map[uint8]string, d *Decoder) {
}
}
func (fastpathT) DecMapUint8StringL(v map[uint8]string, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint8]string given stream length: %v", containerLen)
+ return
+ }
var mk uint8
var mv string
hasLen := containerLen > 0
@@ -6842,36 +4579,28 @@ func (fastpathT) DecMapUint8StringL(v map[uint8]string, containerLen int, d *Dec
d.mapElemKey()
mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
d.mapElemValue()
- mv = string(d.d.DecodeStringAsBytes())
- if v != nil {
- v[mk] = mv
- }
+ mv = d.stringZC(d.d.DecodeStringAsBytes())
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint8BytesR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint8][]byte)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint8][]byte)
+ if *vp == nil {
+ *vp = make(map[uint8][]byte, decInferLen(containerLen, d.h.MaxInitLen, 25))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint8][]byte)
- if *vp == nil {
- *vp = make(map[uint8][]byte, decInferLen(containerLen, d.h.MaxInitLen, 25))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint8BytesL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint8BytesL(rv2i(rv).(map[uint8][]byte), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint8BytesL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint8BytesL(rv2i(rv).(map[uint8][]byte), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint8BytesX(vp *map[uint8][]byte, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -6884,6 +4613,10 @@ func (f fastpathT) DecMapUint8BytesX(vp *map[uint8][]byte, d *Decoder) {
}
}
func (fastpathT) DecMapUint8BytesL(v map[uint8][]byte, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint8][]byte given stream length: %v", containerLen)
+ return
+ }
mapGet := v != nil && !d.h.MapValueReset
var mk uint8
var mv []byte
@@ -6897,85 +4630,28 @@ func (fastpathT) DecMapUint8BytesL(v map[uint8][]byte, containerLen int, d *Deco
} else {
mv = nil
}
- mv = d.d.DecodeBytes(mv, false)
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUint8UintR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint8]uint)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint8]uint)
- if *vp == nil {
- *vp = make(map[uint8]uint, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint8UintL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint8UintL(rv2i(rv).(map[uint8]uint), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUint8UintX(vp *map[uint8]uint, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint8]uint, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- f.DecMapUint8UintL(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUint8UintL(v map[uint8]uint, containerLen int, d *Decoder) {
- var mk uint8
- var mv uint
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
- d.mapElemValue()
- mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- if v != nil {
- v[mk] = mv
- }
+ mv = d.decodeBytesInto(mv)
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint8]uint8)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint8]uint8)
+ if *vp == nil {
+ *vp = make(map[uint8]uint8, decInferLen(containerLen, d.h.MaxInitLen, 2))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint8]uint8)
- if *vp == nil {
- *vp = make(map[uint8]uint8, decInferLen(containerLen, d.h.MaxInitLen, 2))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint8Uint8L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint8Uint8L(rv2i(rv).(map[uint8]uint8), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint8Uint8L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint8Uint8L(rv2i(rv).(map[uint8]uint8), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint8Uint8X(vp *map[uint8]uint8, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -6988,6 +4664,10 @@ func (f fastpathT) DecMapUint8Uint8X(vp *map[uint8]uint8, d *Decoder) {
}
}
func (fastpathT) DecMapUint8Uint8L(v map[uint8]uint8, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint8]uint8 given stream length: %v", containerLen)
+ return
+ }
var mk uint8
var mv uint8
hasLen := containerLen > 0
@@ -6996,35 +4676,27 @@ func (fastpathT) DecMapUint8Uint8L(v map[uint8]uint8, containerLen int, d *Decod
mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
d.mapElemValue()
mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint8]uint64)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint8]uint64)
+ if *vp == nil {
+ *vp = make(map[uint8]uint64, decInferLen(containerLen, d.h.MaxInitLen, 9))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint8]uint64)
- if *vp == nil {
- *vp = make(map[uint8]uint64, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint8Uint64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint8Uint64L(rv2i(rv).(map[uint8]uint64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint8Uint64L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint8Uint64L(rv2i(rv).(map[uint8]uint64), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint8Uint64X(vp *map[uint8]uint64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7037,6 +4709,10 @@ func (f fastpathT) DecMapUint8Uint64X(vp *map[uint8]uint64, d *Decoder) {
}
}
func (fastpathT) DecMapUint8Uint64L(v map[uint8]uint64, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint8]uint64 given stream length: %v", containerLen)
+ return
+ }
var mk uint8
var mv uint64
hasLen := containerLen > 0
@@ -7045,35 +4721,27 @@ func (fastpathT) DecMapUint8Uint64L(v map[uint8]uint64, containerLen int, d *Dec
mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
d.mapElemValue()
mv = d.d.DecodeUint64()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint8IntR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint8]int)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint8]int)
+ if *vp == nil {
+ *vp = make(map[uint8]int, decInferLen(containerLen, d.h.MaxInitLen, 9))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint8]int)
- if *vp == nil {
- *vp = make(map[uint8]int, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint8IntL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint8IntL(rv2i(rv).(map[uint8]int), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint8IntL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint8IntL(rv2i(rv).(map[uint8]int), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint8IntX(vp *map[uint8]int, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7086,6 +4754,10 @@ func (f fastpathT) DecMapUint8IntX(vp *map[uint8]int, d *Decoder) {
}
}
func (fastpathT) DecMapUint8IntL(v map[uint8]int, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint8]int given stream length: %v", containerLen)
+ return
+ }
var mk uint8
var mv int
hasLen := containerLen > 0
@@ -7094,133 +4766,72 @@ func (fastpathT) DecMapUint8IntL(v map[uint8]int, containerLen int, d *Decoder)
mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
d.mapElemValue()
mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
-func (d *Decoder) fastpathDecMapUint8Int64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint8]int64)) = nil
+func (d *Decoder) fastpathDecMapUint8Int32R(f *codecFnInfo, rv reflect.Value) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint8]int32)
+ if *vp == nil {
+ *vp = make(map[uint8]int32, decInferLen(containerLen, d.h.MaxInitLen, 5))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint8]int64)
- if *vp == nil {
- *vp = make(map[uint8]int64, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint8Int64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint8Int64L(rv2i(rv).(map[uint8]int64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint8Int32L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint8Int32L(rv2i(rv).(map[uint8]int32), containerLen, d)
}
+ d.mapEnd()
}
-func (f fastpathT) DecMapUint8Int64X(vp *map[uint8]int64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+func (f fastpathT) DecMapUint8Int32X(vp *map[uint8]int32, d *Decoder) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
- *vp = make(map[uint8]int64, decInferLen(containerLen, d.h.MaxInitLen, 9))
+ *vp = make(map[uint8]int32, decInferLen(containerLen, d.h.MaxInitLen, 5))
}
if containerLen != 0 {
- f.DecMapUint8Int64L(*vp, containerLen, d)
+ f.DecMapUint8Int32L(*vp, containerLen, d)
}
d.mapEnd()
}
}
-func (fastpathT) DecMapUint8Int64L(v map[uint8]int64, containerLen int, d *Decoder) {
+func (fastpathT) DecMapUint8Int32L(v map[uint8]int32, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint8]int32 given stream length: %v", containerLen)
+ return
+ }
var mk uint8
- var mv int64
+ var mv int32
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
d.mapElemValue()
- mv = d.d.DecodeInt64()
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUint8Float32R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint8]float32)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint8]float32)
- if *vp == nil {
- *vp = make(map[uint8]float32, decInferLen(containerLen, d.h.MaxInitLen, 5))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint8Float32L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint8Float32L(rv2i(rv).(map[uint8]float32), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUint8Float32X(vp *map[uint8]float32, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint8]float32, decInferLen(containerLen, d.h.MaxInitLen, 5))
- }
- if containerLen != 0 {
- f.DecMapUint8Float32L(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUint8Float32L(v map[uint8]float32, containerLen int, d *Decoder) {
- var mk uint8
- var mv float32
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
- d.mapElemValue()
- mv = float32(d.decodeFloat32())
- if v != nil {
- v[mk] = mv
- }
+ mv = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint8Float64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint8]float64)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint8]float64)
+ if *vp == nil {
+ *vp = make(map[uint8]float64, decInferLen(containerLen, d.h.MaxInitLen, 9))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint8]float64)
- if *vp == nil {
- *vp = make(map[uint8]float64, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint8Float64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint8Float64L(rv2i(rv).(map[uint8]float64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint8Float64L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint8Float64L(rv2i(rv).(map[uint8]float64), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint8Float64X(vp *map[uint8]float64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7233,6 +4844,10 @@ func (f fastpathT) DecMapUint8Float64X(vp *map[uint8]float64, d *Decoder) {
}
}
func (fastpathT) DecMapUint8Float64L(v map[uint8]float64, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint8]float64 given stream length: %v", containerLen)
+ return
+ }
var mk uint8
var mv float64
hasLen := containerLen > 0
@@ -7241,35 +4856,27 @@ func (fastpathT) DecMapUint8Float64L(v map[uint8]float64, containerLen int, d *D
mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
d.mapElemValue()
mv = d.d.DecodeFloat64()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint8BoolR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint8]bool)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint8]bool)
+ if *vp == nil {
+ *vp = make(map[uint8]bool, decInferLen(containerLen, d.h.MaxInitLen, 2))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint8]bool)
- if *vp == nil {
- *vp = make(map[uint8]bool, decInferLen(containerLen, d.h.MaxInitLen, 2))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint8BoolL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint8BoolL(rv2i(rv).(map[uint8]bool), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint8BoolL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint8BoolL(rv2i(rv).(map[uint8]bool), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint8BoolX(vp *map[uint8]bool, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7282,6 +4889,10 @@ func (f fastpathT) DecMapUint8BoolX(vp *map[uint8]bool, d *Decoder) {
}
}
func (fastpathT) DecMapUint8BoolL(v map[uint8]bool, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint8]bool given stream length: %v", containerLen)
+ return
+ }
var mk uint8
var mv bool
hasLen := containerLen > 0
@@ -7290,35 +4901,27 @@ func (fastpathT) DecMapUint8BoolL(v map[uint8]bool, containerLen int, d *Decoder
mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
d.mapElemValue()
mv = d.d.DecodeBool()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint64IntfR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint64]interface{})) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint64]interface{})
+ if *vp == nil {
+ *vp = make(map[uint64]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint64]interface{})
- if *vp == nil {
- *vp = make(map[uint64]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint64IntfL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint64IntfL(rv2i(rv).(map[uint64]interface{}), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint64IntfL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint64IntfL(rv2i(rv).(map[uint64]interface{}), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint64IntfX(vp *map[uint64]interface{}, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7331,6 +4934,10 @@ func (f fastpathT) DecMapUint64IntfX(vp *map[uint64]interface{}, d *Decoder) {
}
}
func (fastpathT) DecMapUint64IntfL(v map[uint64]interface{}, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint64]interface{} given stream length: %v", containerLen)
+ return
+ }
mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
var mk uint64
var mv interface{}
@@ -7345,35 +4952,27 @@ func (fastpathT) DecMapUint64IntfL(v map[uint64]interface{}, containerLen int, d
mv = nil
}
d.decode(&mv)
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint64StringR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint64]string)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint64]string)
+ if *vp == nil {
+ *vp = make(map[uint64]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint64]string)
- if *vp == nil {
- *vp = make(map[uint64]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint64StringL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint64StringL(rv2i(rv).(map[uint64]string), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint64StringL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint64StringL(rv2i(rv).(map[uint64]string), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint64StringX(vp *map[uint64]string, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7386,6 +4985,10 @@ func (f fastpathT) DecMapUint64StringX(vp *map[uint64]string, d *Decoder) {
}
}
func (fastpathT) DecMapUint64StringL(v map[uint64]string, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint64]string given stream length: %v", containerLen)
+ return
+ }
var mk uint64
var mv string
hasLen := containerLen > 0
@@ -7393,36 +4996,28 @@ func (fastpathT) DecMapUint64StringL(v map[uint64]string, containerLen int, d *D
d.mapElemKey()
mk = d.d.DecodeUint64()
d.mapElemValue()
- mv = string(d.d.DecodeStringAsBytes())
- if v != nil {
- v[mk] = mv
- }
+ mv = d.stringZC(d.d.DecodeStringAsBytes())
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint64BytesR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint64][]byte)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint64][]byte)
+ if *vp == nil {
+ *vp = make(map[uint64][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint64][]byte)
- if *vp == nil {
- *vp = make(map[uint64][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint64BytesL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint64BytesL(rv2i(rv).(map[uint64][]byte), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint64BytesL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint64BytesL(rv2i(rv).(map[uint64][]byte), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint64BytesX(vp *map[uint64][]byte, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7435,6 +5030,10 @@ func (f fastpathT) DecMapUint64BytesX(vp *map[uint64][]byte, d *Decoder) {
}
}
func (fastpathT) DecMapUint64BytesL(v map[uint64][]byte, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint64][]byte given stream length: %v", containerLen)
+ return
+ }
mapGet := v != nil && !d.h.MapValueReset
var mk uint64
var mv []byte
@@ -7448,85 +5047,28 @@ func (fastpathT) DecMapUint64BytesL(v map[uint64][]byte, containerLen int, d *De
} else {
mv = nil
}
- mv = d.d.DecodeBytes(mv, false)
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUint64UintR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint64]uint)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint64]uint)
- if *vp == nil {
- *vp = make(map[uint64]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint64UintL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint64UintL(rv2i(rv).(map[uint64]uint), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUint64UintX(vp *map[uint64]uint, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint64]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- f.DecMapUint64UintL(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUint64UintL(v map[uint64]uint, containerLen int, d *Decoder) {
- var mk uint64
- var mv uint
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = d.d.DecodeUint64()
- d.mapElemValue()
- mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- if v != nil {
- v[mk] = mv
- }
+ mv = d.decodeBytesInto(mv)
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint64]uint8)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint64]uint8)
+ if *vp == nil {
+ *vp = make(map[uint64]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint64]uint8)
- if *vp == nil {
- *vp = make(map[uint64]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint64Uint8L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint64Uint8L(rv2i(rv).(map[uint64]uint8), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint64Uint8L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint64Uint8L(rv2i(rv).(map[uint64]uint8), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint64Uint8X(vp *map[uint64]uint8, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7539,6 +5081,10 @@ func (f fastpathT) DecMapUint64Uint8X(vp *map[uint64]uint8, d *Decoder) {
}
}
func (fastpathT) DecMapUint64Uint8L(v map[uint64]uint8, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint64]uint8 given stream length: %v", containerLen)
+ return
+ }
var mk uint64
var mv uint8
hasLen := containerLen > 0
@@ -7547,35 +5093,27 @@ func (fastpathT) DecMapUint64Uint8L(v map[uint64]uint8, containerLen int, d *Dec
mk = d.d.DecodeUint64()
d.mapElemValue()
mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint64]uint64)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint64]uint64)
+ if *vp == nil {
+ *vp = make(map[uint64]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint64]uint64)
- if *vp == nil {
- *vp = make(map[uint64]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint64Uint64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint64Uint64L(rv2i(rv).(map[uint64]uint64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint64Uint64L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint64Uint64L(rv2i(rv).(map[uint64]uint64), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint64Uint64X(vp *map[uint64]uint64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7588,6 +5126,10 @@ func (f fastpathT) DecMapUint64Uint64X(vp *map[uint64]uint64, d *Decoder) {
}
}
func (fastpathT) DecMapUint64Uint64L(v map[uint64]uint64, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint64]uint64 given stream length: %v", containerLen)
+ return
+ }
var mk uint64
var mv uint64
hasLen := containerLen > 0
@@ -7596,35 +5138,27 @@ func (fastpathT) DecMapUint64Uint64L(v map[uint64]uint64, containerLen int, d *D
mk = d.d.DecodeUint64()
d.mapElemValue()
mv = d.d.DecodeUint64()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint64IntR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint64]int)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint64]int)
+ if *vp == nil {
+ *vp = make(map[uint64]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint64]int)
- if *vp == nil {
- *vp = make(map[uint64]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint64IntL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint64IntL(rv2i(rv).(map[uint64]int), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint64IntL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint64IntL(rv2i(rv).(map[uint64]int), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint64IntX(vp *map[uint64]int, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7637,6 +5171,10 @@ func (f fastpathT) DecMapUint64IntX(vp *map[uint64]int, d *Decoder) {
}
}
func (fastpathT) DecMapUint64IntL(v map[uint64]int, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint64]int given stream length: %v", containerLen)
+ return
+ }
var mk uint64
var mv int
hasLen := containerLen > 0
@@ -7645,133 +5183,72 @@ func (fastpathT) DecMapUint64IntL(v map[uint64]int, containerLen int, d *Decoder
mk = d.d.DecodeUint64()
d.mapElemValue()
mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
-func (d *Decoder) fastpathDecMapUint64Int64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint64]int64)) = nil
+func (d *Decoder) fastpathDecMapUint64Int32R(f *codecFnInfo, rv reflect.Value) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint64]int32)
+ if *vp == nil {
+ *vp = make(map[uint64]int32, decInferLen(containerLen, d.h.MaxInitLen, 12))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint64]int64)
- if *vp == nil {
- *vp = make(map[uint64]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint64Int64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint64Int64L(rv2i(rv).(map[uint64]int64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint64Int32L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint64Int32L(rv2i(rv).(map[uint64]int32), containerLen, d)
}
+ d.mapEnd()
}
-func (f fastpathT) DecMapUint64Int64X(vp *map[uint64]int64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+func (f fastpathT) DecMapUint64Int32X(vp *map[uint64]int32, d *Decoder) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
- *vp = make(map[uint64]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
+ *vp = make(map[uint64]int32, decInferLen(containerLen, d.h.MaxInitLen, 12))
}
if containerLen != 0 {
- f.DecMapUint64Int64L(*vp, containerLen, d)
+ f.DecMapUint64Int32L(*vp, containerLen, d)
}
d.mapEnd()
}
}
-func (fastpathT) DecMapUint64Int64L(v map[uint64]int64, containerLen int, d *Decoder) {
+func (fastpathT) DecMapUint64Int32L(v map[uint64]int32, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint64]int32 given stream length: %v", containerLen)
+ return
+ }
var mk uint64
- var mv int64
+ var mv int32
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
mk = d.d.DecodeUint64()
d.mapElemValue()
- mv = d.d.DecodeInt64()
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapUint64Float32R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint64]float32)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint64]float32)
- if *vp == nil {
- *vp = make(map[uint64]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint64Float32L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint64Float32L(rv2i(rv).(map[uint64]float32), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapUint64Float32X(vp *map[uint64]float32, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[uint64]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
- }
- if containerLen != 0 {
- f.DecMapUint64Float32L(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapUint64Float32L(v map[uint64]float32, containerLen int, d *Decoder) {
- var mk uint64
- var mv float32
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = d.d.DecodeUint64()
- d.mapElemValue()
- mv = float32(d.decodeFloat32())
- if v != nil {
- v[mk] = mv
- }
+ mv = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint64Float64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint64]float64)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint64]float64)
+ if *vp == nil {
+ *vp = make(map[uint64]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint64]float64)
- if *vp == nil {
- *vp = make(map[uint64]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint64Float64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint64Float64L(rv2i(rv).(map[uint64]float64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint64Float64L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint64Float64L(rv2i(rv).(map[uint64]float64), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint64Float64X(vp *map[uint64]float64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7784,6 +5261,10 @@ func (f fastpathT) DecMapUint64Float64X(vp *map[uint64]float64, d *Decoder) {
}
}
func (fastpathT) DecMapUint64Float64L(v map[uint64]float64, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint64]float64 given stream length: %v", containerLen)
+ return
+ }
var mk uint64
var mv float64
hasLen := containerLen > 0
@@ -7792,35 +5273,27 @@ func (fastpathT) DecMapUint64Float64L(v map[uint64]float64, containerLen int, d
mk = d.d.DecodeUint64()
d.mapElemValue()
mv = d.d.DecodeFloat64()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapUint64BoolR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[uint64]bool)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[uint64]bool)
+ if *vp == nil {
+ *vp = make(map[uint64]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[uint64]bool)
- if *vp == nil {
- *vp = make(map[uint64]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- fastpathTV.DecMapUint64BoolL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapUint64BoolL(rv2i(rv).(map[uint64]bool), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapUint64BoolL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapUint64BoolL(rv2i(rv).(map[uint64]bool), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapUint64BoolX(vp *map[uint64]bool, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7833,6 +5306,10 @@ func (f fastpathT) DecMapUint64BoolX(vp *map[uint64]bool, d *Decoder) {
}
}
func (fastpathT) DecMapUint64BoolL(v map[uint64]bool, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[uint64]bool given stream length: %v", containerLen)
+ return
+ }
var mk uint64
var mv bool
hasLen := containerLen > 0
@@ -7841,35 +5318,27 @@ func (fastpathT) DecMapUint64BoolL(v map[uint64]bool, containerLen int, d *Decod
mk = d.d.DecodeUint64()
d.mapElemValue()
mv = d.d.DecodeBool()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapIntIntfR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int]interface{})) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int]interface{})
+ if *vp == nil {
+ *vp = make(map[int]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int]interface{})
- if *vp == nil {
- *vp = make(map[int]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- fastpathTV.DecMapIntIntfL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapIntIntfL(rv2i(rv).(map[int]interface{}), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapIntIntfL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapIntIntfL(rv2i(rv).(map[int]interface{}), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapIntIntfX(vp *map[int]interface{}, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7882,6 +5351,10 @@ func (f fastpathT) DecMapIntIntfX(vp *map[int]interface{}, d *Decoder) {
}
}
func (fastpathT) DecMapIntIntfL(v map[int]interface{}, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int]interface{} given stream length: %v", containerLen)
+ return
+ }
mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
var mk int
var mv interface{}
@@ -7896,35 +5369,27 @@ func (fastpathT) DecMapIntIntfL(v map[int]interface{}, containerLen int, d *Deco
mv = nil
}
d.decode(&mv)
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapIntStringR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int]string)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int]string)
+ if *vp == nil {
+ *vp = make(map[int]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int]string)
- if *vp == nil {
- *vp = make(map[int]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- fastpathTV.DecMapIntStringL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapIntStringL(rv2i(rv).(map[int]string), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapIntStringL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapIntStringL(rv2i(rv).(map[int]string), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapIntStringX(vp *map[int]string, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7937,6 +5402,10 @@ func (f fastpathT) DecMapIntStringX(vp *map[int]string, d *Decoder) {
}
}
func (fastpathT) DecMapIntStringL(v map[int]string, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int]string given stream length: %v", containerLen)
+ return
+ }
var mk int
var mv string
hasLen := containerLen > 0
@@ -7944,36 +5413,28 @@ func (fastpathT) DecMapIntStringL(v map[int]string, containerLen int, d *Decoder
d.mapElemKey()
mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
d.mapElemValue()
- mv = string(d.d.DecodeStringAsBytes())
- if v != nil {
- v[mk] = mv
- }
+ mv = d.stringZC(d.d.DecodeStringAsBytes())
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapIntBytesR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int][]byte)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int][]byte)
+ if *vp == nil {
+ *vp = make(map[int][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int][]byte)
- if *vp == nil {
- *vp = make(map[int][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
- }
- if containerLen != 0 {
- fastpathTV.DecMapIntBytesL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapIntBytesL(rv2i(rv).(map[int][]byte), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapIntBytesL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapIntBytesL(rv2i(rv).(map[int][]byte), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapIntBytesX(vp *map[int][]byte, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -7986,6 +5447,10 @@ func (f fastpathT) DecMapIntBytesX(vp *map[int][]byte, d *Decoder) {
}
}
func (fastpathT) DecMapIntBytesL(v map[int][]byte, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int][]byte given stream length: %v", containerLen)
+ return
+ }
mapGet := v != nil && !d.h.MapValueReset
var mk int
var mv []byte
@@ -7999,85 +5464,28 @@ func (fastpathT) DecMapIntBytesL(v map[int][]byte, containerLen int, d *Decoder)
} else {
mv = nil
}
- mv = d.d.DecodeBytes(mv, false)
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapIntUintR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int]uint)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int]uint)
- if *vp == nil {
- *vp = make(map[int]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapIntUintL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapIntUintL(rv2i(rv).(map[int]uint), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapIntUintX(vp *map[int]uint, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[int]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- f.DecMapIntUintL(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapIntUintL(v map[int]uint, containerLen int, d *Decoder) {
- var mk int
- var mv uint
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
- d.mapElemValue()
- mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- if v != nil {
- v[mk] = mv
- }
+ mv = d.decodeBytesInto(mv)
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapIntUint8R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int]uint8)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int]uint8)
+ if *vp == nil {
+ *vp = make(map[int]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int]uint8)
- if *vp == nil {
- *vp = make(map[int]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- fastpathTV.DecMapIntUint8L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapIntUint8L(rv2i(rv).(map[int]uint8), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapIntUint8L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapIntUint8L(rv2i(rv).(map[int]uint8), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapIntUint8X(vp *map[int]uint8, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -8090,6 +5498,10 @@ func (f fastpathT) DecMapIntUint8X(vp *map[int]uint8, d *Decoder) {
}
}
func (fastpathT) DecMapIntUint8L(v map[int]uint8, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int]uint8 given stream length: %v", containerLen)
+ return
+ }
var mk int
var mv uint8
hasLen := containerLen > 0
@@ -8098,35 +5510,27 @@ func (fastpathT) DecMapIntUint8L(v map[int]uint8, containerLen int, d *Decoder)
mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
d.mapElemValue()
mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapIntUint64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int]uint64)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int]uint64)
+ if *vp == nil {
+ *vp = make(map[int]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int]uint64)
- if *vp == nil {
- *vp = make(map[int]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapIntUint64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapIntUint64L(rv2i(rv).(map[int]uint64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapIntUint64L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapIntUint64L(rv2i(rv).(map[int]uint64), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapIntUint64X(vp *map[int]uint64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -8139,6 +5543,10 @@ func (f fastpathT) DecMapIntUint64X(vp *map[int]uint64, d *Decoder) {
}
}
func (fastpathT) DecMapIntUint64L(v map[int]uint64, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int]uint64 given stream length: %v", containerLen)
+ return
+ }
var mk int
var mv uint64
hasLen := containerLen > 0
@@ -8147,35 +5555,27 @@ func (fastpathT) DecMapIntUint64L(v map[int]uint64, containerLen int, d *Decoder
mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
d.mapElemValue()
mv = d.d.DecodeUint64()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapIntIntR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int]int)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int]int)
+ if *vp == nil {
+ *vp = make(map[int]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int]int)
- if *vp == nil {
- *vp = make(map[int]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapIntIntL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapIntIntL(rv2i(rv).(map[int]int), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapIntIntL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapIntIntL(rv2i(rv).(map[int]int), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapIntIntX(vp *map[int]int, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -8188,6 +5588,10 @@ func (f fastpathT) DecMapIntIntX(vp *map[int]int, d *Decoder) {
}
}
func (fastpathT) DecMapIntIntL(v map[int]int, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int]int given stream length: %v", containerLen)
+ return
+ }
var mk int
var mv int
hasLen := containerLen > 0
@@ -8196,133 +5600,72 @@ func (fastpathT) DecMapIntIntL(v map[int]int, containerLen int, d *Decoder) {
mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
d.mapElemValue()
mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
-func (d *Decoder) fastpathDecMapIntInt64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int]int64)) = nil
+func (d *Decoder) fastpathDecMapIntInt32R(f *codecFnInfo, rv reflect.Value) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int]int32)
+ if *vp == nil {
+ *vp = make(map[int]int32, decInferLen(containerLen, d.h.MaxInitLen, 12))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int]int64)
- if *vp == nil {
- *vp = make(map[int]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapIntInt64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapIntInt64L(rv2i(rv).(map[int]int64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapIntInt32L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapIntInt32L(rv2i(rv).(map[int]int32), containerLen, d)
}
+ d.mapEnd()
}
-func (f fastpathT) DecMapIntInt64X(vp *map[int]int64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+func (f fastpathT) DecMapIntInt32X(vp *map[int]int32, d *Decoder) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
- *vp = make(map[int]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
+ *vp = make(map[int]int32, decInferLen(containerLen, d.h.MaxInitLen, 12))
}
if containerLen != 0 {
- f.DecMapIntInt64L(*vp, containerLen, d)
+ f.DecMapIntInt32L(*vp, containerLen, d)
}
d.mapEnd()
}
}
-func (fastpathT) DecMapIntInt64L(v map[int]int64, containerLen int, d *Decoder) {
+func (fastpathT) DecMapIntInt32L(v map[int]int32, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int]int32 given stream length: %v", containerLen)
+ return
+ }
var mk int
- var mv int64
+ var mv int32
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
d.mapElemValue()
- mv = d.d.DecodeInt64()
- if v != nil {
- v[mk] = mv
- }
- }
-}
-func (d *Decoder) fastpathDecMapIntFloat32R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int]float32)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int]float32)
- if *vp == nil {
- *vp = make(map[int]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
- }
- if containerLen != 0 {
- fastpathTV.DecMapIntFloat32L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapIntFloat32L(rv2i(rv).(map[int]float32), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapIntFloat32X(vp *map[int]float32, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[int]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
- }
- if containerLen != 0 {
- f.DecMapIntFloat32L(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapIntFloat32L(v map[int]float32, containerLen int, d *Decoder) {
- var mk int
- var mv float32
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
- d.mapElemValue()
- mv = float32(d.decodeFloat32())
- if v != nil {
- v[mk] = mv
- }
+ mv = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapIntFloat64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int]float64)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int]float64)
+ if *vp == nil {
+ *vp = make(map[int]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int]float64)
- if *vp == nil {
- *vp = make(map[int]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapIntFloat64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapIntFloat64L(rv2i(rv).(map[int]float64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapIntFloat64L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapIntFloat64L(rv2i(rv).(map[int]float64), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapIntFloat64X(vp *map[int]float64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -8335,6 +5678,10 @@ func (f fastpathT) DecMapIntFloat64X(vp *map[int]float64, d *Decoder) {
}
}
func (fastpathT) DecMapIntFloat64L(v map[int]float64, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int]float64 given stream length: %v", containerLen)
+ return
+ }
var mk int
var mv float64
hasLen := containerLen > 0
@@ -8343,35 +5690,27 @@ func (fastpathT) DecMapIntFloat64L(v map[int]float64, containerLen int, d *Decod
mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
d.mapElemValue()
mv = d.d.DecodeFloat64()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
func (d *Decoder) fastpathDecMapIntBoolR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int]bool)) = nil
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int]bool)
+ if *vp == nil {
+ *vp = make(map[int]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int]bool)
- if *vp == nil {
- *vp = make(map[int]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- fastpathTV.DecMapIntBoolL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapIntBoolL(rv2i(rv).(map[int]bool), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapIntBoolL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapIntBoolL(rv2i(rv).(map[int]bool), containerLen, d)
}
+ d.mapEnd()
}
func (f fastpathT) DecMapIntBoolX(vp *map[int]bool, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -8384,6 +5723,10 @@ func (f fastpathT) DecMapIntBoolX(vp *map[int]bool, d *Decoder) {
}
}
func (fastpathT) DecMapIntBoolL(v map[int]bool, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int]bool given stream length: %v", containerLen)
+ return
+ }
var mk int
var mv bool
hasLen := containerLen > 0
@@ -8392,54 +5735,50 @@ func (fastpathT) DecMapIntBoolL(v map[int]bool, containerLen int, d *Decoder) {
mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
d.mapElemValue()
mv = d.d.DecodeBool()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
-func (d *Decoder) fastpathDecMapInt64IntfR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int64]interface{})) = nil
+func (d *Decoder) fastpathDecMapInt32IntfR(f *codecFnInfo, rv reflect.Value) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int32]interface{})
+ if *vp == nil {
+ *vp = make(map[int32]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 20))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int64]interface{})
- if *vp == nil {
- *vp = make(map[int64]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- fastpathTV.DecMapInt64IntfL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapInt64IntfL(rv2i(rv).(map[int64]interface{}), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapInt32IntfL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapInt32IntfL(rv2i(rv).(map[int32]interface{}), containerLen, d)
}
+ d.mapEnd()
}
-func (f fastpathT) DecMapInt64IntfX(vp *map[int64]interface{}, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+func (f fastpathT) DecMapInt32IntfX(vp *map[int32]interface{}, d *Decoder) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
- *vp = make(map[int64]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
+ *vp = make(map[int32]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 20))
}
if containerLen != 0 {
- f.DecMapInt64IntfL(*vp, containerLen, d)
+ f.DecMapInt32IntfL(*vp, containerLen, d)
}
d.mapEnd()
}
}
-func (fastpathT) DecMapInt64IntfL(v map[int64]interface{}, containerLen int, d *Decoder) {
+func (fastpathT) DecMapInt32IntfL(v map[int32]interface{}, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int32]interface{} given stream length: %v", containerLen)
+ return
+ }
mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
- var mk int64
+ var mk int32
var mv interface{}
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = d.d.DecodeInt64()
+ mk = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
d.mapElemValue()
if mapGet {
mv = v[mk]
@@ -8447,504 +5786,372 @@ func (fastpathT) DecMapInt64IntfL(v map[int64]interface{}, containerLen int, d *
mv = nil
}
d.decode(&mv)
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
-func (d *Decoder) fastpathDecMapInt64StringR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int64]string)) = nil
+func (d *Decoder) fastpathDecMapInt32StringR(f *codecFnInfo, rv reflect.Value) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int32]string)
+ if *vp == nil {
+ *vp = make(map[int32]string, decInferLen(containerLen, d.h.MaxInitLen, 20))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int64]string)
- if *vp == nil {
- *vp = make(map[int64]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
- }
- if containerLen != 0 {
- fastpathTV.DecMapInt64StringL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapInt64StringL(rv2i(rv).(map[int64]string), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapInt32StringL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapInt32StringL(rv2i(rv).(map[int32]string), containerLen, d)
}
+ d.mapEnd()
}
-func (f fastpathT) DecMapInt64StringX(vp *map[int64]string, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+func (f fastpathT) DecMapInt32StringX(vp *map[int32]string, d *Decoder) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
- *vp = make(map[int64]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
+ *vp = make(map[int32]string, decInferLen(containerLen, d.h.MaxInitLen, 20))
}
if containerLen != 0 {
- f.DecMapInt64StringL(*vp, containerLen, d)
+ f.DecMapInt32StringL(*vp, containerLen, d)
}
d.mapEnd()
}
}
-func (fastpathT) DecMapInt64StringL(v map[int64]string, containerLen int, d *Decoder) {
- var mk int64
+func (fastpathT) DecMapInt32StringL(v map[int32]string, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int32]string given stream length: %v", containerLen)
+ return
+ }
+ var mk int32
var mv string
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = d.d.DecodeInt64()
+ mk = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
d.mapElemValue()
- mv = string(d.d.DecodeStringAsBytes())
- if v != nil {
- v[mk] = mv
- }
+ mv = d.stringZC(d.d.DecodeStringAsBytes())
+ v[mk] = mv
}
}
-func (d *Decoder) fastpathDecMapInt64BytesR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int64][]byte)) = nil
+func (d *Decoder) fastpathDecMapInt32BytesR(f *codecFnInfo, rv reflect.Value) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int32][]byte)
+ if *vp == nil {
+ *vp = make(map[int32][]byte, decInferLen(containerLen, d.h.MaxInitLen, 28))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int64][]byte)
- if *vp == nil {
- *vp = make(map[int64][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
- }
- if containerLen != 0 {
- fastpathTV.DecMapInt64BytesL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapInt64BytesL(rv2i(rv).(map[int64][]byte), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapInt32BytesL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapInt32BytesL(rv2i(rv).(map[int32][]byte), containerLen, d)
}
+ d.mapEnd()
}
-func (f fastpathT) DecMapInt64BytesX(vp *map[int64][]byte, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+func (f fastpathT) DecMapInt32BytesX(vp *map[int32][]byte, d *Decoder) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
- *vp = make(map[int64][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
+ *vp = make(map[int32][]byte, decInferLen(containerLen, d.h.MaxInitLen, 28))
}
if containerLen != 0 {
- f.DecMapInt64BytesL(*vp, containerLen, d)
+ f.DecMapInt32BytesL(*vp, containerLen, d)
}
d.mapEnd()
}
}
-func (fastpathT) DecMapInt64BytesL(v map[int64][]byte, containerLen int, d *Decoder) {
+func (fastpathT) DecMapInt32BytesL(v map[int32][]byte, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int32][]byte given stream length: %v", containerLen)
+ return
+ }
mapGet := v != nil && !d.h.MapValueReset
- var mk int64
+ var mk int32
var mv []byte
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = d.d.DecodeInt64()
+ mk = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
d.mapElemValue()
if mapGet {
mv = v[mk]
} else {
mv = nil
}
- mv = d.d.DecodeBytes(mv, false)
- if v != nil {
- v[mk] = mv
- }
+ mv = d.decodeBytesInto(mv)
+ v[mk] = mv
}
}
-func (d *Decoder) fastpathDecMapInt64UintR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int64]uint)) = nil
+func (d *Decoder) fastpathDecMapInt32Uint8R(f *codecFnInfo, rv reflect.Value) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int32]uint8)
+ if *vp == nil {
+ *vp = make(map[int32]uint8, decInferLen(containerLen, d.h.MaxInitLen, 5))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int64]uint)
- if *vp == nil {
- *vp = make(map[int64]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapInt64UintL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapInt64UintL(rv2i(rv).(map[int64]uint), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapInt32Uint8L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapInt32Uint8L(rv2i(rv).(map[int32]uint8), containerLen, d)
}
+ d.mapEnd()
}
-func (f fastpathT) DecMapInt64UintX(vp *map[int64]uint, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+func (f fastpathT) DecMapInt32Uint8X(vp *map[int32]uint8, d *Decoder) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
- *vp = make(map[int64]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
+ *vp = make(map[int32]uint8, decInferLen(containerLen, d.h.MaxInitLen, 5))
}
if containerLen != 0 {
- f.DecMapInt64UintL(*vp, containerLen, d)
+ f.DecMapInt32Uint8L(*vp, containerLen, d)
}
d.mapEnd()
}
}
-func (fastpathT) DecMapInt64UintL(v map[int64]uint, containerLen int, d *Decoder) {
- var mk int64
- var mv uint
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = d.d.DecodeInt64()
- d.mapElemValue()
- mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
- if v != nil {
- v[mk] = mv
- }
+func (fastpathT) DecMapInt32Uint8L(v map[int32]uint8, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int32]uint8 given stream length: %v", containerLen)
+ return
}
-}
-func (d *Decoder) fastpathDecMapInt64Uint8R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int64]uint8)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int64]uint8)
- if *vp == nil {
- *vp = make(map[int64]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- fastpathTV.DecMapInt64Uint8L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapInt64Uint8L(rv2i(rv).(map[int64]uint8), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapInt64Uint8X(vp *map[int64]uint8, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[int64]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- f.DecMapInt64Uint8L(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapInt64Uint8L(v map[int64]uint8, containerLen int, d *Decoder) {
- var mk int64
+ var mk int32
var mv uint8
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = d.d.DecodeInt64()
+ mk = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
d.mapElemValue()
mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
-func (d *Decoder) fastpathDecMapInt64Uint64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int64]uint64)) = nil
+func (d *Decoder) fastpathDecMapInt32Uint64R(f *codecFnInfo, rv reflect.Value) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int32]uint64)
+ if *vp == nil {
+ *vp = make(map[int32]uint64, decInferLen(containerLen, d.h.MaxInitLen, 12))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int64]uint64)
- if *vp == nil {
- *vp = make(map[int64]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapInt64Uint64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapInt64Uint64L(rv2i(rv).(map[int64]uint64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapInt32Uint64L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapInt32Uint64L(rv2i(rv).(map[int32]uint64), containerLen, d)
}
+ d.mapEnd()
}
-func (f fastpathT) DecMapInt64Uint64X(vp *map[int64]uint64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+func (f fastpathT) DecMapInt32Uint64X(vp *map[int32]uint64, d *Decoder) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
- *vp = make(map[int64]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
+ *vp = make(map[int32]uint64, decInferLen(containerLen, d.h.MaxInitLen, 12))
}
if containerLen != 0 {
- f.DecMapInt64Uint64L(*vp, containerLen, d)
+ f.DecMapInt32Uint64L(*vp, containerLen, d)
}
d.mapEnd()
}
}
-func (fastpathT) DecMapInt64Uint64L(v map[int64]uint64, containerLen int, d *Decoder) {
- var mk int64
+func (fastpathT) DecMapInt32Uint64L(v map[int32]uint64, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int32]uint64 given stream length: %v", containerLen)
+ return
+ }
+ var mk int32
var mv uint64
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = d.d.DecodeInt64()
+ mk = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
d.mapElemValue()
mv = d.d.DecodeUint64()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
-func (d *Decoder) fastpathDecMapInt64IntR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int64]int)) = nil
+func (d *Decoder) fastpathDecMapInt32IntR(f *codecFnInfo, rv reflect.Value) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int32]int)
+ if *vp == nil {
+ *vp = make(map[int32]int, decInferLen(containerLen, d.h.MaxInitLen, 12))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int64]int)
- if *vp == nil {
- *vp = make(map[int64]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapInt64IntL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapInt64IntL(rv2i(rv).(map[int64]int), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapInt32IntL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapInt32IntL(rv2i(rv).(map[int32]int), containerLen, d)
}
+ d.mapEnd()
}
-func (f fastpathT) DecMapInt64IntX(vp *map[int64]int, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+func (f fastpathT) DecMapInt32IntX(vp *map[int32]int, d *Decoder) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
- *vp = make(map[int64]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
+ *vp = make(map[int32]int, decInferLen(containerLen, d.h.MaxInitLen, 12))
}
if containerLen != 0 {
- f.DecMapInt64IntL(*vp, containerLen, d)
+ f.DecMapInt32IntL(*vp, containerLen, d)
}
d.mapEnd()
}
}
-func (fastpathT) DecMapInt64IntL(v map[int64]int, containerLen int, d *Decoder) {
- var mk int64
+func (fastpathT) DecMapInt32IntL(v map[int32]int, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int32]int given stream length: %v", containerLen)
+ return
+ }
+ var mk int32
var mv int
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = d.d.DecodeInt64()
+ mk = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
d.mapElemValue()
mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
-func (d *Decoder) fastpathDecMapInt64Int64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int64]int64)) = nil
+func (d *Decoder) fastpathDecMapInt32Int32R(f *codecFnInfo, rv reflect.Value) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int32]int32)
+ if *vp == nil {
+ *vp = make(map[int32]int32, decInferLen(containerLen, d.h.MaxInitLen, 8))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int64]int64)
- if *vp == nil {
- *vp = make(map[int64]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapInt64Int64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapInt64Int64L(rv2i(rv).(map[int64]int64), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapInt32Int32L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapInt32Int32L(rv2i(rv).(map[int32]int32), containerLen, d)
}
+ d.mapEnd()
}
-func (f fastpathT) DecMapInt64Int64X(vp *map[int64]int64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+func (f fastpathT) DecMapInt32Int32X(vp *map[int32]int32, d *Decoder) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
- *vp = make(map[int64]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
+ *vp = make(map[int32]int32, decInferLen(containerLen, d.h.MaxInitLen, 8))
}
if containerLen != 0 {
- f.DecMapInt64Int64L(*vp, containerLen, d)
+ f.DecMapInt32Int32L(*vp, containerLen, d)
}
d.mapEnd()
}
}
-func (fastpathT) DecMapInt64Int64L(v map[int64]int64, containerLen int, d *Decoder) {
- var mk int64
- var mv int64
+func (fastpathT) DecMapInt32Int32L(v map[int32]int32, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int32]int32 given stream length: %v", containerLen)
+ return
+ }
+ var mk int32
+ var mv int32
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = d.d.DecodeInt64()
+ mk = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
d.mapElemValue()
- mv = d.d.DecodeInt64()
- if v != nil {
- v[mk] = mv
- }
+ mv = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
+ v[mk] = mv
}
}
-func (d *Decoder) fastpathDecMapInt64Float32R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int64]float32)) = nil
+func (d *Decoder) fastpathDecMapInt32Float64R(f *codecFnInfo, rv reflect.Value) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int32]float64)
+ if *vp == nil {
+ *vp = make(map[int32]float64, decInferLen(containerLen, d.h.MaxInitLen, 12))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int64]float32)
- if *vp == nil {
- *vp = make(map[int64]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
- }
- if containerLen != 0 {
- fastpathTV.DecMapInt64Float32L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapInt64Float32L(rv2i(rv).(map[int64]float32), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapInt32Float64L(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapInt32Float64L(rv2i(rv).(map[int32]float64), containerLen, d)
}
+ d.mapEnd()
}
-func (f fastpathT) DecMapInt64Float32X(vp *map[int64]float32, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+func (f fastpathT) DecMapInt32Float64X(vp *map[int32]float64, d *Decoder) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
- *vp = make(map[int64]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
+ *vp = make(map[int32]float64, decInferLen(containerLen, d.h.MaxInitLen, 12))
}
if containerLen != 0 {
- f.DecMapInt64Float32L(*vp, containerLen, d)
+ f.DecMapInt32Float64L(*vp, containerLen, d)
}
d.mapEnd()
}
}
-func (fastpathT) DecMapInt64Float32L(v map[int64]float32, containerLen int, d *Decoder) {
- var mk int64
- var mv float32
- hasLen := containerLen > 0
- for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
- d.mapElemKey()
- mk = d.d.DecodeInt64()
- d.mapElemValue()
- mv = float32(d.decodeFloat32())
- if v != nil {
- v[mk] = mv
- }
+func (fastpathT) DecMapInt32Float64L(v map[int32]float64, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int32]float64 given stream length: %v", containerLen)
+ return
}
-}
-func (d *Decoder) fastpathDecMapInt64Float64R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int64]float64)) = nil
- }
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int64]float64)
- if *vp == nil {
- *vp = make(map[int64]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- fastpathTV.DecMapInt64Float64L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapInt64Float64L(rv2i(rv).(map[int64]float64), containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (f fastpathT) DecMapInt64Float64X(vp *map[int64]float64, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- *vp = nil
- } else {
- if *vp == nil {
- *vp = make(map[int64]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
- }
- if containerLen != 0 {
- f.DecMapInt64Float64L(*vp, containerLen, d)
- }
- d.mapEnd()
- }
-}
-func (fastpathT) DecMapInt64Float64L(v map[int64]float64, containerLen int, d *Decoder) {
- var mk int64
+ var mk int32
var mv float64
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = d.d.DecodeInt64()
+ mk = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
d.mapElemValue()
mv = d.d.DecodeFloat64()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
-func (d *Decoder) fastpathDecMapInt64BoolR(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
- if rv.Kind() == reflect.Ptr {
- *(rv2i(rv).(*map[int64]bool)) = nil
+func (d *Decoder) fastpathDecMapInt32BoolR(f *codecFnInfo, rv reflect.Value) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[int32]bool)
+ if *vp == nil {
+ *vp = make(map[int32]bool, decInferLen(containerLen, d.h.MaxInitLen, 5))
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[int64]bool)
- if *vp == nil {
- *vp = make(map[int64]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
- }
- if containerLen != 0 {
- fastpathTV.DecMapInt64BoolL(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.DecMapInt64BoolL(rv2i(rv).(map[int64]bool), containerLen, d)
+ if containerLen != 0 {
+ fastpathTV.DecMapInt32BoolL(*vp, containerLen, d)
}
- d.mapEnd()
+ } else if containerLen != 0 {
+ fastpathTV.DecMapInt32BoolL(rv2i(rv).(map[int32]bool), containerLen, d)
}
+ d.mapEnd()
}
-func (f fastpathT) DecMapInt64BoolX(vp *map[int64]bool, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+func (f fastpathT) DecMapInt32BoolX(vp *map[int32]bool, d *Decoder) {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
- *vp = make(map[int64]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
+ *vp = make(map[int32]bool, decInferLen(containerLen, d.h.MaxInitLen, 5))
}
if containerLen != 0 {
- f.DecMapInt64BoolL(*vp, containerLen, d)
+ f.DecMapInt32BoolL(*vp, containerLen, d)
}
d.mapEnd()
}
}
-func (fastpathT) DecMapInt64BoolL(v map[int64]bool, containerLen int, d *Decoder) {
- var mk int64
+func (fastpathT) DecMapInt32BoolL(v map[int32]bool, containerLen int, d *Decoder) {
+ if v == nil {
+ d.errorf("cannot decode into nil map[int32]bool given stream length: %v", containerLen)
+ return
+ }
+ var mk int32
var mv bool
hasLen := containerLen > 0
for j := 0; (hasLen && j < containerLen) || !(hasLen || d.checkBreak()); j++ {
d.mapElemKey()
- mk = d.d.DecodeInt64()
+ mk = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
d.mapElemValue()
mv = d.d.DecodeBool()
- if v != nil {
- v[mk] = mv
- }
+ v[mk] = mv
}
}
diff --git a/vendor/github.com/ugorji/go/codec/fast-path.go.tmpl b/vendor/github.com/ugorji/go/codec/fast-path.go.tmpl
index 537f069d6..56801ee5c 100644
--- a/vendor/github.com/ugorji/go/codec/fast-path.go.tmpl
+++ b/vendor/github.com/ugorji/go/codec/fast-path.go.tmpl
@@ -1,6 +1,7 @@
// +build !notfastpath
+// +build !codec.notfastpath
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
// Code generated from fast-path.go.tmpl - DO NOT EDIT.
@@ -56,50 +57,60 @@ import (
const fastpathEnabled = true
+{{/*
const fastpathMapBySliceErrMsg = "mapBySlice requires even slice length, but got %v"
+*/ -}}
type fastpathT struct {}
var fastpathTV fastpathT
type fastpathE struct {
- rtid uintptr
+ {{/* rtid uintptr */ -}}
rt reflect.Type
encfn func(*Encoder, *codecFnInfo, reflect.Value)
decfn func(*Decoder, *codecFnInfo, reflect.Value)
}
type fastpathA [{{ .FastpathLen }}]fastpathE
+type fastpathARtid [{{ .FastpathLen }}]uintptr
-func (x *fastpathA) index(rtid uintptr) int {
+var fastpathAv fastpathA
+var fastpathAvRtid fastpathARtid
+
+type fastpathAslice struct{}
+
+func (fastpathAslice) Len() int { return {{ .FastpathLen }} }
+func (fastpathAslice) Less(i, j int) bool {
+ return fastpathAvRtid[uint(i)] < fastpathAvRtid[uint(j)]
+}
+func (fastpathAslice) Swap(i, j int) {
+ fastpathAvRtid[uint(i)], fastpathAvRtid[uint(j)] = fastpathAvRtid[uint(j)], fastpathAvRtid[uint(i)]
+ fastpathAv[uint(i)], fastpathAv[uint(j)] = fastpathAv[uint(j)], fastpathAv[uint(i)]
+}
+
+func fastpathAvIndex(rtid uintptr) int {
// use binary search to grab the index (adapted from sort/search.go)
// Note: we use goto (instead of for loop) so this can be inlined.
- // h, i, j := 0, 0, len(x)
+ // h, i, j := 0, 0, {{ .FastpathLen }}
var h, i uint
- var j = uint(len(x))
+ var j uint = {{ .FastpathLen }}
LOOP:
if i < j {
- h = i + (j-i)/2
- if x[h].rtid < rtid {
+ h = (i + j) >> 1 // avoid overflow when computing h // h = i + (j-i)/2
+ if fastpathAvRtid[h] < rtid {
i = h + 1
} else {
j = h
}
goto LOOP
}
- if i < uint(len(x)) && x[i].rtid == rtid {
+ if i < {{ .FastpathLen }} && fastpathAvRtid[i] == rtid {
return int(i)
}
return -1
}
-type fastpathAslice []fastpathE
-
-func (x fastpathAslice) Len() int { return len(x) }
-func (x fastpathAslice) Less(i, j int) bool { return x[uint(i)].rtid < x[uint(j)].rtid }
-func (x fastpathAslice) Swap(i, j int) { x[uint(i)], x[uint(j)] = x[uint(j)], x[uint(i)] }
-
-var fastpathAV fastpathA
// due to possible initialization loop error, make fastpath in an init()
func init() {
@@ -109,19 +120,20 @@ func init() {
fd func(*Decoder, *codecFnInfo, reflect.Value)) {
xrt := reflect.TypeOf(v)
xptr := rt2id(xrt)
- fastpathAV[i] = fastpathE{xptr, xrt, fe, fd}
+ fastpathAvRtid[i] = xptr
+ fastpathAv[i] = fastpathE{xrt, fe, fd}
i++
}
- {{/* do not register []uint8 in fast-path */}}
- {{range .Values}}{{if not .Primitive}}{{if not .MapKey }}{{if ne .Elem "uint8" -}}
+ {{/* do not register []byte in fast-path */}}
+ {{range .Values}}{{if not .Primitive}}{{if not .MapKey -}}
fn([]{{ .Elem }}(nil), (*Encoder).{{ .MethodNamePfx "fastpathEnc" false }}R, (*Decoder).{{ .MethodNamePfx "fastpathDec" false }}R)
- {{end}}{{end}}{{end}}{{end}}
+ {{end}}{{end}}{{end}}
{{range .Values}}{{if not .Primitive}}{{if .MapKey -}}
fn(map[{{ .MapKey }}]{{ .Elem }}(nil), (*Encoder).{{ .MethodNamePfx "fastpathEnc" false }}R, (*Decoder).{{ .MethodNamePfx "fastpathDec" false }}R)
{{end}}{{end}}{{end}}
- sort.Sort(fastpathAslice(fastpathAV[:]))
+ sort.Sort(fastpathAslice{})
}
// -- encode
@@ -129,7 +141,7 @@ func init() {
// -- -- fast path type switch
func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
switch v := iv.(type) {
-{{range .Values}}{{if not .Primitive}}{{if not .MapKey }}{{if ne .Elem "uint8" -}}
+{{range .Values}}{{if not .Primitive}}{{if not .MapKey -}}
case []{{ .Elem }}:
fastpathTV.{{ .MethodNamePfx "Enc" false }}V(v, e)
case *[]{{ .Elem }}:
@@ -138,7 +150,7 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
} else {
fastpathTV.{{ .MethodNamePfx "Enc" false }}V(*v, e)
}
-{{end}}{{end}}{{end}}{{end -}}
+{{end}}{{end}}{{end -}}
{{range .Values}}{{if not .Primitive}}{{if .MapKey -}}
case map[{{ .MapKey }}]{{ .Elem }}:
@@ -161,37 +173,49 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
// -- -- fast path functions
{{range .Values}}{{if not .Primitive}}{{if not .MapKey -}}
func (e *Encoder) {{ .MethodNamePfx "fastpathEnc" false }}R(f *codecFnInfo, rv reflect.Value) {
- if f.ti.mbs {
- fastpathTV.{{ .MethodNamePfx "EncAsMap" false }}V(rv2i(rv).([]{{ .Elem }}), e)
+ var v []{{ .Elem }}
+ if rv.Kind() == reflect.Array {
+ rvGetSlice4Array(rv, &v)
} else {
- fastpathTV.{{ .MethodNamePfx "Enc" false }}V(rv2i(rv).([]{{ .Elem }}), e)
+ v = rv2i(rv).([]{{ .Elem }})
+ }
+ if f.ti.mbs {
+ fastpathTV.{{ .MethodNamePfx "EncAsMap" false }}V(v, e)
+ } else {
+ fastpathTV.{{ .MethodNamePfx "Enc" false }}V(v, e)
}
}
func (fastpathT) {{ .MethodNamePfx "Enc" false }}V(v []{{ .Elem }}, e *Encoder) {
{{/* if v == nil { e.e.EncodeNil(); return } */ -}}
+ {{ if eq .Elem "uint8" "byte" -}}
+ e.e.EncodeStringBytesRaw(v)
+ {{ else -}}
e.arrayStart(len(v))
for j := range v {
e.arrayElem()
{{ encmd .Elem "v[j]"}}
}
e.arrayEnd()
+ {{ end -}}
}
func (fastpathT) {{ .MethodNamePfx "EncAsMap" false }}V(v []{{ .Elem }}, e *Encoder) {
{{/* if v == nil { e.e.EncodeNil() } else */ -}}
- if len(v)%2 == 1 {
+ e.haltOnMbsOddLen(len(v))
+ {{/*
+ if len(v)&1 != 0 { // similar to &1==1 or %2 == 1
e.errorf(fastpathMapBySliceErrMsg, len(v))
- } else {
- e.mapStart(len(v) / 2)
- for j := range v {
- if j%2 == 0 {
- e.mapElemKey()
- } else {
- e.mapElemValue()
- }
- {{ encmd .Elem "v[j]"}}
- }
- e.mapEnd()
}
+ */ -}}
+ e.mapStart(len(v) >> 1) // e.mapStart(len(v) / 2)
+ for j := range v {
+ if j&1 == 0 { // if j%2 == 0 {
+ e.mapElemKey()
+ } else {
+ e.mapElemValue()
+ }
+ {{ encmd .Elem "v[j]"}}
+ }
+ e.mapEnd()
}
{{end}}{{end}}{{end -}}
@@ -255,7 +279,7 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
var changed bool
var containerLen int
switch v := iv.(type) {
-{{range .Values}}{{if not .Primitive}}{{if not .MapKey }}{{if ne .Elem "uint8" -}}
+{{range .Values}}{{if not .Primitive}}{{if not .MapKey -}}
case []{{ .Elem }}:
fastpathTV.{{ .MethodNamePfx "Dec" false }}N(v, d)
case *[]{{ .Elem }}:
@@ -263,13 +287,13 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
if v2, changed = fastpathTV.{{ .MethodNamePfx "Dec" false }}Y(*v, d); changed {
*v = v2
}
-{{end}}{{end}}{{end}}{{end -}}
+{{end}}{{end}}{{end -}}
{{range .Values}}{{if not .Primitive}}{{if .MapKey }}{{/*
// maps only change if nil, and in that case, there's no point copying
*/ -}}
case map[{{ .MapKey }}]{{ .Elem }}:
- containerLen = d.mapStart()
- if containerLen != decContainerLenNil {
+ containerLen = d.mapStart(d.d.ReadMapStart())
+ if containerLen != containerLenNil {
if containerLen != 0 {
fastpathTV.{{ .MethodNamePfx "Dec" false }}L(v, containerLen, d)
}
@@ -277,10 +301,10 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
}
case *map[{{ .MapKey }}]{{ .Elem }}:
{{/*
- containerLen = d.mapStart()
+ containerLen = d.mapStart(d.d.ReadMapStart())
if containerLen == 0 {
d.mapEnd()
- } else if containerLen == decContainerLenNil {
+ } else if containerLen == containerLenNil {
*v = nil
} else {
if *v == nil {
@@ -325,17 +349,39 @@ Slices can change if they
- are settable (e.g. contained in an interface{})
*/}}
func (d *Decoder) {{ .MethodNamePfx "fastpathDec" false }}R(f *codecFnInfo, rv reflect.Value) {
- if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
+ {{/*
+ // seqTypeArray=true means that we are not getting a pointer, so no need to check that.
+ if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
+ */ -}}
+ var v []{{ .Elem }}
+ switch rv.Kind() {
+ case reflect.Ptr:
vp := rv2i(rv).(*[]{{ .Elem }})
- if v, changed := fastpathTV.{{ .MethodNamePfx "Dec" false }}Y(*vp, d); changed { *vp = v }
- } else {
+ var changed bool
+ if v, changed = fastpathTV.{{ .MethodNamePfx "Dec" false }}Y(*vp, d); changed {
+ *vp = v
+ }
+ case reflect.Array:
+ rvGetSlice4Array(rv, &v)
+ fastpathTV.{{ .MethodNamePfx "Dec" false }}N(v, d)
+ default:
fastpathTV.{{ .MethodNamePfx "Dec" false }}N(rv2i(rv).([]{{ .Elem }}), d)
}
}
func (f fastpathT) {{ .MethodNamePfx "Dec" false }}X(vp *[]{{ .Elem }}, d *Decoder) {
if v, changed := f.{{ .MethodNamePfx "Dec" false }}Y(*vp, d); changed { *vp = v }
}
-func (fastpathT) {{ .MethodNamePfx "Dec" false }}Y(v []{{ .Elem }}, d *Decoder) (_ []{{ .Elem }}, changed bool) {
+func (fastpathT) {{ .MethodNamePfx "Dec" false }}Y(v []{{ .Elem }}, d *Decoder) (v2 []{{ .Elem }}, changed bool) {
+ {{ if eq .Elem "uint8" "byte" -}}
+ switch d.d.ContainerType() {
+ case valueTypeNil, valueTypeMap:
+ break
+ default:
+ v2 = d.decodeBytesInto(v[:len(v):len(v)])
+ changed = !(len(v2) > 0 && len(v2) == len(v) && &v2[0] == &v[0]) // not same slice
+ return
+ }
+ {{ end -}}
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
if v == nil { return }
@@ -364,14 +410,10 @@ func (fastpathT) {{ .MethodNamePfx "Dec" false }}Y(v []{{ .Elem }}, d *Decoder)
}
var j int
for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
- if j == 0 && len(v) == 0 {
- if hasLen {
- xlen = decInferLen(containerLenS, d.h.MaxInitLen, {{ .Size }})
- } else {
- xlen = 8
- }
+ if j == 0 && len(v) == 0 { // means hasLen == false
+ xlen = decInferLen(containerLenS, d.h.MaxInitLen, {{ .Size }}) {{/* xlen = decDefSliceCap */}}
v = make([]{{ .Elem }}, uint(xlen))
- changed = true
+ changed = true
}
{{/* // if indefinite, etc, then expand the slice if necessary */ -}}
if j >= len(v) {
@@ -379,7 +421,7 @@ func (fastpathT) {{ .MethodNamePfx "Dec" false }}Y(v []{{ .Elem }}, d *Decoder)
changed = true
}
slh.ElemContainerState(j)
- {{ if eq .Elem "interface{}" }}d.decode(&v[uint(j)]){{ else }}v[uint(j)] = {{ decmd .Elem }}{{ end }}
+ {{ if eq .Elem "interface{}" }}d.decode(&v[uint(j)]){{ else }}v[uint(j)] = {{ decmd .Elem false }}{{ end }}
}
if j < len(v) {
v = v[:uint(j)]
@@ -389,9 +431,21 @@ func (fastpathT) {{ .MethodNamePfx "Dec" false }}Y(v []{{ .Elem }}, d *Decoder)
changed = true
}
slh.End()
- return v, changed
+ return v, changed
}
func (fastpathT) {{ .MethodNamePfx "Dec" false }}N(v []{{ .Elem }}, d *Decoder) {
+ {{ if eq .Elem "uint8" "byte" -}}
+ switch d.d.ContainerType() {
+ case valueTypeNil, valueTypeMap:
+ break
+ default:
+ v2 := d.decodeBytesInto(v[:len(v):len(v)])
+ if !(len(v2) > 0 && len(v2) == len(v) && &v2[0] == &v[0]) { // not same slice
+ copy(v, v2)
+ }
+ return
+ }
+ {{ end -}}
slh, containerLenS := d.decSliceHelperStart()
if slh.IsNil {
return
@@ -404,62 +458,55 @@ func (fastpathT) {{ .MethodNamePfx "Dec" false }}N(v []{{ .Elem }}, d *Decoder)
for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.checkBreak()); j++ {
{{/* // if indefinite, etc, then expand the slice if necessary */ -}}
if j >= len(v) {
- fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
+ slh.arrayCannotExpand(hasLen, len(v), j, containerLenS)
return
}
slh.ElemContainerState(j)
{{ if eq .Elem "interface{}" -}}
d.decode(&v[uint(j)])
{{- else -}}
- v[uint(j)] = {{ decmd .Elem }}
+ v[uint(j)] = {{ decmd .Elem false }}
{{- end }}
}
slh.End()
}
{{end}}{{end}}{{end -}}
-func fastpathDecArrayCannotExpand(slh decSliceHelper, hasLen bool, lenv, j, containerLenS int) {
- slh.d.arrayCannotExpand(lenv, j+1)
- slh.ElemContainerState(j)
- slh.d.swallow()
- j++
- for ; (hasLen && j < containerLenS) || !(hasLen || slh.d.checkBreak()); j++ {
- slh.ElemContainerState(j)
- slh.d.swallow()
- }
- slh.End()
-}
-
{{range .Values}}{{if not .Primitive}}{{if .MapKey -}}
{{/*
Maps can change if they are
- addressable (from a ptr)
- settable (e.g. contained in an interface{})
+
+Also, these methods are called by decodeValue directly, after handling a TryNil.
+Consequently, there's no need to check for containerLenNil here.
*/ -}}
func (d *Decoder) {{ .MethodNamePfx "fastpathDec" false }}R(f *codecFnInfo, rv reflect.Value) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ {{/*
+ if containerLen == containerLenNil {
if rv.Kind() == reflect.Ptr {
*(rv2i(rv).(*map[{{ .MapKey }}]{{ .Elem }})) = nil
}
- } else {
- if rv.Kind() == reflect.Ptr {
- vp, _ := rv2i(rv).(*map[{{ .MapKey }}]{{ .Elem }})
- if *vp == nil {
- *vp = make(map[{{ .MapKey }}]{{ .Elem }}, decInferLen(containerLen, d.h.MaxInitLen, {{ .Size }}))
- }
- if containerLen != 0 {
- fastpathTV.{{ .MethodNamePfx "Dec" false }}L(*vp, containerLen, d)
- }
- } else if containerLen != 0 {
- fastpathTV.{{ .MethodNamePfx "Dec" false }}L(rv2i(rv).(map[{{ .MapKey }}]{{ .Elem }}), containerLen, d)
- }
- d.mapEnd()
+ return
}
+ */ -}}
+ if rv.Kind() == reflect.Ptr {
+ vp, _ := rv2i(rv).(*map[{{ .MapKey }}]{{ .Elem }})
+ if *vp == nil {
+ *vp = make(map[{{ .MapKey }}]{{ .Elem }}, decInferLen(containerLen, d.h.MaxInitLen, {{ .Size }}))
+ }
+ if containerLen != 0 {
+ fastpathTV.{{ .MethodNamePfx "Dec" false }}L(*vp, containerLen, d)
+ }
+ } else if containerLen != 0 {
+ fastpathTV.{{ .MethodNamePfx "Dec" false }}L(rv2i(rv).(map[{{ .MapKey }}]{{ .Elem }}), containerLen, d)
+ }
+ d.mapEnd()
}
func (f fastpathT) {{ .MethodNamePfx "Dec" false }}X(vp *map[{{ .MapKey }}]{{ .Elem }}, d *Decoder) {
- containerLen := d.mapStart()
- if containerLen == decContainerLenNil {
+ containerLen := d.mapStart(d.d.ReadMapStart())
+ if containerLen == containerLenNil {
*vp = nil
} else {
if *vp == nil {
@@ -472,7 +519,12 @@ func (f fastpathT) {{ .MethodNamePfx "Dec" false }}X(vp *map[{{ .MapKey }}]{{ .E
}
}
func (fastpathT) {{ .MethodNamePfx "Dec" false }}L(v map[{{ .MapKey }}]{{ .Elem }}, containerLen int, d *Decoder) {
- {{/* No need to check if containerLen == decContainerLenNil, as that is checked by R and L above */ -}}
+ {{/* No need to check if containerLen == containerLenNil, as that is checked by R and L above */ -}}
+ if v == nil {
+ d.errorf("cannot decode into nil map[{{ .MapKey }}]{{ .Elem }} given stream length: %v", containerLen)
+ {{/* d.swallowMapContents(containerLen) */ -}}
+ return
+ }
{{if eq .Elem "interface{}" }}mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
{{else if eq .Elem "bytes" "[]byte" }}mapGet := v != nil && !d.h.MapValueReset
{{end -}}
@@ -484,8 +536,8 @@ func (fastpathT) {{ .MethodNamePfx "Dec" false }}L(v map[{{ .MapKey }}]{{ .Elem
{{ if eq .MapKey "interface{}" }}mk = nil
d.decode(&mk)
if bv, bok := mk.([]byte); bok {
- mk = d.string(bv) {{/* // maps cannot have []byte as key. switch to string. */}}
- }{{ else }}mk = {{ decmd .MapKey }}{{ end }}
+ mk = d.stringZC(bv) {{/* // maps cannot have []byte as key. switch to string. */}}
+ }{{ else }}mk = {{ decmd .MapKey true }}{{ end }}
d.mapElemValue()
{{ if eq .Elem "interface{}" "[]byte" "bytes" -}}
if mapGet { mv = v[mk] } else { mv = nil }
@@ -493,11 +545,11 @@ func (fastpathT) {{ .MethodNamePfx "Dec" false }}L(v map[{{ .MapKey }}]{{ .Elem
{{ if eq .Elem "interface{}" -}}
d.decode(&mv)
{{ else if eq .Elem "[]byte" "bytes" -}}
- mv = d.d.DecodeBytes(mv, false)
+ mv = d.decodeBytesInto(mv)
{{ else -}}
- mv = {{ decmd .Elem }}
+ mv = {{ decmd .Elem false }}
{{ end -}}
- if v != nil { v[mk] = mv }
+ v[mk] = mv
}
}
{{end}}{{end}}{{end}}
diff --git a/vendor/github.com/ugorji/go/codec/fast-path.not.go b/vendor/github.com/ugorji/go/codec/fast-path.not.go
index 6b6ac1ff2..3fcc8fd3a 100644
--- a/vendor/github.com/ugorji/go/codec/fast-path.not.go
+++ b/vendor/github.com/ugorji/go/codec/fast-path.not.go
@@ -1,7 +1,8 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
-// +build notfastpath
+//go:build notfastpath || codec.notfastpath
+// +build notfastpath codec.notfastpath
package codec
@@ -17,11 +18,13 @@ const fastpathEnabled = false
// This tag disables fastpath during build, allowing for faster build, test execution,
// short-program runs, etc.
-func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { return false }
-func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { return false }
-func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { return false }
-func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { return false }
-func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool { return false }
+func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { return false }
+func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { return false }
+
+// func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { return false }
+// func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { return false }
+
+func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool { return false }
type fastpathT struct{}
type fastpathE struct {
@@ -32,10 +35,7 @@ type fastpathE struct {
}
type fastpathA [0]fastpathE
-func (x fastpathA) index(rtid uintptr) int { return -1 }
+func fastpathAvIndex(rtid uintptr) int { return -1 }
-var fastpathAV fastpathA
+var fastpathAv fastpathA
var fastpathTV fastpathT
-
-// ----
-type TestMammoth2Wrapper struct{} // to allow testMammoth work in notfastpath mode
diff --git a/vendor/github.com/ugorji/go/codec/float.go b/vendor/github.com/ugorji/go/codec/float.go
deleted file mode 100644
index cfe3a9ec7..000000000
--- a/vendor/github.com/ugorji/go/codec/float.go
+++ /dev/null
@@ -1,313 +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.
-
-package codec
-
-import "strconv"
-
-// func parseFloat(b []byte, bitsize int) (f float64, err error) {
-// if bitsize == 32 {
-// return parseFloat32(b)
-// } else {
-// return parseFloat64(b)
-// }
-// }
-
-func parseFloat32(b []byte) (f float32, err error) {
- return parseFloat32_custom(b)
- // return parseFloat32_strconv(b)
-}
-
-func parseFloat64(b []byte) (f float64, err error) {
- return parseFloat64_custom(b)
- // return parseFloat64_strconv(b)
-}
-
-func parseFloat32_strconv(b []byte) (f float32, err error) {
- f64, err := strconv.ParseFloat(stringView(b), 32)
- f = float32(f64)
- return
-}
-
-func parseFloat64_strconv(b []byte) (f float64, err error) {
- return strconv.ParseFloat(stringView(b), 64)
-}
-
-// ------ parseFloat custom below --------
-
-// We assume that a lot of floating point numbers in json files will be
-// those that are handwritten, and with defined precision (in terms of number
-// of digits after decimal point), etc.
-//
-// We further assume that this ones can be written in exact format.
-//
-// strconv.ParseFloat has some unnecessary overhead which we can do without
-// for the common case:
-//
-// - expensive char-by-char check to see if underscores are in right place
-// - testing for and skipping underscores
-// - check if the string matches ignorecase +/- inf, +/- infinity, nan
-// - support for base 16 (0xFFFF...)
-//
-// The functions below will try a fast-path for floats which can be decoded
-// without any loss of precision, meaning they:
-//
-// - fits within the significand bits of the 32-bits or 64-bits
-// - exponent fits within the exponent value
-// - there is no truncation (any extra numbers are all trailing zeros)
-//
-// To figure out what the values are for maxMantDigits, use this idea below:
-//
-// 2^23 = 838 8608 (between 10^ 6 and 10^ 7) (significand bits of uint32)
-// 2^32 = 42 9496 7296 (between 10^ 9 and 10^10) (full uint32)
-// 2^52 = 4503 5996 2737 0496 (between 10^15 and 10^16) (significand bits of uint64)
-// 2^64 = 1844 6744 0737 0955 1616 (between 10^19 and 10^20) (full uint64)
-//
-// Since we only allow for up to what can comfortably fit into the significand
-// ignoring the exponent, and we only try to parse iff significand fits into the
-
-// Exact powers of 10.
-var float64pow10 = [...]float64{
- 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,
- 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,
- 1e20, 1e21, 1e22,
-}
-var float32pow10 = [...]float32{1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10}
-
-type floatinfo struct {
- mantbits uint8
- expbits uint8
- bias int16
-
- exactPow10 int8 // Exact powers of ten are <= 10^N (32: 10, 64: 22)
- exactInts int8 // Exact integers are <= 10^N
-
- maxMantDigits int8 // 10^19 fits in uint64, while 10^9 fits in uint32
-}
-
-var fi32 = floatinfo{23, 8, -127, 10, 7, 9} // maxMantDigits = 9
-var fi64 = floatinfo{52, 11, -1023, 22, 15, 19} // maxMantDigits = 19
-
-const fMax64 = 1e15
-const fMax32 = 1e7
-
-const fBase = 10
-
-func parseFloatErr(b []byte) error {
- return &strconv.NumError{
- Func: "ParseFloat",
- Err: strconv.ErrSyntax,
- Num: string(b),
- }
-}
-
-func parseFloat32_custom(b []byte) (f float32, err error) {
- mantissa, exp, neg, trunc, bad, ok := readFloat(b, fi32)
- _ = trunc
- if bad {
- return 0, parseFloatErr(b)
- }
- if ok {
- // parseFloatDebug(b, 32, false, exp, trunc, ok)
- f = float32(mantissa)
- if neg {
- f = -f
- }
- if exp != 0 {
- indx := fExpIndx(exp)
- if exp < 0 { // int / 10^k
- f /= float32pow10[indx]
- } else { // exp > 0
- if exp > fi32.exactPow10 {
- f *= float32pow10[exp-fi32.exactPow10]
- if f < -fMax32 || f > fMax32 { // exponent too large - outside range
- goto FALLBACK
- }
- indx = uint8(fi32.exactPow10)
- }
- f *= float32pow10[indx]
- }
- }
- return
- }
-FALLBACK:
- // parseFloatDebug(b, 32, true, exp, trunc, ok)
- return parseFloat32_strconv(b)
-}
-
-func parseFloat64_custom(b []byte) (f float64, err error) {
- mantissa, exp, neg, trunc, bad, ok := readFloat(b, fi64)
- _ = trunc
- if bad {
- return 0, parseFloatErr(b)
- }
- if ok {
- f = float64(mantissa)
- if neg {
- f = -f
- }
- if exp != 0 {
- indx := fExpIndx(exp)
- if exp < 0 { // int / 10^k
- f /= float64pow10[indx]
- } else { // exp > 0
- if exp > fi64.exactPow10 {
- f *= float64pow10[exp-fi64.exactPow10]
- if f < -fMax64 || f > fMax64 { // exponent too large - outside range
- goto FALLBACK
- }
- indx = uint8(fi64.exactPow10)
- }
- f *= float64pow10[indx]
- }
- }
- return
- }
-FALLBACK:
- return parseFloat64_strconv(b)
-}
-
-func fExpIndx(v int8) uint8 {
- if v < 0 {
- return uint8(-v)
- }
- return uint8(v)
-}
-
-func readFloat(s []byte, y floatinfo) (mantissa uint64, exp int8, neg, trunc, bad, ok bool) {
- var i uint // make it uint, so that we eliminate bounds checking
- var slen = uint(len(s))
- if slen == 0 {
- bad = true
- return
- }
- switch s[0] {
- case '+':
- i++
- case '-':
- neg = true
- i++
- }
-
- // we considered punting early if string has length > maxMantDigits, but this doesn't account
- // for trailing 0's e.g. 700000000000000000000 can be encoded exactly as it is 7e20
-
- // var sawdot, sawdigits, sawexp bool
- var sawdot, sawexp bool
- var nd, ndMant, dp int8
-L:
- for ; i < slen; i++ {
- switch s[i] {
- case '.':
- if sawdot {
- bad = true
- return
- }
- sawdot = true
- dp = nd
- case '0':
- if nd == 0 { // ignore leading zeros
- dp--
- continue
- }
- nd++
- if ndMant < y.maxMantDigits {
- // mantissa = (mantissa << 1) + (mantissa << 3)
- mantissa *= fBase
- ndMant++
- }
- case '1', '2', '3', '4', '5', '6', '7', '8', '9':
- // sawdigits = true
- nd++
- if ndMant < y.maxMantDigits {
- // mantissa = (mantissa << 1) + (mantissa << 3) + uint64(s[i]-'0')
- mantissa = mantissa*fBase + uint64(s[i]-'0')
- // mantissa *= fBase
- // mantissa += uint64(s[i] - '0')
- ndMant++
- } else {
- trunc = true
- return // break L
- }
- case 'e', 'E':
- sawexp = true
- break L
- default:
- bad = true
- return
- }
- }
- // if !sawdigits {
- // bad = true
- // return
- // }
- if !sawdot {
- dp = nd
- }
-
- if sawexp {
- i++
- if i < slen {
- var eneg bool
- if s[i] == '+' {
- i++
- } else if s[i] == '-' {
- i++
- eneg = true
- }
- if i < slen {
- // for exact match, exponent is 1 or 2 digits (float64: -22 to 37, float32: -1 to 17).
- // exit quick if exponent is more than 2 digits.
- if i+2 < slen {
- return
- }
-
- var e int8
-
- if s[i] < '0' || s[i] > '9' {
- bad = true
- return
- }
- e = e*fBase + int8(s[i]-'0') // (e << 1) + (e << 3) + int8(s[i]-'0')
- i++
-
- if i < slen {
- if s[i] < '0' || s[i] > '9' {
- bad = true
- return
- }
- e = e*fBase + int8(s[i]-'0') // (e << 1) + (e << 3) + int8(s[i]-'0')
- i++
- }
-
- if eneg {
- dp -= e
- } else {
- dp += e
- }
- }
- }
- }
-
- if mantissa != 0 {
- if mantissa>>y.mantbits != 0 {
- return
- }
- exp = dp - ndMant
- if exp < -y.exactPow10 || exp > y.exactInts+y.exactPow10 { // cannot handle it
- return
- }
- }
- ok = true // && !trunc // if trunc=true, we return early (so here trunc=false)
- return
-}
-
-// fMul10ShiftU64
-
-// func parseFloatDebug(b []byte, bitsize int, strconv bool, exp int8, trunc, ok bool) {
-// if strconv {
-// xdebugf("parseFloat%d: delegating: %s, exp: %d, trunc: %v, ok: %v", bitsize, b, exp, trunc, ok)
-// } else {
-// xdebug2f("parseFloat%d: attempting: %s, exp: %d, trunc: %v, ok: %v", bitsize, b, exp, trunc, ok)
-// }
-// }
diff --git a/vendor/github.com/ugorji/go/codec/gen-dec-map.go.tmpl b/vendor/github.com/ugorji/go/codec/gen-dec-map.go.tmpl
index 35bda4a16..a7ce62b59 100644
--- a/vendor/github.com/ugorji/go/codec/gen-dec-map.go.tmpl
+++ b/vendor/github.com/ugorji/go/codec/gen-dec-map.go.tmpl
@@ -8,7 +8,8 @@ if {{var "v"}} == nil {
{{var "v"}} = make(map[{{ .KTyp }}]{{ .Typ }}, {{var "rl"}})
*{{ .Varname }} = {{var "v"}}
}
-var {{var "mk"}} {{ .KTyp }}
+{{ $mk := var "mk" -}}
+var {{ $mk }} {{ .KTyp }}
var {{var "mv"}} {{ .Typ }}
var {{var "mg"}}, {{var "mdn"}} {{if decElemKindPtr}}, {{var "ms"}}, {{var "mok"}}{{end}} bool
if z.DecBasicHandle().MapValueReset {
@@ -20,10 +21,14 @@ if {{var "l"}} != 0 {
{{var "hl"}} := {{var "l"}} > 0
for {{var "j"}} := 0; ({{var "hl"}} && {{var "j"}} < {{var "l"}}) || !({{var "hl"}} || z.DecCheckBreak()); {{var "j"}}++ {
z.DecReadMapElemKey()
- {{ $x := printf "%vmk%v" .TempVar .Rand }}{{ decLineVarK $x -}}
+ {{ if eq .KTyp "string" -}}
+ {{ decLineVarK $mk -}}{{- /* decLineVarKStrZC $mk */ -}}
+ {{ else -}}
+ {{ decLineVarK $mk -}}
+ {{ end -}}
{{ if eq .KTyp "interface{}" }}{{/* // special case if a byte array. */ -}}
if {{var "bv"}}, {{var "bok"}} := {{var "mk"}}.([]byte); {{var "bok"}} {
- {{var "mk"}} = string({{var "bv"}})
+ {{var "mk"}} = z.DecStringZC({{var "bv"}})
}
{{ end -}}
{{if decElemKindPtr -}}
@@ -31,23 +36,23 @@ if {{var "l"}} != 0 {
{{end -}}
if {{var "mg"}} {
{{if decElemKindPtr -}}
- {{var "mv"}}, {{var "mok"}} = {{var "v"}}[{{var "mk"}}]
+ {{var "mv"}}, {{var "mok"}} = {{var "v"}}[{{ $mk }}]
if {{var "mok"}} {
{{var "ms"}} = false
}
{{else -}}
- {{var "mv"}} = {{var "v"}}[{{var "mk"}}]
+ {{var "mv"}} = {{var "v"}}[{{ $mk }}]
{{end -}}
} {{if not decElemKindImmutable}}else { {{var "mv"}} = {{decElemZero}} }{{end}}
z.DecReadMapElemValue()
{{var "mdn"}} = false
{{ $x := printf "%vmv%v" .TempVar .Rand }}{{ $y := printf "%vmdn%v" .TempVar .Rand }}{{ decLineVar $x $y -}}
if {{var "mdn"}} {
- if z.DecBasicHandle().DeleteOnNilMapValue { delete({{var "v"}}, {{var "mk"}}) } else { {{var "v"}}[{{var "mk"}}] = {{decElemZero}} }
- } else if {{if decElemKindPtr}} {{var "ms"}} && {{end}} {{var "v"}} != nil {
- {{var "v"}}[{{var "mk"}}] = {{var "mv"}}
+ {{var "v"}}[{{ $mk }}] = {{decElemZero}}
+ } else {{if decElemKindPtr}} if {{var "ms"}} {{end}} {
+ {{var "v"}}[{{ $mk }}] = {{var "mv"}}
}
}
-} // else len==0: TODO: Should we clear map entries?
+} // else len==0: leave as-is (do not clear map entries)
z.DecReadMapEnd()
}
diff --git a/vendor/github.com/ugorji/go/codec/gen-helper.generated.go b/vendor/github.com/ugorji/go/codec/gen-helper.generated.go
index d86d3af49..5643b6af9 100644
--- a/vendor/github.com/ugorji/go/codec/gen-helper.generated.go
+++ b/vendor/github.com/ugorji/go/codec/gen-helper.generated.go
@@ -1,16 +1,19 @@
// comment this out // + build ignore
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
// Code generated from gen-helper.go.tmpl - DO NOT EDIT.
package codec
-import "encoding"
+import (
+ "encoding"
+ "reflect"
+)
// GenVersion is the current version of codecgen.
-const GenVersion = 16
+const GenVersion = 25
// This file is used to generate helper code for codecgen.
// The values here i.e. genHelper(En|De)coder are not to be used directly by
@@ -18,17 +21,18 @@ const GenVersion = 16
// GenHelperEncoder is exported so that it can be used externally by codecgen.
//
-// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.
-func GenHelperEncoder(e *Encoder) (ge genHelperEncoder, ee genHelperEncDriver) {
+// Library users: DO NOT USE IT DIRECTLY or INDIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.
+func GenHelper() (g genHelper) { return }
+
+type genHelper struct{}
+
+func (genHelper) Encoder(e *Encoder) (ge genHelperEncoder, ee genHelperEncDriver) {
ge = genHelperEncoder{e: e}
ee = genHelperEncDriver{encDriver: e.e}
return
}
-// GenHelperDecoder is exported so that it can be used externally by codecgen.
-//
-// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.
-func GenHelperDecoder(d *Decoder) (gd genHelperDecoder, dd genHelperDecDriver) {
+func (genHelper) Decoder(d *Decoder) (gd genHelperDecoder, dd genHelperDecDriver) {
gd = genHelperDecoder{d: d}
dd = genHelperDecDriver{decDriver: d.d}
return
@@ -44,7 +48,7 @@ type genHelperDecDriver struct {
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
type genHelperEncoder struct {
- M must
+ M mustHdl
F fastpathT
e *Encoder
}
@@ -74,7 +78,7 @@ func (f genHelperEncoder) IsJSONHandle() bool {
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperEncoder) EncFallback(iv interface{}) {
// f.e.encodeI(iv, false, false)
- f.e.encodeValue(rv4i(iv), nil)
+ f.e.encodeValue(reflect.ValueOf(iv), nil)
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
@@ -99,18 +103,13 @@ func (f genHelperEncoder) EncBinaryMarshal(iv encoding.BinaryMarshaler) {
func (f genHelperEncoder) EncRaw(iv Raw) { f.e.rawBytes(iv) }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperEncoder) I2Rtid(v interface{}) uintptr {
- return i2rtid(v)
-}
-
-// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperEncoder) Extension(rtid uintptr) (xfn *extTypeTagFn) {
- return f.e.h.getExt(rtid, true)
+func (f genHelperEncoder) Extension(v interface{}) (xfn *extTypeTagFn) {
+ return f.e.h.getExtForI(v)
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperEncoder) EncExtension(v interface{}, xfFn *extTypeTagFn) {
- f.e.e.EncodeExt(v, xfFn.tag, xfFn.ext)
+ f.e.e.EncodeExt(v, xfFn.rt, xfFn.tag, xfFn.ext)
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
@@ -118,9 +117,6 @@ func (f genHelperEncoder) WriteStr(s string) {
f.e.w().writestr(s)
}
-// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperEncoder) BytesView(v string) []byte { return bytesView(v) }
-
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperEncoder) EncWriteMapStart(length int) { f.e.mapStart(length) }
@@ -142,6 +138,22 @@ func (f genHelperEncoder) EncWriteMapElemKey() { f.e.mapElemKey() }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperEncoder) EncWriteMapElemValue() { f.e.mapElemValue() }
+// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+func (f genHelperEncoder) EncEncodeComplex64(v complex64) { f.e.encodeComplex64(v) }
+
+// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+func (f genHelperEncoder) EncEncodeComplex128(v complex128) { f.e.encodeComplex128(v) }
+
+// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+func (f genHelperEncoder) EncEncode(v interface{}) { f.e.encode(v) }
+
+// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+func (f genHelperEncoder) EncEncodeMapNonNil(v interface{}) {
+ if skipFastpathTypeSwitchInDirectCall || !fastpathEncodeTypeSwitch(v, f.e) {
+ f.e.encodeValue(reflect.ValueOf(v), nil)
+ }
+}
+
// ---------------- DECODER FOLLOWS -----------------
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
@@ -157,10 +169,10 @@ func (f genHelperDecoder) DecBinary() bool {
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecSwallow() { f.d.swallow() }
-// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperDecoder) DecScratchBuffer() []byte {
- return f.d.b[:]
-}
+// // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+// func (f genHelperDecoder) DecScratchBuffer() []byte {
+// return f.d.b[:]
+// }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecScratchArrayBuffer() *[decScratchByteArrayLen]byte {
@@ -169,9 +181,11 @@ func (f genHelperDecoder) DecScratchArrayBuffer() *[decScratchByteArrayLen]byte
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecFallback(iv interface{}, chkPtr bool) {
- rv := rv4i(iv)
+ rv := reflect.ValueOf(iv)
if chkPtr {
- f.d.ensureDecodeable(rv)
+ if x, _ := isDecodeable(rv); !x {
+ f.d.haltAsNotDecodeable(rv)
+ }
}
f.d.decodeValue(rv, nil)
}
@@ -193,25 +207,17 @@ func (f genHelperDecoder) DecArrayCannotExpand(sliceLen, streamLen int) {
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecTextUnmarshal(tm encoding.TextUnmarshaler) {
- if fnerr := tm.UnmarshalText(f.d.d.DecodeStringAsBytes()); fnerr != nil {
- panic(fnerr)
- }
+ halt.onerror(tm.UnmarshalText(f.d.d.DecodeStringAsBytes()))
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecJSONUnmarshal(tm jsonUnmarshaler) {
- // bs := f.dd.DecodeStringAsBytes()
- // grab the bytes to be read, as UnmarshalJSON needs the full JSON so as to unmarshal it itself.
- if fnerr := tm.UnmarshalJSON(f.d.nextValueBytes()); fnerr != nil {
- panic(fnerr)
- }
+ f.d.jsonUnmarshalV(tm)
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecBinaryUnmarshal(bm encoding.BinaryUnmarshaler) {
- if fnerr := bm.UnmarshalBinary(f.d.d.DecodeBytes(nil, true)); fnerr != nil {
- panic(fnerr)
- }
+ halt.onerror(bm.UnmarshalBinary(f.d.d.DecodeBytes(nil)))
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
@@ -223,18 +229,13 @@ func (f genHelperDecoder) IsJSONHandle() bool {
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperDecoder) I2Rtid(v interface{}) uintptr {
- return i2rtid(v)
-}
-
-// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperDecoder) Extension(rtid uintptr) (xfn *extTypeTagFn) {
- return f.d.h.getExt(rtid, true)
+func (f genHelperDecoder) Extension(v interface{}) (xfn *extTypeTagFn) {
+ return f.d.h.getExtForI(v)
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecExtension(v interface{}, xfFn *extTypeTagFn) {
- f.d.d.DecodeExt(v, xfFn.tag, xfFn.ext)
+ f.d.d.DecodeExt(v, xfFn.rt, xfFn.tag, xfFn.ext)
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
@@ -243,16 +244,13 @@ func (f genHelperDecoder) DecInferLen(clen, maxlen, unit int) (rvlen int) {
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperDecoder) StringView(v []byte) string { return stringView(v) }
-
-// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperDecoder) DecReadMapStart() int { return f.d.mapStart() }
+func (f genHelperDecoder) DecReadMapStart() int { return f.d.mapStart(f.d.d.ReadMapStart()) }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecReadMapEnd() { f.d.mapEnd() }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperDecoder) DecReadArrayStart() int { return f.d.arrayStart() }
+func (f genHelperDecoder) DecReadArrayStart() int { return f.d.arrayStart(f.d.d.ReadArrayStart()) }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecReadArrayEnd() { f.d.arrayEnd() }
@@ -271,3 +269,9 @@ func (f genHelperDecoder) DecDecodeFloat32() float32 { return f.d.decodeFloat32(
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecCheckBreak() bool { return f.d.checkBreak() }
+
+// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+func (f genHelperDecoder) DecStringZC(v []byte) string { return f.d.stringZC(v) }
+
+// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+func (f genHelperDecoder) DecodeBytesInto(v []byte) []byte { return f.d.decodeBytesInto(v) }
diff --git a/vendor/github.com/ugorji/go/codec/gen-helper.go.tmpl b/vendor/github.com/ugorji/go/codec/gen-helper.go.tmpl
index 446523316..1f1339684 100644
--- a/vendor/github.com/ugorji/go/codec/gen-helper.go.tmpl
+++ b/vendor/github.com/ugorji/go/codec/gen-helper.go.tmpl
@@ -1,13 +1,16 @@
// comment this out // + build ignore
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
// Code generated from gen-helper.go.tmpl - DO NOT EDIT.
package codec
-import "encoding"
+import (
+ "encoding"
+ "reflect"
+)
// GenVersion is the current version of codecgen.
const GenVersion = {{ .Version }}
@@ -26,17 +29,18 @@ const GenVersion = {{ .Version }}
// GenHelperEncoder is exported so that it can be used externally by codecgen.
//
-// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.
-func GenHelperEncoder(e *Encoder) (ge genHelperEncoder, ee genHelperEncDriver) {
+// Library users: DO NOT USE IT DIRECTLY or INDIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.
+func GenHelper() (g genHelper) { return }
+
+type genHelper struct {}
+
+func (genHelper) Encoder(e *Encoder) (ge genHelperEncoder, ee genHelperEncDriver) {
ge = genHelperEncoder{e: e}
ee = genHelperEncDriver{encDriver: e.e}
return
}
-// GenHelperDecoder is exported so that it can be used externally by codecgen.
-//
-// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.
-func GenHelperDecoder(d *Decoder) (gd genHelperDecoder, dd genHelperDecDriver) {
+func (genHelper) Decoder(d *Decoder) (gd genHelperDecoder, dd genHelperDecDriver) {
gd = genHelperDecoder{d: d}
dd = genHelperDecDriver{decDriver: d.d}
return
@@ -52,7 +56,7 @@ type genHelperDecDriver struct {
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
type genHelperEncoder struct {
- M must
+ M mustHdl
F fastpathT
e *Encoder
}
@@ -79,7 +83,7 @@ func (f genHelperEncoder) IsJSONHandle() bool {
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperEncoder) EncFallback(iv interface{}) {
// f.e.encodeI(iv, false, false)
- f.e.encodeValue(rv4i(iv), nil)
+ f.e.encodeValue(reflect.ValueOf(iv), nil)
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperEncoder) EncTextMarshal(iv encoding.TextMarshaler) {
@@ -100,24 +104,17 @@ func (f genHelperEncoder) EncBinaryMarshal(iv encoding.BinaryMarshaler) {
func (f genHelperEncoder) EncRaw(iv Raw) { f.e.rawBytes(iv) }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperEncoder) I2Rtid(v interface{}) uintptr {
- return i2rtid(v)
-}
-// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperEncoder) Extension(rtid uintptr) (xfn *extTypeTagFn) {
- return f.e.h.getExt(rtid, true)
+func (f genHelperEncoder) Extension(v interface{}) (xfn *extTypeTagFn) {
+ return f.e.h.getExtForI(v)
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperEncoder) EncExtension(v interface{}, xfFn *extTypeTagFn) {
- f.e.e.EncodeExt(v, xfFn.tag, xfFn.ext)
+ f.e.e.EncodeExt(v, xfFn.rt, xfFn.tag, xfFn.ext)
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperEncoder) WriteStr(s string) {
f.e.w().writestr(s)
}
-// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperEncoder) BytesView(v string) []byte { return bytesView(v) }
-
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperEncoder) EncWriteMapStart(length int) { f.e.mapStart(length) }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
@@ -132,6 +129,18 @@ func (f genHelperEncoder) EncWriteArrayElem() { f.e.arrayElem() }
func (f genHelperEncoder) EncWriteMapElemKey() { f.e.mapElemKey() }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperEncoder) EncWriteMapElemValue() { f.e.mapElemValue() }
+// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+func (f genHelperEncoder) EncEncodeComplex64(v complex64) { f.e.encodeComplex64(v) }
+// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+func (f genHelperEncoder) EncEncodeComplex128(v complex128) { f.e.encodeComplex128(v) }
+// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+func (f genHelperEncoder) EncEncode(v interface{}) { f.e.encode(v) }
+// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+func (f genHelperEncoder) EncEncodeMapNonNil(v interface{}) {
+ if skipFastpathTypeSwitchInDirectCall || !fastpathEncodeTypeSwitch(v, f.e) {
+ f.e.encodeValue(reflect.ValueOf(v), nil)
+ }
+}
// ---------------- DECODER FOLLOWS -----------------
@@ -145,19 +154,23 @@ func (f genHelperDecoder) DecBinary() bool {
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecSwallow() { f.d.swallow() }
-// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperDecoder) DecScratchBuffer() []byte {
- return f.d.b[:]
-}
+
+// // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+// func (f genHelperDecoder) DecScratchBuffer() []byte {
+// return f.d.b[:]
+// }
+
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecScratchArrayBuffer() *[decScratchByteArrayLen]byte {
return &f.d.b
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecFallback(iv interface{}, chkPtr bool) {
- rv := rv4i(iv)
+ rv := reflect.ValueOf(iv)
if chkPtr {
- f.d.ensureDecodeable(rv)
+ if x, _ := isDecodeable(rv); !x {
+ f.d.haltAsNotDecodeable(rv)
+ }
}
f.d.decodeValue(rv, nil)
}
@@ -175,23 +188,15 @@ func (f genHelperDecoder) DecArrayCannotExpand(sliceLen, streamLen int) {
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecTextUnmarshal(tm encoding.TextUnmarshaler) {
- if fnerr := tm.UnmarshalText(f.d.d.DecodeStringAsBytes()); fnerr != nil {
- panic(fnerr)
- }
+ halt.onerror(tm.UnmarshalText(f.d.d.DecodeStringAsBytes()))
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecJSONUnmarshal(tm jsonUnmarshaler) {
- // bs := f.dd.DecodeStringAsBytes()
- // grab the bytes to be read, as UnmarshalJSON needs the full JSON so as to unmarshal it itself.
- if fnerr := tm.UnmarshalJSON(f.d.nextValueBytes()); fnerr != nil {
- panic(fnerr)
- }
+ f.d.jsonUnmarshalV(tm)
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecBinaryUnmarshal(bm encoding.BinaryUnmarshaler) {
- if fnerr := bm.UnmarshalBinary(f.d.d.DecodeBytes(nil, true)); fnerr != nil {
- panic(fnerr)
- }
+ halt.onerror(bm.UnmarshalBinary(f.d.d.DecodeBytes(nil)))
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecRaw() []byte { return f.d.rawBytes() }
@@ -200,31 +205,31 @@ func (f genHelperDecoder) DecRaw() []byte { return f.d.rawBytes() }
func (f genHelperDecoder) IsJSONHandle() bool {
return f.d.js
}
+{{/*
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) I2Rtid(v interface{}) uintptr {
return i2rtid(v)
}
+*/ -}}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperDecoder) Extension(rtid uintptr) (xfn *extTypeTagFn) {
- return f.d.h.getExt(rtid, true)
+func (f genHelperDecoder) Extension(v interface{}) (xfn *extTypeTagFn) {
+ return f.d.h.getExtForI(v)
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecExtension(v interface{}, xfFn *extTypeTagFn) {
- f.d.d.DecodeExt(v, xfFn.tag, xfFn.ext)
+ f.d.d.DecodeExt(v, xfFn.rt, xfFn.tag, xfFn.ext)
}
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecInferLen(clen, maxlen, unit int) (rvlen int) {
return decInferLen(clen, maxlen, unit)
}
-// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperDecoder) StringView(v []byte) string { return stringView(v) }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperDecoder) DecReadMapStart() int { return f.d.mapStart() }
+func (f genHelperDecoder) DecReadMapStart() int { return f.d.mapStart(f.d.d.ReadMapStart()) }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecReadMapEnd() { f.d.mapEnd() }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
-func (f genHelperDecoder) DecReadArrayStart() int { return f.d.arrayStart() }
+func (f genHelperDecoder) DecReadArrayStart() int { return f.d.arrayStart(f.d.d.ReadArrayStart()) }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecReadArrayEnd() { f.d.arrayEnd() }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
@@ -238,4 +243,7 @@ func (f genHelperDecoder) DecReadMapElemValue() { f.d.mapElemValue() }
func (f genHelperDecoder) DecDecodeFloat32() float32 { return f.d.decodeFloat32() }
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
func (f genHelperDecoder) DecCheckBreak() bool { return f.d.checkBreak() }
-
+// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+func (f genHelperDecoder) DecStringZC(v []byte) string { return f.d.stringZC(v) }
+// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
+func (f genHelperDecoder) DecodeBytesInto(v []byte) []byte { return f.d.decodeBytesInto(v) }
diff --git a/vendor/github.com/ugorji/go/codec/gen.generated.go b/vendor/github.com/ugorji/go/codec/gen.generated.go
index 5aca5a488..e72d00305 100644
--- a/vendor/github.com/ugorji/go/codec/gen.generated.go
+++ b/vendor/github.com/ugorji/go/codec/gen.generated.go
@@ -1,6 +1,6 @@
// +build codecgen.exec
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
@@ -18,7 +18,8 @@ if {{var "v"}} == nil {
{{var "v"}} = make(map[{{ .KTyp }}]{{ .Typ }}, {{var "rl"}})
*{{ .Varname }} = {{var "v"}}
}
-var {{var "mk"}} {{ .KTyp }}
+{{ $mk := var "mk" -}}
+var {{ $mk }} {{ .KTyp }}
var {{var "mv"}} {{ .Typ }}
var {{var "mg"}}, {{var "mdn"}} {{if decElemKindPtr}}, {{var "ms"}}, {{var "mok"}}{{end}} bool
if z.DecBasicHandle().MapValueReset {
@@ -30,10 +31,14 @@ if {{var "l"}} != 0 {
{{var "hl"}} := {{var "l"}} > 0
for {{var "j"}} := 0; ({{var "hl"}} && {{var "j"}} < {{var "l"}}) || !({{var "hl"}} || z.DecCheckBreak()); {{var "j"}}++ {
z.DecReadMapElemKey()
- {{ $x := printf "%vmk%v" .TempVar .Rand }}{{ decLineVarK $x -}}
+ {{ if eq .KTyp "string" -}}
+ {{ decLineVarK $mk -}}{{- /* decLineVarKStrZC $mk */ -}}
+ {{ else -}}
+ {{ decLineVarK $mk -}}
+ {{ end -}}
{{ if eq .KTyp "interface{}" }}{{/* // special case if a byte array. */ -}}
if {{var "bv"}}, {{var "bok"}} := {{var "mk"}}.([]byte); {{var "bok"}} {
- {{var "mk"}} = string({{var "bv"}})
+ {{var "mk"}} = z.DecStringZC({{var "bv"}})
}
{{ end -}}
{{if decElemKindPtr -}}
@@ -41,24 +46,24 @@ if {{var "l"}} != 0 {
{{end -}}
if {{var "mg"}} {
{{if decElemKindPtr -}}
- {{var "mv"}}, {{var "mok"}} = {{var "v"}}[{{var "mk"}}]
+ {{var "mv"}}, {{var "mok"}} = {{var "v"}}[{{ $mk }}]
if {{var "mok"}} {
{{var "ms"}} = false
}
{{else -}}
- {{var "mv"}} = {{var "v"}}[{{var "mk"}}]
+ {{var "mv"}} = {{var "v"}}[{{ $mk }}]
{{end -}}
} {{if not decElemKindImmutable}}else { {{var "mv"}} = {{decElemZero}} }{{end}}
z.DecReadMapElemValue()
{{var "mdn"}} = false
{{ $x := printf "%vmv%v" .TempVar .Rand }}{{ $y := printf "%vmdn%v" .TempVar .Rand }}{{ decLineVar $x $y -}}
if {{var "mdn"}} {
- if z.DecBasicHandle().DeleteOnNilMapValue { delete({{var "v"}}, {{var "mk"}}) } else { {{var "v"}}[{{var "mk"}}] = {{decElemZero}} }
- } else if {{if decElemKindPtr}} {{var "ms"}} && {{end}} {{var "v"}} != nil {
- {{var "v"}}[{{var "mk"}}] = {{var "mv"}}
+ {{var "v"}}[{{ $mk }}] = {{decElemZero}}
+ } else {{if decElemKindPtr}} if {{var "ms"}} {{end}} {
+ {{var "v"}}[{{ $mk }}] = {{var "mv"}}
}
}
-} // else len==0: TODO: Should we clear map entries?
+} // else len==0: leave as-is (do not clear map entries)
z.DecReadMapEnd()
}
`
diff --git a/vendor/github.com/ugorji/go/codec/gen.go b/vendor/github.com/ugorji/go/codec/gen.go
index 3573bc32e..8c5bbf201 100644
--- a/vendor/github.com/ugorji/go/codec/gen.go
+++ b/vendor/github.com/ugorji/go/codec/gen.go
@@ -1,8 +1,9 @@
-// +build codecgen.exec
-
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build codecgen.exec
+// +build codecgen.exec
+
package codec
import (
@@ -14,6 +15,7 @@ import (
"io"
"io/ioutil"
"math/rand"
+ "os"
"reflect"
"regexp"
"sort"
@@ -22,6 +24,7 @@ import (
"sync"
"text/template"
"time"
+ // "ugorji.net/zz"
"unicode"
"unicode/utf8"
)
@@ -38,11 +41,17 @@ import (
// In those areas, we try to only do reflection or interface-conversion when NECESSARY:
// - Extensions, only if Extensions are configured.
//
-// However, codecgen doesn't support the following:
-// - Canonical option. (codecgen IGNORES it currently)
-// This is just because it has not been implemented.
+// However, note following codecgen caveats:
+// - Canonical option.
+// If Canonical=true, codecgen'ed code will delegate encoding maps to reflection-based code.
+// This is due to the runtime work needed to marshal a map in canonical mode.
+// - CheckCircularRef option.
+// When encoding a struct, a circular reference can lead to a stack overflow.
+// If CheckCircularRef=true, codecgen'ed code will delegate encoding structs to reflection-based code.
// - MissingFielder implementation.
-// If a type implements MissingFielder, it is completely ignored by codecgen.
+// If a type implements MissingFielder, a Selfer is not generated (with a warning message).
+// Statically reproducing the runtime work needed to extract the missing fields and marshal them along with the struct fields,
+// while handling the Canonical=true special case, was onerous to implement.
//
// During encode/decode, Selfer takes precedence.
// A type implementing Selfer will know how to encode/decode itself statically.
@@ -86,23 +95,42 @@ import (
//
// Note:
// codecgen-generated code depends on the variables defined by fast-path.generated.go.
-// consequently, you cannot run with tags "codecgen notfastpath".
+// consequently, you cannot run with tags "codecgen codec.notfastpath".
+//
+// Note:
+// genInternalXXX functions are used for generating fast-path and other internally generated
+// files, and not for use in codecgen.
+
+// Size of a struct or value is not portable across machines, especially across 32-bit vs 64-bit
+// operating systems. This is due to types like int, uintptr, pointers, (and derived types like slice), etc
+// which use the natural word size on those machines, which may be 4 bytes (on 32-bit) or 8 bytes (on 64-bit).
+//
+// Within decInferLen calls, we may generate an explicit size of the entry.
+// We do this because decInferLen values are expected to be approximate,
+// and serve as a good hint on the size of the elements or key+value entry.
+//
+// Since development is done on 64-bit machines, the sizes will be roughly correctly
+// on 64-bit OS, and slightly larger than expected on 32-bit OS.
+// This is ok.
+//
+// For reference, look for 'Size' in fast-path.go.tmpl, gen-dec-(array|map).go.tmpl and gen.go (this file).
// GenVersion is the current version of codecgen.
//
-// NOTE: Increment this value each time codecgen changes fundamentally.
+// MARKER: Increment this value each time codecgen changes fundamentally.
+// Also update codecgen/gen.go (minimumCodecVersion, genVersion, etc).
// Fundamental changes are:
// - helper methods change (signature change, new ones added, some removed, etc)
// - codecgen command line changes
//
// v1: Initial Version
-// v2:
+// v2: -
// v3: Changes for Kubernetes:
// changes in signature of some unpublished helper methods and codecgen cmdline arguments.
// v4: Removed separator support from (en|de)cDriver, and refactored codec(gen)
// v5: changes to support faster json decoding. Let encoder/decoder maintain state of collections.
// v6: removed unsafe from gen, and now uses codecgen.exec tag
-// v7:
+// v7: -
// v8: current - we now maintain compatibility with old generated code.
// v9: skipped
// v10: modified encDriver and decDriver interfaces.
@@ -112,10 +140,19 @@ import (
// v14: 20190611 refactored nil handling: TryDecodeAsNil -> selective TryNil, etc
// v15: 20190626 encDriver.EncodeString handles StringToRaw flag inside handle
// v16: 20190629 refactoring for v1.1.6
-const genVersion = 16
+// v17: 20200911 reduce number of types for which we generate fast path functions (v1.1.8)
+// v18: 20201004 changed definition of genHelper...Extension (to take interface{}) and eliminated I2Rtid method
+// v19: 20201115 updated codecgen cmdline flags and optimized output
+// v20: 20201120 refactored GenHelper to one exported function
+// v21: 20210104 refactored generated code to honor ZeroCopy=true for more efficiency
+// v22: 20210118 fixed issue in generated code when encoding a type which is also a codec.Selfer
+// v23: 20210203 changed slice/map types for which we generate fast-path functions
+// v24: 20210226 robust handling for Canonical|CheckCircularRef flags and MissingFielder implementations
+// v25: 20210406 pass base reflect.Type to side(En|De)code and (En|De)codeExt calls
+const genVersion = 25
const (
- genCodecPkg = "codec1978"
+ genCodecPkg = "codec1978" // MARKER: keep in sync with codecgen/gen.go
genTempVarPfx = "yy"
genTopLevelVarName = "x"
@@ -130,11 +167,15 @@ const (
// From testing, it didn't make much difference in runtime, so keep as true (one function only)
genUseOneFunctionForDecStructMap = true
+ // genStructCanonical configures whether we generate 2 paths based on Canonical flag
+ // when encoding struct fields.
+ genStructCanonical = false
+
// genFastpathCanonical configures whether we support Canonical in fast path.
// The savings is not much.
//
- // NOTE: This MUST ALWAYS BE TRUE. fast-path.go.tmp doesn't handle it being false.
- genFastpathCanonical = true // MUST be true
+ // MARKER: This MUST ALWAYS BE TRUE. fast-path.go.tmp doesn't handle it being false.
+ genFastpathCanonical = true
// genFastpathTrimTypes configures whether we trim uncommon fastpath types.
genFastpathTrimTypes = true
@@ -147,6 +188,12 @@ const (
)
type genStructMapStyle uint8
+type genStringDecAsBytes string
+type genStringDecZC string
+
+var genStringDecAsBytesTyp = reflect.TypeOf(genStringDecAsBytes(""))
+var genStringDecZCTyp = reflect.TypeOf(genStringDecZC(""))
+var genFormats = []string{"Json", "Cbor", "Msgpack", "Binc", "Simple"}
const (
genStructMapStyleConsolidated genStructMapStyle = iota
@@ -155,8 +202,9 @@ const (
)
var (
- errGenAllTypesSamePkg = errors.New("All types must be in the same package")
- errGenExpectArrayOrMap = errors.New("unexpected type. Expecting array/map/slice")
+ errGenAllTypesSamePkg = errors.New("All types must be in the same package")
+ errGenExpectArrayOrMap = errors.New("unexpected type - expecting array/map/slice")
+ errGenUnexpectedTypeFastpath = errors.New("fast-path: unexpected type - requires map or slice")
genBase64enc = base64.NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789__")
genQNameRegex = regexp.MustCompile(`[A-Za-z_.]+`)
@@ -166,6 +214,14 @@ type genBuf struct {
buf []byte
}
+func (x *genBuf) sIf(b bool, s, t string) *genBuf {
+ if b {
+ x.buf = append(x.buf, s...)
+ } else {
+ x.buf = append(x.buf, t...)
+ }
+ return x
+}
func (x *genBuf) s(s string) *genBuf { x.buf = append(x.buf, s...); return x }
func (x *genBuf) b(s []byte) *genBuf { x.buf = append(x.buf, s...); return x }
func (x *genBuf) v() string { return string(x.buf) }
@@ -186,7 +242,9 @@ type genRunner struct {
tc reflect.Type // currently running selfer on this type
te map[uintptr]bool // types for which the encoder has been created
td map[uintptr]bool // types for which the decoder has been created
- cp string // codec import path
+ tz map[uintptr]bool // types for which GenIsZero has been created
+
+ cp string // codec import path
im map[string]reflect.Type // imports to add
imn map[string]string // package names of imports to add
@@ -197,6 +255,7 @@ type genRunner struct {
cpfx string // codec package prefix
+ ty map[reflect.Type]struct{} // types for which GenIsZero *should* be created
tm map[reflect.Type]struct{} // types for which enc/dec must be generated
ts []reflect.Type // types for which enc/dec must be generated
@@ -206,6 +265,8 @@ type genRunner struct {
ti *TypeInfos
// rr *rand.Rand // random generator for file-specific types
+ jsonOnlyWhen, toArrayWhen, omitEmptyWhen *bool
+
nx bool // no extensions
}
@@ -238,28 +299,35 @@ func (g *genIfClause) c(last bool) (v string) {
//
// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINUOUSLY WITHOUT NOTICE.
func Gen(w io.Writer, buildTags, pkgName, uid string, noExtensions bool,
- ti *TypeInfos, typ ...reflect.Type) {
+ jsonOnlyWhen, toArrayWhen, omitEmptyWhen *bool,
+ ti *TypeInfos, types ...reflect.Type) (warnings []string) {
// All types passed to this method do not have a codec.Selfer method implemented directly.
// codecgen already checks the AST and skips any types that define the codec.Selfer methods.
// Consequently, there's no need to check and trim them if they implement codec.Selfer
- if len(typ) == 0 {
+ if len(types) == 0 {
return
}
x := genRunner{
- w: w,
- t: typ,
- te: make(map[uintptr]bool),
- td: make(map[uintptr]bool),
- im: make(map[string]reflect.Type),
- imn: make(map[string]string),
- is: make(map[reflect.Type]struct{}),
- tm: make(map[reflect.Type]struct{}),
- ts: []reflect.Type{},
- bp: genImportPath(typ[0]),
- xs: uid,
- ti: ti,
- nx: noExtensions,
+ w: w,
+ t: types,
+ te: make(map[uintptr]bool),
+ td: make(map[uintptr]bool),
+ tz: make(map[uintptr]bool),
+ im: make(map[string]reflect.Type),
+ imn: make(map[string]string),
+ is: make(map[reflect.Type]struct{}),
+ tm: make(map[reflect.Type]struct{}),
+ ty: make(map[reflect.Type]struct{}),
+ ts: []reflect.Type{},
+ bp: genImportPath(types[0]),
+ xs: uid,
+ ti: ti,
+ jsonOnlyWhen: jsonOnlyWhen,
+ toArrayWhen: toArrayWhen,
+ omitEmptyWhen: omitEmptyWhen,
+
+ nx: noExtensions,
}
if x.ti == nil {
x.ti = defTypeInfos
@@ -272,13 +340,26 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, noExtensions bool,
// gather imports first:
x.cp = genImportPath(reflect.TypeOf(x))
x.imn[x.cp] = genCodecPkg
- for _, t := range typ {
- // fmt.Printf("###########: PkgPath: '%v', Name: '%s'\n", genImportPath(t), t.Name())
+
+ // iterate, check if all in same package, and remove any missingfielders
+ for i := 0; i < len(x.t); {
+ t := x.t[i]
+ // xdebugf("###########: PkgPath: '%v', Name: '%s'\n", genImportPath(t), t.Name())
if genImportPath(t) != x.bp {
- panic(errGenAllTypesSamePkg)
+ halt.onerror(errGenAllTypesSamePkg)
+ }
+ ti1 := x.ti.get(rt2id(t), t)
+ if ti1.flagMissingFielder || ti1.flagMissingFielderPtr {
+ // output diagnostic message - that nothing generated for this type
+ warnings = append(warnings, fmt.Sprintf("type: '%v' not generated; implements codec.MissingFielder", t))
+ copy(x.t[i:], x.t[i+1:])
+ x.t = x.t[:len(x.t)-1]
+ continue
}
x.genRefPkgs(t)
+ i++
}
+
x.line("// +build go1.6")
if buildTags != "" {
x.line("// +build " + buildTags)
@@ -331,10 +412,10 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, noExtensions bool,
}
x.linef("codecSelferBitsize%s = uint8(32 << (^uint(0) >> 63))", x.xs)
- x.linef("codecSelferDecContainerLenNil%s = %d", x.xs, int64(decContainerLenNil))
+ x.linef("codecSelferDecContainerLenNil%s = %d", x.xs, int64(containerLenNil))
x.line(")")
x.line("var (")
- x.line("errCodecSelferOnlyMapOrArrayEncodeToStruct" + x.xs + " = " + "\nerrors.New(`only encoded map or array can be decoded into a struct`)")
+ x.line("errCodecSelferOnlyMapOrArrayEncodeToStruct" + x.xs + " = " + "errors.New(`only encoded map or array can be decoded into a struct`)")
x.line(")")
x.line("")
@@ -342,13 +423,14 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, noExtensions bool,
x.line("type " + x.hn + " struct{}")
x.line("")
x.linef("func %sFalse() bool { return false }", x.hn)
+ x.linef("func %sTrue() bool { return true }", x.hn)
x.line("")
x.varsfxreset()
x.line("func init() {")
x.linef("if %sGenVersion != %v {", x.cpfx, genVersion)
x.line("_, file, _, _ := runtime.Caller(0)")
x.linef("ver := strconv.FormatInt(int64(%sGenVersion), 10)", x.cpfx)
- x.outf(`panic("codecgen version mismatch: current: %v, need " + ver + ". Re-generate file: " + file)`, genVersion)
+ x.outf(`panic(errors.New("codecgen version mismatch: current: %v, need " + ver + ". Re-generate file: " + file))`, genVersion)
x.linef("}")
if len(imKeys) > 0 {
x.line("if false { // reference the types, but skip this branch at build/run time")
@@ -362,10 +444,12 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, noExtensions bool,
x.line("")
// generate rest of type info
- for _, t := range typ {
+ for _, t := range x.t {
x.tc = t
+ x.linef("func (%s) codecSelferViaCodecgen() {}", x.genTypeName(t))
x.selfer(true)
x.selfer(false)
+ x.tryGenIsZero(t)
}
for _, t := range x.ts {
@@ -380,7 +464,7 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, noExtensions bool,
case reflect.Map:
x.encMapFallback("v", t)
default:
- panic(errGenExpectArrayOrMap)
+ halt.onerror(errGenExpectArrayOrMap)
}
x.line("}")
x.line("")
@@ -395,13 +479,19 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, noExtensions bool,
case reflect.Map:
x.decMapFallback("v", rtid, t)
default:
- panic(errGenExpectArrayOrMap)
+ halt.onerror(errGenExpectArrayOrMap)
}
x.line("}")
x.line("")
}
+ for t := range x.ty {
+ x.tryGenIsZero(t)
+ x.line("")
+ }
+
x.line("")
+ return
}
func (x *genRunner) checkForSelfer(t reflect.Type, varname string) bool {
@@ -420,9 +510,9 @@ func (x *genRunner) arr2str(t reflect.Type, s string) string {
func (x *genRunner) genRequiredMethodVars(encode bool) {
x.line("var h " + x.hn)
if encode {
- x.line("z, r := " + x.cpfx + "GenHelperEncoder(e)")
+ x.line("z, r := " + x.cpfx + "GenHelper().Encoder(e)")
} else {
- x.line("z, r := " + x.cpfx + "GenHelperDecoder(d)")
+ x.line("z, r := " + x.cpfx + "GenHelper().Decoder(d)")
}
x.line("_, _, _ = h, z, r")
}
@@ -468,6 +558,15 @@ func (x *genRunner) sayFalse() string {
return "false"
}
+// sayFalse will either say "true" or use a function call that returns true.
+func (x *genRunner) sayTrue() string {
+ x.f++
+ if x.f%2 == 0 {
+ return x.hn + "True()"
+ }
+ return "true"
+}
+
func (x *genRunner) varsfx() string {
x.c++
return strconv.FormatUint(x.c, 10)
@@ -479,16 +578,12 @@ func (x *genRunner) varsfxreset() {
func (x *genRunner) out(s string) {
_, err := io.WriteString(x.w, s)
- if err != nil {
- panic(err)
- }
+ genCheckErr(err)
}
func (x *genRunner) outf(s string, params ...interface{}) {
_, err := fmt.Fprintf(x.w, s, params...)
- if err != nil {
- panic(err)
- }
+ genCheckErr(err)
}
func (x *genRunner) line(s string) {
@@ -512,8 +607,6 @@ func (x *genRunner) linef(s string, params ...interface{}) {
}
func (x *genRunner) genTypeName(t reflect.Type) (n string) {
- // defer func() { xdebugf(">>>> ####: genTypeName: t: %v, name: '%s'\n", t, n) }()
-
// if the type has a PkgPath, which doesn't match the current package,
// then include it.
// We cannot depend on t.String() because it includes current package,
@@ -577,8 +670,55 @@ func (x *genRunner) genMethodNameT(t reflect.Type) (s string) {
return genMethodNameT(t, x.tc)
}
+func (x *genRunner) tryGenIsZero(t reflect.Type) (done bool) {
+ if t.Kind() != reflect.Struct || t.Implements(isCodecEmptyerTyp) {
+ return
+ }
+
+ rtid := rt2id(t)
+
+ if _, ok := x.tz[rtid]; ok {
+ delete(x.ty, t)
+ return
+ }
+
+ x.tz[rtid] = true
+ delete(x.ty, t)
+
+ ti := x.ti.get(rtid, t)
+ tisfi := ti.sfi.source() // always use sequence from file. decStruct expects same thing.
+ varname := genTopLevelVarName
+
+ x.linef("func (%s *%s) IsCodecEmpty() bool {", varname, x.genTypeName(t))
+
+ anonSeen := make(map[reflect.Type]bool)
+ var omitline genBuf
+ for _, si := range tisfi {
+ if si.path.parent != nil {
+ root := si.path.root()
+ if anonSeen[root.typ] {
+ continue
+ }
+ anonSeen[root.typ] = true
+ }
+ t2 := genOmitEmptyLinePreChecks(varname, t, si, &omitline, true)
+ // if Ptr, we already checked if nil above
+ if t2.Type.Kind() != reflect.Ptr {
+ x.doEncOmitEmptyLine(t2, varname, &omitline)
+ omitline.s(" || ")
+ }
+ }
+ omitline.s(" false")
+ x.linef("return !(%s)", omitline.v())
+
+ x.line("}")
+ x.line("")
+ return true
+}
+
func (x *genRunner) selfer(encode bool) {
t := x.tc
+ // ti := x.ti.get(rt2id(t), t)
t0 := t
// always make decode use a pointer receiver,
// and structs/arrays always use a ptr receiver (encode|decode)
@@ -598,6 +738,9 @@ func (x *genRunner) selfer(encode bool) {
if encode {
x.line(") CodecEncodeSelf(e *" + x.cpfx + "Encoder) {")
x.genRequiredMethodVars(true)
+ if t0.Kind() == reflect.Struct {
+ x.linef("if z.EncBasicHandle().CheckCircularRef { z.EncEncode(%s); return }", genTopLevelVarName)
+ }
x.encVar(genTopLevelVarName, t)
} else {
x.line(") CodecDecodeSelf(d *" + x.cpfx + "Decoder) {")
@@ -650,7 +793,7 @@ func (x *genRunner) selfer(encode bool) {
}
// used for chan, array, slice, map
-func (x *genRunner) xtraSM(varname string, t reflect.Type, encode, isptr bool) {
+func (x *genRunner) xtraSM(varname string, t reflect.Type, ti *typeInfo, encode, isptr bool) {
var ptrPfx, addrPfx string
if isptr {
ptrPfx = "*"
@@ -662,28 +805,38 @@ func (x *genRunner) xtraSM(varname string, t reflect.Type, encode, isptr bool) {
} else {
x.linef("h.dec%s((*%s)(%s%s), d)", x.genMethodNameT(t), x.genTypeName(t), addrPfx, varname)
}
- x.registerXtraT(t)
+ x.registerXtraT(t, ti)
}
-func (x *genRunner) registerXtraT(t reflect.Type) {
+func (x *genRunner) registerXtraT(t reflect.Type, ti *typeInfo) {
// recursively register the types
+ tk := t.Kind()
+ if tk == reflect.Ptr {
+ x.registerXtraT(t.Elem(), nil)
+ return
+ }
if _, ok := x.tm[t]; ok {
return
}
- var tkey reflect.Type
- switch t.Kind() {
- case reflect.Chan, reflect.Slice, reflect.Array:
- case reflect.Map:
- tkey = t.Key()
+
+ switch tk {
+ case reflect.Chan, reflect.Slice, reflect.Array, reflect.Map:
default:
return
}
+ // only register the type if it will not default to a fast-path
+ if ti == nil {
+ ti = x.ti.get(rt2id(t), t)
+ }
+ if _, rtidu := genFastpathUnderlying(t, ti.rtid, ti); fastpathAvIndex(rtidu) != -1 {
+ return
+ }
x.tm[t] = struct{}{}
x.ts = append(x.ts, t)
// check if this refers to any xtra types eg. a slice of array: add the array
- x.registerXtraT(t.Elem())
- if tkey != nil {
- x.registerXtraT(tkey)
+ x.registerXtraT(t.Elem(), nil)
+ if tk == reflect.Map {
+ x.registerXtraT(t.Key(), nil)
}
}
@@ -710,22 +863,22 @@ func (x *genRunner) encVarChkNil(varname string, t reflect.Type, checkNil bool)
telem := t.Elem()
tek := telem.Kind()
if tek == reflect.Array || (tek == reflect.Struct && telem != timeTyp) {
- x.enc(varname, genNonPtr(t))
+ x.enc(varname, genNonPtr(t), true)
break
}
i := x.varsfx()
x.line(genTempVarPfx + i + " := *" + varname)
- x.enc(genTempVarPfx+i, genNonPtr(t))
+ x.enc(genTempVarPfx+i, genNonPtr(t), false)
case reflect.Struct, reflect.Array:
if t == timeTyp {
- x.enc(varname, t)
+ x.enc(varname, t, false)
break
}
i := x.varsfx()
x.line(genTempVarPfx + i + " := &" + varname)
- x.enc(genTempVarPfx+i, t)
+ x.enc(genTempVarPfx+i, t, true)
default:
- x.enc(varname, t)
+ x.enc(varname, t, false)
}
if checkNil {
@@ -737,7 +890,7 @@ func (x *genRunner) encVarChkNil(varname string, t reflect.Type, checkNil bool)
// if t is !time.Time and t is of kind reflect.Struct or reflect.Array, varname is of type *T
// (to prevent copying),
// else t is of type T
-func (x *genRunner) enc(varname string, t reflect.Type) {
+func (x *genRunner) enc(varname string, t reflect.Type, isptr bool) {
rtid := rt2id(t)
ti2 := x.ti.get(rtid, t)
// We call CodecEncodeSelf if one of the following are honored:
@@ -747,28 +900,56 @@ func (x *genRunner) enc(varname string, t reflect.Type) {
mi := x.varsfx()
// tptr := reflect.PtrTo(t)
- tk := t.Kind()
+ // tk := t.Kind()
+
+ // check if
+ // - type is time.Time, RawExt, Raw
+ // - the type implements (Text|JSON|Binary)(Unm|M)arshal
+
+ var hasIf genIfClause
+ defer hasIf.end(x) // end if block (if necessary)
+
+ var ptrPfx, addrPfx string
+ if isptr {
+ ptrPfx = "*"
+ } else {
+ addrPfx = "&"
+ }
+
+ if t == timeTyp {
+ x.linef("%s z.EncBasicHandle().TimeBuiltin() { r.EncodeTime(%s%s)", hasIf.c(false), ptrPfx, varname)
+ // return
+ }
+ if t == rawTyp {
+ x.linef("%s z.EncRaw(%s%s)", hasIf.c(true), ptrPfx, varname)
+ return
+ }
+ if t == rawExtTyp {
+ x.linef("%s r.EncodeRawExt(%s%s)", hasIf.c(true), addrPfx, varname)
+ return
+ }
+ // only check for extensions if extensions are configured,
+ // and the type is named, and has a packagePath,
+ // and this is not the CodecEncodeSelf or CodecDecodeSelf method (i.e. it is not a Selfer)
+ if !x.nx && varname != genTopLevelVarName && t != genStringDecAsBytesTyp &&
+ t != genStringDecZCTyp && genImportPath(t) != "" && t.Name() != "" {
+ yy := fmt.Sprintf("%sxt%s", genTempVarPfx, mi)
+ x.linef("%s %s := z.Extension(%s); %s != nil { z.EncExtension(%s, %s) ",
+ hasIf.c(false), yy, varname, yy, varname, yy)
+ }
+
if x.checkForSelfer(t, varname) {
- if tk == reflect.Array ||
- (tk == reflect.Struct && rtid != timeTypId) { // varname is of type *T
- // if tptr.Implements(selferTyp) || t.Implements(selferTyp) {
- if ti2.isFlag(tiflagSelfer) || ti2.isFlag(tiflagSelferPtr) {
- x.line(varname + ".CodecEncodeSelf(e)")
- return
- }
- } else { // varname is of type T
- if ti2.isFlag(tiflagSelfer) {
- x.line(varname + ".CodecEncodeSelf(e)")
- return
- } else if ti2.isFlag(tiflagSelferPtr) {
- x.linef("%ssf%s := &%s", genTempVarPfx, mi, varname)
- x.linef("%ssf%s.CodecEncodeSelf(e)", genTempVarPfx, mi)
- return
- }
+ if ti2.flagSelfer {
+ x.linef("%s %s.CodecEncodeSelf(e)", hasIf.c(true), varname)
+ return
+ } else if ti2.flagSelferPtr {
+ x.linef("%s %ssf%s := &%s", hasIf.c(true), genTempVarPfx, mi, varname)
+ x.linef("%ssf%s.CodecEncodeSelf(e)", genTempVarPfx, mi)
+ return
}
if _, ok := x.te[rtid]; ok {
- x.line(varname + ".CodecEncodeSelf(e)")
+ x.linef("%s %s.CodecEncodeSelf(e)", hasIf.c(true), varname)
return
}
}
@@ -778,7 +959,7 @@ func (x *genRunner) enc(varname string, t reflect.Type) {
if t == t0 {
inlist = true
if x.checkForSelfer(t, varname) {
- x.line(varname + ".CodecEncodeSelf(e)")
+ x.linef("%s %s.CodecEncodeSelf(e)", hasIf.c(true), varname)
return
}
break
@@ -791,59 +972,22 @@ func (x *genRunner) enc(varname string, t reflect.Type) {
rtidAdded = true
}
- // check if
- // - type is time.Time, RawExt, Raw
- // - the type implements (Text|JSON|Binary)(Unm|M)arshal
+ if ti2.flagBinaryMarshaler {
+ x.linef("%s z.EncBinary() { z.EncBinaryMarshal(%s%v) ", hasIf.c(false), ptrPfx, varname)
+ } else if ti2.flagBinaryMarshalerPtr {
+ x.linef("%s z.EncBinary() { z.EncBinaryMarshal(%s%v) ", hasIf.c(false), addrPfx, varname)
+ }
- var hasIf genIfClause
- defer hasIf.end(x) // end if block (if necessary)
+ if ti2.flagJsonMarshaler {
+ x.linef("%s !z.EncBinary() && z.IsJSONHandle() { z.EncJSONMarshal(%s%v) ", hasIf.c(false), ptrPfx, varname)
+ } else if ti2.flagJsonMarshalerPtr {
+ x.linef("%s !z.EncBinary() && z.IsJSONHandle() { z.EncJSONMarshal(%s%v) ", hasIf.c(false), addrPfx, varname)
+ } else if ti2.flagTextMarshaler {
+ x.linef("%s !z.EncBinary() { z.EncTextMarshal(%s%v) ", hasIf.c(false), ptrPfx, varname)
+ } else if ti2.flagTextMarshalerPtr {
+ x.linef("%s !z.EncBinary() { z.EncTextMarshal(%s%v) ", hasIf.c(false), addrPfx, varname)
+ }
- if t == timeTyp {
- x.linef("%s !z.EncBasicHandle().TimeNotBuiltin { r.EncodeTime(%s)", hasIf.c(false), varname)
- // return
- }
- if t == rawTyp {
- x.linef("%s z.EncRaw(%s)", hasIf.c(true), varname)
- return
- }
- if t == rawExtTyp {
- x.linef("%s r.EncodeRawExt(%s)", hasIf.c(true), varname)
- return
- }
- // only check for extensions if extensions are configured,
- // and the type is named, and has a packagePath,
- // and this is not the CodecEncodeSelf or CodecDecodeSelf method (i.e. it is not a Selfer)
- var arrayOrStruct = tk == reflect.Array || tk == reflect.Struct // meaning varname if of type *T
- if !x.nx && varname != genTopLevelVarName && genImportPath(t) != "" && t.Name() != "" {
- yy := fmt.Sprintf("%sxt%s", genTempVarPfx, mi)
- x.linef("%s %s := z.Extension(z.I2Rtid(%s)); %s != nil { z.EncExtension(%s, %s) ",
- hasIf.c(false), yy, varname, yy, varname, yy)
- }
- if arrayOrStruct { // varname is of type *T
- if ti2.isFlag(tiflagBinaryMarshaler) || ti2.isFlag(tiflagBinaryMarshalerPtr) {
- x.linef("%s z.EncBinary() { z.EncBinaryMarshal(%v) ", hasIf.c(false), varname)
- }
- if ti2.isFlag(tiflagJsonMarshaler) || ti2.isFlag(tiflagJsonMarshalerPtr) {
- x.linef("%s !z.EncBinary() && z.IsJSONHandle() { z.EncJSONMarshal(%v) ", hasIf.c(false), varname)
- } else if ti2.isFlag(tiflagTextUnmarshaler) || ti2.isFlag(tiflagTextUnmarshalerPtr) {
- x.linef("%s !z.EncBinary() { z.EncTextMarshal(%v) ", hasIf.c(false), varname)
- }
- } else { // varname is of type T
- if ti2.isFlag(tiflagBinaryMarshaler) {
- x.linef("%s z.EncBinary() { z.EncBinaryMarshal(%v) ", hasIf.c(false), varname)
- } else if ti2.isFlag(tiflagBinaryMarshalerPtr) {
- x.linef("%s z.EncBinary() { z.EncBinaryMarshal(&%v) ", hasIf.c(false), varname)
- }
- if ti2.isFlag(tiflagJsonMarshaler) {
- x.linef("%s !z.EncBinary() && z.IsJSONHandle() { z.EncJSONMarshal(%v) ", hasIf.c(false), varname)
- } else if ti2.isFlag(tiflagJsonMarshalerPtr) {
- x.linef("%s !z.EncBinary() && z.IsJSONHandle() { z.EncJSONMarshal(&%v) ", hasIf.c(false), varname)
- } else if ti2.isFlag(tiflagTextMarshaler) {
- x.linef("%s !z.EncBinary() { z.EncTextMarshal(%v) ", hasIf.c(false), varname)
- } else if ti2.isFlag(tiflagTextMarshalerPtr) {
- x.linef("%s !z.EncBinary() { z.EncTextMarshal(&%v) ", hasIf.c(false), varname)
- }
- }
x.lineIf(hasIf.c(true))
switch t.Kind() {
@@ -855,30 +999,48 @@ func (x *genRunner) enc(varname string, t reflect.Type) {
x.line("r.EncodeFloat32(float32(" + varname + "))")
case reflect.Float64:
x.line("r.EncodeFloat64(float64(" + varname + "))")
+ case reflect.Complex64:
+ x.linef("z.EncEncodeComplex64(complex64(%s))", varname)
+ case reflect.Complex128:
+ x.linef("z.EncEncodeComplex128(complex128(%s))", varname)
case reflect.Bool:
x.line("r.EncodeBool(bool(" + varname + "))")
case reflect.String:
x.linef("r.EncodeString(string(%s))", varname)
case reflect.Chan:
- x.xtraSM(varname, t, true, false)
+ x.xtraSM(varname, t, ti2, true, false)
// x.encListFallback(varname, rtid, t)
case reflect.Array:
- x.xtraSM(varname, t, true, true)
+ _, rtidu := genFastpathUnderlying(t, rtid, ti2)
+ if fastpathAvIndex(rtidu) != -1 {
+ g := x.newFastpathGenV(ti2.key)
+ x.linef("z.F.%sV((%s)(%s[:]), e)", g.MethodNamePfx("Enc", false), x.genTypeName(ti2.key), varname)
+ } else {
+ x.xtraSM(varname, t, ti2, true, true)
+ }
case reflect.Slice:
// if nil, call dedicated function
- // if a []uint8, call dedicated function
+ // if a []byte, call dedicated function
// if a known fastpath slice, call dedicated function
// else write encode function in-line.
// - if elements are primitives or Selfers, call dedicated function on each member.
// - else call Encoder.encode(XXX) on it.
+
x.linef("if %s == nil { r.EncodeNil() } else {", varname)
if rtid == uint8SliceTypId {
x.line("r.EncodeStringBytesRaw([]byte(" + varname + "))")
- } else if fastpathAV.index(rtid) != -1 {
- g := x.newFastpathGenV(t)
- x.line("z.F." + g.MethodNamePfx("Enc", false) + "V(" + varname + ", e)")
} else {
- x.xtraSM(varname, t, true, false)
+ tu, rtidu := genFastpathUnderlying(t, rtid, ti2)
+ if fastpathAvIndex(rtidu) != -1 {
+ g := x.newFastpathGenV(tu)
+ if rtid == rtidu {
+ x.linef("z.F.%sV(%s, e)", g.MethodNamePfx("Enc", false), varname)
+ } else {
+ x.linef("z.F.%sV((%s)(%s), e)", g.MethodNamePfx("Enc", false), x.genTypeName(tu), varname)
+ }
+ } else {
+ x.xtraSM(varname, t, ti2, true, false)
+ }
}
x.linef("} // end block: if %s slice == nil", varname)
case reflect.Map:
@@ -888,11 +1050,16 @@ func (x *genRunner) enc(varname string, t reflect.Type) {
// - if elements are primitives or Selfers, call dedicated function on each member.
// - else call Encoder.encode(XXX) on it.
x.linef("if %s == nil { r.EncodeNil() } else {", varname)
- if fastpathAV.index(rtid) != -1 {
- g := x.newFastpathGenV(t)
- x.line("z.F." + g.MethodNamePfx("Enc", false) + "V(" + varname + ", e)")
+ tu, rtidu := genFastpathUnderlying(t, rtid, ti2)
+ if fastpathAvIndex(rtidu) != -1 {
+ g := x.newFastpathGenV(tu)
+ if rtid == rtidu {
+ x.linef("z.F.%sV(%s, e)", g.MethodNamePfx("Enc", false), varname)
+ } else {
+ x.linef("z.F.%sV((%s)(%s), e)", g.MethodNamePfx("Enc", false), x.genTypeName(tu), varname)
+ }
} else {
- x.xtraSM(varname, t, true, false)
+ x.xtraSM(varname, t, ti2, true, false)
}
x.linef("} // end block: if %s map == nil", varname)
case reflect.Struct:
@@ -920,6 +1087,10 @@ func (x *genRunner) encZero(t reflect.Type) {
x.line("r.EncodeFloat32(0)")
case reflect.Float64:
x.line("r.EncodeFloat64(0)")
+ case reflect.Complex64:
+ x.line("z.EncEncodeComplex64(0)")
+ case reflect.Complex128:
+ x.line("z.EncEncodeComplex128(0)")
case reflect.Bool:
x.line("r.EncodeBool(false)")
case reflect.String:
@@ -929,12 +1100,39 @@ func (x *genRunner) encZero(t reflect.Type) {
}
}
+func genOmitEmptyLinePreChecks(varname string, t reflect.Type, si *structFieldInfo, omitline *genBuf, oneLevel bool) (t2 reflect.StructField) {
+ // xdebug2f("calling genOmitEmptyLinePreChecks on: %v", t)
+ t2typ := t
+ varname3 := varname
+ // go through the loop, record the t2 field explicitly,
+ // and gather the omit line if embedded in pointers.
+ fullpath := si.path.fullpath()
+ for i, path := range fullpath {
+ for t2typ.Kind() == reflect.Ptr {
+ t2typ = t2typ.Elem()
+ }
+ t2 = t2typ.Field(int(path.index))
+ t2typ = t2.Type
+ varname3 = varname3 + "." + t2.Name
+ // do not include actual field in the omit line.
+ // that is done subsequently (right after - below).
+ if i+1 < len(fullpath) && t2typ.Kind() == reflect.Ptr {
+ omitline.s(varname3).s(" != nil && ")
+ }
+ if oneLevel {
+ break
+ }
+ }
+ return
+}
+
func (x *genRunner) doEncOmitEmptyLine(t2 reflect.StructField, varname string, buf *genBuf) {
x.f = 0
x.encOmitEmptyLine(t2, varname, buf)
}
func (x *genRunner) encOmitEmptyLine(t2 reflect.StructField, varname string, buf *genBuf) {
+ // xdebugf("calling encOmitEmptyLine on: %v", t2.Type)
// smartly check omitEmpty on a struct type, as it may contain uncomparable map/slice/etc.
// also, for maps/slices/arrays, check if len ! 0 (not if == zero value)
varname2 := varname + "." + t2.Name
@@ -942,19 +1140,36 @@ func (x *genRunner) encOmitEmptyLine(t2 reflect.StructField, varname string, buf
case reflect.Struct:
rtid2 := rt2id(t2.Type)
ti2 := x.ti.get(rtid2, t2.Type)
- // fmt.Printf(">>>> structfield: omitempty: type: %s, field: %s\n", t2.Type.Name(), t2.Name)
+ // xdebugf(">>>> structfield: omitempty: type: %s, field: %s\n", t2.Type.Name(), t2.Name)
if ti2.rtid == timeTypId {
buf.s("!(").s(varname2).s(".IsZero())")
break
}
- if ti2.isFlag(tiflagIsZeroerPtr) || ti2.isFlag(tiflagIsZeroer) {
+ if ti2.flagIsZeroerPtr || ti2.flagIsZeroer {
buf.s("!(").s(varname2).s(".IsZero())")
break
}
- if ti2.isFlag(tiflagComparable) {
+ if t2.Type.Implements(isCodecEmptyerTyp) {
+ buf.s("!(").s(varname2).s(".IsCodecEmpty())")
+ break
+ }
+ _, ok := x.tz[rtid2]
+ if ok {
+ buf.s("!(").s(varname2).s(".IsCodecEmpty())")
+ break
+ }
+ // if we *should* create a IsCodecEmpty for it, but haven't yet, add it here
+ // _, ok = x.ty[rtid2]
+ if genImportPath(t2.Type) == x.bp {
+ x.ty[t2.Type] = struct{}{}
+ buf.s("!(").s(varname2).s(".IsCodecEmpty())")
+ break
+ }
+ if ti2.flagComparable {
buf.s(varname2).s(" != ").s(x.genZeroValueR(t2.Type))
break
}
+ // fmt.Printf("???? !!!! We shouldn't get to this point !!!! ???? - for type: %v\n", t2.Type)
// buf.s("(")
buf.s(x.sayFalse()) // buf.s("false")
for i, n := 0, t2.Type.NumField(); i < n; i++ {
@@ -967,7 +1182,7 @@ func (x *genRunner) encOmitEmptyLine(t2 reflect.StructField, varname string, buf
}
//buf.s(")")
case reflect.Bool:
- buf.s(varname2)
+ buf.s("bool(").s(varname2).s(")")
case reflect.Map, reflect.Slice, reflect.Array, reflect.Chan:
buf.s("len(").s(varname2).s(") != 0")
default:
@@ -982,62 +1197,12 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) {
// if t === type currently running selfer on, do for all
ti := x.ti.get(rtid, t)
i := x.varsfx()
- sepVarname := genTempVarPfx + "sep" + i
+ // sepVarname := genTempVarPfx + "sep" + i
numfieldsvar := genTempVarPfx + "q" + i
ti2arrayvar := genTempVarPfx + "r" + i
struct2arrvar := genTempVarPfx + "2arr" + i
- x.line(sepVarname + " := !z.EncBinary()")
- x.linef("%s := z.EncBasicHandle().StructToArray", struct2arrvar)
- x.linef("_, _ = %s, %s", sepVarname, struct2arrvar)
- x.linef("const %s bool = %v // struct tag has 'toArray'", ti2arrayvar, ti.toArray)
-
- tisfi := ti.sfiSrc // always use sequence from file. decStruct expects same thing.
-
- // var nn int
- // due to omitEmpty, we need to calculate the
- // number of non-empty things we write out first.
- // This is required as we need to pre-determine the size of the container,
- // to support length-prefixing.
- if ti.anyOmitEmpty {
- x.linef("var %s = [%v]bool{ // should field at this index be written?", numfieldsvar, len(tisfi))
-
- for j, si := range tisfi {
- _ = j
- if !si.omitEmpty() {
- x.linef("true, // %s", si.fieldName)
- continue
- }
- var t2 reflect.StructField
- var omitline genBuf
- {
- t2typ := t
- varname3 := varname
- // go through the loop, record the t2 field explicitly,
- // and gather the omit line if embedded in pointers.
- for ij, ix := range si.is {
- if uint8(ij) == si.nis {
- break
- }
- for t2typ.Kind() == reflect.Ptr {
- t2typ = t2typ.Elem()
- }
- t2 = t2typ.Field(int(ix))
- t2typ = t2.Type
- varname3 = varname3 + "." + t2.Name
- // do not include actual field in the omit line.
- // that is done subsequently (right after - below).
- if uint8(ij+1) < si.nis && t2typ.Kind() == reflect.Ptr {
- omitline.s(varname3).s(" != nil && ")
- }
- }
- }
- x.doEncOmitEmptyLine(t2, varname, &omitline)
- x.linef("%s, // %s", omitline.v(), si.fieldName)
- }
- x.line("}")
- x.linef("_ = %s", numfieldsvar)
- }
+ tisfi := ti.sfi.source() // always use sequence from file. decStruct expects same thing.
type genFQN struct {
i string
@@ -1057,14 +1222,12 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) {
q.fqname = varname
{
t2typ := t
- for ij, ix := range si.is {
- if uint8(ij) == si.nis {
- break
- }
+ fullpath := si.path.fullpath()
+ for _, path := range fullpath {
for t2typ.Kind() == reflect.Ptr {
t2typ = t2typ.Elem()
}
- q.sf = t2typ.Field(int(ix))
+ q.sf = t2typ.Field(int(path.index))
t2typ = q.sf.Type
q.fqname += "." + q.sf.Name
if t2typ.Kind() == reflect.Ptr {
@@ -1079,6 +1242,12 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) {
}
}
+ // x.line(sepVarname + " := !z.EncBinary()")
+ x.linef("%s := z.EncBasicHandle().StructToArray", struct2arrvar)
+ // x.linef("_, _ = %s, %s", sepVarname, struct2arrvar)
+ x.linef("_ = %s", struct2arrvar)
+ x.linef("const %s bool = %v // struct tag has 'toArray'", ti2arrayvar, ti.toArray)
+
for j := range genFQNs {
q := &genFQNs[j]
if q.canNil {
@@ -1086,79 +1255,144 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) {
}
}
- x.linef("if %s || %s {", ti2arrayvar, struct2arrvar) // if ti.toArray
- x.linef("z.EncWriteArrayStart(%d)", len(tisfi))
+ // var nn int
+ // due to omitEmpty, we need to calculate the
+ // number of non-empty things we write out first.
+ // This is required as we need to pre-determine the size of the container,
+ // to support length-prefixing.
+ omitEmptySometimes := x.omitEmptyWhen == nil
+ omitEmptyAlways := (x.omitEmptyWhen != nil && *(x.omitEmptyWhen))
+ // omitEmptyNever := (x.omitEmptyWhen != nil && !*(x.omitEmptyWhen))
- for j, si := range tisfi {
- q := &genFQNs[j]
- // if the type of the field is a Selfer, or one of the ones
- if q.canNil {
- x.linef("if %s { z.EncWriteArrayElem(); r.EncodeNil() } else { ", q.nilVar)
- }
- x.linef("z.EncWriteArrayElem()")
- if si.omitEmpty() {
- x.linef("if %s[%v] {", numfieldsvar, j)
- }
- x.encVarChkNil(q.fqname, q.sf.Type, false)
- if si.omitEmpty() {
- x.linef("} else {")
- x.encZero(q.sf.Type)
- x.linef("}")
- }
- if q.canNil {
- x.line("}")
- }
- }
+ toArraySometimes := x.toArrayWhen == nil
+ toArrayAlways := (x.toArrayWhen != nil && *(x.toArrayWhen))
+ toArrayNever := (x.toArrayWhen != nil && !(*(x.toArrayWhen)))
- x.line("z.EncWriteArrayEnd()")
- x.linef("} else {") // if not ti.toArray
- if ti.anyOmitEmpty {
- x.linef("var %snn%s int", genTempVarPfx, i)
- x.linef("for _, b := range %s { if b { %snn%s++ } }", numfieldsvar, genTempVarPfx, i)
- x.linef("z.EncWriteMapStart(%snn%s)", genTempVarPfx, i)
- x.linef("%snn%s = %v", genTempVarPfx, i, 0)
- } else {
- x.linef("z.EncWriteMapStart(%d)", len(tisfi))
- }
+ if (omitEmptySometimes && ti.anyOmitEmpty) || omitEmptyAlways {
+ x.linef("var %s = [%v]bool{ // should field at this index be written?", numfieldsvar, len(tisfi))
- for j, si := range tisfi {
- q := &genFQNs[j]
- if si.omitEmpty() {
- x.linef("if %s[%v] {", numfieldsvar, j)
- }
- x.linef("z.EncWriteMapElemKey()")
-
- // emulate EncStructFieldKey
- switch ti.keyType {
- case valueTypeInt:
- x.linef("r.EncodeInt(z.M.Int(strconv.ParseInt(`%s`, 10, 64)))", si.encName)
- case valueTypeUint:
- x.linef("r.EncodeUint(z.M.Uint(strconv.ParseUint(`%s`, 10, 64)))", si.encName)
- case valueTypeFloat:
- x.linef("r.EncodeFloat64(z.M.Float(strconv.ParseFloat(`%s`, 64)))", si.encName)
- default: // string
- if si.encNameAsciiAlphaNum {
- x.linef(`if z.IsJSONHandle() { z.WriteStr("\"%s\"") } else { `, si.encName)
+ for _, si := range tisfi {
+ if omitEmptySometimes && !si.path.omitEmpty {
+ x.linef("true, // %s", si.encName) // si.fieldName)
+ continue
}
- x.linef("r.EncodeString(`%s`)", si.encName)
- if si.encNameAsciiAlphaNum {
+ var omitline genBuf
+ t2 := genOmitEmptyLinePreChecks(varname, t, si, &omitline, false)
+ x.doEncOmitEmptyLine(t2, varname, &omitline)
+ x.linef("%s, // %s", omitline.v(), si.encName) // si.fieldName)
+ }
+ x.line("}")
+ x.linef("_ = %s", numfieldsvar)
+ }
+
+ if toArraySometimes {
+ x.linef("if %s || %s {", ti2arrayvar, struct2arrvar) // if ti.toArray
+ }
+ if toArraySometimes || toArrayAlways {
+ x.linef("z.EncWriteArrayStart(%d)", len(tisfi))
+
+ for j, si := range tisfi {
+ doOmitEmptyCheck := (omitEmptySometimes && si.path.omitEmpty) || omitEmptyAlways
+ q := &genFQNs[j]
+ // if the type of the field is a Selfer, or one of the ones
+ if q.canNil {
+ x.linef("if %s { z.EncWriteArrayElem(); r.EncodeNil() } else { ", q.nilVar)
+ }
+ x.linef("z.EncWriteArrayElem()")
+ if doOmitEmptyCheck {
+ x.linef("if %s[%v] {", numfieldsvar, j)
+ }
+ x.encVarChkNil(q.fqname, q.sf.Type, false)
+ if doOmitEmptyCheck {
+ x.linef("} else {")
+ x.encZero(q.sf.Type)
x.linef("}")
}
+ if q.canNil {
+ x.line("}")
+ }
}
- x.line("z.EncWriteMapElemValue()")
- if q.canNil {
- x.line("if " + q.nilVar + " { r.EncodeNil() } else { ")
- x.encVarChkNil(q.fqname, q.sf.Type, false)
- x.line("}")
- } else {
- x.encVarChkNil(q.fqname, q.sf.Type, false)
- }
- if si.omitEmpty() {
- x.line("}")
- }
+
+ x.line("z.EncWriteArrayEnd()")
+ }
+ if toArraySometimes {
+ x.linef("} else {") // if not ti.toArray
+ }
+ if toArraySometimes || toArrayNever {
+ if (omitEmptySometimes && ti.anyOmitEmpty) || omitEmptyAlways {
+ x.linef("var %snn%s int", genTempVarPfx, i)
+ x.linef("for _, b := range %s { if b { %snn%s++ } }", numfieldsvar, genTempVarPfx, i)
+ x.linef("z.EncWriteMapStart(%snn%s)", genTempVarPfx, i)
+ x.linef("%snn%s = %v", genTempVarPfx, i, 0)
+ } else {
+ x.linef("z.EncWriteMapStart(%d)", len(tisfi))
+ }
+
+ fn := func(tisfi []*structFieldInfo) {
+ for j, si := range tisfi {
+ q := &genFQNs[j]
+ doOmitEmptyCheck := (omitEmptySometimes && si.path.omitEmpty) || omitEmptyAlways
+ if doOmitEmptyCheck {
+ x.linef("if %s[%v] {", numfieldsvar, j)
+ }
+ x.linef("z.EncWriteMapElemKey()")
+
+ // emulate EncStructFieldKey
+ switch ti.keyType {
+ case valueTypeInt:
+ x.linef("r.EncodeInt(z.M.Int(strconv.ParseInt(`%s`, 10, 64)))", si.encName)
+ case valueTypeUint:
+ x.linef("r.EncodeUint(z.M.Uint(strconv.ParseUint(`%s`, 10, 64)))", si.encName)
+ case valueTypeFloat:
+ x.linef("r.EncodeFloat64(z.M.Float(strconv.ParseFloat(`%s`, 64)))", si.encName)
+ default: // string
+ if x.jsonOnlyWhen == nil {
+ if si.path.encNameAsciiAlphaNum {
+ x.linef(`if z.IsJSONHandle() { z.WriteStr("\"%s\"") } else { `, si.encName)
+ }
+ x.linef("r.EncodeString(`%s`)", si.encName)
+ if si.path.encNameAsciiAlphaNum {
+ x.linef("}")
+ }
+ } else if *(x.jsonOnlyWhen) {
+ if si.path.encNameAsciiAlphaNum {
+ x.linef(`z.WriteStr("\"%s\"")`, si.encName)
+ } else {
+ x.linef("r.EncodeString(`%s`)", si.encName)
+ }
+ } else {
+ x.linef("r.EncodeString(`%s`)", si.encName)
+ }
+ }
+ x.line("z.EncWriteMapElemValue()")
+ if q.canNil {
+ x.line("if " + q.nilVar + " { r.EncodeNil() } else { ")
+ x.encVarChkNil(q.fqname, q.sf.Type, false)
+ x.line("}")
+ } else {
+ x.encVarChkNil(q.fqname, q.sf.Type, false)
+ }
+ if doOmitEmptyCheck {
+ x.line("}")
+ }
+ }
+ }
+
+ if genStructCanonical {
+ x.linef("if z.EncBasicHandle().Canonical {") // if Canonical block
+ fn(ti.sfi.sorted())
+ x.linef("} else {") // else !cononical block
+ fn(ti.sfi.source())
+ x.linef("}") // end if Canonical block
+ } else {
+ fn(tisfi)
+ }
+
+ x.line("z.EncWriteMapEnd()")
+ }
+ if toArraySometimes {
+ x.linef("} ") // end if/else ti.toArray
}
- x.line("z.EncWriteMapEnd()")
- x.linef("} ") // end if/else ti.toArray
}
func (x *genRunner) encListFallback(varname string, t reflect.Type) {
@@ -1178,15 +1412,11 @@ func (x *genRunner) encListFallback(varname string, t reflect.Type) {
Label, Chan, Slice, Sfx string
}
tm, err := template.New("").Parse(genEncChanTmpl)
- if err != nil {
- panic(err)
- }
+ genCheckErr(err)
x.linef("if %s == nil { r.EncodeNil() } else { ", varname)
x.linef("var sch%s []%s", i, x.genTypeName(t.Elem()))
err = tm.Execute(x.w, &ts{"Lsch" + i, varname, "sch" + i, i})
- if err != nil {
- panic(err)
- }
+ genCheckErr(err)
if elemBytes {
x.linef("r.EncodeStringBytesRaw([]byte(%s))", "sch"+i)
x.line("}")
@@ -1196,11 +1426,17 @@ func (x *genRunner) encListFallback(varname string, t reflect.Type) {
}
x.line("z.EncWriteArrayStart(len(" + varname + "))")
- x.linef("for _, %sv%s := range %s {", genTempVarPfx, i, varname)
- x.linef("z.EncWriteArrayElem()")
- x.encVar(genTempVarPfx+"v"+i, t.Elem())
+ // x.linef("for _, %sv%s := range %s {", genTempVarPfx, i, varname)
+ // x.linef("z.EncWriteArrayElem()")
+ // x.encVar(genTempVarPfx+"v"+i, t.Elem())
+ // x.line("}")
+
+ x.linef("for %sv%s := range %s {", genTempVarPfx, i, varname)
+ x.linef("z.EncWriteArrayElem()")
+ x.encVar(fmt.Sprintf("%s[%sv%s]", varname, genTempVarPfx, i), t.Elem())
x.line("}")
+
x.line("z.EncWriteArrayEnd()")
if t.Kind() == reflect.Chan {
x.line("}")
@@ -1208,10 +1444,11 @@ func (x *genRunner) encListFallback(varname string, t reflect.Type) {
}
func (x *genRunner) encMapFallback(varname string, t reflect.Type) {
- x.linef("if %s == nil { r.EncodeNil(); return }", varname)
- // NOTE: Canonical Option is not honored
+ x.linef("if %s == nil { r.EncodeNil()", varname)
+ x.linef("} else if z.EncBasicHandle().Canonical { z.EncEncodeMapNonNil(%s)", varname)
+ x.line("} else {")
i := x.varsfx()
- x.line("z.EncWriteMapStart(len(" + varname + "))")
+ x.linef("z.EncWriteMapStart(len(%s))", varname)
x.linef("for %sk%s, %sv%s := range %s {", genTempVarPfx, i, genTempVarPfx, i, varname)
x.linef("z.EncWriteMapElemKey()")
x.encVar(genTempVarPfx+"k"+i, t.Key())
@@ -1219,6 +1456,7 @@ func (x *genRunner) encMapFallback(varname string, t reflect.Type) {
x.encVar(genTempVarPfx+"v"+i, t.Elem())
x.line("}")
x.line("z.EncWriteMapEnd()")
+ x.line("}")
}
func (x *genRunner) decVarInitPtr(varname, nilvar string, t reflect.Type, si *structFieldInfo,
@@ -1230,15 +1468,13 @@ func (x *genRunner) decVarInitPtr(varname, nilvar string, t reflect.Type, si *st
t2kind := t2typ.Kind()
var nilbufed bool
if si != nil {
- for ij, ix := range si.is {
- if uint8(ij) == si.nis {
- break
- }
+ fullpath := si.path.fullpath()
+ for _, path := range fullpath {
// only one-level pointers can be seen in a type
if t2typ.Kind() == reflect.Ptr {
t2typ = t2typ.Elem()
}
- t2 = t2typ.Field(int(ix))
+ t2 = t2typ.Field(int(path.index))
t2typ = t2.Type
varname3 = varname3 + "." + t2.Name
t2kind = t2typ.Kind()
@@ -1344,41 +1580,12 @@ func (x *genRunner) decVar(varname, nilvar string, t reflect.Type, canBeNil, che
}
// dec will decode a variable (varname) of type t or ptrTo(t) if isptr==true.
-// t is always a basetype (i.e. not of kind reflect.Ptr).
func (x *genRunner) dec(varname string, t reflect.Type, isptr bool) {
// assumptions:
// - the varname is to a pointer already. No need to take address of it
// - t is always a baseType T (not a *T, etc).
rtid := rt2id(t)
ti2 := x.ti.get(rtid, t)
- if x.checkForSelfer(t, varname) {
- if ti2.isFlag(tiflagSelfer) || ti2.isFlag(tiflagSelferPtr) {
- x.line(varname + ".CodecDecodeSelf(d)")
- return
- }
- if _, ok := x.td[rtid]; ok {
- x.line(varname + ".CodecDecodeSelf(d)")
- return
- }
- }
-
- inlist := false
- for _, t0 := range x.t {
- if t == t0 {
- inlist = true
- if x.checkForSelfer(t, varname) {
- x.line(varname + ".CodecDecodeSelf(d)")
- return
- }
- break
- }
- }
-
- var rtidAdded bool
- if t == x.tc {
- x.td[rtid] = true
- rtidAdded = true
- }
// check if
// - type is time.Time, Raw, RawExt
@@ -1396,7 +1603,7 @@ func (x *genRunner) dec(varname string, t reflect.Type, isptr bool) {
addrPfx = "&"
}
if t == timeTyp {
- x.linef("%s !z.DecBasicHandle().TimeNotBuiltin { %s%v = r.DecodeTime()", hasIf.c(false), ptrPfx, varname)
+ x.linef("%s z.DecBasicHandle().TimeBuiltin() { %s%v = r.DecodeTime()", hasIf.c(false), ptrPfx, varname)
// return
}
if t == rawTyp {
@@ -1412,18 +1619,59 @@ func (x *genRunner) dec(varname string, t reflect.Type, isptr bool) {
// only check for extensions if extensions are configured,
// and the type is named, and has a packagePath,
// and this is not the CodecEncodeSelf or CodecDecodeSelf method (i.e. it is not a Selfer)
- if !x.nx && varname != genTopLevelVarName && genImportPath(t) != "" && t.Name() != "" {
+ // xdebugf("genRunner.dec: varname: %v, t: %v, genImportPath: %v, t.Name: %v", varname, t, genImportPath(t), t.Name())
+ if !x.nx && varname != genTopLevelVarName && t != genStringDecAsBytesTyp &&
+ t != genStringDecZCTyp && genImportPath(t) != "" && t.Name() != "" {
// first check if extensions are configued, before doing the interface conversion
yy := fmt.Sprintf("%sxt%s", genTempVarPfx, mi)
- x.linef("%s %s := z.Extension(z.I2Rtid(%s)); %s != nil { z.DecExtension(%s, %s) ", hasIf.c(false), yy, varname, yy, varname, yy)
+ x.linef("%s %s := z.Extension(%s); %s != nil { z.DecExtension(%s%s, %s) ", hasIf.c(false), yy, varname, yy, addrPfx, varname, yy)
}
- if ti2.isFlag(tiflagBinaryUnmarshaler) || ti2.isFlag(tiflagBinaryUnmarshalerPtr) {
+ if x.checkForSelfer(t, varname) {
+ if ti2.flagSelfer {
+ x.linef("%s %s.CodecDecodeSelf(d)", hasIf.c(true), varname)
+ return
+ }
+ if ti2.flagSelferPtr {
+ x.linef("%s %s.CodecDecodeSelf(d)", hasIf.c(true), varname)
+ return
+ }
+ if _, ok := x.td[rtid]; ok {
+ x.linef("%s %s.CodecDecodeSelf(d)", hasIf.c(true), varname)
+ return
+ }
+ }
+
+ inlist := false
+ for _, t0 := range x.t {
+ if t == t0 {
+ inlist = true
+ if x.checkForSelfer(t, varname) {
+ x.linef("%s %s.CodecDecodeSelf(d)", hasIf.c(true), varname)
+ return
+ }
+ break
+ }
+ }
+
+ var rtidAdded bool
+ if t == x.tc {
+ x.td[rtid] = true
+ rtidAdded = true
+ }
+
+ if ti2.flagBinaryUnmarshaler {
+ x.linef("%s z.DecBinary() { z.DecBinaryUnmarshal(%s%v) ", hasIf.c(false), ptrPfx, varname)
+ } else if ti2.flagBinaryUnmarshalerPtr {
x.linef("%s z.DecBinary() { z.DecBinaryUnmarshal(%s%v) ", hasIf.c(false), addrPfx, varname)
}
- if ti2.isFlag(tiflagJsonUnmarshaler) || ti2.isFlag(tiflagJsonUnmarshalerPtr) {
+ if ti2.flagJsonUnmarshaler {
+ x.linef("%s !z.DecBinary() && z.IsJSONHandle() { z.DecJSONUnmarshal(%s%v)", hasIf.c(false), ptrPfx, varname)
+ } else if ti2.flagJsonUnmarshalerPtr {
x.linef("%s !z.DecBinary() && z.IsJSONHandle() { z.DecJSONUnmarshal(%s%v)", hasIf.c(false), addrPfx, varname)
- } else if ti2.isFlag(tiflagTextUnmarshaler) || ti2.isFlag(tiflagTextUnmarshalerPtr) {
+ } else if ti2.flagTextUnmarshaler {
+ x.linef("%s !z.DecBinary() { z.DecTextUnmarshal(%s%v)", hasIf.c(false), ptrPfx, varname)
+ } else if ti2.flagTextUnmarshalerPtr {
x.linef("%s !z.DecBinary() { z.DecTextUnmarshal(%s%v)", hasIf.c(false), addrPfx, varname)
}
@@ -1434,34 +1682,55 @@ func (x *genRunner) dec(varname string, t reflect.Type, isptr bool) {
}
switch t.Kind() {
- case reflect.Array, reflect.Chan:
- x.xtraSM(varname, t, false, isptr)
+ case reflect.Chan:
+ x.xtraSM(varname, t, ti2, false, isptr)
+ case reflect.Array:
+ _, rtidu := genFastpathUnderlying(t, rtid, ti2)
+ if fastpathAvIndex(rtidu) != -1 {
+ g := x.newFastpathGenV(ti2.key)
+ x.linef("z.F.%sN((%s)(%s[:]), d)", g.MethodNamePfx("Dec", false), x.genTypeName(ti2.key), varname)
+ } else {
+ x.xtraSM(varname, t, ti2, false, isptr)
+ }
case reflect.Slice:
- // if a []uint8, call dedicated function
+ // if a []byte, call dedicated function
// if a known fastpath slice, call dedicated function
// else write encode function in-line.
// - if elements are primitives or Selfers, call dedicated function on each member.
// - else call Encoder.encode(XXX) on it.
+
if rtid == uint8SliceTypId {
- x.linef("%s%s = r.DecodeBytes(%s(%s[]byte)(%s), false)",
- ptrPfx, varname, ptrPfx, ptrPfx, varname)
- } else if fastpathAV.index(rtid) != -1 {
- g := x.newFastpathGenV(t)
- x.linef("z.F.%sX(%s%s, d)", g.MethodNamePfx("Dec", false), addrPfx, varname)
+ x.linef("%s%s = z.DecodeBytesInto(%s(%s[]byte)(%s))", ptrPfx, varname, ptrPfx, ptrPfx, varname)
} else {
- x.xtraSM(varname, t, false, isptr)
- // x.decListFallback(varname, rtid, false, t)
+ tu, rtidu := genFastpathUnderlying(t, rtid, ti2)
+ if fastpathAvIndex(rtidu) != -1 {
+ g := x.newFastpathGenV(tu)
+ if rtid == rtidu {
+ x.linef("z.F.%sX(%s%s, d)", g.MethodNamePfx("Dec", false), addrPfx, varname)
+ } else {
+ x.linef("z.F.%sX((*%s)(%s%s), d)", g.MethodNamePfx("Dec", false), x.genTypeName(tu), addrPfx, varname)
+ }
+ } else {
+ x.xtraSM(varname, t, ti2, false, isptr)
+ // x.decListFallback(varname, rtid, false, t)
+ }
}
case reflect.Map:
// if a known fastpath map, call dedicated function
// else write encode function in-line.
// - if elements are primitives or Selfers, call dedicated function on each member.
// - else call Encoder.encode(XXX) on it.
- if fastpathAV.index(rtid) != -1 {
- g := x.newFastpathGenV(t)
- x.linef("z.F.%sX(%s%s, d)", g.MethodNamePfx("Dec", false), addrPfx, varname)
+
+ tu, rtidu := genFastpathUnderlying(t, rtid, ti2)
+ if fastpathAvIndex(rtidu) != -1 {
+ g := x.newFastpathGenV(tu)
+ if rtid == rtidu {
+ x.linef("z.F.%sX(%s%s, d)", g.MethodNamePfx("Dec", false), addrPfx, varname)
+ } else {
+ x.linef("z.F.%sX((*%s)(%s%s), d)", g.MethodNamePfx("Dec", false), x.genTypeName(tu), addrPfx, varname)
+ }
} else {
- x.xtraSM(varname, t, false, isptr)
+ x.xtraSM(varname, t, ti2, false, isptr)
}
case reflect.Struct:
if inlist {
@@ -1524,10 +1793,21 @@ func (x *genRunner) decTryAssignPrimitive(varname string, t reflect.Type, isptr
case reflect.Float64:
x.linef("%s%s = (%s)(r.DecodeFloat64())", ptr, varname, x.genTypeName(t))
+ case reflect.Complex64:
+ x.linef("%s%s = (%s)(complex(z.DecDecodeFloat32(), 0))", ptr, varname, x.genTypeName(t))
+ case reflect.Complex128:
+ x.linef("%s%s = (%s)(complex(r.DecodeFloat64(), 0))", ptr, varname, x.genTypeName(t))
+
case reflect.Bool:
x.linef("%s%s = (%s)(r.DecodeBool())", ptr, varname, x.genTypeName(t))
case reflect.String:
- x.linef("%s%s = (%s)(string(r.DecodeStringAsBytes()))", ptr, varname, x.genTypeName(t))
+ if t == genStringDecAsBytesTyp {
+ x.linef("%s%s = r.DecodeStringAsBytes()", ptr, varname)
+ } else if t == genStringDecZCTyp {
+ x.linef("%s%s = (string)(z.DecStringZC(r.DecodeStringAsBytes()))", ptr, varname)
+ } else {
+ x.linef("%s%s = (%s)(z.DecStringZC(r.DecodeStringAsBytes()))", ptr, varname, x.genTypeName(t))
+ }
default:
return false
}
@@ -1536,11 +1816,11 @@ func (x *genRunner) decTryAssignPrimitive(varname string, t reflect.Type, isptr
func (x *genRunner) decListFallback(varname string, rtid uintptr, t reflect.Type) {
if t.AssignableTo(uint8SliceTyp) {
- x.line("*" + varname + " = r.DecodeBytes(*((*[]byte)(" + varname + ")), false)")
+ x.line("*" + varname + " = z.DecodeBytesInto(*((*[]byte)(" + varname + ")))")
return
}
if t.Kind() == reflect.Array && t.Elem().Kind() == reflect.Uint8 {
- x.linef("r.DecodeBytes( ((*[%d]byte)(%s))[:], true)", t.Len(), varname)
+ x.linef("r.DecodeBytes( ((*[%d]byte)(%s))[:])", t.Len(), varname)
return
}
type tstruc struct {
@@ -1581,12 +1861,8 @@ func (x *genRunner) decListFallback(varname string, rtid uintptr, t reflect.Type
return t.Kind() == reflect.Chan
}
tm, err := template.New("").Funcs(funcs).Parse(genDecListTmpl)
- if err != nil {
- panic(err)
- }
- if err = tm.Execute(x.w, &ts); err != nil {
- panic(err)
- }
+ genCheckErr(err)
+ genCheckErr(tm.Execute(x.w, &ts))
}
func (x *genRunner) decMapFallback(varname string, rtid uintptr, t reflect.Type) {
@@ -1619,6 +1895,14 @@ func (x *genRunner) decMapFallback(varname string, rtid uintptr, t reflect.Type)
funcs["decElemKindIntf"] = func() bool {
return telem.Kind() == reflect.Interface
}
+ funcs["decLineVarKStrBytes"] = func(varname string) string {
+ x.decVar(varname, "", genStringDecAsBytesTyp, false, true)
+ return ""
+ }
+ funcs["decLineVarKStrZC"] = func(varname string) string {
+ x.decVar(varname, "", genStringDecZCTyp, false, true)
+ return ""
+ }
funcs["decLineVarK"] = func(varname string) string {
x.decVar(varname, "", tkey, false, true)
return ""
@@ -1635,18 +1919,14 @@ func (x *genRunner) decMapFallback(varname string, rtid uintptr, t reflect.Type)
}
tm, err := template.New("").Funcs(funcs).Parse(genDecMapTmpl)
- if err != nil {
- panic(err)
- }
- if err = tm.Execute(x.w, &ts); err != nil {
- panic(err)
- }
+ genCheckErr(err)
+ genCheckErr(tm.Execute(x.w, &ts))
}
func (x *genRunner) decStructMapSwitch(kName string, varname string, rtid uintptr, t reflect.Type) {
ti := x.ti.get(rtid, t)
- tisfi := ti.sfiSrc // always use sequence from file. decStruct expects same thing.
- x.line("switch (" + kName + ") {")
+ tisfi := ti.sfi.source() // always use sequence from file. decStruct expects same thing.
+ x.line("switch string(" + kName + ") {")
var newbuf, nilbuf genBuf
for _, si := range tisfi {
x.line("case \"" + si.encName + "\":")
@@ -1663,8 +1943,8 @@ func (x *genRunner) decStructMapSwitch(kName string, varname string, rtid uintpt
}
x.line("default:")
// pass the slice here, so that the string will not escape, and maybe save allocation
- x.line("z.DecStructFieldNotFound(-1, " + kName + ")")
- x.line("} // end switch " + kName)
+ x.linef("z.DecStructFieldNotFound(-1, string(%s))", kName)
+ x.linef("} // end switch %s", kName)
}
func (x *genRunner) decStructMap(varname, lenvarname string, rtid uintptr, t reflect.Type, style genStructMapStyle) {
@@ -1689,13 +1969,13 @@ func (x *genRunner) decStructMap(varname, lenvarname string, rtid uintptr, t ref
// emulate decstructfieldkey
switch ti.keyType {
case valueTypeInt:
- x.linef("%s := z.StringView(strconv.AppendInt(z.DecScratchArrayBuffer()[:0], r.DecodeInt64(), 10))", kName)
+ x.linef("%s := strconv.AppendInt(z.DecScratchArrayBuffer()[:0], r.DecodeInt64(), 10)", kName)
case valueTypeUint:
- x.linef("%s := z.StringView(strconv.AppendUint(z.DecScratchArrayBuffer()[:0], r.DecodeUint64(), 10))", kName)
+ x.linef("%s := strconv.AppendUint(z.DecScratchArrayBuffer()[:0], r.DecodeUint64(), 10)", kName)
case valueTypeFloat:
- x.linef("%s := z.StringView(strconv.AppendFloat(z.DecScratchArrayBuffer()[:0], r.DecodeFloat64(), 'f', -1, 64))", kName)
+ x.linef("%s := strconv.AppendFloat(z.DecScratchArrayBuffer()[:0], r.DecodeFloat64(), 'f', -1, 64)", kName)
default: // string
- x.linef("%s := z.StringView(r.DecodeStringAsBytes())", kName)
+ x.linef("%s := r.DecodeStringAsBytes()", kName)
}
x.line("z.DecReadMapElemValue()")
@@ -1708,7 +1988,7 @@ func (x *genRunner) decStructArray(varname, lenvarname, breakString string, rtid
tpfx := genTempVarPfx
i := x.varsfx()
ti := x.ti.get(rtid, t)
- tisfi := ti.sfiSrc // always use sequence from file. decStruct expects same thing.
+ tisfi := ti.sfi.source() // always use sequence from file. decStruct expects same thing.
x.linef("var %sj%s int", tpfx, i)
x.linef("var %sb%s bool", tpfx, i) // break
x.linef("var %shl%s bool = %s >= 0", tpfx, i, lenvarname) // has length
@@ -1806,12 +2086,13 @@ func (x *genRunner) newFastpathGenV(t reflect.Type) (v fastpathGenV) {
v.Elem = x.genTypeName(te)
v.Size = int(te.Size())
case reflect.Map:
- te, tk := t.Elem(), t.Key()
+ te := t.Elem()
+ tk := t.Key()
v.Elem = x.genTypeName(te)
v.MapKey = x.genTypeName(tk)
v.Size = int(te.Size() + tk.Size())
default:
- panic("unexpected type for newFastpathGenV. Requires map or slice type")
+ halt.onerror(errGenUnexpectedTypeFastpath)
}
return
}
@@ -1876,6 +2157,16 @@ func genNonPtr(t reflect.Type) reflect.Type {
return t
}
+func genFastpathUnderlying(t reflect.Type, rtid uintptr, ti *typeInfo) (tu reflect.Type, rtidu uintptr) {
+ tu = t
+ rtidu = rtid
+ if ti.flagHasPkgPath {
+ tu = ti.fastpathUnderlying
+ rtidu = rt2id(tu)
+ }
+ return
+}
+
func genTitleCaseName(s string) string {
switch s {
case "interface{}", "interface {}":
@@ -1964,17 +2255,19 @@ func genCustomTypeName(tstr string) string {
}
func genIsImmutable(t reflect.Type) (v bool) {
- return isImmutableKind(t.Kind())
+ return scalarBitset.isset(byte(t.Kind()))
}
type genInternal struct {
Version int
Values []fastpathGenV
+ Formats []string
}
func (x genInternal) FastpathLen() (l int) {
for _, v := range x.Values {
- if v.Primitive == "" && !(v.MapKey == "" && v.Elem == "uint8") {
+ // if v.Primitive == "" && !(v.MapKey == "" && v.Elem == "uint8") {
+ if v.Primitive == "" {
l++
}
}
@@ -2016,7 +2309,7 @@ func genInternalNonZeroValue(s string) string {
i = 2
case "bytes", "[]byte", "[]uint8":
i = 3
- case "float32", "float64", "float", "double":
+ case "float32", "float64", "float", "double", "complex", "complex64", "complex128":
i = 4
default:
i = 5
@@ -2027,6 +2320,7 @@ func genInternalNonZeroValue(s string) string {
return genInternalNonZeroValueStrs[idx%slen][i] // return string, to remove ambiguity
}
+// Note: used for fastpath only
func genInternalEncCommandAsString(s string, vname string) string {
switch s {
case "uint64":
@@ -2054,7 +2348,8 @@ func genInternalEncCommandAsString(s string, vname string) string {
}
}
-func genInternalDecCommandAsString(s string) string {
+// Note: used for fastpath only
+func genInternalDecCommandAsString(s string, mapkey bool) string {
switch s {
case "uint":
return "uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))"
@@ -2080,45 +2375,62 @@ func genInternalDecCommandAsString(s string) string {
return "d.d.DecodeInt64()"
case "string":
- return "string(d.d.DecodeStringAsBytes())"
+ // if mapkey {
+ // return "d.stringZC(d.d.DecodeStringAsBytes())"
+ // }
+ // return "string(d.d.DecodeStringAsBytes())"
+ return "d.stringZC(d.d.DecodeStringAsBytes())"
case "[]byte", "[]uint8", "bytes":
- return "d.d.DecodeBytes(nil, false)"
+ return "d.d.DecodeBytes([]byte{})"
case "float32":
return "float32(d.decodeFloat32())"
case "float64":
return "d.d.DecodeFloat64()"
+ case "complex64":
+ return "complex(d.decodeFloat32(), 0)"
+ case "complex128":
+ return "complex(d.d.DecodeFloat64(), 0)"
case "bool":
return "d.d.DecodeBool()"
default:
- panic(errors.New("gen internal: unknown type for decode: " + s))
+ halt.onerror(errors.New("gen internal: unknown type for decode: " + s))
}
+ return ""
}
+// func genInternalSortType(s string, elem bool) string {
+// for _, v := range [...]string{
+// "int",
+// "uint",
+// "float",
+// "bool",
+// "string",
+// "bytes", "[]uint8", "[]byte",
+// } {
+// if v == "[]byte" || v == "[]uint8" {
+// v = "bytes"
+// }
+// if strings.HasPrefix(s, v) {
+// if v == "int" || v == "uint" || v == "float" {
+// v += "64"
+// }
+// if elem {
+// return v
+// }
+// return v + "Slice"
+// }
+// }
+// halt.onerror(errors.New("sorttype: unexpected type: " + s))
+// }
+
func genInternalSortType(s string, elem bool) string {
- for _, v := range [...]string{
- "int",
- "uint",
- "float",
- "bool",
- "string",
- "bytes", "[]uint8", "[]byte",
- } {
- if v == "[]byte" || v == "[]uint8" {
- v = "bytes"
- }
- if strings.HasPrefix(s, v) {
- if v == "int" || v == "uint" || v == "float" {
- v += "64"
- }
- if elem {
- return v
- }
- return v + "Slice"
- }
+ if elem {
+ return s
}
- panic("sorttype: unexpected type: " + s)
+ return s + "Slice"
}
+// MARKER: keep in sync with codecgen/gen.go
func genStripVendor(s string) string {
// HACK: Misbehaviour occurs in go 1.5. May have to re-visit this later.
// if s contains /vendor/ OR startsWith vendor/, then return everything after it.
@@ -2157,6 +2469,8 @@ func genInternalInit() {
"int64": 8,
"float32": 4,
"float64": 8,
+ "complex64": 8,
+ "complex128": 16,
"bool": 1,
}
@@ -2191,65 +2505,12 @@ func genInternalInit() {
mapvaltypes = types[:]
if genFastpathTrimTypes {
- slicetypes = []string{
- "interface{}",
- "string",
- "[]byte",
- "float32",
- "float64",
- "uint",
- // "uint8", // no need for fastpath of []uint8, as it is handled specially
- "uint16",
- "uint32",
- "uint64",
- // "uintptr",
- "int",
- "int8",
- "int16",
- "int32",
- "int64",
- "bool",
- }
+ // Note: we only create fast-paths for commonly used types.
+ // Consequently, things like int8, uint16, uint, etc are commented out.
- mapkeytypes = []string{
- //"interface{}",
- "string",
- //"[]byte",
- //"float32",
- //"float64",
- "uint",
- "uint8",
- //"uint16",
- //"uint32",
- "uint64",
- //"uintptr",
- "int",
- //"int8",
- //"int16",
- //"int32",
- "int64",
- // "bool",
- }
-
- mapvaltypes = []string{
- "interface{}",
- "string",
- "[]byte",
- "uint",
- "uint8",
- //"uint16",
- //"uint32",
- "uint64",
- // "uintptr",
- "int",
- //"int8",
- //"int16",
- //"int32",
- "int64",
- "float32",
- "float64",
- "bool",
- }
+ slicetypes = genInternalFastpathSliceTypes()
+ mapkeytypes = genInternalFastpathMapKeyTypes()
+ mapvaltypes = genInternalFastpathMapValueTypes()
}
// var mapkeytypes [len(&types) - 1]string // skip bool
@@ -2263,7 +2524,7 @@ func genInternalInit() {
// }
// var mapkeytypestr = string(mb)
- var gt = genInternal{Version: genVersion}
+ var gt = genInternal{Version: genVersion, Formats: genFormats}
// For each slice or map type, there must be a (symmetrical) Encode and Decode fast-path function
@@ -2303,9 +2564,6 @@ func genInternalInit() {
}
// genInternalGoFile is used to generate source files from templates.
-// It is run by the program author alone.
-// Unfortunately, it has to be exported so that it can be called from a command line tool.
-// *** DO NOT USE ***
func genInternalGoFile(r io.Reader, w io.Writer) (err error) {
genInternalOnce.Do(genInternalInit)
@@ -2337,3 +2595,207 @@ func genInternalGoFile(r io.Reader, w io.Writer) (err error) {
w.Write(bout)
return
}
+
+func genInternalFastpathSliceTypes() []string {
+ return []string{
+ "interface{}",
+ "string",
+ "[]byte",
+ "float32",
+ "float64",
+ // "uint",
+ // "uint8", // no need for fastpath of []uint8, as it is handled specially
+ "uint8", // keep fast-path, so it doesn't have to go through reflection
+ // "uint16",
+ // "uint32",
+ "uint64",
+ // "uintptr",
+ "int",
+ // "int8",
+ // "int16",
+ "int32", // rune
+ "int64",
+ "bool",
+ }
+}
+
+func genInternalFastpathMapKeyTypes() []string {
+ return []string{
+ // "interface{}",
+ "string",
+ // "[]byte",
+ // "float32",
+ // "float64",
+ // "uint",
+ "uint8", // byte
+ // "uint16",
+ // "uint32",
+ "uint64", // used for keys
+ // "uintptr",
+ "int", // default number key
+ // "int8",
+ // "int16",
+ "int32", // rune
+ // "int64",
+ // "bool",
+ }
+}
+
+func genInternalFastpathMapValueTypes() []string {
+ return []string{
+ "interface{}",
+ "string",
+ "[]byte",
+ // "uint",
+ "uint8", // byte
+ // "uint16",
+ // "uint32",
+ "uint64", // used for keys, etc
+ // "uintptr",
+ "int", // default number
+ //"int8",
+ // "int16",
+ "int32", // rune (mostly used for unicode)
+ // "int64",
+ // "float32",
+ "float64",
+ "bool",
+ }
+}
+
+// sort-slice ...
+// generates sort implementations for
+// various slice types and combination slice+reflect.Value types.
+//
+// The combination slice+reflect.Value types are used
+// during canonical encode, and the others are used during fast-path
+// encoding of map keys.
+
+// genInternalSortableTypes returns the types
+// that are used for fast-path canonical's encoding of maps.
+//
+// For now, we only support the highest sizes for
+// int64, uint64, float64, bool, string, bytes.
+func genInternalSortableTypes() []string {
+ return genInternalFastpathMapKeyTypes()
+}
+
+// genInternalSortablePlusTypes returns the types
+// that are used for reflection-based canonical's encoding of maps.
+//
+// For now, we only support the highest sizes for
+// int64, uint64, float64, bool, string, bytes.
+func genInternalSortablePlusTypes() []string {
+ return []string{
+ "string",
+ "float64",
+ "uint64",
+ // "uintptr",
+ "int64",
+ "bool",
+ "time",
+ "bytes",
+ }
+}
+
+func genTypeForShortName(s string) string {
+ switch s {
+ case "time":
+ return "time.Time"
+ case "bytes":
+ return "[]byte"
+ }
+ return s
+}
+
+func genArgs(args ...interface{}) map[string]interface{} {
+ m := make(map[string]interface{}, len(args)/2)
+ for i := 0; i < len(args); {
+ m[args[i].(string)] = args[i+1]
+ i += 2
+ }
+ return m
+}
+
+func genEndsWith(s0 string, sn ...string) bool {
+ for _, s := range sn {
+ if strings.HasSuffix(s0, s) {
+ return true
+ }
+ }
+ return false
+}
+
+func genCheckErr(err error) {
+ halt.onerror(err)
+}
+
+func genRunSortTmpl2Go(fnameIn, fnameOut string) {
+ var err error
+
+ funcs := make(template.FuncMap)
+ funcs["sortables"] = genInternalSortableTypes
+ funcs["sortablesplus"] = genInternalSortablePlusTypes
+ funcs["tshort"] = genTypeForShortName
+ funcs["endswith"] = genEndsWith
+ funcs["args"] = genArgs
+
+ t := template.New("").Funcs(funcs)
+ fin, err := os.Open(fnameIn)
+ genCheckErr(err)
+ defer fin.Close()
+ fout, err := os.Create(fnameOut)
+ genCheckErr(err)
+ defer fout.Close()
+ tmplstr, err := ioutil.ReadAll(fin)
+ genCheckErr(err)
+ t, err = t.Parse(string(tmplstr))
+ genCheckErr(err)
+ var out bytes.Buffer
+ err = t.Execute(&out, 0)
+ genCheckErr(err)
+ bout, err := format.Source(out.Bytes())
+ if err != nil {
+ fout.Write(out.Bytes()) // write out if error, so we can still see.
+ }
+ genCheckErr(err)
+ // write out if error, as much as possible, so we can still see.
+ _, err = fout.Write(bout)
+ genCheckErr(err)
+}
+
+func genRunTmpl2Go(fnameIn, fnameOut string) {
+ // println("____ " + fnameIn + " --> " + fnameOut + " ______")
+ fin, err := os.Open(fnameIn)
+ genCheckErr(err)
+ defer fin.Close()
+ fout, err := os.Create(fnameOut)
+ genCheckErr(err)
+ defer fout.Close()
+ err = genInternalGoFile(fin, fout)
+ genCheckErr(err)
+}
+
+// --- some methods here for other types, which are only used in codecgen
+
+// depth returns number of valid nodes in the hierachy
+func (path *structFieldInfoPathNode) root() *structFieldInfoPathNode {
+TOP:
+ if path.parent != nil {
+ path = path.parent
+ goto TOP
+ }
+ return path
+}
+
+func (path *structFieldInfoPathNode) fullpath() (p []*structFieldInfoPathNode) {
+ // this method is mostly called by a command-line tool - it's not optimized, and that's ok.
+ // it shouldn't be used in typical runtime use - as it does unnecessary allocation.
+ d := path.depth()
+ p = make([]*structFieldInfoPathNode, d)
+ for d--; d >= 0; d-- {
+ p[d] = path
+ path = path.parent
+ }
+ return
+}
diff --git a/vendor/github.com/ugorji/go/codec/go.mod b/vendor/github.com/ugorji/go/codec/go.mod
index b4760da40..7fcabb473 100644
--- a/vendor/github.com/ugorji/go/codec/go.mod
+++ b/vendor/github.com/ugorji/go/codec/go.mod
@@ -1,5 +1,5 @@
module github.com/ugorji/go/codec
-require (
-github.com/ugorji/go v1.1.7
-)
+go 1.11
+
+require github.com/ugorji/go v1.2.6
diff --git a/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go b/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go
index 9ddbe2059..25c5b0208 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go
@@ -1,6 +1,7 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build go1.5
// +build go1.5
package codec
diff --git a/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go b/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go
index c5fcd6697..a32dfd7de 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go
@@ -1,14 +1,20 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build !go1.5
// +build !go1.5
package codec
-import "reflect"
+import (
+ "errors"
+ "reflect"
+)
const reflectArrayOfSupported = false
+var errNoReflectArrayOf = errors.New("codec: reflect.ArrayOf unsupported by this go version")
+
func reflectArrayOf(count int, elem reflect.Type) reflect.Type {
- panic("codec: reflect.ArrayOf unsupported in this go version")
+ panic(errNoReflectArrayOf)
}
diff --git a/vendor/github.com/ugorji/go/codec/goversion_fmt_time_gte_go15.go b/vendor/github.com/ugorji/go/codec/goversion_fmt_time_gte_go15.go
index a35359887..688d6b62d 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_fmt_time_gte_go15.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_fmt_time_gte_go15.go
@@ -1,12 +1,13 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build go1.5
// +build go1.5
package codec
import "time"
-func fmtTime(t time.Time, b []byte) []byte {
- return t.AppendFormat(b, time.RFC3339Nano)
+func fmtTime(t time.Time, fmt string, b []byte) []byte {
+ return t.AppendFormat(b, fmt)
}
diff --git a/vendor/github.com/ugorji/go/codec/goversion_fmt_time_lt_go15.go b/vendor/github.com/ugorji/go/codec/goversion_fmt_time_lt_go15.go
index 41700c321..a1b8b973e 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_fmt_time_lt_go15.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_fmt_time_lt_go15.go
@@ -1,14 +1,15 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build !go1.5
// +build !go1.5
package codec
import "time"
-func fmtTime(t time.Time, b []byte) []byte {
- s := t.Format(time.RFC3339Nano)
+func fmtTime(t time.Time, fmt string, b []byte) []byte {
+ s := t.Format(fmt)
b = b[:len(s)]
copy(b, s)
return b
diff --git a/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go b/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go110.go
similarity index 67%
rename from vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go
rename to vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go110.go
index cde4cd372..805303172 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go110.go
@@ -1,7 +1,8 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
-// +build !go1.9
+//go:build !go1.10
+// +build !go1.10
package codec
diff --git a/vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go b/vendor/github.com/ugorji/go/codec/goversion_makemap_not_unsafe_gte_go110.go
similarity index 56%
rename from vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go
rename to vendor/github.com/ugorji/go/codec/goversion_makemap_not_unsafe_gte_go110.go
index bc39d6b71..46f787db3 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_makemap_not_unsafe_gte_go110.go
@@ -1,15 +1,14 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
-// +build go1.9
+//go:build go1.10 && (safe || codec.safe || appengine)
+// +build go1.10
+// +build safe codec.safe appengine
package codec
import "reflect"
func makeMapReflect(t reflect.Type, size int) reflect.Value {
- if size < 0 {
- return reflect.MakeMapWithSize(t, 4)
- }
return reflect.MakeMapWithSize(t, size)
}
diff --git a/vendor/github.com/ugorji/go/codec/goversion_makemap_unsafe_gte_go110.go b/vendor/github.com/ugorji/go/codec/goversion_makemap_unsafe_gte_go110.go
new file mode 100644
index 000000000..03c069f0f
--- /dev/null
+++ b/vendor/github.com/ugorji/go/codec/goversion_makemap_unsafe_gte_go110.go
@@ -0,0 +1,25 @@
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
+// Use of this source code is governed by a MIT license found in the LICENSE file.
+
+//go:build go1.10 && !safe && !codec.safe && !appengine
+// +build go1.10,!safe,!codec.safe,!appengine
+
+package codec
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+func makeMapReflect(typ reflect.Type, size int) (rv reflect.Value) {
+ t := (*unsafeIntf)(unsafe.Pointer(&typ)).ptr
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ urv.typ = t
+ urv.flag = uintptr(reflect.Map)
+ urv.ptr = makemap(t, size, nil)
+ return
+}
+
+//go:linkname makemap runtime.makemap
+//go:noescape
+func makemap(typ unsafe.Pointer, size int, h unsafe.Pointer) unsafe.Pointer
diff --git a/vendor/github.com/ugorji/go/codec/goversion_maprange_gte_go112.go b/vendor/github.com/ugorji/go/codec/goversion_maprange_gte_go112.go
index 9931cb6ea..16c8921ba 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_maprange_gte_go112.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_maprange_gte_go112.go
@@ -1,8 +1,9 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build go1.12 && (safe || codec.safe || appengine)
// +build go1.12
-// +build safe
+// +build safe codec.safe appengine
package codec
@@ -14,10 +15,6 @@ type mapIter struct {
values bool
}
-func (t *mapIter) ValidKV() (r bool) {
- return true
-}
-
func (t *mapIter) Next() (r bool) {
return t.t.Next()
}
diff --git a/vendor/github.com/ugorji/go/codec/goversion_maprange_lt_go112.go b/vendor/github.com/ugorji/go/codec/goversion_maprange_lt_go112.go
index 1f020bde0..85c8ea72f 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_maprange_lt_go112.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_maprange_lt_go112.go
@@ -1,8 +1,10 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build go1.7 && !go1.12 && (safe || codec.safe || appengine)
+// +build go1.7
// +build !go1.12
-// +build !go1.7 safe
+// +build safe codec.safe appengine
package codec
@@ -15,10 +17,6 @@ type mapIter struct {
values bool
}
-func (t *mapIter) ValidKV() (r bool) {
- return true
-}
-
func (t *mapIter) Next() (r bool) {
t.j++
return t.j < len(t.keys)
diff --git a/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go b/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go
index 794133a3c..c894a30c1 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go
@@ -1,6 +1,7 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build go1.10
// +build go1.10
package codec
diff --git a/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go b/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go
index fd92ede35..1476eac01 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go
@@ -1,6 +1,7 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build !go1.10
// +build !go1.10
package codec
diff --git a/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go b/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go
index 8debfa613..c093eebd2 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go
@@ -1,10 +1,13 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build !go1.4
// +build !go1.4
package codec
+import "errors"
+
// This codec package will only work for go1.4 and above.
// This is for the following reasons:
// - go 1.4 was released in 2014
@@ -12,6 +15,8 @@ package codec
// - interface only holds pointers
// - reflect.Value is stabilized as 3 words
+var errCodecSupportedOnlyFromGo14 = errors.New("codec: go 1.3 and below are not supported")
+
func init() {
- panic("codec: go 1.3 and below are not supported")
+ panic(errCodecSupportedOnlyFromGo14)
}
diff --git a/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go b/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go
index 0f1bb01e5..e1dfce4a7 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go
@@ -1,6 +1,7 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build go1.5 && !go1.6
// +build go1.5,!go1.6
package codec
diff --git a/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go b/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go
index 2fb4b057d..5cb4564d2 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go
@@ -1,6 +1,7 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build go1.6 && !go1.7
// +build go1.6,!go1.7
package codec
diff --git a/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go b/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go
index c5b815505..82ef3ef88 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go
@@ -1,6 +1,7 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build go1.7
// +build go1.7
package codec
diff --git a/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go b/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go
index 837cf240b..10274048a 100644
--- a/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go
+++ b/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go
@@ -1,6 +1,7 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build !go1.5
// +build !go1.5
package codec
diff --git a/vendor/github.com/ugorji/go/codec/helper.go b/vendor/github.com/ugorji/go/codec/helper.go
index 8f7626bc0..68025c5d8 100644
--- a/vendor/github.com/ugorji/go/codec/helper.go
+++ b/vendor/github.com/ugorji/go/codec/helper.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
@@ -128,9 +128,69 @@ package codec
// For example, in json, we have dedicated functions for ReadMapElemKey, etc
// which do not delegate to readDelim, as readDelim takes a parameter.
// The difference in runtime was as much as 5%.
+//
+// ------------------------------------------
+// Handling Nil
+// - In dynamic (reflection) mode, decodeValue and encodeValue handle nil at the top
+// - Consequently, methods used with them as a parent in the chain e.g. kXXX
+// methods do not handle nil.
+// - Fastpath methods also do not handle nil.
+// The switch called in (en|de)code(...) handles it so the dependent calls don't have to.
+// - codecgen will handle nil before calling into the library for further work also.
+//
+// ------------------------------------------
+// Passing reflect.Kind to functions that take a reflect.Value
+// - Note that reflect.Value.Kind() is very cheap, as its fundamentally a binary AND of 2 numbers
+//
+// ------------------------------------------
+// Transient values during decoding
+//
+// With reflection, the stack is not used. Consequently, values which may be stack-allocated in
+// normal use will cause a heap allocation when using reflection.
+//
+// There are cases where we know that a value is transient, and we just need to decode into it
+// temporarily so we can right away use its value for something else.
+//
+// In these situations, we can elide the heap allocation by being deliberate with use of a pre-cached
+// scratch memory or scratch value.
+//
+// We use this for situations:
+// - decode into a temp value x, and then set x into an interface
+// - decode into a temp value, for use as a map key, to lookup up a map value
+// - decode into a temp value, for use as a map value, to set into a map
+// - decode into a temp value, for sending into a channel
+//
+// By definition, Transient values are NEVER pointer-shaped values,
+// like pointer, func, map, chan. Using transient for pointer-shaped values
+// can lead to data corruption when GC tries to follow what it saw as a pointer at one point.
+//
+// In general, transient values are values which can be decoded as an atomic value
+// using a single call to the decDriver. This naturally includes bool or numeric types.
+//
+// Note that some values which "contain" pointers, specifically string and slice,
+// can also be transient. In the case of string, it is decoded as an atomic value.
+// In the case of a slice, decoding into its elements always uses an addressable
+// value in memory ie we grow the slice, and then decode directly into the memory
+// address corresponding to that index in the slice.
+//
+// To handle these string and slice values, we have to use a scratch value
+// which has the same shape of a string or slice.
+//
+// Consequently, the full range of types which can be transient is:
+// - numbers
+// - bool
+// - string
+// - slice
+//
+// and whbut we MUST use a scratch space with that element
+// being defined as an unsafe.Pointer to start with.
+//
+// We have to be careful with maps. Because we iterate map keys and values during a range,
+// we must have 2 variants of the scratch space/value for maps and keys separately.
+//
+// These are the TransientAddrK and TransientAddr2K methods of decPerType.
import (
- "bytes"
"encoding"
"encoding/binary"
"errors"
@@ -138,32 +198,50 @@ import (
"io"
"math"
"reflect"
+ "runtime"
"sort"
"strconv"
"strings"
"sync"
"sync/atomic"
"time"
+ "unicode/utf8"
)
-const (
- // rvNLen is the length of the array for readn or writen calls
- rwNLen = 7
+// if debugging is true, then
+// - within Encode/Decode, do not recover from panic's
+// - etc
+//
+// Note: Negative tests that check for errors will fail, so only use this
+// when debugging, and run only one test at a time preferably.
+//
+// Note: RPC tests espeially fail, as they depend on getting the error from an Encode/Decode call.
+const debugging = false
- // scratchByteArrayLen = 64
- // initCollectionCap = 16 // 32 is defensive. 16 is preferred.
+const (
+ // containerLenUnknown is length returned from Read(Map|Array)Len
+ // when a format doesn't know apiori.
+ // For example, json doesn't pre-determine the length of a container (sequence/map).
+ containerLenUnknown = -1
+
+ // containerLenNil is length returned from Read(Map|Array)Len
+ // when a 'nil' was encountered in the stream.
+ containerLenNil = math.MinInt32
+
+ // [N]byte is handled by converting to []byte first,
+ // and sending to the dedicated fast-path function for []byte.
+ //
+ // Code exists in case our understanding is wrong.
+ // keep the defensive code behind this flag, so we can remove/hide it if needed.
+ // For now, we enable the defensive code (ie set it to true).
+ handleBytesWithinKArray = true
// Support encoding.(Binary|Text)(Unm|M)arshaler.
// This constant flag will enable or disable it.
supportMarshalInterfaces = true
- // for debugging, set this to false, to catch panic traces.
- // Note that this will always cause rpc tests to fail, since they need io.EOF sent via panic.
- recoverPanicToErr = true
-
- // arrayCacheLen is the length of the cache used in encoder or decoder for
- // allowing zero-alloc initialization.
- // arrayCacheLen = 8
+ // bytesFreeListNoCache is used for debugging, when we want to skip using a cache of []byte.
+ bytesFreeListNoCache = false
// size of the cacheline: defaulting to value for archs: amd64, arm64, 386
// should use "runtime/internal/sys".CacheLineSize, but that is not exposed.
@@ -172,51 +250,132 @@ const (
wordSizeBits = 32 << (^uint(0) >> 63) // strconv.IntSize
wordSize = wordSizeBits / 8
- // so structFieldInfo fits into 8 bytes
- maxLevelsEmbedding = 14
+ // MARKER: determines whether to skip calling fastpath(En|De)codeTypeSwitch.
+ // Calling the fastpath switch in encode() or decode() could be redundant,
+ // as we still have to introspect it again within fnLoad
+ // to determine the function to use for values of that type.
+ skipFastpathTypeSwitchInDirectCall = false
+)
- // xdebug controls whether xdebugf prints any output
- xdebug = true
+const cpu32Bit = ^uint(0)>>32 == 0
+
+type rkind byte
+
+const (
+ rkindPtr = rkind(reflect.Ptr)
+ rkindString = rkind(reflect.String)
+ rkindChan = rkind(reflect.Chan)
+)
+
+type mapKeyFastKind uint8
+
+const (
+ mapKeyFastKind32 = iota + 1
+ mapKeyFastKind32ptr
+ mapKeyFastKind64
+ mapKeyFastKind64ptr
+ mapKeyFastKindStr
)
var (
+ // use a global mutex to ensure each Handle is initialized.
+ // We do this, so we don't have to store the basicHandle mutex
+ // directly in BasicHandle, so it can be shallow-copied.
+ handleInitMu sync.Mutex
+
+ must mustHdl
+ halt panicHdl
+
+ digitCharBitset bitset256
+ numCharBitset bitset256
+ whitespaceCharBitset bitset256
+ asciiAlphaNumBitset bitset256
+
+ // numCharWithExpBitset64 bitset64
+ // numCharNoExpBitset64 bitset64
+ // whitespaceCharBitset64 bitset64
+ //
+ // // hasptrBitset sets bit for all kinds which always have internal pointers
+ // hasptrBitset bitset32
+
+ // refBitset sets bit for all kinds which are direct internal references
+ refBitset bitset32
+
+ // isnilBitset sets bit for all kinds which can be compared to nil
+ isnilBitset bitset32
+
+ // numBoolBitset sets bit for all number and bool kinds
+ numBoolBitset bitset32
+
+ // numBoolStrSliceBitset sets bits for all kinds which are numbers, bool, strings and slices
+ numBoolStrSliceBitset bitset32
+
+ // scalarBitset sets bit for all kinds which are scalars/primitives and thus immutable
+ scalarBitset bitset32
+
+ mapKeyFastKindVals [32]mapKeyFastKind
+
+ // codecgen is set to true by codecgen, so that tests, etc can use this information as needed.
+ codecgen bool
+
oneByteArr [1]byte
zeroByteSlice = oneByteArr[:0:0]
- codecgen bool
-
- panicv panicHdl
-
- refBitset bitset32
- isnilBitset bitset32
- scalarBitset bitset32
+ eofReader devNullReader
)
var (
errMapTypeNotMapKind = errors.New("MapType MUST be of Map Kind")
errSliceTypeNotSliceKind = errors.New("SliceType MUST be of Slice Kind")
+
+ errExtFnWriteExtUnsupported = errors.New("BytesExt.WriteExt is not supported")
+ errExtFnReadExtUnsupported = errors.New("BytesExt.ReadExt is not supported")
+ errExtFnConvertExtUnsupported = errors.New("InterfaceExt.ConvertExt is not supported")
+ errExtFnUpdateExtUnsupported = errors.New("InterfaceExt.UpdateExt is not supported")
+
+ errPanicUndefined = errors.New("panic: undefined error")
+
+ errHandleInited = errors.New("cannot modify initialized Handle")
+
+ errNoFormatHandle = errors.New("no handle (cannot identify format)")
)
-var pool4tiload = sync.Pool{New: func() interface{} { return new(typeInfoLoadArray) }}
+var pool4tiload = sync.Pool{
+ New: func() interface{} {
+ return &typeInfoLoad{
+ etypes: make([]uintptr, 0, 4),
+ sfis: make([]structFieldInfo, 0, 4),
+ sfiNames: make(map[string]uint16, 4),
+ }
+ },
+}
func init() {
- refBitset = refBitset.
- set(byte(reflect.Map)).
- set(byte(reflect.Ptr)).
- set(byte(reflect.Func)).
- set(byte(reflect.Chan)).
- set(byte(reflect.UnsafePointer))
+ xx := func(f mapKeyFastKind, k ...reflect.Kind) {
+ for _, v := range k {
+ mapKeyFastKindVals[byte(v)&31] = f // 'v % 32' equal to 'v & 31'
+ }
+ }
- isnilBitset = isnilBitset.
- set(byte(reflect.Map)).
- set(byte(reflect.Ptr)).
- set(byte(reflect.Func)).
- set(byte(reflect.Chan)).
- set(byte(reflect.UnsafePointer)).
- set(byte(reflect.Interface)).
- set(byte(reflect.Slice))
+ var f mapKeyFastKind
- scalarBitset = scalarBitset.
+ f = mapKeyFastKind64
+ if wordSizeBits == 32 {
+ f = mapKeyFastKind32
+ }
+ xx(f, reflect.Int, reflect.Uint, reflect.Uintptr)
+
+ f = mapKeyFastKind64ptr
+ if wordSizeBits == 32 {
+ f = mapKeyFastKind32ptr
+ }
+ xx(f, reflect.Ptr)
+
+ xx(mapKeyFastKindStr, reflect.String)
+ xx(mapKeyFastKind32, reflect.Uint32, reflect.Int32, reflect.Float32)
+ xx(mapKeyFastKind64, reflect.Uint64, reflect.Int64, reflect.Float64)
+
+ numBoolBitset.
set(byte(reflect.Bool)).
set(byte(reflect.Int)).
set(byte(reflect.Int8)).
@@ -232,22 +391,80 @@ func init() {
set(byte(reflect.Float32)).
set(byte(reflect.Float64)).
set(byte(reflect.Complex64)).
- set(byte(reflect.Complex128)).
+ set(byte(reflect.Complex128))
+
+ numBoolStrSliceBitset = numBoolBitset
+
+ numBoolStrSliceBitset.
+ set(byte(reflect.String)).
+ set(byte(reflect.Slice))
+
+ scalarBitset = numBoolBitset
+
+ scalarBitset.
set(byte(reflect.String))
+ // MARKER: reflect.Array is not a scalar, as its contents can be modified.
+
+ refBitset.
+ set(byte(reflect.Map)).
+ set(byte(reflect.Ptr)).
+ set(byte(reflect.Func)).
+ set(byte(reflect.Chan)).
+ set(byte(reflect.UnsafePointer))
+
+ isnilBitset = refBitset
+
+ isnilBitset.
+ set(byte(reflect.Interface)).
+ set(byte(reflect.Slice))
+
+ // hasptrBitset = isnilBitset
+ //
+ // hasptrBitset.
+ // set(byte(reflect.String))
+
+ for i := byte(0); i <= utf8.RuneSelf; i++ {
+ if (i >= '0' && i <= '9') || (i >= 'a' && i <= 'z') || (i >= 'A' && i <= 'Z') {
+ asciiAlphaNumBitset.set(i)
+ }
+ switch i {
+ case ' ', '\t', '\r', '\n':
+ whitespaceCharBitset.set(i)
+ case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
+ digitCharBitset.set(i)
+ numCharBitset.set(i)
+ case '.', '+', '-':
+ numCharBitset.set(i)
+ case 'e', 'E':
+ numCharBitset.set(i)
+ }
+ }
}
-type handleFlag uint8
+// driverStateManager supports the runtime state of an (enc|dec)Driver.
+//
+// During a side(En|De)code call, we can capture the state, reset it,
+// and then restore it later to continue the primary encoding/decoding.
+type driverStateManager interface {
+ resetState()
+ captureState() interface{}
+ restoreState(state interface{})
+}
-const (
- initedHandleFlag handleFlag = 1 << iota
- binaryHandleFlag
- jsonHandleFlag
-)
+type bdAndBdread struct {
+ bdRead bool
+ bd byte
+}
+
+func (x bdAndBdread) captureState() interface{} { return x }
+func (x *bdAndBdread) resetState() { x.bd, x.bdRead = 0, false }
+func (x *bdAndBdread) reset() { x.resetState() }
+func (x *bdAndBdread) restoreState(v interface{}) { *x = v.(bdAndBdread) }
type clsErr struct {
- closed bool // is it closed?
- errClosed error // error on closing
+ err error // error on closing
+ closed bool // is it closed?
}
type charEncoding uint8
@@ -307,15 +524,6 @@ func (x valueType) String() string {
return strconv.FormatInt(int64(x), 10)
}
-type seqType uint8
-
-const (
- _ seqType = iota
- seqTypeArray
- seqTypeSlice
- seqTypeChan
-)
-
// note that containerMapStart and containerArraySend are not sent.
// This is because the ReadXXXStart and EncodeXXXStart already does these.
type containerState uint8
@@ -338,34 +546,46 @@ const (
// so as not to cause an infinite loop.
const rgetMaxRecursion = 2
-// Anecdotally, we believe most types have <= 12 fields.
-// - even Java's PMD rules set TooManyFields threshold to 15.
-// However, go has embedded fields, which should be regarded as
-// top level, allowing structs to possibly double or triple.
-// In addition, we don't want to keep creating transient arrays,
-// especially for the sfi index tracking, and the evtypes tracking.
+// fauxUnion is used to keep track of the primitives decoded.
//
-// So - try to keep typeInfoLoadArray within 2K bytes
-const (
- typeInfoLoadArraySfisLen = 16
- typeInfoLoadArraySfiidxLen = 8 * 112
- typeInfoLoadArrayEtypesLen = 12
- typeInfoLoadArrayBLen = 8 * 4
-)
+// Without it, we would have to decode each primitive and wrap it
+// in an interface{}, causing an allocation.
+// In this model, the primitives are decoded in a "pseudo-atomic" fashion,
+// so we can rest assured that no other decoding happens while these
+// primitives are being decoded.
+//
+// maps and arrays are not handled by this mechanism.
+type fauxUnion struct {
+ // r RawExt // used for RawExt, uint, []byte.
+
+ // primitives below
+ u uint64
+ i int64
+ f float64
+ l []byte
+ s string
+
+ // ---- cpu cache line boundary?
+ t time.Time
+ b bool
+
+ // state
+ v valueType
+}
// typeInfoLoad is a transient object used while loading up a typeInfo.
type typeInfoLoad struct {
- etypes []uintptr
- sfis []structFieldInfo
+ etypes []uintptr
+ sfis []structFieldInfo
+ sfiNames map[string]uint16
}
-// typeInfoLoadArray is a cache object used to efficiently load up a typeInfo without
-// much allocation.
-type typeInfoLoadArray struct {
- sfis [typeInfoLoadArraySfisLen]structFieldInfo
- sfiidx [typeInfoLoadArraySfiidxLen]byte
- etypes [typeInfoLoadArrayEtypesLen]uintptr
- b [typeInfoLoadArrayBLen]byte // scratch - used for struct field names
+func (x *typeInfoLoad) reset() {
+ x.etypes = x.etypes[:0]
+ x.sfis = x.sfis[:0]
+ for k := range x.sfiNames { // optimized to zero the map
+ delete(x.sfiNames, k)
+ }
}
// mirror json.Marshaler and json.Unmarshaler here,
@@ -382,32 +602,41 @@ type isZeroer interface {
IsZero() bool
}
+type isCodecEmptyer interface {
+ IsCodecEmpty() bool
+}
+
type codecError struct {
- name string
- err interface{}
+ err error
+ name string
+ pos int
+ encode bool
}
-func (e codecError) Cause() error {
- switch xerr := e.err.(type) {
- case nil:
- return nil
- case error:
- return xerr
- case string:
- return errors.New(xerr)
- case fmt.Stringer:
- return errors.New(xerr.String())
- default:
- return fmt.Errorf("%v", e.err)
+func (e *codecError) Cause() error {
+ return e.err
+}
+
+func (e *codecError) Error() string {
+ if e.encode {
+ return fmt.Sprintf("%s encode error: %v", e.name, e.err)
}
+ return fmt.Sprintf("%s decode error [pos %d]: %v", e.name, e.pos, e.err)
}
-func (e codecError) Error() string {
- return fmt.Sprintf("%s error: %v", e.name, e.err)
+func wrapCodecErr(in error, name string, numbytesread int, encode bool) (out error) {
+ x, ok := in.(*codecError)
+ if ok && x.pos == numbytesread && x.name == name && x.encode == encode {
+ return in
+ }
+ return &codecError{in, name, numbytesread, encode}
}
var (
- bigen = binary.BigEndian
+ bigen bigenHelper
+
+ bigenstd = binary.BigEndian
+
structInfoFieldName = "_struct"
mapStrIntfTyp = reflect.TypeOf(map[string]interface{}(nil))
@@ -438,9 +667,11 @@ var (
jsonMarshalerTyp = reflect.TypeOf((*jsonMarshaler)(nil)).Elem()
jsonUnmarshalerTyp = reflect.TypeOf((*jsonUnmarshaler)(nil)).Elem()
- selferTyp = reflect.TypeOf((*Selfer)(nil)).Elem()
- missingFielderTyp = reflect.TypeOf((*MissingFielder)(nil)).Elem()
- iszeroTyp = reflect.TypeOf((*isZeroer)(nil)).Elem()
+ selferTyp = reflect.TypeOf((*Selfer)(nil)).Elem()
+ missingFielderTyp = reflect.TypeOf((*MissingFielder)(nil)).Elem()
+ iszeroTyp = reflect.TypeOf((*isZeroer)(nil)).Elem()
+ isCodecEmptyerTyp = reflect.TypeOf((*isCodecEmptyer)(nil)).Elem()
+ isSelferViaCodecgenerTyp = reflect.TypeOf((*isSelferViaCodecgener)(nil)).Elem()
uint8TypId = rt2id(uint8Typ)
uint8SliceTypId = rt2id(uint8SliceTyp)
@@ -462,42 +693,10 @@ var (
bsAll0xff = []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
chkOvf checkOverflow
-
- errNoFieldNameToStructFieldInfo = errors.New("no field name passed to parseStructFieldInfo")
)
var defTypeInfos = NewTypeInfos([]string{"codec", "json"})
-var immutableKindsSet = [32]bool{
- // reflect.Invalid: ,
- reflect.Bool: true,
- reflect.Int: true,
- reflect.Int8: true,
- reflect.Int16: true,
- reflect.Int32: true,
- reflect.Int64: true,
- reflect.Uint: true,
- reflect.Uint8: true,
- reflect.Uint16: true,
- reflect.Uint32: true,
- reflect.Uint64: true,
- reflect.Uintptr: true,
- reflect.Float32: true,
- reflect.Float64: true,
- reflect.Complex64: true,
- reflect.Complex128: true,
- // reflect.Array
- // reflect.Chan
- // reflect.Func: true,
- // reflect.Interface
- // reflect.Map
- // reflect.Ptr
- // reflect.Slice
- reflect.String: true,
- // reflect.Struct
- // reflect.UnsafePointer
-}
-
// SelfExt is a sentinel extension signifying that types
// registered with it SHOULD be encoded and decoded
// based on the native mode of the format.
@@ -528,6 +727,10 @@ type Selfer interface {
CodecDecodeSelf(*Decoder)
}
+type isSelferViaCodecgener interface {
+ codecSelferViaCodecgen()
+}
+
// MissingFielder defines the interface allowing structs to internally decode or encode
// values which do not map to struct fields.
//
@@ -543,12 +746,18 @@ type MissingFielder interface {
// It returns true if the missing field was set on the struct.
CodecMissingField(field []byte, value interface{}) bool
- // CodecMissingFields returns the set of fields which are not struct fields
+ // CodecMissingFields returns the set of fields which are not struct fields.
+ //
+ // Note that the returned map may be mutated by the caller.
CodecMissingFields() map[string]interface{}
}
-// MapBySlice is a tag interface that denotes wrapped slice should encode as a map in the stream.
-// The slice contains a sequence of key-value pairs.
+// MapBySlice is a tag interface that denotes the slice or array value should encode as a map
+// in the stream, and can be decoded from a map in the stream.
+//
+// The slice or array must contain a sequence of key-value pairs.
+// The length of the slice or array must be even (fully divisible by 2).
+//
// This affords storing a map in a specific sequence in the stream.
//
// Example usage:
@@ -561,13 +770,45 @@ type MissingFielder interface {
// // v2 will be encoded like the map: {"KeyValues": {"one": "1", "two": "2", "three": "3"} }
//
// The support of MapBySlice affords the following:
-// - A slice type which implements MapBySlice will be encoded as a map
+// - A slice or array type which implements MapBySlice will be encoded as a map
// - A slice can be decoded from a map in the stream
-// - It MUST be a slice type (not a pointer receiver) that implements MapBySlice
type MapBySlice interface {
MapBySlice()
}
+// basicHandleRuntimeState holds onto all BasicHandle runtime and cached config information.
+//
+// Storing this outside BasicHandle allows us create shallow copies of a Handle,
+// which can be used e.g. when we need to modify config fields temporarily.
+// Shallow copies are used within tests, so we can modify some config fields for a test
+// temporarily when running tests in parallel, without running the risk that a test executing
+// in parallel with other tests does not see a transient modified values not meant for it.
+type basicHandleRuntimeState struct {
+ // these are used during runtime.
+ // At init time, they should have nothing in them.
+ rtidFns atomicRtidFnSlice
+ rtidFnsNoExt atomicRtidFnSlice
+
+ // Note: basicHandleRuntimeState is not comparable, due to these slices here (extHandle, intf2impls).
+ // If *[]T is used instead, this becomes comparable, at the cost of extra indirection.
+ // Thses slices are used all the time, so keep as slices (not pointers).
+
+ extHandle
+
+ intf2impls
+
+ mu sync.Mutex
+
+ jsonHandle bool
+ binaryHandle bool
+
+ // timeBuiltin is initialized from TimeNotBuiltin, and used internally.
+ // once initialized, it cannot be changed, as the function for encoding/decoding time.Time
+ // will have been cached and the TimeNotBuiltin value will not be consulted thereafter.
+ timeBuiltin bool
+ _ bool // padding
+}
+
// BasicHandle encapsulates the common options and extension functions.
//
// Deprecated: DO NOT USE DIRECTLY. EXPORTED FOR GODOC BENEFIT. WILL BE REMOVED.
@@ -580,14 +821,7 @@ type BasicHandle struct {
// If not configured, the default TypeInfos is used, which uses struct tag keys: codec, json
TypeInfos *TypeInfos
- // Note: BasicHandle is not comparable, due to these slices here (extHandle, intf2impls).
- // If *[]T is used instead, this becomes comparable, at the cost of extra indirection.
- // Thses slices are used all the time, so keep as slices (not pointers).
-
- extHandle
-
- rtidFns atomicRtidFnSlice
- rtidFnsNoExt atomicRtidFnSlice
+ *basicHandleRuntimeState
// ---- cache line
@@ -597,11 +831,6 @@ type BasicHandle struct {
EncodeOptions
- intf2impls
-
- mu sync.Mutex
- inited uint32 // holds if inited, and also handle flags (binary encoding, json handler, etc)
-
RPCOptions
// TimeNotBuiltin configures whether time.Time should be treated as a builtin type.
@@ -618,8 +847,7 @@ type BasicHandle struct {
//
// Note: DO NOT CHANGE AFTER FIRST USE.
//
- // Once a Handle has been used, do not modify this option.
- // It will lead to unexpected behaviour during encoding and decoding.
+ // Once a Handle has been initialized (used), do not modify this option. It will be ignored.
TimeNotBuiltin bool
// ExplicitRelease configures whether Release() is implicitly called after an encode or
@@ -645,16 +873,22 @@ type BasicHandle struct {
ExplicitRelease bool
// ---- cache line
+ inited uint32 // holds if inited, and also handle flags (binary encoding, json handler, etc)
+
}
-// basicHandle returns an initialized BasicHandle from the Handle.
-func basicHandle(hh Handle) (x *BasicHandle) {
- x = hh.getBasicHandle()
- // ** We need to simulate once.Do, to ensure no data race within the block.
- // ** Consequently, below would not work.
+// initHandle does a one-time initialization of the handle.
+// After this is run, do not modify the Handle, as some modifications are ignored
+// e.g. extensions, registered interfaces, TimeNotBuiltIn, etc
+func initHandle(hh Handle) {
+ x := hh.getBasicHandle()
+
+ // MARKER: We need to simulate once.Do, to ensure no data race within the block.
+ // Consequently, below would not work.
+ //
// if atomic.CompareAndSwapUint32(&x.inited, 0, 1) {
// x.be = hh.isBinary()
- // _, x.js = hh.(*JsonHandle)
+ // x.js = hh.isJson
// x.n = hh.Name()[0]
// }
@@ -662,55 +896,113 @@ func basicHandle(hh Handle) (x *BasicHandle) {
// is not sufficient, since a race condition can occur within init(Handle) function.
// init is made noinline, so that this function can be inlined by its caller.
if atomic.LoadUint32(&x.inited) == 0 {
- x.init(hh)
+ x.initHandle(hh)
}
+}
+
+func (x *BasicHandle) basicInit() {
+ x.rtidFns.store(nil)
+ x.rtidFnsNoExt.store(nil)
+ x.timeBuiltin = !x.TimeNotBuiltin
+}
+
+func (x *BasicHandle) init() {}
+
+func (x *BasicHandle) isInited() bool {
+ return atomic.LoadUint32(&x.inited) != 0
+}
+
+// clearInited: DANGEROUS - only use in testing, etc
+func (x *BasicHandle) clearInited() {
+ atomic.StoreUint32(&x.inited, 0)
+}
+
+// TimeBuiltin returns whether time.Time OOTB support is used,
+// based on the initial configuration of TimeNotBuiltin
+func (x *basicHandleRuntimeState) TimeBuiltin() bool {
+ return x.timeBuiltin
+}
+
+func (x *basicHandleRuntimeState) isJs() bool {
+ return x.jsonHandle
+}
+
+func (x *basicHandleRuntimeState) isBe() bool {
+ return x.binaryHandle
+}
+
+func (x *basicHandleRuntimeState) setExt(rt reflect.Type, tag uint64, ext Ext) (err error) {
+ rk := rt.Kind()
+ for rk == reflect.Ptr {
+ rt = rt.Elem()
+ rk = rt.Kind()
+ }
+
+ if rt.PkgPath() == "" || rk == reflect.Interface { // || rk == reflect.Ptr {
+ return fmt.Errorf("codec.Handle.SetExt: Takes named type, not a pointer or interface: %v", rt)
+ }
+
+ rtid := rt2id(rt)
+ switch rtid {
+ case timeTypId, rawTypId, rawExtTypId:
+ // these are all natively supported type, so they cannot have an extension.
+ // However, we do not return an error for these, as we do not document that.
+ // Instead, we silently treat as a no-op, and return.
+ return
+ }
+ for i := range x.extHandle {
+ v := &x.extHandle[i]
+ if v.rtid == rtid {
+ v.tag, v.ext = tag, ext
+ return
+ }
+ }
+ rtidptr := rt2id(reflect.PtrTo(rt))
+ x.extHandle = append(x.extHandle, extTypeTagFn{rtid, rtidptr, rt, tag, ext})
return
}
-func (x *BasicHandle) isJs() bool {
- return handleFlag(x.inited)&jsonHandleFlag != 0
-}
-
-func (x *BasicHandle) isBe() bool {
- return handleFlag(x.inited)&binaryHandleFlag != 0
-}
-
+// initHandle should be called only from codec.initHandle global function.
+// make it uninlineable, as it is called at most once for each handle.
//go:noinline
-func (x *BasicHandle) init(hh Handle) {
- // make it uninlineable, as it is called at most once
- x.mu.Lock()
+func (x *BasicHandle) initHandle(hh Handle) {
+ handleInitMu.Lock()
+ defer handleInitMu.Unlock() // use defer, as halt may panic below
if x.inited == 0 {
- var f = initedHandleFlag
- if hh.isBinary() {
- f |= binaryHandleFlag
+ if x.basicHandleRuntimeState == nil {
+ x.basicHandleRuntimeState = new(basicHandleRuntimeState)
}
- if _, b := hh.(*JsonHandle); b {
- f |= jsonHandleFlag
- }
- atomic.StoreUint32(&x.inited, uint32(f))
+ x.jsonHandle = hh.isJson()
+ x.binaryHandle = hh.isBinary()
// ensure MapType and SliceType are of correct type
if x.MapType != nil && x.MapType.Kind() != reflect.Map {
- panic(errMapTypeNotMapKind)
+ halt.onerror(errMapTypeNotMapKind)
}
if x.SliceType != nil && x.SliceType.Kind() != reflect.Slice {
- panic(errSliceTypeNotSliceKind)
+ halt.onerror(errSliceTypeNotSliceKind)
}
+ x.basicInit()
+ hh.init()
+ atomic.StoreUint32(&x.inited, 1)
}
- x.mu.Unlock()
}
func (x *BasicHandle) getBasicHandle() *BasicHandle {
return x
}
-func (x *BasicHandle) getTypeInfo(rtid uintptr, rt reflect.Type) (pti *typeInfo) {
- if x.TypeInfos == nil {
- return defTypeInfos.get(rtid, rt)
+func (x *BasicHandle) typeInfos() *TypeInfos {
+ if x.TypeInfos != nil {
+ return x.TypeInfos
}
- return x.TypeInfos.get(rtid, rt)
+ return defTypeInfos
}
-func findFn(s []codecRtidFn, rtid uintptr) (i uint, fn *codecFn) {
+func (x *BasicHandle) getTypeInfo(rtid uintptr, rt reflect.Type) (pti *typeInfo) {
+ return x.typeInfos().get(rtid, rt)
+}
+
+func findRtidFn(s []codecRtidFn, rtid uintptr) (i uint, fn *codecFn) {
// binary search. adapted from sort/search.go.
// Note: we use goto (instead of for loop) so this can be inlined.
@@ -719,7 +1011,7 @@ func findFn(s []codecRtidFn, rtid uintptr) (i uint, fn *codecFn) {
var j = uint(len(s))
LOOP:
if i < j {
- h = i + (j-i)/2
+ h = (i + j) >> 1 // avoid overflow when computing h // h = i + (j-i)/2
if s[h].rtid < rtid {
i = h + 1
} else {
@@ -734,34 +1026,36 @@ LOOP:
}
func (x *BasicHandle) fn(rt reflect.Type) (fn *codecFn) {
- return x.fnVia(rt, &x.rtidFns, true)
+ return x.fnVia(rt, x.typeInfos(), &x.rtidFns, x.CheckCircularRef, true)
}
func (x *BasicHandle) fnNoExt(rt reflect.Type) (fn *codecFn) {
- return x.fnVia(rt, &x.rtidFnsNoExt, false)
+ return x.fnVia(rt, x.typeInfos(), &x.rtidFnsNoExt, x.CheckCircularRef, false)
}
-func (x *BasicHandle) fnVia(rt reflect.Type, fs *atomicRtidFnSlice, checkExt bool) (fn *codecFn) {
+func (x *basicHandleRuntimeState) fnVia(rt reflect.Type, tinfos *TypeInfos, fs *atomicRtidFnSlice, checkCircularRef, checkExt bool) (fn *codecFn) {
rtid := rt2id(rt)
sp := fs.load()
if sp != nil {
- if _, fn = findFn(sp, rtid); fn != nil {
+ if _, fn = findRtidFn(sp, rtid); fn != nil {
return
}
}
- fn = x.fnLoad(rt, rtid, checkExt)
+
+ fn = x.fnLoad(rt, rtid, tinfos, checkCircularRef, checkExt)
x.mu.Lock()
- var sp2 []codecRtidFn
sp = fs.load()
+ // since this is an atomic load/store, we MUST use a different array each time,
+ // else we have a data race when a store is happening simultaneously with a findRtidFn call.
if sp == nil {
- sp2 = []codecRtidFn{{rtid, fn}}
- fs.store(sp2)
+ sp = []codecRtidFn{{rtid, fn}}
+ fs.store(sp)
} else {
- idx, fn2 := findFn(sp, rtid)
+ idx, fn2 := findRtidFn(sp, rtid)
if fn2 == nil {
- sp2 = make([]codecRtidFn, len(sp)+1)
- copy(sp2, sp[:idx])
+ sp2 := make([]codecRtidFn, len(sp)+1)
copy(sp2[idx+1:], sp[idx:])
+ copy(sp2, sp[:idx])
sp2[idx] = codecRtidFn{rtid, fn}
fs.store(sp2)
}
@@ -770,17 +1064,38 @@ func (x *BasicHandle) fnVia(rt reflect.Type, fs *atomicRtidFnSlice, checkExt boo
return
}
-func (x *BasicHandle) fnLoad(rt reflect.Type, rtid uintptr, checkExt bool) (fn *codecFn) {
+func fnloadFastpathUnderlying(ti *typeInfo) (f *fastpathE, u reflect.Type) {
+ var rtid uintptr
+ var idx int
+ rtid = rt2id(ti.fastpathUnderlying)
+ idx = fastpathAvIndex(rtid)
+ if idx == -1 {
+ return
+ }
+ f = &fastpathAv[idx]
+ if uint8(reflect.Array) == ti.kind {
+ u = reflectArrayOf(ti.rt.Len(), ti.elem)
+ } else {
+ u = f.rt
+ }
+ return
+}
+
+func (x *basicHandleRuntimeState) fnLoad(rt reflect.Type, rtid uintptr, tinfos *TypeInfos, checkCircularRef, checkExt bool) (fn *codecFn) {
fn = new(codecFn)
fi := &(fn.i)
- ti := x.getTypeInfo(rtid, rt)
+ ti := tinfos.get(rtid, rt)
fi.ti = ti
-
rk := reflect.Kind(ti.kind)
- // anything can be an extension except the built-in ones: time, raw and rawext
+ // anything can be an extension except the built-in ones: time, raw and rawext.
+ // ensure we check for these types, then if extension, before checking if
+ // it implementes one of the pre-declared interfaces.
- if rtid == timeTypId && !x.TimeNotBuiltin {
+ fi.addrDf = true
+ // fi.addrEf = true
+
+ if rtid == timeTypId && x.timeBuiltin {
fn.fe = (*Encoder).kTime
fn.fd = (*Decoder).kTime
} else if rtid == rawTypId {
@@ -789,83 +1104,98 @@ func (x *BasicHandle) fnLoad(rt reflect.Type, rtid uintptr, checkExt bool) (fn *
} else if rtid == rawExtTypId {
fn.fe = (*Encoder).rawExt
fn.fd = (*Decoder).rawExt
- fi.addrF = true
fi.addrD = true
fi.addrE = true
} else if xfFn := x.getExt(rtid, checkExt); xfFn != nil {
fi.xfTag, fi.xfFn = xfFn.tag, xfFn.ext
fn.fe = (*Encoder).ext
fn.fd = (*Decoder).ext
- fi.addrF = true
fi.addrD = true
if rk == reflect.Struct || rk == reflect.Array {
fi.addrE = true
}
- } else if ti.isFlag(tiflagSelfer) || ti.isFlag(tiflagSelferPtr) {
+ } else if (ti.flagSelfer || ti.flagSelferPtr) &&
+ !(checkCircularRef && ti.flagSelferViaCodecgen && ti.kind == byte(reflect.Struct)) {
+ // do not use Selfer generated by codecgen if it is a struct and CheckCircularRef=true
fn.fe = (*Encoder).selferMarshal
fn.fd = (*Decoder).selferUnmarshal
- fi.addrF = true
- fi.addrD = ti.isFlag(tiflagSelferPtr)
- fi.addrE = ti.isFlag(tiflagSelferPtr)
+ fi.addrD = ti.flagSelferPtr
+ fi.addrE = ti.flagSelferPtr
} else if supportMarshalInterfaces && x.isBe() &&
- (ti.isFlag(tiflagBinaryMarshaler) || ti.isFlag(tiflagBinaryMarshalerPtr)) &&
- (ti.isFlag(tiflagBinaryUnmarshaler) || ti.isFlag(tiflagBinaryUnmarshalerPtr)) {
+ (ti.flagBinaryMarshaler || ti.flagBinaryMarshalerPtr) &&
+ (ti.flagBinaryUnmarshaler || ti.flagBinaryUnmarshalerPtr) {
fn.fe = (*Encoder).binaryMarshal
fn.fd = (*Decoder).binaryUnmarshal
- fi.addrF = true
- fi.addrD = ti.isFlag(tiflagBinaryUnmarshalerPtr)
- fi.addrE = ti.isFlag(tiflagBinaryMarshalerPtr)
+ fi.addrD = ti.flagBinaryUnmarshalerPtr
+ fi.addrE = ti.flagBinaryMarshalerPtr
} else if supportMarshalInterfaces && !x.isBe() && x.isJs() &&
- (ti.isFlag(tiflagJsonMarshaler) || ti.isFlag(tiflagJsonMarshalerPtr)) &&
- (ti.isFlag(tiflagJsonUnmarshaler) || ti.isFlag(tiflagJsonUnmarshalerPtr)) {
+ (ti.flagJsonMarshaler || ti.flagJsonMarshalerPtr) &&
+ (ti.flagJsonUnmarshaler || ti.flagJsonUnmarshalerPtr) {
//If JSON, we should check JSONMarshal before textMarshal
fn.fe = (*Encoder).jsonMarshal
fn.fd = (*Decoder).jsonUnmarshal
- fi.addrF = true
- fi.addrD = ti.isFlag(tiflagJsonUnmarshalerPtr)
- fi.addrE = ti.isFlag(tiflagJsonMarshalerPtr)
+ fi.addrD = ti.flagJsonUnmarshalerPtr
+ fi.addrE = ti.flagJsonMarshalerPtr
} else if supportMarshalInterfaces && !x.isBe() &&
- (ti.isFlag(tiflagTextMarshaler) || ti.isFlag(tiflagTextMarshalerPtr)) &&
- (ti.isFlag(tiflagTextUnmarshaler) || ti.isFlag(tiflagTextUnmarshalerPtr)) {
+ (ti.flagTextMarshaler || ti.flagTextMarshalerPtr) &&
+ (ti.flagTextUnmarshaler || ti.flagTextUnmarshalerPtr) {
fn.fe = (*Encoder).textMarshal
fn.fd = (*Decoder).textUnmarshal
- fi.addrF = true
- fi.addrD = ti.isFlag(tiflagTextUnmarshalerPtr)
- fi.addrE = ti.isFlag(tiflagTextMarshalerPtr)
+ fi.addrD = ti.flagTextUnmarshalerPtr
+ fi.addrE = ti.flagTextMarshalerPtr
} else {
- if fastpathEnabled && (rk == reflect.Map || rk == reflect.Slice) {
- if ti.pkgpath == "" { // un-named slice or map
- if idx := fastpathAV.index(rtid); idx != -1 {
- fn.fe = fastpathAV[idx].encfn
- fn.fd = fastpathAV[idx].decfn
+ if fastpathEnabled && (rk == reflect.Map || rk == reflect.Slice || rk == reflect.Array) {
+ // by default (without using unsafe),
+ // if an array is not addressable, converting from an array to a slice
+ // requires an allocation (see helper_not_unsafe.go: func rvGetSlice4Array).
+ //
+ // (Non-addressable arrays mostly occur as keys/values from a map).
+ //
+ // However, fastpath functions are mostly for slices of numbers or strings,
+ // which are small by definition and thus allocation should be fast/cheap in time.
+ //
+ // Consequently, the value of doing this quick allocation to elide the overhead cost of
+ // non-optimized (not-unsafe) reflection is a fair price.
+ var rtid2 uintptr
+ if !ti.flagHasPkgPath { // un-named type (slice or mpa or array)
+ rtid2 = rtid
+ if rk == reflect.Array {
+ rtid2 = rt2id(ti.key) // ti.key for arrays = reflect.SliceOf(ti.elem)
+ }
+ if idx := fastpathAvIndex(rtid2); idx != -1 {
+ fn.fe = fastpathAv[idx].encfn
+ fn.fd = fastpathAv[idx].decfn
fi.addrD = true
- fi.addrF = false
- }
- } else {
- // use mapping for underlying type if there
- var rtu reflect.Type
- if rk == reflect.Map {
- rtu = reflect.MapOf(ti.key, ti.elem)
- } else {
- rtu = reflect.SliceOf(ti.elem)
- }
- rtuid := rt2id(rtu)
- if idx := fastpathAV.index(rtuid); idx != -1 {
- xfnf := fastpathAV[idx].encfn
- xrt := fastpathAV[idx].rt
- fn.fe = func(e *Encoder, xf *codecFnInfo, xrv reflect.Value) {
- xfnf(e, xf, rvConvert(xrv, xrt))
+ fi.addrDf = false
+ if rk == reflect.Array {
+ fi.addrD = false // decode directly into array value (slice made from it)
}
- fi.addrD = true
- fi.addrF = false // meaning it can be an address(ptr) or a value
- xfnf2 := fastpathAV[idx].decfn
- xptr2rt := reflect.PtrTo(xrt)
- fn.fd = func(d *Decoder, xf *codecFnInfo, xrv reflect.Value) {
- if xrv.Kind() == reflect.Ptr {
- xfnf2(d, xf, rvConvert(xrv, xptr2rt))
- } else {
+ }
+ } else { // named type (with underlying type of map or slice or array)
+ // try to use mapping for underlying type
+ xfe, xrt := fnloadFastpathUnderlying(ti)
+ if xfe != nil {
+ xfnf := xfe.encfn
+ xfnf2 := xfe.decfn
+ if rk == reflect.Array {
+ fi.addrD = false // decode directly into array value (slice made from it)
+ fn.fd = func(d *Decoder, xf *codecFnInfo, xrv reflect.Value) {
xfnf2(d, xf, rvConvert(xrv, xrt))
}
+ } else {
+ fi.addrD = true
+ fi.addrDf = false // meaning it can be an address(ptr) or a value
+ xptr2rt := reflect.PtrTo(xrt)
+ fn.fd = func(d *Decoder, xf *codecFnInfo, xrv reflect.Value) {
+ if xrv.Kind() == reflect.Ptr {
+ xfnf2(d, xf, rvConvert(xrv, xptr2rt))
+ } else {
+ xfnf2(d, xf, rvConvert(xrv, xrt))
+ }
+ }
+ }
+ fn.fe = func(e *Encoder, xf *codecFnInfo, xrv reflect.Value) {
+ xfnf(e, xf, rvConvert(xrv, xrt))
}
}
}
@@ -876,9 +1206,9 @@ func (x *BasicHandle) fnLoad(rt reflect.Type, rtid uintptr, checkExt bool) (fn *
fn.fe = (*Encoder).kBool
fn.fd = (*Decoder).kBool
case reflect.String:
- // Do not use different functions based on StringToRaw option,
- // as that will statically set the function for a string type,
- // and if the Handle is modified thereafter, behaviour is non-deterministic.
+ // Do not use different functions based on StringToRaw option, as that will statically
+ // set the function for a string type, and if the Handle is modified thereafter,
+ // behaviour is non-deterministic
// i.e. DO NOT DO:
// if x.StringToRaw {
// fn.fe = (*Encoder).kStringToRaw
@@ -927,31 +1257,26 @@ func (x *BasicHandle) fnLoad(rt reflect.Type, rtid uintptr, checkExt bool) (fn *
case reflect.Float64:
fn.fe = (*Encoder).kFloat64
fn.fd = (*Decoder).kFloat64
- case reflect.Invalid:
- fn.fe = (*Encoder).kInvalid
- fn.fd = (*Decoder).kErr
+ case reflect.Complex64:
+ fn.fe = (*Encoder).kComplex64
+ fn.fd = (*Decoder).kComplex64
+ case reflect.Complex128:
+ fn.fe = (*Encoder).kComplex128
+ fn.fd = (*Decoder).kComplex128
case reflect.Chan:
- fi.seq = seqTypeChan
fn.fe = (*Encoder).kChan
- fn.fd = (*Decoder).kSliceForChan
+ fn.fd = (*Decoder).kChan
case reflect.Slice:
- fi.seq = seqTypeSlice
fn.fe = (*Encoder).kSlice
fn.fd = (*Decoder).kSlice
case reflect.Array:
- fi.seq = seqTypeArray
+ fi.addrD = false // decode directly into array value (slice made from it)
fn.fe = (*Encoder).kArray
- fi.addrF = false
- fi.addrD = false
- rt2 := reflect.SliceOf(ti.elem)
- fn.fd = func(d *Decoder, xf *codecFnInfo, xrv reflect.Value) {
- // call fnVia directly, so fn(...) is not recursive, and can be inlined
- d.h.fnVia(rt2, &x.rtidFns, true).fd(d, xf, rvGetSlice4Array(xrv, rt2))
- }
+ fn.fd = (*Decoder).kArray
case reflect.Struct:
if ti.anyOmitEmpty ||
- ti.isFlag(tiflagMissingFielder) ||
- ti.isFlag(tiflagMissingFielderPtr) {
+ ti.flagMissingFielder ||
+ ti.flagMissingFielderPtr {
fn.fe = (*Encoder).kStruct
} else {
fn.fe = (*Encoder).kStructNoOmitempty
@@ -991,12 +1316,15 @@ func (x *BasicHandle) fnLoad(rt reflect.Type, rtid uintptr, checkExt bool) (fn *
// Such a pre-configured Handle is safe for concurrent access.
type Handle interface {
Name() string
- // return the basic handle. It may not have been inited.
- // Prefer to use basicHandle() helper function that ensures it has been inited.
getBasicHandle() *BasicHandle
newEncDriver() encDriver
newDecDriver() decDriver
isBinary() bool
+ isJson() bool // json is special for now, so track it
+ // desc describes the current byte descriptor, or returns "unknown[XXX]" if not understood.
+ desc(bd byte) string
+ // init initializes the handle based on handle-specific info (beyond what is in BasicHandle)
+ init()
}
// Raw represents raw formatted bytes.
@@ -1022,6 +1350,14 @@ type RawExt struct {
Value interface{}
}
+func (re *RawExt) setData(xbs []byte, zerocopy bool) {
+ if zerocopy {
+ re.Data = xbs
+ } else {
+ re.Data = append(re.Data[:0], xbs...)
+ }
+}
+
// BytesExt handles custom (de)serialization of types to/from []byte.
// It is used by codecs (e.g. binc, msgpack, simple) which do custom serialization of the types.
type BytesExt interface {
@@ -1067,17 +1403,13 @@ type addExtWrapper struct {
}
func (x addExtWrapper) WriteExt(v interface{}) []byte {
- bs, err := x.encFn(rv4i(v))
- if err != nil {
- panic(err)
- }
+ bs, err := x.encFn(reflect.ValueOf(v))
+ halt.onerror(err)
return bs
}
func (x addExtWrapper) ReadExt(v interface{}, bs []byte) {
- if err := x.decFn(rv4i(v), bs); err != nil {
- panic(err)
- }
+ halt.onerror(x.decFn(reflect.ValueOf(v), bs))
}
func (x addExtWrapper) ConvertExt(v interface{}) interface{} {
@@ -1091,21 +1423,21 @@ func (x addExtWrapper) UpdateExt(dest interface{}, v interface{}) {
type bytesExtFailer struct{}
func (bytesExtFailer) WriteExt(v interface{}) []byte {
- panicv.errorstr("BytesExt.WriteExt is not supported")
+ halt.onerror(errExtFnWriteExtUnsupported)
return nil
}
func (bytesExtFailer) ReadExt(v interface{}, bs []byte) {
- panicv.errorstr("BytesExt.ReadExt is not supported")
+ halt.onerror(errExtFnReadExtUnsupported)
}
type interfaceExtFailer struct{}
func (interfaceExtFailer) ConvertExt(v interface{}) interface{} {
- panicv.errorstr("InterfaceExt.ConvertExt is not supported")
+ halt.onerror(errExtFnConvertExtUnsupported)
return nil
}
func (interfaceExtFailer) UpdateExt(dest interface{}, v interface{}) {
- panicv.errorstr("InterfaceExt.UpdateExt is not supported")
+ halt.onerror(errExtFnUpdateExtUnsupported)
}
type bytesExtWrapper struct {
@@ -1126,10 +1458,16 @@ type extFailWrapper struct {
type binaryEncodingType struct{}
func (binaryEncodingType) isBinary() bool { return true }
+func (binaryEncodingType) isJson() bool { return false }
type textEncodingType struct{}
func (textEncodingType) isBinary() bool { return false }
+func (textEncodingType) isJson() bool { return false }
+
+type notJsonType struct{}
+
+func (notJsonType) isJson() bool { return false }
// noBuiltInTypes is embedded into many types which do not support builtins
// e.g. msgpack, simple, cbor.
@@ -1139,26 +1477,83 @@ type noBuiltInTypes struct{}
func (noBuiltInTypes) EncodeBuiltin(rt uintptr, v interface{}) {}
func (noBuiltInTypes) DecodeBuiltin(rt uintptr, v interface{}) {}
-// bigenHelper.
-// Users must already slice the x completely, because we will not reslice.
-type bigenHelper struct {
- x []byte // must be correctly sliced to appropriate len. slicing is a cost.
- w *encWr
+// bigenHelper handles ByteOrder operations directly using
+// arrays of bytes (not slice of bytes).
+//
+// Since byteorder operations are very common for encoding and decoding
+// numbers, lengths, etc - it is imperative that this operation is as
+// fast as possible. Removing indirection (pointer chasing) to look
+// at up to 8 bytes helps a lot here.
+//
+// For times where it is expedient to use a slice, delegate to the
+// bigenstd (equal to the binary.BigEndian value).
+//
+// retrofitted from stdlib: encoding/binary/BigEndian (ByteOrder)
+type bigenHelper struct{}
+
+func (z bigenHelper) PutUint16(v uint16) (b [2]byte) {
+ return [...]byte{
+ byte(v >> 8),
+ byte(v),
+ }
}
-func (z bigenHelper) writeUint16(v uint16) {
- bigen.PutUint16(z.x, v)
- z.w.writeb(z.x)
+func (z bigenHelper) PutUint32(v uint32) (b [4]byte) {
+ return [...]byte{
+ byte(v >> 24),
+ byte(v >> 16),
+ byte(v >> 8),
+ byte(v),
+ }
}
-func (z bigenHelper) writeUint32(v uint32) {
- bigen.PutUint32(z.x, v)
- z.w.writeb(z.x)
+func (z bigenHelper) PutUint64(v uint64) (b [8]byte) {
+ return [...]byte{
+ byte(v >> 56),
+ byte(v >> 48),
+ byte(v >> 40),
+ byte(v >> 32),
+ byte(v >> 24),
+ byte(v >> 16),
+ byte(v >> 8),
+ byte(v),
+ }
}
-func (z bigenHelper) writeUint64(v uint64) {
- bigen.PutUint64(z.x, v)
- z.w.writeb(z.x)
+func (z bigenHelper) Uint16(b [2]byte) (v uint16) {
+ return uint16(b[1]) |
+ uint16(b[0])<<8
+}
+
+func (z bigenHelper) Uint32(b [4]byte) (v uint32) {
+ return uint32(b[3]) |
+ uint32(b[2])<<8 |
+ uint32(b[1])<<16 |
+ uint32(b[0])<<24
+}
+
+func (z bigenHelper) Uint64(b [8]byte) (v uint64) {
+ return uint64(b[7]) |
+ uint64(b[6])<<8 |
+ uint64(b[5])<<16 |
+ uint64(b[4])<<24 |
+ uint64(b[3])<<32 |
+ uint64(b[2])<<40 |
+ uint64(b[1])<<48 |
+ uint64(b[0])<<56
+}
+
+func (z bigenHelper) writeUint16(w *encWr, v uint16) {
+ x := z.PutUint16(v)
+ w.writen2(x[0], x[1])
+}
+
+func (z bigenHelper) writeUint32(w *encWr, v uint32) {
+ w.writen4(z.PutUint32(v))
+}
+
+func (z bigenHelper) writeUint64(w *encWr, v uint64) {
+ w.writen8(z.PutUint64(v))
}
type extTypeTagFn struct {
@@ -1167,7 +1562,6 @@ type extTypeTagFn struct {
rt reflect.Type
tag uint64
ext Ext
- // _ [1]uint64 // padding
}
type extHandle []extTypeTagFn
@@ -1176,13 +1570,13 @@ type extHandle []extTypeTagFn
// To deregister an Ext, call AddExt with nil encfn and/or nil decfn.
//
// Deprecated: Use SetBytesExt or SetInterfaceExt on the Handle instead.
-func (o *extHandle) AddExt(rt reflect.Type, tag byte,
+func (x *BasicHandle) AddExt(rt reflect.Type, tag byte,
encfn func(reflect.Value) ([]byte, error),
decfn func(reflect.Value, []byte) error) (err error) {
if encfn == nil || decfn == nil {
- return o.SetExt(rt, uint64(tag), nil)
+ return x.SetExt(rt, uint64(tag), nil)
}
- return o.SetExt(rt, uint64(tag), addExtWrapper{encfn, decfn})
+ return x.SetExt(rt, uint64(tag), addExtWrapper{encfn, decfn})
}
// SetExt will set the extension for a tag and reflect.Type.
@@ -1191,38 +1585,20 @@ func (o *extHandle) AddExt(rt reflect.Type, tag byte,
// To Deregister an ext, call SetExt with nil Ext.
//
// Deprecated: Use SetBytesExt or SetInterfaceExt on the Handle instead.
-func (o *extHandle) SetExt(rt reflect.Type, tag uint64, ext Ext) (err error) {
- // o is a pointer, because we may need to initialize it
- // We EXPECT *o is a pointer to a non-nil extHandle.
+func (x *BasicHandle) SetExt(rt reflect.Type, tag uint64, ext Ext) (err error) {
+ if x.isInited() {
+ return errHandleInited
+ }
+ if x.basicHandleRuntimeState == nil {
+ x.basicHandleRuntimeState = new(basicHandleRuntimeState)
+ }
+ return x.basicHandleRuntimeState.setExt(rt, tag, ext)
+}
- rk := rt.Kind()
- for rk == reflect.Ptr {
- rt = rt.Elem()
- rk = rt.Kind()
+func (o extHandle) getExtForI(x interface{}) (v *extTypeTagFn) {
+ if len(o) > 0 {
+ v = o.getExt(i2rtid(x), true)
}
-
- if rt.PkgPath() == "" || rk == reflect.Interface { // || rk == reflect.Ptr {
- return fmt.Errorf("codec.Handle.SetExt: Takes named type, not a pointer or interface: %v", rt)
- }
-
- rtid := rt2id(rt)
- switch rtid {
- case timeTypId, rawTypId, rawExtTypId:
- // all natively supported type, so cannot have an extension.
- // However, we do not return an error for these, as we do not document that.
- // Instead, we silently treat as a no-op, and return.
- return
- }
- o2 := *o
- for i := range o2 {
- v := &o2[i]
- if v.rtid == rtid {
- v.tag, v.ext = tag, ext
- return
- }
- }
- rtidptr := rt2id(reflect.PtrTo(rt))
- *o = append(o2, extTypeTagFn{rtid, rtidptr, rt, tag, ext}) // , [1]uint64{}})
return
}
@@ -1252,7 +1628,6 @@ func (o extHandle) getExtForTag(tag uint64) (v *extTypeTagFn) {
type intf2impl struct {
rtid uintptr // for intf
impl reflect.Type
- // _ [1]uint64 // padding // not-needed, as *intf2impl is never returned.
}
type intf2impls []intf2impl
@@ -1297,67 +1672,79 @@ func (o intf2impls) intf2impl(rtid uintptr) (rv reflect.Value) {
return
}
-type structFieldInfoFlag uint8
+// structFieldinfopathNode is a node in a tree, which allows us easily
+// walk the anonymous path.
+//
+// In the typical case, the node is not embedded/anonymous, and thus the parent
+// will be nil and this information becomes a value (not needing any indirection).
+type structFieldInfoPathNode struct {
+ parent *structFieldInfoPathNode
-const (
- _ structFieldInfoFlag = 1 << iota
- structFieldInfoFlagReady
- structFieldInfoFlagOmitEmpty
-)
+ offset uint16
+ index uint16
+ kind uint8
+ numderef uint8
-func (x *structFieldInfoFlag) flagSet(f structFieldInfoFlag) {
- *x = *x | f
+ // encNameAsciiAlphaNum and omitEmpty should be in structFieldInfo,
+ // but are kept here for tighter packaging.
+
+ encNameAsciiAlphaNum bool // the encName only contains ascii alphabet and numbers
+ omitEmpty bool
+
+ typ reflect.Type
}
-func (x *structFieldInfoFlag) flagClr(f structFieldInfoFlag) {
- *x = *x &^ f
+// depth returns number of valid nodes in the hierachy
+func (path *structFieldInfoPathNode) depth() (d int) {
+TOP:
+ if path != nil {
+ d++
+ path = path.parent
+ goto TOP
+ }
+ return
}
-func (x structFieldInfoFlag) flagGet(f structFieldInfoFlag) bool {
- return x&f != 0
+// field returns the field of the struct.
+func (path *structFieldInfoPathNode) field(v reflect.Value) (rv2 reflect.Value) {
+ if parent := path.parent; parent != nil {
+ v = parent.field(v)
+ for j, k := uint8(0), parent.numderef; j < k; j++ {
+ if rvIsNil(v) {
+ return
+ }
+ v = v.Elem()
+ }
+ }
+ return path.rvField(v)
}
-func (x structFieldInfoFlag) omitEmpty() bool {
- return x.flagGet(structFieldInfoFlagOmitEmpty)
-}
-
-func (x structFieldInfoFlag) ready() bool {
- return x.flagGet(structFieldInfoFlagReady)
+// fieldAlloc returns the field of the struct.
+// It allocates if a nil value was seen while searching.
+func (path *structFieldInfoPathNode) fieldAlloc(v reflect.Value) (rv2 reflect.Value) {
+ if parent := path.parent; parent != nil {
+ v = parent.fieldAlloc(v)
+ for j, k := uint8(0), parent.numderef; j < k; j++ {
+ if rvIsNil(v) {
+ rvSetDirect(v, reflect.New(rvType(v).Elem()))
+ }
+ v = v.Elem()
+ }
+ }
+ return path.rvField(v)
}
type structFieldInfo struct {
- encName string // encode name
- fieldName string // field name
+ encName string // encode name
- is [maxLevelsEmbedding]uint16 // (recursive/embedded) field index in struct
- nis uint8 // num levels of embedding. if 1, then it's not embedded.
+ // encNameHash uintptr
- encNameAsciiAlphaNum bool // the encName only contains ascii alphabet and numbers
- structFieldInfoFlag
- // _ [1]byte // padding
-}
+ // fieldName string // currently unused
-// func (si *structFieldInfo) setToZeroValue(v reflect.Value) {
-// if v, valid := si.field(v, false); valid {
-// v.Set(reflect.Zero(v.Type()))
-// }
-// }
+ // encNameAsciiAlphaNum and omitEmpty should be here,
+ // but are stored in structFieldInfoPathNode for tighter packaging.
-// rv returns the field of the struct.
-// If anonymous, it returns an Invalid
-func (si *structFieldInfo) field(v reflect.Value, update bool) (rv2 reflect.Value, valid bool) {
- // replicate FieldByIndex
- for i, x := range si.is {
- if uint8(i) == si.nis {
- break
- }
- if v, valid = baseStructRv(v, update); !valid {
- return
- }
- v = v.Field(int(x))
- }
-
- return v, true
+ path structFieldInfoPathNode
}
func parseStructInfo(stag string) (toArray, omitEmpty bool, keytype valueType) {
@@ -1365,35 +1752,32 @@ func parseStructInfo(stag string) (toArray, omitEmpty bool, keytype valueType) {
if stag == "" {
return
}
- for i, s := range strings.Split(stag, ",") {
- if i == 0 {
- } else {
- switch s {
- case "omitempty":
- omitEmpty = true
- case "toarray":
- toArray = true
- case "int":
- keytype = valueTypeInt
- case "uint":
- keytype = valueTypeUint
- case "float":
- keytype = valueTypeFloat
- // case "bool":
- // keytype = valueTypeBool
- case "string":
- keytype = valueTypeString
- }
+ ss := strings.Split(stag, ",")
+ if len(ss) < 2 {
+ return
+ }
+ for _, s := range ss[1:] {
+ switch s {
+ case "omitempty":
+ omitEmpty = true
+ case "toarray":
+ toArray = true
+ case "int":
+ keytype = valueTypeInt
+ case "uint":
+ keytype = valueTypeUint
+ case "float":
+ keytype = valueTypeFloat
+ // case "bool":
+ // keytype = valueTypeBool
+ case "string":
+ keytype = valueTypeString
}
}
return
}
func (si *structFieldInfo) parseTag(stag string) {
- // if fname == "" {
- // panic(errNoFieldNameToStructFieldInfo)
- // }
-
if stag == "" {
return
}
@@ -1405,7 +1789,7 @@ func (si *structFieldInfo) parseTag(stag string) {
} else {
switch s {
case "omitempty":
- si.flagSet(structFieldInfoFlagOmitEmpty)
+ si.path.omitEmpty = true
}
}
}
@@ -1414,135 +1798,29 @@ func (si *structFieldInfo) parseTag(stag string) {
type sfiSortedByEncName []*structFieldInfo
func (p sfiSortedByEncName) Len() int { return len(p) }
-func (p sfiSortedByEncName) Less(i, j int) bool { return p[uint(i)].encName < p[uint(j)].encName }
func (p sfiSortedByEncName) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p sfiSortedByEncName) Less(i, j int) bool { return p[uint(i)].encName < p[uint(j)].encName }
-const structFieldNodeNumToCache = 4
+// typeInfo4Container holds information that is only available for
+// containers like map, array, chan, slice.
+type typeInfo4Container struct {
+ elem reflect.Type
+ // key is:
+ // - if map kind: map key
+ // - if array kind: sliceOf(elem)
+ // - if chan kind: sliceof(elem)
+ key reflect.Type
-type structFieldNodeCache struct {
- rv [structFieldNodeNumToCache]reflect.Value
- idx [structFieldNodeNumToCache]uint32
- num uint8
+ // fastpathUnderlying is underlying type of a named slice/map/array, as defined by go spec,
+ // that is used by fastpath where we defined fastpath functions for the underlying type.
+ //
+ // for a map, it's a map; for a slice or array, it's a slice; else its nil.
+ fastpathUnderlying reflect.Type
+
+ tikey *typeInfo
+ tielem *typeInfo
}
-func (x *structFieldNodeCache) get(key uint32) (fv reflect.Value, valid bool) {
- for i, k := range &x.idx {
- if uint8(i) == x.num {
- return // break
- }
- if key == k {
- return x.rv[i], true
- }
- }
- return
-}
-
-func (x *structFieldNodeCache) tryAdd(fv reflect.Value, key uint32) {
- if x.num < structFieldNodeNumToCache {
- x.rv[x.num] = fv
- x.idx[x.num] = key
- x.num++
- return
- }
-}
-
-type structFieldNode struct {
- v reflect.Value
- cache2 structFieldNodeCache
- cache3 structFieldNodeCache
- update bool
-}
-
-func (x *structFieldNode) field(si *structFieldInfo) (fv reflect.Value) {
- // return si.fieldval(x.v, x.update)
-
- // Note: we only cache if nis=2 or nis=3 i.e. up to 2 levels of embedding
- // This mostly saves us time on the repeated calls to v.Elem, v.Field, etc.
- var valid bool
- switch si.nis {
- case 1:
- fv = x.v.Field(int(si.is[0]))
- case 2:
- if fv, valid = x.cache2.get(uint32(si.is[0])); valid {
- fv = fv.Field(int(si.is[1]))
- return
- }
- fv = x.v.Field(int(si.is[0]))
- if fv, valid = baseStructRv(fv, x.update); !valid {
- return
- }
- x.cache2.tryAdd(fv, uint32(si.is[0]))
- fv = fv.Field(int(si.is[1]))
- case 3:
- var key uint32 = uint32(si.is[0])<<16 | uint32(si.is[1])
- if fv, valid = x.cache3.get(key); valid {
- fv = fv.Field(int(si.is[2]))
- return
- }
- fv = x.v.Field(int(si.is[0]))
- if fv, valid = baseStructRv(fv, x.update); !valid {
- return
- }
- fv = fv.Field(int(si.is[1]))
- if fv, valid = baseStructRv(fv, x.update); !valid {
- return
- }
- x.cache3.tryAdd(fv, key)
- fv = fv.Field(int(si.is[2]))
- default:
- fv, _ = si.field(x.v, x.update)
- }
- return
-}
-
-func baseStructRv(v reflect.Value, update bool) (v2 reflect.Value, valid bool) {
- for v.Kind() == reflect.Ptr {
- if rvIsNil(v) {
- if !update {
- return
- }
- rvSetDirect(v, reflect.New(v.Type().Elem()))
- }
- v = v.Elem()
- }
- return v, true
-}
-
-type tiflag uint32
-
-const (
- _ tiflag = 1 << iota
-
- tiflagComparable
-
- tiflagIsZeroer
- tiflagIsZeroerPtr
-
- tiflagBinaryMarshaler
- tiflagBinaryMarshalerPtr
-
- tiflagBinaryUnmarshaler
- tiflagBinaryUnmarshalerPtr
-
- tiflagTextMarshaler
- tiflagTextMarshalerPtr
-
- tiflagTextUnmarshaler
- tiflagTextUnmarshalerPtr
-
- tiflagJsonMarshaler
- tiflagJsonMarshalerPtr
-
- tiflagJsonUnmarshaler
- tiflagJsonUnmarshalerPtr
-
- tiflagSelfer
- tiflagSelferPtr
-
- tiflagMissingFielder
- tiflagMissingFielderPtr
-)
-
// typeInfo keeps static (non-changing readonly)information
// about each (non-ptr) type referenced in the encode/decode sequence.
//
@@ -1553,9 +1831,10 @@ const (
// - If type is text(M/Unm)arshaler, call Text(M/Unm)arshal method
// - Else decode appropriately based on the reflect.Kind
type typeInfo struct {
- rt reflect.Type
- elem reflect.Type
- pkgpath string
+ rt reflect.Type
+ ptr reflect.Type
+
+ // pkgpath string
rtid uintptr
@@ -1568,63 +1847,176 @@ type typeInfo struct {
keyType valueType // if struct, how is the field name stored in a stream? default is string
mbs bool // base type (T or *T) is a MapBySlice
- // ---- cpu cache line boundary?
- sfiSort []*structFieldInfo // sorted. Used when enc/dec struct to map.
- sfiSrc []*structFieldInfo // unsorted. Used when enc/dec struct to array.
+ sfi4Name map[string]*structFieldInfo // map. used for finding sfi given a name
- key reflect.Type
+ *typeInfo4Container
// ---- cpu cache line boundary?
- // sfis []structFieldInfo // all sfi, in src order, as created.
- sfiNamesSort []byte // all names, with indexes into the sfiSort
- // rv0 is the zero value for the type.
- // It is mostly beneficial for all non-reference kinds
- // i.e. all but map/chan/func/ptr/unsafe.pointer
- // so beneficial for intXX, bool, slices, structs, etc
- rv0 reflect.Value
+ size, keysize, elemsize uint32
- elemsize uintptr
+ keykind, elemkind uint8
- // other flags, with individual bits representing if set.
- flags tiflag
+ flagHasPkgPath bool // Type.PackagePath != ""
+ flagCustom bool // does this have custom implementation?
+ flagComparable bool
+ flagCanTransient bool
+
+ flagSelferViaCodecgen bool
+
+ // custom implementation flags
+ flagIsZeroer bool
+ flagIsZeroerPtr bool
+
+ flagIsCodecEmptyer bool
+ flagIsCodecEmptyerPtr bool
+
+ flagBinaryMarshaler bool
+ flagBinaryMarshalerPtr bool
+
+ flagBinaryUnmarshaler bool
+ flagBinaryUnmarshalerPtr bool
+
+ flagTextMarshaler bool
+ flagTextMarshalerPtr bool
+
+ flagTextUnmarshaler bool
+ flagTextUnmarshalerPtr bool
+
+ flagJsonMarshaler bool
+ flagJsonMarshalerPtr bool
+
+ flagJsonUnmarshaler bool
+ flagJsonUnmarshalerPtr bool
+
+ flagSelfer bool
+ flagSelferPtr bool
+
+ flagMissingFielder bool
+ flagMissingFielderPtr bool
infoFieldOmitempty bool
- elemkind uint8
- _ [2]byte // padding
- // _ [1]uint64 // padding
+ sfi structFieldInfos
}
-func (ti *typeInfo) isFlag(f tiflag) bool {
- return ti.flags&f != 0
+func (ti *typeInfo) siForEncName(name []byte) (si *structFieldInfo) {
+ return ti.sfi4Name[string(name)]
}
-func (ti *typeInfo) flag(when bool, f tiflag) *typeInfo {
- if when {
- ti.flags |= f
- }
- return ti
-}
+func (ti *typeInfo) resolve(x []structFieldInfo, ss map[string]uint16) (n int) {
+ n = len(x)
-func (ti *typeInfo) indexForEncName(name []byte) (index int16) {
- var sn []byte
- if len(name)+2 <= 32 {
- var buf [32]byte // should not escape to heap
- sn = buf[:len(name)+2]
- } else {
- sn = make([]byte, len(name)+2)
+ for i := range x {
+ ui := uint16(i)
+ xn := x[i].encName
+ j, ok := ss[xn]
+ if ok {
+ i2clear := ui // index to be cleared
+ if x[i].path.depth() < x[j].path.depth() { // this one is shallower
+ ss[xn] = ui
+ i2clear = j
+ }
+ if x[i2clear].encName != "" {
+ x[i2clear].encName = ""
+ n--
+ }
+ } else {
+ ss[xn] = ui
+ }
}
- copy(sn[1:], name)
- sn[0], sn[len(sn)-1] = tiSep2(name), 0xff
- j := bytes.Index(ti.sfiNamesSort, sn)
- if j < 0 {
- return -1
- }
- index = int16(uint16(ti.sfiNamesSort[j+len(sn)+1]) | uint16(ti.sfiNamesSort[j+len(sn)])<<8)
+
return
}
+func (ti *typeInfo) init(x []structFieldInfo, n int) {
+ var anyOmitEmpty bool
+
+ // remove all the nils (non-ready)
+ m := make(map[string]*structFieldInfo, n)
+ w := make([]structFieldInfo, n)
+ y := make([]*structFieldInfo, n+n)
+ z := y[n:]
+ y = y[:n]
+ n = 0
+ for i := range x {
+ if x[i].encName == "" {
+ continue
+ }
+ if !anyOmitEmpty && x[i].path.omitEmpty {
+ anyOmitEmpty = true
+ }
+ w[n] = x[i]
+ y[n] = &w[n]
+ m[x[i].encName] = &w[n]
+ n++
+ }
+ if n != len(y) {
+ halt.errorf("failure reading struct %v - expecting %d of %d valid fields, got %d", ti.rt, len(y), len(x), n)
+ }
+
+ copy(z, y)
+ sort.Sort(sfiSortedByEncName(z))
+
+ ti.anyOmitEmpty = anyOmitEmpty
+ ti.sfi.load(y, z)
+ ti.sfi4Name = m
+}
+
+// Handling flagCanTransient
+//
+// We support transient optimization if the kind of the type is
+// a number, bool, string, or slice.
+// In addition, we also support if the kind is struct or array,
+// and the type does not contain any pointers recursively).
+//
+// Noteworthy that all reference types (string, slice, func, map, ptr, interface, etc) have pointers.
+//
+// If using transient for a type with a pointer, there is the potential for data corruption
+// when GC tries to follow a "transient" pointer which may become a non-pointer soon after.
+//
+
+func isCanTransient(t reflect.Type, k reflect.Kind) (v bool) {
+ var bs *bitset32
+ if transientValueHasStringSlice {
+ bs = &numBoolStrSliceBitset
+ } else {
+ bs = &numBoolBitset
+ }
+ if bs.isset(byte(k)) {
+ v = true
+ } else if k == reflect.Array {
+ elem := t.Elem()
+ v = isCanTransient(elem, elem.Kind())
+ } else if k == reflect.Struct {
+ v = true
+ for j, jlen := 0, t.NumField(); j < jlen; j++ {
+ f := t.Field(j)
+ if !isCanTransient(f.Type, f.Type.Kind()) {
+ v = false
+ return
+ }
+ }
+ } else {
+ v = false
+ }
+ return
+}
+
+func (ti *typeInfo) doSetFlagCanTransient() {
+ if transientSizeMax > 0 {
+ ti.flagCanTransient = ti.size <= transientSizeMax
+ } else {
+ ti.flagCanTransient = true
+ }
+ if ti.flagCanTransient {
+ // if ti kind is a num, bool, string or slice, then it is flagCanTransient
+ if !numBoolStrSliceBitset.isset(ti.kind) {
+ ti.flagCanTransient = isCanTransient(ti.rt, reflect.Kind(ti.kind))
+ }
+ }
+}
+
type rtid2ti struct {
rtid uintptr
ti *typeInfo
@@ -1635,7 +2027,6 @@ type rtid2ti struct {
// It is configured with a set of tag keys, which are used to get
// configuration for the type.
type TypeInfos struct {
- // infos: formerly map[uintptr]*typeInfo, now *[]rtid2ti, 2 words expected
infos atomicTypeInfoSlice
mu sync.Mutex
_ uint64 // padding (cache-aligned)
@@ -1667,12 +2058,11 @@ func findTypeInfo(s []rtid2ti, rtid uintptr) (i uint, ti *typeInfo) {
// binary search. adapted from sort/search.go.
// Note: we use goto (instead of for loop) so this can be inlined.
- // h, i, j := 0, 0, len(s)
- var h uint // var h, i uint
+ var h uint
var j = uint(len(s))
LOOP:
if i < j {
- h = i + (j-i)/2
+ h = (i + j) >> 1 // avoid overflow when computing h // h = i + (j-i)/2
if s[h].rtid < rtid {
i = h + 1
} else {
@@ -1687,55 +2077,95 @@ LOOP:
}
func (x *TypeInfos) get(rtid uintptr, rt reflect.Type) (pti *typeInfo) {
+ if pti = x.find(rtid); pti == nil {
+ pti = x.load(rt)
+ }
+ return
+}
+
+func (x *TypeInfos) find(rtid uintptr) (pti *typeInfo) {
sp := x.infos.load()
if sp != nil {
_, pti = findTypeInfo(sp, rtid)
- if pti != nil {
- return
- }
}
+ return
+}
+func (x *TypeInfos) load(rt reflect.Type) (pti *typeInfo) {
rk := rt.Kind()
if rk == reflect.Ptr { // || (rk == reflect.Interface && rtid != intfTypId) {
- panicv.errorf("invalid kind passed to TypeInfos.get: %v - %v", rk, rt)
+ halt.errorf("invalid kind passed to TypeInfos.get: %v - %v", rk, rt)
}
+ rtid := rt2id(rt)
+
// do not hold lock while computing this.
// it may lead to duplication, but that's ok.
ti := typeInfo{
rt: rt,
+ ptr: reflect.PtrTo(rt),
rtid: rtid,
kind: uint8(rk),
- pkgpath: rt.PkgPath(),
+ size: uint32(rt.Size()),
+ numMeth: uint16(rt.NumMethod()),
keyType: valueTypeString, // default it - so it's never 0
- }
- ti.rv0 = reflect.Zero(rt)
- ti.numMeth = uint16(rt.NumMethod())
+ // pkgpath: rt.PkgPath(),
+ flagHasPkgPath: rt.PkgPath() != "",
+ }
+
+ // bset sets custom implementation flags
+ bset := func(when bool, b *bool) {
+ if when {
+ *b = true
+ ti.flagCustom = true
+ }
+ }
var b1, b2 bool
- b1, b2 = implIntf(rt, binaryMarshalerTyp)
- ti.flag(b1, tiflagBinaryMarshaler).flag(b2, tiflagBinaryMarshalerPtr)
- b1, b2 = implIntf(rt, binaryUnmarshalerTyp)
- ti.flag(b1, tiflagBinaryUnmarshaler).flag(b2, tiflagBinaryUnmarshalerPtr)
- b1, b2 = implIntf(rt, textMarshalerTyp)
- ti.flag(b1, tiflagTextMarshaler).flag(b2, tiflagTextMarshalerPtr)
- b1, b2 = implIntf(rt, textUnmarshalerTyp)
- ti.flag(b1, tiflagTextUnmarshaler).flag(b2, tiflagTextUnmarshalerPtr)
- b1, b2 = implIntf(rt, jsonMarshalerTyp)
- ti.flag(b1, tiflagJsonMarshaler).flag(b2, tiflagJsonMarshalerPtr)
- b1, b2 = implIntf(rt, jsonUnmarshalerTyp)
- ti.flag(b1, tiflagJsonUnmarshaler).flag(b2, tiflagJsonUnmarshalerPtr)
- b1, b2 = implIntf(rt, selferTyp)
- ti.flag(b1, tiflagSelfer).flag(b2, tiflagSelferPtr)
- b1, b2 = implIntf(rt, missingFielderTyp)
- ti.flag(b1, tiflagMissingFielder).flag(b2, tiflagMissingFielderPtr)
- b1, b2 = implIntf(rt, iszeroTyp)
- ti.flag(b1, tiflagIsZeroer).flag(b2, tiflagIsZeroerPtr)
- b1 = rt.Comparable()
- ti.flag(b1, tiflagComparable)
+ b1, b2 = implIntf(rt, binaryMarshalerTyp)
+ bset(b1, &ti.flagBinaryMarshaler)
+ bset(b2, &ti.flagBinaryMarshalerPtr)
+ b1, b2 = implIntf(rt, binaryUnmarshalerTyp)
+ bset(b1, &ti.flagBinaryUnmarshaler)
+ bset(b2, &ti.flagBinaryUnmarshalerPtr)
+ b1, b2 = implIntf(rt, textMarshalerTyp)
+ bset(b1, &ti.flagTextMarshaler)
+ bset(b2, &ti.flagTextMarshalerPtr)
+ b1, b2 = implIntf(rt, textUnmarshalerTyp)
+ bset(b1, &ti.flagTextUnmarshaler)
+ bset(b2, &ti.flagTextUnmarshalerPtr)
+ b1, b2 = implIntf(rt, jsonMarshalerTyp)
+ bset(b1, &ti.flagJsonMarshaler)
+ bset(b2, &ti.flagJsonMarshalerPtr)
+ b1, b2 = implIntf(rt, jsonUnmarshalerTyp)
+ bset(b1, &ti.flagJsonUnmarshaler)
+ bset(b2, &ti.flagJsonUnmarshalerPtr)
+ b1, b2 = implIntf(rt, selferTyp)
+ bset(b1, &ti.flagSelfer)
+ bset(b2, &ti.flagSelferPtr)
+ b1, b2 = implIntf(rt, missingFielderTyp)
+ bset(b1, &ti.flagMissingFielder)
+ bset(b2, &ti.flagMissingFielderPtr)
+ b1, b2 = implIntf(rt, iszeroTyp)
+ bset(b1, &ti.flagIsZeroer)
+ bset(b2, &ti.flagIsZeroerPtr)
+ b1, b2 = implIntf(rt, isCodecEmptyerTyp)
+ bset(b1, &ti.flagIsCodecEmptyer)
+ bset(b2, &ti.flagIsCodecEmptyerPtr)
+
+ b1, b2 = implIntf(rt, isSelferViaCodecgenerTyp)
+ ti.flagSelferViaCodecgen = b1 || b2
+
+ b1 = rt.Comparable()
+ // bset(b1, &ti.flagComparable)
+ ti.flagComparable = b1
+
+ ti.doSetFlagCanTransient()
+
+ var tt reflect.Type
switch rk {
case reflect.Struct:
var omitEmpty bool
@@ -1745,48 +2175,99 @@ func (x *TypeInfos) get(rtid uintptr, rt reflect.Type) (pti *typeInfo) {
} else {
ti.keyType = valueTypeString
}
- pp, pi := &pool4tiload, pool4tiload.Get() // pool.tiLoad()
- pv := pi.(*typeInfoLoadArray)
- pv.etypes[0] = ti.rtid
- // vv := typeInfoLoad{pv.fNames[:0], pv.encNames[:0], pv.etypes[:1], pv.sfis[:0]}
- vv := typeInfoLoad{pv.etypes[:1], pv.sfis[:0]}
- x.rget(rt, rtid, omitEmpty, nil, &vv)
- ti.sfiSrc, ti.sfiSort, ti.sfiNamesSort, ti.anyOmitEmpty = rgetResolveSFI(rt, vv.sfis, pv)
+ pp, pi := &pool4tiload, pool4tiload.Get()
+ pv := pi.(*typeInfoLoad)
+ pv.reset()
+ pv.etypes = append(pv.etypes, ti.rtid)
+ x.rget(rt, rtid, nil, pv, omitEmpty)
+ n := ti.resolve(pv.sfis, pv.sfiNames)
+ ti.init(pv.sfis, n)
pp.Put(pi)
case reflect.Map:
+ ti.typeInfo4Container = new(typeInfo4Container)
ti.elem = rt.Elem()
+ for tt = ti.elem; tt.Kind() == reflect.Ptr; tt = tt.Elem() {
+ }
+ ti.tielem = x.get(rt2id(tt), tt)
+ ti.elemkind = uint8(ti.elem.Kind())
+ ti.elemsize = uint32(ti.elem.Size())
ti.key = rt.Key()
+ for tt = ti.key; tt.Kind() == reflect.Ptr; tt = tt.Elem() {
+ }
+ ti.tikey = x.get(rt2id(tt), tt)
+ ti.keykind = uint8(ti.key.Kind())
+ ti.keysize = uint32(ti.key.Size())
+ if ti.flagHasPkgPath {
+ ti.fastpathUnderlying = reflect.MapOf(ti.key, ti.elem)
+ }
case reflect.Slice:
- ti.mbs, _ = implIntf(rt, mapBySliceTyp)
+ ti.typeInfo4Container = new(typeInfo4Container)
+ ti.mbs, b2 = implIntf(rt, mapBySliceTyp)
+ if !ti.mbs && b2 {
+ ti.mbs = b2
+ }
ti.elem = rt.Elem()
- ti.elemsize = ti.elem.Size()
+ for tt = ti.elem; tt.Kind() == reflect.Ptr; tt = tt.Elem() {
+ }
+ ti.tielem = x.get(rt2id(tt), tt)
ti.elemkind = uint8(ti.elem.Kind())
+ ti.elemsize = uint32(ti.elem.Size())
+ if ti.flagHasPkgPath {
+ ti.fastpathUnderlying = reflect.SliceOf(ti.elem)
+ }
case reflect.Chan:
+ ti.typeInfo4Container = new(typeInfo4Container)
ti.elem = rt.Elem()
- ti.chandir = uint8(rt.ChanDir())
- case reflect.Array:
- ti.elem = rt.Elem()
- ti.elemsize = ti.elem.Size()
+ for tt = ti.elem; tt.Kind() == reflect.Ptr; tt = tt.Elem() {
+ }
+ ti.tielem = x.get(rt2id(tt), tt)
ti.elemkind = uint8(ti.elem.Kind())
- case reflect.Ptr:
+ ti.elemsize = uint32(ti.elem.Size())
+ ti.chandir = uint8(rt.ChanDir())
+ ti.key = reflect.SliceOf(ti.elem)
+ ti.keykind = uint8(reflect.Slice)
+ case reflect.Array:
+ ti.typeInfo4Container = new(typeInfo4Container)
+ ti.mbs, b2 = implIntf(rt, mapBySliceTyp)
+ if !ti.mbs && b2 {
+ ti.mbs = b2
+ }
ti.elem = rt.Elem()
+ ti.elemkind = uint8(ti.elem.Kind())
+ ti.elemsize = uint32(ti.elem.Size())
+ for tt = ti.elem; tt.Kind() == reflect.Ptr; tt = tt.Elem() {
+ }
+ ti.tielem = x.get(rt2id(tt), tt)
+ ti.key = reflect.SliceOf(ti.elem)
+ ti.keykind = uint8(reflect.Slice)
+ ti.keysize = uint32(ti.key.Size())
+ if ti.flagHasPkgPath {
+ ti.fastpathUnderlying = ti.key
+ }
+
+ // MARKER: reflect.Ptr cannot happen here, as we halt early if reflect.Ptr passed in
+ // case reflect.Ptr:
+ // ti.elem = rt.Elem()
+ // ti.elemkind = uint8(ti.elem.Kind())
+ // ti.elemsize = uint32(ti.elem.Size())
}
x.mu.Lock()
- sp = x.infos.load()
- var sp2 []rtid2ti
+ sp := x.infos.load()
+ // since this is an atomic load/store, we MUST use a different array each time,
+ // else we have a data race when a store is happening simultaneously with a findRtidFn call.
if sp == nil {
pti = &ti
- sp2 = []rtid2ti{{rtid, pti}}
- x.infos.store(sp2)
+ sp = []rtid2ti{{rtid, pti}}
+ x.infos.store(sp)
} else {
var idx uint
idx, pti = findTypeInfo(sp, rtid)
if pti == nil {
pti = &ti
- sp2 = make([]rtid2ti, len(sp)+1)
- copy(sp2, sp[:idx])
+ sp2 := make([]rtid2ti, len(sp)+1)
copy(sp2[idx+1:], sp[idx:])
+ copy(sp2, sp[:idx])
sp2[idx] = rtid2ti{rtid, pti}
x.infos.store(sp2)
}
@@ -1795,8 +2276,8 @@ func (x *TypeInfos) get(rtid uintptr, rt reflect.Type) (pti *typeInfo) {
return
}
-func (x *TypeInfos) rget(rt reflect.Type, rtid uintptr, omitEmpty bool,
- indexstack []uint16, pv *typeInfoLoad) {
+func (x *TypeInfos) rget(rt reflect.Type, rtid uintptr,
+ path *structFieldInfoPathNode, pv *typeInfoLoad, omitEmpty bool) {
// Read up fields and store how to access the value.
//
// It uses go's rules for message selectors,
@@ -1806,18 +2287,14 @@ func (x *TypeInfos) rget(rt reflect.Type, rtid uintptr, omitEmpty bool,
// Typically, types have < 16 fields,
// and iteration using equals is faster than maps there
flen := rt.NumField()
- if flen > (1< %v fields are not supported - has %v fields",
- (1<= 0; i-- { // bounds-check elimination
- b := si.encName[i]
- if (b >= '0' && b <= '9') || (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') {
- continue
- }
- si.encNameAsciiAlphaNum = false
- break
- }
- si.fieldName = f.Name
- si.flagSet(structFieldInfoFlagReady)
- if len(indexstack) > maxLevelsEmbedding-1 {
- panicv.errorf("codec: only supports up to %v depth of embedding - type has %v depth",
- maxLevelsEmbedding-1, len(indexstack))
- }
- si.nis = uint8(len(indexstack)) + 1
- copy(si.is[:], indexstack)
- si.is[len(indexstack)] = j
+ // si.encNameHash = maxUintptr() // hashShortString(bytesView(si.encName))
if omitEmpty {
- si.flagSet(structFieldInfoFlagOmitEmpty)
+ si.path.omitEmpty = true
}
+
+ for i := len(si.encName) - 1; i >= 0; i-- { // bounds-check elimination
+ if !asciiAlphaNumBitset.isset(si.encName[i]) {
+ si.path.encNameAsciiAlphaNum = false
+ break
+ }
+ }
+
pv.sfis = append(pv.sfis, si)
}
}
-func tiSep(name string) uint8 {
- // (xn[0]%64) // (between 192-255 - outside ascii BMP)
- // Tried the following before settling on correct implementation:
- // return 0xfe - (name[0] & 63)
- // return 0xfe - (name[0] & 63) - uint8(len(name))
- // return 0xfe - (name[0] & 63) - uint8(len(name)&63)
- // return ((0xfe - (name[0] & 63)) & 0xf8) | (uint8(len(name) & 0x07))
+func implIntf(rt, iTyp reflect.Type) (base bool, indir bool) {
+ // return rt.Implements(iTyp), reflect.PtrTo(rt).Implements(iTyp)
- return 0xfe - (name[0] & 63) - uint8(len(name)&63)
-}
+ // if I's method is defined on T (ie T implements I), then *T implements I.
+ // The converse is not true.
-func tiSep2(name []byte) uint8 {
- return 0xfe - (name[0] & 63) - uint8(len(name)&63)
-}
+ // Type.Implements can be expensive, as it does a simulataneous linear search across 2 lists
+ // with alphanumeric string comparisons.
+ // If we can avoid running one of these 2 calls, we should.
-// resolves the struct field info got from a call to rget.
-// Returns a trimmed, unsorted and sorted []*structFieldInfo.
-func rgetResolveSFI(rt reflect.Type, x []structFieldInfo, pv *typeInfoLoadArray) (
- y, z []*structFieldInfo, ss []byte, anyOmitEmpty bool) {
- sa := pv.sfiidx[:0]
- sn := pv.b[:]
- n := len(x)
-
- var xn string
- var ui uint16
- var sep byte
-
- for i := range x {
- ui = uint16(i)
- xn = x[i].encName // fieldName or encName? use encName for now.
- if len(xn)+2 > cap(sn) {
- sn = make([]byte, len(xn)+2)
- } else {
- sn = sn[:len(xn)+2]
- }
- // use a custom sep, so that misses are less frequent,
- // since the sep (first char in search) is as unique as first char in field name.
- sep = tiSep(xn)
- sn[0], sn[len(sn)-1] = sep, 0xff
- copy(sn[1:], xn)
- j := bytes.Index(sa, sn)
- if j == -1 {
- sa = append(sa, sep)
- sa = append(sa, xn...)
- sa = append(sa, 0xff, byte(ui>>8), byte(ui))
- } else {
- index := uint16(sa[j+len(sn)+1]) | uint16(sa[j+len(sn)])<<8
- // one of them must be cleared (reset to nil),
- // and the index updated appropriately
- i2clear := ui // index to be cleared
- if x[i].nis < x[index].nis { // this one is shallower
- // update the index to point to this later one.
- sa[j+len(sn)], sa[j+len(sn)+1] = byte(ui>>8), byte(ui)
- // clear the earlier one, as this later one is shallower.
- i2clear = index
- }
- if x[i2clear].ready() {
- x[i2clear].flagClr(structFieldInfoFlagReady)
- n--
- }
- }
- }
-
- var w []structFieldInfo
- sharingArray := len(x) <= typeInfoLoadArraySfisLen // sharing array with typeInfoLoadArray
- if sharingArray {
- w = make([]structFieldInfo, n)
- }
-
- // remove all the nils (non-ready)
- y = make([]*structFieldInfo, n)
- n = 0
- var sslen int
- for i := range x {
- if !x[i].ready() {
- continue
- }
- if !anyOmitEmpty && x[i].omitEmpty() {
- anyOmitEmpty = true
- }
- if sharingArray {
- w[n] = x[i]
- y[n] = &w[n]
- } else {
- y[n] = &x[i]
- }
- sslen = sslen + len(x[i].encName) + 4
- n++
- }
- if n != len(y) {
- panicv.errorf("failure reading struct %v - expecting %d of %d valid fields, got %d",
- rt, len(y), len(x), n)
- }
-
- z = make([]*structFieldInfo, len(y))
- copy(z, y)
- sort.Sort(sfiSortedByEncName(z))
-
- sharingArray = len(sa) <= typeInfoLoadArraySfiidxLen
- if sharingArray {
- ss = make([]byte, 0, sslen)
+ base = rt.Implements(iTyp)
+ if base {
+ indir = true
} else {
- ss = sa[:0] // reuse the newly made sa array if necessary
- }
- for i := range z {
- xn = z[i].encName
- sep = tiSep(xn)
- ui = uint16(i)
- ss = append(ss, sep)
- ss = append(ss, xn...)
- ss = append(ss, 0xff, byte(ui>>8), byte(ui))
+ indir = reflect.PtrTo(rt).Implements(iTyp)
}
return
}
-func implIntf(rt, iTyp reflect.Type) (base bool, indir bool) {
- return rt.Implements(iTyp), reflect.PtrTo(rt).Implements(iTyp)
-}
-
-// isEmptyStruct is only called from isEmptyValue, and checks if a struct is empty:
-// - does it implement IsZero() bool
-// - is it comparable, and can i compare directly using ==
-// - if checkStruct, then walk through the encodable fields
-// and check if they are empty or not.
-func isEmptyStruct(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) bool {
- // v is a struct kind - no need to check again.
- // We only check isZero on a struct kind, to reduce the amount of times
- // that we lookup the rtid and typeInfo for each type as we walk the tree.
-
- vt := v.Type()
- rtid := rt2id(vt)
- if tinfos == nil {
- tinfos = defTypeInfos
- }
- ti := tinfos.get(rtid, vt)
- if ti.rtid == timeTypId {
- return rv2i(v).(time.Time).IsZero()
- }
- if ti.isFlag(tiflagIsZeroerPtr) && v.CanAddr() {
- return rv2i(v.Addr()).(isZeroer).IsZero()
- }
- if ti.isFlag(tiflagIsZeroer) {
- return rv2i(v).(isZeroer).IsZero()
- }
- if ti.isFlag(tiflagComparable) {
- return rv2i(v) == rv2i(reflect.Zero(vt))
- }
- if !checkStruct {
- return false
- }
- // We only care about what we can encode/decode,
- // so that is what we use to check omitEmpty.
- for _, si := range ti.sfiSrc {
- sfv, valid := si.field(v, false)
- if valid && !isEmptyValue(sfv, tinfos, deref, checkStruct) {
- return false
- }
- }
- return true
-}
-
-// func roundFloat(x float64) float64 {
-// t := math.Trunc(x)
-// if math.Abs(x-t) >= 0.5 {
-// return t + math.Copysign(1, x)
-// }
-// return t
-// }
-
-func panicToErr(h errDecorator, err *error) {
- // Note: This method MUST be called directly from defer i.e. defer panicToErr ...
- // else it seems the recover is not fully handled
- if recoverPanicToErr {
- if x := recover(); x != nil {
- // fmt.Printf("panic'ing with: %v\n", x)
- // debug.PrintStack()
- panicValToErr(h, x, err)
- }
- }
-}
-
func isSliceBoundsError(s string) bool {
return strings.Contains(s, "index out of range") ||
strings.Contains(s, "slice bounds out of range")
}
+func sprintf(format string, v ...interface{}) string {
+ return fmt.Sprintf(format, v...)
+}
+
func panicValToErr(h errDecorator, v interface{}, err *error) {
- d, dok := h.(*Decoder)
+ if v == *err {
+ return
+ }
switch xerr := v.(type) {
case nil:
+ case runtime.Error:
+ d, dok := h.(*Decoder)
+ if dok && d.bytes && isSliceBoundsError(xerr.Error()) {
+ *err = io.EOF
+ } else {
+ h.wrapErr(xerr, err)
+ }
case error:
switch xerr {
case nil:
@@ -2129,55 +2463,38 @@ func panicValToErr(h errDecorator, v interface{}, err *error) {
// treat as special (bubble up)
*err = xerr
default:
- if dok && d.bytes && isSliceBoundsError(xerr.Error()) {
- *err = io.EOF
- } else {
- h.wrapErr(xerr, err)
- }
- }
- case string:
- if xerr != "" {
- if dok && d.bytes && isSliceBoundsError(xerr) {
- *err = io.EOF
- } else {
- h.wrapErr(xerr, err)
- }
- }
- case fmt.Stringer:
- if xerr != nil {
h.wrapErr(xerr, err)
}
default:
- h.wrapErr(v, err)
+ // we don't expect this to happen (as this library always panics with an error)
+ h.wrapErr(fmt.Errorf("%v", v), err)
}
}
-func isImmutableKind(k reflect.Kind) (v bool) {
- // return immutableKindsSet[k]
- // since we know reflect.Kind is in range 0..31, then use the k%32 == k constraint
- return immutableKindsSet[k%reflect.Kind(len(immutableKindsSet))] // bounds-check-elimination
+func usableByteSlice(bs []byte, slen int) (out []byte, changed bool) {
+ if slen <= 0 {
+ return []byte{}, true
+ }
+ if cap(bs) < slen {
+ return make([]byte, slen), true
+ }
+ return bs[:slen], false
}
-func usableByteSlice(bs []byte, slen int) []byte {
- if cap(bs) >= slen {
- if bs == nil {
- return []byte{}
- }
- return bs[:slen]
- }
- return make([]byte, slen)
+func mapKeyFastKindFor(k reflect.Kind) mapKeyFastKind {
+ return mapKeyFastKindVals[k&31]
}
// ----
type codecFnInfo struct {
- ti *typeInfo
- xfFn Ext
- xfTag uint64
- seq seqType
- addrD bool
- addrF bool // if addrD, this says whether decode function can take a value or a ptr
- addrE bool
+ ti *typeInfo
+ xfFn Ext
+ xfTag uint64
+ addrD bool
+ addrDf bool // force: if addrD, then decode function MUST take a ptr
+ addrE bool
+ // addrEf bool // force: if addrE, then encode function MUST take a ptr
}
// codecFn encapsulates the captured variables and the encode function.
@@ -2188,7 +2505,7 @@ type codecFn struct {
i codecFnInfo
fe func(*Encoder, *codecFnInfo, reflect.Value)
fd func(*Decoder, *codecFnInfo, reflect.Value)
- _ [1]uint64 // padding (cache-aligned)
+ // _ [1]uint64 // padding (cache-aligned)
}
type codecRtidFn struct {
@@ -2197,12 +2514,7 @@ type codecRtidFn struct {
}
func makeExt(ext interface{}) Ext {
- if ext == nil {
- return &extFailWrapper{}
- }
switch t := ext.(type) {
- case nil:
- return &extFailWrapper{}
case Ext:
return t
case BytesExt:
@@ -2214,7 +2526,8 @@ func makeExt(ext interface{}) Ext {
}
func baseRV(v interface{}) (rv reflect.Value) {
- for rv = rv4i(v); rv.Kind() == reflect.Ptr; rv = rv.Elem() {
+ // use reflect.ValueOf, not rv4i, as of go 1.16beta, rv4i was not inlineable
+ for rv = reflect.ValueOf(v); rv.Kind() == reflect.Ptr; rv = rv.Elem() {
}
return
}
@@ -2228,14 +2541,6 @@ func baseRV(v interface{}) (rv reflect.Value) {
type checkOverflow struct{}
-// func (checkOverflow) Float16(f float64) (overflow bool) {
-// panicv.errorf("unimplemented")
-// if f < 0 {
-// f = -f
-// }
-// return math.MaxFloat32 < f && f <= math.MaxFloat64
-// }
-
func (checkOverflow) Float32(v float64) (overflow bool) {
if v < 0 {
v = -v
@@ -2243,23 +2548,22 @@ func (checkOverflow) Float32(v float64) (overflow bool) {
return math.MaxFloat32 < v && v <= math.MaxFloat64
}
func (checkOverflow) Uint(v uint64, bitsize uint8) (overflow bool) {
- if bitsize == 0 || bitsize >= 64 || v == 0 {
- return
- }
- if trunc := (v << (64 - bitsize)) >> (64 - bitsize); v != trunc {
+ if v != 0 && v != (v<<(64-bitsize))>>(64-bitsize) {
overflow = true
}
return
}
func (checkOverflow) Int(v int64, bitsize uint8) (overflow bool) {
- if bitsize == 0 || bitsize >= 64 || v == 0 {
- return
- }
- if trunc := (v << (64 - bitsize)) >> (64 - bitsize); v != trunc {
+ if v != 0 && v != (v<<(64-bitsize))>>(64-bitsize) {
overflow = true
}
return
}
+
+func (checkOverflow) Uint2Int(v uint64, neg bool) (overflow bool) {
+ return (neg && v > 1<<63) || (!neg && v >= 1<<63)
+}
+
func (checkOverflow) SignedInt(v uint64) (overflow bool) {
//e.g. -127 to 128 for int8
pos := (v >> 63) == 0
@@ -2278,25 +2582,25 @@ func (checkOverflow) SignedInt(v uint64) (overflow bool) {
func (x checkOverflow) Float32V(v float64) float64 {
if x.Float32(v) {
- panicv.errorf("float32 overflow: %v", v)
+ halt.errorf("float32 overflow: %v", v)
}
return v
}
func (x checkOverflow) UintV(v uint64, bitsize uint8) uint64 {
if x.Uint(v, bitsize) {
- panicv.errorf("uint64 overflow: %v", v)
+ halt.errorf("uint64 overflow: %v", v)
}
return v
}
func (x checkOverflow) IntV(v int64, bitsize uint8) int64 {
if x.Int(v, bitsize) {
- panicv.errorf("int64 overflow: %v", v)
+ halt.errorf("int64 overflow: %v", v)
}
return v
}
func (x checkOverflow) SignedIntV(v uint64) int64 {
if x.SignedInt(v) {
- panicv.errorf("uint64 to int64 overflow: %v", v)
+ halt.errorf("uint64 to int64 overflow: %v", v)
}
return int64(v)
}
@@ -2304,60 +2608,31 @@ func (x checkOverflow) SignedIntV(v uint64) int64 {
// ------------------ FLOATING POINT -----------------
func isNaN64(f float64) bool { return f != f }
-func isNaN32(f float32) bool { return f != f }
-func abs32(f float32) float32 {
- return math.Float32frombits(math.Float32bits(f) &^ (1 << 31))
+
+func isWhitespaceChar(v byte) bool {
+ // these are in order of speed below ...
+
+ return v < 33
+ // return v < 33 && whitespaceCharBitset64.isset(v)
+ // return v < 33 && (v == ' ' || v == '\n' || v == '\t' || v == '\r')
+ // return v == ' ' || v == '\n' || v == '\t' || v == '\r'
+ // return whitespaceCharBitset.isset(v)
}
-// Per go spec, floats are represented in memory as
-// IEEE single or double precision floating point values.
-//
-// We also looked at the source for stdlib math/modf.go,
-// reviewed https://github.com/chewxy/math32
-// and read wikipedia documents describing the formats.
-//
-// It became clear that we could easily look at the bits to determine
-// whether any fraction exists.
-//
-// This is all we need for now.
+func isNumberChar(v byte) bool {
+ // these are in order of speed below ...
-func noFrac64(f float64) (v bool) {
- x := math.Float64bits(f)
- e := uint64(x>>52)&0x7FF - 1023 // uint(x>>shift)&mask - bias
- // clear top 12+e bits, the integer part; if the rest is 0, then no fraction.
- if e < 52 {
- // return x&((1<<64-1)>>(12+e)) == 0
- return x<<(12+e) == 0
- }
- return
+ return numCharBitset.isset(v)
+ // return v < 64 && numCharNoExpBitset64.isset(v) || v == 'e' || v == 'E'
+ // return v > 42 && v < 102 && numCharWithExpBitset64.isset(v-42)
}
-func noFrac32(f float32) (v bool) {
- x := math.Float32bits(f)
- e := uint32(x>>23)&0xFF - 127 // uint(x>>shift)&mask - bias
- // clear top 9+e bits, the integer part; if the rest is 0, then no fraction.
- if e < 23 {
- // return x&((1<<32-1)>>(9+e)) == 0
- return x<<(9+e) == 0
- }
- return
-}
-
-// func noFrac(f float64) bool {
-// _, frac := math.Modf(float64(f))
-// return frac == 0
-// }
-
// -----------------------
type ioFlusher interface {
Flush() error
}
-type ioPeeker interface {
- Peek(int) ([]byte, error)
-}
-
type ioBuffered interface {
Buffered() int
}
@@ -2369,75 +2644,6 @@ type sfiRv struct {
r reflect.Value
}
-// -----------------
-
-type set []interface{}
-
-func (s *set) add(v interface{}) (exists bool) {
- // e.ci is always nil, or len >= 1
- x := *s
-
- if x == nil {
- x = make([]interface{}, 1, 8)
- x[0] = v
- *s = x
- return
- }
- // typically, length will be 1. make this perform.
- if len(x) == 1 {
- if j := x[0]; j == 0 {
- x[0] = v
- } else if j == v {
- exists = true
- } else {
- x = append(x, v)
- *s = x
- }
- return
- }
- // check if it exists
- for _, j := range x {
- if j == v {
- exists = true
- return
- }
- }
- // try to replace a "deleted" slot
- for i, j := range x {
- if j == 0 {
- x[i] = v
- return
- }
- }
- // if unable to replace deleted slot, just append it.
- x = append(x, v)
- *s = x
- return
-}
-
-func (s *set) remove(v interface{}) (exists bool) {
- x := *s
- if len(x) == 0 {
- return
- }
- if len(x) == 1 {
- if x[0] == v {
- x[0] = 0
- }
- return
- }
- for i, j := range x {
- if j == v {
- exists = true
- x[i] = 0 // set it to 0, as way to delete it.
- // copy(x[i:], x[i+1:])
- // x = x[:len(x)-1]
- return
- }
- }
- return
-}
-
// ------
// bitset types are better than [256]bool, because they permit the whole
@@ -2450,233 +2656,317 @@ func (s *set) remove(v interface{}) (exists bool) {
//
// given x > 0 and n > 0 and x is exactly 2^n, then pos/x === pos>>n AND pos%x === pos&(x-1).
// consequently, pos/32 === pos>>5, pos/16 === pos>>4, pos/8 === pos>>3, pos%8 == pos&7
+//
+// Note that using >> or & is faster than using / or %, as division is quite expensive if not optimized.
-type bitset256 [32]byte
+// MARKER:
+// We noticed a little performance degradation when using bitset256 as [32]byte (or bitset32 as uint32).
+// For example, json encoding went from 188K ns/op to 168K ns/op (~ 10% reduction).
+// Consequently, we are using a [NNN]bool for bitsetNNN.
+// To eliminate bounds-checking, we use x % v as that is guaranteed to be within bounds.
-func (x *bitset256) check(pos byte) uint8 {
- return x[pos>>3] & (1 << (pos & 7))
+// ----
+type bitset32 [32]bool
+
+func (x *bitset32) set(pos byte) *bitset32 {
+ x[pos&31] = true // x[pos%32] = true
+ return x
+}
+func (x *bitset32) isset(pos byte) bool {
+ return x[pos&31] // x[pos%32]
}
+type bitset256 [256]bool
+
+func (x *bitset256) set(pos byte) *bitset256 {
+ x[pos] = true
+ return x
+}
func (x *bitset256) isset(pos byte) bool {
- return x.check(pos) != 0
- // return x[pos>>3]&(1<<(pos&7)) != 0
+ return x[pos]
}
-// func (x *bitset256) issetv(pos byte) byte {
-// return x[pos>>3] & (1 << (pos & 7))
-// }
-
-func (x *bitset256) set(pos byte) {
- x[pos>>3] |= (1 << (pos & 7))
-}
-
-type bitset32 uint32
-
-func (x bitset32) set(pos byte) bitset32 {
- return x | (1 << pos)
-}
-
-func (x bitset32) check(pos byte) uint32 {
- return uint32(x) & (1 << pos)
-}
-func (x bitset32) isset(pos byte) bool {
- return x.check(pos) != 0
- // return x&(1<>3] &^= (1 << (pos & 7))
-// }
-
-// type bit2set256 [64]byte
-
-// func (x *bit2set256) set(pos byte, v1, v2 bool) {
-// var pos2 uint8 = (pos & 3) << 1 // returning 0, 2, 4 or 6
-// if v1 {
-// x[pos>>2] |= 1 << (pos2 + 1)
-// }
-// if v2 {
-// x[pos>>2] |= 1 << pos2
-// }
-// }
-// func (x *bit2set256) get(pos byte) uint8 {
-// var pos2 uint8 = (pos & 3) << 1 // returning 0, 2, 4 or 6
-// return x[pos>>2] << (6 - pos2) >> 6 // 11000000 -> 00000011
-// }
-
// ------------
type panicHdl struct{}
-func (panicHdl) errorv(err error) {
+// errorv will panic if err is defined (not nil)
+func (panicHdl) onerror(err error) {
if err != nil {
panic(err)
}
}
-func (panicHdl) errorstr(message string) {
- if message != "" {
- panic(message)
- }
-}
-
+// errorf will always panic, using the parameters passed.
+//
+// Note: it is ok to pass in a stringView, as it will just pass it directly
+// to a fmt.Sprintf call and not hold onto it.
+//
+//go:noinline
func (panicHdl) errorf(format string, params ...interface{}) {
- if len(params) != 0 {
- panic(fmt.Sprintf(format, params...))
+ if format == "" {
+ panic(errPanicUndefined)
}
if len(params) == 0 {
- panic(format)
+ panic(errors.New(format))
}
- panic("undefined error")
+ panic(fmt.Errorf(format, params...))
}
// ----------------------------------------------------
type errDecorator interface {
- wrapErr(in interface{}, out *error)
+ wrapErr(in error, out *error)
}
type errDecoratorDef struct{}
-func (errDecoratorDef) wrapErr(v interface{}, e *error) { *e = fmt.Errorf("%v", v) }
+func (errDecoratorDef) wrapErr(v error, e *error) { *e = v }
// ----------------------------------------------------
-type must struct{}
+type mustHdl struct{}
-func (must) String(s string, err error) string {
- if err != nil {
- panicv.errorv(err)
- }
+func (mustHdl) String(s string, err error) string {
+ halt.onerror(err)
return s
}
-func (must) Int(s int64, err error) int64 {
- if err != nil {
- panicv.errorv(err)
- }
+func (mustHdl) Int(s int64, err error) int64 {
+ halt.onerror(err)
return s
}
-func (must) Uint(s uint64, err error) uint64 {
- if err != nil {
- panicv.errorv(err)
- }
+func (mustHdl) Uint(s uint64, err error) uint64 {
+ halt.onerror(err)
return s
}
-func (must) Float(s float64, err error) float64 {
- if err != nil {
- panicv.errorv(err)
- }
+func (mustHdl) Float(s float64, err error) float64 {
+ halt.onerror(err)
return s
}
// -------------------
func freelistCapacity(length int) (capacity int) {
- for capacity = 8; capacity < length; capacity *= 2 {
+ for capacity = 8; capacity <= length; capacity *= 2 {
}
return
}
+// bytesFreelist is a list of byte buffers, sorted by cap.
+//
+// In anecdotal testing (running go test -tsd 1..6), we couldn't get
+// the length ofthe list > 4 at any time. So we believe a linear search
+// without bounds checking is sufficient.
+//
+// Typical usage model:
+// peek may go together with put, iff pop=true. peek gets largest byte slice temporarily.
+// check is used to switch a []byte if necessary
+// get/put go together
+//
+// Given that folks may get a []byte, and then append to it a lot which may re-allocate
+// a new []byte, we should try to return both (one received from blist and new one allocated).
+//
+// Typical usage model for get/put, when we don't know whether we may need more than requested
+// v0 := blist.get()
+// v1 := v0
+// ... use v1 ...
+// blist.put(v1)
+// if byteSliceAddr(v0) != byteSliceAddr(v1) {
+// blist.put(v0)
+// }
+//
type bytesFreelist [][]byte
-func (x *bytesFreelist) get(length int) (out []byte) {
- var j int = -1
- for i := 0; i < len(*x); i++ {
- if cap((*x)[i]) >= length && (j == -1 || cap((*x)[j]) > cap((*x)[i])) {
- j = i
- }
+// peek returns a slice of possibly non-zero'ed bytes, with len=0,
+// and with the largest capacity from the list.
+func (x *bytesFreelist) peek(length int, pop bool) (out []byte) {
+ if bytesFreeListNoCache {
+ return make([]byte, 0, freelistCapacity(length))
}
- if j == -1 {
- return make([]byte, length, freelistCapacity(length))
+ y := *x
+ if len(y) > 0 {
+ out = y[len(y)-1]
}
- out = (*x)[j][:length]
- (*x)[j] = nil
- for i := 0; i < len(out); i++ {
- out[i] = 0
+ // start buf with a minimum of 64 bytes
+ const minLenBytes = 64
+ if length < minLenBytes {
+ length = minLenBytes
+ }
+ if cap(out) < length {
+ out = make([]byte, 0, freelistCapacity(length))
+ y = append(y, out)
+ *x = y
+ }
+ if pop && len(y) > 0 {
+ y = y[:len(y)-1]
+ *x = y
}
return
}
+// get returns a slice of possibly non-zero'ed bytes, with len=0,
+// and with cap >= length requested.
+func (x *bytesFreelist) get(length int) (out []byte) {
+ if bytesFreeListNoCache {
+ return make([]byte, 0, freelistCapacity(length))
+ }
+ y := *x
+ // MARKER: do not use range, as range is not currently inlineable as of go 1.16-beta
+ // for i, v := range y {
+ for i := 0; i < len(y); i++ {
+ v := y[i]
+ if cap(v) >= length {
+ // *x = append(y[:i], y[i+1:]...)
+ copy(y[i:], y[i+1:])
+ *x = y[:len(y)-1]
+ return v
+ }
+ }
+ return make([]byte, 0, freelistCapacity(length))
+}
+
func (x *bytesFreelist) put(v []byte) {
- if len(v) == 0 {
+ if bytesFreeListNoCache || cap(v) == 0 {
return
}
- for i := 0; i < len(*x); i++ {
- if cap((*x)[i]) == 0 {
- (*x)[i] = v
+ if len(v) != 0 {
+ v = v[:0]
+ }
+ // append the new value, then try to put it in a better position
+ y := append(*x, v)
+ *x = y
+ // MARKER: do not use range, as range is not currently inlineable as of go 1.16-beta
+ // for i, z := range y[:len(y)-1] {
+ for i := 0; i < len(y)-1; i++ {
+ z := y[i]
+ if cap(z) > cap(v) {
+ copy(y[i+1:], y[i:])
+ y[i] = v
return
}
}
- *x = append(*x, v)
}
func (x *bytesFreelist) check(v []byte, length int) (out []byte) {
- if cap(v) < length {
+ // ensure inlineable, by moving slow-path out to its own function
+ if cap(v) >= length {
+ return v[:0]
+ }
+ return x.checkPutGet(v, length)
+}
+
+func (x *bytesFreelist) checkPutGet(v []byte, length int) []byte {
+ // checkPutGet broken out into its own function, so check is inlineable in general case
+ const useSeparateCalls = false
+
+ if useSeparateCalls {
x.put(v)
return x.get(length)
}
- return v[:length]
+
+ if bytesFreeListNoCache {
+ return make([]byte, 0, freelistCapacity(length))
+ }
+
+ // assume cap(v) < length, so put must happen before get
+ y := *x
+ var put = cap(v) == 0 // if empty, consider it already put
+ if !put {
+ y = append(y, v)
+ *x = y
+ }
+ for i := 0; i < len(y); i++ {
+ z := y[i]
+ if put {
+ if cap(z) >= length {
+ copy(y[i:], y[i+1:])
+ y = y[:len(y)-1]
+ *x = y
+ return z
+ }
+ } else {
+ if cap(z) > cap(v) {
+ copy(y[i+1:], y[i:])
+ y[i] = v
+ put = true
+ }
+ }
+ }
+ return make([]byte, 0, freelistCapacity(length))
}
// -------------------------
+// sfiRvFreelist is used by Encoder for encoding structs,
+// where we have to gather the fields first and then
+// analyze them for omitEmpty, before knowing the length of the array/map to encode.
+//
+// Typically, the length here will depend on the number of cycles e.g.
+// if type T1 has reference to T1, or T1 has reference to type T2 which has reference to T1.
+//
+// In the general case, the length of this list at most times is 1,
+// so linear search is fine.
type sfiRvFreelist [][]sfiRv
func (x *sfiRvFreelist) get(length int) (out []sfiRv) {
- var j int = -1
- for i := 0; i < len(*x); i++ {
- if cap((*x)[i]) >= length && (j == -1 || cap((*x)[j]) > cap((*x)[i])) {
- j = i
+ y := *x
+
+ // MARKER: do not use range, as range is not currently inlineable as of go 1.16-beta
+ // for i, v := range y {
+ for i := 0; i < len(y); i++ {
+ v := y[i]
+ if cap(v) >= length {
+ // *x = append(y[:i], y[i+1:]...)
+ copy(y[i:], y[i+1:])
+ *x = y[:len(y)-1]
+ return v
}
}
- if j == -1 {
- return make([]sfiRv, length, freelistCapacity(length))
- }
- out = (*x)[j][:length]
- (*x)[j] = nil
- for i := 0; i < len(out); i++ {
- out[i] = sfiRv{}
- }
- return
+ return make([]sfiRv, 0, freelistCapacity(length))
}
func (x *sfiRvFreelist) put(v []sfiRv) {
- for i := 0; i < len(*x); i++ {
- if cap((*x)[i]) == 0 {
- (*x)[i] = v
+ if len(v) != 0 {
+ v = v[:0]
+ }
+ // append the new value, then try to put it in a better position
+ y := append(*x, v)
+ *x = y
+ // MARKER: do not use range, as range is not currently inlineable as of go 1.16-beta
+ // for i, z := range y[:len(y)-1] {
+ for i := 0; i < len(y)-1; i++ {
+ z := y[i]
+ if cap(z) > cap(v) {
+ copy(y[i+1:], y[i:])
+ y[i] = v
return
}
}
- *x = append(*x, v)
}
-// -----------
+// ---- multiple interner implementations ----
-// xdebugf printf. the message in red on the terminal.
-// Use it in place of fmt.Printf (which it calls internally)
-func xdebugf(pattern string, args ...interface{}) {
- xdebugAnyf("31", pattern, args...)
+// Hard to tell which is most performant:
+// - use a map[string]string - worst perf, no collisions, and unlimited entries
+// - use a linear search with move to front heuristics - no collisions, and maxed at 64 entries
+// - use a computationally-intensive hash - best performance, some collisions, maxed at 64 entries
+
+const (
+ internMaxStrLen = 16 // if more than 16 bytes, faster to copy than compare bytes
+ internCap = 64 * 2 // 64 uses 1K bytes RAM, so 128 (anecdotal sweet spot) uses 2K bytes
+)
+
+type internerMap map[string]string
+
+func (x *internerMap) init() {
+ *x = make(map[string]string, internCap)
}
-// xdebug2f printf. the message in blue on the terminal.
-// Use it in place of fmt.Printf (which it calls internally)
-func xdebug2f(pattern string, args ...interface{}) {
- xdebugAnyf("34", pattern, args...)
-}
-
-func xdebugAnyf(colorcode, pattern string, args ...interface{}) {
- if !xdebug {
- return
+func (x internerMap) string(v []byte) (s string) {
+ s, ok := x[string(v)] // no allocation here, per go implementation
+ if !ok {
+ s = string(v) // new allocation here
+ x[s] = s
}
- var delim string
- if len(pattern) > 0 && pattern[len(pattern)-1] != '\n' {
- delim = "\n"
- }
- fmt.Printf("\033[1;"+colorcode+"m"+pattern+delim+"\033[0m", args...)
- // os.Stderr.Flush()
+ return
}
-
-// register these here, so that staticcheck stops barfing
-var _ = xdebug2f
-var _ = xdebugf
-var _ = isNaN32
diff --git a/vendor/github.com/ugorji/go/codec/helper_internal.go b/vendor/github.com/ugorji/go/codec/helper_internal.go
index 82d6e3140..e646249c7 100644
--- a/vendor/github.com/ugorji/go/codec/helper_internal.go
+++ b/vendor/github.com/ugorji/go/codec/helper_internal.go
@@ -1,8 +1,12 @@
-// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
+// maxArrayLen is the size of uint, which determines
+// the maximum length of any array.
+const maxArrayLen = 1<<((32<<(^uint(0)>>63))-1) - 1
+
// All non-std package dependencies live in this file,
// so porting to different environment is easy (just update functions).
@@ -18,27 +22,26 @@ func pruneSignExt(v []byte, pos bool) (n int) {
return
}
-// validate that this function is correct ...
-// culled from OGRE (Object-Oriented Graphics Rendering Engine)
-// function: halfToFloatI (http://stderr.org/doc/ogre-doc/api/OgreBitwise_8h-source.html)
-func halfFloatToFloatBits(yy uint16) (d uint32) {
- y := uint32(yy)
- s := (y >> 15) & 0x01
- e := (y >> 10) & 0x1f
- m := y & 0x03ff
+func halfFloatToFloatBits(h uint16) (f uint32) {
+ // retrofitted from:
+ // - OGRE (Object-Oriented Graphics Rendering Engine)
+ // function: halfToFloatI https://www.ogre3d.org/docs/api/1.9/_ogre_bitwise_8h_source.html
+
+ s := uint32(h >> 15)
+ m := uint32(h & 0x03ff)
+ e := int32((h >> 10) & 0x1f)
if e == 0 {
- if m == 0 { // plu or minus 0
+ if m == 0 { // plus or minus 0
return s << 31
}
// Denormalized number -- renormalize it
- for (m & 0x00000400) == 0 {
+ for (m & 0x0400) == 0 {
m <<= 1
e -= 1
}
e += 1
- const zz uint32 = 0x0400
- m &= ^zz
+ m &= ^uint32(0x0400)
} else if e == 31 {
if m == 0 { // Inf
return (s << 31) | 0x7f800000
@@ -47,78 +50,98 @@ func halfFloatToFloatBits(yy uint16) (d uint32) {
}
e = e + (127 - 15)
m = m << 13
- return (s << 31) | (e << 23) | m
+ return (s << 31) | (uint32(e) << 23) | m
}
-// GrowCap will return a new capacity for a slice, given the following:
+func floatToHalfFloatBits(i uint32) (h uint16) {
+ // retrofitted from:
+ // - OGRE (Object-Oriented Graphics Rendering Engine)
+ // function: halfToFloatI https://www.ogre3d.org/docs/api/1.9/_ogre_bitwise_8h_source.html
+ // - http://www.java2s.com/example/java-utility-method/float-to/floattohalf-float-f-fae00.html
+ s := (i >> 16) & 0x8000
+ e := int32(((i >> 23) & 0xff) - (127 - 15))
+ m := i & 0x7fffff
+
+ var h32 uint32
+
+ if e <= 0 {
+ if e < -10 { // zero
+ h32 = s // track -0 vs +0
+ } else {
+ m = (m | 0x800000) >> uint32(1-e)
+ h32 = s | (m >> 13)
+ }
+ } else if e == 0xff-(127-15) {
+ if m == 0 { // Inf
+ h32 = s | 0x7c00
+ } else { // NAN
+ m >>= 13
+ var me uint32
+ if m == 0 {
+ me = 1
+ }
+ h32 = s | 0x7c00 | m | me
+ }
+ } else {
+ if e > 30 { // Overflow
+ h32 = s | 0x7c00
+ } else {
+ h32 = s | (uint32(e) << 10) | (m >> 13)
+ }
+ }
+ h = uint16(h32)
+ return
+}
+
+// growCap will return a new capacity for a slice, given the following:
// - oldCap: current capacity
// - unit: in-memory size of an element
// - num: number of elements to add
-func growCap(oldCap, unit, num int) (newCap int) {
+func growCap(oldCap, unit, num uint) (newCap uint) {
// appendslice logic (if cap < 1024, *2, else *1.25):
// leads to many copy calls, especially when copying bytes.
// bytes.Buffer model (2*cap + n): much better for bytes.
// smarter way is to take the byte-size of the appended element(type) into account
- // maintain 3 thresholds:
+ // maintain 1 thresholds:
// t1: if cap <= t1, newcap = 2x
- // t2: if cap <= t2, newcap = 1.75x
- // t3: if cap <= t3, newcap = 1.5x
- // else newcap = 1.25x
+ // else newcap = 1.5x
//
- // t1, t2, t3 >= 1024 always.
- // i.e. if unit size >= 16, then always do 2x or 1.25x (ie t1, t2, t3 are all same)
+ // t1 is always >= 1024.
+ // This means that, if unit size >= 16, then always do 2x or 1.5x (ie t1, t2, t3 are all same)
//
// With this, appending for bytes increase by:
// 100% up to 4K
- // 75% up to 8K
- // 50% up to 16K
- // 25% beyond that
+ // 50% beyond that
// unit can be 0 e.g. for struct{}{}; handle that appropriately
- var t1, t2, t3 int // thresholds
- if unit <= 1 {
- t1, t2, t3 = 4*1024, 8*1024, 16*1024
- } else if unit < 16 {
- t3 = 16 / unit * 1024
- t1 = t3 * 1 / 4
- t2 = t3 * 2 / 4
- } else {
- t1, t2, t3 = 1024, 1024, 1024
+ maxCap := num + (oldCap * 3 / 2)
+ if unit == 0 || maxCap > maxArrayLen || maxCap < oldCap { // handle wraparound, etc
+ return maxArrayLen
}
- var x int // temporary variable
-
- // x is multiplier here: one of 5, 6, 7 or 8; incr of 25%, 50%, 75% or 100% respectively
- if oldCap <= t1 { // [0,t1]
- x = 8
- } else if oldCap > t3 { // (t3,infinity]
- x = 5
- } else if oldCap <= t2 { // (t1,t2]
- x = 7
- } else { // (t2,t3]
- x = 6
- }
- newCap = x * oldCap / 4
-
- if num > 0 {
- newCap += num
- }
- if newCap <= oldCap {
- newCap = oldCap + 1
+ var t1 uint = 1024 // default thresholds for large values
+ if unit <= 4 {
+ t1 = 8 * 1024
+ } else if unit <= 16 {
+ t1 = 2 * 1024
}
- // ensure newCap is a multiple of 64 (if it is > 64) or 16.
- if newCap > 64 {
- if x = newCap % 64; x != 0 {
- x = newCap / 64
- newCap = 64 * (x + 1)
- }
- } else {
- if x = newCap % 16; x != 0 {
- x = newCap / 16
- newCap = 16 * (x + 1)
+ newCap = 2 + num
+ if oldCap > 0 {
+ if oldCap <= t1 { // [0,t1]
+ newCap = num + (oldCap * 2)
+ } else { // (t1,infinity]
+ newCap = maxCap
}
}
+
+ // ensure newCap takes multiples of a cache line (size is a multiple of 64)
+ t1 = newCap * unit
+ if t2 := t1 % 64; t2 != 0 {
+ t1 += 64 - t2
+ newCap = t1 / unit
+ }
+
return
}
diff --git a/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go b/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go
index 4572c6f4c..57a3fe26d 100644
--- a/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go
+++ b/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go
@@ -1,57 +1,80 @@
-// +build !go1.7 safe appengine
-
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build !go1.9 || safe || codec.safe || appengine
+// +build !go1.9 safe codec.safe appengine
+
package codec
import (
+ // "hash/adler32"
+ "math"
"reflect"
"sync/atomic"
"time"
)
+// This file has safe variants of some helper functions.
+// MARKER: See helper_unsafe.go for the usage documentation.
+
const safeMode = true
-// stringView returns a view of the []byte as a string.
-// In unsafe mode, it doesn't incur allocation and copying caused by conversion.
-// In regular safe mode, it is an allocation and copy.
-//
-// Usage: Always maintain a reference to v while result of this call is in use,
-// and call keepAlive4BytesView(v) at point where done with view.
+const transientSizeMax = 0
+const transientValueHasStringSlice = true
+
func stringView(v []byte) string {
return string(v)
}
-// bytesView returns a view of the string as a []byte.
-// In unsafe mode, it doesn't incur allocation and copying caused by conversion.
-// In regular safe mode, it is an allocation and copy.
-//
-// Usage: Always maintain a reference to v while result of this call is in use,
-// and call keepAlive4BytesView(v) at point where done with view.
func bytesView(v string) []byte {
return []byte(v)
}
-// isNil says whether the value v is nil.
-// This applies to references like map/ptr/unsafepointer/chan/func,
-// and non-reference values like interface/slice.
+func byteSliceSameData(v1 []byte, v2 []byte) bool {
+ return cap(v1) != 0 && cap(v2) != 0 && &(v1[:1][0]) == &(v2[:1][0])
+}
+
+func okBytes3(b []byte) (v [4]byte) {
+ copy(v[1:], b)
+ return
+}
+
+func okBytes4(b []byte) (v [4]byte) {
+ copy(v[:], b)
+ return
+}
+
+func okBytes8(b []byte) (v [8]byte) {
+ copy(v[:], b)
+ return
+}
+
func isNil(v interface{}) (rv reflect.Value, isnil bool) {
- rv = rv4i(v)
+ rv = reflect.ValueOf(v)
if isnilBitset.isset(byte(rv.Kind())) {
isnil = rv.IsNil()
}
return
}
-func rv4i(i interface{}) reflect.Value {
- return reflect.ValueOf(i)
+func eq4i(i0, i1 interface{}) bool {
+ return i0 == i1
}
+func rv4iptr(i interface{}) reflect.Value { return reflect.ValueOf(i) }
+func rv4istr(i interface{}) reflect.Value { return reflect.ValueOf(i) }
+
+// func rv4i(i interface{}) reflect.Value { return reflect.ValueOf(i) }
+// func rv4iK(i interface{}, kind byte, isref bool) reflect.Value { return reflect.ValueOf(i) }
+
func rv2i(rv reflect.Value) interface{} {
return rv.Interface()
}
+func rvAddr(rv reflect.Value, ptrType reflect.Type) reflect.Value {
+ return rv.Addr()
+}
+
func rvIsNil(rv reflect.Value) bool {
return rv.IsNil()
}
@@ -64,49 +87,196 @@ func rvZeroAddrK(t reflect.Type, k reflect.Kind) reflect.Value {
return reflect.New(t).Elem()
}
+func rvZeroK(t reflect.Type, k reflect.Kind) reflect.Value {
+ return reflect.Zero(t)
+}
+
func rvConvert(v reflect.Value, t reflect.Type) (rv reflect.Value) {
+ // Note that reflect.Value.Convert(...) will make a copy if it is addressable.
+ // Since we decode into the passed value, we must try to convert the addressable value..
+ if v.CanAddr() {
+ return v.Addr().Convert(reflect.PtrTo(t)).Elem()
+ }
return v.Convert(t)
}
func rt2id(rt reflect.Type) uintptr {
- return rv4i(rt).Pointer()
+ return reflect.ValueOf(rt).Pointer()
}
func i2rtid(i interface{}) uintptr {
- return rv4i(reflect.TypeOf(i)).Pointer()
+ return reflect.ValueOf(reflect.TypeOf(i)).Pointer()
}
// --------------------------
-func isEmptyValue(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) bool {
+func isEmptyValue(v reflect.Value, tinfos *TypeInfos, recursive bool) bool {
switch v.Kind() {
case reflect.Invalid:
return true
- case reflect.Array, reflect.Map, reflect.Slice, reflect.String:
+ case reflect.Array, reflect.String:
return v.Len() == 0
+ case reflect.Map, reflect.Slice, reflect.Chan:
+ return v.IsNil() || v.Len() == 0
case reflect.Bool:
return !v.Bool()
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
return v.Int() == 0
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
return v.Uint() == 0
+ case reflect.Complex64, reflect.Complex128:
+ c := v.Complex()
+ return math.Float64bits(real(c)) == 0 && math.Float64bits(imag(c)) == 0
case reflect.Float32, reflect.Float64:
return v.Float() == 0
- case reflect.Interface, reflect.Ptr:
- if deref {
- if v.IsNil() {
- return true
- }
- return isEmptyValue(v.Elem(), tinfos, deref, checkStruct)
- }
+ case reflect.Func, reflect.UnsafePointer:
return v.IsNil()
+ case reflect.Interface, reflect.Ptr:
+ isnil := v.IsNil()
+ if recursive && !isnil {
+ return isEmptyValue(v.Elem(), tinfos, recursive)
+ }
+ return isnil
case reflect.Struct:
- return isEmptyStruct(v, tinfos, deref, checkStruct)
+ return isEmptyStruct(v, tinfos, recursive)
}
return false
}
+// isEmptyStruct is only called from isEmptyValue, and checks if a struct is empty:
+// - does it implement IsZero() bool
+// - is it comparable, and can i compare directly using ==
+// - if checkStruct, then walk through the encodable fields
+// and check if they are empty or not.
+func isEmptyStruct(v reflect.Value, tinfos *TypeInfos, recursive bool) bool {
+ // v is a struct kind - no need to check again.
+ // We only check isZero on a struct kind, to reduce the amount of times
+ // that we lookup the rtid and typeInfo for each type as we walk the tree.
+
+ vt := rvType(v)
+ rtid := rt2id(vt)
+ if tinfos == nil {
+ tinfos = defTypeInfos
+ }
+ ti := tinfos.get(rtid, vt)
+ if ti.rtid == timeTypId {
+ return rv2i(v).(time.Time).IsZero()
+ }
+ if ti.flagIsZeroer {
+ return rv2i(v).(isZeroer).IsZero()
+ }
+ if ti.flagIsZeroerPtr && v.CanAddr() {
+ return rv2i(v.Addr()).(isZeroer).IsZero()
+ }
+ if ti.flagIsCodecEmptyer {
+ return rv2i(v).(isCodecEmptyer).IsCodecEmpty()
+ }
+ if ti.flagIsCodecEmptyerPtr && v.CanAddr() {
+ return rv2i(v.Addr()).(isCodecEmptyer).IsCodecEmpty()
+ }
+ if ti.flagComparable {
+ return rv2i(v) == rv2i(rvZeroK(vt, reflect.Struct))
+ }
+ if !recursive {
+ return false
+ }
+ // We only care about what we can encode/decode,
+ // so that is what we use to check omitEmpty.
+ for _, si := range ti.sfi.source() {
+ sfv := si.path.field(v)
+ if sfv.IsValid() && !isEmptyValue(sfv, tinfos, recursive) {
+ return false
+ }
+ }
+ return true
+}
+
// --------------------------
+
+type perTypeElem struct {
+ t reflect.Type
+ rtid uintptr
+ zero reflect.Value
+ addr [2]reflect.Value
+}
+
+func (x *perTypeElem) get(index uint8) (v reflect.Value) {
+ v = x.addr[index%2]
+ if v.IsValid() {
+ v.Set(x.zero)
+ } else {
+ v = reflect.New(x.t).Elem()
+ x.addr[index%2] = v
+ }
+ return
+}
+
+type perType struct {
+ v []perTypeElem
+}
+
+type decPerType struct {
+ perType
+}
+
+type encPerType struct {
+ perType
+}
+
+func (x *perType) elem(t reflect.Type) *perTypeElem {
+ rtid := rt2id(t)
+ var h, i uint
+ var j = uint(len(x.v))
+LOOP:
+ if i < j {
+ h = (i + j) >> 1 // avoid overflow when computing h // h = i + (j-i)/2
+ if x.v[h].rtid < rtid {
+ i = h + 1
+ } else {
+ j = h
+ }
+ goto LOOP
+ }
+ if i < uint(len(x.v)) {
+ if x.v[i].rtid != rtid {
+ x.v = append(x.v, perTypeElem{})
+ copy(x.v[i+1:], x.v[i:])
+ x.v[i] = perTypeElem{t: t, rtid: rtid, zero: reflect.Zero(t)}
+ }
+ } else {
+ x.v = append(x.v, perTypeElem{t: t, rtid: rtid, zero: reflect.Zero(t)})
+ }
+ return &x.v[i]
+}
+
+func (x *perType) TransientAddrK(t reflect.Type, k reflect.Kind) (rv reflect.Value) {
+ return x.elem(t).get(0)
+}
+
+func (x *perType) TransientAddr2K(t reflect.Type, k reflect.Kind) (rv reflect.Value) {
+ return x.elem(t).get(1)
+}
+
+func (x *perType) AddressableRO(v reflect.Value) (rv reflect.Value) {
+ rv = x.elem(v.Type()).get(0)
+ rvSetDirect(rv, v)
+ return
+}
+
+// --------------------------
+type structFieldInfos struct {
+ c []*structFieldInfo
+ s []*structFieldInfo
+}
+
+func (x *structFieldInfos) load(source, sorted []*structFieldInfo) {
+ x.c = source
+ x.s = sorted
+}
+
+func (x *structFieldInfos) sorted() (v []*structFieldInfo) { return x.s }
+func (x *structFieldInfos) source() (v []*structFieldInfo) { return x.c }
+
type atomicClsErr struct {
v atomic.Value
}
@@ -123,7 +293,7 @@ func (x *atomicClsErr) store(p clsErr) {
}
// --------------------------
-type atomicTypeInfoSlice struct { // expected to be 2 words
+type atomicTypeInfoSlice struct {
v atomic.Value
}
@@ -139,7 +309,7 @@ func (x *atomicTypeInfoSlice) store(p []rtid2ti) {
}
// --------------------------
-type atomicRtidFnSlice struct { // expected to be 2 words
+type atomicRtidFnSlice struct {
v atomic.Value
}
@@ -155,26 +325,26 @@ func (x *atomicRtidFnSlice) store(p []codecRtidFn) {
}
// --------------------------
-func (n *decNaked) ru() reflect.Value {
- return rv4i(&n.u).Elem()
+func (n *fauxUnion) ru() reflect.Value {
+ return reflect.ValueOf(&n.u).Elem()
}
-func (n *decNaked) ri() reflect.Value {
- return rv4i(&n.i).Elem()
+func (n *fauxUnion) ri() reflect.Value {
+ return reflect.ValueOf(&n.i).Elem()
}
-func (n *decNaked) rf() reflect.Value {
- return rv4i(&n.f).Elem()
+func (n *fauxUnion) rf() reflect.Value {
+ return reflect.ValueOf(&n.f).Elem()
}
-func (n *decNaked) rl() reflect.Value {
- return rv4i(&n.l).Elem()
+func (n *fauxUnion) rl() reflect.Value {
+ return reflect.ValueOf(&n.l).Elem()
}
-func (n *decNaked) rs() reflect.Value {
- return rv4i(&n.s).Elem()
+func (n *fauxUnion) rs() reflect.Value {
+ return reflect.ValueOf(&n.s).Elem()
}
-func (n *decNaked) rt() reflect.Value {
- return rv4i(&n.t).Elem()
+func (n *fauxUnion) rt() reflect.Value {
+ return reflect.ValueOf(&n.t).Elem()
}
-func (n *decNaked) rb() reflect.Value {
- return rv4i(&n.b).Elem()
+func (n *fauxUnion) rb() reflect.Value {
+ return reflect.ValueOf(&n.b).Elem()
}
// --------------------------
@@ -191,7 +361,7 @@ func rvSetBool(rv reflect.Value, v bool) {
}
func rvSetTime(rv reflect.Value, v time.Time) {
- rv.Set(rv4i(v))
+ rv.Set(reflect.ValueOf(v))
}
func rvSetFloat32(rv reflect.Value, v float32) {
@@ -202,6 +372,14 @@ func rvSetFloat64(rv reflect.Value, v float64) {
rv.SetFloat(v)
}
+func rvSetComplex64(rv reflect.Value, v complex64) {
+ rv.SetComplex(complex128(v))
+}
+
+func rvSetComplex128(rv reflect.Value, v complex128) {
+ rv.SetComplex(v)
+}
+
func rvSetInt(rv reflect.Value, v int) {
rv.SetInt(int64(v))
}
@@ -248,34 +426,73 @@ func rvSetUint64(rv reflect.Value, v uint64) {
// ----------------
-// rvSetDirect is rv.Set for all kinds except reflect.Interface
func rvSetDirect(rv reflect.Value, v reflect.Value) {
rv.Set(v)
}
-// rvSlice returns a slice of the slice of lenth
+func rvSetDirectZero(rv reflect.Value) {
+ rv.Set(reflect.Zero(rv.Type()))
+}
+
+// func rvSet(rv reflect.Value, v reflect.Value) {
+// rv.Set(v)
+// }
+
+func rvSetIntf(rv reflect.Value, v reflect.Value) {
+ rv.Set(v)
+}
+
+func rvSetZero(rv reflect.Value) {
+ rv.Set(reflect.Zero(rv.Type()))
+}
+
func rvSlice(rv reflect.Value, length int) reflect.Value {
return rv.Slice(0, length)
}
+func rvMakeSlice(rv reflect.Value, ti *typeInfo, xlen, xcap int) (v reflect.Value, set bool) {
+ v = reflect.MakeSlice(ti.rt, xlen, xcap)
+ if rv.Len() > 0 {
+ reflect.Copy(v, rv)
+ }
+ return
+}
+
+func rvGrowSlice(rv reflect.Value, ti *typeInfo, cap, incr int) (v reflect.Value, newcap int, set bool) {
+ newcap = int(growCap(uint(cap), uint(ti.elemsize), uint(incr)))
+ v = reflect.MakeSlice(ti.rt, newcap, newcap)
+ if rv.Len() > 0 {
+ reflect.Copy(v, rv)
+ }
+ return
+}
+
// ----------------
func rvSliceIndex(rv reflect.Value, i int, ti *typeInfo) reflect.Value {
return rv.Index(i)
}
-func rvGetSliceLen(rv reflect.Value) int {
+func rvArrayIndex(rv reflect.Value, i int, ti *typeInfo) reflect.Value {
+ return rv.Index(i)
+}
+
+func rvSliceZeroCap(t reflect.Type) (v reflect.Value) {
+ return reflect.MakeSlice(t, 0, 0)
+}
+
+func rvLenSlice(rv reflect.Value) int {
return rv.Len()
}
-func rvGetSliceCap(rv reflect.Value) int {
+func rvCapSlice(rv reflect.Value) int {
return rv.Cap()
}
-func rvGetArrayBytesRO(rv reflect.Value, scratch []byte) (bs []byte) {
+func rvGetArrayBytes(rv reflect.Value, scratch []byte) (bs []byte) {
l := rv.Len()
- if rv.CanAddr() {
- return rvGetBytes(rv.Slice(0, l))
+ if scratch == nil || rv.CanAddr() {
+ return rv.Slice(0, l).Bytes()
}
if l <= cap(scratch) {
@@ -283,21 +500,36 @@ func rvGetArrayBytesRO(rv reflect.Value, scratch []byte) (bs []byte) {
} else {
bs = make([]byte, l)
}
- reflect.Copy(rv4i(bs), rv)
+ reflect.Copy(reflect.ValueOf(bs), rv)
return
}
func rvGetArray4Slice(rv reflect.Value) (v reflect.Value) {
- v = rvZeroAddrK(reflectArrayOf(rvGetSliceLen(rv), rv.Type().Elem()), reflect.Array)
+ v = rvZeroAddrK(reflectArrayOf(rvLenSlice(rv), rvType(rv).Elem()), reflect.Array)
reflect.Copy(v, rv)
return
}
-func rvGetSlice4Array(rv reflect.Value, tslice reflect.Type) (v reflect.Value) {
- return rv.Slice(0, rv.Len())
+func rvGetSlice4Array(rv reflect.Value, v interface{}) {
+ // v is a pointer to a slice to be populated
+
+ // rv.Slice fails if address is not addressable, which can occur during encoding.
+ // Consequently, check if non-addressable, and if so, make new slice and copy into it first.
+ // MARKER: this *may* cause allocation if non-addressable, unfortunately.
+
+ rve := reflect.ValueOf(v).Elem()
+ l := rv.Len()
+ if rv.CanAddr() {
+ rve.Set(rv.Slice(0, l))
+ } else {
+ rvs := reflect.MakeSlice(rve.Type(), l, l)
+ reflect.Copy(rvs, rv)
+ rve.Set(rvs)
+ }
+ // reflect.ValueOf(v).Elem().Set(rv.Slice(0, rv.Len()))
}
-func rvCopySlice(dest, src reflect.Value) {
+func rvCopySlice(dest, src reflect.Value, _ reflect.Type) {
reflect.Copy(dest, src)
}
@@ -327,6 +559,14 @@ func rvGetFloat32(rv reflect.Value) float32 {
return float32(rv.Float())
}
+func rvGetComplex64(rv reflect.Value) complex64 {
+ return complex64(rv.Complex())
+}
+
+func rvGetComplex128(rv reflect.Value) complex128 {
+ return rv.Complex()
+}
+
func rvGetInt(rv reflect.Value) int {
return int(rv.Int())
}
@@ -371,24 +611,29 @@ func rvGetUintptr(rv reflect.Value) uintptr {
return uintptr(rv.Uint())
}
-// ------------ map range and map indexing ----------
-
-func mapGet(m, k, v reflect.Value) (vv reflect.Value) {
- return m.MapIndex(k)
+func rvLenMap(rv reflect.Value) int {
+ return rv.Len()
}
-func mapSet(m, k, v reflect.Value) {
+// func rvLenArray(rv reflect.Value) int { return rv.Len() }
+
+// ------------ map range and map indexing ----------
+
+func mapStoresElemIndirect(elemsize uintptr) bool { return false }
+
+func mapSet(m, k, v reflect.Value, keyFastKind mapKeyFastKind, _, _ bool) {
m.SetMapIndex(k, v)
}
-func mapDelete(m, k reflect.Value) {
- m.SetMapIndex(k, reflect.Value{})
+func mapGet(m, k, v reflect.Value, keyFastKind mapKeyFastKind, _, _ bool) (vv reflect.Value) {
+ return m.MapIndex(k)
}
-// return an addressable reflect value that can be used in mapRange and mapGet operations.
-//
-// all calls to mapGet or mapRange will call here to get an addressable reflect.Value.
-func mapAddressableRV(t reflect.Type, k reflect.Kind) (r reflect.Value) {
+// func mapDelete(m, k reflect.Value) {
+// m.SetMapIndex(k, reflect.Value{})
+// }
+
+func mapAddrLoopvarRV(t reflect.Type, k reflect.Kind) (r reflect.Value) {
return // reflect.New(t).Elem()
}
@@ -407,3 +652,19 @@ func (d *Decoder) checkBreak() bool {
func (d *Decoder) jsondriver() *jsonDecDriver {
return d.d.(*jsonDecDriver)
}
+
+func (d *Decoder) stringZC(v []byte) (s string) {
+ return d.string(v)
+}
+
+func (d *Decoder) mapKeyString(callFnRvk *bool, kstrbs, kstr2bs *[]byte) string {
+ return d.string(*kstr2bs)
+}
+
+// ---------- structFieldInfo optimized ---------------
+
+func (n *structFieldInfoPathNode) rvField(v reflect.Value) reflect.Value {
+ return v.Field(int(n.index))
+}
+
+// ---------- others ---------------
diff --git a/vendor/github.com/ugorji/go/codec/helper_not_unsafe_not_gc.go b/vendor/github.com/ugorji/go/codec/helper_not_unsafe_not_gc.go
new file mode 100644
index 000000000..e3fdc8854
--- /dev/null
+++ b/vendor/github.com/ugorji/go/codec/helper_not_unsafe_not_gc.go
@@ -0,0 +1,19 @@
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
+// Use of this source code is governed by a MIT license found in the LICENSE file.
+
+//go:build !go1.9 || safe || codec.safe || appengine || !gc
+// +build !go1.9 safe codec.safe appengine !gc
+
+package codec
+
+import "reflect"
+
+// This files contains safe versions of the code where the unsafe versions are not supported
+// in either gccgo or gollvm.
+//
+// - rvType:
+// reflect.toType is not supported in gccgo, gollvm.
+
+func rvType(rv reflect.Value) reflect.Type {
+ return rv.Type()
+}
diff --git a/vendor/github.com/ugorji/go/codec/helper_unsafe.go b/vendor/github.com/ugorji/go/codec/helper_unsafe.go
index 9a22ccf5d..352cf4b3c 100644
--- a/vendor/github.com/ugorji/go/codec/helper_unsafe.go
+++ b/vendor/github.com/ugorji/go/codec/helper_unsafe.go
@@ -1,21 +1,46 @@
-// +build !safe
-// +build !appengine
-// +build go1.7
-
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build !safe && !codec.safe && !appengine && go1.9
+// +build !safe,!codec.safe,!appengine,go1.9
+
+// minimum of go 1.9 is needed, as that is the minimum for all features and linked functions we need
+// - typedmemclr was introduced in go 1.8
+// - mapassign_fastXXX was introduced in go 1.9
+// etc
+
package codec
import (
"reflect"
+ _ "runtime" // needed for go linkname(s)
"sync/atomic"
"time"
"unsafe"
)
-// This file has unsafe variants of some helper methods.
-// NOTE: See helper_not_unsafe.go for the usage information.
+// This file has unsafe variants of some helper functions.
+// MARKER: See helper_unsafe.go for the usage documentation.
+
+// There are a number of helper_*unsafe*.go files.
+//
+// - helper_unsafe
+// unsafe variants of dependent functions
+// - helper_unsafe_compiler_gc (gc)
+// unsafe variants of dependent functions which cannot be shared with gollvm or gccgo
+// - helper_not_unsafe_not_gc (gccgo/gollvm or safe)
+// safe variants of functions in helper_unsafe_compiler_gc
+// - helper_not_unsafe (safe)
+// safe variants of functions in helper_unsafe
+// - helper_unsafe_compiler_not_gc (gccgo, gollvm)
+// unsafe variants of functions/variables which non-standard compilers need
+//
+// This way, we can judiciously use build tags to include the right set of files
+// for any compiler, and make it run optimally in unsafe mode.
+//
+// As of March 2021, we cannot differentiate whether running with gccgo or gollvm
+// using a build constraint, as both satisfy 'gccgo' build tag.
+// Consequently, we must use the lowest common denominator to support both.
// For reflect.Value code, we decided to do the following:
// - if we know the kind, we can elide conditional checks for
@@ -25,16 +50,48 @@ import (
// We can also optimize
// - IsNil
+// MARKER: Some functions here will not be hit during code coverage runs due to optimizations, e.g.
+// - rvCopySlice: decode calls it if rvGrowSlice didn't set the new slice into the pointer to the orig slice.
+// however, helper_unsafe sets it, so there's no need to call rvCopySlice later
+// - rvSlice: same as above
+// - rvGetArray4Bytes: only called within kArray for []byte, but that is now handled
+// within the fast-path directly
+
const safeMode = false
-// keep in sync with GO_ROOT/src/reflect/value.go
+// helperUnsafeDirectAssignMapEntry says that we should not copy the pointer in the map
+// to another value during mapRange/iteration and mapGet calls, but directly assign it.
+//
+// The only callers of mapRange/iteration is encode.
+// Here, we just walk through the values and encode them
+//
+// The only caller of mapGet is decode.
+// Here, it does a Get if the underlying value is a pointer, and decodes into that.
+//
+// For both users, we are very careful NOT to modify or keep the pointers around.
+// Consequently, it is ok for take advantage of the performance that the map is not modified
+// during an iteration and we can just "peek" at the internal value" in the map and use it.
+const helperUnsafeDirectAssignMapEntry = true
+
+// MARKER: keep in sync with GO_ROOT/src/reflect/value.go
const (
+ unsafeFlagStickyRO = 1 << 5
+ unsafeFlagEmbedRO = 1 << 6
unsafeFlagIndir = 1 << 7
unsafeFlagAddr = 1 << 8
- unsafeFlagKindMask = (1 << 5) - 1 // 5 bits for 27 kinds (up to 31)
+ unsafeFlagRO = unsafeFlagStickyRO | unsafeFlagEmbedRO
+ // unsafeFlagKindMask = (1 << 5) - 1 // 5 bits for 27 kinds (up to 31)
// unsafeTypeKindDirectIface = 1 << 5
)
+// transientSizeMax below is used in TransientAddr as the backing storage.
+//
+// Must be >= 16 as the maximum size is a complex128 (or string on 64-bit machines).
+const transientSizeMax = 64
+
+// should struct/array support internal strings and slices?
+const transientValueHasStringSlice = false
+
type unsafeString struct {
Data unsafe.Pointer
Len int
@@ -47,83 +104,189 @@ type unsafeSlice struct {
}
type unsafeIntf struct {
- typ unsafe.Pointer
- word unsafe.Pointer
+ typ unsafe.Pointer
+ ptr unsafe.Pointer
}
type unsafeReflectValue struct {
- typ unsafe.Pointer
- ptr unsafe.Pointer
+ unsafeIntf
flag uintptr
}
+// keep in sync with stdlib runtime/type.go
+type unsafeRuntimeType struct {
+ size uintptr
+ // ... many other fields here
+}
+
+// unsafeZeroAddr and unsafeZeroSlice points to a read-only block of memory
+// used for setting a zero value for most types or creating a read-only
+// zero value for a given type.
+var (
+ unsafeZeroAddr = unsafe.Pointer(&unsafeZeroArr[0])
+ unsafeZeroSlice = unsafeSlice{unsafeZeroAddr, 0, 0}
+)
+
+// We use a scratch memory and an unsafeSlice for transient values:
+//
+// unsafeSlice is used for standalone strings and slices (outside an array or struct).
+// scratch memory is used for other kinds, based on contract below:
+// - numbers, bool are always transient
+// - structs and arrays are transient iff they have no pointers i.e.
+// no string, slice, chan, func, interface, map, etc only numbers and bools.
+// - slices and strings are transient (using the unsafeSlice)
+
+type unsafePerTypeElem struct {
+ arr [transientSizeMax]byte // for bool, number, struct, array kinds
+ slice unsafeSlice // for string and slice kinds
+}
+
+func (x *unsafePerTypeElem) addrFor(k reflect.Kind) unsafe.Pointer {
+ if k == reflect.String || k == reflect.Slice {
+ x.slice = unsafeSlice{} // memclr
+ return unsafe.Pointer(&x.slice)
+ }
+ x.arr = [transientSizeMax]byte{} // memclr
+ return unsafe.Pointer(&x.arr)
+}
+
+type perType struct {
+ elems [2]unsafePerTypeElem
+}
+
+type decPerType struct {
+ perType
+}
+
+type encPerType struct{}
+
+// TransientAddrK is used for getting a *transient* value to be decoded into,
+// which will right away be used for something else.
+//
+// See notes in helper.go about "Transient values during decoding"
+
+func (x *perType) TransientAddrK(t reflect.Type, k reflect.Kind) reflect.Value {
+ return rvZeroAddrTransientAnyK(t, k, x.elems[0].addrFor(k))
+}
+
+func (x *perType) TransientAddr2K(t reflect.Type, k reflect.Kind) reflect.Value {
+ return rvZeroAddrTransientAnyK(t, k, x.elems[1].addrFor(k))
+}
+
+func (encPerType) AddressableRO(v reflect.Value) reflect.Value {
+ return rvAddressableReadonly(v)
+}
+
+// stringView returns a view of the []byte as a string.
+// In unsafe mode, it doesn't incur allocation and copying caused by conversion.
+// In regular safe mode, it is an allocation and copy.
func stringView(v []byte) string {
- if len(v) == 0 {
- return ""
- }
- bx := (*unsafeSlice)(unsafe.Pointer(&v))
- return *(*string)(unsafe.Pointer(&unsafeString{bx.Data, bx.Len}))
+ return *(*string)(unsafe.Pointer(&v))
}
-func bytesView(v string) []byte {
- if len(v) == 0 {
- return zeroByteSlice
- }
+// bytesView returns a view of the string as a []byte.
+// In unsafe mode, it doesn't incur allocation and copying caused by conversion.
+// In regular safe mode, it is an allocation and copy.
+func bytesView(v string) (b []byte) {
sx := (*unsafeString)(unsafe.Pointer(&v))
- return *(*[]byte)(unsafe.Pointer(&unsafeSlice{sx.Data, sx.Len, sx.Len}))
+ bx := (*unsafeSlice)(unsafe.Pointer(&b))
+ bx.Data, bx.Len, bx.Cap = sx.Data, sx.Len, sx.Len
+ return
}
-// // isNilRef says whether the interface is a nil reference or not.
-// //
-// // A reference here is a pointer-sized reference i.e. map, ptr, chan, func, unsafepointer.
-// // It is optional to extend this to also check if slices or interfaces are nil also.
-// //
-// // NOTE: There is no global way of checking if an interface is nil.
-// // For true references (map, ptr, func, chan), you can just look
-// // at the word of the interface.
-// // However, for slices, you have to dereference
-// // the word, and get a pointer to the 3-word interface value.
-// func isNilRef(v interface{}) (rv reflect.Value, isnil bool) {
-// isnil = ((*unsafeIntf)(unsafe.Pointer(&v))).word == nil
-// return
-// }
+func byteSliceSameData(v1 []byte, v2 []byte) bool {
+ return (*unsafeSlice)(unsafe.Pointer(&v1)).Data == (*unsafeSlice)(unsafe.Pointer(&v2)).Data
+}
+// MARKER: okBytesN functions will copy N bytes into the top slots of the return array.
+// These functions expect that the bounds are valid, and have been checked before this is called.
+// copy(...) does a number of checks which are unnecessary in this situation when in bounds.
+
+func okBytes3(b []byte) (v [4]byte) {
+ *(*[3]byte)(unsafe.Pointer(&v[1])) = *((*[3]byte)(((*unsafeSlice)(unsafe.Pointer(&b))).Data))
+ return
+}
+
+func okBytes4(b []byte) [4]byte {
+ return *((*[4]byte)(((*unsafeSlice)(unsafe.Pointer(&b))).Data))
+}
+
+func okBytes8(b []byte) [8]byte {
+ return *((*[8]byte)(((*unsafeSlice)(unsafe.Pointer(&b))).Data))
+}
+
+// isNil says whether the value v is nil.
+// This applies to references like map/ptr/unsafepointer/chan/func,
+// and non-reference values like interface/slice.
func isNil(v interface{}) (rv reflect.Value, isnil bool) {
var ui = (*unsafeIntf)(unsafe.Pointer(&v))
- if ui.word == nil {
- isnil = true
- return
+ isnil = ui.ptr == nil
+ if !isnil {
+ rv, isnil = unsafeIsNilIntfOrSlice(ui, v)
}
- rv = rv4i(v) // reflect.value is cheap and inline'able
+ return
+}
+
+func unsafeIsNilIntfOrSlice(ui *unsafeIntf, v interface{}) (rv reflect.Value, isnil bool) {
+ rv = reflect.ValueOf(v) // reflect.ValueOf is currently not inline'able - so call it directly
tk := rv.Kind()
- isnil = (tk == reflect.Interface || tk == reflect.Slice) && *(*unsafe.Pointer)(ui.word) == nil
+ isnil = (tk == reflect.Interface || tk == reflect.Slice) && *(*unsafe.Pointer)(ui.ptr) == nil
return
}
-func rv2ptr(urv *unsafeReflectValue) (ptr unsafe.Pointer) {
- // true references (map, func, chan, ptr - NOT slice) may be double-referenced? as flagIndir
- if refBitset.isset(byte(urv.flag&unsafeFlagKindMask)) && urv.flag&unsafeFlagIndir != 0 {
- ptr = *(*unsafe.Pointer)(urv.ptr)
- } else {
- ptr = urv.ptr
+// return the pointer for a reference (map/chan/func/pointer/unsafe.Pointer).
+// true references (map, func, chan, ptr - NOT slice) may be double-referenced? as flagIndir
+//
+// Assumes that v is a reference (map/func/chan/ptr/func)
+func rvRefPtr(v *unsafeReflectValue) unsafe.Pointer {
+ if v.flag&unsafeFlagIndir != 0 {
+ return *(*unsafe.Pointer)(v.ptr)
}
+ return v.ptr
+}
+
+func eq4i(i0, i1 interface{}) bool {
+ v0 := (*unsafeIntf)(unsafe.Pointer(&i0))
+ v1 := (*unsafeIntf)(unsafe.Pointer(&i1))
+ return v0.typ == v1.typ && v0.ptr == v1.ptr
+}
+
+func rv4iptr(i interface{}) (v reflect.Value) {
+ // Main advantage here is that it is inlined, nothing escapes to heap, i is never nil
+ uv := (*unsafeReflectValue)(unsafe.Pointer(&v))
+ uv.unsafeIntf = *(*unsafeIntf)(unsafe.Pointer(&i))
+ uv.flag = uintptr(rkindPtr)
return
}
-func rv4i(i interface{}) (rv reflect.Value) {
- // Unfortunately, we cannot get the "kind" of the interface directly here.
- // We need the 'rtype', whose structure changes in different go versions.
- // Finally, it's not clear that there is benefit to reimplementing it,
- // as the "escapes(i)" is not clearly expensive since we want i to exist on the heap.
-
- return reflect.ValueOf(i)
+func rv4istr(i interface{}) (v reflect.Value) {
+ // Main advantage here is that it is inlined, nothing escapes to heap, i is never nil
+ uv := (*unsafeReflectValue)(unsafe.Pointer(&v))
+ uv.unsafeIntf = *(*unsafeIntf)(unsafe.Pointer(&i))
+ uv.flag = uintptr(rkindString) | unsafeFlagIndir
+ return
}
-func rv2i(rv reflect.Value) interface{} {
+func rv2i(rv reflect.Value) (i interface{}) {
// We tap into implememtation details from
// the source go stdlib reflect/value.go, and trims the implementation.
+ //
+ // e.g.
+ // - a map/ptr is a reference, thus flagIndir is not set on it
+ // - an int/slice is not a reference, thus flagIndir is set on it
+
urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
- return *(*interface{})(unsafe.Pointer(&unsafeIntf{typ: urv.typ, word: rv2ptr(urv)}))
+ if refBitset.isset(byte(rv.Kind())) && urv.flag&unsafeFlagIndir != 0 {
+ urv.ptr = *(*unsafe.Pointer)(urv.ptr)
+ }
+ return *(*interface{})(unsafe.Pointer(&urv.unsafeIntf))
+}
+
+func rvAddr(rv reflect.Value, ptrType reflect.Type) reflect.Value {
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ urv.flag = (urv.flag & unsafeFlagRO) | uintptr(reflect.Ptr)
+ urv.typ = ((*unsafeIntf)(unsafe.Pointer(&ptrType))).ptr
+ return rv
}
func rvIsNil(rv reflect.Value) bool {
@@ -141,22 +304,69 @@ func rvSetSliceLen(rv reflect.Value, length int) {
func rvZeroAddrK(t reflect.Type, k reflect.Kind) (rv reflect.Value) {
urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ urv.typ = ((*unsafeIntf)(unsafe.Pointer(&t))).ptr
urv.flag = uintptr(k) | unsafeFlagIndir | unsafeFlagAddr
- urv.typ = ((*unsafeIntf)(unsafe.Pointer(&t))).word
- urv.ptr = unsafe_New(urv.typ)
+ urv.ptr = unsafeNew(urv.typ)
return
}
-func rvConvert(v reflect.Value, t reflect.Type) (rv reflect.Value) {
- uv := (*unsafeReflectValue)(unsafe.Pointer(&v))
+func rvZeroAddrTransientAnyK(t reflect.Type, k reflect.Kind, addr unsafe.Pointer) (rv reflect.Value) {
urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
- *urv = *uv
- urv.typ = ((*unsafeIntf)(unsafe.Pointer(&t))).word
+ urv.typ = ((*unsafeIntf)(unsafe.Pointer(&t))).ptr
+ urv.flag = uintptr(k) | unsafeFlagIndir | unsafeFlagAddr
+ urv.ptr = addr
return
}
+func rvZeroK(t reflect.Type, k reflect.Kind) (rv reflect.Value) {
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ urv.typ = ((*unsafeIntf)(unsafe.Pointer(&t))).ptr
+ if refBitset.isset(byte(k)) {
+ urv.flag = uintptr(k)
+ } else if rtsize2(urv.typ) <= uintptr(len(unsafeZeroArr)) {
+ urv.flag = uintptr(k) | unsafeFlagIndir
+ urv.ptr = unsafeZeroAddr
+ } else { // meaning struct or array
+ urv.flag = uintptr(k) | unsafeFlagIndir | unsafeFlagAddr
+ urv.ptr = unsafeNew(urv.typ)
+ }
+ return
+}
+
+// rvConvert will convert a value to a different type directly,
+// ensuring that they still point to the same underlying value.
+func rvConvert(v reflect.Value, t reflect.Type) reflect.Value {
+ uv := (*unsafeReflectValue)(unsafe.Pointer(&v))
+ uv.typ = ((*unsafeIntf)(unsafe.Pointer(&t))).ptr
+ return v
+}
+
+// rvAddressableReadonly returns an addressable reflect.Value.
+//
+// Use it within encode calls, when you just want to "read" the underlying ptr
+// without modifying the value.
+//
+// Note that it cannot be used for r/w use, as those non-addressable values
+// may have been stored in read-only memory, and trying to write the pointer
+// may cause a segfault.
+func rvAddressableReadonly(v reflect.Value) reflect.Value {
+ // hack to make an addressable value out of a non-addressable one.
+ // Assume folks calling it are passing a value that can be addressable, but isn't.
+ // This assumes that the flagIndir is already set on it.
+ // so we just set the flagAddr bit on the flag (and do not set the flagIndir).
+
+ uv := (*unsafeReflectValue)(unsafe.Pointer(&v))
+ uv.flag = uv.flag | unsafeFlagAddr // | unsafeFlagIndir
+
+ return v
+}
+
+func rtsize2(rt unsafe.Pointer) uintptr {
+ return ((*unsafeRuntimeType)(rt)).size
+}
+
func rt2id(rt reflect.Type) uintptr {
- return uintptr(((*unsafeIntf)(unsafe.Pointer(&rt))).word)
+ return uintptr(((*unsafeIntf)(unsafe.Pointer(&rt))).ptr)
}
func i2rtid(i interface{}) uintptr {
@@ -165,11 +375,30 @@ func i2rtid(i interface{}) uintptr {
// --------------------------
-func isEmptyValue(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) bool {
+func unsafeCmpZero(ptr unsafe.Pointer, size int) bool {
+ var s1 = unsafeString{ptr, size}
+ var s2 = unsafeString{unsafeZeroAddr, size}
+ if size > len(unsafeZeroArr) {
+ arr := make([]byte, size)
+ s2.Data = unsafe.Pointer(&arr[0])
+ }
+ return *(*string)(unsafe.Pointer(&s1)) == *(*string)(unsafe.Pointer(&s2)) // memcmp
+}
+
+func isEmptyValue(v reflect.Value, tinfos *TypeInfos, recursive bool) bool {
urv := (*unsafeReflectValue)(unsafe.Pointer(&v))
if urv.flag == 0 {
return true
}
+ if recursive {
+ return isEmptyValueFallbackRecur(urv, v, tinfos)
+ }
+ return unsafeCmpZero(urv.ptr, int(rtsize2(urv.typ)))
+}
+
+func isEmptyValueFallbackRecur(urv *unsafeReflectValue, v reflect.Value, tinfos *TypeInfos) bool {
+ const recursive = true
+
switch v.Kind() {
case reflect.Invalid:
return true
@@ -205,28 +434,34 @@ func isEmptyValue(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) b
return *(*float32)(urv.ptr) == 0
case reflect.Float64:
return *(*float64)(urv.ptr) == 0
- case reflect.Interface:
- isnil := urv.ptr == nil || *(*unsafe.Pointer)(urv.ptr) == nil
- if deref {
- if isnil {
- return true
- }
- return isEmptyValue(v.Elem(), tinfos, deref, checkStruct)
+ case reflect.Complex64:
+ return unsafeCmpZero(urv.ptr, 8)
+ case reflect.Complex128:
+ return unsafeCmpZero(urv.ptr, 16)
+ case reflect.Struct:
+ // return isEmptyStruct(v, tinfos, recursive)
+ if tinfos == nil {
+ tinfos = defTypeInfos
}
- return isnil
- case reflect.Ptr:
+ ti := tinfos.find(uintptr(urv.typ))
+ if ti == nil {
+ ti = tinfos.load(rvType(v))
+ }
+ return unsafeCmpZero(urv.ptr, int(ti.size))
+ case reflect.Interface, reflect.Ptr:
// isnil := urv.ptr == nil // (not sufficient, as a pointer value encodes the type)
isnil := urv.ptr == nil || *(*unsafe.Pointer)(urv.ptr) == nil
- if deref {
- if isnil {
- return true
- }
- return isEmptyValue(v.Elem(), tinfos, deref, checkStruct)
+ if recursive && !isnil {
+ return isEmptyValue(v.Elem(), tinfos, recursive)
}
return isnil
- case reflect.Struct:
- return isEmptyStruct(v, tinfos, deref, checkStruct)
- case reflect.Map, reflect.Array, reflect.Chan:
+ case reflect.UnsafePointer:
+ return urv.ptr == nil || *(*unsafe.Pointer)(urv.ptr) == nil
+ case reflect.Chan:
+ return urv.ptr == nil || len_chan(rvRefPtr(urv)) == 0
+ case reflect.Map:
+ return urv.ptr == nil || len_map(rvRefPtr(urv)) == 0
+ case reflect.Array:
return v.Len() == 0
}
return false
@@ -234,6 +469,34 @@ func isEmptyValue(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) b
// --------------------------
+type structFieldInfos struct {
+ c unsafe.Pointer // source
+ s unsafe.Pointer // sorted
+ length int
+}
+
+func (x *structFieldInfos) load(source, sorted []*structFieldInfo) {
+ s := (*unsafeSlice)(unsafe.Pointer(&sorted))
+ x.s = s.Data
+ x.length = s.Len
+ s = (*unsafeSlice)(unsafe.Pointer(&source))
+ x.c = s.Data
+}
+
+func (x *structFieldInfos) sorted() (v []*structFieldInfo) {
+ *(*unsafeSlice)(unsafe.Pointer(&v)) = unsafeSlice{x.s, x.length, x.length}
+ // s := (*unsafeSlice)(unsafe.Pointer(&v))
+ // s.Data = x.sorted0
+ // s.Len = x.length
+ // s.Cap = s.Len
+ return
+}
+
+func (x *structFieldInfos) source() (v []*structFieldInfo) {
+ *(*unsafeSlice)(unsafe.Pointer(&v)) = unsafeSlice{x.c, x.length, x.length}
+ return
+}
+
// atomicXXX is expected to be 2 words (for symmetry with atomic.Value)
//
// Note that we do not atomically load/store length and data pointer separately,
@@ -244,7 +507,6 @@ func isEmptyValue(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) b
// ----------------------
type atomicTypeInfoSlice struct {
v unsafe.Pointer // *[]rtid2ti
- _ uint64 // padding (atomicXXX expected to be 2 words)
}
func (x *atomicTypeInfoSlice) load() (s []rtid2ti) {
@@ -259,10 +521,13 @@ func (x *atomicTypeInfoSlice) store(p []rtid2ti) {
atomic.StorePointer(&x.v, unsafe.Pointer(&p))
}
+// MARKER: in safe mode, atomicXXX are atomic.Value, which contains an interface{}.
+// This is 2 words.
+// consider padding atomicXXX here with a uintptr, so they fit into 2 words also.
+
// --------------------------
type atomicRtidFnSlice struct {
v unsafe.Pointer // *[]codecRtidFn
- _ uint64 // padding (atomicXXX expected to be 2 words) (make 1 word so JsonHandle fits)
}
func (x *atomicRtidFnSlice) load() (s []codecRtidFn) {
@@ -280,7 +545,6 @@ func (x *atomicRtidFnSlice) store(p []codecRtidFn) {
// --------------------------
type atomicClsErr struct {
v unsafe.Pointer // *clsErr
- _ uint64 // padding (atomicXXX expected to be 2 words)
}
func (x *atomicClsErr) load() (e clsErr) {
@@ -297,27 +561,27 @@ func (x *atomicClsErr) store(p clsErr) {
// --------------------------
-// to create a reflect.Value for each member field of decNaked,
-// we first create a global decNaked, and create reflect.Value
+// to create a reflect.Value for each member field of fauxUnion,
+// we first create a global fauxUnion, and create reflect.Value
// for them all.
// This way, we have the flags and type in the reflect.Value.
// Then, when a reflect.Value is called, we just copy it,
-// update the ptr to the decNaked's, and return it.
+// update the ptr to the fauxUnion's, and return it.
type unsafeDecNakedWrapper struct {
- decNaked
+ fauxUnion
ru, ri, rf, rl, rs, rb, rt reflect.Value // mapping to the primitives above
}
func (n *unsafeDecNakedWrapper) init() {
- n.ru = rv4i(&n.u).Elem()
- n.ri = rv4i(&n.i).Elem()
- n.rf = rv4i(&n.f).Elem()
- n.rl = rv4i(&n.l).Elem()
- n.rs = rv4i(&n.s).Elem()
- n.rt = rv4i(&n.t).Elem()
- n.rb = rv4i(&n.b).Elem()
- // n.rr[] = rv4i(&n.)
+ n.ru = rv4iptr(&n.u).Elem()
+ n.ri = rv4iptr(&n.i).Elem()
+ n.rf = rv4iptr(&n.f).Elem()
+ n.rl = rv4iptr(&n.l).Elem()
+ n.rs = rv4iptr(&n.s).Elem()
+ n.rt = rv4iptr(&n.t).Elem()
+ n.rb = rv4iptr(&n.b).Elem()
+ // n.rr[] = reflect.ValueOf(&n.)
}
var defUnsafeDecNakedWrapper unsafeDecNakedWrapper
@@ -326,37 +590,37 @@ func init() {
defUnsafeDecNakedWrapper.init()
}
-func (n *decNaked) ru() (v reflect.Value) {
+func (n *fauxUnion) ru() (v reflect.Value) {
v = defUnsafeDecNakedWrapper.ru
((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.u)
return
}
-func (n *decNaked) ri() (v reflect.Value) {
+func (n *fauxUnion) ri() (v reflect.Value) {
v = defUnsafeDecNakedWrapper.ri
((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.i)
return
}
-func (n *decNaked) rf() (v reflect.Value) {
+func (n *fauxUnion) rf() (v reflect.Value) {
v = defUnsafeDecNakedWrapper.rf
((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.f)
return
}
-func (n *decNaked) rl() (v reflect.Value) {
+func (n *fauxUnion) rl() (v reflect.Value) {
v = defUnsafeDecNakedWrapper.rl
((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.l)
return
}
-func (n *decNaked) rs() (v reflect.Value) {
+func (n *fauxUnion) rs() (v reflect.Value) {
v = defUnsafeDecNakedWrapper.rs
((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.s)
return
}
-func (n *decNaked) rt() (v reflect.Value) {
+func (n *fauxUnion) rt() (v reflect.Value) {
v = defUnsafeDecNakedWrapper.rt
((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.t)
return
}
-func (n *decNaked) rb() (v reflect.Value) {
+func (n *fauxUnion) rb() (v reflect.Value) {
v = defUnsafeDecNakedWrapper.rb
((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.b)
return
@@ -393,6 +657,16 @@ func rvSetFloat64(rv reflect.Value, v float64) {
*(*float64)(urv.ptr) = v
}
+func rvSetComplex64(rv reflect.Value, v complex64) {
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ *(*complex64)(urv.ptr) = v
+}
+
+func rvSetComplex128(rv reflect.Value, v complex128) {
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ *(*complex128)(urv.ptr) = v
+}
+
func rvSetInt(rv reflect.Value, v int) {
urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
*(*int)(urv.ptr) = v
@@ -450,27 +724,80 @@ func rvSetUint64(rv reflect.Value, v uint64) {
// ----------------
-// rvSetDirect is rv.Set for all kinds except reflect.Interface
+// rvSetZero is rv.Set(reflect.Zero(rv.Type()) for all kinds (including reflect.Interface).
+func rvSetZero(rv reflect.Value) {
+ rvSetDirectZero(rv)
+}
+
+func rvSetIntf(rv reflect.Value, v reflect.Value) {
+ rv.Set(v)
+}
+
+// rvSetDirect is rv.Set for all kinds except reflect.Interface.
+//
+// Callers MUST not pass a value of kind reflect.Interface, as it may cause unexpected segfaults.
func rvSetDirect(rv reflect.Value, v reflect.Value) {
+ // MARKER: rv.Set for kind reflect.Interface may do a separate allocation if a scalar value.
+ // The book-keeping is onerous, so we just do the simple ones where a memmove is sufficient.
urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
uv := (*unsafeReflectValue)(unsafe.Pointer(&v))
if uv.flag&unsafeFlagIndir == 0 {
*(*unsafe.Pointer)(urv.ptr) = uv.ptr
+ } else if uv.ptr == unsafeZeroAddr {
+ if urv.ptr != unsafeZeroAddr {
+ typedmemclr(urv.typ, urv.ptr)
+ }
} else {
typedmemmove(urv.typ, urv.ptr, uv.ptr)
}
}
-// rvSlice returns a slice of the slice of lenth
-func rvSlice(rv reflect.Value, length int) (v reflect.Value) {
+// rvSetDirectZero is rv.Set(reflect.Zero(rv.Type()) for all kinds except reflect.Interface.
+func rvSetDirectZero(rv reflect.Value) {
urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
- uv := (*unsafeReflectValue)(unsafe.Pointer(&v))
- *uv = *urv
- var x []unsafe.Pointer
- uv.ptr = unsafe.Pointer(&x)
- *(*unsafeSlice)(uv.ptr) = *(*unsafeSlice)(urv.ptr)
- (*unsafeSlice)(uv.ptr).Len = length
- return
+ if urv.ptr != unsafeZeroAddr {
+ typedmemclr(urv.typ, urv.ptr)
+ }
+}
+
+// rvMakeSlice updates the slice to point to a new array.
+// It copies data from old slice to new slice.
+// It returns set=true iff it updates it, else it just returns a new slice pointing to a newly made array.
+func rvMakeSlice(rv reflect.Value, ti *typeInfo, xlen, xcap int) (_ reflect.Value, set bool) {
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ ux := (*unsafeSlice)(urv.ptr)
+ t := ((*unsafeIntf)(unsafe.Pointer(&ti.elem))).ptr
+ s := unsafeSlice{newarray(t, xcap), xlen, xcap}
+ if ux.Len > 0 {
+ typedslicecopy(t, s, *ux)
+ }
+ *ux = s
+ return rv, true
+}
+
+// rvSlice returns a sub-slice of the slice given new lenth,
+// without modifying passed in value.
+// It is typically called when we know that SetLen(...) cannot be done.
+func rvSlice(rv reflect.Value, length int) reflect.Value {
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ var x []struct{}
+ ux := (*unsafeSlice)(unsafe.Pointer(&x))
+ *ux = *(*unsafeSlice)(urv.ptr)
+ ux.Len = length
+ urv.ptr = unsafe.Pointer(ux)
+ return rv
+}
+
+// rcGrowSlice updates the slice to point to a new array with the cap incremented, and len set to the new cap value.
+// It copies data from old slice to new slice.
+// It returns set=true iff it updates it, else it just returns a new slice pointing to a newly made array.
+func rvGrowSlice(rv reflect.Value, ti *typeInfo, cap, incr int) (v reflect.Value, newcap int, set bool) {
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ ux := (*unsafeSlice)(urv.ptr)
+ t := ((*unsafeIntf)(unsafe.Pointer(&ti.elem))).ptr
+ *ux = unsafeGrowslice(t, *ux, cap, incr)
+ ux.Len = ux.Cap
+ return rv, ux.Cap, true
}
// ------------
@@ -478,28 +805,46 @@ func rvSlice(rv reflect.Value, length int) (v reflect.Value) {
func rvSliceIndex(rv reflect.Value, i int, ti *typeInfo) (v reflect.Value) {
urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
uv := (*unsafeReflectValue)(unsafe.Pointer(&v))
- uv.ptr = unsafe.Pointer(uintptr(((*unsafeSlice)(urv.ptr)).Data) + (ti.elemsize * uintptr(i)))
- uv.typ = ((*unsafeIntf)(unsafe.Pointer(&ti.elem))).word
+ uv.ptr = unsafe.Pointer(uintptr(((*unsafeSlice)(urv.ptr)).Data) + uintptr(int(ti.elemsize)*i))
+ uv.typ = ((*unsafeIntf)(unsafe.Pointer(&ti.elem))).ptr
uv.flag = uintptr(ti.elemkind) | unsafeFlagIndir | unsafeFlagAddr
return
}
-func rvGetSliceLen(rv reflect.Value) int {
+func rvSliceZeroCap(t reflect.Type) (v reflect.Value) {
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&v))
+ urv.typ = ((*unsafeIntf)(unsafe.Pointer(&t))).ptr
+ urv.flag = uintptr(reflect.Slice) | unsafeFlagIndir
+ urv.ptr = unsafe.Pointer(&unsafeZeroSlice)
+ return
+}
+
+func rvLenSlice(rv reflect.Value) int {
urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
return (*unsafeSlice)(urv.ptr).Len
}
-func rvGetSliceCap(rv reflect.Value) int {
+func rvCapSlice(rv reflect.Value) int {
urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
return (*unsafeSlice)(urv.ptr).Cap
}
-func rvGetArrayBytesRO(rv reflect.Value, scratch []byte) (bs []byte) {
- l := rv.Len()
+func rvArrayIndex(rv reflect.Value, i int, ti *typeInfo) (v reflect.Value) {
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ uv := (*unsafeReflectValue)(unsafe.Pointer(&v))
+ uv.ptr = unsafe.Pointer(uintptr(urv.ptr) + uintptr(int(ti.elemsize)*i))
+ uv.typ = ((*unsafeIntf)(unsafe.Pointer(&ti.elem))).ptr
+ uv.flag = uintptr(ti.elemkind) | unsafeFlagIndir | unsafeFlagAddr
+ return
+}
+
+// if scratch is nil, then return a writable view (assuming canAddr=true)
+func rvGetArrayBytes(rv reflect.Value, scratch []byte) (bs []byte) {
urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
bx := (*unsafeSlice)(unsafe.Pointer(&bs))
bx.Data = urv.ptr
- bx.Len, bx.Cap = l, l
+ bx.Len = rv.Len()
+ bx.Cap = bx.Len
return
}
@@ -510,14 +855,14 @@ func rvGetArray4Slice(rv reflect.Value) (v reflect.Value) {
// e.g. full slice is based off a *[16]byte, but we can create a *[4]byte
// off of it. That is ok.
//
- // Consequently, we use rvGetSliceLen, not rvGetSliceCap.
+ // Consequently, we use rvLenSlice, not rvCapSlice.
- t := reflectArrayOf(rvGetSliceLen(rv), rv.Type().Elem())
+ t := reflectArrayOf(rvLenSlice(rv), rvType(rv).Elem())
// v = rvZeroAddrK(t, reflect.Array)
uv := (*unsafeReflectValue)(unsafe.Pointer(&v))
uv.flag = uintptr(reflect.Array) | unsafeFlagIndir | unsafeFlagAddr
- uv.typ = ((*unsafeIntf)(unsafe.Pointer(&t))).word
+ uv.typ = ((*unsafeIntf)(unsafe.Pointer(&t))).ptr
urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
uv.ptr = *(*unsafe.Pointer)(urv.ptr) // slice rv has a ptr to the slice.
@@ -525,29 +870,21 @@ func rvGetArray4Slice(rv reflect.Value) (v reflect.Value) {
return
}
-func rvGetSlice4Array(rv reflect.Value, tslice reflect.Type) (v reflect.Value) {
- uv := (*unsafeReflectValue)(unsafe.Pointer(&v))
-
- var x []unsafe.Pointer
-
- uv.ptr = unsafe.Pointer(&x)
- uv.typ = ((*unsafeIntf)(unsafe.Pointer(&tslice))).word
- uv.flag = unsafeFlagIndir | uintptr(reflect.Slice)
+func rvGetSlice4Array(rv reflect.Value, v interface{}) {
+ // v is a pointer to a slice to be populated
+ uv := (*unsafeIntf)(unsafe.Pointer(&v))
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
s := (*unsafeSlice)(uv.ptr)
- s.Data = ((*unsafeReflectValue)(unsafe.Pointer(&rv))).ptr
+ s.Data = urv.ptr
s.Len = rv.Len()
s.Cap = s.Len
- return
}
-func rvCopySlice(dest, src reflect.Value) {
- t := dest.Type().Elem()
- urv := (*unsafeReflectValue)(unsafe.Pointer(&dest))
- destPtr := urv.ptr
- urv = (*unsafeReflectValue)(unsafe.Pointer(&src))
- typedslicecopy((*unsafeIntf)(unsafe.Pointer(&t)).word,
- *(*unsafeSlice)(destPtr), *(*unsafeSlice)(urv.ptr))
+func rvCopySlice(dest, src reflect.Value, elemType reflect.Type) {
+ typedslicecopy((*unsafeIntf)(unsafe.Pointer(&elemType)).ptr,
+ *(*unsafeSlice)((*unsafeReflectValue)(unsafe.Pointer(&dest)).ptr),
+ *(*unsafeSlice)((*unsafeReflectValue)(unsafe.Pointer(&src)).ptr))
}
// ------------
@@ -582,6 +919,16 @@ func rvGetFloat32(rv reflect.Value) float32 {
return *(*float32)(v.ptr)
}
+func rvGetComplex64(rv reflect.Value) complex64 {
+ v := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ return *(*complex64)(v.ptr)
+}
+
+func rvGetComplex128(rv reflect.Value) complex128 {
+ v := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ return *(*complex128)(v.ptr)
+}
+
func rvGetInt(rv reflect.Value) int {
v := (*unsafeReflectValue)(unsafe.Pointer(&rv))
return *(*int)(v.ptr)
@@ -637,6 +984,22 @@ func rvGetUintptr(rv reflect.Value) uintptr {
return *(*uintptr)(v.ptr)
}
+func rvLenMap(rv reflect.Value) int {
+ // maplen is not inlined, because as of go1.16beta, go:linkname's are not inlined.
+ // thus, faster to call rv.Len() directly.
+ //
+ // MARKER: review after https://github.com/golang/go/issues/20019 fixed.
+
+ // return rv.Len()
+
+ return len_map(rvRefPtr((*unsafeReflectValue)(unsafe.Pointer(&rv))))
+}
+
+// Note: it is hard to find len(...) of an array type,
+// as that is a field in the arrayType representing the array, and hard to introspect.
+//
+// func rvLenArray(rv reflect.Value) int { return rv.Len() }
+
// ------------ map range and map indexing ----------
// regular calls to map via reflection: MapKeys, MapIndex, MapRange/MapIter etc
@@ -645,8 +1008,6 @@ func rvGetUintptr(rv reflect.Value) uintptr {
// It is more performant to provide a value that the map entry is set into,
// and that elides the allocation.
-// unsafeMapHashIter
-//
// go 1.4+ has runtime/hashmap.go or runtime/map.go which has a
// hIter struct with the first 2 values being key and value
// of the current iteration.
@@ -655,29 +1016,26 @@ func rvGetUintptr(rv reflect.Value) uintptr {
// We bypass the reflect wrapper functions and just use the *hIter directly.
//
// Though *hIter has many fields, we only care about the first 2.
-type unsafeMapHashIter struct {
- key, value unsafe.Pointer
- // other fields are ignored
-}
-
-type mapIter struct {
- unsafeMapIter
-}
+//
+// We directly embed this in unsafeMapIter below
+//
+// hiter is typically about 12 words, but we just fill up unsafeMapIter to 32 words,
+// so it fills multiple cache lines and can give some extra space to accomodate small growth.
type unsafeMapIter struct {
- it *unsafeMapHashIter
- // k, v reflect.Value
- mtyp, ktyp, vtyp unsafe.Pointer
- mptr, kptr, vptr unsafe.Pointer
- kisref, visref bool
- mapvalues bool
- done bool
- started bool
- // _ [2]uint64 // padding (cache-aligned)
-}
-
-func (t *unsafeMapIter) ValidKV() (r bool) {
- return false
+ mtyp, mptr unsafe.Pointer
+ k, v reflect.Value
+ kisref bool
+ visref bool
+ mapvalues bool
+ done bool
+ started bool
+ _ [3]byte // padding
+ it struct {
+ key unsafe.Pointer
+ value unsafe.Pointer
+ _ [20]uintptr // padding for other fields (to make up 32 words for enclosing struct)
+ }
}
func (t *unsafeMapIter) Next() (r bool) {
@@ -685,7 +1043,7 @@ func (t *unsafeMapIter) Next() (r bool) {
return
}
if t.started {
- mapiternext((unsafe.Pointer)(t.it))
+ mapiternext((unsafe.Pointer)(&t.it))
} else {
t.started = true
}
@@ -694,37 +1052,38 @@ func (t *unsafeMapIter) Next() (r bool) {
if t.done {
return
}
- unsafeMapSet(t.kptr, t.ktyp, t.it.key, t.kisref)
- if t.mapvalues {
- unsafeMapSet(t.vptr, t.vtyp, t.it.value, t.visref)
+
+ if helperUnsafeDirectAssignMapEntry || t.kisref {
+ (*unsafeReflectValue)(unsafe.Pointer(&t.k)).ptr = t.it.key
+ } else {
+ k := (*unsafeReflectValue)(unsafe.Pointer(&t.k))
+ typedmemmove(k.typ, k.ptr, t.it.key)
}
+
+ if t.mapvalues {
+ if helperUnsafeDirectAssignMapEntry || t.visref {
+ (*unsafeReflectValue)(unsafe.Pointer(&t.v)).ptr = t.it.value
+ } else {
+ v := (*unsafeReflectValue)(unsafe.Pointer(&t.v))
+ typedmemmove(v.typ, v.ptr, t.it.value)
+ }
+ }
+
return true
}
func (t *unsafeMapIter) Key() (r reflect.Value) {
- return
+ return t.k
}
func (t *unsafeMapIter) Value() (r reflect.Value) {
- return
+ return t.v
}
-func (t *unsafeMapIter) Done() {
-}
+func (t *unsafeMapIter) Done() {}
-func unsafeMapSet(p, ptyp, p2 unsafe.Pointer, isref bool) {
- if isref {
- *(*unsafe.Pointer)(p) = *(*unsafe.Pointer)(p2) // p2
- } else {
- typedmemmove(ptyp, p, p2) // *(*unsafe.Pointer)(p2)) // p2)
- }
-}
-
-func unsafeMapKVPtr(urv *unsafeReflectValue) unsafe.Pointer {
- if urv.flag&unsafeFlagIndir == 0 {
- return unsafe.Pointer(&urv.ptr)
- }
- return urv.ptr
+type mapIter struct {
+ unsafeMapIter
}
func mapRange(t *mapIter, m, k, v reflect.Value, mapvalues bool) {
@@ -736,55 +1095,33 @@ func mapRange(t *mapIter, m, k, v reflect.Value, mapvalues bool) {
t.started = false
t.mapvalues = mapvalues
- var urv *unsafeReflectValue
+ // var urv *unsafeReflectValue
- urv = (*unsafeReflectValue)(unsafe.Pointer(&m))
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&m))
t.mtyp = urv.typ
- t.mptr = rv2ptr(urv)
+ t.mptr = rvRefPtr(urv)
- t.it = (*unsafeMapHashIter)(mapiterinit(t.mtyp, t.mptr))
+ // t.it = (*unsafeMapHashIter)(reflect_mapiterinit(t.mtyp, t.mptr))
+ mapiterinit(t.mtyp, t.mptr, unsafe.Pointer(&t.it))
- urv = (*unsafeReflectValue)(unsafe.Pointer(&k))
- t.ktyp = urv.typ
- t.kptr = urv.ptr
+ t.k = k
t.kisref = refBitset.isset(byte(k.Kind()))
if mapvalues {
- urv = (*unsafeReflectValue)(unsafe.Pointer(&v))
- t.vtyp = urv.typ
- t.vptr = urv.ptr
+ t.v = v
t.visref = refBitset.isset(byte(v.Kind()))
} else {
- t.vtyp = nil
- t.vptr = nil
+ t.v = reflect.Value{}
}
}
-func mapGet(m, k, v reflect.Value) (vv reflect.Value) {
- var urv = (*unsafeReflectValue)(unsafe.Pointer(&k))
- var kptr = unsafeMapKVPtr(urv)
-
- urv = (*unsafeReflectValue)(unsafe.Pointer(&m))
-
- vvptr := mapaccess(urv.typ, rv2ptr(urv), kptr)
- if vvptr == nil {
- return
+// unsafeMapKVPtr returns the pointer if flagIndir, else it returns a pointer to the pointer.
+// It is needed as maps always keep a reference to the underlying value.
+func unsafeMapKVPtr(urv *unsafeReflectValue) unsafe.Pointer {
+ if urv.flag&unsafeFlagIndir == 0 {
+ return unsafe.Pointer(&urv.ptr)
}
- // vvptr = *(*unsafe.Pointer)(vvptr)
-
- urv = (*unsafeReflectValue)(unsafe.Pointer(&v))
-
- unsafeMapSet(urv.ptr, urv.typ, vvptr, refBitset.isset(byte(v.Kind())))
- return v
-}
-
-func mapSet(m, k, v reflect.Value) {
- var urv = (*unsafeReflectValue)(unsafe.Pointer(&k))
- var kptr = unsafeMapKVPtr(urv)
- urv = (*unsafeReflectValue)(unsafe.Pointer(&v))
- var vptr = unsafeMapKVPtr(urv)
- urv = (*unsafeReflectValue)(unsafe.Pointer(&m))
- mapassign(urv.typ, rv2ptr(urv), kptr, vptr)
+ return urv.ptr
}
// func mapDelete(m, k reflect.Value) {
@@ -797,53 +1134,51 @@ func mapSet(m, k, v reflect.Value) {
// return an addressable reflect value that can be used in mapRange and mapGet operations.
//
// all calls to mapGet or mapRange will call here to get an addressable reflect.Value.
-func mapAddressableRV(t reflect.Type, k reflect.Kind) (r reflect.Value) {
- // return reflect.New(t).Elem()
- return rvZeroAddrK(t, k)
+func mapAddrLoopvarRV(t reflect.Type, k reflect.Kind) (rv reflect.Value) {
+ // return rvZeroAddrK(t, k)
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ urv.flag = uintptr(k) | unsafeFlagIndir | unsafeFlagAddr
+ urv.typ = ((*unsafeIntf)(unsafe.Pointer(&t))).ptr
+ // since we always set the ptr when helperUnsafeDirectAssignMapEntry=true,
+ // we should only allocate if it is not true
+ if !helperUnsafeDirectAssignMapEntry {
+ urv.ptr = unsafeNew(urv.typ)
+ }
+ return
}
-//go:linkname mapiterinit reflect.mapiterinit
-//go:noescape
-func mapiterinit(typ unsafe.Pointer, it unsafe.Pointer) (key unsafe.Pointer)
-
-//go:linkname mapiternext reflect.mapiternext
-//go:noescape
-func mapiternext(it unsafe.Pointer) (key unsafe.Pointer)
-
-//go:linkname mapaccess reflect.mapaccess
-//go:noescape
-func mapaccess(typ unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer) (val unsafe.Pointer)
-
-//go:linkname mapassign reflect.mapassign
-//go:noescape
-func mapassign(typ unsafe.Pointer, m unsafe.Pointer, key, val unsafe.Pointer)
-
-//go:linkname mapdelete reflect.mapdelete
-//go:noescape
-func mapdelete(typ unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer)
-
-//go:linkname typedmemmove reflect.typedmemmove
-//go:noescape
-func typedmemmove(typ unsafe.Pointer, dst, src unsafe.Pointer)
-
-//go:linkname unsafe_New reflect.unsafe_New
-//go:noescape
-func unsafe_New(typ unsafe.Pointer) unsafe.Pointer
-
-//go:linkname typedslicecopy reflect.typedslicecopy
-//go:noescape
-func typedslicecopy(elemType unsafe.Pointer, dst, src unsafeSlice) int
-
// ---------- ENCODER optimized ---------------
func (e *Encoder) jsondriver() *jsonEncDriver {
- return (*jsonEncDriver)((*unsafeIntf)(unsafe.Pointer(&e.e)).word)
+ return (*jsonEncDriver)((*unsafeIntf)(unsafe.Pointer(&e.e)).ptr)
+}
+
+func (d *Decoder) zerocopystate() bool {
+ return d.decByteState == decByteStateZerocopy && d.h.ZeroCopy
+}
+
+func (d *Decoder) stringZC(v []byte) (s string) {
+ if d.zerocopystate() {
+ return stringView(v)
+ }
+ return d.string(v)
+}
+
+func (d *Decoder) mapKeyString(callFnRvk *bool, kstrbs, kstr2bs *[]byte) string {
+ if !d.zerocopystate() {
+ *callFnRvk = true
+ if d.decByteState == decByteStateReuseBuf {
+ *kstrbs = append((*kstrbs)[:0], (*kstr2bs)...)
+ *kstr2bs = *kstrbs
+ }
+ }
+ return stringView(*kstr2bs)
}
// ---------- DECODER optimized ---------------
func (d *Decoder) checkBreak() bool {
- // jsonDecDriver.CheckBreak() CANNOT be inlined.
+ // MARKER: jsonDecDriver.CheckBreak() costs over 80, and this isn't inlined.
// Consequently, there's no benefit in incurring the cost of this
// wrapping function checkBreak.
//
@@ -859,9 +1194,108 @@ func (d *Decoder) checkBreak() bool {
}
func (d *Decoder) jsondriver() *jsonDecDriver {
- return (*jsonDecDriver)((*unsafeIntf)(unsafe.Pointer(&d.d)).word)
+ return (*jsonDecDriver)((*unsafeIntf)(unsafe.Pointer(&d.d)).ptr)
}
-// func (d *Decoder) cbordriver() *cborDecDriver {
-// return (*cborDecDriver)((*unsafeIntf)(unsafe.Pointer(&d.d)).word)
-// }
+// ---------- structFieldInfo optimized ---------------
+
+func (n *structFieldInfoPathNode) rvField(v reflect.Value) (rv reflect.Value) {
+ // we already know this is exported, and maybe embedded (based on what si says)
+ uv := (*unsafeReflectValue)(unsafe.Pointer(&v))
+ urv := (*unsafeReflectValue)(unsafe.Pointer(&rv))
+ // clear flagEmbedRO if necessary, and inherit permission bits from v
+ urv.flag = uv.flag&(unsafeFlagStickyRO|unsafeFlagIndir|unsafeFlagAddr) | uintptr(n.kind)
+ urv.typ = ((*unsafeIntf)(unsafe.Pointer(&n.typ))).ptr
+ urv.ptr = unsafe.Pointer(uintptr(uv.ptr) + uintptr(n.offset))
+ return
+}
+
+// runtime chan and map are designed such that the first field is the count.
+// len builtin uses this to get the length of a chan/map easily.
+// leverage this knowledge, since maplen and chanlen functions from runtime package
+// are go:linkname'd here, and thus not inlined as of go1.16beta
+
+func len_map_chan(m unsafe.Pointer) int {
+ if m == nil {
+ return 0
+ }
+ return *((*int)(m))
+}
+
+func len_map(m unsafe.Pointer) int {
+ // return maplen(m)
+ return len_map_chan(m)
+}
+func len_chan(m unsafe.Pointer) int {
+ // return chanlen(m)
+ return len_map_chan(m)
+}
+
+func unsafeNew(typ unsafe.Pointer) unsafe.Pointer {
+ return mallocgc(rtsize2(typ), typ, true)
+}
+
+// ---------- go linknames (LINKED to runtime/reflect) ---------------
+
+// MARKER: always check that these linknames match subsequent versions of go
+//
+// Note that as of Jan 2021 (go 1.16 release), go:linkname(s) are not inlined
+// outside of the standard library use (e.g. within sync, reflect, etc).
+// If these link'ed functions were normally inlined, calling them here would
+// not necessarily give a performance boost, due to function overhead.
+//
+// However, it seems most of these functions are not inlined anyway,
+// as only maplen, chanlen and mapaccess are small enough to get inlined.
+//
+// We checked this by going into $GOROOT/src/runtime and running:
+// $ go build -tags codec.notfastpath -gcflags "-m=2"
+
+// reflect.{unsafe_New, unsafe_NewArray} are not supported in gollvm,
+// failing with "error: undefined reference" error.
+// however, runtime.{mallocgc, newarray} are supported, so use that instead.
+
+//go:linkname mallocgc runtime.mallocgc
+//go:noescape
+func mallocgc(size uintptr, typ unsafe.Pointer, needzero bool) unsafe.Pointer
+
+//go:linkname newarray runtime.newarray
+//go:noescape
+func newarray(typ unsafe.Pointer, n int) unsafe.Pointer
+
+//go:linkname mapiterinit runtime.mapiterinit
+//go:noescape
+func mapiterinit(typ unsafe.Pointer, m unsafe.Pointer, it unsafe.Pointer)
+
+//go:linkname mapiternext runtime.mapiternext
+//go:noescape
+func mapiternext(it unsafe.Pointer) (key unsafe.Pointer)
+
+//go:linkname mapdelete runtime.mapdelete
+//go:noescape
+func mapdelete(typ unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer)
+
+//go:linkname mapassign runtime.mapassign
+//go:noescape
+func mapassign(typ unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer) unsafe.Pointer
+
+//go:linkname mapaccess2 runtime.mapaccess2
+//go:noescape
+func mapaccess2(typ unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer) (val unsafe.Pointer, ok bool)
+
+// reflect.typed{memmove, memclr, slicecopy} will handle checking if the type has pointers or not,
+// and if a writeBarrier is needed, before delegating to the right method in the runtime.
+//
+// This is why we use the functions in reflect, and not the ones in runtime directly.
+// Calling runtime.XXX here will lead to memory issues.
+
+//go:linkname typedslicecopy reflect.typedslicecopy
+//go:noescape
+func typedslicecopy(elemType unsafe.Pointer, dst, src unsafeSlice) int
+
+//go:linkname typedmemmove reflect.typedmemmove
+//go:noescape
+func typedmemmove(typ unsafe.Pointer, dst, src unsafe.Pointer)
+
+//go:linkname typedmemclr reflect.typedmemclr
+//go:noescape
+func typedmemclr(typ unsafe.Pointer, dst unsafe.Pointer)
diff --git a/vendor/github.com/ugorji/go/codec/helper_unsafe_compiler_gc.go b/vendor/github.com/ugorji/go/codec/helper_unsafe_compiler_gc.go
new file mode 100644
index 000000000..1cbce9d22
--- /dev/null
+++ b/vendor/github.com/ugorji/go/codec/helper_unsafe_compiler_gc.go
@@ -0,0 +1,171 @@
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
+// Use of this source code is governed by a MIT license found in the LICENSE file.
+
+//go:build !safe && !codec.safe && !appengine && go1.9 && gc
+// +build !safe,!codec.safe,!appengine,go1.9,gc
+
+package codec
+
+import (
+ "reflect"
+ _ "runtime" // needed for go linkname(s)
+ "unsafe"
+)
+
+// keep in sync with
+// $GOROOT/src/cmd/compile/internal/gc/reflect.go: MAXKEYSIZE, MAXELEMSIZE
+// $GOROOT/src/runtime/map.go: maxKeySize, maxElemSize
+// $GOROOT/src/reflect/type.go: maxKeySize, maxElemSize
+//
+// We use these to determine whether the type is stored indirectly in the map or not.
+const (
+ // mapMaxKeySize = 128
+ mapMaxElemSize = 128
+)
+
+func unsafeGrowslice(typ unsafe.Pointer, old unsafeSlice, cap, incr int) (v unsafeSlice) {
+ return growslice(typ, old, cap+incr)
+}
+
+func rvType(rv reflect.Value) reflect.Type {
+ return rvPtrToType(((*unsafeReflectValue)(unsafe.Pointer(&rv))).typ) // rv.Type()
+}
+
+// mapStoresElemIndirect tells if the element type is stored indirectly in the map.
+//
+// This is used to determine valIsIndirect which is passed into mapSet/mapGet calls.
+//
+// If valIsIndirect doesn't matter, then just return false and ignore the value
+// passed in mapGet/mapSet calls
+func mapStoresElemIndirect(elemsize uintptr) bool {
+ return elemsize > mapMaxElemSize
+}
+
+func mapSet(m, k, v reflect.Value, keyFastKind mapKeyFastKind, valIsIndirect, valIsRef bool) {
+ var urv = (*unsafeReflectValue)(unsafe.Pointer(&k))
+ var kptr = unsafeMapKVPtr(urv)
+ urv = (*unsafeReflectValue)(unsafe.Pointer(&v))
+ var vtyp = urv.typ
+ var vptr = unsafeMapKVPtr(urv)
+
+ urv = (*unsafeReflectValue)(unsafe.Pointer(&m))
+ mptr := rvRefPtr(urv)
+
+ var vvptr unsafe.Pointer
+
+ // mapassign_fastXXX don't take indirect into account.
+ // It was hard to infer what makes it work all the time.
+ // Sometimes, we got vvptr == nil when we dereferenced vvptr (if valIsIndirect).
+ // Consequently, only use fastXXX functions if !valIsIndirect
+
+ if valIsIndirect {
+ vvptr = mapassign(urv.typ, mptr, kptr)
+ typedmemmove(vtyp, vvptr, vptr)
+ // reflect_mapassign(urv.typ, mptr, kptr, vptr)
+ return
+ }
+
+ switch keyFastKind {
+ case mapKeyFastKind32:
+ vvptr = mapassign_fast32(urv.typ, mptr, *(*uint32)(kptr))
+ case mapKeyFastKind32ptr:
+ vvptr = mapassign_fast32ptr(urv.typ, mptr, *(*unsafe.Pointer)(kptr))
+ case mapKeyFastKind64:
+ vvptr = mapassign_fast64(urv.typ, mptr, *(*uint64)(kptr))
+ case mapKeyFastKind64ptr:
+ vvptr = mapassign_fast64ptr(urv.typ, mptr, *(*unsafe.Pointer)(kptr))
+ case mapKeyFastKindStr:
+ vvptr = mapassign_faststr(urv.typ, mptr, *(*string)(kptr))
+ default:
+ vvptr = mapassign(urv.typ, mptr, kptr)
+ }
+
+ // if keyFastKind != 0 && valIsIndirect {
+ // vvptr = *(*unsafe.Pointer)(vvptr)
+ // }
+
+ typedmemmove(vtyp, vvptr, vptr)
+}
+
+func mapGet(m, k, v reflect.Value, keyFastKind mapKeyFastKind, valIsIndirect, valIsRef bool) (_ reflect.Value) {
+ var urv = (*unsafeReflectValue)(unsafe.Pointer(&k))
+ var kptr = unsafeMapKVPtr(urv)
+ urv = (*unsafeReflectValue)(unsafe.Pointer(&m))
+ mptr := rvRefPtr(urv)
+
+ var vvptr unsafe.Pointer
+ var ok bool
+
+ // Note that mapaccess2_fastXXX functions do not check if the value needs to be copied.
+ // if they do, we should dereference the pointer and return that
+
+ switch keyFastKind {
+ case mapKeyFastKind32, mapKeyFastKind32ptr:
+ vvptr, ok = mapaccess2_fast32(urv.typ, mptr, *(*uint32)(kptr))
+ case mapKeyFastKind64, mapKeyFastKind64ptr:
+ vvptr, ok = mapaccess2_fast64(urv.typ, mptr, *(*uint64)(kptr))
+ case mapKeyFastKindStr:
+ vvptr, ok = mapaccess2_faststr(urv.typ, mptr, *(*string)(kptr))
+ default:
+ vvptr, ok = mapaccess2(urv.typ, mptr, kptr)
+ }
+
+ if !ok {
+ return
+ }
+
+ urv = (*unsafeReflectValue)(unsafe.Pointer(&v))
+
+ if keyFastKind != 0 && valIsIndirect {
+ urv.ptr = *(*unsafe.Pointer)(vvptr)
+ } else if helperUnsafeDirectAssignMapEntry || valIsRef {
+ urv.ptr = vvptr
+ } else {
+ typedmemmove(urv.typ, urv.ptr, vvptr)
+ }
+
+ return v
+}
+
+//go:linkname unsafeZeroArr runtime.zeroVal
+var unsafeZeroArr [1024]byte
+
+//go:linkname rvPtrToType reflect.toType
+//go:noescape
+func rvPtrToType(typ unsafe.Pointer) reflect.Type
+
+//go:linkname growslice runtime.growslice
+//go:noescape
+func growslice(typ unsafe.Pointer, old unsafeSlice, cap int) unsafeSlice
+
+//go:linkname mapassign_fast32 runtime.mapassign_fast32
+//go:noescape
+func mapassign_fast32(typ unsafe.Pointer, m unsafe.Pointer, key uint32) unsafe.Pointer
+
+//go:linkname mapassign_fast32ptr runtime.mapassign_fast32ptr
+//go:noescape
+func mapassign_fast32ptr(typ unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer) unsafe.Pointer
+
+//go:linkname mapassign_fast64 runtime.mapassign_fast64
+//go:noescape
+func mapassign_fast64(typ unsafe.Pointer, m unsafe.Pointer, key uint64) unsafe.Pointer
+
+//go:linkname mapassign_fast64ptr runtime.mapassign_fast64ptr
+//go:noescape
+func mapassign_fast64ptr(typ unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer) unsafe.Pointer
+
+//go:linkname mapassign_faststr runtime.mapassign_faststr
+//go:noescape
+func mapassign_faststr(typ unsafe.Pointer, m unsafe.Pointer, s string) unsafe.Pointer
+
+//go:linkname mapaccess2_fast32 runtime.mapaccess2_fast32
+//go:noescape
+func mapaccess2_fast32(typ unsafe.Pointer, m unsafe.Pointer, key uint32) (val unsafe.Pointer, ok bool)
+
+//go:linkname mapaccess2_fast64 runtime.mapaccess2_fast64
+//go:noescape
+func mapaccess2_fast64(typ unsafe.Pointer, m unsafe.Pointer, key uint64) (val unsafe.Pointer, ok bool)
+
+//go:linkname mapaccess2_faststr runtime.mapaccess2_faststr
+//go:noescape
+func mapaccess2_faststr(typ unsafe.Pointer, m unsafe.Pointer, key string) (val unsafe.Pointer, ok bool)
diff --git a/vendor/github.com/ugorji/go/codec/helper_unsafe_compiler_not_gc.go b/vendor/github.com/ugorji/go/codec/helper_unsafe_compiler_not_gc.go
new file mode 100644
index 000000000..bd9fdedb6
--- /dev/null
+++ b/vendor/github.com/ugorji/go/codec/helper_unsafe_compiler_not_gc.go
@@ -0,0 +1,80 @@
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
+// Use of this source code is governed by a MIT license found in the LICENSE file.
+
+//go:build !safe && !codec.safe && !appengine && go1.9 && !gc
+// +build !safe,!codec.safe,!appengine,go1.9,!gc
+
+package codec
+
+import (
+ "reflect"
+ _ "runtime" // needed for go linkname(s)
+ "unsafe"
+)
+
+var unsafeZeroArr [1024]byte
+
+// runtime.growslice does not work with gccgo, failing with "growslice: cap out of range" error.
+// consequently, we just call newarray followed by typedslicecopy directly.
+
+func unsafeGrowslice(typ unsafe.Pointer, old unsafeSlice, cap, incr int) (v unsafeSlice) {
+ size := rtsize2(typ)
+ if size == 0 {
+ return unsafeSlice{unsafe.Pointer(&unsafeZeroArr[0]), old.Len, cap + incr}
+ }
+ newcap := int(growCap(uint(cap), uint(size), uint(incr)))
+ v = unsafeSlice{Data: newarray(typ, newcap), Len: old.Len, Cap: newcap}
+ if old.Len > 0 {
+ typedslicecopy(typ, v, old)
+ }
+ // memmove(v.Data, old.Data, size*uintptr(old.Len))
+ return
+}
+
+// func unsafeNew(t reflect.Type, typ unsafe.Pointer) unsafe.Pointer {
+// rv := reflect.New(t)
+// return ((*unsafeReflectValue)(unsafe.Pointer(&rv))).ptr
+// }
+
+// runtime.{mapassign_fastXXX, mapaccess2_fastXXX} are not supported in gollvm,
+// failing with "error: undefined reference" error.
+// so we just use runtime.{mapassign, mapaccess2} directly
+
+func mapStoresElemIndirect(elemsize uintptr) bool { return false }
+
+func mapSet(m, k, v reflect.Value, _ mapKeyFastKind, _, valIsRef bool) {
+ var urv = (*unsafeReflectValue)(unsafe.Pointer(&k))
+ var kptr = unsafeMapKVPtr(urv)
+ urv = (*unsafeReflectValue)(unsafe.Pointer(&v))
+ var vtyp = urv.typ
+ var vptr = unsafeMapKVPtr(urv)
+
+ urv = (*unsafeReflectValue)(unsafe.Pointer(&m))
+ mptr := rvRefPtr(urv)
+
+ vvptr := mapassign(urv.typ, mptr, kptr)
+ typedmemmove(vtyp, vvptr, vptr)
+}
+
+func mapGet(m, k, v reflect.Value, _ mapKeyFastKind, _, valIsRef bool) (_ reflect.Value) {
+ var urv = (*unsafeReflectValue)(unsafe.Pointer(&k))
+ var kptr = unsafeMapKVPtr(urv)
+ urv = (*unsafeReflectValue)(unsafe.Pointer(&m))
+ mptr := rvRefPtr(urv)
+
+ vvptr, ok := mapaccess2(urv.typ, mptr, kptr)
+
+ if !ok {
+ return
+ }
+
+ urv = (*unsafeReflectValue)(unsafe.Pointer(&v))
+
+ if helperUnsafeDirectAssignMapEntry || valIsRef {
+ urv.ptr = vvptr
+ } else {
+ typedmemmove(urv.typ, urv.ptr, vvptr)
+ }
+
+ return v
+}
diff --git a/vendor/github.com/ugorji/go/codec/json.go b/vendor/github.com/ugorji/go/codec/json.go
index 7b64e02ec..8bd151f90 100644
--- a/vendor/github.com/ugorji/go/codec/json.go
+++ b/vendor/github.com/ugorji/go/codec/json.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
@@ -14,14 +14,13 @@ package codec
// we will encode and decode appropriately.
// Users can specify their map type if necessary to force it.
//
-// Note:
-// - we cannot use strconv.Quote and strconv.Unquote because json quotes/unquotes differently.
-// We implement it here.
+// We cannot use strconv.(Q|Unq)uote because json quotes/unquotes differently.
import (
"bytes"
"encoding/base64"
"math"
+ "reflect"
"strconv"
"time"
"unicode"
@@ -65,8 +64,6 @@ const (
jsonU4Chk2 = '0'
jsonU4Chk1 = 'a' - 10
jsonU4Chk0 = 'A' - 10
-
- // jsonScratchArrayLen = cacheLineSize + 32 // 96
)
const (
@@ -78,19 +75,52 @@ const (
// P.S. Do not expect a significant decoding boost from this.
jsonValidateSymbols = true
+ // jsonEscapeMultiByteUnicodeSep controls whether some unicode characters
+ // that are valid json but may bomb in some contexts are escaped during encoeing.
+ //
+ // U+2028 is LINE SEPARATOR. U+2029 is PARAGRAPH SEPARATOR.
+ // Both technically valid JSON, but bomb on JSONP, so fix here unconditionally.
+ jsonEscapeMultiByteUnicodeSep = true
+
+ // jsonManualInlineDecRdInHotZones controls whether we manually inline some decReader calls.
+ //
+ // encode performance is at par with libraries that just iterate over bytes directly,
+ // because encWr (with inlined bytesEncAppender calls) is inlined.
+ // Conversely, decode performance suffers because decRd (with inlined bytesDecReader calls)
+ // isn't inlinable.
+ //
+ // To improve decode performamnce from json:
+ // - readn1 is only called for \u
+ // - consequently, to optimize json decoding, we specifically need inlining
+ // for bytes use-case of some other decReader methods:
+ // - jsonReadAsisChars, skipWhitespace (advance) and jsonReadNum
+ // - AND THEN readn3, readn4 (for ull, rue and alse).
+ // - (readn1 is only called when a char is escaped).
+ // - without inlining, we still pay the cost of a method invocationK, and this dominates time
+ // - To mitigate, we manually inline in hot zones
+ // *excluding places where used sparingly (e.g. nextValueBytes, and other atypical cases)*.
+ // - jsonReadAsisChars *only* called in: appendStringAsBytes
+ // - advance called: everywhere
+ // - jsonReadNum: decNumBytes, DecodeNaked
+ // - From running go test (our anecdotal findings):
+ // - calling jsonReadAsisChars in appendStringAsBytes: 23431
+ // - calling jsonReadNum in decNumBytes: 15251
+ // - calling jsonReadNum in DecodeNaked: 612
+ // Consequently, we manually inline jsonReadAsisChars (in appendStringAsBytes)
+ // and jsonReadNum (in decNumbytes)
+ jsonManualInlineDecRdInHotZones = true
+
jsonSpacesOrTabsLen = 128
- jsonAlwaysReturnInternString = false
+ // jsonAlwaysReturnInternString = false
)
var (
// jsonTabs and jsonSpaces are used as caches for indents
jsonTabs, jsonSpaces [jsonSpacesOrTabsLen]byte
- jsonCharHtmlSafeSet bitset256
- jsonCharSafeSet bitset256
- jsonCharWhitespaceSet bitset256
- jsonNumSet bitset256
+ jsonCharHtmlSafeSet bitset256
+ jsonCharSafeSet bitset256
)
func init() {
@@ -113,43 +143,54 @@ func init() {
jsonCharHtmlSafeSet.set(i)
}
}
- for i = 0; i <= utf8.RuneSelf; i++ {
- switch i {
- case ' ', '\t', '\r', '\n':
- jsonCharWhitespaceSet.set(i)
- case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'e', 'E', '.', '+', '-':
- jsonNumSet.set(i)
- }
- }
}
// ----------------
+type jsonEncState struct {
+ di int8 // indent per: if negative, use tabs
+ d bool // indenting?
+ dl uint16 // indent level
+}
+
+func (x jsonEncState) captureState() interface{} { return x }
+func (x *jsonEncState) restoreState(v interface{}) { *x = v.(jsonEncState) }
+
type jsonEncDriver struct {
noBuiltInTypes
h *JsonHandle
- se interfaceExtWrapper
+ // se interfaceExtWrapper
// ---- cpu cache line boundary?
- di int8 // indent per: if negative, use tabs
- d bool // indenting?
- dl uint16 // indent level
- ks bool // map key as string
- is byte // integer as string
+ jsonEncState
+
+ ks bool // map key as string
+ is byte // integer as string
typical bool
+ rawext bool // rawext configured on the handle
s *bitset256 // safe set for characters (taking h.HTMLAsIs into consideration)
- // scratch: encode time, numbers, etc. Note: leave 1 byte for containerState
- b [cacheLineSize + 24]byte // buffer for encoding numbers and time
+
+ // buf *[]byte // used mostly for encoding []byte
+
+ // scratch buffer for: encode time, numbers, etc
+ //
+ // RFC3339Nano uses 35 chars: 2006-01-02T15:04:05.999999999Z07:00
+ // MaxUint64 uses 20 chars: 18446744073709551615
+ // floats are encoded using: f/e fmt, and -1 precision, or 1 if no fractions.
+ // This means we are limited by the number of characters for the
+ // mantissa (up to 17), exponent (up to 3), signs (up to 3), dot (up to 1), E (up to 1)
+ // for a total of 24 characters.
+ // -xxx.yyyyyyyyyyyye-zzz
+ // Consequently, 35 characters should be sufficient for encoding time, integers or floats.
+ // We use up all the remaining bytes to make this use full cache lines.
+ b [56]byte
e Encoder
}
-// Keep writeIndent, WriteArrayElem, WriteMapElemKey, WriteMapElemValue
-// in jsonEncDriver, so that *Encoder can directly call them
-
func (e *jsonEncDriver) encoder() *Encoder { return &e.e }
func (e *jsonEncDriver) writeIndent() {
@@ -203,7 +244,7 @@ func (e *jsonEncDriver) EncodeNil() {
// ie if initial token is n.
// e.e.encWr.writeb(jsonLiteralNull)
- e.e.encWr.writen([rwNLen]byte{'n', 'u', 'l', 'l'}, 4)
+ e.e.encWr.writen4([4]byte{'n', 'u', 'l', 'l'})
}
func (e *jsonEncDriver) EncodeTime(t time.Time) {
@@ -214,16 +255,15 @@ func (e *jsonEncDriver) EncodeTime(t time.Time) {
e.EncodeNil()
} else {
e.b[0] = '"'
- b := fmtTime(t, e.b[1:1])
+ b := fmtTime(t, time.RFC3339Nano, e.b[1:1])
e.b[len(b)+1] = '"'
e.e.encWr.writeb(e.b[:len(b)+2])
}
}
-func (e *jsonEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext) {
+func (e *jsonEncDriver) EncodeExt(rv interface{}, basetype reflect.Type, xtag uint64, ext Ext) {
if ext == SelfExt {
- rv2 := baseRV(rv)
- e.e.encodeValue(rv2, e.h.fnNoExt(rv2.Type()))
+ e.e.encodeValue(baseRV(rv), e.h.fnNoExt(basetype))
} else if v := ext.ConvertExt(rv); v == nil {
e.EncodeNil()
} else {
@@ -247,15 +287,19 @@ func (e *jsonEncDriver) EncodeBool(b bool) {
if e.ks && e.e.c == containerMapKey {
if b {
- e.e.encWr.writen([rwNLen]byte{'"', 't', 'r', 'u', 'e', '"'}, 6)
+ e.e.encWr.writen4([4]byte{'"', 't', 'r', 'u'})
+ e.e.encWr.writen2('e', '"')
} else {
- e.e.encWr.writen([rwNLen]byte{'"', 'f', 'a', 'l', 's', 'e', '"'}, 7)
+ e.e.encWr.writen4([4]byte{'"', 'f', 'a', 'l'})
+ e.e.encWr.writen2('s', 'e')
+ e.e.encWr.writen1('"')
}
} else {
if b {
- e.e.encWr.writen([rwNLen]byte{'t', 'r', 'u', 'e'}, 4)
+ e.e.encWr.writen4([4]byte{'t', 'r', 'u', 'e'})
} else {
- e.e.encWr.writen([rwNLen]byte{'f', 'a', 'l', 's', 'e'}, 5)
+ e.e.encWr.writen4([4]byte{'f', 'a', 'l', 's'})
+ e.e.encWr.writen1('e')
}
}
}
@@ -274,36 +318,117 @@ func (e *jsonEncDriver) encodeFloat(f float64, bitsize, fmt byte, prec int8) {
}
func (e *jsonEncDriver) EncodeFloat64(f float64) {
+ if math.IsNaN(f) || math.IsInf(f, 0) {
+ e.EncodeNil()
+ return
+ }
fmt, prec := jsonFloatStrconvFmtPrec64(f)
e.encodeFloat(f, 64, fmt, prec)
}
func (e *jsonEncDriver) EncodeFloat32(f float32) {
+ if math.IsNaN(float64(f)) || math.IsInf(float64(f), 0) {
+ e.EncodeNil()
+ return
+ }
fmt, prec := jsonFloatStrconvFmtPrec32(f)
e.encodeFloat(float64(f), 32, fmt, prec)
}
+func (e *jsonEncDriver) encodeUint(neg bool, quotes bool, u uint64) {
+ // copied mostly from std library: strconv
+ // this should only be called on 64bit OS.
+
+ const smallsString = "00010203040506070809" +
+ "10111213141516171819" +
+ "20212223242526272829" +
+ "30313233343536373839" +
+ "40414243444546474849" +
+ "50515253545556575859" +
+ "60616263646566676869" +
+ "70717273747576777879" +
+ "80818283848586878889" +
+ "90919293949596979899"
+
+ // typically, 19 or 20 bytes sufficient for decimal encoding a uint64
+ // var a [24]byte
+ var a = e.b[0:24]
+ var i = uint8(len(a))
+
+ if quotes {
+ i--
+ a[i] = '"'
+ }
+ // u guaranteed to fit into a uint (as we are not 32bit OS)
+ var is uint
+ var us = uint(u)
+ for us >= 100 {
+ is = us % 100 * 2
+ us /= 100
+ i -= 2
+ a[i+1] = smallsString[is+1]
+ a[i+0] = smallsString[is+0]
+ }
+
+ // us < 100
+ is = us * 2
+ i--
+ a[i] = smallsString[is+1]
+ if us >= 10 {
+ i--
+ a[i] = smallsString[is]
+ }
+ if neg {
+ i--
+ a[i] = '-'
+ }
+ if quotes {
+ i--
+ a[i] = '"'
+ }
+ e.e.encWr.writeb(a[i:])
+}
+
func (e *jsonEncDriver) EncodeInt(v int64) {
- if e.is == 'A' || e.is == 'L' && (v > 1<<53 || v < -(1<<53)) ||
- (e.ks && e.e.c == containerMapKey) {
- blen := 2 + len(strconv.AppendInt(e.b[1:1], v, 10))
- e.b[0] = '"'
- e.b[blen-1] = '"'
- e.e.encWr.writeb(e.b[:blen])
+ quotes := e.is == 'A' || e.is == 'L' && (v > 1<<53 || v < -(1<<53)) ||
+ (e.ks && e.e.c == containerMapKey)
+
+ if cpu32Bit {
+ if quotes {
+ blen := 2 + len(strconv.AppendInt(e.b[1:1], v, 10))
+ e.b[0] = '"'
+ e.b[blen-1] = '"'
+ e.e.encWr.writeb(e.b[:blen])
+ } else {
+ e.e.encWr.writeb(strconv.AppendInt(e.b[:0], v, 10))
+ }
return
}
- e.e.encWr.writeb(strconv.AppendInt(e.b[:0], v, 10))
+
+ if v < 0 {
+ e.encodeUint(true, quotes, uint64(-v))
+ } else {
+ e.encodeUint(false, quotes, uint64(v))
+ }
}
func (e *jsonEncDriver) EncodeUint(v uint64) {
- if e.is == 'A' || e.is == 'L' && v > 1<<53 || (e.ks && e.e.c == containerMapKey) {
- blen := 2 + len(strconv.AppendUint(e.b[1:1], v, 10))
- e.b[0] = '"'
- e.b[blen-1] = '"'
- e.e.encWr.writeb(e.b[:blen])
+ quotes := e.is == 'A' || e.is == 'L' && v > 1<<53 || (e.ks && e.e.c == containerMapKey)
+
+ if cpu32Bit {
+ // use strconv directly, as optimized encodeUint only works on 64-bit alone
+ if quotes {
+ blen := 2 + len(strconv.AppendUint(e.b[1:1], v, 10))
+ e.b[0] = '"'
+ e.b[blen-1] = '"'
+ e.e.encWr.writeb(e.b[:blen])
+ } else {
+ e.e.encWr.writeb(strconv.AppendUint(e.b[:0], v, 10))
+ }
return
}
- e.e.encWr.writeb(strconv.AppendUint(e.b[:0], v, 10))
+
+ e.encodeUint(false, quotes, v)
}
func (e *jsonEncDriver) EncodeString(v string) {
@@ -320,25 +445,28 @@ func (e *jsonEncDriver) EncodeStringBytesRaw(v []byte) {
e.EncodeNil()
return
}
- if e.se.InterfaceExt != nil {
- e.EncodeExt(v, 0, &e.se)
+
+ if e.rawext {
+ iv := e.h.RawBytesExt.ConvertExt(v)
+ if iv == nil {
+ e.EncodeNil()
+ } else {
+ e.e.encode(iv)
+ }
return
}
slen := base64.StdEncoding.EncodedLen(len(v)) + 2
- var bs []byte
- if len(e.b) < slen {
- bs = e.e.blist.get(slen)
- } else {
- bs = e.b[:slen]
- }
+
+ // bs := e.e.blist.check(*e.buf, n)[:slen]
+ // *e.buf = bs
+
+ bs := e.e.blist.peek(slen, false)[:slen]
+
bs[0] = '"'
base64.StdEncoding.Encode(bs[1:], v)
bs[len(bs)-1] = '"'
e.e.encWr.writeb(bs)
- if len(e.b) < slen {
- e.e.blist.put(bs)
- }
}
// indent is done as below:
@@ -393,18 +521,18 @@ func (e *jsonEncDriver) quoteStr(s string) {
// if 0x20 <= b && b != '\\' && b != '"' && b != '<' && b != '>' && b != '&' {
// if (htmlasis && jsonCharSafeSet.isset(b)) || jsonCharHtmlSafeSet.isset(b) {
- b := s[i]
- if e.s.isset(b) {
+ if e.s.isset(s[i]) {
i++
continue
}
- if b < utf8.RuneSelf {
+ // b := s[i]
+ if s[i] < utf8.RuneSelf {
if start < i {
w.writestr(s[start:i])
}
- switch b {
+ switch s[i] {
case '\\', '"':
- w.writen2('\\', b)
+ w.writen2('\\', s[i])
case '\n':
w.writen2('\\', 'n')
case '\r':
@@ -417,27 +545,25 @@ func (e *jsonEncDriver) quoteStr(s string) {
w.writen2('\\', 't')
default:
w.writestr(`\u00`)
- w.writen2(hex[b>>4], hex[b&0xF])
+ w.writen2(hex[s[i]>>4], hex[s[i]&0xF])
}
i++
start = i
continue
}
c, size := utf8.DecodeRuneInString(s[i:])
- if c == utf8.RuneError {
- if size == 1 {
- if start < i {
- w.writestr(s[start:i])
- }
- w.writestr(`\ufffd`)
- i++
- start = i
+ if c == utf8.RuneError && size == 1 { // meaning invalid encoding (so output as-is)
+ if start < i {
+ w.writestr(s[start:i])
}
+ w.writestr(`\uFFFD`)
+ i++
+ start = i
continue
}
// U+2028 is LINE SEPARATOR. U+2029 is PARAGRAPH SEPARATOR.
- // Both technically valid JSON, but bomb on JSONP, so fix here unconditionally.
- if c == '\u2028' || c == '\u2029' {
+ // Both technically valid JSON, but bomb on JSONP, so fix here *unconditionally*.
+ if jsonEscapeMultiByteUnicodeSep && (c == '\u2028' || c == '\u2029') {
if start < i {
w.writestr(s[start:i])
}
@@ -457,75 +583,76 @@ func (e *jsonEncDriver) quoteStr(s string) {
func (e *jsonEncDriver) atEndOfEncode() {
if e.h.TermWhitespace {
- if e.e.c == 0 { // scalar written, output space
- e.e.encWr.writen1(' ')
- } else { // container written, output new-line
- e.e.encWr.writen1('\n')
+ var c byte = ' ' // default is that scalar is written, so output space
+ if e.e.c != 0 {
+ c = '\n' // for containers (map/list), output a newline
}
+ e.e.encWr.writen1(c)
}
}
// ----------
-type jsonDecDriver struct {
- noBuiltInTypes
- h *JsonHandle
+type jsonDecState struct {
+ rawext bool // rawext configured on the handle
tok uint8 // used to store the token read right after skipWhiteSpace
- fnil bool // found null
- _ [2]byte // padding
+ _ bool // found null
+ _ byte // padding
bstr [4]byte // scratch used for string \UXXX parsing
- buf []byte
- se interfaceExtWrapper
+ // scratch buffer used for base64 decoding (DecodeBytes in reuseBuf mode),
+ // or reading doubleQuoted string (DecodeStringAsBytes, DecodeNaked)
+ buf *[]byte
+}
- _ uint64 // padding
+func (x jsonDecState) captureState() interface{} { return x }
+func (x *jsonDecState) restoreState(v interface{}) { *x = v.(jsonDecState) }
+
+type jsonDecDriver struct {
+ noBuiltInTypes
+ decDriverNoopNumberHelper
+ h *JsonHandle
+
+ jsonDecState
+
+ // se interfaceExtWrapper
// ---- cpu cache line boundary?
d Decoder
}
-// func jsonIsWS(b byte) bool {
-// // return b == ' ' || b == '\t' || b == '\r' || b == '\n'
-// return jsonCharWhitespaceSet.isset(b)
-// }
+func (d *jsonDecDriver) descBd() (s string) { panic("descBd unsupported") }
func (d *jsonDecDriver) decoder() *Decoder {
return &d.d
}
-func (d *jsonDecDriver) uncacheRead() {
- if d.tok != 0 {
- d.d.decRd.unreadn1()
- d.tok = 0
- }
-}
-
func (d *jsonDecDriver) ReadMapStart() int {
d.advance()
if d.tok == 'n' {
- d.readLit4Null()
- return decContainerLenNil
+ d.readLit4Null(d.d.decRd.readn3())
+ return containerLenNil
}
if d.tok != '{' {
d.d.errorf("read map - expect char '%c' but got char '%c'", '{', d.tok)
}
d.tok = 0
- return decContainerLenUnknown
+ return containerLenUnknown
}
func (d *jsonDecDriver) ReadArrayStart() int {
d.advance()
if d.tok == 'n' {
- d.readLit4Null()
- return decContainerLenNil
+ d.readLit4Null(d.d.decRd.readn3())
+ return containerLenNil
}
if d.tok != '[' {
d.d.errorf("read array - expect char '%c' but got char '%c'", '[', d.tok)
}
d.tok = 0
- return decContainerLenUnknown
+ return containerLenUnknown
}
func (d *jsonDecDriver) CheckBreak() bool {
@@ -582,69 +709,127 @@ func (d *jsonDecDriver) ReadMapEnd() {
d.tok = 0
}
-// func (d *jsonDecDriver) readDelim(xc uint8) {
-// d.advance()
-// if d.tok != xc {
-// d.readDelimError(xc)
-// }
-// d.tok = 0
-// }
-
func (d *jsonDecDriver) readDelimError(xc uint8) {
d.d.errorf("read json delimiter - expect char '%c' but got char '%c'", xc, d.tok)
}
-func (d *jsonDecDriver) readLit4True() {
- bs := d.d.decRd.readn(3)
+// MARKER: readLit4XXX takes the readn(3|4) as a parameter so they can be inlined.
+// We pass the array directly to errorf, as passing slice pushes past inlining threshold,
+// and passing slice also might cause allocation of the bs array on the heap.
+
+func (d *jsonDecDriver) readLit4True(bs [4]byte) {
+ // bs := d.d.decRd.readn3()
d.tok = 0
- if jsonValidateSymbols && bs != [rwNLen]byte{'r', 'u', 'e'} { // !Equal jsonLiteral4True
- d.d.errorf("expecting %s: got %s", jsonLiteral4True, bs)
+ if jsonValidateSymbols && bs != [...]byte{0, 'r', 'u', 'e'} { // !Equal jsonLiteral4True
+ // d.d.errorf("expecting %s: got %s", jsonLiteral4True, bs[:])
+ d.d.errorf("expecting true: got t%s", bs)
}
}
-func (d *jsonDecDriver) readLit4False() {
- bs := d.d.decRd.readn(4)
+func (d *jsonDecDriver) readLit4False(bs [4]byte) {
+ // bs := d.d.decRd.readn4()
d.tok = 0
- if jsonValidateSymbols && bs != [rwNLen]byte{'a', 'l', 's', 'e'} { // !Equal jsonLiteral4False
- d.d.errorf("expecting %s: got %s", jsonLiteral4False, bs)
+ if jsonValidateSymbols && bs != [4]byte{'a', 'l', 's', 'e'} { // !Equal jsonLiteral4False
+ // d.d.errorf("expecting %s: got %s", jsonLiteral4False, bs)
+ d.d.errorf("expecting false: got f%s", bs)
}
}
-func (d *jsonDecDriver) readLit4Null() {
- bs := d.d.decRd.readn(3) // readx(3)
+func (d *jsonDecDriver) readLit4Null(bs [4]byte) {
+ // bs := d.d.decRd.readn3() // readx(3)
d.tok = 0
- if jsonValidateSymbols && bs != [rwNLen]byte{'u', 'l', 'l'} { // !Equal jsonLiteral4Null
- d.d.errorf("expecting %s: got %s", jsonLiteral4Null, bs)
+ if jsonValidateSymbols && bs != [...]byte{0, 'u', 'l', 'l'} { // !Equal jsonLiteral4Null
+ // d.d.errorf("expecting %s: got %s", jsonLiteral4Null, bs[:])
+ d.d.errorf("expecting null: got n%s", bs)
}
- d.fnil = true
}
func (d *jsonDecDriver) advance() {
if d.tok == 0 {
- d.fnil = false
- d.tok = d.d.decRd.skip(&jsonCharWhitespaceSet)
+ d.tok = d.d.decRd.skipWhitespace() // skip(&whitespaceCharBitset)
}
}
+func (d *jsonDecDriver) nextValueBytes(v []byte) []byte {
+ v, cursor := d.nextValueBytesR(v)
+ decNextValueBytesHelper{d: &d.d}.bytesRdV(&v, cursor)
+ return v
+}
+
+func (d *jsonDecDriver) nextValueBytesR(v0 []byte) (v []byte, cursor uint) {
+ v = v0
+ var h = decNextValueBytesHelper{d: &d.d}
+ dr := &d.d.decRd
+
+ consumeString := func() {
+ TOP:
+ bs := dr.jsonReadAsisChars()
+ h.appendN(&v, bs...)
+ if bs[len(bs)-1] != '"' {
+ // last char is '\', so consume next one and try again
+ h.append1(&v, dr.readn1())
+ goto TOP
+ }
+ }
+
+ d.advance() // ignore leading whitespace
+ cursor = d.d.rb.c - 1 // cursor starts just before non-whitespace token
+
+ switch d.tok {
+ default:
+ h.appendN(&v, dr.jsonReadNum()...)
+ case 'n':
+ d.readLit4Null(d.d.decRd.readn3())
+ h.appendN(&v, jsonLiteralNull...)
+ case 'f':
+ d.readLit4False(d.d.decRd.readn4())
+ h.appendN(&v, jsonLiteralFalse...)
+ case 't':
+ d.readLit4True(d.d.decRd.readn3())
+ h.appendN(&v, jsonLiteralTrue...)
+ case '"':
+ h.append1(&v, '"')
+ consumeString()
+ case '{', '[':
+ var elem struct{}
+ var stack []struct{}
+
+ stack = append(stack, elem)
+
+ h.append1(&v, d.tok)
+
+ for len(stack) != 0 {
+ c := dr.readn1()
+ h.append1(&v, c)
+ switch c {
+ case '"':
+ consumeString()
+ case '{', '[':
+ stack = append(stack, elem)
+ case '}', ']':
+ stack = stack[:len(stack)-1]
+ }
+ }
+ }
+ d.tok = 0
+ return
+}
+
func (d *jsonDecDriver) TryNil() bool {
d.advance()
// we shouldn't try to see if quoted "null" was here, right?
// only the plain string: `null` denotes a nil (ie not quotes)
if d.tok == 'n' {
- d.readLit4Null()
+ d.readLit4Null(d.d.decRd.readn3())
return true
}
return false
}
-func (d *jsonDecDriver) Nil() bool {
- return d.fnil
-}
-
func (d *jsonDecDriver) DecodeBool() (v bool) {
d.advance()
if d.tok == 'n' {
- d.readLit4Null()
+ d.readLit4Null(d.d.decRd.readn3())
return
}
fquot := d.d.c == containerMapKey && d.tok == '"'
@@ -653,10 +838,10 @@ func (d *jsonDecDriver) DecodeBool() (v bool) {
}
switch d.tok {
case 'f':
- d.readLit4False()
+ d.readLit4False(d.d.decRd.readn4())
// v = false
case 't':
- d.readLit4True()
+ d.readLit4True(d.d.decRd.readn3())
v = true
default:
d.d.errorf("decode bool: got first char %c", d.tok)
@@ -672,14 +857,13 @@ func (d *jsonDecDriver) DecodeTime() (t time.Time) {
// read string, and pass the string into json.unmarshal
d.advance()
if d.tok == 'n' {
- d.readLit4Null()
+ d.readLit4Null(d.d.decRd.readn3())
return
}
- bs := d.readString()
+ d.ensureReadingString()
+ bs := d.readUnescapedString()
t, err := time.Parse(time.RFC3339, stringView(bs))
- if err != nil {
- d.d.errorv(err)
- }
+ d.d.onerror(err)
return
}
@@ -697,7 +881,7 @@ func (d *jsonDecDriver) ContainerType() (vt valueType) {
} else if d.tok == '[' {
return valueTypeArray
} else if d.tok == 'n' {
- d.readLit4Null()
+ d.readLit4Null(d.d.decRd.readn3())
return valueTypeNil
} else if d.tok == '"' {
return valueTypeString
@@ -707,108 +891,83 @@ func (d *jsonDecDriver) ContainerType() (vt valueType) {
func (d *jsonDecDriver) decNumBytes() (bs []byte) {
d.advance()
+ dr := &d.d.decRd
if d.tok == '"' {
- bs = d.d.decRd.readUntil('"', false)
+ bs = dr.readUntil('"')
} else if d.tok == 'n' {
- d.readLit4Null()
+ d.readLit4Null(d.d.decRd.readn3())
} else {
- d.d.decRd.unreadn1()
- bs = d.d.decRd.readTo(&jsonNumSet)
+ if jsonManualInlineDecRdInHotZones {
+ if dr.bytes {
+ bs = dr.rb.jsonReadNum()
+ } else if dr.bufio {
+ bs = dr.bi.jsonReadNum()
+ } else {
+ bs = dr.ri.jsonReadNum()
+ }
+ } else {
+ bs = dr.jsonReadNum()
+ }
}
d.tok = 0
return
}
func (d *jsonDecDriver) DecodeUint64() (u uint64) {
- bs := d.decNumBytes()
- if len(bs) == 0 {
- return
- }
- n, neg, badsyntax, overflow := jsonParseInteger(bs)
- if overflow {
- d.d.errorf("overflow parsing unsigned integer: %s", bs)
- } else if neg {
- d.d.errorf("minus found parsing unsigned integer: %s", bs)
- } else if badsyntax {
- // fallback: try to decode as float, and cast
- n = d.decUint64ViaFloat(bs)
- }
- return n
-}
-
-func (d *jsonDecDriver) DecodeInt64() (i int64) {
- const cutoff = uint64(1 << uint(64-1))
- bs := d.decNumBytes()
- if len(bs) == 0 {
- return
- }
- n, neg, badsyntax, overflow := jsonParseInteger(bs)
- if overflow {
- d.d.errorf("overflow parsing integer: %s", bs)
- } else if badsyntax {
- // d.d.errorf("invalid syntax for integer: %s", bs)
- // fallback: try to decode as float, and cast
- if neg {
- n = d.decUint64ViaFloat(bs[1:])
- } else {
- n = d.decUint64ViaFloat(bs)
- }
- }
+ b := d.decNumBytes()
+ u, neg, ok := parseInteger_bytes(b)
if neg {
- if n > cutoff {
- d.d.errorf("overflow parsing integer: %s", bs)
- }
- i = -(int64(n))
- } else {
- if n >= cutoff {
- d.d.errorf("overflow parsing integer: %s", bs)
- }
- i = int64(n)
+ d.d.errorf("negative number cannot be decoded as uint64")
+ }
+ if !ok {
+ d.d.onerror(strconvParseErr(b, "ParseUint"))
}
return
}
-func (d *jsonDecDriver) decUint64ViaFloat(s []byte) (u uint64) {
- if len(s) == 0 {
- return
+func (d *jsonDecDriver) DecodeInt64() (v int64) {
+ b := d.decNumBytes()
+ u, neg, ok := parseInteger_bytes(b)
+ if !ok {
+ d.d.onerror(strconvParseErr(b, "ParseInt"))
}
- f, err := parseFloat64(s)
- if err != nil {
- d.d.errorf("invalid syntax for integer: %s", s)
+ if chkOvf.Uint2Int(u, neg) {
+ d.d.errorf("overflow decoding number from %s", b)
}
- fi, ff := math.Modf(f)
- if ff > 0 {
- d.d.errorf("fractional part found parsing integer: %s", s)
- } else if fi > float64(math.MaxUint64) {
- d.d.errorf("overflow parsing integer: %s", s)
+ if neg {
+ v = -int64(u)
+ } else {
+ v = int64(u)
}
- return uint64(fi)
+ return
}
func (d *jsonDecDriver) DecodeFloat64() (f float64) {
var err error
- if bs := d.decNumBytes(); len(bs) > 0 {
- if f, err = parseFloat64(bs); err != nil {
- d.d.errorv(err)
- }
+ bs := d.decNumBytes()
+ if len(bs) == 0 {
+ return
}
+ f, err = parseFloat64(bs)
+ d.d.onerror(err)
return
}
func (d *jsonDecDriver) DecodeFloat32() (f float32) {
var err error
- if bs := d.decNumBytes(); len(bs) > 0 {
- if f, err = parseFloat32(bs); err != nil {
- d.d.errorv(err)
- }
+ bs := d.decNumBytes()
+ if len(bs) == 0 {
+ return
}
+ f, err = parseFloat32(bs)
+ d.d.onerror(err)
return
}
-func (d *jsonDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) {
+func (d *jsonDecDriver) DecodeExt(rv interface{}, basetype reflect.Type, xtag uint64, ext Ext) {
d.advance()
if d.tok == 'n' {
- d.readLit4Null()
+ d.readLit4Null(d.d.decRd.readn3())
return
}
if ext == nil {
@@ -816,8 +975,7 @@ func (d *jsonDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) {
re.Tag = xtag
d.d.decode(&re.Value)
} else if ext == SelfExt {
- rv2 := baseRV(rv)
- d.d.decodeValue(rv2, d.h.fnNoExt(rv2.Type()))
+ d.d.decodeValue(baseRV(rv), d.h.fnNoExt(basetype))
} else {
d.d.interfaceExtConvertAndDecode(rv, ext)
}
@@ -831,31 +989,37 @@ func (d *jsonDecDriver) decBytesFromArray(bs []byte) []byte {
}
d.tok = 0
bs = append(bs, uint8(d.DecodeUint64()))
- d.tok = d.d.decRd.skip(&jsonCharWhitespaceSet)
+ d.tok = d.d.decRd.skipWhitespace() // skip(&whitespaceCharBitset)
for d.tok != ']' {
if d.tok != ',' {
d.d.errorf("read array element - expect char '%c' but got char '%c'", ',', d.tok)
}
d.tok = 0
bs = append(bs, uint8(chkOvf.UintV(d.DecodeUint64(), 8)))
- d.tok = d.d.decRd.skip(&jsonCharWhitespaceSet)
+ d.tok = d.d.decRd.skipWhitespace() // skip(&whitespaceCharBitset)
}
d.tok = 0
return bs
}
-func (d *jsonDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) {
+func (d *jsonDecDriver) DecodeBytes(bs []byte) (bsOut []byte) {
+ d.d.decByteState = decByteStateNone
+ d.advance()
+ if d.tok == 'n' {
+ d.readLit4Null(d.d.decRd.readn3())
+ return nil
+ }
// if decoding into raw bytes, and the RawBytesExt is configured, use it to decode.
- if d.se.InterfaceExt != nil {
+ if d.rawext {
bsOut = bs
- d.DecodeExt(&bsOut, 0, &d.se)
+ d.d.interfaceExtConvertAndDecode(&bsOut, d.h.RawBytesExt)
return
}
- d.advance()
// check if an "array" of uint8's (see ContainerType for how to infer if an array)
if d.tok == '[' {
// bsOut, _ = fastpathTV.DecSliceUint8V(bs, true, d.d)
- if zerocopy && len(bs) == 0 {
+ if bs == nil {
+ d.d.decByteState = decByteStateReuseBuf
bs = d.d.b[:]
}
return d.decBytesFromArray(bs)
@@ -863,30 +1027,24 @@ func (d *jsonDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) {
// base64 encodes []byte{} as "", and we encode nil []byte as null.
// Consequently, base64 should decode null as a nil []byte, and "" as an empty []byte{}.
- // appendStringAsBytes returns a zero-len slice for both, so as not to reset d.buf.
- // However, it sets a fnil field to true, so we can check if a null was found.
- if d.tok == 'n' {
- d.readLit4Null()
- return nil
- }
-
- bs1 := d.readString()
+ d.ensureReadingString()
+ bs1 := d.readUnescapedString()
slen := base64.StdEncoding.DecodedLen(len(bs1))
if slen == 0 {
bsOut = []byte{}
} else if slen <= cap(bs) {
bsOut = bs[:slen]
- } else if zerocopy {
- d.buf = d.d.blist.check(d.buf, slen)
- bsOut = d.buf
+ } else if bs == nil {
+ d.d.decByteState = decByteStateReuseBuf
+ bsOut = d.d.blist.check(*d.buf, slen)[:slen]
+ *d.buf = bsOut
} else {
bsOut = make([]byte, slen)
}
slen2, err := base64.StdEncoding.Decode(bsOut, bs1)
if err != nil {
d.d.errorf("error decoding base64 binary '%s': %v", bs1, err)
- return nil
}
if slen != slen2 {
bsOut = bsOut[:slen2]
@@ -895,129 +1053,141 @@ func (d *jsonDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) {
}
func (d *jsonDecDriver) DecodeStringAsBytes() (s []byte) {
+ d.d.decByteState = decByteStateNone
d.advance()
- if d.tok != '"' {
- // d.d.errorf("expect char '%c' but got char '%c'", '"', d.tok)
- // handle non-string scalar: null, true, false or a number
- switch d.tok {
- case 'n':
- d.readLit4Null()
- return []byte{}
- case 'f':
- d.readLit4False()
- return jsonLiteralFalse
- case 't':
- d.readLit4True()
- return jsonLiteralTrue
- }
- // try to parse a valid number
- return d.decNumBytes()
+
+ // common case
+ if d.tok == '"' {
+ return d.dblQuoteStringAsBytes()
}
- s = d.appendStringAsBytes()
- if d.fnil {
- return nil
+
+ // handle non-string scalar: null, true, false or a number
+ switch d.tok {
+ case 'n':
+ d.readLit4Null(d.d.decRd.readn3())
+ return nil // []byte{}
+ case 'f':
+ d.readLit4False(d.d.decRd.readn4())
+ return jsonLiteralFalse
+ case 't':
+ d.readLit4True(d.d.decRd.readn3())
+ return jsonLiteralTrue
}
- return
+
+ // try to parse a valid number
+ d.tok = 0
+ return d.d.decRd.jsonReadNum()
}
-func (d *jsonDecDriver) readString() (bs []byte) {
+func (d *jsonDecDriver) ensureReadingString() {
if d.tok != '"' {
d.d.errorf("expecting string starting with '\"'; got '%c'", d.tok)
- return
}
+}
- bs = d.d.decRd.readUntil('"', false)
+func (d *jsonDecDriver) readUnescapedString() (bs []byte) {
+ // d.ensureReadingString()
+ bs = d.d.decRd.readUntil('"')
d.tok = 0
return
}
-func (d *jsonDecDriver) appendStringAsBytes() (bs []byte) {
- if d.buf != nil {
- d.buf = d.buf[:0]
- }
+func (d *jsonDecDriver) dblQuoteStringAsBytes() (buf []byte) {
+ d.d.decByteState = decByteStateNone
+ // use a local buf variable, so we don't do pointer chasing within loop
+ buf = (*d.buf)[:0]
+ dr := &d.d.decRd
d.tok = 0
- // append on each byte seen can be expensive, so we just
- // keep track of where we last read a contiguous set of
- // non-special bytes (using cursor variable),
- // and when we see a special byte
- // e.g. end-of-slice, " or \,
- // we will append the full range into the v slice before proceeding
+ var bs []byte
+ var c byte
+ var firstTime bool = true
- var cs = d.d.decRd.readUntil('"', true)
- var c uint8
- var i, cursor uint
for {
- if i >= uint(len(cs)) {
- d.buf = append(d.buf, cs[cursor:]...)
- cs = d.d.decRd.readUntil('"', true)
- i, cursor = 0, 0
- continue // this continue helps elide the cs[i] below
+ if firstTime {
+ firstTime = false
+ if dr.bytes {
+ bs = dr.rb.jsonReadAsisChars()
+ if bs[len(bs)-1] == '"' {
+ d.d.decByteState = decByteStateZerocopy
+ return bs[:len(bs)-1]
+ }
+ goto APPEND
+ }
}
- c = cs[i]
+
+ if jsonManualInlineDecRdInHotZones {
+ if dr.bytes {
+ bs = dr.rb.jsonReadAsisChars()
+ } else if dr.bufio {
+ bs = dr.bi.jsonReadAsisChars()
+ } else {
+ bs = dr.ri.jsonReadAsisChars()
+ }
+ } else {
+ bs = dr.jsonReadAsisChars()
+ }
+
+ APPEND:
+ buf = append(buf, bs[:len(bs)-1]...)
+ c = bs[len(bs)-1]
+
if c == '"' {
break
}
- if c != '\\' {
- i++
- continue
- }
- d.buf = append(d.buf, cs[cursor:i]...)
- i++
- if i >= uint(len(cs)) {
- d.d.errorf("need at least 1 more bytes for \\ escape sequence")
- return // bounds-check elimination
- }
- c = cs[i]
+ // c is now '\'
+ c = dr.readn1()
+
switch c {
case '"', '\\', '/', '\'':
- d.buf = append(d.buf, c)
+ buf = append(buf, c)
case 'b':
- d.buf = append(d.buf, '\b')
+ buf = append(buf, '\b')
case 'f':
- d.buf = append(d.buf, '\f')
+ buf = append(buf, '\f')
case 'n':
- d.buf = append(d.buf, '\n')
+ buf = append(buf, '\n')
case 'r':
- d.buf = append(d.buf, '\r')
+ buf = append(buf, '\r')
case 't':
- d.buf = append(d.buf, '\t')
+ buf = append(buf, '\t')
case 'u':
- i = d.appendStringAsBytesSlashU(cs, i)
+ buf = append(buf, d.bstr[:utf8.EncodeRune(d.bstr[:], d.appendStringAsBytesSlashU())]...)
default:
+ *d.buf = buf
d.d.errorf("unsupported escaped value: %c", c)
}
- i++
- cursor = i
}
- if len(cs) > 0 {
- if len(d.buf) > 0 && cursor < uint(len(cs)) {
- d.buf = append(d.buf, cs[cursor:i]...)
- } else {
- // if bytes, just return the cs got from readUntil.
- // do not do it for io, especially bufio, as the buffer is needed for other things
- cs = cs[:i]
- if d.d.bytes {
- return cs
- }
- d.buf = d.d.blist.check(d.buf, len(cs))
- copy(d.buf, cs)
- }
- }
- return d.buf
+ *d.buf = buf
+ d.d.decByteState = decByteStateReuseBuf
+ return
}
-func (d *jsonDecDriver) appendStringAsBytesSlashU(cs []byte, i uint) uint {
- var r rune
+func (d *jsonDecDriver) appendStringAsBytesSlashU() (r rune) {
var rr uint32
- var j uint
- var c byte
- if uint(len(cs)) < i+4 {
- d.d.errorf("need at least 4 more bytes for unicode sequence")
- return 0 // bounds-check elimination
+ var csu [2]byte
+ var cs [4]byte = d.d.decRd.readn4()
+ if rr = jsonSlashURune(cs); rr == unicode.ReplacementChar {
+ return unicode.ReplacementChar
}
- for _, c = range cs[i+1 : i+5] { // bounds-check-elimination
+ r = rune(rr)
+ if utf16.IsSurrogate(r) {
+ csu = d.d.decRd.readn2()
+ cs = d.d.decRd.readn4()
+ if csu[0] == '\\' && csu[1] == 'u' {
+ if rr = jsonSlashURune(cs); rr == unicode.ReplacementChar {
+ return unicode.ReplacementChar
+ }
+ return utf16.DecodeRune(r, rune(rr))
+ }
+ return unicode.ReplacementChar
+ }
+ return
+}
+
+func jsonSlashURune(cs [4]byte) (rr uint32) {
+ for _, c := range cs {
// best to use explicit if-else
// - not a table, etc which involve memory loads, array lookup with bounds checks, etc
if c >= '0' && c <= '9' {
@@ -1027,102 +1197,21 @@ func (d *jsonDecDriver) appendStringAsBytesSlashU(cs []byte, i uint) uint {
} else if c >= 'A' && c <= 'F' {
rr = rr*16 + uint32(c-jsonU4Chk0)
} else {
- r = unicode.ReplacementChar
- i += 4
- goto encode_rune
+ return unicode.ReplacementChar
}
}
- r = rune(rr)
- i += 4
- if utf16.IsSurrogate(r) {
- if len(cs) >= int(i+6) {
- var cx = cs[i+1:][:6:6] // [:6] affords bounds-check-elimination
- //var cx [6]byte
- //copy(cx[:], cs[i+1:])
- if cx[0] == '\\' && cx[1] == 'u' {
- i += 2
- var rr1 uint32
- for j = 2; j < 6; j++ {
- c = cx[j]
- if c >= '0' && c <= '9' {
- rr = rr*16 + uint32(c-jsonU4Chk2)
- } else if c >= 'a' && c <= 'f' {
- rr = rr*16 + uint32(c-jsonU4Chk1)
- } else if c >= 'A' && c <= 'F' {
- rr = rr*16 + uint32(c-jsonU4Chk0)
- } else {
- r = unicode.ReplacementChar
- i += 4
- goto encode_rune
- }
- }
- r = utf16.DecodeRune(r, rune(rr1))
- i += 4
- goto encode_rune
- }
- }
- r = unicode.ReplacementChar
- }
-encode_rune:
- w2 := utf8.EncodeRune(d.bstr[:], r)
- d.buf = append(d.buf, d.bstr[:w2]...)
- return i
+ return
}
-func (d *jsonDecDriver) nakedNum(z *decNaked, bs []byte) (err error) {
- const cutoff = uint64(1 << uint(64-1))
-
- var n uint64
- var neg, badsyntax, overflow bool
-
- if len(bs) == 0 {
- if d.h.PreferFloat {
- z.v = valueTypeFloat
- z.f = 0
- } else if d.h.SignedInteger {
- z.v = valueTypeInt
- z.i = 0
- } else {
- z.v = valueTypeUint
- z.u = 0
- }
- return
- }
+func (d *jsonDecDriver) nakedNum(z *fauxUnion, bs []byte) (err error) {
+ // Note: nakedNum is NEVER called with a zero-length []byte
if d.h.PreferFloat {
- goto F
- }
- n, neg, badsyntax, overflow = jsonParseInteger(bs)
- if badsyntax || overflow {
- goto F
- }
- if neg {
- if n > cutoff {
- goto F
- }
- z.v = valueTypeInt
- z.i = -(int64(n))
- } else if d.h.SignedInteger {
- if n >= cutoff {
- goto F
- }
- z.v = valueTypeInt
- z.i = int64(n)
+ z.v = valueTypeFloat
+ z.f, err = parseFloat64(bs)
} else {
- z.v = valueTypeUint
- z.u = n
+ err = parseNumber(bs, z, d.h.SignedInteger)
}
return
-F:
- z.v = valueTypeFloat
- z.f, err = parseFloat64(bs)
- return
-}
-
-func (d *jsonDecDriver) sliceToString(bs []byte) string {
- if d.d.is != nil && (jsonAlwaysReturnInternString || d.d.c == containerMapKey) {
- return d.d.string(bs)
- }
- return string(bs)
}
func (d *jsonDecDriver) DecodeNaked() {
@@ -1132,14 +1221,14 @@ func (d *jsonDecDriver) DecodeNaked() {
var bs []byte
switch d.tok {
case 'n':
- d.readLit4Null()
+ d.readLit4Null(d.d.decRd.readn3())
z.v = valueTypeNil
case 'f':
- d.readLit4False()
+ d.readLit4False(d.d.decRd.readn4())
z.v = valueTypeBool
z.b = false
case 't':
- d.readLit4True()
+ d.readLit4True(d.d.decRd.readn3())
z.v = valueTypeBool
z.b = true
case '{':
@@ -1148,7 +1237,7 @@ func (d *jsonDecDriver) DecodeNaked() {
z.v = valueTypeArray // don't consume. kInterfaceNaked will call ReadArrayStart
case '"':
// if a string, and MapKeyAsString, then try to decode it as a nil, bool or number first
- bs = d.appendStringAsBytes()
+ bs = d.dblQuoteStringAsBytes()
if len(bs) > 0 && d.d.c == containerMapKey && d.h.MapKeyAsString {
if bytes.Equal(bs, jsonLiteralNull) {
z.v = valueTypeNil
@@ -1162,22 +1251,21 @@ func (d *jsonDecDriver) DecodeNaked() {
// check if a number: float, int or uint
if err := d.nakedNum(z, bs); err != nil {
z.v = valueTypeString
- z.s = d.sliceToString(bs)
+ z.s = d.d.stringZC(bs)
}
}
} else {
z.v = valueTypeString
- z.s = d.sliceToString(bs)
+ z.s = d.d.stringZC(bs)
}
default: // number
- bs = d.decNumBytes()
+ bs = d.d.decRd.jsonReadNum()
+ d.tok = 0
if len(bs) == 0 {
d.d.errorf("decode number from empty string")
- return
}
if err := d.nakedNum(z, bs); err != nil {
d.d.errorf("decode number from %s: %v", bs, err)
- return
}
}
}
@@ -1205,6 +1293,10 @@ func (d *jsonDecDriver) DecodeNaked() {
//
// Note that, when decoding quoted strings, invalid UTF-8 or invalid UTF-16 surrogate pairs are
// not treated as an error. Instead, they are replaced by the Unicode replacement character U+FFFD.
+//
+// Note also that the float values for NaN, +Inf or -Inf are encoded as null,
+// as suggested by NOTE 4 of the ECMA-262 ECMAScript Language Specification 5.1 edition.
+// see http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf .
type JsonHandle struct {
textEncodingType
BasicHandle
@@ -1253,26 +1345,30 @@ type JsonHandle struct {
// _ uint64 // padding (cache line)
- // Note: below, we store hardly-used items
- // e.g. RawBytesExt (which is already cached in the (en|de)cDriver).
+ // Note: below, we store hardly-used items e.g. RawBytesExt.
+ // These values below may straddle a cache line, but they are hardly-used,
+ // so shouldn't contribute to false-sharing except in rare cases.
// RawBytesExt, if configured, is used to encode and decode raw bytes in a custom way.
// If not configured, raw bytes are encoded to/from base64 text.
RawBytesExt InterfaceExt
-
- _ [5]uint64 // padding (cache line)
}
+func (h *JsonHandle) isJson() bool { return true }
+
// Name returns the name of the handle: json
func (h *JsonHandle) Name() string { return "json" }
-// func (h *JsonHandle) hasElemSeparators() bool { return true }
+func (h *JsonHandle) desc(bd byte) string { return string(bd) }
+
func (h *JsonHandle) typical() bool {
return h.Indent == 0 && !h.MapKeyAsString && h.IntegerAsString != 'A' && h.IntegerAsString != 'L'
}
func (h *JsonHandle) newEncDriver() encDriver {
var e = &jsonEncDriver{h: h}
+ // var x []byte
+ // e.buf = &x
e.e.e = e
e.e.js = true
e.e.init(h)
@@ -1282,6 +1378,8 @@ func (h *JsonHandle) newEncDriver() encDriver {
func (h *JsonHandle) newDecDriver() decDriver {
var d = &jsonDecDriver{h: h}
+ var x []byte
+ d.buf = &x
d.d.d = d
d.d.js = true
d.d.jsms = h.MapKeyAsString
@@ -1290,63 +1388,47 @@ func (h *JsonHandle) newDecDriver() decDriver {
return d
}
+func (e *jsonEncDriver) resetState() {
+ e.dl = 0
+}
+
func (e *jsonEncDriver) reset() {
+ e.resetState()
// (htmlasis && jsonCharSafeSet.isset(b)) || jsonCharHtmlSafeSet.isset(b)
+ // cache values from the handle
e.typical = e.h.typical()
if e.h.HTMLCharsAsIs {
e.s = &jsonCharSafeSet
} else {
e.s = &jsonCharHtmlSafeSet
}
- e.se.InterfaceExt = e.h.RawBytesExt
- e.d, e.dl, e.di = false, 0, 0
- if e.h.Indent != 0 {
- e.d = true
- e.di = int8(e.h.Indent)
- }
+ e.rawext = e.h.RawBytesExt != nil
+ e.di = int8(e.h.Indent)
+ e.d = e.h.Indent != 0
e.ks = e.h.MapKeyAsString
e.is = e.h.IntegerAsString
}
-func (d *jsonDecDriver) reset() {
- d.se.InterfaceExt = d.h.RawBytesExt
- d.buf = d.d.blist.check(d.buf, 256)[:0]
+func (d *jsonDecDriver) resetState() {
+ *d.buf = d.d.blist.check(*d.buf, 256)
d.tok = 0
- d.fnil = false
}
-func (d *jsonDecDriver) atEndOfDecode() {}
-
-// jsonFloatStrconvFmtPrec ...
-//
-// ensure that every float has an 'e' or '.' in it,/ for easy differentiation from integers.
-// this is better/faster than checking if encoded value has [e.] and appending if needed.
-
-// func jsonFloatStrconvFmtPrec(f float64, bits32 bool) (fmt byte, prec int) {
-// fmt = 'f'
-// prec = -1
-// var abs = math.Abs(f)
-// if abs == 0 || abs == 1 {
-// prec = 1
-// } else if !bits32 && (abs < 1e-6 || abs >= 1e21) ||
-// bits32 && (float32(abs) < 1e-6 || float32(abs) >= 1e21) {
-// fmt = 'e'
-// } else if _, frac := math.Modf(abs); frac == 0 {
-// // ensure that floats have a .0 at the end, for easy identification as floats
-// prec = 1
-// }
-// return
-// }
+func (d *jsonDecDriver) reset() {
+ d.resetState()
+ d.rawext = d.h.RawBytesExt != nil
+}
func jsonFloatStrconvFmtPrec64(f float64) (fmt byte, prec int8) {
fmt = 'f'
prec = -1
- var abs = math.Abs(f)
+ fbits := math.Float64bits(f)
+ abs := math.Float64frombits(fbits &^ (1 << 63))
if abs == 0 || abs == 1 {
prec = 1
} else if abs < 1e-6 || abs >= 1e21 {
fmt = 'e'
- } else if noFrac64(abs) { // _, frac := math.Modf(abs); frac == 0 {
+ } else if noFrac64(fbits) {
prec = 1
}
return
@@ -1355,139 +1437,21 @@ func jsonFloatStrconvFmtPrec64(f float64) (fmt byte, prec int8) {
func jsonFloatStrconvFmtPrec32(f float32) (fmt byte, prec int8) {
fmt = 'f'
prec = -1
- var abs = abs32(f)
+ // directly handle Modf (to get fractions) and Abs (to get absolute)
+ fbits := math.Float32bits(f)
+ abs := math.Float32frombits(fbits &^ (1 << 31))
if abs == 0 || abs == 1 {
prec = 1
} else if abs < 1e-6 || abs >= 1e21 {
fmt = 'e'
- } else if noFrac32(abs) { // _, frac := math.Modf(abs); frac == 0 {
+ } else if noFrac32(fbits) {
prec = 1
}
return
}
-// custom-fitted version of strconv.Parse(Ui|I)nt.
-// Also ensures we don't have to search for .eE to determine if a float or not.
-// Note: s CANNOT be a zero-length slice.
-func jsonParseInteger(s []byte) (n uint64, neg, badSyntax, overflow bool) {
- const maxUint64 = (1<<64 - 1)
- const cutoff = maxUint64/10 + 1
-
- if len(s) == 0 { // bounds-check-elimination
- // treat empty string as zero value
- // badSyntax = true
- return
- }
- switch s[0] {
- case '+':
- s = s[1:]
- case '-':
- s = s[1:]
- neg = true
- }
- for _, c := range s {
- if c < '0' || c > '9' {
- badSyntax = true
- return
- }
- // unsigned integers don't overflow well on multiplication, so check cutoff here
- // e.g. (maxUint64-5)*10 doesn't overflow well ...
- if n >= cutoff {
- overflow = true
- return
- }
- n *= 10
- n1 := n + uint64(c-'0')
- if n1 < n || n1 > maxUint64 {
- overflow = true
- return
- }
- n = n1
- }
- return
-}
-
var _ decDriverContainerTracker = (*jsonDecDriver)(nil)
var _ encDriverContainerTracker = (*jsonEncDriver)(nil)
var _ decDriver = (*jsonDecDriver)(nil)
var _ encDriver = (*jsonEncDriver)(nil)
-
-// ----------------
-
-/*
-type jsonEncDriverTypical jsonEncDriver
-
-func (e *jsonEncDriverTypical) WriteArrayStart(length int) {
- e.e.encWr.writen1('[')
-}
-
-func (e *jsonEncDriverTypical) WriteArrayElem() {
- if e.e.c != containerArrayStart {
- e.e.encWr.writen1(',')
- }
-}
-
-func (e *jsonEncDriverTypical) WriteArrayEnd() {
- e.e.encWr.writen1(']')
-}
-
-func (e *jsonEncDriverTypical) WriteMapStart(length int) {
- e.e.encWr.writen1('{')
-}
-
-func (e *jsonEncDriverTypical) WriteMapElemKey() {
- if e.e.c != containerMapStart {
- e.e.encWr.writen1(',')
- }
-}
-
-func (e *jsonEncDriverTypical) WriteMapElemValue() {
- e.e.encWr.writen1(':')
-}
-
-func (e *jsonEncDriverTypical) WriteMapEnd() {
- e.e.encWr.writen1('}')
-}
-
-func (e *jsonEncDriverTypical) EncodeBool(b bool) {
- if b {
- // e.e.encWr.writeb(jsonLiteralTrue)
- e.e.encWr.writen([rwNLen]byte{'t', 'r', 'u', 'e'}, 4)
- } else {
- // e.e.encWr.writeb(jsonLiteralFalse)
- e.e.encWr.writen([rwNLen]byte{'f', 'a', 'l', 's', 'e'}, 5)
- }
-}
-
-func (e *jsonEncDriverTypical) EncodeInt(v int64) {
- e.e.encWr.writeb(strconv.AppendInt(e.b[:0], v, 10))
-}
-
-func (e *jsonEncDriverTypical) EncodeUint(v uint64) {
- e.e.encWr.writeb(strconv.AppendUint(e.b[:0], v, 10))
-}
-
-func (e *jsonEncDriverTypical) EncodeFloat64(f float64) {
- fmt, prec := jsonFloatStrconvFmtPrec64(f)
- e.e.encWr.writeb(strconv.AppendFloat(e.b[:0], f, fmt, int(prec), 64))
- // e.e.encWr.writeb(strconv.AppendFloat(e.b[:0], f, jsonFloatStrconvFmtPrec64(f), 64))
-}
-
-func (e *jsonEncDriverTypical) EncodeFloat32(f float32) {
- fmt, prec := jsonFloatStrconvFmtPrec32(f)
- e.e.encWr.writeb(strconv.AppendFloat(e.b[:0], float64(f), fmt, int(prec), 32))
-}
-
-// func (e *jsonEncDriverTypical) encodeFloat(f float64, bitsize uint8) {
-// fmt, prec := jsonFloatStrconvFmtPrec(f, bitsize == 32)
-// e.e.encWr.writeb(strconv.AppendFloat(e.b[:0], f, fmt, prec, int(bitsize)))
-// }
-
-// func (e *jsonEncDriverTypical) atEndOfEncode() {
-// if e.tw {
-// e.e.encWr.writen1(' ')
-// }
-// }
-
-*/
diff --git a/vendor/github.com/ugorji/go/codec/mammoth-test.go.tmpl b/vendor/github.com/ugorji/go/codec/mammoth-test.go.tmpl
index ba55b396f..53198064d 100644
--- a/vendor/github.com/ugorji/go/codec/mammoth-test.go.tmpl
+++ b/vendor/github.com/ugorji/go/codec/mammoth-test.go.tmpl
@@ -1,12 +1,16 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
+//go:build !codec.notmammoth
+// +build codec.notmammoth
+
// Code generated from mammoth-test.go.tmpl - DO NOT EDIT.
package codec
import "testing"
import "fmt"
+import "reflect"
// TestMammoth has all the different paths optimized in fast-path
// It has all the primitives, slices and maps.
@@ -25,6 +29,7 @@ type TestMammoth struct {
{{range .Values }}{{if not .Primitive }}{{if not .MapKey -}}
{{ .MethodNamePfx "F" false }} []{{ .Elem }}
{{ .MethodNamePfx "Fptr" false }} *[]{{ .Elem }}
+{{ .MethodNamePfx "Farr4" false }} [4]{{ .Elem }}
{{end}}{{end}}{{end}}
{{range .Values }}{{if not .Primitive }}{{if .MapKey -}}
@@ -43,7 +48,7 @@ func (_ {{ .MethodNamePfx "typMbs" false }}) MapBySlice() { }
type {{ .MethodNamePfx "typMap" false }} map[{{ .MapKey }}]{{ .Elem }}
{{end}}{{end}}{{end}}
-func doTestMammothSlices(t *testing.T, h Handle) {
+func __doTestMammothSlices(t *testing.T, h Handle) {
{{range $i, $e := .Values }}{{if not .Primitive }}{{if not .MapKey -}}
var v{{$i}}va [8]{{ .Elem }}
for _, v := range [][]{{ .Elem }}{ nil, {}, { {{ nonzerocmd .Elem }}, {{ zerocmd .Elem }}, {{ zerocmd .Elem }}, {{ nonzerocmd .Elem }} } } {
@@ -65,20 +70,34 @@ func doTestMammothSlices(t *testing.T, h Handle) {
var bs{{$i}} []byte
v{{$i}}v1 = v
bs{{$i}} = testMarshalErr(v{{$i}}v1, h, t, "enc-slice-v{{$i}}")
- if v != nil {
- if v == nil { v{{$i}}v2 = nil } else { v{{$i}}v2 = make([]{{ .Elem }}, len(v)) }
+ if v == nil {
+ v{{$i}}v2 = make([]{{ .Elem }}, 2)
+ testUnmarshalErr(v{{$i}}v2, bs{{$i}}, h, t, "dec-slice-v{{$i}}")
+ testDeepEqualErr(v{{$i}}v2[0], v{{$i}}v2[1], t, "equal-slice-v{{$i}}") // should not change
+ testDeepEqualErr(len(v{{$i}}v2), 2, t, "equal-slice-v{{$i}}") // should not change
+ v{{$i}}v2 = make([]{{ .Elem }}, 2)
+ testUnmarshalErr(reflect.ValueOf(v{{$i}}v2), bs{{$i}}, h, t, "dec-slice-v{{$i}}-noaddr") // non-addressable value
+ testDeepEqualErr(v{{$i}}v2[0], v{{$i}}v2[1], t, "equal-slice-v{{$i}}-noaddr") // should not change
+ testDeepEqualErr(len(v{{$i}}v2), 2, t, "equal-slice-v{{$i}}") // should not change
+ } else {
+ v{{$i}}v2 = make([]{{ .Elem }}, len(v))
testUnmarshalErr(v{{$i}}v2, bs{{$i}}, h, t, "dec-slice-v{{$i}}")
testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-slice-v{{$i}}")
- if v == nil { v{{$i}}v2 = nil } else { v{{$i}}v2 = make([]{{ .Elem }}, len(v)) }
- testUnmarshalErr(rv4i(v{{$i}}v2), bs{{$i}}, h, t, "dec-slice-v{{$i}}-noaddr") // non-addressable value
+ v{{$i}}v2 = make([]{{ .Elem }}, len(v))
+ testUnmarshalErr(reflect.ValueOf(v{{$i}}v2), bs{{$i}}, h, t, "dec-slice-v{{$i}}-noaddr") // non-addressable value
testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-slice-v{{$i}}-noaddr")
- }
+ }
+ testReleaseBytes(bs{{$i}})
// ...
bs{{$i}} = testMarshalErr(&v{{$i}}v1, h, t, "enc-slice-v{{$i}}-p")
v{{$i}}v2 = nil
testUnmarshalErr(&v{{$i}}v2, bs{{$i}}, h, t, "dec-slice-v{{$i}}-p")
testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-slice-v{{$i}}-p")
v{{$i}}va = [8]{{ .Elem }}{} // clear the array
+ testUnmarshalErr(&v{{$i}}va, bs{{$i}}, h, t, "dec-array-v{{$i}}-p-1")
+ if v{{$i}}v1 == nil && v{{$i}}v2 == nil { v{{$i}}v2 = []{{ .Elem }}{} } // so we can compare to zero len slice below
+ testDeepEqualErr(v{{$i}}va[:len(v{{$i}}v2)], v{{$i}}v2, t, "equal-array-v{{$i}}-p-1")
+ v{{$i}}va = [8]{{ .Elem }}{} // clear the array
v{{$i}}v2 = v{{$i}}va[:1:1]
testUnmarshalErr(&v{{$i}}v2, bs{{$i}}, h, t, "dec-slice-v{{$i}}-p-1")
testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-slice-v{{$i}}-p-1")
@@ -98,6 +117,7 @@ func doTestMammothSlices(t *testing.T, h Handle) {
testUnmarshalErr((&v{{$i}}va)[:], bs{{$i}}, h, t, "dec-slice-v{{$i}}-p-cap-noaddr")
testDeepEqualErr(v{{$i}}v1, v{{$i}}va[:len(v{{$i}}v1)], t, "equal-slice-v{{$i}}-p-cap-noaddr")
}
+ testReleaseBytes(bs{{$i}})
// ...
var v{{$i}}v3, v{{$i}}v4 {{ .MethodNamePfx "typMbs" false }}
v{{$i}}v2 = nil
@@ -108,17 +128,19 @@ func doTestMammothSlices(t *testing.T, h Handle) {
bs{{$i}} = testMarshalErr(v{{$i}}v3, h, t, "enc-slice-v{{$i}}-custom")
testUnmarshalErr(v{{$i}}v4, bs{{$i}}, h, t, "dec-slice-v{{$i}}-custom")
testDeepEqualErr(v{{$i}}v3, v{{$i}}v4, t, "equal-slice-v{{$i}}-custom")
+ testReleaseBytes(bs{{$i}})
}
bs{{$i}} = testMarshalErr(&v{{$i}}v3, h, t, "enc-slice-v{{$i}}-custom-p")
v{{$i}}v2 = nil
v{{$i}}v4 = {{ .MethodNamePfx "typMbs" false }}(v{{$i}}v2)
testUnmarshalErr(&v{{$i}}v4, bs{{$i}}, h, t, "dec-slice-v{{$i}}-custom-p")
testDeepEqualErr(v{{$i}}v3, v{{$i}}v4, t, "equal-slice-v{{$i}}-custom-p")
+ testReleaseBytes(bs{{$i}})
}
{{end}}{{end}}{{end}}
}
-func doTestMammothMaps(t *testing.T, h Handle) {
+func __doTestMammothMaps(t *testing.T, h Handle) {
{{range $i, $e := .Values }}{{if not .Primitive }}{{if .MapKey -}}
for _, v := range []map[{{ .MapKey }}]{{ .Elem }}{ nil, {}, { {{ nonzerocmd .MapKey }}:{{ zerocmd .Elem }} {{if ne "bool" .MapKey}}, {{ nonzerocmd .MapKey }}:{{ nonzerocmd .Elem }} {{end}} } } {
// fmt.Printf(">>>> running mammoth map v{{$i}}: %v\n", v)
@@ -131,16 +153,18 @@ func doTestMammothMaps(t *testing.T, h Handle) {
testUnmarshalErr(v{{$i}}v2, bs{{$i}}, h, t, "dec-map-v{{$i}}")
testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-map-v{{$i}}")
if v == nil { v{{$i}}v2 = nil } else { v{{$i}}v2 = make(map[{{ .MapKey }}]{{ .Elem }}, len(v)) } // reset map
- testUnmarshalErr(rv4i(v{{$i}}v2), bs{{$i}}, h, t, "dec-map-v{{$i}}-noaddr") // decode into non-addressable map value
+ testUnmarshalErr(reflect.ValueOf(v{{$i}}v2), bs{{$i}}, h, t, "dec-map-v{{$i}}-noaddr") // decode into non-addressable map value
testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-map-v{{$i}}-noaddr")
}
if v == nil { v{{$i}}v2 = nil } else { v{{$i}}v2 = make(map[{{ .MapKey }}]{{ .Elem }}, len(v)) } // reset map
testUnmarshalErr(&v{{$i}}v2, bs{{$i}}, h, t, "dec-map-v{{$i}}-p-len")
testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-map-v{{$i}}-p-len")
+ testReleaseBytes(bs{{$i}})
bs{{$i}} = testMarshalErr(&v{{$i}}v1, h, t, "enc-map-v{{$i}}-p")
v{{$i}}v2 = nil
testUnmarshalErr(&v{{$i}}v2, bs{{$i}}, h, t, "dec-map-v{{$i}}-p-nil")
testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-map-v{{$i}}-p-nil")
+ testReleaseBytes(bs{{$i}})
// ...
if v == nil { v{{$i}}v2 = nil } else { v{{$i}}v2 = make(map[{{ .MapKey }}]{{ .Elem }}, len(v)) } // reset map
var v{{$i}}v3, v{{$i}}v4 {{ .MethodNamePfx "typMap" false }}
@@ -150,6 +174,7 @@ func doTestMammothMaps(t *testing.T, h Handle) {
bs{{$i}} = testMarshalErr(v{{$i}}v3, h, t, "enc-map-v{{$i}}-custom")
testUnmarshalErr(v{{$i}}v4, bs{{$i}}, h, t, "dec-map-v{{$i}}-p-len")
testDeepEqualErr(v{{$i}}v3, v{{$i}}v4, t, "equal-map-v{{$i}}-p-len")
+ testReleaseBytes(bs{{$i}})
}
}
{{end}}{{end}}{{end}}
@@ -157,6 +182,54 @@ func doTestMammothMaps(t *testing.T, h Handle) {
}
func doTestMammothMapsAndSlices(t *testing.T, h Handle) {
- doTestMammothSlices(t, h)
- doTestMammothMaps(t, h)
+ defer testSetup(t, &h)()
+ if mh, ok := h.(*MsgpackHandle); ok {
+ defer func(b bool) { mh.RawToString = b }(mh.RawToString)
+ mh.RawToString = true
+ }
+ __doTestMammothSlices(t, h)
+ __doTestMammothMaps(t, h)
}
+
+func doTestMammoth(t *testing.T, h Handle) {
+ defer testSetup(t, &h)()
+ if mh, ok := h.(*MsgpackHandle); ok {
+ defer func(b bool) { mh.RawToString = b }(mh.RawToString)
+ mh.RawToString = true
+ }
+
+ name := h.Name()
+ var b []byte
+
+ var m, m2 TestMammoth
+ testRandomFillRV(reflect.ValueOf(&m).Elem())
+ b = testMarshalErr(&m, h, t, "mammoth-"+name)
+
+ testUnmarshalErr(&m2, b, h, t, "mammoth-"+name)
+ testDeepEqualErr(&m, &m2, t, "mammoth-"+name)
+ testReleaseBytes(b)
+
+ if testing.Short() {
+ t.Skipf("skipping rest of mammoth test in -short mode")
+ }
+
+ var mm, mm2 TestMammoth2Wrapper
+ testRandomFillRV(reflect.ValueOf(&mm).Elem())
+ b = testMarshalErr(&mm, h, t, "mammoth2-"+name)
+ // os.Stderr.Write([]byte("\n\n\n\n" + string(b) + "\n\n\n\n"))
+ testUnmarshalErr(&mm2, b, h, t, "mammoth2-"+name)
+ testDeepEqualErr(&mm, &mm2, t, "mammoth2-"+name)
+ // testMammoth2(t, name, h)
+ testReleaseBytes(b)
+}
+
+{{range $i, $e := .Formats -}}
+func Test{{ . }}Mammoth(t *testing.T) {
+ doTestMammoth(t, test{{ . }}H)
+}
+{{end}}
+{{range $i, $e := .Formats -}}
+func Test{{ . }}MammothMapsAndSlices(t *testing.T) {
+ doTestMammothMapsAndSlices(t, test{{ . }}H)
+}
+{{end}}
diff --git a/vendor/github.com/ugorji/go/codec/mammoth2-test.go.tmpl b/vendor/github.com/ugorji/go/codec/mammoth2-test.go.tmpl
index 71eaf618a..9fe56ec7f 100644
--- a/vendor/github.com/ugorji/go/codec/mammoth2-test.go.tmpl
+++ b/vendor/github.com/ugorji/go/codec/mammoth2-test.go.tmpl
@@ -1,6 +1,6 @@
-// +build !notfastpath
+// +build !codec.notmammoth
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
// Code generated from mammoth2-test.go.tmpl - DO NOT EDIT.
@@ -9,15 +9,16 @@ package codec
// Increase codecoverage by covering all the codecgen paths, in fast-path and gen-helper.go....
//
-// Add:
-// - test file for creating a mammoth generated file as _mammoth_generated.go
-// - generate a second mammoth files in a different file: mammoth2_generated_test.go
-// - mammoth-test.go.tmpl will do this
-// - run codecgen on it, into mammoth2_codecgen_generated_test.go (no build tags)
-// - as part of TestMammoth, run it also
-// - this will cover all the codecgen, gen-helper, etc in one full run
-// - check in mammoth* files into github also
-// - then
+// Note: even though this is built based on fast-path and gen-helper, we will run these tests
+// in all modes, including notfastpath, etc.
+//
+// Add test file for creating a mammoth generated file as _mammoth_generated.go
+// - generate a second mammoth files in a different file: mammoth2_generated_test.go
+// mammoth-test.go.tmpl will do this
+// - run codecgen on it, into mammoth2_codecgen_generated_test.go (no build tags)
+// - as part of TestMammoth, run it also
+// - this will cover all the codecgen, gen-helper, etc in one full run
+// - check in mammoth* files into github also
//
// Now, add some types:
// - some that implement BinaryMarshal, TextMarshal, JSONMarshal, and one that implements none of it
@@ -26,6 +27,7 @@ package codec
// import "encoding/binary"
+
import "fmt"
type TestMammoth2 struct {
@@ -52,11 +54,11 @@ type TestMammoth2 struct {
type testMammoth2Binary uint64
func (x testMammoth2Binary) MarshalBinary() (data []byte, err error) {
data = make([]byte, 8)
-bigen.PutUint64(data, uint64(x))
+bigenstd.PutUint64(data, uint64(x))
return
}
func (x *testMammoth2Binary) UnmarshalBinary(data []byte) (err error) {
-*x = testMammoth2Binary(bigen.Uint64(data))
+*x = testMammoth2Binary(bigenstd.Uint64(data))
return
}
@@ -83,12 +85,17 @@ return
type testMammoth2Basic [4]uint64
type TestMammoth2Wrapper struct {
- V TestMammoth2
- T testMammoth2Text
- B testMammoth2Binary
- J testMammoth2Json
- C testMammoth2Basic
- M map[testMammoth2Basic]TestMammoth2
- L []TestMammoth2
- A [4]int64
+ V TestMammoth2
+ T testMammoth2Text
+ B testMammoth2Binary
+ J testMammoth2Json
+ C testMammoth2Basic
+ M map[testMammoth2Basic]TestMammoth2
+ L []TestMammoth2
+ A [4]int64
+
+ Tcomplex128 complex128
+ Tcomplex64 complex64
+ Tbytes []uint8
+ Tpbytes *[]uint8
}
diff --git a/vendor/github.com/ugorji/go/codec/msgpack.go b/vendor/github.com/ugorji/go/codec/msgpack.go
index 4543337d2..df78885a9 100644
--- a/vendor/github.com/ugorji/go/codec/msgpack.go
+++ b/vendor/github.com/ugorji/go/codec/msgpack.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
/*
@@ -22,6 +22,7 @@ import (
"io"
"math"
"net/rpc"
+ "reflect"
"time"
)
@@ -79,84 +80,57 @@ const (
var mpTimeExtTag int8 = -1
var mpTimeExtTagU = uint8(mpTimeExtTag)
-// var mpdesc = map[byte]string{
-// mpPosFixNumMin: "PosFixNumMin",
-// mpPosFixNumMax: "PosFixNumMax",
-// mpFixMapMin: "FixMapMin",
-// mpFixMapMax: "FixMapMax",
-// mpFixArrayMin: "FixArrayMin",
-// mpFixArrayMax: "FixArrayMax",
-// mpFixStrMin: "FixStrMin",
-// mpFixStrMax: "FixStrMax",
-// mpNil: "Nil",
-// mpFalse: "False",
-// mpTrue: "True",
-// mpFloat: "Float",
-// mpDouble: "Double",
-// mpUint8: "Uint8",
-// mpUint16: "Uint16",
-// mpUint32: "Uint32",
-// mpUint64: "Uint64",
-// mpInt8: "Int8",
-// mpInt16: "Int16",
-// mpInt32: "Int32",
-// mpInt64: "Int64",
-// mpBin8: "Bin8",
-// mpBin16: "Bin16",
-// mpBin32: "Bin32",
-// mpExt8: "Ext8",
-// mpExt16: "Ext16",
-// mpExt32: "Ext32",
-// mpFixExt1: "FixExt1",
-// mpFixExt2: "FixExt2",
-// mpFixExt4: "FixExt4",
-// mpFixExt8: "FixExt8",
-// mpFixExt16: "FixExt16",
-// mpStr8: "Str8",
-// mpStr16: "Str16",
-// mpStr32: "Str32",
-// mpArray16: "Array16",
-// mpArray32: "Array32",
-// mpMap16: "Map16",
-// mpMap32: "Map32",
-// mpNegFixNumMin: "NegFixNumMin",
-// mpNegFixNumMax: "NegFixNumMax",
-// }
+var mpdescNames = map[byte]string{
+ mpNil: "nil",
+ mpFalse: "false",
+ mpTrue: "true",
+ mpFloat: "float",
+ mpDouble: "float",
+ mpUint8: "uuint",
+ mpUint16: "uint",
+ mpUint32: "uint",
+ mpUint64: "uint",
+ mpInt8: "int",
+ mpInt16: "int",
+ mpInt32: "int",
+ mpInt64: "int",
-func mpdesc(bd byte) string {
- switch bd {
- case mpNil:
- return "nil"
- case mpFalse:
- return "false"
- case mpTrue:
- return "true"
- case mpFloat, mpDouble:
- return "float"
- case mpUint8, mpUint16, mpUint32, mpUint64:
- return "uint"
- case mpInt8, mpInt16, mpInt32, mpInt64:
- return "int"
- default:
+ mpStr8: "string|bytes",
+ mpStr16: "string|bytes",
+ mpStr32: "string|bytes",
+
+ mpBin8: "bytes",
+ mpBin16: "bytes",
+ mpBin32: "bytes",
+
+ mpArray16: "array",
+ mpArray32: "array",
+
+ mpMap16: "map",
+ mpMap32: "map",
+}
+
+func mpdesc(bd byte) (s string) {
+ s = mpdescNames[bd]
+ if s == "" {
switch {
- case bd >= mpPosFixNumMin && bd <= mpPosFixNumMax:
- return "int"
- case bd >= mpNegFixNumMin && bd <= mpNegFixNumMax:
- return "int"
- case bd == mpStr8, bd == mpStr16, bd == mpStr32, bd >= mpFixStrMin && bd <= mpFixStrMax:
- return "string|bytes"
- case bd == mpBin8, bd == mpBin16, bd == mpBin32:
- return "bytes"
- case bd == mpArray16, bd == mpArray32, bd >= mpFixArrayMin && bd <= mpFixArrayMax:
- return "array"
- case bd == mpMap16, bd == mpMap32, bd >= mpFixMapMin && bd <= mpFixMapMax:
- return "map"
- case bd >= mpFixExt1 && bd <= mpFixExt16, bd >= mpExt8 && bd <= mpExt32:
- return "ext"
+ case bd >= mpPosFixNumMin && bd <= mpPosFixNumMax,
+ bd >= mpNegFixNumMin && bd <= mpNegFixNumMax:
+ s = "int"
+ case bd >= mpFixStrMin && bd <= mpFixStrMax:
+ s = "string|bytes"
+ case bd >= mpFixArrayMin && bd <= mpFixArrayMax:
+ s = "array"
+ case bd >= mpFixMapMin && bd <= mpFixMapMax:
+ s = "map"
+ case bd >= mpFixExt1 && bd <= mpFixExt16,
+ bd >= mpExt8 && bd <= mpExt32:
+ s = "ext"
default:
- return "unknown"
+ s = "unknown"
}
}
+ return
}
// MsgpackSpecRpcMultiArgs is a special type which signifies to the MsgpackSpecRpcCodec
@@ -169,8 +143,7 @@ type MsgpackSpecRpcMultiArgs []interface{}
// A MsgpackContainer type specifies the different types of msgpackContainers.
type msgpackContainerType struct {
- fixCutoff uint8
- bFixMin, b8, b16, b32 byte
+ fixCutoff, bFixMin, b8, b16, b32 byte
// hasFixMin, has8, has8Always bool
}
@@ -197,9 +170,9 @@ var (
type msgpackEncDriver struct {
noBuiltInTypes
encDriverNoopContainerWriter
+ encDriverNoState
h *MsgpackHandle
- x [8]byte
- _ [6]uint64 // padding
+ // x [8]byte
e Encoder
}
@@ -217,13 +190,13 @@ func (e *msgpackEncDriver) EncodeInt(i int64) {
} else if i > math.MaxInt8 {
if i <= math.MaxInt16 {
e.e.encWr.writen1(mpInt16)
- bigenHelper{e.x[:2], e.e.w()}.writeUint16(uint16(i))
+ bigen.writeUint16(e.e.w(), uint16(i))
} else if i <= math.MaxInt32 {
e.e.encWr.writen1(mpInt32)
- bigenHelper{e.x[:4], e.e.w()}.writeUint32(uint32(i))
+ bigen.writeUint32(e.e.w(), uint32(i))
} else {
e.e.encWr.writen1(mpInt64)
- bigenHelper{e.x[:8], e.e.w()}.writeUint64(uint64(i))
+ bigen.writeUint64(e.e.w(), uint64(i))
}
} else if i >= -32 {
if e.h.NoFixedNum {
@@ -235,13 +208,13 @@ func (e *msgpackEncDriver) EncodeInt(i int64) {
e.e.encWr.writen2(mpInt8, byte(i))
} else if i >= math.MinInt16 {
e.e.encWr.writen1(mpInt16)
- bigenHelper{e.x[:2], e.e.w()}.writeUint16(uint16(i))
+ bigen.writeUint16(e.e.w(), uint16(i))
} else if i >= math.MinInt32 {
e.e.encWr.writen1(mpInt32)
- bigenHelper{e.x[:4], e.e.w()}.writeUint32(uint32(i))
+ bigen.writeUint32(e.e.w(), uint32(i))
} else {
e.e.encWr.writen1(mpInt64)
- bigenHelper{e.x[:8], e.e.w()}.writeUint64(uint64(i))
+ bigen.writeUint64(e.e.w(), uint64(i))
}
}
@@ -256,13 +229,13 @@ func (e *msgpackEncDriver) EncodeUint(i uint64) {
e.e.encWr.writen2(mpUint8, byte(i))
} else if i <= math.MaxUint16 {
e.e.encWr.writen1(mpUint16)
- bigenHelper{e.x[:2], e.e.w()}.writeUint16(uint16(i))
+ bigen.writeUint16(e.e.w(), uint16(i))
} else if i <= math.MaxUint32 {
e.e.encWr.writen1(mpUint32)
- bigenHelper{e.x[:4], e.e.w()}.writeUint32(uint32(i))
+ bigen.writeUint32(e.e.w(), uint32(i))
} else {
e.e.encWr.writen1(mpUint64)
- bigenHelper{e.x[:8], e.e.w()}.writeUint64(uint64(i))
+ bigen.writeUint64(e.e.w(), uint64(i))
}
}
@@ -276,12 +249,12 @@ func (e *msgpackEncDriver) EncodeBool(b bool) {
func (e *msgpackEncDriver) EncodeFloat32(f float32) {
e.e.encWr.writen1(mpFloat)
- bigenHelper{e.x[:4], e.e.w()}.writeUint32(math.Float32bits(f))
+ bigen.writeUint32(e.e.w(), math.Float32bits(f))
}
func (e *msgpackEncDriver) EncodeFloat64(f float64) {
e.e.encWr.writen1(mpDouble)
- bigenHelper{e.x[:8], e.e.w()}.writeUint64(math.Float64bits(f))
+ bigen.writeUint64(e.e.w(), math.Float64bits(f))
}
func (e *msgpackEncDriver) EncodeTime(t time.Time) {
@@ -308,26 +281,27 @@ func (e *msgpackEncDriver) EncodeTime(t time.Time) {
}
switch l {
case 4:
- bigenHelper{e.x[:4], e.e.w()}.writeUint32(uint32(data64))
+ bigen.writeUint32(e.e.w(), uint32(data64))
case 8:
- bigenHelper{e.x[:8], e.e.w()}.writeUint64(data64)
+ bigen.writeUint64(e.e.w(), data64)
case 12:
- bigenHelper{e.x[:4], e.e.w()}.writeUint32(uint32(nsec))
- bigenHelper{e.x[:8], e.e.w()}.writeUint64(uint64(sec))
+ bigen.writeUint32(e.e.w(), uint32(nsec))
+ bigen.writeUint64(e.e.w(), uint64(sec))
}
}
-func (e *msgpackEncDriver) EncodeExt(v interface{}, xtag uint64, ext Ext) {
- var bs []byte
+func (e *msgpackEncDriver) EncodeExt(v interface{}, basetype reflect.Type, xtag uint64, ext Ext) {
+ var bs0, bs []byte
if ext == SelfExt {
- bs = e.e.blist.get(1024)[:0]
- e.e.sideEncode(v, &bs)
+ bs0 = e.e.blist.get(1024)
+ bs = bs0
+ e.e.sideEncode(v, basetype, &bs)
} else {
bs = ext.WriteExt(v)
}
if bs == nil {
e.EncodeNil()
- return
+ goto END
}
if e.h.WriteExt {
e.encodeExtPreamble(uint8(xtag), len(bs))
@@ -335,8 +309,12 @@ func (e *msgpackEncDriver) EncodeExt(v interface{}, xtag uint64, ext Ext) {
} else {
e.EncodeStringBytesRaw(bs)
}
+END:
if ext == SelfExt {
e.e.blist.put(bs)
+ if !byteSliceSameData(bs0, bs) {
+ e.e.blist.put(bs0)
+ }
}
}
@@ -361,11 +339,11 @@ func (e *msgpackEncDriver) encodeExtPreamble(xtag byte, l int) {
e.e.encWr.writen1(xtag)
} else if l < 65536 {
e.e.encWr.writen1(mpExt16)
- bigenHelper{e.x[:2], e.e.w()}.writeUint16(uint16(l))
+ bigen.writeUint16(e.e.w(), uint16(l))
e.e.encWr.writen1(xtag)
} else {
e.e.encWr.writen1(mpExt32)
- bigenHelper{e.x[:4], e.e.w()}.writeUint32(uint32(l))
+ bigen.writeUint32(e.e.w(), uint32(l))
e.e.encWr.writen1(xtag)
}
}
@@ -417,10 +395,10 @@ func (e *msgpackEncDriver) writeContainerLen(ct msgpackContainerType, l int) {
e.e.encWr.writen2(ct.b8, uint8(l))
} else if l < 65536 {
e.e.encWr.writen1(ct.b16)
- bigenHelper{e.x[:2], e.e.w()}.writeUint16(uint16(l))
+ bigen.writeUint16(e.e.w(), uint16(l))
} else {
e.e.encWr.writen1(ct.b32)
- bigenHelper{e.x[:4], e.e.w()}.writeUint32(uint32(l))
+ bigen.writeUint32(e.e.w(), uint32(l))
}
}
@@ -428,13 +406,11 @@ func (e *msgpackEncDriver) writeContainerLen(ct msgpackContainerType, l int) {
type msgpackDecDriver struct {
decDriverNoopContainerReader
+ decDriverNoopNumberHelper
h *MsgpackHandle
- // b [scratchByteArrayLen]byte
- bd byte
- bdRead bool
- fnil bool
+ bdAndBdread
+ _ bool
noBuiltInTypes
- _ [6]uint64 // padding
d Decoder
}
@@ -451,7 +427,6 @@ func (d *msgpackDecDriver) DecodeNaked() {
if !d.bdRead {
d.readNextBd()
}
- d.fnil = false
bd := d.bd
n := d.d.naked()
var decodeFurther bool
@@ -460,7 +435,6 @@ func (d *msgpackDecDriver) DecodeNaked() {
case mpNil:
n.v = valueTypeNil
d.bdRead = false
- d.fnil = true
case mpFalse:
n.v = valueTypeBool
n.b = false
@@ -470,36 +444,36 @@ func (d *msgpackDecDriver) DecodeNaked() {
case mpFloat:
n.v = valueTypeFloat
- n.f = float64(math.Float32frombits(bigen.Uint32(d.d.decRd.readx(4))))
+ n.f = float64(math.Float32frombits(bigen.Uint32(d.d.decRd.readn4())))
case mpDouble:
n.v = valueTypeFloat
- n.f = math.Float64frombits(bigen.Uint64(d.d.decRd.readx(8)))
+ n.f = math.Float64frombits(bigen.Uint64(d.d.decRd.readn8()))
case mpUint8:
n.v = valueTypeUint
n.u = uint64(d.d.decRd.readn1())
case mpUint16:
n.v = valueTypeUint
- n.u = uint64(bigen.Uint16(d.d.decRd.readx(2)))
+ n.u = uint64(bigen.Uint16(d.d.decRd.readn2()))
case mpUint32:
n.v = valueTypeUint
- n.u = uint64(bigen.Uint32(d.d.decRd.readx(4)))
+ n.u = uint64(bigen.Uint32(d.d.decRd.readn4()))
case mpUint64:
n.v = valueTypeUint
- n.u = uint64(bigen.Uint64(d.d.decRd.readx(8)))
+ n.u = uint64(bigen.Uint64(d.d.decRd.readn8()))
case mpInt8:
n.v = valueTypeInt
n.i = int64(int8(d.d.decRd.readn1()))
case mpInt16:
n.v = valueTypeInt
- n.i = int64(int16(bigen.Uint16(d.d.decRd.readx(2))))
+ n.i = int64(int16(bigen.Uint16(d.d.decRd.readn2())))
case mpInt32:
n.v = valueTypeInt
- n.i = int64(int32(bigen.Uint32(d.d.decRd.readx(4))))
+ n.i = int64(int32(bigen.Uint32(d.d.decRd.readn4())))
case mpInt64:
n.v = valueTypeInt
- n.i = int64(int64(bigen.Uint64(d.d.decRd.readx(8))))
+ n.i = int64(int64(bigen.Uint64(d.d.decRd.readn8())))
default:
switch {
@@ -512,15 +486,16 @@ func (d *msgpackDecDriver) DecodeNaked() {
n.v = valueTypeInt
n.i = int64(int8(bd))
case bd == mpStr8, bd == mpStr16, bd == mpStr32, bd >= mpFixStrMin && bd <= mpFixStrMax:
- if d.h.WriteExt || d.h.RawToString {
- n.v = valueTypeString
- n.s = string(d.DecodeStringAsBytes())
- } else {
- n.v = valueTypeBytes
- n.l = d.DecodeBytes(nil, false)
- }
+ d.d.fauxUnionReadRawBytes(d.h.WriteExt)
+ // if d.h.WriteExt || d.h.RawToString {
+ // n.v = valueTypeString
+ // n.s = d.d.stringZC(d.DecodeStringAsBytes())
+ // } else {
+ // n.v = valueTypeBytes
+ // n.l = d.DecodeBytes([]byte{})
+ // }
case bd == mpBin8, bd == mpBin16, bd == mpBin32:
- decNakedReadRawBytes(d, &d.d, n, d.h.RawToString)
+ d.d.fauxUnionReadRawBytes(false)
case bd == mpArray16, bd == mpArray32, bd >= mpFixArrayMin && bd <= mpFixArrayMax:
n.v = valueTypeArray
decodeFurther = true
@@ -535,7 +510,7 @@ func (d *msgpackDecDriver) DecodeNaked() {
n.v = valueTypeTime
n.t = d.decodeTime(clen)
} else if d.d.bytes {
- n.l = d.d.decRd.readx(uint(clen))
+ n.l = d.d.decRd.rb.readx(uint(clen))
} else {
n.l = decByteSlice(d.d.r(), clen, d.d.h.MaxInitLen, d.d.b[:])
}
@@ -552,6 +527,165 @@ func (d *msgpackDecDriver) DecodeNaked() {
}
}
+func (d *msgpackDecDriver) nextValueBytes(v0 []byte) (v []byte) {
+ if !d.bdRead {
+ d.readNextBd()
+ }
+ v = v0
+ var h = decNextValueBytesHelper{d: &d.d}
+ var cursor = d.d.rb.c - 1
+ h.append1(&v, d.bd)
+ v = d.nextValueBytesBdReadR(v)
+ d.bdRead = false
+ h.bytesRdV(&v, cursor)
+ return
+}
+
+func (d *msgpackDecDriver) nextValueBytesR(v0 []byte) (v []byte) {
+ d.readNextBd()
+ v = v0
+ var h = decNextValueBytesHelper{d: &d.d}
+ h.append1(&v, d.bd)
+ return d.nextValueBytesBdReadR(v)
+}
+
+func (d *msgpackDecDriver) nextValueBytesBdReadR(v0 []byte) (v []byte) {
+ v = v0
+ var h = decNextValueBytesHelper{d: &d.d}
+
+ bd := d.bd
+
+ var clen uint
+
+ switch bd {
+ case mpNil, mpFalse, mpTrue: // pass
+ case mpUint8, mpInt8:
+ h.append1(&v, d.d.decRd.readn1())
+ case mpUint16, mpInt16:
+ h.appendN(&v, d.d.decRd.readx(2)...)
+ case mpFloat, mpUint32, mpInt32:
+ h.appendN(&v, d.d.decRd.readx(4)...)
+ case mpDouble, mpUint64, mpInt64:
+ h.appendN(&v, d.d.decRd.readx(8)...)
+ case mpStr8, mpBin8:
+ clen = uint(d.d.decRd.readn1())
+ h.append1(&v, byte(clen))
+ h.appendN(&v, d.d.decRd.readx(clen)...)
+ case mpStr16, mpBin16:
+ x := d.d.decRd.readn2()
+ h.appendN(&v, x[:]...)
+ clen = uint(bigen.Uint16(x))
+ h.appendN(&v, d.d.decRd.readx(clen)...)
+ case mpStr32, mpBin32:
+ x := d.d.decRd.readn4()
+ h.appendN(&v, x[:]...)
+ clen = uint(bigen.Uint32(x))
+ h.appendN(&v, d.d.decRd.readx(clen)...)
+ case mpFixExt1:
+ h.append1(&v, d.d.decRd.readn1()) // tag
+ h.append1(&v, d.d.decRd.readn1())
+ case mpFixExt2:
+ h.append1(&v, d.d.decRd.readn1()) // tag
+ h.appendN(&v, d.d.decRd.readx(2)...)
+ case mpFixExt4:
+ h.append1(&v, d.d.decRd.readn1()) // tag
+ h.appendN(&v, d.d.decRd.readx(4)...)
+ case mpFixExt8:
+ h.append1(&v, d.d.decRd.readn1()) // tag
+ h.appendN(&v, d.d.decRd.readx(8)...)
+ case mpFixExt16:
+ h.append1(&v, d.d.decRd.readn1()) // tag
+ h.appendN(&v, d.d.decRd.readx(16)...)
+ case mpExt8:
+ clen = uint(d.d.decRd.readn1())
+ h.append1(&v, uint8(clen))
+ h.append1(&v, d.d.decRd.readn1()) // tag
+ h.appendN(&v, d.d.decRd.readx(clen)...)
+ case mpExt16:
+ x := d.d.decRd.readn2()
+ clen = uint(bigen.Uint16(x))
+ h.appendN(&v, x[:]...)
+ h.append1(&v, d.d.decRd.readn1()) // tag
+ h.appendN(&v, d.d.decRd.readx(clen)...)
+ case mpExt32:
+ x := d.d.decRd.readn4()
+ clen = uint(bigen.Uint32(x))
+ h.appendN(&v, x[:]...)
+ h.append1(&v, d.d.decRd.readn1()) // tag
+ h.appendN(&v, d.d.decRd.readx(clen)...)
+ case mpArray16:
+ x := d.d.decRd.readn2()
+ clen = uint(bigen.Uint16(x))
+ h.appendN(&v, x[:]...)
+ for i := uint(0); i < clen; i++ {
+ v = d.nextValueBytesR(v)
+ }
+ case mpArray32:
+ x := d.d.decRd.readn4()
+ clen = uint(bigen.Uint32(x))
+ h.appendN(&v, x[:]...)
+ for i := uint(0); i < clen; i++ {
+ v = d.nextValueBytesR(v)
+ }
+ case mpMap16:
+ x := d.d.decRd.readn2()
+ clen = uint(bigen.Uint16(x))
+ h.appendN(&v, x[:]...)
+ for i := uint(0); i < clen; i++ {
+ v = d.nextValueBytesR(v)
+ v = d.nextValueBytesR(v)
+ }
+ case mpMap32:
+ x := d.d.decRd.readn4()
+ clen = uint(bigen.Uint32(x))
+ h.appendN(&v, x[:]...)
+ for i := uint(0); i < clen; i++ {
+ v = d.nextValueBytesR(v)
+ v = d.nextValueBytesR(v)
+ }
+ default:
+ switch {
+ case bd >= mpPosFixNumMin && bd <= mpPosFixNumMax: // pass
+ case bd >= mpNegFixNumMin && bd <= mpNegFixNumMax: // pass
+ case bd >= mpFixStrMin && bd <= mpFixStrMax:
+ clen = uint(mpFixStrMin ^ bd)
+ h.appendN(&v, d.d.decRd.readx(clen)...)
+ case bd >= mpFixArrayMin && bd <= mpFixArrayMax:
+ clen = uint(mpFixArrayMin ^ bd)
+ for i := uint(0); i < clen; i++ {
+ v = d.nextValueBytesR(v)
+ }
+ case bd >= mpFixMapMin && bd <= mpFixMapMax:
+ clen = uint(mpFixMapMin ^ bd)
+ for i := uint(0); i < clen; i++ {
+ v = d.nextValueBytesR(v)
+ v = d.nextValueBytesR(v)
+ }
+ default:
+ d.d.errorf("nextValueBytes: cannot infer value: %s: Ox%x/%d/%s", msgBadDesc, bd, bd, mpdesc(bd))
+ }
+ }
+ return
+}
+
+func (d *msgpackDecDriver) decFloat4Int32() (f float32) {
+ fbits := bigen.Uint32(d.d.decRd.readn4())
+ f = math.Float32frombits(fbits)
+ if !noFrac32(fbits) {
+ d.d.errorf("assigning integer value from float32 with a fraction: %v", f)
+ }
+ return
+}
+
+func (d *msgpackDecDriver) decFloat4Int64() (f float64) {
+ fbits := bigen.Uint64(d.d.decRd.readn8())
+ f = math.Float64frombits(fbits)
+ if !noFrac64(fbits) {
+ d.d.errorf("assigning integer value from float64 with a fraction: %v", f)
+ }
+ return
+}
+
// int can be decoded from msgpack type: intXXX or uintXXX
func (d *msgpackDecDriver) DecodeInt64() (i int64) {
if d.advanceNil() {
@@ -561,19 +695,23 @@ func (d *msgpackDecDriver) DecodeInt64() (i int64) {
case mpUint8:
i = int64(uint64(d.d.decRd.readn1()))
case mpUint16:
- i = int64(uint64(bigen.Uint16(d.d.decRd.readx(2))))
+ i = int64(uint64(bigen.Uint16(d.d.decRd.readn2())))
case mpUint32:
- i = int64(uint64(bigen.Uint32(d.d.decRd.readx(4))))
+ i = int64(uint64(bigen.Uint32(d.d.decRd.readn4())))
case mpUint64:
- i = int64(bigen.Uint64(d.d.decRd.readx(8)))
+ i = int64(bigen.Uint64(d.d.decRd.readn8()))
case mpInt8:
i = int64(int8(d.d.decRd.readn1()))
case mpInt16:
- i = int64(int16(bigen.Uint16(d.d.decRd.readx(2))))
+ i = int64(int16(bigen.Uint16(d.d.decRd.readn2())))
case mpInt32:
- i = int64(int32(bigen.Uint32(d.d.decRd.readx(4))))
+ i = int64(int32(bigen.Uint32(d.d.decRd.readn4())))
case mpInt64:
- i = int64(bigen.Uint64(d.d.decRd.readx(8)))
+ i = int64(bigen.Uint64(d.d.decRd.readn8()))
+ case mpFloat:
+ i = int64(d.decFloat4Int32())
+ case mpDouble:
+ i = int64(d.decFloat4Int64())
default:
switch {
case d.bd >= mpPosFixNumMin && d.bd <= mpPosFixNumMax:
@@ -582,7 +720,6 @@ func (d *msgpackDecDriver) DecodeInt64() (i int64) {
i = int64(int8(d.bd))
default:
d.d.errorf("cannot decode signed integer: %s: %x/%s", msgBadDesc, d.bd, mpdesc(d.bd))
- return
}
}
d.bdRead = false
@@ -598,38 +735,46 @@ func (d *msgpackDecDriver) DecodeUint64() (ui uint64) {
case mpUint8:
ui = uint64(d.d.decRd.readn1())
case mpUint16:
- ui = uint64(bigen.Uint16(d.d.decRd.readx(2)))
+ ui = uint64(bigen.Uint16(d.d.decRd.readn2()))
case mpUint32:
- ui = uint64(bigen.Uint32(d.d.decRd.readx(4)))
+ ui = uint64(bigen.Uint32(d.d.decRd.readn4()))
case mpUint64:
- ui = bigen.Uint64(d.d.decRd.readx(8))
+ ui = bigen.Uint64(d.d.decRd.readn8())
case mpInt8:
if i := int64(int8(d.d.decRd.readn1())); i >= 0 {
ui = uint64(i)
} else {
d.d.errorf("assigning negative signed value: %v, to unsigned type", i)
- return
}
case mpInt16:
- if i := int64(int16(bigen.Uint16(d.d.decRd.readx(2)))); i >= 0 {
+ if i := int64(int16(bigen.Uint16(d.d.decRd.readn2()))); i >= 0 {
ui = uint64(i)
} else {
d.d.errorf("assigning negative signed value: %v, to unsigned type", i)
- return
}
case mpInt32:
- if i := int64(int32(bigen.Uint32(d.d.decRd.readx(4)))); i >= 0 {
+ if i := int64(int32(bigen.Uint32(d.d.decRd.readn4()))); i >= 0 {
ui = uint64(i)
} else {
d.d.errorf("assigning negative signed value: %v, to unsigned type", i)
- return
}
case mpInt64:
- if i := int64(bigen.Uint64(d.d.decRd.readx(8))); i >= 0 {
+ if i := int64(bigen.Uint64(d.d.decRd.readn8())); i >= 0 {
ui = uint64(i)
} else {
d.d.errorf("assigning negative signed value: %v, to unsigned type", i)
- return
+ }
+ case mpFloat:
+ if f := d.decFloat4Int32(); f >= 0 {
+ ui = uint64(f)
+ } else {
+ d.d.errorf("assigning negative float value: %v, to unsigned type", f)
+ }
+ case mpDouble:
+ if f := d.decFloat4Int64(); f >= 0 {
+ ui = uint64(f)
+ } else {
+ d.d.errorf("assigning negative float value: %v, to unsigned type", f)
}
default:
switch {
@@ -637,10 +782,8 @@ func (d *msgpackDecDriver) DecodeUint64() (ui uint64) {
ui = uint64(d.bd)
case d.bd >= mpNegFixNumMin && d.bd <= mpNegFixNumMax:
d.d.errorf("assigning negative signed value: %v, to unsigned type", int(d.bd))
- return
default:
d.d.errorf("cannot decode unsigned integer: %s: %x/%s", msgBadDesc, d.bd, mpdesc(d.bd))
- return
}
}
d.bdRead = false
@@ -653,9 +796,9 @@ func (d *msgpackDecDriver) DecodeFloat64() (f float64) {
return
}
if d.bd == mpFloat {
- f = float64(math.Float32frombits(bigen.Uint32(d.d.decRd.readx(4))))
+ f = float64(math.Float32frombits(bigen.Uint32(d.d.decRd.readn4())))
} else if d.bd == mpDouble {
- f = math.Float64frombits(bigen.Uint64(d.d.decRd.readx(8)))
+ f = math.Float64frombits(bigen.Uint64(d.d.decRd.readn8()))
} else {
f = float64(d.DecodeInt64())
}
@@ -674,13 +817,13 @@ func (d *msgpackDecDriver) DecodeBool() (b bool) {
b = true
} else {
d.d.errorf("cannot decode bool: %s: %x/%s", msgBadDesc, d.bd, mpdesc(d.bd))
- return
}
d.bdRead = false
return
}
-func (d *msgpackDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) {
+func (d *msgpackDecDriver) DecodeBytes(bs []byte) (bsOut []byte) {
+ d.d.decByteState = decByteStateNone
if d.advanceNil() {
return
}
@@ -695,34 +838,42 @@ func (d *msgpackDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte)
} else if bd == mpArray16 || bd == mpArray32 ||
(bd >= mpFixArrayMin && bd <= mpFixArrayMax) {
// check if an "array" of uint8's
- if zerocopy && len(bs) == 0 {
+ if bs == nil {
+ d.d.decByteState = decByteStateReuseBuf
bs = d.d.b[:]
}
// bsOut, _ = fastpathTV.DecSliceUint8V(bs, true, d.d)
slen := d.ReadArrayStart()
- bs = usableByteSlice(bs, slen)
+ var changed bool
+ if bs, changed = usableByteSlice(bs, slen); changed {
+ d.d.decByteState = decByteStateNone
+ }
for i := 0; i < len(bs); i++ {
bs[i] = uint8(chkOvf.UintV(d.DecodeUint64(), 8))
}
return bs
} else {
d.d.errorf("invalid byte descriptor for decoding bytes, got: 0x%x", d.bd)
- return
}
d.bdRead = false
- if zerocopy {
- if d.d.bytes {
- return d.d.decRd.readx(uint(clen))
- } else if len(bs) == 0 {
- bs = d.d.b[:]
- }
+ if d.d.zerocopy() {
+ d.d.decByteState = decByteStateZerocopy
+ return d.d.decRd.rb.readx(uint(clen))
+ }
+ if bs == nil {
+ d.d.decByteState = decByteStateReuseBuf
+ bs = d.d.b[:]
}
return decByteSlice(d.d.r(), clen, d.h.MaxInitLen, bs)
}
func (d *msgpackDecDriver) DecodeStringAsBytes() (s []byte) {
- return d.DecodeBytes(d.d.b[:], true)
+ return d.DecodeBytes(nil)
+}
+
+func (d *msgpackDecDriver) descBd() string {
+ return sprintf("%v (%s)", d.bd, mpdesc(d.bd))
}
func (d *msgpackDecDriver) readNextBd() {
@@ -730,28 +881,19 @@ func (d *msgpackDecDriver) readNextBd() {
d.bdRead = true
}
-func (d *msgpackDecDriver) uncacheRead() {
- if d.bdRead {
- d.d.decRd.unreadn1()
- d.bdRead = false
- }
-}
-
func (d *msgpackDecDriver) advanceNil() (null bool) {
- d.fnil = false
if !d.bdRead {
d.readNextBd()
}
if d.bd == mpNil {
d.bdRead = false
- d.fnil = true
- null = true
+ return true // null = true
}
return
}
-func (d *msgpackDecDriver) Nil() bool {
- return d.fnil
+func (d *msgpackDecDriver) TryNil() (v bool) {
+ return d.advanceNil()
}
func (d *msgpackDecDriver) ContainerType() (vt valueType) {
@@ -759,10 +901,8 @@ func (d *msgpackDecDriver) ContainerType() (vt valueType) {
d.readNextBd()
}
bd := d.bd
- d.fnil = false
if bd == mpNil {
d.bdRead = false
- d.fnil = true
return valueTypeNil
} else if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 {
return valueTypeBytes
@@ -780,23 +920,18 @@ func (d *msgpackDecDriver) ContainerType() (vt valueType) {
return valueTypeUnset
}
-func (d *msgpackDecDriver) TryNil() (v bool) {
- return d.advanceNil()
-}
-
func (d *msgpackDecDriver) readContainerLen(ct msgpackContainerType) (clen int) {
bd := d.bd
if bd == ct.b8 {
clen = int(d.d.decRd.readn1())
} else if bd == ct.b16 {
- clen = int(bigen.Uint16(d.d.decRd.readx(2)))
+ clen = int(bigen.Uint16(d.d.decRd.readn2()))
} else if bd == ct.b32 {
- clen = int(bigen.Uint32(d.d.decRd.readx(4)))
+ clen = int(bigen.Uint32(d.d.decRd.readn4()))
} else if (ct.bFixMin & bd) == ct.bFixMin {
clen = int(ct.bFixMin ^ bd)
} else {
d.d.errorf("cannot read container length: %s: hex: %x, decimal: %d", msgBadDesc, bd, bd)
- return
}
d.bdRead = false
return
@@ -804,14 +939,14 @@ func (d *msgpackDecDriver) readContainerLen(ct msgpackContainerType) (clen int)
func (d *msgpackDecDriver) ReadMapStart() int {
if d.advanceNil() {
- return decContainerLenNil
+ return containerLenNil
}
return d.readContainerLen(msgpackContainerMap)
}
func (d *msgpackDecDriver) ReadArrayStart() int {
if d.advanceNil() {
- return decContainerLenNil
+ return containerLenNil
}
return d.readContainerLen(msgpackContainerList)
}
@@ -831,12 +966,11 @@ func (d *msgpackDecDriver) readExtLen() (clen int) {
case mpExt8:
clen = int(d.d.decRd.readn1())
case mpExt16:
- clen = int(bigen.Uint16(d.d.decRd.readx(2)))
+ clen = int(bigen.Uint16(d.d.decRd.readn2()))
case mpExt32:
- clen = int(bigen.Uint32(d.d.decRd.readx(4)))
+ clen = int(bigen.Uint32(d.d.decRd.readn4()))
default:
d.d.errorf("decoding ext bytes: found unexpected byte: %x", d.bd)
- return
}
return
}
@@ -865,57 +999,53 @@ func (d *msgpackDecDriver) DecodeTime() (t time.Time) {
clen = 12
} else {
d.d.errorf("invalid stream for decoding time as extension: got 0x%x, 0x%x", d.bd, b2)
- return
}
}
return d.decodeTime(clen)
}
func (d *msgpackDecDriver) decodeTime(clen int) (t time.Time) {
- // bs = d.d.decRd.readx(clen)
d.bdRead = false
switch clen {
case 4:
- t = time.Unix(int64(bigen.Uint32(d.d.decRd.readx(4))), 0).UTC()
+ t = time.Unix(int64(bigen.Uint32(d.d.decRd.readn4())), 0).UTC()
case 8:
- tv := bigen.Uint64(d.d.decRd.readx(8))
+ tv := bigen.Uint64(d.d.decRd.readn8())
t = time.Unix(int64(tv&0x00000003ffffffff), int64(tv>>34)).UTC()
case 12:
- nsec := bigen.Uint32(d.d.decRd.readx(4))
- sec := bigen.Uint64(d.d.decRd.readx(8))
+ nsec := bigen.Uint32(d.d.decRd.readn4())
+ sec := bigen.Uint64(d.d.decRd.readn8())
t = time.Unix(int64(sec), int64(nsec)).UTC()
default:
d.d.errorf("invalid length of bytes for decoding time - expecting 4 or 8 or 12, got %d", clen)
- return
}
return
}
-func (d *msgpackDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) {
+func (d *msgpackDecDriver) DecodeExt(rv interface{}, basetype reflect.Type, xtag uint64, ext Ext) {
if xtag > 0xff {
d.d.errorf("ext: tag must be <= 0xff; got: %v", xtag)
- return
}
if d.advanceNil() {
return
}
- realxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag))
+ xbs, realxtag1, zerocopy := d.decodeExtV(ext != nil, uint8(xtag))
realxtag := uint64(realxtag1)
if ext == nil {
re := rv.(*RawExt)
re.Tag = realxtag
- re.Data = detachZeroCopyBytes(d.d.bytes, re.Data, xbs)
+ re.setData(xbs, zerocopy)
} else if ext == SelfExt {
- d.d.sideDecode(rv, xbs)
+ d.d.sideDecode(rv, basetype, xbs)
} else {
ext.ReadExt(rv, xbs)
}
}
-func (d *msgpackDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []byte) {
+func (d *msgpackDecDriver) decodeExtV(verifyTag bool, tag byte) (xbs []byte, xtag byte, zerocopy bool) {
xbd := d.bd
if xbd == mpBin8 || xbd == mpBin16 || xbd == mpBin32 {
- xbs = d.DecodeBytes(nil, true)
+ xbs = d.DecodeBytes(nil)
} else if xbd == mpStr8 || xbd == mpStr16 || xbd == mpStr32 ||
(xbd >= mpFixStrMin && xbd <= mpFixStrMax) {
xbs = d.DecodeStringAsBytes()
@@ -924,10 +1054,10 @@ func (d *msgpackDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs
xtag = d.d.decRd.readn1()
if verifyTag && xtag != tag {
d.d.errorf("wrong extension tag - got %b, expecting %v", xtag, tag)
- return
}
if d.d.bytes {
- xbs = d.d.decRd.readx(uint(clen))
+ xbs = d.d.decRd.rb.readx(uint(clen))
+ zerocopy = true
} else {
xbs = decByteSlice(d.d.r(), clen, d.d.h.MaxInitLen, d.d.b[:])
}
@@ -962,13 +1092,13 @@ type MsgpackHandle struct {
// PositiveIntUnsigned says to encode positive integers as unsigned.
PositiveIntUnsigned bool
-
- _ [7]uint64 // padding (cache-aligned)
}
// Name returns the name of the handle: msgpack
func (h *MsgpackHandle) Name() string { return "msgpack" }
+func (h *MsgpackHandle) desc(bd byte) string { return mpdesc(bd) }
+
func (h *MsgpackHandle) newEncDriver() encDriver {
var e = &msgpackEncDriver{h: h}
e.e.e = e
@@ -985,14 +1115,6 @@ func (h *MsgpackHandle) newDecDriver() decDriver {
return d
}
-func (e *msgpackEncDriver) reset() {
-}
-
-func (d *msgpackDecDriver) reset() {
- d.bd, d.bdRead = 0, false
- d.fnil = false
-}
-
//--------------------------------------------------
type msgpackSpecRpcCodec struct {
@@ -1011,7 +1133,7 @@ func (c *msgpackSpecRpcCodec) WriteRequest(r *rpc.Request, body interface{}) err
bodyArr = []interface{}{body}
}
r2 := []interface{}{0, uint32(r.Seq), r.ServiceMethod, bodyArr}
- return c.write(r2, nil, false)
+ return c.write(r2)
}
func (c *msgpackSpecRpcCodec) WriteResponse(r *rpc.Response, body interface{}) error {
@@ -1023,7 +1145,7 @@ func (c *msgpackSpecRpcCodec) WriteResponse(r *rpc.Response, body interface{}) e
body = nil
}
r2 := []interface{}{1, uint32(r.Seq), moe, body}
- return c.write(r2, nil, false)
+ return c.write(r2)
}
func (c *msgpackSpecRpcCodec) ReadResponseHeader(r *rpc.Response) error {
@@ -1071,8 +1193,7 @@ func (c *msgpackSpecRpcCodec) parseCustomHeader(expectTypeByte byte, msgid *uint
err = c.read(&b)
if err == nil {
if b != expectTypeByte {
- err = fmt.Errorf("%s - expecting %v but got %x/%s",
- msgBadDesc, expectTypeByte, b, mpdesc(b))
+ err = fmt.Errorf("%s - expecting %v but got %x/%s", msgBadDesc, expectTypeByte, b, mpdesc(b))
} else {
err = c.read(msgid)
if err == nil {
diff --git a/vendor/github.com/ugorji/go/codec/prebuild.go b/vendor/github.com/ugorji/go/codec/prebuild.go
deleted file mode 100644
index 7771057ef..000000000
--- a/vendor/github.com/ugorji/go/codec/prebuild.go
+++ /dev/null
@@ -1,136 +0,0 @@
-// +build prebuild
-
-package main
-
-// prebuild.go generates sort implementations for
-// various slice types and combination slice+reflect.Value types.
-//
-// The combination slice+reflect.Value types are used
-// during canonical encode, and the others are used during fast-path
-// encoding of map keys.
-
-import (
- "bytes"
- "go/format"
- "io/ioutil"
- "os"
- "strings"
- "text/template"
-)
-
-// genInternalSortableTypes returns the types
-// that are used for fast-path canonical's encoding of maps.
-//
-// For now, we only support the highest sizes for
-// int64, uint64, float64, bool, string, bytes.
-func genInternalSortableTypes() []string {
- return []string{
- "string",
- // "float32",
- "float64",
- // "uint",
- // "uint8",
- // "uint16",
- // "uint32",
- "uint64",
- "uintptr",
- // "int",
- // "int8",
- // "int16",
- // "int32",
- "int64",
- "bool",
- "time",
- "bytes",
- }
-}
-
-// genInternalSortablePlusTypes returns the types
-// that are used for reflection-based canonical's encoding of maps.
-//
-// For now, we only support the highest sizes for
-// int64, uint64, float64, bool, string, bytes.
-func genInternalSortablePlusTypes() []string {
- return []string{
- "string",
- "float64",
- "uint64",
- "uintptr",
- "int64",
- "bool",
- "time",
- "bytes",
- }
-}
-
-func genTypeForShortName(s string) string {
- switch s {
- case "time":
- return "time.Time"
- case "bytes":
- return "[]byte"
- }
- return s
-}
-
-func genArgs(args ...interface{}) map[string]interface{} {
- m := make(map[string]interface{}, len(args)/2)
- for i := 0; i < len(args); {
- m[args[i].(string)] = args[i+1]
- i += 2
- }
- return m
-}
-
-func genEndsWith(s0 string, sn ...string) bool {
- for _, s := range sn {
- if strings.HasSuffix(s0, s) {
- return true
- }
- }
- return false
-}
-
-func chkerr(err error) {
- if err != nil {
- panic(err)
- }
-}
-
-func run(fnameIn, fnameOut string) {
- var err error
-
- funcs := make(template.FuncMap)
- funcs["sortables"] = genInternalSortableTypes
- funcs["sortablesplus"] = genInternalSortablePlusTypes
- funcs["tshort"] = genTypeForShortName
- funcs["endswith"] = genEndsWith
- funcs["args"] = genArgs
-
- t := template.New("").Funcs(funcs)
- fin, err := os.Open(fnameIn)
- chkerr(err)
- defer fin.Close()
- fout, err := os.Create(fnameOut)
- chkerr(err)
- defer fout.Close()
- tmplstr, err := ioutil.ReadAll(fin)
- chkerr(err)
- t, err = t.Parse(string(tmplstr))
- chkerr(err)
- var out bytes.Buffer
- err = t.Execute(&out, 0)
- chkerr(err)
- bout, err := format.Source(out.Bytes())
- if err != nil {
- fout.Write(out.Bytes()) // write out if error, so we can still see.
- }
- chkerr(err)
- // write out if error, as much as possible, so we can still see.
- _, err = fout.Write(bout)
- chkerr(err)
-}
-
-func main() {
- run("sort-slice.go.tmpl", "sort-slice.generated.go")
-}
diff --git a/vendor/github.com/ugorji/go/codec/reader.go b/vendor/github.com/ugorji/go/codec/reader.go
index 1c3fe88e4..802938c7d 100644
--- a/vendor/github.com/ugorji/go/codec/reader.go
+++ b/vendor/github.com/ugorji/go/codec/reader.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
@@ -8,25 +8,44 @@ import "io"
// decReader abstracts the reading source, allowing implementations that can
// read from an io.Reader or directly off a byte slice with zero-copying.
type decReader interface {
- unreadn1()
// readx will use the implementation scratch buffer if possible i.e. n < len(scratchbuf), OR
// just return a view of the []byte being decoded from.
- // Ensure you call detachZeroCopyBytes later if this needs to be sent outside codec control.
readx(n uint) []byte
readb([]byte)
- readn1() uint8
- // read up to 7 bytes at a time
- readn(num uint8) (v [rwNLen]byte)
+
+ readn1() byte
+ readn2() [2]byte
+ // readn3 will read 3 bytes into the top-most elements of a 4-byte array
+ readn3() [4]byte
+ readn4() [4]byte
+ readn8() [8]byte
+ // readn1eof() (v uint8, eof bool)
+
+ // // read up to 8 bytes at a time
+ // readn(num uint8) (v [8]byte)
+
numread() uint // number of bytes read
- track()
- stopTrack() []byte
+
+ // skip any whitespace characters, and return the first non-matching byte
+ skipWhitespace() (token byte)
+
+ // jsonReadNum will include last read byte in first element of slice,
+ // and continue numeric characters until it sees a non-numeric char
+ // or EOF. If it sees a non-numeric character, it will unread that.
+ jsonReadNum() []byte
+
+ // jsonReadAsisChars will read json plain characters (anything but " or \)
+ // and return a slice terminated by a non-json asis character.
+ jsonReadAsisChars() []byte
// skip will skip any byte that matches, and return the first non-matching byte
- skip(accept *bitset256) (token byte)
+ // skip(accept *bitset256) (token byte)
+
// readTo will read any byte that matches, stopping once no-longer matching.
- readTo(accept *bitset256) (out []byte)
- // readUntil will read, only stopping once it matches the 'stop' byte.
- readUntil(stop byte, includeLast bool) (out []byte)
+ // readTo(accept *bitset256) (out []byte)
+
+ // readUntil will read, only stopping once it matches the 'stop' byte (which it excludes).
+ readUntil(stop byte) (out []byte)
}
// ------------------------------------------------
@@ -48,44 +67,28 @@ type ioDecReaderCommon struct {
n uint // num read
- l byte // last byte
- ls unreadByteStatus // last byte status
- trb bool // tracking bytes turned on
- _ bool
- b [4]byte // tiny buffer for reading single bytes
+ l byte // last byte
+ ls unreadByteStatus // last byte status
+
+ b [6]byte // tiny buffer for reading single bytes
blist *bytesFreelist
- tr []byte // buffer for tracking bytes
bufr []byte // buffer for readTo/readUntil
}
-func (z *ioDecReaderCommon) last() byte {
- return z.l
-}
-
func (z *ioDecReaderCommon) reset(r io.Reader, blist *bytesFreelist) {
z.blist = blist
z.r = r
z.ls = unreadByteUndefined
z.l, z.n = 0, 0
- z.trb = false
+ z.bufr = z.blist.check(z.bufr, 256)
}
func (z *ioDecReaderCommon) numread() uint {
return z.n
}
-func (z *ioDecReaderCommon) track() {
- z.tr = z.blist.check(z.tr, 256)[:0]
- z.trb = true
-}
-
-func (z *ioDecReaderCommon) stopTrack() (bs []byte) {
- z.trb = false
- return z.tr
-}
-
// ------------------------------------------
// ioDecReader is a decReader that reads off an io.Reader.
@@ -94,11 +97,9 @@ func (z *ioDecReaderCommon) stopTrack() (bs []byte) {
type ioDecReader struct {
ioDecReaderCommon
- // rr io.Reader
br io.ByteScanner
- x [64 + 16]byte // for: get struct field name, swallow valueTypeBytes, etc
- // _ [1]uint64 // padding
+ x [64 + 48]byte // for: get struct field name, swallow valueTypeBytes, etc
}
func (z *ioDecReader) reset(r io.Reader, blist *bytesFreelist) {
@@ -178,9 +179,23 @@ func (z *ioDecReader) UnreadByte() (err error) {
return
}
-func (z *ioDecReader) readn(num uint8) (bs [rwNLen]byte) {
- z.readb(bs[:num])
- // copy(bs[:], z.readx(uint(num)))
+func (z *ioDecReader) readn2() (bs [2]byte) {
+ z.readb(bs[:])
+ return
+}
+
+func (z *ioDecReader) readn3() (bs [4]byte) {
+ z.readb(bs[1:])
+ return
+}
+
+func (z *ioDecReader) readn4() (bs [4]byte) {
+ z.readb(bs[:])
+ return
+}
+
+func (z *ioDecReader) readn8() (bs [8]byte) {
+ z.readb(bs[:])
return
}
@@ -193,13 +208,9 @@ func (z *ioDecReader) readx(n uint) (bs []byte) {
} else {
bs = make([]byte, n)
}
- if _, err := decReadFull(z.r, bs); err != nil {
- panic(err)
- }
+ _, err := readFull(z.r, bs)
+ halt.onerror(err)
z.n += uint(len(bs))
- if z.trb {
- z.tr = append(z.tr, bs...)
- }
return
}
@@ -207,99 +218,81 @@ func (z *ioDecReader) readb(bs []byte) {
if len(bs) == 0 {
return
}
- if _, err := decReadFull(z.r, bs); err != nil {
- panic(err)
- }
+ _, err := readFull(z.r, bs)
+ halt.onerror(err)
z.n += uint(len(bs))
- if z.trb {
- z.tr = append(z.tr, bs...)
- }
+}
+
+func (z *ioDecReader) readn1() (b uint8) {
+ b, err := z.ReadByte()
+ halt.onerror(err)
+ z.n++
+ return
}
func (z *ioDecReader) readn1eof() (b uint8, eof bool) {
b, err := z.ReadByte()
if err == nil {
z.n++
- if z.trb {
- z.tr = append(z.tr, b)
- }
} else if err == io.EOF {
eof = true
} else {
- panic(err)
+ halt.onerror(err)
}
return
}
-func (z *ioDecReader) readn1() (b uint8) {
- b, err := z.ReadByte()
- if err == nil {
- z.n++
- if z.trb {
- z.tr = append(z.tr, b)
- }
- return
- }
- panic(err)
-}
-
-func (z *ioDecReader) skip(accept *bitset256) (token byte) {
- var eof bool
+func (z *ioDecReader) jsonReadNum() (bs []byte) {
+ z.unreadn1()
+ z.bufr = z.bufr[:0]
LOOP:
- token, eof = z.readn1eof()
- if eof {
- return
- }
- if accept.isset(token) {
- goto LOOP
- }
- return
-}
-
-func (z *ioDecReader) readTo(accept *bitset256) []byte {
- z.bufr = z.blist.check(z.bufr, 256)[:0]
-LOOP:
- token, eof := z.readn1eof()
+ i, eof := z.readn1eof()
if eof {
return z.bufr
}
- if accept.isset(token) {
- z.bufr = append(z.bufr, token)
+ if isNumberChar(i) {
+ z.bufr = append(z.bufr, i)
goto LOOP
}
z.unreadn1()
return z.bufr
}
-func (z *ioDecReader) readUntil(stop byte, includeLast bool) []byte {
- z.bufr = z.blist.check(z.bufr, 256)[:0]
+func (z *ioDecReader) jsonReadAsisChars() (bs []byte) {
+ z.bufr = z.bufr[:0]
LOOP:
- token, eof := z.readn1eof()
- if eof {
- panic(io.EOF)
+ i := z.readn1()
+ z.bufr = append(z.bufr, i)
+ if i == '"' || i == '\\' {
+ return z.bufr
}
+ goto LOOP
+}
+
+func (z *ioDecReader) skipWhitespace() (token byte) {
+LOOP:
+ token = z.readn1()
+ if isWhitespaceChar(token) {
+ goto LOOP
+ }
+ return
+}
+
+func (z *ioDecReader) readUntil(stop byte) []byte {
+ z.bufr = z.bufr[:0]
+LOOP:
+ token := z.readn1()
z.bufr = append(z.bufr, token)
if token == stop {
- if includeLast {
- return z.bufr
- }
return z.bufr[:len(z.bufr)-1]
}
goto LOOP
}
-//go:noinline
func (z *ioDecReader) unreadn1() {
err := z.UnreadByte()
- if err != nil {
- panic(err)
- }
+ halt.onerror(err)
z.n--
- if z.trb {
- if l := len(z.tr) - 1; l >= 0 {
- z.tr = z.tr[:l]
- }
- }
}
// ------------------------------------
@@ -316,32 +309,42 @@ func (z *bufioDecReader) reset(r io.Reader, bufsize int, blist *bytesFreelist) {
z.c = 0
if cap(z.buf) < bufsize {
z.buf = blist.get(bufsize)
+ } else {
+ z.buf = z.buf[:0]
}
- z.buf = z.buf[:0]
}
func (z *bufioDecReader) readb(p []byte) {
var n = uint(copy(p, z.buf[z.c:]))
z.n += n
z.c += n
- if len(p) == int(n) {
- if z.trb {
- z.tr = append(z.tr, p...)
- }
- } else {
- z.readbFill(p, n)
+ if len(p) != int(n) {
+ z.readbFill(p, n, true, false)
}
}
-func (z *bufioDecReader) readbFill(p0 []byte, n uint) {
+func readbFillHandleErr(err error, must, eof bool) (isEOF bool) {
+ if err == io.EOF {
+ isEOF = true
+ }
+ if must && !(eof && isEOF) {
+ halt.onerror(err)
+ }
+ return
+}
+
+func (z *bufioDecReader) readbFill(p0 []byte, n uint, must, eof bool) (isEOF bool, err error) {
// at this point, there's nothing in z.buf to read (z.buf is fully consumed)
- p := p0[n:]
+ var p []byte
+ if p0 != nil {
+ p = p0[n:]
+ }
var n2 uint
- var err error
if len(p) > cap(z.buf) {
- n2, err = decReadFull(z.r, p)
+ n2, err = readFull(z.r, p)
if err != nil {
- panic(err)
+ isEOF = readbFillHandleErr(err, must, eof)
+ return
}
n += n2
z.n += n2
@@ -349,74 +352,88 @@ func (z *bufioDecReader) readbFill(p0 []byte, n uint) {
z.buf = z.buf[:1]
z.buf[0] = p[len(p)-1]
z.c = 1
- if z.trb {
- z.tr = append(z.tr, p0[:n]...)
- }
return
}
// z.c is now 0, and len(p) <= cap(z.buf)
+ var n1 int
LOOP:
// for len(p) > 0 && z.err == nil {
+ z.buf = z.buf[0:cap(z.buf)]
+ n1, err = z.r.Read(z.buf)
+ n2 = uint(n1)
+ if n2 == 0 && err != nil {
+ isEOF = readbFillHandleErr(err, must, eof)
+ return
+ }
+ err = nil
+ z.buf = z.buf[:n2]
+ z.c = 0
if len(p) > 0 {
- z.buf = z.buf[0:cap(z.buf)]
- var n1 int
- n1, err = z.r.Read(z.buf)
- n2 = uint(n1)
- if n2 == 0 && err != nil {
- panic(err)
- }
- z.buf = z.buf[:n2]
n2 = uint(copy(p, z.buf))
z.c = n2
n += n2
z.n += n2
p = p[n2:]
- goto LOOP
+ if len(p) > 0 {
+ goto LOOP
+ }
+ if z.c == 0 {
+ z.buf = z.buf[:1]
+ z.buf[0] = p[len(p)-1]
+ z.c = 1
+ }
}
- if z.c == 0 {
- z.buf = z.buf[:1]
- z.buf[0] = p[len(p)-1]
- z.c = 1
- }
- if z.trb {
- z.tr = append(z.tr, p0[:n]...)
- }
-}
-
-func (z *bufioDecReader) last() byte {
- return z.buf[z.c-1]
+ return
}
func (z *bufioDecReader) readn1() (b byte) {
- // fast-path, so we elide calling into Read() most of the time
- if z.c < uint(len(z.buf)) {
- b = z.buf[z.c]
- z.c++
- z.n++
- if z.trb {
- z.tr = append(z.tr, b)
- }
- } else { // meaning z.c == len(z.buf) or greater ... so need to fill
- z.readbFill(z.b[:1], 0)
- b = z.b[0]
+ if z.c >= uint(len(z.buf)) {
+ z.readbFill(nil, 0, true, false)
}
+ b = z.buf[z.c]
+ z.c++
+ z.n++
+ return
+}
+
+func (z *bufioDecReader) readn1eof() (b byte, eof bool) {
+ if z.c >= uint(len(z.buf)) {
+ eof, _ = z.readbFill(nil, 0, true, true)
+ if eof {
+ return
+ }
+ }
+ b = z.buf[z.c]
+ z.c++
+ z.n++
return
}
func (z *bufioDecReader) unreadn1() {
if z.c == 0 {
- panic(errDecUnreadByteNothingToRead)
+ halt.onerror(errDecUnreadByteNothingToRead)
}
z.c--
z.n--
- if z.trb {
- z.tr = z.tr[:len(z.tr)-1]
- }
}
-func (z *bufioDecReader) readn(num uint8) (bs [rwNLen]byte) {
- z.readb(bs[:num])
- // copy(bs[:], z.readx(uint(num)))
+func (z *bufioDecReader) readn2() (bs [2]byte) {
+ z.readb(bs[:])
+ return
+}
+
+func (z *bufioDecReader) readn3() (bs [4]byte) {
+ z.readb(bs[1:])
+ return
+}
+
+func (z *bufioDecReader) readn4() (bs [4]byte) {
+ z.readb(bs[:])
+ return
+}
+
+func (z *bufioDecReader) readn8() (bs [8]byte) {
+ z.readb(bs[:])
return
}
@@ -427,136 +444,89 @@ func (z *bufioDecReader) readx(n uint) (bs []byte) {
bs = z.buf[z.c : z.c+n]
z.n += n
z.c += n
- if z.trb {
- z.tr = append(z.tr, bs...)
- }
} else {
bs = make([]byte, n)
// n no longer used - can reuse
n = uint(copy(bs, z.buf[z.c:]))
z.n += n
z.c += n
- z.readbFill(bs, n)
+ z.readbFill(bs, n, true, false)
}
return
}
-func (z *bufioDecReader) skip(accept *bitset256) (token byte) {
+func (z *bufioDecReader) jsonReadNum() (bs []byte) {
+ z.unreadn1()
+ z.bufr = z.bufr[:0]
+LOOP:
+ i, eof := z.readn1eof()
+ if eof {
+ return z.bufr
+ }
+ if isNumberChar(i) {
+ z.bufr = append(z.bufr, i)
+ goto LOOP
+ }
+ z.unreadn1()
+ return z.bufr
+}
+
+func (z *bufioDecReader) jsonReadAsisChars() (bs []byte) {
+ z.bufr = z.bufr[:0]
+LOOP:
+ i := z.readn1()
+ z.bufr = append(z.bufr, i)
+ if i == '"' || i == '\\' {
+ return z.bufr
+ }
+ goto LOOP
+}
+
+func (z *bufioDecReader) skipWhitespace() (token byte) {
i := z.c
LOOP:
if i < uint(len(z.buf)) {
// inline z.skipLoopFn(i) and refactor, so cost is within inline budget
token = z.buf[i]
i++
- if accept.isset(token) {
+ if isWhitespaceChar(token) {
goto LOOP
}
z.n += i - 2 - z.c
- if z.trb {
- z.tr = append(z.tr, z.buf[z.c:i]...) // z.doTrack(i)
- }
z.c = i
return
}
- return z.skipFill(accept)
+ return z.skipFillWhitespace()
}
-func (z *bufioDecReader) skipFill(accept *bitset256) (token byte) {
+func (z *bufioDecReader) skipFillWhitespace() (token byte) {
z.n += uint(len(z.buf)) - z.c
- if z.trb {
- z.tr = append(z.tr, z.buf[z.c:]...)
- }
var i, n2 int
var err error
for {
z.c = 0
z.buf = z.buf[0:cap(z.buf)]
n2, err = z.r.Read(z.buf)
- if n2 == 0 && err != nil {
- panic(err)
+ if n2 == 0 {
+ halt.onerror(err)
}
z.buf = z.buf[:n2]
for i, token = range z.buf {
- // if !accept.isset(token) {
- if accept.check(token) == 0 {
+ if !isWhitespaceChar(token) {
z.n += (uint(i) - z.c) - 1
z.loopFn(uint(i + 1))
return
}
}
z.n += uint(n2)
- if z.trb {
- z.tr = append(z.tr, z.buf...)
- }
}
}
func (z *bufioDecReader) loopFn(i uint) {
- if z.trb {
- z.tr = append(z.tr, z.buf[z.c:i]...) // z.doTrack(i)
- }
z.c = i
}
-func (z *bufioDecReader) readTo(accept *bitset256) (out []byte) {
- i := z.c
-LOOP:
- if i < uint(len(z.buf)) {
- // if !accept.isset(z.buf[i]) {
- if accept.check(z.buf[i]) == 0 {
- // inline readToLoopFn here (for performance)
- z.n += (i - z.c) - 1
- out = z.buf[z.c:i]
- if z.trb {
- z.tr = append(z.tr, z.buf[z.c:i]...) // z.doTrack(i)
- }
- z.c = i
- return
- }
- i++
- goto LOOP
- }
- return z.readToFill(accept)
-}
-
-func (z *bufioDecReader) readToFill(accept *bitset256) []byte {
- z.bufr = z.blist.check(z.bufr, 256)[:0]
- z.n += uint(len(z.buf)) - z.c
- z.bufr = append(z.bufr, z.buf[z.c:]...)
- if z.trb {
- z.tr = append(z.tr, z.buf[z.c:]...)
- }
- var n2 int
- var err error
- for {
- z.c = 0
- z.buf = z.buf[:cap(z.buf)]
- n2, err = z.r.Read(z.buf)
- if n2 == 0 && err != nil {
- if err == io.EOF {
- return z.bufr // readTo should read until it matches or end is reached
- }
- panic(err)
- }
- z.buf = z.buf[:n2]
- for i, token := range z.buf {
- // if !accept.isset(token) {
- if accept.check(token) == 0 {
- z.n += (uint(i) - z.c) - 1
- z.bufr = append(z.bufr, z.buf[z.c:i]...)
- z.loopFn(uint(i))
- return z.bufr
- }
- }
- z.bufr = append(z.bufr, z.buf...)
- z.n += uint(n2)
- if z.trb {
- z.tr = append(z.tr, z.buf...)
- }
- }
-}
-
-func (z *bufioDecReader) readUntil(stop byte, includeLast bool) (out []byte) {
+func (z *bufioDecReader) readUntil(stop byte) (out []byte) {
i := z.c
LOOP:
if i < uint(len(z.buf)) {
@@ -564,9 +534,6 @@ LOOP:
z.n += (i - z.c) - 1
i++
out = z.buf[z.c:i]
- if z.trb {
- z.tr = append(z.tr, z.buf[z.c:i]...) // z.doTrack(i)
- }
z.c = i
goto FINISH
}
@@ -575,25 +542,19 @@ LOOP:
}
out = z.readUntilFill(stop)
FINISH:
- if includeLast {
- return
- }
return out[:len(out)-1]
}
func (z *bufioDecReader) readUntilFill(stop byte) []byte {
- z.bufr = z.blist.check(z.bufr, 256)[:0]
+ z.bufr = z.bufr[:0]
z.n += uint(len(z.buf)) - z.c
z.bufr = append(z.bufr, z.buf[z.c:]...)
- if z.trb {
- z.tr = append(z.tr, z.buf[z.c:]...)
- }
for {
z.c = 0
z.buf = z.buf[0:cap(z.buf)]
n1, err := z.r.Read(z.buf)
- if n1 == 0 && err != nil {
- panic(err)
+ if n1 == 0 {
+ halt.onerror(err)
}
n2 := uint(n1)
z.buf = z.buf[:n2]
@@ -607,138 +568,149 @@ func (z *bufioDecReader) readUntilFill(stop byte) []byte {
}
z.bufr = append(z.bufr, z.buf...)
z.n += n2
- if z.trb {
- z.tr = append(z.tr, z.buf...)
- }
}
}
// ------------------------------------
// bytesDecReader is a decReader that reads off a byte slice with zero copying
+//
+// Note: we do not try to convert index'ing out of bounds to an io.EOF.
+// instead, we let it bubble up to the exported Encode/Decode method
+// and recover it as an io.EOF.
+//
+// see panicValToErr(...) function in helper.go.
type bytesDecReader struct {
b []byte // data
c uint // cursor
- t uint // track start
- // a int // available
}
func (z *bytesDecReader) reset(in []byte) {
- z.b = in
+ z.b = in[:len(in):len(in)] // reslicing must not go past capacity
z.c = 0
- z.t = 0
}
func (z *bytesDecReader) numread() uint {
return z.c
}
-func (z *bytesDecReader) last() byte {
- return z.b[z.c-1]
-}
-
-func (z *bytesDecReader) unreadn1() {
- if z.c == 0 || len(z.b) == 0 {
- panic(errBytesDecReaderCannotUnread)
- }
- z.c--
-}
+// Note: slicing from a non-constant start position is more expensive,
+// as more computation is required to decipher the pointer start position.
+// However, we do it only once, and it's better than reslicing both z.b and return value.
func (z *bytesDecReader) readx(n uint) (bs []byte) {
- // slicing from a non-constant start position is more expensive,
- // as more computation is required to decipher the pointer start position.
- // However, we do it only once, and it's better than reslicing both z.b and return value.
-
- z.c += n
- return z.b[z.c-n : z.c]
+ x := z.c + n
+ bs = z.b[z.c:x]
+ z.c = x
+ return
}
func (z *bytesDecReader) readb(bs []byte) {
copy(bs, z.readx(uint(len(bs))))
}
+// MARKER: do not use this - as it calls into memmove (as the size of data to move is unknown)
+// func (z *bytesDecReader) readnn(bs []byte, n uint) {
+// x := z.c
+// copy(bs, z.b[x:x+n])
+// z.c += n
+// }
+
+// func (z *bytesDecReader) readn(num uint8) (bs [8]byte) {
+// x := z.c + uint(num)
+// copy(bs[:], z.b[z.c:x]) // slice z.b completely, so we get bounds error if past
+// z.c = x
+// return
+// }
+
+// func (z *bytesDecReader) readn1() uint8 {
+// z.c++
+// return z.b[z.c-1]
+// }
+
func (z *bytesDecReader) readn1() (v uint8) {
v = z.b[z.c]
z.c++
return
}
-func (z *bytesDecReader) readn(num uint8) (bs [rwNLen]byte) {
- // if z.c >= uint(len(z.b)) || z.c+uint(num) >= uint(len(z.b)) {
- // panic(io.EOF)
- // }
+// MARKER: for readn{2,3,4,8}, ensure you slice z.b completely so we get bounds error if past end.
- // for bounds-check elimination, reslice z.b and ensure bs is within len
- // bb := z.b[z.c:][:num]
- bb := z.b[z.c : z.c+uint(num)]
- _ = bs[len(bb)-1]
- var i int
-LOOP:
- if i < len(bb) {
- bs[i] = bb[i]
- i++
- goto LOOP
- }
-
- z.c += uint(num)
+func (z *bytesDecReader) readn2() (bs [2]byte) {
+ // copy(bs[:], z.b[z.c:z.c+2])
+ bs[1] = z.b[z.c+1]
+ bs[0] = z.b[z.c]
+ z.c += 2
return
}
-func (z *bytesDecReader) skip(accept *bitset256) (token byte) {
+func (z *bytesDecReader) readn3() (bs [4]byte) {
+ // copy(bs[1:], z.b[z.c:z.c+3])
+ bs = okBytes3(z.b[z.c : z.c+3])
+ z.c += 3
+ return
+}
+
+func (z *bytesDecReader) readn4() (bs [4]byte) {
+ // copy(bs[:], z.b[z.c:z.c+4])
+ bs = okBytes4(z.b[z.c : z.c+4])
+ z.c += 4
+ return
+}
+
+func (z *bytesDecReader) readn8() (bs [8]byte) {
+ // copy(bs[:], z.b[z.c:z.c+8])
+ bs = okBytes8(z.b[z.c : z.c+8])
+ z.c += 8
+ return
+}
+
+func (z *bytesDecReader) jsonReadNum() []byte {
+ z.c--
i := z.c
LOOP:
- // if i < uint(len(z.b)) {
- token = z.b[i]
+ if i < uint(len(z.b)) && isNumberChar(z.b[i]) {
+ i++
+ goto LOOP
+ }
+ z.c, i = i, z.c
+ return z.b[i:z.c]
+}
+
+func (z *bytesDecReader) jsonReadAsisChars() []byte {
+ i := z.c
+LOOP:
+ token := z.b[i]
i++
- if accept.isset(token) {
+ if token == '"' || token == '\\' {
+ z.c, i = i, z.c
+ return z.b[i:z.c]
+ }
+ goto LOOP
+}
+
+func (z *bytesDecReader) skipWhitespace() (token byte) {
+ i := z.c
+LOOP:
+ token = z.b[i]
+ if isWhitespaceChar(token) {
+ i++
goto LOOP
}
- z.c = i
+ z.c = i + 1
return
}
-func (z *bytesDecReader) readTo(accept *bitset256) (out []byte) {
+func (z *bytesDecReader) readUntil(stop byte) (out []byte) {
i := z.c
LOOP:
- if i < uint(len(z.b)) {
- if accept.isset(z.b[i]) {
- i++
- goto LOOP
- }
- }
-
- out = z.b[z.c:i]
- z.c = i
- return // z.b[c:i]
-}
-
-func (z *bytesDecReader) readUntil(stop byte, includeLast bool) (out []byte) {
- i := z.c
-LOOP:
- // if i < uint(len(z.b)) {
if z.b[i] == stop {
- i++
- if includeLast {
- out = z.b[z.c:i]
- } else {
- out = z.b[z.c : i-1]
- }
- // z.a -= (i - z.c)
- z.c = i
+ out = z.b[z.c:i]
+ z.c = i + 1
return
}
i++
goto LOOP
- // }
- // panic(io.EOF)
-}
-
-func (z *bytesDecReader) track() {
- z.t = z.c
-}
-
-func (z *bytesDecReader) stopTrack() (bs []byte) {
- return z.b[z.t:z.c]
}
// --------------
@@ -758,10 +730,15 @@ type decRd struct {
rb bytesDecReader
ri *ioDecReader
bi *bufioDecReader
+
+ decReader
}
-// numread, track and stopTrack are always inlined, as they just check int fields, etc.
-
+// From out benchmarking, we see the following in terms of performance:
+//
+// - interface calls
+// - branch that can inline what it calls
+//
// the if/else-if/else block is expensive to inline.
// Each node of this construct costs a lot and dominates the budget.
// Best to only do an if fast-path else block (so fast-path is inlined).
@@ -779,6 +756,11 @@ type decRd struct {
// If golang inlining gets better and bytesDecReader methods can be inlined,
// then we can revert to using these 2 functions so the bytesDecReader
// methods are inlined and the IO paths call out to a function.
+//
+// decRd is designed to embed a decReader, and then re-implement some of the decReader
+// methods using a conditional branch. We only override the ones that have a bytes version
+// that is small enough to be inlined. We use ./run.sh -z to check.
+// Right now, only numread and readn1 can be inlined.
func (z *decRd) numread() uint {
if z.bytes {
@@ -789,183 +771,18 @@ func (z *decRd) numread() uint {
return z.ri.numread()
}
}
-func (z *decRd) stopTrack() []byte {
- if z.bytes {
- return z.rb.stopTrack()
- } else if z.bufio {
- return z.bi.stopTrack()
- } else {
- return z.ri.stopTrack()
- }
-}
-func (z *decRd) track() {
+func (z *decRd) readn1() (v uint8) {
if z.bytes {
- z.rb.track()
- } else if z.bufio {
- z.bi.track()
+ // MARKER: manually inline, else this function is not inlined.
+ // Keep in sync with bytesDecReader.readn1
+ // return z.rb.readn1()
+ v = z.rb.b[z.rb.c]
+ z.rb.c++
} else {
- z.ri.track()
+ v = z.readn1IO()
}
-}
-
-func (z *decRd) unreadn1() {
- if z.bytes {
- z.rb.unreadn1()
- } else if z.bufio {
- z.bi.unreadn1()
- } else {
- z.ri.unreadn1() // not inlined
- }
-}
-
-func (z *decRd) readn(num uint8) [rwNLen]byte {
- if z.bytes {
- return z.rb.readn(num)
- } else if z.bufio {
- return z.bi.readn(num)
- } else {
- return z.ri.readn(num)
- }
-}
-
-func (z *decRd) readx(n uint) []byte {
- if z.bytes {
- return z.rb.readx(n)
- } else if z.bufio {
- return z.bi.readx(n)
- } else {
- return z.ri.readx(n)
- }
-}
-
-func (z *decRd) readb(s []byte) {
- if z.bytes {
- z.rb.readb(s)
- } else if z.bufio {
- z.bi.readb(s)
- } else {
- z.ri.readb(s)
- }
-}
-
-func (z *decRd) readn1() uint8 {
- if z.bytes {
- return z.rb.readn1()
- } else if z.bufio {
- return z.bi.readn1()
- } else {
- return z.ri.readn1()
- }
-}
-
-func (z *decRd) skip(accept *bitset256) (token byte) {
- if z.bytes {
- return z.rb.skip(accept)
- } else if z.bufio {
- return z.bi.skip(accept)
- } else {
- return z.ri.skip(accept)
- }
-}
-
-func (z *decRd) readTo(accept *bitset256) (out []byte) {
- if z.bytes {
- return z.rb.readTo(accept)
- } else if z.bufio {
- return z.bi.readTo(accept)
- } else {
- return z.ri.readTo(accept)
- }
-}
-
-func (z *decRd) readUntil(stop byte, includeLast bool) (out []byte) {
- if z.bytes {
- return z.rb.readUntil(stop, includeLast)
- } else if z.bufio {
- return z.bi.readUntil(stop, includeLast)
- } else {
- return z.ri.readUntil(stop, includeLast)
- }
-}
-
-/*
-func (z *decRd) track() {
- if z.bytes {
- z.rb.track()
- } else {
- z.trackIO()
- }
-}
-func (z *decRd) trackIO() {
- if z.bufio {
- z.bi.track()
- } else {
- z.ri.track()
- }
-}
-
-func (z *decRd) unreadn1() {
- if z.bytes {
- z.rb.unreadn1()
- } else {
- z.unreadn1IO()
- }
-}
-func (z *decRd) unreadn1IO() {
- if z.bufio {
- z.bi.unreadn1()
- } else {
- z.ri.unreadn1()
- }
-}
-
-func (z *decRd) readn(num uint8) [rwNLen]byte {
- if z.bytes {
- return z.rb.readn(num)
- }
- return z.readnIO(num)
-}
-func (z *decRd) readnIO(num uint8) [rwNLen]byte {
- if z.bufio {
- return z.bi.readn(num)
- }
- return z.ri.readn(num)
-}
-
-func (z *decRd) readx(n uint) []byte {
- if z.bytes {
- return z.rb.readx(n)
- }
- return z.readxIO(n)
-}
-func (z *decRd) readxIO(n uint) []byte {
- if z.bufio {
- return z.bi.readx(n)
- }
- return z.ri.readx(n)
-}
-
-func (z *decRd) readb(s []byte) {
- if z.bytes {
- z.rb.readb(s)
- } else {
- z.readbIO(s)
- }
-}
-func (z *decRd) readbIO(s []byte) {
- if z.bufio {
- z.bi.readb(s)
- } else {
- z.ri.readb(s)
- }
-}
-
-func (z *decRd) readn1() uint8 {
- if z.bytes {
- return z.rb.readn1()
- }
- return z.readn1IO()
+ return
}
func (z *decRd) readn1IO() uint8 {
if z.bufio {
@@ -974,44 +791,26 @@ func (z *decRd) readn1IO() uint8 {
return z.ri.readn1()
}
-func (z *decRd) skip(accept *bitset256) (token byte) {
- if z.bytes {
- return z.rb.skip(accept)
- }
- return z.skipIO(accept)
-}
-func (z *decRd) skipIO(accept *bitset256) (token byte) {
- if z.bufio {
- return z.bi.skip(accept)
- }
- return z.ri.skip(accept)
-}
+type devNullReader struct{}
-func (z *decRd) readTo(accept *bitset256) (out []byte) {
- if z.bytes {
- return z.rb.readTo(accept)
- }
- return z.readToIO(accept)
-}
-func (z *decRd) readToIO(accept *bitset256) (out []byte) {
- if z.bufio {
- return z.bi.readTo(accept)
- }
- return z.ri.readTo(accept)
-}
+func (devNullReader) Read(p []byte) (int, error) { return 0, io.EOF }
+func (devNullReader) Close() error { return nil }
-func (z *decRd) readUntil(stop byte, includeLast bool) (out []byte) {
- if z.bytes {
- return z.rb.readUntil(stop, includeLast)
+func readFull(r io.Reader, bs []byte) (n uint, err error) {
+ var nn int
+ for n < uint(len(bs)) && err == nil {
+ nn, err = r.Read(bs[n:])
+ if nn > 0 {
+ if err == io.EOF {
+ // leave EOF for next time
+ err = nil
+ }
+ n += uint(nn)
+ }
}
- return z.readUntilIO(stop, includeLast)
+ // do not do this below - it serves no purpose
+ // if n != len(bs) && err == io.EOF { err = io.ErrUnexpectedEOF }
+ return
}
-func (z *decRd) readUntilIO(stop byte, includeLast bool) (out []byte) {
- if z.bufio {
- return z.bi.readUntil(stop, includeLast)
- }
- return z.ri.readUntil(stop, includeLast)
-}
-*/
var _ decReader = (*decRd)(nil)
diff --git a/vendor/github.com/ugorji/go/codec/register_ext.go b/vendor/github.com/ugorji/go/codec/register_ext.go
index 68b002cc8..65e455377 100644
--- a/vendor/github.com/ugorji/go/codec/register_ext.go
+++ b/vendor/github.com/ugorji/go/codec/register_ext.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
diff --git a/vendor/github.com/ugorji/go/codec/rpc.go b/vendor/github.com/ugorji/go/codec/rpc.go
index 8ee235876..cf72377c7 100644
--- a/vendor/github.com/ugorji/go/codec/rpc.go
+++ b/vendor/github.com/ugorji/go/codec/rpc.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
@@ -10,7 +10,12 @@ import (
"net/rpc"
)
-var errRpcJsonNeedsTermWhitespace = errors.New("rpc requires JsonHandle with TermWhitespace=true")
+var (
+ errRpcIsClosed = errors.New("rpc - connection has been closed")
+ errRpcNoConn = errors.New("rpc - no connection")
+
+ rpcSpaceArr = [1]byte{' '}
+)
// Rpc provides a rpc Server or Client Codec for rpc communication.
type Rpc interface {
@@ -37,40 +42,31 @@ type rpcCodec struct {
dec *Decoder
enc *Encoder
- // bw *bufio.Writer
- // br *bufio.Reader
- h Handle
+ h Handle
cls atomicClsErr
}
func newRPCCodec(conn io.ReadWriteCloser, h Handle) rpcCodec {
- // return newRPCCodec2(bufio.NewReader(conn), bufio.NewWriter(conn), conn, h)
return newRPCCodec2(conn, conn, conn, h)
}
func newRPCCodec2(r io.Reader, w io.Writer, c io.Closer, h Handle) rpcCodec {
- // defensive: ensure that jsonH has TermWhitespace turned on.
- if jsonH, ok := h.(*JsonHandle); ok && !jsonH.TermWhitespace {
- panic(errRpcJsonNeedsTermWhitespace)
- }
- // always ensure that we use a flusher, and always flush what was written to the connection.
- // we lose nothing by using a buffered writer internally.
+ bh := h.getBasicHandle()
+ // if the writer can flush, ensure we leverage it, else
+ // we may hang waiting on read if write isn't flushed.
+ // var f ioFlusher
f, ok := w.(ioFlusher)
- bh := basicHandle(h)
if !bh.RPCNoBuffer {
if bh.WriterBufferSize <= 0 {
- if !ok {
+ if !ok { // a flusher means there's already a buffer
bw := bufio.NewWriter(w)
f, w = bw, bw
}
}
if bh.ReaderBufferSize <= 0 {
- if _, ok = w.(ioPeeker); !ok {
- if _, ok = w.(ioBuffered); !ok {
- br := bufio.NewReader(r)
- r = br
- }
+ if _, ok = w.(ioBuffered); !ok {
+ r = bufio.NewReader(r)
}
}
}
@@ -85,63 +81,77 @@ func newRPCCodec2(r io.Reader, w io.Writer, c io.Closer, h Handle) rpcCodec {
}
}
-func (c *rpcCodec) write(obj1, obj2 interface{}, writeObj2 bool) (err error) {
- if c.c != nil {
- cls := c.cls.load()
- if cls.closed {
- return cls.errClosed
- }
- }
- err = c.enc.Encode(obj1)
- if err == nil {
- if writeObj2 {
- err = c.enc.Encode(obj2)
- }
+func (c *rpcCodec) write(obj ...interface{}) (err error) {
+ err = c.ready()
+ if err != nil {
+ return
}
if c.f != nil {
- if err == nil {
- err = c.f.Flush()
- } else {
- _ = c.f.Flush() // swallow flush error, so we maintain prior error on write
+ defer func() {
+ flushErr := c.f.Flush()
+ if flushErr != nil && err == nil {
+ err = flushErr
+ }
+ }()
+ }
+
+ for _, o := range obj {
+ err = c.enc.Encode(o)
+ if err != nil {
+ return
+ }
+ // defensive: ensure a space is always written after each encoding,
+ // in case the value was a number, and encoding a value right after
+ // without a space will lead to invalid output.
+ if c.h.isJson() {
+ _, err = c.w.Write(rpcSpaceArr[:])
+ if err != nil {
+ return
+ }
}
}
return
}
-func (c *rpcCodec) swallow(err *error) {
- defer panicToErr(c.dec, err)
- c.dec.swallow()
-}
-
func (c *rpcCodec) read(obj interface{}) (err error) {
- if c.c != nil {
- cls := c.cls.load()
- if cls.closed {
- return cls.errClosed
+ err = c.ready()
+ if err == nil {
+ //If nil is passed in, we should read and discard
+ if obj == nil {
+ // return c.dec.Decode(&obj)
+ err = c.dec.swallowErr()
+ } else {
+ err = c.dec.Decode(obj)
}
}
- //If nil is passed in, we should read and discard
- if obj == nil {
- // var obj2 interface{}
- // return c.dec.Decode(&obj2)
- c.swallow(&err)
- return
- }
- return c.dec.Decode(obj)
+ return
}
-func (c *rpcCodec) Close() error {
+func (c *rpcCodec) Close() (err error) {
+ if c.c != nil {
+ cls := c.cls.load()
+ if !cls.closed {
+ cls.err = c.c.Close()
+ cls.closed = true
+ c.cls.store(cls)
+ }
+ err = cls.err
+ }
+ return
+}
+
+func (c *rpcCodec) ready() (err error) {
if c.c == nil {
- return nil
+ err = errRpcNoConn
+ } else {
+ cls := c.cls.load()
+ if cls.closed {
+ if err = cls.err; err == nil {
+ err = errRpcIsClosed
+ }
+ }
}
- cls := c.cls.load()
- if cls.closed {
- return cls.errClosed
- }
- cls.errClosed = c.c.Close()
- cls.closed = true
- c.cls.store(cls)
- return cls.errClosed
+ return
}
func (c *rpcCodec) ReadResponseBody(body interface{}) error {
@@ -155,11 +165,11 @@ type goRpcCodec struct {
}
func (c *goRpcCodec) WriteRequest(r *rpc.Request, body interface{}) error {
- return c.write(r, body, true)
+ return c.write(r, body)
}
func (c *goRpcCodec) WriteResponse(r *rpc.Response, body interface{}) error {
- return c.write(r, body, true)
+ return c.write(r, body)
}
func (c *goRpcCodec) ReadResponseHeader(r *rpc.Response) error {
diff --git a/vendor/github.com/ugorji/go/codec/simple.go b/vendor/github.com/ugorji/go/codec/simple.go
index 42bfd042b..c3c09f1cf 100644
--- a/vendor/github.com/ugorji/go/codec/simple.go
+++ b/vendor/github.com/ugorji/go/codec/simple.go
@@ -1,10 +1,11 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
import (
"math"
+ "reflect"
"time"
)
@@ -30,12 +31,39 @@ const (
simpleVdExt = 248
)
+var simpledescNames = map[byte]string{
+ simpleVdNil: "null",
+ simpleVdFalse: "false",
+ simpleVdTrue: "true",
+ simpleVdFloat32: "float32",
+ simpleVdFloat64: "float64",
+
+ simpleVdPosInt: "+int",
+ simpleVdNegInt: "-int",
+
+ simpleVdTime: "time",
+
+ simpleVdString: "string",
+ simpleVdByteArray: "binary",
+ simpleVdArray: "array",
+ simpleVdMap: "map",
+ simpleVdExt: "ext",
+}
+
+func simpledesc(bd byte) (s string) {
+ s = simpledescNames[bd]
+ if s == "" {
+ s = "unknown"
+ }
+ return
+}
+
type simpleEncDriver struct {
noBuiltInTypes
encDriverNoopContainerWriter
+ encDriverNoState
h *SimpleHandle
- b [8]byte
- _ [6]uint64 // padding (cache-aligned)
+ // b [8]byte
e Encoder
}
@@ -65,7 +93,7 @@ func (e *simpleEncDriver) EncodeFloat32(f float32) {
return
}
e.e.encWr.writen1(simpleVdFloat32)
- bigenHelper{e.b[:4], e.e.w()}.writeUint32(math.Float32bits(f))
+ bigen.writeUint32(e.e.w(), math.Float32bits(f))
}
func (e *simpleEncDriver) EncodeFloat64(f float64) {
@@ -74,7 +102,7 @@ func (e *simpleEncDriver) EncodeFloat64(f float64) {
return
}
e.e.encWr.writen1(simpleVdFloat64)
- bigenHelper{e.b[:8], e.e.w()}.writeUint64(math.Float64bits(f))
+ bigen.writeUint64(e.e.w(), math.Float64bits(f))
}
func (e *simpleEncDriver) EncodeInt(v int64) {
@@ -98,13 +126,13 @@ func (e *simpleEncDriver) encUint(v uint64, bd uint8) {
e.e.encWr.writen2(bd, uint8(v))
} else if v <= math.MaxUint16 {
e.e.encWr.writen1(bd + 1)
- bigenHelper{e.b[:2], e.e.w()}.writeUint16(uint16(v))
+ bigen.writeUint16(e.e.w(), uint16(v))
} else if v <= math.MaxUint32 {
e.e.encWr.writen1(bd + 2)
- bigenHelper{e.b[:4], e.e.w()}.writeUint32(uint32(v))
+ bigen.writeUint32(e.e.w(), uint32(v))
} else { // if v <= math.MaxUint64 {
e.e.encWr.writen1(bd + 3)
- bigenHelper{e.b[:8], e.e.w()}.writeUint64(v)
+ bigen.writeUint64(e.e.w(), v)
}
}
@@ -116,32 +144,37 @@ func (e *simpleEncDriver) encLen(bd byte, length int) {
e.e.encWr.writen1(uint8(length))
} else if length <= math.MaxUint16 {
e.e.encWr.writen1(bd + 2)
- bigenHelper{e.b[:2], e.e.w()}.writeUint16(uint16(length))
+ bigen.writeUint16(e.e.w(), uint16(length))
} else if int64(length) <= math.MaxUint32 {
e.e.encWr.writen1(bd + 3)
- bigenHelper{e.b[:4], e.e.w()}.writeUint32(uint32(length))
+ bigen.writeUint32(e.e.w(), uint32(length))
} else {
e.e.encWr.writen1(bd + 4)
- bigenHelper{e.b[:8], e.e.w()}.writeUint64(uint64(length))
+ bigen.writeUint64(e.e.w(), uint64(length))
}
}
-func (e *simpleEncDriver) EncodeExt(v interface{}, xtag uint64, ext Ext) {
- var bs []byte
+func (e *simpleEncDriver) EncodeExt(v interface{}, basetype reflect.Type, xtag uint64, ext Ext) {
+ var bs0, bs []byte
if ext == SelfExt {
- bs = e.e.blist.get(1024)[:0]
- e.e.sideEncode(v, &bs)
+ bs0 = e.e.blist.get(1024)
+ bs = bs0
+ e.e.sideEncode(v, basetype, &bs)
} else {
bs = ext.WriteExt(v)
}
if bs == nil {
e.EncodeNil()
- return
+ goto END
}
e.encodeExtPreamble(uint8(xtag), len(bs))
e.e.encWr.writeb(bs)
+END:
if ext == SelfExt {
e.e.blist.put(bs)
+ if !byteSliceSameData(bs0, bs) {
+ e.e.blist.put(bs0)
+ }
}
}
@@ -193,11 +226,7 @@ func (e *simpleEncDriver) EncodeTime(t time.Time) {
return
}
v, err := t.MarshalBinary()
- if err != nil {
- e.e.errorv(err)
- return
- }
- // time.Time marshalbinary takes about 14 bytes.
+ e.e.onerror(err)
e.e.encWr.writen2(simpleVdTime, uint8(len(v)))
e.e.encWr.writeb(v)
}
@@ -205,13 +234,12 @@ func (e *simpleEncDriver) EncodeTime(t time.Time) {
//------------------------------------
type simpleDecDriver struct {
- h *SimpleHandle
- bdRead bool
- bd byte
- fnil bool
+ h *SimpleHandle
+ bdAndBdread
+ _ bool
noBuiltInTypes
decDriverNoopContainerReader
- _ [6]uint64 // padding
+ decDriverNoopNumberHelper
d Decoder
}
@@ -219,44 +247,33 @@ func (d *simpleDecDriver) decoder() *Decoder {
return &d.d
}
+func (d *simpleDecDriver) descBd() string {
+ return sprintf("%v (%s)", d.bd, simpledesc(d.bd))
+}
+
func (d *simpleDecDriver) readNextBd() {
d.bd = d.d.decRd.readn1()
d.bdRead = true
}
-func (d *simpleDecDriver) uncacheRead() {
- if d.bdRead {
- d.d.decRd.unreadn1()
- d.bdRead = false
- }
-}
-
func (d *simpleDecDriver) advanceNil() (null bool) {
- d.fnil = false
if !d.bdRead {
d.readNextBd()
}
if d.bd == simpleVdNil {
d.bdRead = false
- d.fnil = true
- null = true
+ return true // null = true
}
return
}
-func (d *simpleDecDriver) Nil() bool {
- return d.fnil
-}
-
func (d *simpleDecDriver) ContainerType() (vt valueType) {
if !d.bdRead {
d.readNextBd()
}
- d.fnil = false
switch d.bd {
case simpleVdNil:
d.bdRead = false
- d.fnil = true
return valueTypeNil
case simpleVdByteArray, simpleVdByteArray + 1,
simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4:
@@ -278,31 +295,45 @@ func (d *simpleDecDriver) TryNil() bool {
return d.advanceNil()
}
-func (d *simpleDecDriver) decCheckInteger() (ui uint64, neg bool) {
+func (d *simpleDecDriver) decFloat() (f float64, ok bool) {
+ ok = true
+ switch d.bd {
+ case simpleVdFloat32:
+ f = float64(math.Float32frombits(bigen.Uint32(d.d.decRd.readn4())))
+ case simpleVdFloat64:
+ f = math.Float64frombits(bigen.Uint64(d.d.decRd.readn8()))
+ default:
+ ok = false
+ }
+ return
+}
+
+func (d *simpleDecDriver) decInteger() (ui uint64, neg, ok bool) {
+ ok = true
switch d.bd {
case simpleVdPosInt:
ui = uint64(d.d.decRd.readn1())
case simpleVdPosInt + 1:
- ui = uint64(bigen.Uint16(d.d.decRd.readx(2)))
+ ui = uint64(bigen.Uint16(d.d.decRd.readn2()))
case simpleVdPosInt + 2:
- ui = uint64(bigen.Uint32(d.d.decRd.readx(4)))
+ ui = uint64(bigen.Uint32(d.d.decRd.readn4()))
case simpleVdPosInt + 3:
- ui = uint64(bigen.Uint64(d.d.decRd.readx(8)))
+ ui = uint64(bigen.Uint64(d.d.decRd.readn8()))
case simpleVdNegInt:
ui = uint64(d.d.decRd.readn1())
neg = true
case simpleVdNegInt + 1:
- ui = uint64(bigen.Uint16(d.d.decRd.readx(2)))
+ ui = uint64(bigen.Uint16(d.d.decRd.readn2()))
neg = true
case simpleVdNegInt + 2:
- ui = uint64(bigen.Uint32(d.d.decRd.readx(4)))
+ ui = uint64(bigen.Uint32(d.d.decRd.readn4()))
neg = true
case simpleVdNegInt + 3:
- ui = uint64(bigen.Uint64(d.d.decRd.readx(8)))
+ ui = uint64(bigen.Uint64(d.d.decRd.readn8()))
neg = true
default:
- d.d.errorf("integer only valid from pos/neg integer1..8. Invalid descriptor: %v", d.bd)
- return
+ ok = false
+ // d.d.errorf("integer only valid from pos/neg integer1..8. Invalid descriptor: %v", d.bd)
}
// DO NOT do this check below, because callers may only want the unsigned value:
//
@@ -317,11 +348,7 @@ func (d *simpleDecDriver) DecodeInt64() (i int64) {
if d.advanceNil() {
return
}
- ui, neg := d.decCheckInteger()
- i = chkOvf.SignedIntV(ui)
- if neg {
- i = -i
- }
+ i = decNegintPosintFloatNumberHelper{&d.d}.int64(d.decInteger())
d.bdRead = false
return
}
@@ -330,11 +357,7 @@ func (d *simpleDecDriver) DecodeUint64() (ui uint64) {
if d.advanceNil() {
return
}
- ui, neg := d.decCheckInteger()
- if neg {
- d.d.errorf("assigning negative signed value to unsigned type")
- return
- }
+ ui = decNegintPosintFloatNumberHelper{&d.d}.uint64(d.decInteger())
d.bdRead = false
return
}
@@ -343,18 +366,7 @@ func (d *simpleDecDriver) DecodeFloat64() (f float64) {
if d.advanceNil() {
return
}
- if d.bd == simpleVdFloat32 {
- f = float64(math.Float32frombits(bigen.Uint32(d.d.decRd.readx(4))))
- } else if d.bd == simpleVdFloat64 {
- f = math.Float64frombits(bigen.Uint64(d.d.decRd.readx(8)))
- } else {
- if d.bd >= simpleVdPosInt && d.bd <= simpleVdNegInt+3 {
- f = float64(d.DecodeInt64())
- } else {
- d.d.errorf("float only valid from float32/64: Invalid descriptor: %v", d.bd)
- return
- }
- }
+ f = decNegintPosintFloatNumberHelper{&d.d}.float64(d.decFloat())
d.bdRead = false
return
}
@@ -369,7 +381,6 @@ func (d *simpleDecDriver) DecodeBool() (b bool) {
b = true
} else {
d.d.errorf("cannot decode bool - %s: %x", msgBadDesc, d.bd)
- return
}
d.bdRead = false
return
@@ -377,7 +388,7 @@ func (d *simpleDecDriver) DecodeBool() (b bool) {
func (d *simpleDecDriver) ReadMapStart() (length int) {
if d.advanceNil() {
- return decContainerLenNil
+ return containerLenNil
}
d.bdRead = false
return d.decLen()
@@ -385,55 +396,56 @@ func (d *simpleDecDriver) ReadMapStart() (length int) {
func (d *simpleDecDriver) ReadArrayStart() (length int) {
if d.advanceNil() {
- return decContainerLenNil
+ return containerLenNil
}
d.bdRead = false
return d.decLen()
}
+func (d *simpleDecDriver) uint2Len(ui uint64) int {
+ if chkOvf.Uint(ui, intBitsize) {
+ d.d.errorf("overflow integer: %v", ui)
+ }
+ return int(ui)
+}
+
func (d *simpleDecDriver) decLen() int {
- switch d.bd % 8 {
+ switch d.bd & 7 { // d.bd % 8 {
case 0:
return 0
case 1:
return int(d.d.decRd.readn1())
case 2:
- return int(bigen.Uint16(d.d.decRd.readx(2)))
+ return int(bigen.Uint16(d.d.decRd.readn2()))
case 3:
- ui := uint64(bigen.Uint32(d.d.decRd.readx(4)))
- if chkOvf.Uint(ui, intBitsize) {
- d.d.errorf("overflow integer: %v", ui)
- return 0
- }
- return int(ui)
+ return d.uint2Len(uint64(bigen.Uint32(d.d.decRd.readn4())))
case 4:
- ui := bigen.Uint64(d.d.decRd.readx(8))
- if chkOvf.Uint(ui, intBitsize) {
- d.d.errorf("overflow integer: %v", ui)
- return 0
- }
- return int(ui)
+ return d.uint2Len(bigen.Uint64(d.d.decRd.readn8()))
}
d.d.errorf("cannot read length: bd%%8 must be in range 0..4. Got: %d", d.bd%8)
return -1
}
func (d *simpleDecDriver) DecodeStringAsBytes() (s []byte) {
- return d.DecodeBytes(d.d.b[:], true)
+ return d.DecodeBytes(nil)
}
-func (d *simpleDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) {
+func (d *simpleDecDriver) DecodeBytes(bs []byte) (bsOut []byte) {
+ d.d.decByteState = decByteStateNone
if d.advanceNil() {
return
}
// check if an "array" of uint8's (see ContainerType for how to infer if an array)
if d.bd >= simpleVdArray && d.bd <= simpleVdMap+4 {
- if len(bs) == 0 && zerocopy {
+ if bs == nil {
+ d.d.decByteState = decByteStateReuseBuf
bs = d.d.b[:]
}
- // bsOut, _ = fastpathTV.DecSliceUint8V(bs, true, d.d)
slen := d.ReadArrayStart()
- bs = usableByteSlice(bs, slen)
+ var changed bool
+ if bs, changed = usableByteSlice(bs, slen); changed {
+ d.d.decByteState = decByteStateNone
+ }
for i := 0; i < len(bs); i++ {
bs[i] = uint8(chkOvf.UintV(d.DecodeUint64(), 8))
}
@@ -442,12 +454,13 @@ func (d *simpleDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) {
clen := d.decLen()
d.bdRead = false
- if zerocopy {
- if d.d.bytes {
- return d.d.decRd.readx(uint(clen))
- } else if len(bs) == 0 {
- bs = d.d.b[:]
- }
+ if d.d.zerocopy() {
+ d.d.decByteState = decByteStateZerocopy
+ return d.d.decRd.rb.readx(uint(clen))
+ }
+ if bs == nil {
+ d.d.decByteState = decByteStateReuseBuf
+ bs = d.d.b[:]
}
return decByteSlice(d.d.r(), clen, d.d.h.MaxInitLen, bs)
}
@@ -458,58 +471,53 @@ func (d *simpleDecDriver) DecodeTime() (t time.Time) {
}
if d.bd != simpleVdTime {
d.d.errorf("invalid descriptor for time.Time - expect 0x%x, received 0x%x", simpleVdTime, d.bd)
- return
}
d.bdRead = false
- clen := int(d.d.decRd.readn1())
- b := d.d.decRd.readx(uint(clen))
- if err := (&t).UnmarshalBinary(b); err != nil {
- d.d.errorv(err)
- }
+ clen := uint(d.d.decRd.readn1())
+ b := d.d.decRd.readx(clen)
+ d.d.onerror((&t).UnmarshalBinary(b))
return
}
-func (d *simpleDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) {
+func (d *simpleDecDriver) DecodeExt(rv interface{}, basetype reflect.Type, xtag uint64, ext Ext) {
if xtag > 0xff {
d.d.errorf("ext: tag must be <= 0xff; got: %v", xtag)
- return
}
if d.advanceNil() {
return
}
- realxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag))
+ xbs, realxtag1, zerocopy := d.decodeExtV(ext != nil, uint8(xtag))
realxtag := uint64(realxtag1)
if ext == nil {
re := rv.(*RawExt)
re.Tag = realxtag
- re.Data = detachZeroCopyBytes(d.d.bytes, re.Data, xbs)
+ re.setData(xbs, zerocopy)
} else if ext == SelfExt {
- d.d.sideDecode(rv, xbs)
+ d.d.sideDecode(rv, basetype, xbs)
} else {
ext.ReadExt(rv, xbs)
}
}
-func (d *simpleDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []byte) {
+func (d *simpleDecDriver) decodeExtV(verifyTag bool, tag byte) (xbs []byte, xtag byte, zerocopy bool) {
switch d.bd {
case simpleVdExt, simpleVdExt + 1, simpleVdExt + 2, simpleVdExt + 3, simpleVdExt + 4:
l := d.decLen()
xtag = d.d.decRd.readn1()
if verifyTag && xtag != tag {
d.d.errorf("wrong extension tag. Got %b. Expecting: %v", xtag, tag)
- return
}
if d.d.bytes {
- xbs = d.d.decRd.readx(uint(l))
+ xbs = d.d.decRd.rb.readx(uint(l))
+ zerocopy = true
} else {
xbs = decByteSlice(d.d.r(), l, d.d.h.MaxInitLen, d.d.b[:])
}
case simpleVdByteArray, simpleVdByteArray + 1,
simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4:
- xbs = d.DecodeBytes(nil, true)
+ xbs = d.DecodeBytes(nil)
default:
d.d.errorf("ext - %s - expecting extensions/bytearray, got: 0x%x", msgBadDesc, d.bd)
- return
}
d.bdRead = false
return
@@ -520,14 +528,12 @@ func (d *simpleDecDriver) DecodeNaked() {
d.readNextBd()
}
- d.fnil = false
n := d.d.naked()
var decodeFurther bool
switch d.bd {
case simpleVdNil:
n.v = valueTypeNil
- d.fnil = true
case simpleVdFalse:
n.v = valueTypeBool
n.b = false
@@ -557,16 +563,16 @@ func (d *simpleDecDriver) DecodeNaked() {
case simpleVdString, simpleVdString + 1,
simpleVdString + 2, simpleVdString + 3, simpleVdString + 4:
n.v = valueTypeString
- n.s = string(d.DecodeStringAsBytes())
+ n.s = d.d.stringZC(d.DecodeStringAsBytes())
case simpleVdByteArray, simpleVdByteArray + 1,
simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4:
- decNakedReadRawBytes(d, &d.d, n, d.h.RawToString)
+ d.d.fauxUnionReadRawBytes(false)
case simpleVdExt, simpleVdExt + 1, simpleVdExt + 2, simpleVdExt + 3, simpleVdExt + 4:
n.v = valueTypeExt
l := d.decLen()
n.u = uint64(d.d.decRd.readn1())
if d.d.bytes {
- n.l = d.d.decRd.readx(uint(l))
+ n.l = d.d.decRd.rb.readx(uint(l))
} else {
n.l = decByteSlice(d.d.r(), l, d.d.h.MaxInitLen, d.d.b[:])
}
@@ -586,6 +592,108 @@ func (d *simpleDecDriver) DecodeNaked() {
}
}
+func (d *simpleDecDriver) nextValueBytes(v0 []byte) (v []byte) {
+ if !d.bdRead {
+ d.readNextBd()
+ }
+ v = v0
+ var h = decNextValueBytesHelper{d: &d.d}
+ var cursor = d.d.rb.c - 1
+ h.append1(&v, d.bd)
+ v = d.nextValueBytesBdReadR(v)
+ d.bdRead = false
+ h.bytesRdV(&v, cursor)
+ return
+}
+
+func (d *simpleDecDriver) nextValueBytesR(v0 []byte) (v []byte) {
+ d.readNextBd()
+ v = v0
+ var h = decNextValueBytesHelper{d: &d.d}
+ h.append1(&v, d.bd)
+ return d.nextValueBytesBdReadR(v)
+}
+
+func (d *simpleDecDriver) nextValueBytesBdReadR(v0 []byte) (v []byte) {
+ v = v0
+ var h = decNextValueBytesHelper{d: &d.d}
+
+ c := d.bd
+
+ var length uint
+
+ switch c {
+ case simpleVdNil, simpleVdFalse, simpleVdTrue, simpleVdString, simpleVdByteArray:
+ // pass
+ case simpleVdPosInt, simpleVdNegInt:
+ h.append1(&v, d.d.decRd.readn1())
+ case simpleVdPosInt + 1, simpleVdNegInt + 1:
+ h.appendN(&v, d.d.decRd.readx(2)...)
+ case simpleVdPosInt + 2, simpleVdNegInt + 2, simpleVdFloat32:
+ h.appendN(&v, d.d.decRd.readx(4)...)
+ case simpleVdPosInt + 3, simpleVdNegInt + 3, simpleVdFloat64:
+ h.appendN(&v, d.d.decRd.readx(8)...)
+ case simpleVdTime:
+ c = d.d.decRd.readn1()
+ h.append1(&v, c)
+ h.appendN(&v, d.d.decRd.readx(uint(c))...)
+
+ default:
+ switch c & 7 { // c % 8 {
+ case 0:
+ length = 0
+ case 1:
+ b := d.d.decRd.readn1()
+ length = uint(b)
+ h.append1(&v, b)
+ case 2:
+ x := d.d.decRd.readn2()
+ length = uint(bigen.Uint16(x))
+ h.appendN(&v, x[:]...)
+ case 3:
+ x := d.d.decRd.readn4()
+ length = uint(bigen.Uint32(x))
+ h.appendN(&v, x[:]...)
+ case 4:
+ x := d.d.decRd.readn8()
+ length = uint(bigen.Uint64(x))
+ h.appendN(&v, x[:]...)
+ }
+
+ bExt := c >= simpleVdExt && c <= simpleVdExt+7
+ bStr := c >= simpleVdString && c <= simpleVdString+7
+ bByteArray := c >= simpleVdByteArray && c <= simpleVdByteArray+7
+ bArray := c >= simpleVdArray && c <= simpleVdArray+7
+ bMap := c >= simpleVdMap && c <= simpleVdMap+7
+
+ if !(bExt || bStr || bByteArray || bArray || bMap) {
+ d.d.errorf("cannot infer value - %s 0x%x", msgBadDesc, c)
+ }
+
+ if bExt {
+ h.append1(&v, d.d.decRd.readn1()) // tag
+ }
+
+ if length == 0 {
+ break
+ }
+
+ if bArray {
+ for i := uint(0); i < length; i++ {
+ v = d.nextValueBytesR(v)
+ }
+ } else if bMap {
+ for i := uint(0); i < length; i++ {
+ v = d.nextValueBytesR(v)
+ v = d.nextValueBytesR(v)
+ }
+ } else {
+ h.appendN(&v, d.d.decRd.readx(length)...)
+ }
+ }
+ return
+}
+
//------------------------------------
// SimpleHandle is a Handle for a very simple encoding format.
@@ -612,13 +720,13 @@ type SimpleHandle struct {
BasicHandle
// EncZeroValuesAsNil says to encode zero values for numbers, bool, string, etc as nil
EncZeroValuesAsNil bool
-
- _ [7]uint64 // padding (cache-aligned)
}
// Name returns the name of the handle: simple
func (h *SimpleHandle) Name() string { return "simple" }
+func (h *SimpleHandle) desc(bd byte) string { return simpledesc(bd) }
+
func (h *SimpleHandle) newEncDriver() encDriver {
var e = &simpleEncDriver{h: h}
e.e.e = e
@@ -635,13 +743,5 @@ func (h *SimpleHandle) newDecDriver() decDriver {
return d
}
-func (e *simpleEncDriver) reset() {
-}
-
-func (d *simpleDecDriver) reset() {
- d.bd, d.bdRead = 0, false
- d.fnil = false
-}
-
var _ decDriver = (*simpleDecDriver)(nil)
var _ encDriver = (*simpleEncDriver)(nil)
diff --git a/vendor/github.com/ugorji/go/codec/sort-slice.generated.go b/vendor/github.com/ugorji/go/codec/sort-slice.generated.go
index 352ddfbd8..0c43bdaae 100644
--- a/vendor/github.com/ugorji/go/codec/sort-slice.generated.go
+++ b/vendor/github.com/ugorji/go/codec/sort-slice.generated.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
// Code generated from sort-slice.go.tmpl - DO NOT EDIT.
@@ -17,12 +17,12 @@ func (p stringSlice) Less(i, j int) bool {
return p[uint(i)] < p[uint(j)]
}
-type float64Slice []float64
+type uint8Slice []uint8
-func (p float64Slice) Len() int { return len(p) }
-func (p float64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-func (p float64Slice) Less(i, j int) bool {
- return p[uint(i)] < p[uint(j)] || isNaN64(p[uint(i)]) && !isNaN64(p[uint(j)])
+func (p uint8Slice) Len() int { return len(p) }
+func (p uint8Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p uint8Slice) Less(i, j int) bool {
+ return p[uint(i)] < p[uint(j)]
}
type uint64Slice []uint64
@@ -33,46 +33,22 @@ func (p uint64Slice) Less(i, j int) bool {
return p[uint(i)] < p[uint(j)]
}
-type uintptrSlice []uintptr
+type intSlice []int
-func (p uintptrSlice) Len() int { return len(p) }
-func (p uintptrSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-func (p uintptrSlice) Less(i, j int) bool {
+func (p intSlice) Len() int { return len(p) }
+func (p intSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p intSlice) Less(i, j int) bool {
return p[uint(i)] < p[uint(j)]
}
-type int64Slice []int64
+type int32Slice []int32
-func (p int64Slice) Len() int { return len(p) }
-func (p int64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-func (p int64Slice) Less(i, j int) bool {
+func (p int32Slice) Len() int { return len(p) }
+func (p int32Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p int32Slice) Less(i, j int) bool {
return p[uint(i)] < p[uint(j)]
}
-type boolSlice []bool
-
-func (p boolSlice) Len() int { return len(p) }
-func (p boolSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-func (p boolSlice) Less(i, j int) bool {
- return !p[uint(i)] && p[uint(j)]
-}
-
-type timeSlice []time.Time
-
-func (p timeSlice) Len() int { return len(p) }
-func (p timeSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-func (p timeSlice) Less(i, j int) bool {
- return p[uint(i)].Before(p[uint(j)])
-}
-
-type bytesSlice [][]byte
-
-func (p bytesSlice) Len() int { return len(p) }
-func (p bytesSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-func (p bytesSlice) Less(i, j int) bool {
- return bytes.Compare(p[uint(i)], p[uint(j)]) == -1
-}
-
type stringRv struct {
v string
r reflect.Value
@@ -109,18 +85,6 @@ func (p float64RvSlice) Less(i, j int) bool {
return p[uint(i)].v < p[uint(j)].v || isNaN64(p[uint(i)].v) && !isNaN64(p[uint(j)].v)
}
-type float64Intf struct {
- v float64
- i interface{}
-}
-type float64IntfSlice []float64Intf
-
-func (p float64IntfSlice) Len() int { return len(p) }
-func (p float64IntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-func (p float64IntfSlice) Less(i, j int) bool {
- return p[uint(i)].v < p[uint(j)].v || isNaN64(p[uint(i)].v) && !isNaN64(p[uint(j)].v)
-}
-
type uint64Rv struct {
v uint64
r reflect.Value
@@ -133,42 +97,6 @@ func (p uint64RvSlice) Less(i, j int) bool {
return p[uint(i)].v < p[uint(j)].v
}
-type uint64Intf struct {
- v uint64
- i interface{}
-}
-type uint64IntfSlice []uint64Intf
-
-func (p uint64IntfSlice) Len() int { return len(p) }
-func (p uint64IntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-func (p uint64IntfSlice) Less(i, j int) bool {
- return p[uint(i)].v < p[uint(j)].v
-}
-
-type uintptrRv struct {
- v uintptr
- r reflect.Value
-}
-type uintptrRvSlice []uintptrRv
-
-func (p uintptrRvSlice) Len() int { return len(p) }
-func (p uintptrRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-func (p uintptrRvSlice) Less(i, j int) bool {
- return p[uint(i)].v < p[uint(j)].v
-}
-
-type uintptrIntf struct {
- v uintptr
- i interface{}
-}
-type uintptrIntfSlice []uintptrIntf
-
-func (p uintptrIntfSlice) Len() int { return len(p) }
-func (p uintptrIntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-func (p uintptrIntfSlice) Less(i, j int) bool {
- return p[uint(i)].v < p[uint(j)].v
-}
-
type int64Rv struct {
v int64
r reflect.Value
@@ -181,18 +109,6 @@ func (p int64RvSlice) Less(i, j int) bool {
return p[uint(i)].v < p[uint(j)].v
}
-type int64Intf struct {
- v int64
- i interface{}
-}
-type int64IntfSlice []int64Intf
-
-func (p int64IntfSlice) Len() int { return len(p) }
-func (p int64IntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-func (p int64IntfSlice) Less(i, j int) bool {
- return p[uint(i)].v < p[uint(j)].v
-}
-
type boolRv struct {
v bool
r reflect.Value
@@ -205,18 +121,6 @@ func (p boolRvSlice) Less(i, j int) bool {
return !p[uint(i)].v && p[uint(j)].v
}
-type boolIntf struct {
- v bool
- i interface{}
-}
-type boolIntfSlice []boolIntf
-
-func (p boolIntfSlice) Len() int { return len(p) }
-func (p boolIntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-func (p boolIntfSlice) Less(i, j int) bool {
- return !p[uint(i)].v && p[uint(j)].v
-}
-
type timeRv struct {
v time.Time
r reflect.Value
@@ -229,18 +133,6 @@ func (p timeRvSlice) Less(i, j int) bool {
return p[uint(i)].v.Before(p[uint(j)].v)
}
-type timeIntf struct {
- v time.Time
- i interface{}
-}
-type timeIntfSlice []timeIntf
-
-func (p timeIntfSlice) Len() int { return len(p) }
-func (p timeIntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-func (p timeIntfSlice) Less(i, j int) bool {
- return p[uint(i)].v.Before(p[uint(j)].v)
-}
-
type bytesRv struct {
v []byte
r reflect.Value
diff --git a/vendor/github.com/ugorji/go/codec/sort-slice.go.tmpl b/vendor/github.com/ugorji/go/codec/sort-slice.go.tmpl
index 95d348c9a..81bf4b488 100644
--- a/vendor/github.com/ugorji/go/codec/sort-slice.go.tmpl
+++ b/vendor/github.com/ugorji/go/codec/sort-slice.go.tmpl
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
// Code generated from sort-slice.go.tmpl - DO NOT EDIT.
@@ -54,11 +54,13 @@ type {{ $v }}Rv struct {
type {{ $v }}RvSlice []{{ $v }}Rv
{{template "T" args "Kind" $v "Type" (print $v "RvSlice") "V" ".v"}}
+{{if eq $v "bytes" "string" -}}
type {{ $v }}Intf struct {
v {{ $t }}
i interface{}
}
type {{ $v }}IntfSlice []{{ $v }}Intf
{{template "T" args "Kind" $v "Type" (print $v "IntfSlice") "V" ".v"}}
+{{end}}
{{end}}
diff --git a/vendor/github.com/ugorji/go/codec/test.py b/vendor/github.com/ugorji/go/codec/test.py
index 800376f68..f00ff5946 100644
--- a/vendor/github.com/ugorji/go/codec/test.py
+++ b/vendor/github.com/ugorji/go/codec/test.py
@@ -5,14 +5,17 @@
# 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
+# sudo apt install python-dev (may not be necessary)
+# sudo apt install python-pip # or python3-pip
# pip install --user msgpack-python msgpack-rpc-python cbor
# Ensure all "string" keys are utf strings (else encoded as bytes)
+from __future__ import print_function
import cbor, msgpack, msgpackrpc, sys, os, threading
+mylocaladdr="127.0.0.1" # localhost.localdomain localhost 127.0.0.1
+
def get_test_data_list():
# get list with all primitive types, and a combo type
l0 = [
@@ -30,6 +33,8 @@ def get_test_data_list():
3232.0,
6464.0,
6464646464.0,
+ 160.0,
+ 1616.0,
False,
True,
u"null",
@@ -69,22 +74,20 @@ def build_test_data(destdir):
for i in range(len(l)):
# packer = msgpack.Packer()
serialized = msgpack.dumps(l[i])
- f = open(os.path.join(destdir, str(i) + '.msgpack.golden'), 'wb')
- f.write(serialized)
- f.close()
+ with open(os.path.join(destdir, str(i) + '.msgpack.golden'), 'wb') as f:
+ f.write(serialized)
serialized = cbor.dumps(l[i])
- f = open(os.path.join(destdir, str(i) + '.cbor.golden'), 'wb')
- f.write(serialized)
- f.close()
+ with open(os.path.join(destdir, str(i) + '.cbor.golden'), 'wb') as f:
+ f.write(serialized)
def doRpcServer(port, stopTimeSec):
class EchoHandler(object):
def Echo123(self, msg1, msg2, msg3):
- return ("1:%s 2:%s 3:%s" % (msg1, msg2, msg3))
+ return ("1:%s 2:%s 3:%s" % (msg1.decode("utf-8"), msg2.decode("utf-8"), msg3.decode("utf-8")))
def EchoStruct(self, msg):
return ("%s" % msg)
- addr = msgpackrpc.Address('127.0.0.1', port)
+ addr = msgpackrpc.Address(mylocaladdr, port)
server = msgpackrpc.Server(EchoHandler())
server.listen(addr)
# run thread to stop it after stopTimeSec seconds if > 0
@@ -96,17 +99,27 @@ def doRpcServer(port, stopTimeSec):
server.start()
def doRpcClientToPythonSvc(port):
- address = msgpackrpc.Address('127.0.0.1', port)
+ address = msgpackrpc.Address(mylocaladdr, 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"})
-
+ print(client.call("Echo123", "A1", "B2", "C3"))
+ print(client.call("EchoStruct", {"A" :"Aa", "B":"Bb", "C":"Cc"}))
+
+# def doCheckSocket(port):
+# print(">>>> port: ", port, " <<<<<")
+# sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+# result = sock.connect_ex(('127.0.0.1', port))
+# if result == 0:
+# print("\t>>>> Port is open")
+# else:
+# print("\t>>>> Port is not open")
+# sock.close()
+
def doRpcClientToGoSvc(port):
- # print ">>>> port: ", port, " <<<<<"
- address = msgpackrpc.Address('127.0.0.1', port)
+ # doCheckSocket(port)
+ address = msgpackrpc.Address(mylocaladdr, 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"})
+ 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":
@@ -123,4 +136,3 @@ def doMain(args):
if __name__ == "__main__":
doMain(sys.argv[1:])
-
diff --git a/vendor/github.com/ugorji/go/codec/writer.go b/vendor/github.com/ugorji/go/codec/writer.go
index 764790bff..4d2c9fe10 100644
--- a/vendor/github.com/ugorji/go/codec/writer.go
+++ b/vendor/github.com/ugorji/go/codec/writer.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
@@ -11,15 +11,17 @@ type encWriter interface {
writestr(string)
writeqstr(string) // write string wrapped in quotes ie "..."
writen1(byte)
+
+ // add convenience functions for writing 2,4
writen2(byte, byte)
- // writen will write up to 7 bytes at a time.
- writen(b [rwNLen]byte, num uint8)
+ writen4([4]byte)
+ writen8([8]byte)
+
end()
}
// ---------------------------------------------
-// bufioEncWriter
type bufioEncWriter struct {
w io.Writer
@@ -53,23 +55,22 @@ func (z *bufioEncWriter) reset(w io.Writer, bufsize int, blist *bytesFreelist) {
z.buf = z.buf[:cap(z.buf)]
}
-//go:noinline - flush only called intermittently
func (z *bufioEncWriter) flushErr() (err error) {
n, err := z.w.Write(z.buf[:z.n])
z.n -= n
- if z.n > 0 && err == nil {
- err = io.ErrShortWrite
- }
- if n > 0 && z.n > 0 {
- copy(z.buf, z.buf[n:z.n+n])
+ if z.n > 0 {
+ if err == nil {
+ err = io.ErrShortWrite
+ }
+ if n > 0 {
+ copy(z.buf, z.buf[n:z.n+n])
+ }
}
return err
}
func (z *bufioEncWriter) flush() {
- if err := z.flushErr(); err != nil {
- panic(err)
- }
+ halt.onerror(z.flushErr())
}
func (z *bufioEncWriter) writeb(s []byte) {
@@ -127,7 +128,6 @@ func (z *bufioEncWriter) writen1(b1 byte) {
z.buf[z.n] = b1
z.n++
}
-
func (z *bufioEncWriter) writen2(b1, b2 byte) {
if 2 > len(z.buf)-z.n {
z.flush()
@@ -136,13 +136,20 @@ func (z *bufioEncWriter) writen2(b1, b2 byte) {
z.buf[z.n] = b1
z.n += 2
}
-
-func (z *bufioEncWriter) writen(b [rwNLen]byte, num uint8) {
- if int(num) > len(z.buf)-z.n {
+func (z *bufioEncWriter) writen4(b [4]byte) {
+ if 4 > len(z.buf)-z.n {
z.flush()
}
- copy(z.buf[z.n:], b[:num])
- z.n += int(num)
+ copy(z.buf[z.n:], b[:])
+ z.n += 4
+}
+
+func (z *bufioEncWriter) writen8(b [8]byte) {
+ if 8 > len(z.buf)-z.n {
+ z.flush()
+ }
+ copy(z.buf[z.n:], b[:])
+ z.n += 8
}
func (z *bufioEncWriter) endErr() (err error) {
@@ -168,7 +175,6 @@ func (z *bytesEncAppender) writestr(s string) {
}
func (z *bytesEncAppender) writeqstr(s string) {
z.b = append(append(append(z.b, '"'), s...), '"')
-
// z.b = append(z.b, '"')
// z.b = append(z.b, s...)
// z.b = append(z.b, '"')
@@ -177,13 +183,15 @@ func (z *bytesEncAppender) writen1(b1 byte) {
z.b = append(z.b, b1)
}
func (z *bytesEncAppender) writen2(b1, b2 byte) {
- z.b = append(z.b, b1, b2) // cost: 81
+ z.b = append(z.b, b1, b2)
}
-func (z *bytesEncAppender) writen(s [rwNLen]byte, num uint8) {
- // if num <= rwNLen {
- if int(num) <= len(s) {
- z.b = append(z.b, s[:num]...)
- }
+func (z *bytesEncAppender) writen4(b [4]byte) {
+ z.b = append(z.b, b[:]...)
+ // z.b = append(z.b, b[0], b[1], b[2], b[3]) // prevents inlining encWr.writen4
+}
+func (z *bytesEncAppender) writen8(b [8]byte) {
+ z.b = append(z.b, b[:]...)
+ // z.b = append(z.b, b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]) // prevents inlining encWr.writen4
}
func (z *bytesEncAppender) endErr() error {
*(z.out) = z.b
@@ -204,11 +212,16 @@ type encWr struct {
c containerState
calls uint16
-
- wb bytesEncAppender
- wf *bufioEncWriter
+ seq uint16 // sequencer (e.g. used by binc for symbols, etc)
+ wb bytesEncAppender
+ wf *bufioEncWriter
}
+// MARKER: manually inline bytesEncAppender.writenx/writeqstr methods,
+// as calling them causes encWr.writenx/writeqstr methods to not be inlined (cost > 80).
+//
+// i.e. e.g. instead of writing z.wb.writen2(b1, b2), use z.wb.b = append(z.wb.b, b1, b2)
+
func (z *encWr) writeb(s []byte) {
if z.bytes {
z.wb.writeb(s)
@@ -218,7 +231,8 @@ func (z *encWr) writeb(s []byte) {
}
func (z *encWr) writeqstr(s string) {
if z.bytes {
- z.wb.writeqstr(s)
+ // MARKER: z.wb.writeqstr(s)
+ z.wb.b = append(append(append(z.wb.b, '"'), s...), '"')
} else {
z.wf.writeqstr(s)
}
@@ -237,20 +251,30 @@ func (z *encWr) writen1(b1 byte) {
z.wf.writen1(b1)
}
}
+
func (z *encWr) writen2(b1, b2 byte) {
if z.bytes {
- z.wb.writen2(b1, b2)
+ // MARKER: z.wb.writen2(b1, b2)
+ z.wb.b = append(z.wb.b, b1, b2)
} else {
z.wf.writen2(b1, b2)
}
}
-func (z *encWr) writen(b [rwNLen]byte, num uint8) {
+func (z *encWr) writen4(b [4]byte) {
if z.bytes {
- z.wb.writen(b, num)
+ z.wb.writen4(b)
} else {
- z.wf.writen(b, num)
+ z.wf.writen4(b)
}
}
+func (z *encWr) writen8(b [8]byte) {
+ if z.bytes {
+ z.wb.writen8(b)
+ } else {
+ z.wf.writen8(b)
+ }
+}
+
func (z *encWr) endErr() error {
if z.bytes {
return z.wb.endErr()
@@ -259,9 +283,7 @@ func (z *encWr) endErr() error {
}
func (z *encWr) end() {
- if err := z.endErr(); err != nil {
- panic(err)
- }
+ halt.onerror(z.endErr())
}
var _ encWriter = (*encWr)(nil)
diff --git a/vendor/golang.org/x/crypto/acme/acme.go b/vendor/golang.org/x/crypto/acme/acme.go
index 6e6c9d131..73b19ef35 100644
--- a/vendor/golang.org/x/crypto/acme/acme.go
+++ b/vendor/golang.org/x/crypto/acme/acme.go
@@ -4,7 +4,7 @@
// Package acme provides an implementation of the
// Automatic Certificate Management Environment (ACME) spec.
-// The intial implementation was based on ACME draft-02 and
+// The initial implementation was based on ACME draft-02 and
// is now being extended to comply with RFC 8555.
// See https://tools.ietf.org/html/draft-ietf-acme-acme-02
// and https://tools.ietf.org/html/rfc8555 for details.
@@ -363,6 +363,10 @@ func AcceptTOS(tosURL string) bool { return true }
// Also see Error's Instance field for when a CA requires already registered accounts to agree
// to an updated Terms of Service.
func (c *Client) Register(ctx context.Context, acct *Account, prompt func(tosURL string) bool) (*Account, error) {
+ if c.Key == nil {
+ return nil, errors.New("acme: client.Key must be set to Register")
+ }
+
dir, err := c.Discover(ctx)
if err != nil {
return nil, err
diff --git a/vendor/golang.org/x/crypto/acme/autocert/autocert.go b/vendor/golang.org/x/crypto/acme/autocert/autocert.go
index 2ea9e2317..c7fbc54c4 100644
--- a/vendor/golang.org/x/crypto/acme/autocert/autocert.go
+++ b/vendor/golang.org/x/crypto/acme/autocert/autocert.go
@@ -1133,11 +1133,11 @@ func (s *certState) tlscert() (*tls.Certificate, error) {
}, nil
}
-// certRequest generates a CSR for the given common name cn and optional SANs.
-func certRequest(key crypto.Signer, cn string, ext []pkix.Extension, san ...string) ([]byte, error) {
+// certRequest generates a CSR for the given common name.
+func certRequest(key crypto.Signer, name string, ext []pkix.Extension) ([]byte, error) {
req := &x509.CertificateRequest{
- Subject: pkix.Name{CommonName: cn},
- DNSNames: san,
+ Subject: pkix.Name{CommonName: name},
+ DNSNames: []string{name},
ExtraExtensions: ext,
}
return x509.CreateCertificateRequest(rand.Reader, req, key)
diff --git a/vendor/golang.org/x/crypto/acme/http.go b/vendor/golang.org/x/crypto/acme/http.go
index c51943e71..2b4c1a10d 100644
--- a/vendor/golang.org/x/crypto/acme/http.go
+++ b/vendor/golang.org/x/crypto/acme/http.go
@@ -10,6 +10,7 @@ import (
"crypto"
"crypto/rand"
"encoding/json"
+ "errors"
"fmt"
"io/ioutil"
"math/big"
@@ -215,6 +216,9 @@ func (c *Client) post(ctx context.Context, key crypto.Signer, url string, body i
func (c *Client) postNoRetry(ctx context.Context, key crypto.Signer, url string, body interface{}) (*http.Response, *http.Request, error) {
kid := noKeyID
if key == nil {
+ if c.Key == nil {
+ return nil, nil, errors.New("acme: Client.Key must be populated to make POST requests")
+ }
key = c.Key
kid = c.accountKID(ctx)
}
diff --git a/vendor/golang.org/x/crypto/acme/jws.go b/vendor/golang.org/x/crypto/acme/jws.go
index 76e3fdacf..8c3ecceca 100644
--- a/vendor/golang.org/x/crypto/acme/jws.go
+++ b/vendor/golang.org/x/crypto/acme/jws.go
@@ -7,6 +7,7 @@ package acme
import (
"crypto"
"crypto/ecdsa"
+ "crypto/hmac"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
@@ -14,6 +15,7 @@ import (
"encoding/asn1"
"encoding/base64"
"encoding/json"
+ "errors"
"fmt"
"math/big"
)
@@ -31,6 +33,14 @@ const noKeyID = keyID("")
// See https://tools.ietf.org/html/rfc8555#section-6.3 for more details.
const noPayload = ""
+// jsonWebSignature can be easily serialized into a JWS following
+// https://tools.ietf.org/html/rfc7515#section-3.2.
+type jsonWebSignature struct {
+ Protected string `json:"protected"`
+ Payload string `json:"payload"`
+ Sig string `json:"signature"`
+}
+
// jwsEncodeJSON signs claimset using provided key and a nonce.
// The result is serialized in JSON format containing either kid or jwk
// fields based on the provided keyID value.
@@ -71,12 +81,7 @@ func jwsEncodeJSON(claimset interface{}, key crypto.Signer, kid keyID, nonce, ur
if err != nil {
return nil, err
}
-
- enc := struct {
- Protected string `json:"protected"`
- Payload string `json:"payload"`
- Sig string `json:"signature"`
- }{
+ enc := jsonWebSignature{
Protected: phead,
Payload: payload,
Sig: base64.RawURLEncoding.EncodeToString(sig),
@@ -84,6 +89,43 @@ func jwsEncodeJSON(claimset interface{}, key crypto.Signer, kid keyID, nonce, ur
return json.Marshal(&enc)
}
+// jwsWithMAC creates and signs a JWS using the given key and the HS256
+// algorithm. kid and url are included in the protected header. rawPayload
+// should not be base64-URL-encoded.
+func jwsWithMAC(key []byte, kid, url string, rawPayload []byte) (*jsonWebSignature, error) {
+ if len(key) == 0 {
+ return nil, errors.New("acme: cannot sign JWS with an empty MAC key")
+ }
+ header := struct {
+ Algorithm string `json:"alg"`
+ KID string `json:"kid"`
+ URL string `json:"url,omitempty"`
+ }{
+ // Only HMAC-SHA256 is supported.
+ Algorithm: "HS256",
+ KID: kid,
+ URL: url,
+ }
+ rawProtected, err := json.Marshal(header)
+ if err != nil {
+ return nil, err
+ }
+ protected := base64.RawURLEncoding.EncodeToString(rawProtected)
+ payload := base64.RawURLEncoding.EncodeToString(rawPayload)
+
+ h := hmac.New(sha256.New, key)
+ if _, err := h.Write([]byte(protected + "." + payload)); err != nil {
+ return nil, err
+ }
+ mac := h.Sum(nil)
+
+ return &jsonWebSignature{
+ Protected: protected,
+ Payload: payload,
+ Sig: base64.RawURLEncoding.EncodeToString(mac),
+ }, nil
+}
+
// jwkEncode encodes public part of an RSA or ECDSA key into a JWK.
// The result is also suitable for creating a JWK thumbprint.
// https://tools.ietf.org/html/rfc7517
diff --git a/vendor/golang.org/x/crypto/acme/rfc8555.go b/vendor/golang.org/x/crypto/acme/rfc8555.go
index dfb57a66f..f9d3011ff 100644
--- a/vendor/golang.org/x/crypto/acme/rfc8555.go
+++ b/vendor/golang.org/x/crypto/acme/rfc8555.go
@@ -37,22 +37,32 @@ func (c *Client) DeactivateReg(ctx context.Context) error {
return nil
}
-// registerRFC is quivalent to c.Register but for CAs implementing RFC 8555.
+// registerRFC is equivalent to c.Register but for CAs implementing RFC 8555.
// It expects c.Discover to have already been called.
-// TODO: Implement externalAccountBinding.
func (c *Client) registerRFC(ctx context.Context, acct *Account, prompt func(tosURL string) bool) (*Account, error) {
c.cacheMu.Lock() // guard c.kid access
defer c.cacheMu.Unlock()
req := struct {
- TermsAgreed bool `json:"termsOfServiceAgreed,omitempty"`
- Contact []string `json:"contact,omitempty"`
+ TermsAgreed bool `json:"termsOfServiceAgreed,omitempty"`
+ Contact []string `json:"contact,omitempty"`
+ ExternalAccountBinding *jsonWebSignature `json:"externalAccountBinding,omitempty"`
}{
Contact: acct.Contact,
}
if c.dir.Terms != "" {
req.TermsAgreed = prompt(c.dir.Terms)
}
+
+ // set 'externalAccountBinding' field if requested
+ if acct.ExternalAccountBinding != nil {
+ eabJWS, err := c.encodeExternalAccountBinding(acct.ExternalAccountBinding)
+ if err != nil {
+ return nil, fmt.Errorf("acme: failed to encode external account binding: %v", err)
+ }
+ req.ExternalAccountBinding = eabJWS
+ }
+
res, err := c.post(ctx, c.Key, c.dir.RegURL, req, wantStatus(
http.StatusOK, // account with this key already registered
http.StatusCreated, // new account created
@@ -75,7 +85,17 @@ func (c *Client) registerRFC(ctx context.Context, acct *Account, prompt func(tos
return a, nil
}
-// updateGegRFC is equivalent to c.UpdateReg but for CAs implementing RFC 8555.
+// encodeExternalAccountBinding will encode an external account binding stanza
+// as described in https://tools.ietf.org/html/rfc8555#section-7.3.4.
+func (c *Client) encodeExternalAccountBinding(eab *ExternalAccountBinding) (*jsonWebSignature, error) {
+ jwk, err := jwkEncode(c.Key.Public())
+ if err != nil {
+ return nil, err
+ }
+ return jwsWithMAC(eab.Key, eab.KID, c.dir.RegURL, []byte(jwk))
+}
+
+// updateRegRFC is equivalent to c.UpdateReg but for CAs implementing RFC 8555.
// It expects c.Discover to have already been called.
func (c *Client) updateRegRFC(ctx context.Context, a *Account) (*Account, error) {
url := string(c.accountKID(ctx))
@@ -390,3 +410,29 @@ func isAlreadyRevoked(err error) bool {
e, ok := err.(*Error)
return ok && e.ProblemType == "urn:ietf:params:acme:error:alreadyRevoked"
}
+
+// ListCertAlternates retrieves any alternate certificate chain URLs for the
+// given certificate chain URL. These alternate URLs can be passed to FetchCert
+// in order to retrieve the alternate certificate chains.
+//
+// If there are no alternate issuer certificate chains, a nil slice will be
+// returned.
+func (c *Client) ListCertAlternates(ctx context.Context, url string) ([]string, error) {
+ if _, err := c.Discover(ctx); err != nil { // required by c.accountKID
+ return nil, err
+ }
+
+ res, err := c.postAsGet(ctx, url, wantStatus(http.StatusOK))
+ if err != nil {
+ return nil, err
+ }
+ defer res.Body.Close()
+
+ // We don't need the body but we need to discard it so we don't end up
+ // preventing keep-alive
+ if _, err := io.Copy(ioutil.Discard, res.Body); err != nil {
+ return nil, fmt.Errorf("acme: cert alternates response stream: %v", err)
+ }
+ alts := linkHeader(res.Header, "alternate")
+ return alts, nil
+}
diff --git a/vendor/golang.org/x/crypto/acme/types.go b/vendor/golang.org/x/crypto/acme/types.go
index e959cafc8..eaae45290 100644
--- a/vendor/golang.org/x/crypto/acme/types.go
+++ b/vendor/golang.org/x/crypto/acme/types.go
@@ -57,6 +57,32 @@ var (
ErrNoAccount = errors.New("acme: account does not exist")
)
+// A Subproblem describes an ACME subproblem as reported in an Error.
+type Subproblem struct {
+ // Type is a URI reference that identifies the problem type,
+ // typically in a "urn:acme:error:xxx" form.
+ Type string
+ // Detail is a human-readable explanation specific to this occurrence of the problem.
+ Detail string
+ // Instance indicates a URL that the client should direct a human user to visit
+ // in order for instructions on how to agree to the updated Terms of Service.
+ // In such an event CA sets StatusCode to 403, Type to
+ // "urn:ietf:params:acme:error:userActionRequired", and adds a Link header with relation
+ // "terms-of-service" containing the latest TOS URL.
+ Instance string
+ // Identifier may contain the ACME identifier that the error is for.
+ Identifier *AuthzID
+}
+
+func (sp Subproblem) String() string {
+ str := fmt.Sprintf("%s: ", sp.Type)
+ if sp.Identifier != nil {
+ str += fmt.Sprintf("[%s: %s] ", sp.Identifier.Type, sp.Identifier.Value)
+ }
+ str += sp.Detail
+ return str
+}
+
// Error is an ACME error, defined in Problem Details for HTTP APIs doc
// http://tools.ietf.org/html/draft-ietf-appsawg-http-problem.
type Error struct {
@@ -76,10 +102,21 @@ type Error struct {
// Header is the original server error response headers.
// It may be nil.
Header http.Header
+ // Subproblems may contain more detailed information about the individual problems
+ // that caused the error. This field is only sent by RFC 8555 compatible ACME
+ // servers. Defined in RFC 8555 Section 6.7.1.
+ Subproblems []Subproblem
}
func (e *Error) Error() string {
- return fmt.Sprintf("%d %s: %s", e.StatusCode, e.ProblemType, e.Detail)
+ str := fmt.Sprintf("%d %s: %s", e.StatusCode, e.ProblemType, e.Detail)
+ if len(e.Subproblems) > 0 {
+ str += fmt.Sprintf("; subproblems:")
+ for _, sp := range e.Subproblems {
+ str += fmt.Sprintf("\n\t%s", sp)
+ }
+ }
+ return str
}
// AuthorizationError indicates that an authorization for an identifier
@@ -199,6 +236,28 @@ type Account struct {
//
// It is non-RFC 8555 compliant and is obsoleted by OrdersURL.
Certificates string
+
+ // ExternalAccountBinding represents an arbitrary binding to an account of
+ // the CA which the ACME server is tied to.
+ // See https://tools.ietf.org/html/rfc8555#section-7.3.4 for more details.
+ ExternalAccountBinding *ExternalAccountBinding
+}
+
+// ExternalAccountBinding contains the data needed to form a request with
+// an external account binding.
+// See https://tools.ietf.org/html/rfc8555#section-7.3.4 for more details.
+type ExternalAccountBinding struct {
+ // KID is the Key ID of the symmetric MAC key that the CA provides to
+ // identify an external account from ACME.
+ KID string
+
+ // Key is the bytes of the symmetric key that the CA provides to identify
+ // the account. Key must correspond to the KID.
+ Key []byte
+}
+
+func (e *ExternalAccountBinding) String() string {
+ return fmt.Sprintf("&{KID: %q, Key: redacted}", e.KID)
}
// Directory is ACME server discovery data.
@@ -511,20 +570,23 @@ func (c *wireChallenge) challenge() *Challenge {
// wireError is a subset of fields of the Problem Details object
// as described in https://tools.ietf.org/html/rfc7807#section-3.1.
type wireError struct {
- Status int
- Type string
- Detail string
- Instance string
+ Status int
+ Type string
+ Detail string
+ Instance string
+ Subproblems []Subproblem
}
func (e *wireError) error(h http.Header) *Error {
- return &Error{
+ err := &Error{
StatusCode: e.Status,
ProblemType: e.Type,
Detail: e.Detail,
Instance: e.Instance,
Header: h,
+ Subproblems: e.Subproblems,
}
+ return err
}
// CertOption is an optional argument type for the TLS ChallengeCert methods for
diff --git a/vendor/golang.org/x/crypto/acme/version_go112.go b/vendor/golang.org/x/crypto/acme/version_go112.go
index b58f2456b..b9efdb59e 100644
--- a/vendor/golang.org/x/crypto/acme/version_go112.go
+++ b/vendor/golang.org/x/crypto/acme/version_go112.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build go1.12
// +build go1.12
package acme
diff --git a/vendor/golang.org/x/crypto/sha3/doc.go b/vendor/golang.org/x/crypto/sha3/doc.go
new file mode 100644
index 000000000..c2fef30af
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/doc.go
@@ -0,0 +1,66 @@
+// 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 sha3 implements the SHA-3 fixed-output-length hash functions and
+// the SHAKE variable-output-length hash functions defined by FIPS-202.
+//
+// Both types of hash function use the "sponge" construction and the Keccak
+// permutation. For a detailed specification see http://keccak.noekeon.org/
+//
+//
+// Guidance
+//
+// If you aren't sure what function you need, use SHAKE256 with at least 64
+// bytes of output. The SHAKE instances are faster than the SHA3 instances;
+// the latter have to allocate memory to conform to the hash.Hash interface.
+//
+// If you need a secret-key MAC (message authentication code), prepend the
+// secret key to the input, hash with SHAKE256 and read at least 32 bytes of
+// output.
+//
+//
+// Security strengths
+//
+// The SHA3-x (x equals 224, 256, 384, or 512) functions have a security
+// strength against preimage attacks of x bits. Since they only produce "x"
+// bits of output, their collision-resistance is only "x/2" bits.
+//
+// The SHAKE-256 and -128 functions have a generic security strength of 256 and
+// 128 bits against all attacks, provided that at least 2x bits of their output
+// is used. Requesting more than 64 or 32 bytes of output, respectively, does
+// not increase the collision-resistance of the SHAKE functions.
+//
+//
+// The sponge construction
+//
+// A sponge builds a pseudo-random function from a public pseudo-random
+// permutation, by applying the permutation to a state of "rate + capacity"
+// bytes, but hiding "capacity" of the bytes.
+//
+// A sponge starts out with a zero state. To hash an input using a sponge, up
+// to "rate" bytes of the input are XORed into the sponge's state. The sponge
+// is then "full" and the permutation is applied to "empty" it. This process is
+// repeated until all the input has been "absorbed". The input is then padded.
+// The digest is "squeezed" from the sponge in the same way, except that output
+// is copied out instead of input being XORed in.
+//
+// A sponge is parameterized by its generic security strength, which is equal
+// to half its capacity; capacity + rate is equal to the permutation's width.
+// Since the KeccakF-1600 permutation is 1600 bits (200 bytes) wide, this means
+// that the security strength of a sponge instance is equal to (1600 - bitrate) / 2.
+//
+//
+// Recommendations
+//
+// The SHAKE functions are recommended for most new uses. They can produce
+// output of arbitrary length. SHAKE256, with an output length of at least
+// 64 bytes, provides 256-bit security against all attacks. The Keccak team
+// recommends it for most applications upgrading from SHA2-512. (NIST chose a
+// much stronger, but much slower, sponge instance for SHA3-512.)
+//
+// The SHA-3 functions are "drop-in" replacements for the SHA-2 functions.
+// They produce output of the same length, with the same security strengths
+// against all attacks. This means, in particular, that SHA3-256 only has
+// 128-bit collision resistance, because its output length is 32 bytes.
+package sha3 // import "golang.org/x/crypto/sha3"
diff --git a/vendor/golang.org/x/crypto/sha3/hashes.go b/vendor/golang.org/x/crypto/sha3/hashes.go
new file mode 100644
index 000000000..0d8043fd2
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/hashes.go
@@ -0,0 +1,97 @@
+// 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 sha3
+
+// This file provides functions for creating instances of the SHA-3
+// and SHAKE hash functions, as well as utility functions for hashing
+// bytes.
+
+import (
+ "hash"
+)
+
+// New224 creates a new SHA3-224 hash.
+// Its generic security strength is 224 bits against preimage attacks,
+// and 112 bits against collision attacks.
+func New224() hash.Hash {
+ if h := new224Asm(); h != nil {
+ return h
+ }
+ return &state{rate: 144, outputLen: 28, dsbyte: 0x06}
+}
+
+// New256 creates a new SHA3-256 hash.
+// Its generic security strength is 256 bits against preimage attacks,
+// and 128 bits against collision attacks.
+func New256() hash.Hash {
+ if h := new256Asm(); h != nil {
+ return h
+ }
+ return &state{rate: 136, outputLen: 32, dsbyte: 0x06}
+}
+
+// New384 creates a new SHA3-384 hash.
+// Its generic security strength is 384 bits against preimage attacks,
+// and 192 bits against collision attacks.
+func New384() hash.Hash {
+ if h := new384Asm(); h != nil {
+ return h
+ }
+ return &state{rate: 104, outputLen: 48, dsbyte: 0x06}
+}
+
+// New512 creates a new SHA3-512 hash.
+// Its generic security strength is 512 bits against preimage attacks,
+// and 256 bits against collision attacks.
+func New512() hash.Hash {
+ if h := new512Asm(); h != nil {
+ return h
+ }
+ return &state{rate: 72, outputLen: 64, dsbyte: 0x06}
+}
+
+// NewLegacyKeccak256 creates a new Keccak-256 hash.
+//
+// Only use this function if you require compatibility with an existing cryptosystem
+// that uses non-standard padding. All other users should use New256 instead.
+func NewLegacyKeccak256() hash.Hash { return &state{rate: 136, outputLen: 32, dsbyte: 0x01} }
+
+// NewLegacyKeccak512 creates a new Keccak-512 hash.
+//
+// Only use this function if you require compatibility with an existing cryptosystem
+// that uses non-standard padding. All other users should use New512 instead.
+func NewLegacyKeccak512() hash.Hash { return &state{rate: 72, outputLen: 64, dsbyte: 0x01} }
+
+// Sum224 returns the SHA3-224 digest of the data.
+func Sum224(data []byte) (digest [28]byte) {
+ h := New224()
+ h.Write(data)
+ h.Sum(digest[:0])
+ return
+}
+
+// Sum256 returns the SHA3-256 digest of the data.
+func Sum256(data []byte) (digest [32]byte) {
+ h := New256()
+ h.Write(data)
+ h.Sum(digest[:0])
+ return
+}
+
+// Sum384 returns the SHA3-384 digest of the data.
+func Sum384(data []byte) (digest [48]byte) {
+ h := New384()
+ h.Write(data)
+ h.Sum(digest[:0])
+ return
+}
+
+// Sum512 returns the SHA3-512 digest of the data.
+func Sum512(data []byte) (digest [64]byte) {
+ h := New512()
+ h.Write(data)
+ h.Sum(digest[:0])
+ return
+}
diff --git a/vendor/golang.org/x/crypto/sha3/hashes_generic.go b/vendor/golang.org/x/crypto/sha3/hashes_generic.go
new file mode 100644
index 000000000..c74fc20fc
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/hashes_generic.go
@@ -0,0 +1,28 @@
+// Copyright 2017 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:build !gc || purego || !s390x
+// +build !gc purego !s390x
+
+package sha3
+
+import (
+ "hash"
+)
+
+// new224Asm returns an assembly implementation of SHA3-224 if available,
+// otherwise it returns nil.
+func new224Asm() hash.Hash { return nil }
+
+// new256Asm returns an assembly implementation of SHA3-256 if available,
+// otherwise it returns nil.
+func new256Asm() hash.Hash { return nil }
+
+// new384Asm returns an assembly implementation of SHA3-384 if available,
+// otherwise it returns nil.
+func new384Asm() hash.Hash { return nil }
+
+// new512Asm returns an assembly implementation of SHA3-512 if available,
+// otherwise it returns nil.
+func new512Asm() hash.Hash { return nil }
diff --git a/vendor/golang.org/x/crypto/sha3/keccakf.go b/vendor/golang.org/x/crypto/sha3/keccakf.go
new file mode 100644
index 000000000..0f4ae8bac
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/keccakf.go
@@ -0,0 +1,413 @@
+// 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.
+
+//go:build !amd64 || purego || !gc
+// +build !amd64 purego !gc
+
+package sha3
+
+// rc stores the round constants for use in the ι step.
+var rc = [24]uint64{
+ 0x0000000000000001,
+ 0x0000000000008082,
+ 0x800000000000808A,
+ 0x8000000080008000,
+ 0x000000000000808B,
+ 0x0000000080000001,
+ 0x8000000080008081,
+ 0x8000000000008009,
+ 0x000000000000008A,
+ 0x0000000000000088,
+ 0x0000000080008009,
+ 0x000000008000000A,
+ 0x000000008000808B,
+ 0x800000000000008B,
+ 0x8000000000008089,
+ 0x8000000000008003,
+ 0x8000000000008002,
+ 0x8000000000000080,
+ 0x000000000000800A,
+ 0x800000008000000A,
+ 0x8000000080008081,
+ 0x8000000000008080,
+ 0x0000000080000001,
+ 0x8000000080008008,
+}
+
+// keccakF1600 applies the Keccak permutation to a 1600b-wide
+// state represented as a slice of 25 uint64s.
+func keccakF1600(a *[25]uint64) {
+ // Implementation translated from Keccak-inplace.c
+ // in the keccak reference code.
+ var t, bc0, bc1, bc2, bc3, bc4, d0, d1, d2, d3, d4 uint64
+
+ for i := 0; i < 24; i += 4 {
+ // Combines the 5 steps in each round into 2 steps.
+ // Unrolls 4 rounds per loop and spreads some steps across rounds.
+
+ // Round 1
+ bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]
+ bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]
+ bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]
+ bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]
+ bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]
+ d0 = bc4 ^ (bc1<<1 | bc1>>63)
+ d1 = bc0 ^ (bc2<<1 | bc2>>63)
+ d2 = bc1 ^ (bc3<<1 | bc3>>63)
+ d3 = bc2 ^ (bc4<<1 | bc4>>63)
+ d4 = bc3 ^ (bc0<<1 | bc0>>63)
+
+ bc0 = a[0] ^ d0
+ t = a[6] ^ d1
+ bc1 = t<<44 | t>>(64-44)
+ t = a[12] ^ d2
+ bc2 = t<<43 | t>>(64-43)
+ t = a[18] ^ d3
+ bc3 = t<<21 | t>>(64-21)
+ t = a[24] ^ d4
+ bc4 = t<<14 | t>>(64-14)
+ a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i]
+ a[6] = bc1 ^ (bc3 &^ bc2)
+ a[12] = bc2 ^ (bc4 &^ bc3)
+ a[18] = bc3 ^ (bc0 &^ bc4)
+ a[24] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[10] ^ d0
+ bc2 = t<<3 | t>>(64-3)
+ t = a[16] ^ d1
+ bc3 = t<<45 | t>>(64-45)
+ t = a[22] ^ d2
+ bc4 = t<<61 | t>>(64-61)
+ t = a[3] ^ d3
+ bc0 = t<<28 | t>>(64-28)
+ t = a[9] ^ d4
+ bc1 = t<<20 | t>>(64-20)
+ a[10] = bc0 ^ (bc2 &^ bc1)
+ a[16] = bc1 ^ (bc3 &^ bc2)
+ a[22] = bc2 ^ (bc4 &^ bc3)
+ a[3] = bc3 ^ (bc0 &^ bc4)
+ a[9] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[20] ^ d0
+ bc4 = t<<18 | t>>(64-18)
+ t = a[1] ^ d1
+ bc0 = t<<1 | t>>(64-1)
+ t = a[7] ^ d2
+ bc1 = t<<6 | t>>(64-6)
+ t = a[13] ^ d3
+ bc2 = t<<25 | t>>(64-25)
+ t = a[19] ^ d4
+ bc3 = t<<8 | t>>(64-8)
+ a[20] = bc0 ^ (bc2 &^ bc1)
+ a[1] = bc1 ^ (bc3 &^ bc2)
+ a[7] = bc2 ^ (bc4 &^ bc3)
+ a[13] = bc3 ^ (bc0 &^ bc4)
+ a[19] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[5] ^ d0
+ bc1 = t<<36 | t>>(64-36)
+ t = a[11] ^ d1
+ bc2 = t<<10 | t>>(64-10)
+ t = a[17] ^ d2
+ bc3 = t<<15 | t>>(64-15)
+ t = a[23] ^ d3
+ bc4 = t<<56 | t>>(64-56)
+ t = a[4] ^ d4
+ bc0 = t<<27 | t>>(64-27)
+ a[5] = bc0 ^ (bc2 &^ bc1)
+ a[11] = bc1 ^ (bc3 &^ bc2)
+ a[17] = bc2 ^ (bc4 &^ bc3)
+ a[23] = bc3 ^ (bc0 &^ bc4)
+ a[4] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[15] ^ d0
+ bc3 = t<<41 | t>>(64-41)
+ t = a[21] ^ d1
+ bc4 = t<<2 | t>>(64-2)
+ t = a[2] ^ d2
+ bc0 = t<<62 | t>>(64-62)
+ t = a[8] ^ d3
+ bc1 = t<<55 | t>>(64-55)
+ t = a[14] ^ d4
+ bc2 = t<<39 | t>>(64-39)
+ a[15] = bc0 ^ (bc2 &^ bc1)
+ a[21] = bc1 ^ (bc3 &^ bc2)
+ a[2] = bc2 ^ (bc4 &^ bc3)
+ a[8] = bc3 ^ (bc0 &^ bc4)
+ a[14] = bc4 ^ (bc1 &^ bc0)
+
+ // Round 2
+ bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]
+ bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]
+ bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]
+ bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]
+ bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]
+ d0 = bc4 ^ (bc1<<1 | bc1>>63)
+ d1 = bc0 ^ (bc2<<1 | bc2>>63)
+ d2 = bc1 ^ (bc3<<1 | bc3>>63)
+ d3 = bc2 ^ (bc4<<1 | bc4>>63)
+ d4 = bc3 ^ (bc0<<1 | bc0>>63)
+
+ bc0 = a[0] ^ d0
+ t = a[16] ^ d1
+ bc1 = t<<44 | t>>(64-44)
+ t = a[7] ^ d2
+ bc2 = t<<43 | t>>(64-43)
+ t = a[23] ^ d3
+ bc3 = t<<21 | t>>(64-21)
+ t = a[14] ^ d4
+ bc4 = t<<14 | t>>(64-14)
+ a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+1]
+ a[16] = bc1 ^ (bc3 &^ bc2)
+ a[7] = bc2 ^ (bc4 &^ bc3)
+ a[23] = bc3 ^ (bc0 &^ bc4)
+ a[14] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[20] ^ d0
+ bc2 = t<<3 | t>>(64-3)
+ t = a[11] ^ d1
+ bc3 = t<<45 | t>>(64-45)
+ t = a[2] ^ d2
+ bc4 = t<<61 | t>>(64-61)
+ t = a[18] ^ d3
+ bc0 = t<<28 | t>>(64-28)
+ t = a[9] ^ d4
+ bc1 = t<<20 | t>>(64-20)
+ a[20] = bc0 ^ (bc2 &^ bc1)
+ a[11] = bc1 ^ (bc3 &^ bc2)
+ a[2] = bc2 ^ (bc4 &^ bc3)
+ a[18] = bc3 ^ (bc0 &^ bc4)
+ a[9] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[15] ^ d0
+ bc4 = t<<18 | t>>(64-18)
+ t = a[6] ^ d1
+ bc0 = t<<1 | t>>(64-1)
+ t = a[22] ^ d2
+ bc1 = t<<6 | t>>(64-6)
+ t = a[13] ^ d3
+ bc2 = t<<25 | t>>(64-25)
+ t = a[4] ^ d4
+ bc3 = t<<8 | t>>(64-8)
+ a[15] = bc0 ^ (bc2 &^ bc1)
+ a[6] = bc1 ^ (bc3 &^ bc2)
+ a[22] = bc2 ^ (bc4 &^ bc3)
+ a[13] = bc3 ^ (bc0 &^ bc4)
+ a[4] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[10] ^ d0
+ bc1 = t<<36 | t>>(64-36)
+ t = a[1] ^ d1
+ bc2 = t<<10 | t>>(64-10)
+ t = a[17] ^ d2
+ bc3 = t<<15 | t>>(64-15)
+ t = a[8] ^ d3
+ bc4 = t<<56 | t>>(64-56)
+ t = a[24] ^ d4
+ bc0 = t<<27 | t>>(64-27)
+ a[10] = bc0 ^ (bc2 &^ bc1)
+ a[1] = bc1 ^ (bc3 &^ bc2)
+ a[17] = bc2 ^ (bc4 &^ bc3)
+ a[8] = bc3 ^ (bc0 &^ bc4)
+ a[24] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[5] ^ d0
+ bc3 = t<<41 | t>>(64-41)
+ t = a[21] ^ d1
+ bc4 = t<<2 | t>>(64-2)
+ t = a[12] ^ d2
+ bc0 = t<<62 | t>>(64-62)
+ t = a[3] ^ d3
+ bc1 = t<<55 | t>>(64-55)
+ t = a[19] ^ d4
+ bc2 = t<<39 | t>>(64-39)
+ a[5] = bc0 ^ (bc2 &^ bc1)
+ a[21] = bc1 ^ (bc3 &^ bc2)
+ a[12] = bc2 ^ (bc4 &^ bc3)
+ a[3] = bc3 ^ (bc0 &^ bc4)
+ a[19] = bc4 ^ (bc1 &^ bc0)
+
+ // Round 3
+ bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]
+ bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]
+ bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]
+ bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]
+ bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]
+ d0 = bc4 ^ (bc1<<1 | bc1>>63)
+ d1 = bc0 ^ (bc2<<1 | bc2>>63)
+ d2 = bc1 ^ (bc3<<1 | bc3>>63)
+ d3 = bc2 ^ (bc4<<1 | bc4>>63)
+ d4 = bc3 ^ (bc0<<1 | bc0>>63)
+
+ bc0 = a[0] ^ d0
+ t = a[11] ^ d1
+ bc1 = t<<44 | t>>(64-44)
+ t = a[22] ^ d2
+ bc2 = t<<43 | t>>(64-43)
+ t = a[8] ^ d3
+ bc3 = t<<21 | t>>(64-21)
+ t = a[19] ^ d4
+ bc4 = t<<14 | t>>(64-14)
+ a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+2]
+ a[11] = bc1 ^ (bc3 &^ bc2)
+ a[22] = bc2 ^ (bc4 &^ bc3)
+ a[8] = bc3 ^ (bc0 &^ bc4)
+ a[19] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[15] ^ d0
+ bc2 = t<<3 | t>>(64-3)
+ t = a[1] ^ d1
+ bc3 = t<<45 | t>>(64-45)
+ t = a[12] ^ d2
+ bc4 = t<<61 | t>>(64-61)
+ t = a[23] ^ d3
+ bc0 = t<<28 | t>>(64-28)
+ t = a[9] ^ d4
+ bc1 = t<<20 | t>>(64-20)
+ a[15] = bc0 ^ (bc2 &^ bc1)
+ a[1] = bc1 ^ (bc3 &^ bc2)
+ a[12] = bc2 ^ (bc4 &^ bc3)
+ a[23] = bc3 ^ (bc0 &^ bc4)
+ a[9] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[5] ^ d0
+ bc4 = t<<18 | t>>(64-18)
+ t = a[16] ^ d1
+ bc0 = t<<1 | t>>(64-1)
+ t = a[2] ^ d2
+ bc1 = t<<6 | t>>(64-6)
+ t = a[13] ^ d3
+ bc2 = t<<25 | t>>(64-25)
+ t = a[24] ^ d4
+ bc3 = t<<8 | t>>(64-8)
+ a[5] = bc0 ^ (bc2 &^ bc1)
+ a[16] = bc1 ^ (bc3 &^ bc2)
+ a[2] = bc2 ^ (bc4 &^ bc3)
+ a[13] = bc3 ^ (bc0 &^ bc4)
+ a[24] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[20] ^ d0
+ bc1 = t<<36 | t>>(64-36)
+ t = a[6] ^ d1
+ bc2 = t<<10 | t>>(64-10)
+ t = a[17] ^ d2
+ bc3 = t<<15 | t>>(64-15)
+ t = a[3] ^ d3
+ bc4 = t<<56 | t>>(64-56)
+ t = a[14] ^ d4
+ bc0 = t<<27 | t>>(64-27)
+ a[20] = bc0 ^ (bc2 &^ bc1)
+ a[6] = bc1 ^ (bc3 &^ bc2)
+ a[17] = bc2 ^ (bc4 &^ bc3)
+ a[3] = bc3 ^ (bc0 &^ bc4)
+ a[14] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[10] ^ d0
+ bc3 = t<<41 | t>>(64-41)
+ t = a[21] ^ d1
+ bc4 = t<<2 | t>>(64-2)
+ t = a[7] ^ d2
+ bc0 = t<<62 | t>>(64-62)
+ t = a[18] ^ d3
+ bc1 = t<<55 | t>>(64-55)
+ t = a[4] ^ d4
+ bc2 = t<<39 | t>>(64-39)
+ a[10] = bc0 ^ (bc2 &^ bc1)
+ a[21] = bc1 ^ (bc3 &^ bc2)
+ a[7] = bc2 ^ (bc4 &^ bc3)
+ a[18] = bc3 ^ (bc0 &^ bc4)
+ a[4] = bc4 ^ (bc1 &^ bc0)
+
+ // Round 4
+ bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]
+ bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]
+ bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]
+ bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]
+ bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]
+ d0 = bc4 ^ (bc1<<1 | bc1>>63)
+ d1 = bc0 ^ (bc2<<1 | bc2>>63)
+ d2 = bc1 ^ (bc3<<1 | bc3>>63)
+ d3 = bc2 ^ (bc4<<1 | bc4>>63)
+ d4 = bc3 ^ (bc0<<1 | bc0>>63)
+
+ bc0 = a[0] ^ d0
+ t = a[1] ^ d1
+ bc1 = t<<44 | t>>(64-44)
+ t = a[2] ^ d2
+ bc2 = t<<43 | t>>(64-43)
+ t = a[3] ^ d3
+ bc3 = t<<21 | t>>(64-21)
+ t = a[4] ^ d4
+ bc4 = t<<14 | t>>(64-14)
+ a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+3]
+ a[1] = bc1 ^ (bc3 &^ bc2)
+ a[2] = bc2 ^ (bc4 &^ bc3)
+ a[3] = bc3 ^ (bc0 &^ bc4)
+ a[4] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[5] ^ d0
+ bc2 = t<<3 | t>>(64-3)
+ t = a[6] ^ d1
+ bc3 = t<<45 | t>>(64-45)
+ t = a[7] ^ d2
+ bc4 = t<<61 | t>>(64-61)
+ t = a[8] ^ d3
+ bc0 = t<<28 | t>>(64-28)
+ t = a[9] ^ d4
+ bc1 = t<<20 | t>>(64-20)
+ a[5] = bc0 ^ (bc2 &^ bc1)
+ a[6] = bc1 ^ (bc3 &^ bc2)
+ a[7] = bc2 ^ (bc4 &^ bc3)
+ a[8] = bc3 ^ (bc0 &^ bc4)
+ a[9] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[10] ^ d0
+ bc4 = t<<18 | t>>(64-18)
+ t = a[11] ^ d1
+ bc0 = t<<1 | t>>(64-1)
+ t = a[12] ^ d2
+ bc1 = t<<6 | t>>(64-6)
+ t = a[13] ^ d3
+ bc2 = t<<25 | t>>(64-25)
+ t = a[14] ^ d4
+ bc3 = t<<8 | t>>(64-8)
+ a[10] = bc0 ^ (bc2 &^ bc1)
+ a[11] = bc1 ^ (bc3 &^ bc2)
+ a[12] = bc2 ^ (bc4 &^ bc3)
+ a[13] = bc3 ^ (bc0 &^ bc4)
+ a[14] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[15] ^ d0
+ bc1 = t<<36 | t>>(64-36)
+ t = a[16] ^ d1
+ bc2 = t<<10 | t>>(64-10)
+ t = a[17] ^ d2
+ bc3 = t<<15 | t>>(64-15)
+ t = a[18] ^ d3
+ bc4 = t<<56 | t>>(64-56)
+ t = a[19] ^ d4
+ bc0 = t<<27 | t>>(64-27)
+ a[15] = bc0 ^ (bc2 &^ bc1)
+ a[16] = bc1 ^ (bc3 &^ bc2)
+ a[17] = bc2 ^ (bc4 &^ bc3)
+ a[18] = bc3 ^ (bc0 &^ bc4)
+ a[19] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[20] ^ d0
+ bc3 = t<<41 | t>>(64-41)
+ t = a[21] ^ d1
+ bc4 = t<<2 | t>>(64-2)
+ t = a[22] ^ d2
+ bc0 = t<<62 | t>>(64-62)
+ t = a[23] ^ d3
+ bc1 = t<<55 | t>>(64-55)
+ t = a[24] ^ d4
+ bc2 = t<<39 | t>>(64-39)
+ a[20] = bc0 ^ (bc2 &^ bc1)
+ a[21] = bc1 ^ (bc3 &^ bc2)
+ a[22] = bc2 ^ (bc4 &^ bc3)
+ a[23] = bc3 ^ (bc0 &^ bc4)
+ a[24] = bc4 ^ (bc1 &^ bc0)
+ }
+}
diff --git a/vendor/golang.org/x/crypto/sha3/keccakf_amd64.go b/vendor/golang.org/x/crypto/sha3/keccakf_amd64.go
new file mode 100644
index 000000000..248a38241
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/keccakf_amd64.go
@@ -0,0 +1,14 @@
+// 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.
+
+//go:build amd64 && !purego && gc
+// +build amd64,!purego,gc
+
+package sha3
+
+// This function is implemented in keccakf_amd64.s.
+
+//go:noescape
+
+func keccakF1600(a *[25]uint64)
diff --git a/vendor/golang.org/x/crypto/sha3/keccakf_amd64.s b/vendor/golang.org/x/crypto/sha3/keccakf_amd64.s
new file mode 100644
index 000000000..4cfa54383
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/keccakf_amd64.s
@@ -0,0 +1,391 @@
+// 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.
+
+//go:build amd64 && !purego && gc
+// +build amd64,!purego,gc
+
+// This code was translated into a form compatible with 6a from the public
+// domain sources at https://github.com/gvanas/KeccakCodePackage
+
+// Offsets in state
+#define _ba (0*8)
+#define _be (1*8)
+#define _bi (2*8)
+#define _bo (3*8)
+#define _bu (4*8)
+#define _ga (5*8)
+#define _ge (6*8)
+#define _gi (7*8)
+#define _go (8*8)
+#define _gu (9*8)
+#define _ka (10*8)
+#define _ke (11*8)
+#define _ki (12*8)
+#define _ko (13*8)
+#define _ku (14*8)
+#define _ma (15*8)
+#define _me (16*8)
+#define _mi (17*8)
+#define _mo (18*8)
+#define _mu (19*8)
+#define _sa (20*8)
+#define _se (21*8)
+#define _si (22*8)
+#define _so (23*8)
+#define _su (24*8)
+
+// Temporary registers
+#define rT1 AX
+
+// Round vars
+#define rpState DI
+#define rpStack SP
+
+#define rDa BX
+#define rDe CX
+#define rDi DX
+#define rDo R8
+#define rDu R9
+
+#define rBa R10
+#define rBe R11
+#define rBi R12
+#define rBo R13
+#define rBu R14
+
+#define rCa SI
+#define rCe BP
+#define rCi rBi
+#define rCo rBo
+#define rCu R15
+
+#define MOVQ_RBI_RCE MOVQ rBi, rCe
+#define XORQ_RT1_RCA XORQ rT1, rCa
+#define XORQ_RT1_RCE XORQ rT1, rCe
+#define XORQ_RBA_RCU XORQ rBa, rCu
+#define XORQ_RBE_RCU XORQ rBe, rCu
+#define XORQ_RDU_RCU XORQ rDu, rCu
+#define XORQ_RDA_RCA XORQ rDa, rCa
+#define XORQ_RDE_RCE XORQ rDe, rCe
+
+#define mKeccakRound(iState, oState, rc, B_RBI_RCE, G_RT1_RCA, G_RT1_RCE, G_RBA_RCU, K_RT1_RCA, K_RT1_RCE, K_RBA_RCU, M_RT1_RCA, M_RT1_RCE, M_RBE_RCU, S_RDU_RCU, S_RDA_RCA, S_RDE_RCE) \
+ /* Prepare round */ \
+ MOVQ rCe, rDa; \
+ ROLQ $1, rDa; \
+ \
+ MOVQ _bi(iState), rCi; \
+ XORQ _gi(iState), rDi; \
+ XORQ rCu, rDa; \
+ XORQ _ki(iState), rCi; \
+ XORQ _mi(iState), rDi; \
+ XORQ rDi, rCi; \
+ \
+ MOVQ rCi, rDe; \
+ ROLQ $1, rDe; \
+ \
+ MOVQ _bo(iState), rCo; \
+ XORQ _go(iState), rDo; \
+ XORQ rCa, rDe; \
+ XORQ _ko(iState), rCo; \
+ XORQ _mo(iState), rDo; \
+ XORQ rDo, rCo; \
+ \
+ MOVQ rCo, rDi; \
+ ROLQ $1, rDi; \
+ \
+ MOVQ rCu, rDo; \
+ XORQ rCe, rDi; \
+ ROLQ $1, rDo; \
+ \
+ MOVQ rCa, rDu; \
+ XORQ rCi, rDo; \
+ ROLQ $1, rDu; \
+ \
+ /* Result b */ \
+ MOVQ _ba(iState), rBa; \
+ MOVQ _ge(iState), rBe; \
+ XORQ rCo, rDu; \
+ MOVQ _ki(iState), rBi; \
+ MOVQ _mo(iState), rBo; \
+ MOVQ _su(iState), rBu; \
+ XORQ rDe, rBe; \
+ ROLQ $44, rBe; \
+ XORQ rDi, rBi; \
+ XORQ rDa, rBa; \
+ ROLQ $43, rBi; \
+ \
+ MOVQ rBe, rCa; \
+ MOVQ rc, rT1; \
+ ORQ rBi, rCa; \
+ XORQ rBa, rT1; \
+ XORQ rT1, rCa; \
+ MOVQ rCa, _ba(oState); \
+ \
+ XORQ rDu, rBu; \
+ ROLQ $14, rBu; \
+ MOVQ rBa, rCu; \
+ ANDQ rBe, rCu; \
+ XORQ rBu, rCu; \
+ MOVQ rCu, _bu(oState); \
+ \
+ XORQ rDo, rBo; \
+ ROLQ $21, rBo; \
+ MOVQ rBo, rT1; \
+ ANDQ rBu, rT1; \
+ XORQ rBi, rT1; \
+ MOVQ rT1, _bi(oState); \
+ \
+ NOTQ rBi; \
+ ORQ rBa, rBu; \
+ ORQ rBo, rBi; \
+ XORQ rBo, rBu; \
+ XORQ rBe, rBi; \
+ MOVQ rBu, _bo(oState); \
+ MOVQ rBi, _be(oState); \
+ B_RBI_RCE; \
+ \
+ /* Result g */ \
+ MOVQ _gu(iState), rBe; \
+ XORQ rDu, rBe; \
+ MOVQ _ka(iState), rBi; \
+ ROLQ $20, rBe; \
+ XORQ rDa, rBi; \
+ ROLQ $3, rBi; \
+ MOVQ _bo(iState), rBa; \
+ MOVQ rBe, rT1; \
+ ORQ rBi, rT1; \
+ XORQ rDo, rBa; \
+ MOVQ _me(iState), rBo; \
+ MOVQ _si(iState), rBu; \
+ ROLQ $28, rBa; \
+ XORQ rBa, rT1; \
+ MOVQ rT1, _ga(oState); \
+ G_RT1_RCA; \
+ \
+ XORQ rDe, rBo; \
+ ROLQ $45, rBo; \
+ MOVQ rBi, rT1; \
+ ANDQ rBo, rT1; \
+ XORQ rBe, rT1; \
+ MOVQ rT1, _ge(oState); \
+ G_RT1_RCE; \
+ \
+ XORQ rDi, rBu; \
+ ROLQ $61, rBu; \
+ MOVQ rBu, rT1; \
+ ORQ rBa, rT1; \
+ XORQ rBo, rT1; \
+ MOVQ rT1, _go(oState); \
+ \
+ ANDQ rBe, rBa; \
+ XORQ rBu, rBa; \
+ MOVQ rBa, _gu(oState); \
+ NOTQ rBu; \
+ G_RBA_RCU; \
+ \
+ ORQ rBu, rBo; \
+ XORQ rBi, rBo; \
+ MOVQ rBo, _gi(oState); \
+ \
+ /* Result k */ \
+ MOVQ _be(iState), rBa; \
+ MOVQ _gi(iState), rBe; \
+ MOVQ _ko(iState), rBi; \
+ MOVQ _mu(iState), rBo; \
+ MOVQ _sa(iState), rBu; \
+ XORQ rDi, rBe; \
+ ROLQ $6, rBe; \
+ XORQ rDo, rBi; \
+ ROLQ $25, rBi; \
+ MOVQ rBe, rT1; \
+ ORQ rBi, rT1; \
+ XORQ rDe, rBa; \
+ ROLQ $1, rBa; \
+ XORQ rBa, rT1; \
+ MOVQ rT1, _ka(oState); \
+ K_RT1_RCA; \
+ \
+ XORQ rDu, rBo; \
+ ROLQ $8, rBo; \
+ MOVQ rBi, rT1; \
+ ANDQ rBo, rT1; \
+ XORQ rBe, rT1; \
+ MOVQ rT1, _ke(oState); \
+ K_RT1_RCE; \
+ \
+ XORQ rDa, rBu; \
+ ROLQ $18, rBu; \
+ NOTQ rBo; \
+ MOVQ rBo, rT1; \
+ ANDQ rBu, rT1; \
+ XORQ rBi, rT1; \
+ MOVQ rT1, _ki(oState); \
+ \
+ MOVQ rBu, rT1; \
+ ORQ rBa, rT1; \
+ XORQ rBo, rT1; \
+ MOVQ rT1, _ko(oState); \
+ \
+ ANDQ rBe, rBa; \
+ XORQ rBu, rBa; \
+ MOVQ rBa, _ku(oState); \
+ K_RBA_RCU; \
+ \
+ /* Result m */ \
+ MOVQ _ga(iState), rBe; \
+ XORQ rDa, rBe; \
+ MOVQ _ke(iState), rBi; \
+ ROLQ $36, rBe; \
+ XORQ rDe, rBi; \
+ MOVQ _bu(iState), rBa; \
+ ROLQ $10, rBi; \
+ MOVQ rBe, rT1; \
+ MOVQ _mi(iState), rBo; \
+ ANDQ rBi, rT1; \
+ XORQ rDu, rBa; \
+ MOVQ _so(iState), rBu; \
+ ROLQ $27, rBa; \
+ XORQ rBa, rT1; \
+ MOVQ rT1, _ma(oState); \
+ M_RT1_RCA; \
+ \
+ XORQ rDi, rBo; \
+ ROLQ $15, rBo; \
+ MOVQ rBi, rT1; \
+ ORQ rBo, rT1; \
+ XORQ rBe, rT1; \
+ MOVQ rT1, _me(oState); \
+ M_RT1_RCE; \
+ \
+ XORQ rDo, rBu; \
+ ROLQ $56, rBu; \
+ NOTQ rBo; \
+ MOVQ rBo, rT1; \
+ ORQ rBu, rT1; \
+ XORQ rBi, rT1; \
+ MOVQ rT1, _mi(oState); \
+ \
+ ORQ rBa, rBe; \
+ XORQ rBu, rBe; \
+ MOVQ rBe, _mu(oState); \
+ \
+ ANDQ rBa, rBu; \
+ XORQ rBo, rBu; \
+ MOVQ rBu, _mo(oState); \
+ M_RBE_RCU; \
+ \
+ /* Result s */ \
+ MOVQ _bi(iState), rBa; \
+ MOVQ _go(iState), rBe; \
+ MOVQ _ku(iState), rBi; \
+ XORQ rDi, rBa; \
+ MOVQ _ma(iState), rBo; \
+ ROLQ $62, rBa; \
+ XORQ rDo, rBe; \
+ MOVQ _se(iState), rBu; \
+ ROLQ $55, rBe; \
+ \
+ XORQ rDu, rBi; \
+ MOVQ rBa, rDu; \
+ XORQ rDe, rBu; \
+ ROLQ $2, rBu; \
+ ANDQ rBe, rDu; \
+ XORQ rBu, rDu; \
+ MOVQ rDu, _su(oState); \
+ \
+ ROLQ $39, rBi; \
+ S_RDU_RCU; \
+ NOTQ rBe; \
+ XORQ rDa, rBo; \
+ MOVQ rBe, rDa; \
+ ANDQ rBi, rDa; \
+ XORQ rBa, rDa; \
+ MOVQ rDa, _sa(oState); \
+ S_RDA_RCA; \
+ \
+ ROLQ $41, rBo; \
+ MOVQ rBi, rDe; \
+ ORQ rBo, rDe; \
+ XORQ rBe, rDe; \
+ MOVQ rDe, _se(oState); \
+ S_RDE_RCE; \
+ \
+ MOVQ rBo, rDi; \
+ MOVQ rBu, rDo; \
+ ANDQ rBu, rDi; \
+ ORQ rBa, rDo; \
+ XORQ rBi, rDi; \
+ XORQ rBo, rDo; \
+ MOVQ rDi, _si(oState); \
+ MOVQ rDo, _so(oState) \
+
+// func keccakF1600(state *[25]uint64)
+TEXT ·keccakF1600(SB), 0, $200-8
+ MOVQ state+0(FP), rpState
+
+ // Convert the user state into an internal state
+ NOTQ _be(rpState)
+ NOTQ _bi(rpState)
+ NOTQ _go(rpState)
+ NOTQ _ki(rpState)
+ NOTQ _mi(rpState)
+ NOTQ _sa(rpState)
+
+ // Execute the KeccakF permutation
+ MOVQ _ba(rpState), rCa
+ MOVQ _be(rpState), rCe
+ MOVQ _bu(rpState), rCu
+
+ XORQ _ga(rpState), rCa
+ XORQ _ge(rpState), rCe
+ XORQ _gu(rpState), rCu
+
+ XORQ _ka(rpState), rCa
+ XORQ _ke(rpState), rCe
+ XORQ _ku(rpState), rCu
+
+ XORQ _ma(rpState), rCa
+ XORQ _me(rpState), rCe
+ XORQ _mu(rpState), rCu
+
+ XORQ _sa(rpState), rCa
+ XORQ _se(rpState), rCe
+ MOVQ _si(rpState), rDi
+ MOVQ _so(rpState), rDo
+ XORQ _su(rpState), rCu
+
+ mKeccakRound(rpState, rpStack, $0x0000000000000001, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpStack, rpState, $0x0000000000008082, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpState, rpStack, $0x800000000000808a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpStack, rpState, $0x8000000080008000, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpState, rpStack, $0x000000000000808b, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpStack, rpState, $0x0000000080000001, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpState, rpStack, $0x8000000080008081, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpStack, rpState, $0x8000000000008009, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpState, rpStack, $0x000000000000008a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpStack, rpState, $0x0000000000000088, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpState, rpStack, $0x0000000080008009, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpStack, rpState, $0x000000008000000a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpState, rpStack, $0x000000008000808b, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpStack, rpState, $0x800000000000008b, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpState, rpStack, $0x8000000000008089, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpStack, rpState, $0x8000000000008003, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpState, rpStack, $0x8000000000008002, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpStack, rpState, $0x8000000000000080, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpState, rpStack, $0x000000000000800a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpStack, rpState, $0x800000008000000a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpState, rpStack, $0x8000000080008081, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpStack, rpState, $0x8000000000008080, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpState, rpStack, $0x0000000080000001, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE)
+ mKeccakRound(rpStack, rpState, $0x8000000080008008, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP)
+
+ // Revert the internal state to the user state
+ NOTQ _be(rpState)
+ NOTQ _bi(rpState)
+ NOTQ _go(rpState)
+ NOTQ _ki(rpState)
+ NOTQ _mi(rpState)
+ NOTQ _sa(rpState)
+
+ RET
diff --git a/vendor/golang.org/x/crypto/sha3/register.go b/vendor/golang.org/x/crypto/sha3/register.go
new file mode 100644
index 000000000..8b4453aac
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/register.go
@@ -0,0 +1,19 @@
+// 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.
+
+//go:build go1.4
+// +build go1.4
+
+package sha3
+
+import (
+ "crypto"
+)
+
+func init() {
+ crypto.RegisterHash(crypto.SHA3_224, New224)
+ crypto.RegisterHash(crypto.SHA3_256, New256)
+ crypto.RegisterHash(crypto.SHA3_384, New384)
+ crypto.RegisterHash(crypto.SHA3_512, New512)
+}
diff --git a/vendor/golang.org/x/crypto/sha3/sha3.go b/vendor/golang.org/x/crypto/sha3/sha3.go
new file mode 100644
index 000000000..ba269a073
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/sha3.go
@@ -0,0 +1,193 @@
+// 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 sha3
+
+// spongeDirection indicates the direction bytes are flowing through the sponge.
+type spongeDirection int
+
+const (
+ // spongeAbsorbing indicates that the sponge is absorbing input.
+ spongeAbsorbing spongeDirection = iota
+ // spongeSqueezing indicates that the sponge is being squeezed.
+ spongeSqueezing
+)
+
+const (
+ // maxRate is the maximum size of the internal buffer. SHAKE-256
+ // currently needs the largest buffer.
+ maxRate = 168
+)
+
+type state struct {
+ // Generic sponge components.
+ a [25]uint64 // main state of the hash
+ buf []byte // points into storage
+ rate int // the number of bytes of state to use
+
+ // dsbyte contains the "domain separation" bits and the first bit of
+ // the padding. Sections 6.1 and 6.2 of [1] separate the outputs of the
+ // SHA-3 and SHAKE functions by appending bitstrings to the message.
+ // Using a little-endian bit-ordering convention, these are "01" for SHA-3
+ // and "1111" for SHAKE, or 00000010b and 00001111b, respectively. Then the
+ // padding rule from section 5.1 is applied to pad the message to a multiple
+ // of the rate, which involves adding a "1" bit, zero or more "0" bits, and
+ // a final "1" bit. We merge the first "1" bit from the padding into dsbyte,
+ // giving 00000110b (0x06) and 00011111b (0x1f).
+ // [1] http://csrc.nist.gov/publications/drafts/fips-202/fips_202_draft.pdf
+ // "Draft FIPS 202: SHA-3 Standard: Permutation-Based Hash and
+ // Extendable-Output Functions (May 2014)"
+ dsbyte byte
+
+ storage storageBuf
+
+ // Specific to SHA-3 and SHAKE.
+ outputLen int // the default output size in bytes
+ state spongeDirection // whether the sponge is absorbing or squeezing
+}
+
+// BlockSize returns the rate of sponge underlying this hash function.
+func (d *state) BlockSize() int { return d.rate }
+
+// Size returns the output size of the hash function in bytes.
+func (d *state) Size() int { return d.outputLen }
+
+// Reset clears the internal state by zeroing the sponge state and
+// the byte buffer, and setting Sponge.state to absorbing.
+func (d *state) Reset() {
+ // Zero the permutation's state.
+ for i := range d.a {
+ d.a[i] = 0
+ }
+ d.state = spongeAbsorbing
+ d.buf = d.storage.asBytes()[:0]
+}
+
+func (d *state) clone() *state {
+ ret := *d
+ if ret.state == spongeAbsorbing {
+ ret.buf = ret.storage.asBytes()[:len(ret.buf)]
+ } else {
+ ret.buf = ret.storage.asBytes()[d.rate-cap(d.buf) : d.rate]
+ }
+
+ return &ret
+}
+
+// permute applies the KeccakF-1600 permutation. It handles
+// any input-output buffering.
+func (d *state) permute() {
+ switch d.state {
+ case spongeAbsorbing:
+ // If we're absorbing, we need to xor the input into the state
+ // before applying the permutation.
+ xorIn(d, d.buf)
+ d.buf = d.storage.asBytes()[:0]
+ keccakF1600(&d.a)
+ case spongeSqueezing:
+ // If we're squeezing, we need to apply the permutatin before
+ // copying more output.
+ keccakF1600(&d.a)
+ d.buf = d.storage.asBytes()[:d.rate]
+ copyOut(d, d.buf)
+ }
+}
+
+// pads appends the domain separation bits in dsbyte, applies
+// the multi-bitrate 10..1 padding rule, and permutes the state.
+func (d *state) padAndPermute(dsbyte byte) {
+ if d.buf == nil {
+ d.buf = d.storage.asBytes()[:0]
+ }
+ // Pad with this instance's domain-separator bits. We know that there's
+ // at least one byte of space in d.buf because, if it were full,
+ // permute would have been called to empty it. dsbyte also contains the
+ // first one bit for the padding. See the comment in the state struct.
+ d.buf = append(d.buf, dsbyte)
+ zerosStart := len(d.buf)
+ d.buf = d.storage.asBytes()[:d.rate]
+ for i := zerosStart; i < d.rate; i++ {
+ d.buf[i] = 0
+ }
+ // This adds the final one bit for the padding. Because of the way that
+ // bits are numbered from the LSB upwards, the final bit is the MSB of
+ // the last byte.
+ d.buf[d.rate-1] ^= 0x80
+ // Apply the permutation
+ d.permute()
+ d.state = spongeSqueezing
+ d.buf = d.storage.asBytes()[:d.rate]
+ copyOut(d, d.buf)
+}
+
+// Write absorbs more data into the hash's state. It produces an error
+// if more data is written to the ShakeHash after writing
+func (d *state) Write(p []byte) (written int, err error) {
+ if d.state != spongeAbsorbing {
+ panic("sha3: write to sponge after read")
+ }
+ if d.buf == nil {
+ d.buf = d.storage.asBytes()[:0]
+ }
+ written = len(p)
+
+ for len(p) > 0 {
+ if len(d.buf) == 0 && len(p) >= d.rate {
+ // The fast path; absorb a full "rate" bytes of input and apply the permutation.
+ xorIn(d, p[:d.rate])
+ p = p[d.rate:]
+ keccakF1600(&d.a)
+ } else {
+ // The slow path; buffer the input until we can fill the sponge, and then xor it in.
+ todo := d.rate - len(d.buf)
+ if todo > len(p) {
+ todo = len(p)
+ }
+ d.buf = append(d.buf, p[:todo]...)
+ p = p[todo:]
+
+ // If the sponge is full, apply the permutation.
+ if len(d.buf) == d.rate {
+ d.permute()
+ }
+ }
+ }
+
+ return
+}
+
+// Read squeezes an arbitrary number of bytes from the sponge.
+func (d *state) Read(out []byte) (n int, err error) {
+ // If we're still absorbing, pad and apply the permutation.
+ if d.state == spongeAbsorbing {
+ d.padAndPermute(d.dsbyte)
+ }
+
+ n = len(out)
+
+ // Now, do the squeezing.
+ for len(out) > 0 {
+ n := copy(out, d.buf)
+ d.buf = d.buf[n:]
+ out = out[n:]
+
+ // Apply the permutation if we've squeezed the sponge dry.
+ if len(d.buf) == 0 {
+ d.permute()
+ }
+ }
+
+ return
+}
+
+// Sum applies padding to the hash state and then squeezes out the desired
+// number of output bytes.
+func (d *state) Sum(in []byte) []byte {
+ // Make a copy of the original hash so that caller can keep writing
+ // and summing.
+ dup := d.clone()
+ hash := make([]byte, dup.outputLen)
+ dup.Read(hash)
+ return append(in, hash...)
+}
diff --git a/vendor/golang.org/x/crypto/sha3/sha3_s390x.go b/vendor/golang.org/x/crypto/sha3/sha3_s390x.go
new file mode 100644
index 000000000..4fcfc924e
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/sha3_s390x.go
@@ -0,0 +1,285 @@
+// Copyright 2017 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:build gc && !purego
+// +build gc,!purego
+
+package sha3
+
+// This file contains code for using the 'compute intermediate
+// message digest' (KIMD) and 'compute last message digest' (KLMD)
+// instructions to compute SHA-3 and SHAKE hashes on IBM Z.
+
+import (
+ "hash"
+
+ "golang.org/x/sys/cpu"
+)
+
+// codes represent 7-bit KIMD/KLMD function codes as defined in
+// the Principles of Operation.
+type code uint64
+
+const (
+ // function codes for KIMD/KLMD
+ sha3_224 code = 32
+ sha3_256 = 33
+ sha3_384 = 34
+ sha3_512 = 35
+ shake_128 = 36
+ shake_256 = 37
+ nopad = 0x100
+)
+
+// kimd is a wrapper for the 'compute intermediate message digest' instruction.
+// src must be a multiple of the rate for the given function code.
+//go:noescape
+func kimd(function code, chain *[200]byte, src []byte)
+
+// klmd is a wrapper for the 'compute last message digest' instruction.
+// src padding is handled by the instruction.
+//go:noescape
+func klmd(function code, chain *[200]byte, dst, src []byte)
+
+type asmState struct {
+ a [200]byte // 1600 bit state
+ buf []byte // care must be taken to ensure cap(buf) is a multiple of rate
+ rate int // equivalent to block size
+ storage [3072]byte // underlying storage for buf
+ outputLen int // output length if fixed, 0 if not
+ function code // KIMD/KLMD function code
+ state spongeDirection // whether the sponge is absorbing or squeezing
+}
+
+func newAsmState(function code) *asmState {
+ var s asmState
+ s.function = function
+ switch function {
+ case sha3_224:
+ s.rate = 144
+ s.outputLen = 28
+ case sha3_256:
+ s.rate = 136
+ s.outputLen = 32
+ case sha3_384:
+ s.rate = 104
+ s.outputLen = 48
+ case sha3_512:
+ s.rate = 72
+ s.outputLen = 64
+ case shake_128:
+ s.rate = 168
+ case shake_256:
+ s.rate = 136
+ default:
+ panic("sha3: unrecognized function code")
+ }
+
+ // limit s.buf size to a multiple of s.rate
+ s.resetBuf()
+ return &s
+}
+
+func (s *asmState) clone() *asmState {
+ c := *s
+ c.buf = c.storage[:len(s.buf):cap(s.buf)]
+ return &c
+}
+
+// copyIntoBuf copies b into buf. It will panic if there is not enough space to
+// store all of b.
+func (s *asmState) copyIntoBuf(b []byte) {
+ bufLen := len(s.buf)
+ s.buf = s.buf[:len(s.buf)+len(b)]
+ copy(s.buf[bufLen:], b)
+}
+
+// resetBuf points buf at storage, sets the length to 0 and sets cap to be a
+// multiple of the rate.
+func (s *asmState) resetBuf() {
+ max := (cap(s.storage) / s.rate) * s.rate
+ s.buf = s.storage[:0:max]
+}
+
+// Write (via the embedded io.Writer interface) adds more data to the running hash.
+// It never returns an error.
+func (s *asmState) Write(b []byte) (int, error) {
+ if s.state != spongeAbsorbing {
+ panic("sha3: write to sponge after read")
+ }
+ length := len(b)
+ for len(b) > 0 {
+ if len(s.buf) == 0 && len(b) >= cap(s.buf) {
+ // Hash the data directly and push any remaining bytes
+ // into the buffer.
+ remainder := len(b) % s.rate
+ kimd(s.function, &s.a, b[:len(b)-remainder])
+ if remainder != 0 {
+ s.copyIntoBuf(b[len(b)-remainder:])
+ }
+ return length, nil
+ }
+
+ if len(s.buf) == cap(s.buf) {
+ // flush the buffer
+ kimd(s.function, &s.a, s.buf)
+ s.buf = s.buf[:0]
+ }
+
+ // copy as much as we can into the buffer
+ n := len(b)
+ if len(b) > cap(s.buf)-len(s.buf) {
+ n = cap(s.buf) - len(s.buf)
+ }
+ s.copyIntoBuf(b[:n])
+ b = b[n:]
+ }
+ return length, nil
+}
+
+// Read squeezes an arbitrary number of bytes from the sponge.
+func (s *asmState) Read(out []byte) (n int, err error) {
+ n = len(out)
+
+ // need to pad if we were absorbing
+ if s.state == spongeAbsorbing {
+ s.state = spongeSqueezing
+
+ // write hash directly into out if possible
+ if len(out)%s.rate == 0 {
+ klmd(s.function, &s.a, out, s.buf) // len(out) may be 0
+ s.buf = s.buf[:0]
+ return
+ }
+
+ // write hash into buffer
+ max := cap(s.buf)
+ if max > len(out) {
+ max = (len(out)/s.rate)*s.rate + s.rate
+ }
+ klmd(s.function, &s.a, s.buf[:max], s.buf)
+ s.buf = s.buf[:max]
+ }
+
+ for len(out) > 0 {
+ // flush the buffer
+ if len(s.buf) != 0 {
+ c := copy(out, s.buf)
+ out = out[c:]
+ s.buf = s.buf[c:]
+ continue
+ }
+
+ // write hash directly into out if possible
+ if len(out)%s.rate == 0 {
+ klmd(s.function|nopad, &s.a, out, nil)
+ return
+ }
+
+ // write hash into buffer
+ s.resetBuf()
+ if cap(s.buf) > len(out) {
+ s.buf = s.buf[:(len(out)/s.rate)*s.rate+s.rate]
+ }
+ klmd(s.function|nopad, &s.a, s.buf, nil)
+ }
+ return
+}
+
+// Sum appends the current hash to b and returns the resulting slice.
+// It does not change the underlying hash state.
+func (s *asmState) Sum(b []byte) []byte {
+ if s.outputLen == 0 {
+ panic("sha3: cannot call Sum on SHAKE functions")
+ }
+
+ // Copy the state to preserve the original.
+ a := s.a
+
+ // Hash the buffer. Note that we don't clear it because we
+ // aren't updating the state.
+ klmd(s.function, &a, nil, s.buf)
+ return append(b, a[:s.outputLen]...)
+}
+
+// Reset resets the Hash to its initial state.
+func (s *asmState) Reset() {
+ for i := range s.a {
+ s.a[i] = 0
+ }
+ s.resetBuf()
+ s.state = spongeAbsorbing
+}
+
+// Size returns the number of bytes Sum will return.
+func (s *asmState) Size() int {
+ return s.outputLen
+}
+
+// BlockSize returns the hash's underlying block size.
+// The Write method must be able to accept any amount
+// of data, but it may operate more efficiently if all writes
+// are a multiple of the block size.
+func (s *asmState) BlockSize() int {
+ return s.rate
+}
+
+// Clone returns a copy of the ShakeHash in its current state.
+func (s *asmState) Clone() ShakeHash {
+ return s.clone()
+}
+
+// new224Asm returns an assembly implementation of SHA3-224 if available,
+// otherwise it returns nil.
+func new224Asm() hash.Hash {
+ if cpu.S390X.HasSHA3 {
+ return newAsmState(sha3_224)
+ }
+ return nil
+}
+
+// new256Asm returns an assembly implementation of SHA3-256 if available,
+// otherwise it returns nil.
+func new256Asm() hash.Hash {
+ if cpu.S390X.HasSHA3 {
+ return newAsmState(sha3_256)
+ }
+ return nil
+}
+
+// new384Asm returns an assembly implementation of SHA3-384 if available,
+// otherwise it returns nil.
+func new384Asm() hash.Hash {
+ if cpu.S390X.HasSHA3 {
+ return newAsmState(sha3_384)
+ }
+ return nil
+}
+
+// new512Asm returns an assembly implementation of SHA3-512 if available,
+// otherwise it returns nil.
+func new512Asm() hash.Hash {
+ if cpu.S390X.HasSHA3 {
+ return newAsmState(sha3_512)
+ }
+ return nil
+}
+
+// newShake128Asm returns an assembly implementation of SHAKE-128 if available,
+// otherwise it returns nil.
+func newShake128Asm() ShakeHash {
+ if cpu.S390X.HasSHA3 {
+ return newAsmState(shake_128)
+ }
+ return nil
+}
+
+// newShake256Asm returns an assembly implementation of SHAKE-256 if available,
+// otherwise it returns nil.
+func newShake256Asm() ShakeHash {
+ if cpu.S390X.HasSHA3 {
+ return newAsmState(shake_256)
+ }
+ return nil
+}
diff --git a/vendor/golang.org/x/crypto/sha3/sha3_s390x.s b/vendor/golang.org/x/crypto/sha3/sha3_s390x.s
new file mode 100644
index 000000000..a0e051b04
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/sha3_s390x.s
@@ -0,0 +1,34 @@
+// Copyright 2017 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:build gc && !purego
+// +build gc,!purego
+
+#include "textflag.h"
+
+// func kimd(function code, chain *[200]byte, src []byte)
+TEXT ·kimd(SB), NOFRAME|NOSPLIT, $0-40
+ MOVD function+0(FP), R0
+ MOVD chain+8(FP), R1
+ LMG src+16(FP), R2, R3 // R2=base, R3=len
+
+continue:
+ WORD $0xB93E0002 // KIMD --, R2
+ BVS continue // continue if interrupted
+ MOVD $0, R0 // reset R0 for pre-go1.8 compilers
+ RET
+
+// func klmd(function code, chain *[200]byte, dst, src []byte)
+TEXT ·klmd(SB), NOFRAME|NOSPLIT, $0-64
+ // TODO: SHAKE support
+ MOVD function+0(FP), R0
+ MOVD chain+8(FP), R1
+ LMG dst+16(FP), R2, R3 // R2=base, R3=len
+ LMG src+40(FP), R4, R5 // R4=base, R5=len
+
+continue:
+ WORD $0xB93F0024 // KLMD R2, R4
+ BVS continue // continue if interrupted
+ MOVD $0, R0 // reset R0 for pre-go1.8 compilers
+ RET
diff --git a/vendor/golang.org/x/crypto/sha3/shake.go b/vendor/golang.org/x/crypto/sha3/shake.go
new file mode 100644
index 000000000..d7be2954a
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/shake.go
@@ -0,0 +1,173 @@
+// 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 sha3
+
+// This file defines the ShakeHash interface, and provides
+// functions for creating SHAKE and cSHAKE instances, as well as utility
+// functions for hashing bytes to arbitrary-length output.
+//
+//
+// SHAKE implementation is based on FIPS PUB 202 [1]
+// cSHAKE implementations is based on NIST SP 800-185 [2]
+//
+// [1] https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf
+// [2] https://doi.org/10.6028/NIST.SP.800-185
+
+import (
+ "encoding/binary"
+ "io"
+)
+
+// ShakeHash defines the interface to hash functions that
+// support arbitrary-length output.
+type ShakeHash interface {
+ // Write absorbs more data into the hash's state. It panics if input is
+ // written to it after output has been read from it.
+ io.Writer
+
+ // Read reads more output from the hash; reading affects the hash's
+ // state. (ShakeHash.Read is thus very different from Hash.Sum)
+ // It never returns an error.
+ io.Reader
+
+ // Clone returns a copy of the ShakeHash in its current state.
+ Clone() ShakeHash
+
+ // Reset resets the ShakeHash to its initial state.
+ Reset()
+}
+
+// cSHAKE specific context
+type cshakeState struct {
+ *state // SHA-3 state context and Read/Write operations
+
+ // initBlock is the cSHAKE specific initialization set of bytes. It is initialized
+ // by newCShake function and stores concatenation of N followed by S, encoded
+ // by the method specified in 3.3 of [1].
+ // It is stored here in order for Reset() to be able to put context into
+ // initial state.
+ initBlock []byte
+}
+
+// Consts for configuring initial SHA-3 state
+const (
+ dsbyteShake = 0x1f
+ dsbyteCShake = 0x04
+ rate128 = 168
+ rate256 = 136
+)
+
+func bytepad(input []byte, w int) []byte {
+ // leftEncode always returns max 9 bytes
+ buf := make([]byte, 0, 9+len(input)+w)
+ buf = append(buf, leftEncode(uint64(w))...)
+ buf = append(buf, input...)
+ padlen := w - (len(buf) % w)
+ return append(buf, make([]byte, padlen)...)
+}
+
+func leftEncode(value uint64) []byte {
+ var b [9]byte
+ binary.BigEndian.PutUint64(b[1:], value)
+ // Trim all but last leading zero bytes
+ i := byte(1)
+ for i < 8 && b[i] == 0 {
+ i++
+ }
+ // Prepend number of encoded bytes
+ b[i-1] = 9 - i
+ return b[i-1:]
+}
+
+func newCShake(N, S []byte, rate int, dsbyte byte) ShakeHash {
+ c := cshakeState{state: &state{rate: rate, dsbyte: dsbyte}}
+
+ // leftEncode returns max 9 bytes
+ c.initBlock = make([]byte, 0, 9*2+len(N)+len(S))
+ c.initBlock = append(c.initBlock, leftEncode(uint64(len(N)*8))...)
+ c.initBlock = append(c.initBlock, N...)
+ c.initBlock = append(c.initBlock, leftEncode(uint64(len(S)*8))...)
+ c.initBlock = append(c.initBlock, S...)
+ c.Write(bytepad(c.initBlock, c.rate))
+ return &c
+}
+
+// Reset resets the hash to initial state.
+func (c *cshakeState) Reset() {
+ c.state.Reset()
+ c.Write(bytepad(c.initBlock, c.rate))
+}
+
+// Clone returns copy of a cSHAKE context within its current state.
+func (c *cshakeState) Clone() ShakeHash {
+ b := make([]byte, len(c.initBlock))
+ copy(b, c.initBlock)
+ return &cshakeState{state: c.clone(), initBlock: b}
+}
+
+// Clone returns copy of SHAKE context within its current state.
+func (c *state) Clone() ShakeHash {
+ return c.clone()
+}
+
+// NewShake128 creates a new SHAKE128 variable-output-length ShakeHash.
+// Its generic security strength is 128 bits against all attacks if at
+// least 32 bytes of its output are used.
+func NewShake128() ShakeHash {
+ if h := newShake128Asm(); h != nil {
+ return h
+ }
+ return &state{rate: rate128, dsbyte: dsbyteShake}
+}
+
+// NewShake256 creates a new SHAKE256 variable-output-length ShakeHash.
+// Its generic security strength is 256 bits against all attacks if
+// at least 64 bytes of its output are used.
+func NewShake256() ShakeHash {
+ if h := newShake256Asm(); h != nil {
+ return h
+ }
+ return &state{rate: rate256, dsbyte: dsbyteShake}
+}
+
+// NewCShake128 creates a new instance of cSHAKE128 variable-output-length ShakeHash,
+// a customizable variant of SHAKE128.
+// N is used to define functions based on cSHAKE, it can be empty when plain cSHAKE is
+// desired. S is a customization byte string used for domain separation - two cSHAKE
+// computations on same input with different S yield unrelated outputs.
+// When N and S are both empty, this is equivalent to NewShake128.
+func NewCShake128(N, S []byte) ShakeHash {
+ if len(N) == 0 && len(S) == 0 {
+ return NewShake128()
+ }
+ return newCShake(N, S, rate128, dsbyteCShake)
+}
+
+// NewCShake256 creates a new instance of cSHAKE256 variable-output-length ShakeHash,
+// a customizable variant of SHAKE256.
+// N is used to define functions based on cSHAKE, it can be empty when plain cSHAKE is
+// desired. S is a customization byte string used for domain separation - two cSHAKE
+// computations on same input with different S yield unrelated outputs.
+// When N and S are both empty, this is equivalent to NewShake256.
+func NewCShake256(N, S []byte) ShakeHash {
+ if len(N) == 0 && len(S) == 0 {
+ return NewShake256()
+ }
+ return newCShake(N, S, rate256, dsbyteCShake)
+}
+
+// ShakeSum128 writes an arbitrary-length digest of data into hash.
+func ShakeSum128(hash, data []byte) {
+ h := NewShake128()
+ h.Write(data)
+ h.Read(hash)
+}
+
+// ShakeSum256 writes an arbitrary-length digest of data into hash.
+func ShakeSum256(hash, data []byte) {
+ h := NewShake256()
+ h.Write(data)
+ h.Read(hash)
+}
diff --git a/vendor/golang.org/x/crypto/sha3/shake_generic.go b/vendor/golang.org/x/crypto/sha3/shake_generic.go
new file mode 100644
index 000000000..5c0710ef9
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/shake_generic.go
@@ -0,0 +1,20 @@
+// Copyright 2017 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:build !gc || purego || !s390x
+// +build !gc purego !s390x
+
+package sha3
+
+// newShake128Asm returns an assembly implementation of SHAKE-128 if available,
+// otherwise it returns nil.
+func newShake128Asm() ShakeHash {
+ return nil
+}
+
+// newShake256Asm returns an assembly implementation of SHAKE-256 if available,
+// otherwise it returns nil.
+func newShake256Asm() ShakeHash {
+ return nil
+}
diff --git a/vendor/golang.org/x/crypto/sha3/xor.go b/vendor/golang.org/x/crypto/sha3/xor.go
new file mode 100644
index 000000000..59c8eb941
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/xor.go
@@ -0,0 +1,24 @@
+// 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.
+
+//go:build (!amd64 && !386 && !ppc64le) || purego
+// +build !amd64,!386,!ppc64le purego
+
+package sha3
+
+// A storageBuf is an aligned array of maxRate bytes.
+type storageBuf [maxRate]byte
+
+func (b *storageBuf) asBytes() *[maxRate]byte {
+ return (*[maxRate]byte)(b)
+}
+
+var (
+ xorIn = xorInGeneric
+ copyOut = copyOutGeneric
+ xorInUnaligned = xorInGeneric
+ copyOutUnaligned = copyOutGeneric
+)
+
+const xorImplementationUnaligned = "generic"
diff --git a/vendor/golang.org/x/crypto/sha3/xor_generic.go b/vendor/golang.org/x/crypto/sha3/xor_generic.go
new file mode 100644
index 000000000..8d9477112
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/xor_generic.go
@@ -0,0 +1,28 @@
+// 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 sha3
+
+import "encoding/binary"
+
+// xorInGeneric xors the bytes in buf into the state; it
+// makes no non-portable assumptions about memory layout
+// or alignment.
+func xorInGeneric(d *state, buf []byte) {
+ n := len(buf) / 8
+
+ for i := 0; i < n; i++ {
+ a := binary.LittleEndian.Uint64(buf)
+ d.a[i] ^= a
+ buf = buf[8:]
+ }
+}
+
+// copyOutGeneric copies uint64s to a byte buffer.
+func copyOutGeneric(d *state, b []byte) {
+ for i := 0; len(b) >= 8; i++ {
+ binary.LittleEndian.PutUint64(b, d.a[i])
+ b = b[8:]
+ }
+}
diff --git a/vendor/golang.org/x/crypto/sha3/xor_unaligned.go b/vendor/golang.org/x/crypto/sha3/xor_unaligned.go
new file mode 100644
index 000000000..1ce606246
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/xor_unaligned.go
@@ -0,0 +1,68 @@
+// 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.
+
+//go:build (amd64 || 386 || ppc64le) && !purego
+// +build amd64 386 ppc64le
+// +build !purego
+
+package sha3
+
+import "unsafe"
+
+// A storageBuf is an aligned array of maxRate bytes.
+type storageBuf [maxRate / 8]uint64
+
+func (b *storageBuf) asBytes() *[maxRate]byte {
+ return (*[maxRate]byte)(unsafe.Pointer(b))
+}
+
+// xorInUnaligned uses unaligned reads and writes to update d.a to contain d.a
+// XOR buf.
+func xorInUnaligned(d *state, buf []byte) {
+ n := len(buf)
+ bw := (*[maxRate / 8]uint64)(unsafe.Pointer(&buf[0]))[: n/8 : n/8]
+ if n >= 72 {
+ d.a[0] ^= bw[0]
+ d.a[1] ^= bw[1]
+ d.a[2] ^= bw[2]
+ d.a[3] ^= bw[3]
+ d.a[4] ^= bw[4]
+ d.a[5] ^= bw[5]
+ d.a[6] ^= bw[6]
+ d.a[7] ^= bw[7]
+ d.a[8] ^= bw[8]
+ }
+ if n >= 104 {
+ d.a[9] ^= bw[9]
+ d.a[10] ^= bw[10]
+ d.a[11] ^= bw[11]
+ d.a[12] ^= bw[12]
+ }
+ if n >= 136 {
+ d.a[13] ^= bw[13]
+ d.a[14] ^= bw[14]
+ d.a[15] ^= bw[15]
+ d.a[16] ^= bw[16]
+ }
+ if n >= 144 {
+ d.a[17] ^= bw[17]
+ }
+ if n >= 168 {
+ d.a[18] ^= bw[18]
+ d.a[19] ^= bw[19]
+ d.a[20] ^= bw[20]
+ }
+}
+
+func copyOutUnaligned(d *state, buf []byte) {
+ ab := (*[maxRate]uint8)(unsafe.Pointer(&d.a[0]))
+ copy(buf, ab[:])
+}
+
+var (
+ xorIn = xorInUnaligned
+ copyOut = copyOutUnaligned
+)
+
+const xorImplementationUnaligned = "unaligned"
diff --git a/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s b/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s
new file mode 100644
index 000000000..db9171c2e
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s
@@ -0,0 +1,18 @@
+// Copyright 2018 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:build gc
+// +build gc
+
+#include "textflag.h"
+
+//
+// System calls for ppc64, AIX are implemented in runtime/syscall_aix.go
+//
+
+TEXT ·syscall6(SB),NOSPLIT,$0-88
+ JMP syscall·syscall6(SB)
+
+TEXT ·rawSyscall6(SB),NOSPLIT,$0-88
+ JMP syscall·rawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/cpu/byteorder.go b/vendor/golang.org/x/sys/cpu/byteorder.go
new file mode 100644
index 000000000..dcbb14ef3
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/byteorder.go
@@ -0,0 +1,65 @@
+// Copyright 2019 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 cpu
+
+import (
+ "runtime"
+)
+
+// byteOrder is a subset of encoding/binary.ByteOrder.
+type byteOrder interface {
+ Uint32([]byte) uint32
+ Uint64([]byte) uint64
+}
+
+type littleEndian struct{}
+type bigEndian struct{}
+
+func (littleEndian) Uint32(b []byte) uint32 {
+ _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808
+ return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
+}
+
+func (littleEndian) Uint64(b []byte) uint64 {
+ _ = b[7] // bounds check hint to compiler; see golang.org/issue/14808
+ return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 |
+ uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
+}
+
+func (bigEndian) Uint32(b []byte) uint32 {
+ _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808
+ return uint32(b[3]) | uint32(b[2])<<8 | uint32(b[1])<<16 | uint32(b[0])<<24
+}
+
+func (bigEndian) Uint64(b []byte) uint64 {
+ _ = b[7] // bounds check hint to compiler; see golang.org/issue/14808
+ return uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 |
+ uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56
+}
+
+// hostByteOrder returns littleEndian on little-endian machines and
+// bigEndian on big-endian machines.
+func hostByteOrder() byteOrder {
+ switch runtime.GOARCH {
+ case "386", "amd64", "amd64p32",
+ "alpha",
+ "arm", "arm64",
+ "mipsle", "mips64le", "mips64p32le",
+ "nios2",
+ "ppc64le",
+ "riscv", "riscv64",
+ "sh":
+ return littleEndian{}
+ case "armbe", "arm64be",
+ "m68k",
+ "mips", "mips64", "mips64p32",
+ "ppc", "ppc64",
+ "s390", "s390x",
+ "shbe",
+ "sparc", "sparc64":
+ return bigEndian{}
+ }
+ panic("unknown architecture")
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go
new file mode 100644
index 000000000..b56886f26
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu.go
@@ -0,0 +1,287 @@
+// Copyright 2018 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 cpu implements processor feature detection for
+// various CPU architectures.
+package cpu
+
+import (
+ "os"
+ "strings"
+)
+
+// Initialized reports whether the CPU features were initialized.
+//
+// For some GOOS/GOARCH combinations initialization of the CPU features depends
+// on reading an operating specific file, e.g. /proc/self/auxv on linux/arm
+// Initialized will report false if reading the file fails.
+var Initialized bool
+
+// CacheLinePad is used to pad structs to avoid false sharing.
+type CacheLinePad struct{ _ [cacheLineSize]byte }
+
+// X86 contains the supported CPU features of the
+// current X86/AMD64 platform. If the current platform
+// is not X86/AMD64 then all feature flags are false.
+//
+// X86 is padded to avoid false sharing. Further the HasAVX
+// and HasAVX2 are only set if the OS supports XMM and YMM
+// registers in addition to the CPUID feature bit being set.
+var X86 struct {
+ _ CacheLinePad
+ HasAES bool // AES hardware implementation (AES NI)
+ HasADX bool // Multi-precision add-carry instruction extensions
+ HasAVX bool // Advanced vector extension
+ HasAVX2 bool // Advanced vector extension 2
+ HasAVX512 bool // Advanced vector extension 512
+ HasAVX512F bool // Advanced vector extension 512 Foundation Instructions
+ HasAVX512CD bool // Advanced vector extension 512 Conflict Detection Instructions
+ HasAVX512ER bool // Advanced vector extension 512 Exponential and Reciprocal Instructions
+ HasAVX512PF bool // Advanced vector extension 512 Prefetch Instructions Instructions
+ HasAVX512VL bool // Advanced vector extension 512 Vector Length Extensions
+ HasAVX512BW bool // Advanced vector extension 512 Byte and Word Instructions
+ HasAVX512DQ bool // Advanced vector extension 512 Doubleword and Quadword Instructions
+ HasAVX512IFMA bool // Advanced vector extension 512 Integer Fused Multiply Add
+ HasAVX512VBMI bool // Advanced vector extension 512 Vector Byte Manipulation Instructions
+ HasAVX5124VNNIW bool // Advanced vector extension 512 Vector Neural Network Instructions Word variable precision
+ HasAVX5124FMAPS bool // Advanced vector extension 512 Fused Multiply Accumulation Packed Single precision
+ HasAVX512VPOPCNTDQ bool // Advanced vector extension 512 Double and quad word population count instructions
+ HasAVX512VPCLMULQDQ bool // Advanced vector extension 512 Vector carry-less multiply operations
+ HasAVX512VNNI bool // Advanced vector extension 512 Vector Neural Network Instructions
+ HasAVX512GFNI bool // Advanced vector extension 512 Galois field New Instructions
+ HasAVX512VAES bool // Advanced vector extension 512 Vector AES instructions
+ HasAVX512VBMI2 bool // Advanced vector extension 512 Vector Byte Manipulation Instructions 2
+ HasAVX512BITALG bool // Advanced vector extension 512 Bit Algorithms
+ HasAVX512BF16 bool // Advanced vector extension 512 BFloat16 Instructions
+ HasBMI1 bool // Bit manipulation instruction set 1
+ HasBMI2 bool // Bit manipulation instruction set 2
+ HasCX16 bool // Compare and exchange 16 Bytes
+ HasERMS bool // Enhanced REP for MOVSB and STOSB
+ HasFMA bool // Fused-multiply-add instructions
+ HasOSXSAVE bool // OS supports XSAVE/XRESTOR for saving/restoring XMM registers.
+ HasPCLMULQDQ bool // PCLMULQDQ instruction - most often used for AES-GCM
+ HasPOPCNT bool // Hamming weight instruction POPCNT.
+ HasRDRAND bool // RDRAND instruction (on-chip random number generator)
+ HasRDSEED bool // RDSEED instruction (on-chip random number generator)
+ HasSSE2 bool // Streaming SIMD extension 2 (always available on amd64)
+ HasSSE3 bool // Streaming SIMD extension 3
+ HasSSSE3 bool // Supplemental streaming SIMD extension 3
+ HasSSE41 bool // Streaming SIMD extension 4 and 4.1
+ HasSSE42 bool // Streaming SIMD extension 4 and 4.2
+ _ CacheLinePad
+}
+
+// ARM64 contains the supported CPU features of the
+// current ARMv8(aarch64) platform. If the current platform
+// is not arm64 then all feature flags are false.
+var ARM64 struct {
+ _ CacheLinePad
+ HasFP bool // Floating-point instruction set (always available)
+ HasASIMD bool // Advanced SIMD (always available)
+ HasEVTSTRM bool // Event stream support
+ HasAES bool // AES hardware implementation
+ HasPMULL bool // Polynomial multiplication instruction set
+ HasSHA1 bool // SHA1 hardware implementation
+ HasSHA2 bool // SHA2 hardware implementation
+ HasCRC32 bool // CRC32 hardware implementation
+ HasATOMICS bool // Atomic memory operation instruction set
+ HasFPHP bool // Half precision floating-point instruction set
+ HasASIMDHP bool // Advanced SIMD half precision instruction set
+ HasCPUID bool // CPUID identification scheme registers
+ HasASIMDRDM bool // Rounding double multiply add/subtract instruction set
+ HasJSCVT bool // Javascript conversion from floating-point to integer
+ HasFCMA bool // Floating-point multiplication and addition of complex numbers
+ HasLRCPC bool // Release Consistent processor consistent support
+ HasDCPOP bool // Persistent memory support
+ HasSHA3 bool // SHA3 hardware implementation
+ HasSM3 bool // SM3 hardware implementation
+ HasSM4 bool // SM4 hardware implementation
+ HasASIMDDP bool // Advanced SIMD double precision instruction set
+ HasSHA512 bool // SHA512 hardware implementation
+ HasSVE bool // Scalable Vector Extensions
+ HasASIMDFHM bool // Advanced SIMD multiplication FP16 to FP32
+ _ CacheLinePad
+}
+
+// ARM contains the supported CPU features of the current ARM (32-bit) platform.
+// All feature flags are false if:
+// 1. the current platform is not arm, or
+// 2. the current operating system is not Linux.
+var ARM struct {
+ _ CacheLinePad
+ HasSWP bool // SWP instruction support
+ HasHALF bool // Half-word load and store support
+ HasTHUMB bool // ARM Thumb instruction set
+ Has26BIT bool // Address space limited to 26-bits
+ HasFASTMUL bool // 32-bit operand, 64-bit result multiplication support
+ HasFPA bool // Floating point arithmetic support
+ HasVFP bool // Vector floating point support
+ HasEDSP bool // DSP Extensions support
+ HasJAVA bool // Java instruction set
+ HasIWMMXT bool // Intel Wireless MMX technology support
+ HasCRUNCH bool // MaverickCrunch context switching and handling
+ HasTHUMBEE bool // Thumb EE instruction set
+ HasNEON bool // NEON instruction set
+ HasVFPv3 bool // Vector floating point version 3 support
+ HasVFPv3D16 bool // Vector floating point version 3 D8-D15
+ HasTLS bool // Thread local storage support
+ HasVFPv4 bool // Vector floating point version 4 support
+ HasIDIVA bool // Integer divide instruction support in ARM mode
+ HasIDIVT bool // Integer divide instruction support in Thumb mode
+ HasVFPD32 bool // Vector floating point version 3 D15-D31
+ HasLPAE bool // Large Physical Address Extensions
+ HasEVTSTRM bool // Event stream support
+ HasAES bool // AES hardware implementation
+ HasPMULL bool // Polynomial multiplication instruction set
+ HasSHA1 bool // SHA1 hardware implementation
+ HasSHA2 bool // SHA2 hardware implementation
+ HasCRC32 bool // CRC32 hardware implementation
+ _ CacheLinePad
+}
+
+// MIPS64X contains the supported CPU features of the current mips64/mips64le
+// platforms. If the current platform is not mips64/mips64le or the current
+// operating system is not Linux then all feature flags are false.
+var MIPS64X struct {
+ _ CacheLinePad
+ HasMSA bool // MIPS SIMD architecture
+ _ CacheLinePad
+}
+
+// PPC64 contains the supported CPU features of the current ppc64/ppc64le platforms.
+// If the current platform is not ppc64/ppc64le then all feature flags are false.
+//
+// For ppc64/ppc64le, it is safe to check only for ISA level starting on ISA v3.00,
+// since there are no optional categories. There are some exceptions that also
+// require kernel support to work (DARN, SCV), so there are feature bits for
+// those as well. The struct is padded to avoid false sharing.
+var PPC64 struct {
+ _ CacheLinePad
+ HasDARN bool // Hardware random number generator (requires kernel enablement)
+ HasSCV bool // Syscall vectored (requires kernel enablement)
+ IsPOWER8 bool // ISA v2.07 (POWER8)
+ IsPOWER9 bool // ISA v3.00 (POWER9), implies IsPOWER8
+ _ CacheLinePad
+}
+
+// S390X contains the supported CPU features of the current IBM Z
+// (s390x) platform. If the current platform is not IBM Z then all
+// feature flags are false.
+//
+// S390X is padded to avoid false sharing. Further HasVX is only set
+// if the OS supports vector registers in addition to the STFLE
+// feature bit being set.
+var S390X struct {
+ _ CacheLinePad
+ HasZARCH bool // z/Architecture mode is active [mandatory]
+ HasSTFLE bool // store facility list extended
+ HasLDISP bool // long (20-bit) displacements
+ HasEIMM bool // 32-bit immediates
+ HasDFP bool // decimal floating point
+ HasETF3EH bool // ETF-3 enhanced
+ HasMSA bool // message security assist (CPACF)
+ HasAES bool // KM-AES{128,192,256} functions
+ HasAESCBC bool // KMC-AES{128,192,256} functions
+ HasAESCTR bool // KMCTR-AES{128,192,256} functions
+ HasAESGCM bool // KMA-GCM-AES{128,192,256} functions
+ HasGHASH bool // KIMD-GHASH function
+ HasSHA1 bool // K{I,L}MD-SHA-1 functions
+ HasSHA256 bool // K{I,L}MD-SHA-256 functions
+ HasSHA512 bool // K{I,L}MD-SHA-512 functions
+ HasSHA3 bool // K{I,L}MD-SHA3-{224,256,384,512} and K{I,L}MD-SHAKE-{128,256} functions
+ HasVX bool // vector facility
+ HasVXE bool // vector-enhancements facility 1
+ _ CacheLinePad
+}
+
+func init() {
+ archInit()
+ initOptions()
+ processOptions()
+}
+
+// options contains the cpu debug options that can be used in GODEBUG.
+// Options are arch dependent and are added by the arch specific initOptions functions.
+// Features that are mandatory for the specific GOARCH should have the Required field set
+// (e.g. SSE2 on amd64).
+var options []option
+
+// Option names should be lower case. e.g. avx instead of AVX.
+type option struct {
+ Name string
+ Feature *bool
+ Specified bool // whether feature value was specified in GODEBUG
+ Enable bool // whether feature should be enabled
+ Required bool // whether feature is mandatory and can not be disabled
+}
+
+func processOptions() {
+ env := os.Getenv("GODEBUG")
+field:
+ for env != "" {
+ field := ""
+ i := strings.IndexByte(env, ',')
+ if i < 0 {
+ field, env = env, ""
+ } else {
+ field, env = env[:i], env[i+1:]
+ }
+ if len(field) < 4 || field[:4] != "cpu." {
+ continue
+ }
+ i = strings.IndexByte(field, '=')
+ if i < 0 {
+ print("GODEBUG sys/cpu: no value specified for \"", field, "\"\n")
+ continue
+ }
+ key, value := field[4:i], field[i+1:] // e.g. "SSE2", "on"
+
+ var enable bool
+ switch value {
+ case "on":
+ enable = true
+ case "off":
+ enable = false
+ default:
+ print("GODEBUG sys/cpu: value \"", value, "\" not supported for cpu option \"", key, "\"\n")
+ continue field
+ }
+
+ if key == "all" {
+ for i := range options {
+ options[i].Specified = true
+ options[i].Enable = enable || options[i].Required
+ }
+ continue field
+ }
+
+ for i := range options {
+ if options[i].Name == key {
+ options[i].Specified = true
+ options[i].Enable = enable
+ continue field
+ }
+ }
+
+ print("GODEBUG sys/cpu: unknown cpu feature \"", key, "\"\n")
+ }
+
+ for _, o := range options {
+ if !o.Specified {
+ continue
+ }
+
+ if o.Enable && !*o.Feature {
+ print("GODEBUG sys/cpu: can not enable \"", o.Name, "\", missing CPU support\n")
+ continue
+ }
+
+ if !o.Enable && o.Required {
+ print("GODEBUG sys/cpu: can not disable \"", o.Name, "\", required CPU feature\n")
+ continue
+ }
+
+ *o.Feature = o.Enable
+ }
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_aix.go b/vendor/golang.org/x/sys/cpu/cpu_aix.go
new file mode 100644
index 000000000..8aaeef545
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_aix.go
@@ -0,0 +1,34 @@
+// Copyright 2019 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:build aix
+// +build aix
+
+package cpu
+
+const (
+ // getsystemcfg constants
+ _SC_IMPL = 2
+ _IMPL_POWER8 = 0x10000
+ _IMPL_POWER9 = 0x20000
+)
+
+func archInit() {
+ impl := getsystemcfg(_SC_IMPL)
+ if impl&_IMPL_POWER8 != 0 {
+ PPC64.IsPOWER8 = true
+ }
+ if impl&_IMPL_POWER9 != 0 {
+ PPC64.IsPOWER8 = true
+ PPC64.IsPOWER9 = true
+ }
+
+ Initialized = true
+}
+
+func getsystemcfg(label int) (n uint64) {
+ r0, _ := callgetsystemcfg(label)
+ n = uint64(r0)
+ return
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm.go b/vendor/golang.org/x/sys/cpu/cpu_arm.go
new file mode 100644
index 000000000..301b752e9
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_arm.go
@@ -0,0 +1,73 @@
+// Copyright 2018 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 cpu
+
+const cacheLineSize = 32
+
+// HWCAP/HWCAP2 bits.
+// These are specific to Linux.
+const (
+ hwcap_SWP = 1 << 0
+ hwcap_HALF = 1 << 1
+ hwcap_THUMB = 1 << 2
+ hwcap_26BIT = 1 << 3
+ hwcap_FAST_MULT = 1 << 4
+ hwcap_FPA = 1 << 5
+ hwcap_VFP = 1 << 6
+ hwcap_EDSP = 1 << 7
+ hwcap_JAVA = 1 << 8
+ hwcap_IWMMXT = 1 << 9
+ hwcap_CRUNCH = 1 << 10
+ hwcap_THUMBEE = 1 << 11
+ hwcap_NEON = 1 << 12
+ hwcap_VFPv3 = 1 << 13
+ hwcap_VFPv3D16 = 1 << 14
+ hwcap_TLS = 1 << 15
+ hwcap_VFPv4 = 1 << 16
+ hwcap_IDIVA = 1 << 17
+ hwcap_IDIVT = 1 << 18
+ hwcap_VFPD32 = 1 << 19
+ hwcap_LPAE = 1 << 20
+ hwcap_EVTSTRM = 1 << 21
+
+ hwcap2_AES = 1 << 0
+ hwcap2_PMULL = 1 << 1
+ hwcap2_SHA1 = 1 << 2
+ hwcap2_SHA2 = 1 << 3
+ hwcap2_CRC32 = 1 << 4
+)
+
+func initOptions() {
+ options = []option{
+ {Name: "pmull", Feature: &ARM.HasPMULL},
+ {Name: "sha1", Feature: &ARM.HasSHA1},
+ {Name: "sha2", Feature: &ARM.HasSHA2},
+ {Name: "swp", Feature: &ARM.HasSWP},
+ {Name: "thumb", Feature: &ARM.HasTHUMB},
+ {Name: "thumbee", Feature: &ARM.HasTHUMBEE},
+ {Name: "tls", Feature: &ARM.HasTLS},
+ {Name: "vfp", Feature: &ARM.HasVFP},
+ {Name: "vfpd32", Feature: &ARM.HasVFPD32},
+ {Name: "vfpv3", Feature: &ARM.HasVFPv3},
+ {Name: "vfpv3d16", Feature: &ARM.HasVFPv3D16},
+ {Name: "vfpv4", Feature: &ARM.HasVFPv4},
+ {Name: "half", Feature: &ARM.HasHALF},
+ {Name: "26bit", Feature: &ARM.Has26BIT},
+ {Name: "fastmul", Feature: &ARM.HasFASTMUL},
+ {Name: "fpa", Feature: &ARM.HasFPA},
+ {Name: "edsp", Feature: &ARM.HasEDSP},
+ {Name: "java", Feature: &ARM.HasJAVA},
+ {Name: "iwmmxt", Feature: &ARM.HasIWMMXT},
+ {Name: "crunch", Feature: &ARM.HasCRUNCH},
+ {Name: "neon", Feature: &ARM.HasNEON},
+ {Name: "idivt", Feature: &ARM.HasIDIVT},
+ {Name: "idiva", Feature: &ARM.HasIDIVA},
+ {Name: "lpae", Feature: &ARM.HasLPAE},
+ {Name: "evtstrm", Feature: &ARM.HasEVTSTRM},
+ {Name: "aes", Feature: &ARM.HasAES},
+ {Name: "crc32", Feature: &ARM.HasCRC32},
+ }
+
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
new file mode 100644
index 000000000..87dd5e302
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
@@ -0,0 +1,172 @@
+// Copyright 2019 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 cpu
+
+import "runtime"
+
+const cacheLineSize = 64
+
+func initOptions() {
+ options = []option{
+ {Name: "fp", Feature: &ARM64.HasFP},
+ {Name: "asimd", Feature: &ARM64.HasASIMD},
+ {Name: "evstrm", Feature: &ARM64.HasEVTSTRM},
+ {Name: "aes", Feature: &ARM64.HasAES},
+ {Name: "fphp", Feature: &ARM64.HasFPHP},
+ {Name: "jscvt", Feature: &ARM64.HasJSCVT},
+ {Name: "lrcpc", Feature: &ARM64.HasLRCPC},
+ {Name: "pmull", Feature: &ARM64.HasPMULL},
+ {Name: "sha1", Feature: &ARM64.HasSHA1},
+ {Name: "sha2", Feature: &ARM64.HasSHA2},
+ {Name: "sha3", Feature: &ARM64.HasSHA3},
+ {Name: "sha512", Feature: &ARM64.HasSHA512},
+ {Name: "sm3", Feature: &ARM64.HasSM3},
+ {Name: "sm4", Feature: &ARM64.HasSM4},
+ {Name: "sve", Feature: &ARM64.HasSVE},
+ {Name: "crc32", Feature: &ARM64.HasCRC32},
+ {Name: "atomics", Feature: &ARM64.HasATOMICS},
+ {Name: "asimdhp", Feature: &ARM64.HasASIMDHP},
+ {Name: "cpuid", Feature: &ARM64.HasCPUID},
+ {Name: "asimrdm", Feature: &ARM64.HasASIMDRDM},
+ {Name: "fcma", Feature: &ARM64.HasFCMA},
+ {Name: "dcpop", Feature: &ARM64.HasDCPOP},
+ {Name: "asimddp", Feature: &ARM64.HasASIMDDP},
+ {Name: "asimdfhm", Feature: &ARM64.HasASIMDFHM},
+ }
+}
+
+func archInit() {
+ switch runtime.GOOS {
+ case "freebsd":
+ readARM64Registers()
+ case "linux", "netbsd":
+ doinit()
+ default:
+ // Most platforms don't seem to allow reading these registers.
+ //
+ // OpenBSD:
+ // See https://golang.org/issue/31746
+ setMinimalFeatures()
+ }
+}
+
+// setMinimalFeatures fakes the minimal ARM64 features expected by
+// TestARM64minimalFeatures.
+func setMinimalFeatures() {
+ ARM64.HasASIMD = true
+ ARM64.HasFP = true
+}
+
+func readARM64Registers() {
+ Initialized = true
+
+ parseARM64SystemRegisters(getisar0(), getisar1(), getpfr0())
+}
+
+func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) {
+ // ID_AA64ISAR0_EL1
+ switch extractBits(isar0, 4, 7) {
+ case 1:
+ ARM64.HasAES = true
+ case 2:
+ ARM64.HasAES = true
+ ARM64.HasPMULL = true
+ }
+
+ switch extractBits(isar0, 8, 11) {
+ case 1:
+ ARM64.HasSHA1 = true
+ }
+
+ switch extractBits(isar0, 12, 15) {
+ case 1:
+ ARM64.HasSHA2 = true
+ case 2:
+ ARM64.HasSHA2 = true
+ ARM64.HasSHA512 = true
+ }
+
+ switch extractBits(isar0, 16, 19) {
+ case 1:
+ ARM64.HasCRC32 = true
+ }
+
+ switch extractBits(isar0, 20, 23) {
+ case 2:
+ ARM64.HasATOMICS = true
+ }
+
+ switch extractBits(isar0, 28, 31) {
+ case 1:
+ ARM64.HasASIMDRDM = true
+ }
+
+ switch extractBits(isar0, 32, 35) {
+ case 1:
+ ARM64.HasSHA3 = true
+ }
+
+ switch extractBits(isar0, 36, 39) {
+ case 1:
+ ARM64.HasSM3 = true
+ }
+
+ switch extractBits(isar0, 40, 43) {
+ case 1:
+ ARM64.HasSM4 = true
+ }
+
+ switch extractBits(isar0, 44, 47) {
+ case 1:
+ ARM64.HasASIMDDP = true
+ }
+
+ // ID_AA64ISAR1_EL1
+ switch extractBits(isar1, 0, 3) {
+ case 1:
+ ARM64.HasDCPOP = true
+ }
+
+ switch extractBits(isar1, 12, 15) {
+ case 1:
+ ARM64.HasJSCVT = true
+ }
+
+ switch extractBits(isar1, 16, 19) {
+ case 1:
+ ARM64.HasFCMA = true
+ }
+
+ switch extractBits(isar1, 20, 23) {
+ case 1:
+ ARM64.HasLRCPC = true
+ }
+
+ // ID_AA64PFR0_EL1
+ switch extractBits(pfr0, 16, 19) {
+ case 0:
+ ARM64.HasFP = true
+ case 1:
+ ARM64.HasFP = true
+ ARM64.HasFPHP = true
+ }
+
+ switch extractBits(pfr0, 20, 23) {
+ case 0:
+ ARM64.HasASIMD = true
+ case 1:
+ ARM64.HasASIMD = true
+ ARM64.HasASIMDHP = true
+ }
+
+ switch extractBits(pfr0, 32, 35) {
+ case 1:
+ ARM64.HasSVE = true
+ }
+}
+
+func extractBits(data uint64, start, end uint) uint {
+ return (uint)(data>>start) & ((1 << (end - start + 1)) - 1)
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.s b/vendor/golang.org/x/sys/cpu/cpu_arm64.s
new file mode 100644
index 000000000..c61f95a05
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.s
@@ -0,0 +1,32 @@
+// Copyright 2019 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:build gc
+// +build gc
+
+#include "textflag.h"
+
+// func getisar0() uint64
+TEXT ·getisar0(SB),NOSPLIT,$0-8
+ // get Instruction Set Attributes 0 into x0
+ // mrs x0, ID_AA64ISAR0_EL1 = d5380600
+ WORD $0xd5380600
+ MOVD R0, ret+0(FP)
+ RET
+
+// func getisar1() uint64
+TEXT ·getisar1(SB),NOSPLIT,$0-8
+ // get Instruction Set Attributes 1 into x0
+ // mrs x0, ID_AA64ISAR1_EL1 = d5380620
+ WORD $0xd5380620
+ MOVD R0, ret+0(FP)
+ RET
+
+// func getpfr0() uint64
+TEXT ·getpfr0(SB),NOSPLIT,$0-8
+ // get Processor Feature Register 0 into x0
+ // mrs x0, ID_AA64PFR0_EL1 = d5380400
+ WORD $0xd5380400
+ MOVD R0, ret+0(FP)
+ RET
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go
new file mode 100644
index 000000000..ccf542a73
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go
@@ -0,0 +1,12 @@
+// Copyright 2019 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:build gc
+// +build gc
+
+package cpu
+
+func getisar0() uint64
+func getisar1() uint64
+func getpfr0() uint64
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go b/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go
new file mode 100644
index 000000000..0af2f2484
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go
@@ -0,0 +1,22 @@
+// Copyright 2019 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:build gc
+// +build gc
+
+package cpu
+
+// haveAsmFunctions reports whether the other functions in this file can
+// be safely called.
+func haveAsmFunctions() bool { return true }
+
+// The following feature detection functions are defined in cpu_s390x.s.
+// They are likely to be expensive to call so the results should be cached.
+func stfle() facilityList
+func kmQuery() queryResult
+func kmcQuery() queryResult
+func kmctrQuery() queryResult
+func kmaQuery() queryResult
+func kimdQuery() queryResult
+func klmdQuery() queryResult
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go b/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go
new file mode 100644
index 000000000..3298a87e9
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go
@@ -0,0 +1,21 @@
+// Copyright 2018 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:build (386 || amd64 || amd64p32) && gc
+// +build 386 amd64 amd64p32
+// +build gc
+
+package cpu
+
+// cpuid is implemented in cpu_x86.s for gc compiler
+// and in cpu_gccgo.c for gccgo.
+func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32)
+
+// xgetbv with ecx = 0 is implemented in cpu_x86.s for gc compiler
+// and in cpu_gccgo.c for gccgo.
+func xgetbv() (eax, edx uint32)
+
+// darwinSupportsAVX512 is implemented in cpu_x86.s for gc compiler
+// and in cpu_gccgo_x86.go for gccgo.
+func darwinSupportsAVX512() bool
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go
new file mode 100644
index 000000000..2aff31891
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go
@@ -0,0 +1,12 @@
+// Copyright 2019 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:build gccgo
+// +build gccgo
+
+package cpu
+
+func getisar0() uint64 { return 0 }
+func getisar1() uint64 { return 0 }
+func getpfr0() uint64 { return 0 }
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go
new file mode 100644
index 000000000..4bfbda619
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go
@@ -0,0 +1,23 @@
+// Copyright 2019 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:build gccgo
+// +build gccgo
+
+package cpu
+
+// haveAsmFunctions reports whether the other functions in this file can
+// be safely called.
+func haveAsmFunctions() bool { return false }
+
+// TODO(mundaym): the following feature detection functions are currently
+// stubs. See https://golang.org/cl/162887 for how to fix this.
+// They are likely to be expensive to call so the results should be cached.
+func stfle() facilityList { panic("not implemented for gccgo") }
+func kmQuery() queryResult { panic("not implemented for gccgo") }
+func kmcQuery() queryResult { panic("not implemented for gccgo") }
+func kmctrQuery() queryResult { panic("not implemented for gccgo") }
+func kmaQuery() queryResult { panic("not implemented for gccgo") }
+func kimdQuery() queryResult { panic("not implemented for gccgo") }
+func klmdQuery() queryResult { panic("not implemented for gccgo") }
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c
new file mode 100644
index 000000000..e363c7d13
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c
@@ -0,0 +1,43 @@
+// Copyright 2018 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 386 amd64 amd64p32
+// +build gccgo
+
+#include
+#include
+
+// Need to wrap __get_cpuid_count because it's declared as static.
+int
+gccgoGetCpuidCount(uint32_t leaf, uint32_t subleaf,
+ uint32_t *eax, uint32_t *ebx,
+ uint32_t *ecx, uint32_t *edx)
+{
+ return __get_cpuid_count(leaf, subleaf, eax, ebx, ecx, edx);
+}
+
+// xgetbv reads the contents of an XCR (Extended Control Register)
+// specified in the ECX register into registers EDX:EAX.
+// Currently, the only supported value for XCR is 0.
+//
+// TODO: Replace with a better alternative:
+//
+// #include
+//
+// #pragma GCC target("xsave")
+//
+// void gccgoXgetbv(uint32_t *eax, uint32_t *edx) {
+// unsigned long long x = _xgetbv(0);
+// *eax = x & 0xffffffff;
+// *edx = (x >> 32) & 0xffffffff;
+// }
+//
+// Note that _xgetbv is defined starting with GCC 8.
+void
+gccgoXgetbv(uint32_t *eax, uint32_t *edx)
+{
+ __asm(" xorl %%ecx, %%ecx\n"
+ " xgetbv"
+ : "=a"(*eax), "=d"(*edx));
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go
new file mode 100644
index 000000000..863d415ab
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go
@@ -0,0 +1,33 @@
+// Copyright 2018 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:build (386 || amd64 || amd64p32) && gccgo
+// +build 386 amd64 amd64p32
+// +build gccgo
+
+package cpu
+
+//extern gccgoGetCpuidCount
+func gccgoGetCpuidCount(eaxArg, ecxArg uint32, eax, ebx, ecx, edx *uint32)
+
+func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) {
+ var a, b, c, d uint32
+ gccgoGetCpuidCount(eaxArg, ecxArg, &a, &b, &c, &d)
+ return a, b, c, d
+}
+
+//extern gccgoXgetbv
+func gccgoXgetbv(eax, edx *uint32)
+
+func xgetbv() (eax, edx uint32) {
+ var a, d uint32
+ gccgoXgetbv(&a, &d)
+ return a, d
+}
+
+// gccgo doesn't build on Darwin, per:
+// https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gcc.rb#L76
+func darwinSupportsAVX512() bool {
+ return false
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux.go b/vendor/golang.org/x/sys/cpu/cpu_linux.go
new file mode 100644
index 000000000..159a686f6
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux.go
@@ -0,0 +1,16 @@
+// Copyright 2018 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:build !386 && !amd64 && !amd64p32 && !arm64
+// +build !386,!amd64,!amd64p32,!arm64
+
+package cpu
+
+func archInit() {
+ if err := readHWCAP(); err != nil {
+ return
+ }
+ doinit()
+ Initialized = true
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_arm.go b/vendor/golang.org/x/sys/cpu/cpu_linux_arm.go
new file mode 100644
index 000000000..2057006dc
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_arm.go
@@ -0,0 +1,39 @@
+// Copyright 2019 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 cpu
+
+func doinit() {
+ ARM.HasSWP = isSet(hwCap, hwcap_SWP)
+ ARM.HasHALF = isSet(hwCap, hwcap_HALF)
+ ARM.HasTHUMB = isSet(hwCap, hwcap_THUMB)
+ ARM.Has26BIT = isSet(hwCap, hwcap_26BIT)
+ ARM.HasFASTMUL = isSet(hwCap, hwcap_FAST_MULT)
+ ARM.HasFPA = isSet(hwCap, hwcap_FPA)
+ ARM.HasVFP = isSet(hwCap, hwcap_VFP)
+ ARM.HasEDSP = isSet(hwCap, hwcap_EDSP)
+ ARM.HasJAVA = isSet(hwCap, hwcap_JAVA)
+ ARM.HasIWMMXT = isSet(hwCap, hwcap_IWMMXT)
+ ARM.HasCRUNCH = isSet(hwCap, hwcap_CRUNCH)
+ ARM.HasTHUMBEE = isSet(hwCap, hwcap_THUMBEE)
+ ARM.HasNEON = isSet(hwCap, hwcap_NEON)
+ ARM.HasVFPv3 = isSet(hwCap, hwcap_VFPv3)
+ ARM.HasVFPv3D16 = isSet(hwCap, hwcap_VFPv3D16)
+ ARM.HasTLS = isSet(hwCap, hwcap_TLS)
+ ARM.HasVFPv4 = isSet(hwCap, hwcap_VFPv4)
+ ARM.HasIDIVA = isSet(hwCap, hwcap_IDIVA)
+ ARM.HasIDIVT = isSet(hwCap, hwcap_IDIVT)
+ ARM.HasVFPD32 = isSet(hwCap, hwcap_VFPD32)
+ ARM.HasLPAE = isSet(hwCap, hwcap_LPAE)
+ ARM.HasEVTSTRM = isSet(hwCap, hwcap_EVTSTRM)
+ ARM.HasAES = isSet(hwCap2, hwcap2_AES)
+ ARM.HasPMULL = isSet(hwCap2, hwcap2_PMULL)
+ ARM.HasSHA1 = isSet(hwCap2, hwcap2_SHA1)
+ ARM.HasSHA2 = isSet(hwCap2, hwcap2_SHA2)
+ ARM.HasCRC32 = isSet(hwCap2, hwcap2_CRC32)
+}
+
+func isSet(hwc uint, value uint) bool {
+ return hwc&value != 0
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
new file mode 100644
index 000000000..79a38a0b9
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
@@ -0,0 +1,71 @@
+// Copyright 2018 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 cpu
+
+// HWCAP/HWCAP2 bits. These are exposed by Linux.
+const (
+ hwcap_FP = 1 << 0
+ hwcap_ASIMD = 1 << 1
+ hwcap_EVTSTRM = 1 << 2
+ hwcap_AES = 1 << 3
+ hwcap_PMULL = 1 << 4
+ hwcap_SHA1 = 1 << 5
+ hwcap_SHA2 = 1 << 6
+ hwcap_CRC32 = 1 << 7
+ hwcap_ATOMICS = 1 << 8
+ hwcap_FPHP = 1 << 9
+ hwcap_ASIMDHP = 1 << 10
+ hwcap_CPUID = 1 << 11
+ hwcap_ASIMDRDM = 1 << 12
+ hwcap_JSCVT = 1 << 13
+ hwcap_FCMA = 1 << 14
+ hwcap_LRCPC = 1 << 15
+ hwcap_DCPOP = 1 << 16
+ hwcap_SHA3 = 1 << 17
+ hwcap_SM3 = 1 << 18
+ hwcap_SM4 = 1 << 19
+ hwcap_ASIMDDP = 1 << 20
+ hwcap_SHA512 = 1 << 21
+ hwcap_SVE = 1 << 22
+ hwcap_ASIMDFHM = 1 << 23
+)
+
+func doinit() {
+ if err := readHWCAP(); err != nil {
+ // failed to read /proc/self/auxv, try reading registers directly
+ readARM64Registers()
+ return
+ }
+
+ // HWCAP feature bits
+ ARM64.HasFP = isSet(hwCap, hwcap_FP)
+ ARM64.HasASIMD = isSet(hwCap, hwcap_ASIMD)
+ ARM64.HasEVTSTRM = isSet(hwCap, hwcap_EVTSTRM)
+ ARM64.HasAES = isSet(hwCap, hwcap_AES)
+ ARM64.HasPMULL = isSet(hwCap, hwcap_PMULL)
+ ARM64.HasSHA1 = isSet(hwCap, hwcap_SHA1)
+ ARM64.HasSHA2 = isSet(hwCap, hwcap_SHA2)
+ ARM64.HasCRC32 = isSet(hwCap, hwcap_CRC32)
+ ARM64.HasATOMICS = isSet(hwCap, hwcap_ATOMICS)
+ ARM64.HasFPHP = isSet(hwCap, hwcap_FPHP)
+ ARM64.HasASIMDHP = isSet(hwCap, hwcap_ASIMDHP)
+ ARM64.HasCPUID = isSet(hwCap, hwcap_CPUID)
+ ARM64.HasASIMDRDM = isSet(hwCap, hwcap_ASIMDRDM)
+ ARM64.HasJSCVT = isSet(hwCap, hwcap_JSCVT)
+ ARM64.HasFCMA = isSet(hwCap, hwcap_FCMA)
+ ARM64.HasLRCPC = isSet(hwCap, hwcap_LRCPC)
+ ARM64.HasDCPOP = isSet(hwCap, hwcap_DCPOP)
+ ARM64.HasSHA3 = isSet(hwCap, hwcap_SHA3)
+ ARM64.HasSM3 = isSet(hwCap, hwcap_SM3)
+ ARM64.HasSM4 = isSet(hwCap, hwcap_SM4)
+ ARM64.HasASIMDDP = isSet(hwCap, hwcap_ASIMDDP)
+ ARM64.HasSHA512 = isSet(hwCap, hwcap_SHA512)
+ ARM64.HasSVE = isSet(hwCap, hwcap_SVE)
+ ARM64.HasASIMDFHM = isSet(hwCap, hwcap_ASIMDFHM)
+}
+
+func isSet(hwc uint, value uint) bool {
+ return hwc&value != 0
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go b/vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go
new file mode 100644
index 000000000..6000db4cd
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go
@@ -0,0 +1,24 @@
+// Copyright 2020 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:build linux && (mips64 || mips64le)
+// +build linux
+// +build mips64 mips64le
+
+package cpu
+
+// HWCAP bits. These are exposed by the Linux kernel 5.4.
+const (
+ // CPU features
+ hwcap_MIPS_MSA = 1 << 1
+)
+
+func doinit() {
+ // HWCAP feature bits
+ MIPS64X.HasMSA = isSet(hwCap, hwcap_MIPS_MSA)
+}
+
+func isSet(hwc uint, value uint) bool {
+ return hwc&value != 0
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go
new file mode 100644
index 000000000..f4992b1a5
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go
@@ -0,0 +1,10 @@
+// Copyright 2019 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:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x
+// +build linux,!arm,!arm64,!mips64,!mips64le,!ppc64,!ppc64le,!s390x
+
+package cpu
+
+func doinit() {}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go
new file mode 100644
index 000000000..021356d6d
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go
@@ -0,0 +1,32 @@
+// Copyright 2018 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:build linux && (ppc64 || ppc64le)
+// +build linux
+// +build ppc64 ppc64le
+
+package cpu
+
+// HWCAP/HWCAP2 bits. These are exposed by the kernel.
+const (
+ // ISA Level
+ _PPC_FEATURE2_ARCH_2_07 = 0x80000000
+ _PPC_FEATURE2_ARCH_3_00 = 0x00800000
+
+ // CPU features
+ _PPC_FEATURE2_DARN = 0x00200000
+ _PPC_FEATURE2_SCV = 0x00100000
+)
+
+func doinit() {
+ // HWCAP2 feature bits
+ PPC64.IsPOWER8 = isSet(hwCap2, _PPC_FEATURE2_ARCH_2_07)
+ PPC64.IsPOWER9 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_00)
+ PPC64.HasDARN = isSet(hwCap2, _PPC_FEATURE2_DARN)
+ PPC64.HasSCV = isSet(hwCap2, _PPC_FEATURE2_SCV)
+}
+
+func isSet(hwc uint, value uint) bool {
+ return hwc&value != 0
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_s390x.go b/vendor/golang.org/x/sys/cpu/cpu_linux_s390x.go
new file mode 100644
index 000000000..1517ac61d
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_s390x.go
@@ -0,0 +1,40 @@
+// Copyright 2019 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 cpu
+
+const (
+ // bit mask values from /usr/include/bits/hwcap.h
+ hwcap_ZARCH = 2
+ hwcap_STFLE = 4
+ hwcap_MSA = 8
+ hwcap_LDISP = 16
+ hwcap_EIMM = 32
+ hwcap_DFP = 64
+ hwcap_ETF3EH = 256
+ hwcap_VX = 2048
+ hwcap_VXE = 8192
+)
+
+func initS390Xbase() {
+ // test HWCAP bit vector
+ has := func(featureMask uint) bool {
+ return hwCap&featureMask == featureMask
+ }
+
+ // mandatory
+ S390X.HasZARCH = has(hwcap_ZARCH)
+
+ // optional
+ S390X.HasSTFLE = has(hwcap_STFLE)
+ S390X.HasLDISP = has(hwcap_LDISP)
+ S390X.HasEIMM = has(hwcap_EIMM)
+ S390X.HasETF3EH = has(hwcap_ETF3EH)
+ S390X.HasDFP = has(hwcap_DFP)
+ S390X.HasMSA = has(hwcap_MSA)
+ S390X.HasVX = has(hwcap_VX)
+ if S390X.HasVX {
+ S390X.HasVXE = has(hwcap_VXE)
+ }
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_mips64x.go b/vendor/golang.org/x/sys/cpu/cpu_mips64x.go
new file mode 100644
index 000000000..f4063c664
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_mips64x.go
@@ -0,0 +1,16 @@
+// Copyright 2018 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:build mips64 || mips64le
+// +build mips64 mips64le
+
+package cpu
+
+const cacheLineSize = 32
+
+func initOptions() {
+ options = []option{
+ {Name: "msa", Feature: &MIPS64X.HasMSA},
+ }
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_mipsx.go b/vendor/golang.org/x/sys/cpu/cpu_mipsx.go
new file mode 100644
index 000000000..07c4e36d8
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_mipsx.go
@@ -0,0 +1,12 @@
+// Copyright 2018 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:build mips || mipsle
+// +build mips mipsle
+
+package cpu
+
+const cacheLineSize = 32
+
+func initOptions() {}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go
new file mode 100644
index 000000000..ebfb3fc8e
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go
@@ -0,0 +1,173 @@
+// Copyright 2020 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 cpu
+
+import (
+ "syscall"
+ "unsafe"
+)
+
+// Minimal copy of functionality from x/sys/unix so the cpu package can call
+// sysctl without depending on x/sys/unix.
+
+const (
+ _CTL_QUERY = -2
+
+ _SYSCTL_VERS_1 = 0x1000000
+)
+
+var _zero uintptr
+
+func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
+ var _p0 unsafe.Pointer
+ if len(mib) > 0 {
+ _p0 = unsafe.Pointer(&mib[0])
+ } else {
+ _p0 = unsafe.Pointer(&_zero)
+ }
+ _, _, errno := syscall.Syscall6(
+ syscall.SYS___SYSCTL,
+ uintptr(_p0),
+ uintptr(len(mib)),
+ uintptr(unsafe.Pointer(old)),
+ uintptr(unsafe.Pointer(oldlen)),
+ uintptr(unsafe.Pointer(new)),
+ uintptr(newlen))
+ if errno != 0 {
+ return errno
+ }
+ return nil
+}
+
+type sysctlNode struct {
+ Flags uint32
+ Num int32
+ Name [32]int8
+ Ver uint32
+ __rsvd uint32
+ Un [16]byte
+ _sysctl_size [8]byte
+ _sysctl_func [8]byte
+ _sysctl_parent [8]byte
+ _sysctl_desc [8]byte
+}
+
+func sysctlNodes(mib []int32) ([]sysctlNode, error) {
+ var olen uintptr
+
+ // Get a list of all sysctl nodes below the given MIB by performing
+ // a sysctl for the given MIB with CTL_QUERY appended.
+ mib = append(mib, _CTL_QUERY)
+ qnode := sysctlNode{Flags: _SYSCTL_VERS_1}
+ qp := (*byte)(unsafe.Pointer(&qnode))
+ sz := unsafe.Sizeof(qnode)
+ if err := sysctl(mib, nil, &olen, qp, sz); err != nil {
+ return nil, err
+ }
+
+ // Now that we know the size, get the actual nodes.
+ nodes := make([]sysctlNode, olen/sz)
+ np := (*byte)(unsafe.Pointer(&nodes[0]))
+ if err := sysctl(mib, np, &olen, qp, sz); err != nil {
+ return nil, err
+ }
+
+ return nodes, nil
+}
+
+func nametomib(name string) ([]int32, error) {
+ // Split name into components.
+ var parts []string
+ last := 0
+ for i := 0; i < len(name); i++ {
+ if name[i] == '.' {
+ parts = append(parts, name[last:i])
+ last = i + 1
+ }
+ }
+ parts = append(parts, name[last:])
+
+ mib := []int32{}
+ // Discover the nodes and construct the MIB OID.
+ for partno, part := range parts {
+ nodes, err := sysctlNodes(mib)
+ if err != nil {
+ return nil, err
+ }
+ for _, node := range nodes {
+ n := make([]byte, 0)
+ for i := range node.Name {
+ if node.Name[i] != 0 {
+ n = append(n, byte(node.Name[i]))
+ }
+ }
+ if string(n) == part {
+ mib = append(mib, int32(node.Num))
+ break
+ }
+ }
+ if len(mib) != partno+1 {
+ return nil, err
+ }
+ }
+
+ return mib, nil
+}
+
+// aarch64SysctlCPUID is struct aarch64_sysctl_cpu_id from NetBSD's
+type aarch64SysctlCPUID struct {
+ midr uint64 /* Main ID Register */
+ revidr uint64 /* Revision ID Register */
+ mpidr uint64 /* Multiprocessor Affinity Register */
+ aa64dfr0 uint64 /* A64 Debug Feature Register 0 */
+ aa64dfr1 uint64 /* A64 Debug Feature Register 1 */
+ aa64isar0 uint64 /* A64 Instruction Set Attribute Register 0 */
+ aa64isar1 uint64 /* A64 Instruction Set Attribute Register 1 */
+ aa64mmfr0 uint64 /* A64 Memory Model Feature Register 0 */
+ aa64mmfr1 uint64 /* A64 Memory Model Feature Register 1 */
+ aa64mmfr2 uint64 /* A64 Memory Model Feature Register 2 */
+ aa64pfr0 uint64 /* A64 Processor Feature Register 0 */
+ aa64pfr1 uint64 /* A64 Processor Feature Register 1 */
+ aa64zfr0 uint64 /* A64 SVE Feature ID Register 0 */
+ mvfr0 uint32 /* Media and VFP Feature Register 0 */
+ mvfr1 uint32 /* Media and VFP Feature Register 1 */
+ mvfr2 uint32 /* Media and VFP Feature Register 2 */
+ pad uint32
+ clidr uint64 /* Cache Level ID Register */
+ ctr uint64 /* Cache Type Register */
+}
+
+func sysctlCPUID(name string) (*aarch64SysctlCPUID, error) {
+ mib, err := nametomib(name)
+ if err != nil {
+ return nil, err
+ }
+
+ out := aarch64SysctlCPUID{}
+ n := unsafe.Sizeof(out)
+ _, _, errno := syscall.Syscall6(
+ syscall.SYS___SYSCTL,
+ uintptr(unsafe.Pointer(&mib[0])),
+ uintptr(len(mib)),
+ uintptr(unsafe.Pointer(&out)),
+ uintptr(unsafe.Pointer(&n)),
+ uintptr(0),
+ uintptr(0))
+ if errno != 0 {
+ return nil, errno
+ }
+ return &out, nil
+}
+
+func doinit() {
+ cpuid, err := sysctlCPUID("machdep.cpu0.cpu_id")
+ if err != nil {
+ setMinimalFeatures()
+ return
+ }
+ parseARM64SystemRegisters(cpuid.aa64isar0, cpuid.aa64isar1, cpuid.aa64pfr0)
+
+ Initialized = true
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_arm.go b/vendor/golang.org/x/sys/cpu/cpu_other_arm.go
new file mode 100644
index 000000000..d7b4fb4cc
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_other_arm.go
@@ -0,0 +1,10 @@
+// Copyright 2020 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:build !linux && arm
+// +build !linux,arm
+
+package cpu
+
+func archInit() {}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go
new file mode 100644
index 000000000..f8c484f58
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go
@@ -0,0 +1,10 @@
+// Copyright 2019 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:build !linux && !netbsd && arm64
+// +build !linux,!netbsd,arm64
+
+package cpu
+
+func doinit() {}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go b/vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go
new file mode 100644
index 000000000..0dafe9644
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go
@@ -0,0 +1,13 @@
+// Copyright 2020 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:build !linux && (mips64 || mips64le)
+// +build !linux
+// +build mips64 mips64le
+
+package cpu
+
+func archInit() {
+ Initialized = true
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go b/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go
new file mode 100644
index 000000000..4e8acd165
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go
@@ -0,0 +1,17 @@
+// Copyright 2020 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:build ppc64 || ppc64le
+// +build ppc64 ppc64le
+
+package cpu
+
+const cacheLineSize = 128
+
+func initOptions() {
+ options = []option{
+ {Name: "darn", Feature: &PPC64.HasDARN},
+ {Name: "scv", Feature: &PPC64.HasSCV},
+ }
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go
new file mode 100644
index 000000000..bd6c128af
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go
@@ -0,0 +1,12 @@
+// Copyright 2019 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:build riscv64
+// +build riscv64
+
+package cpu
+
+const cacheLineSize = 32
+
+func initOptions() {}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_s390x.go b/vendor/golang.org/x/sys/cpu/cpu_s390x.go
new file mode 100644
index 000000000..5881b8833
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_s390x.go
@@ -0,0 +1,172 @@
+// Copyright 2020 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 cpu
+
+const cacheLineSize = 256
+
+func initOptions() {
+ options = []option{
+ {Name: "zarch", Feature: &S390X.HasZARCH, Required: true},
+ {Name: "stfle", Feature: &S390X.HasSTFLE, Required: true},
+ {Name: "ldisp", Feature: &S390X.HasLDISP, Required: true},
+ {Name: "eimm", Feature: &S390X.HasEIMM, Required: true},
+ {Name: "dfp", Feature: &S390X.HasDFP},
+ {Name: "etf3eh", Feature: &S390X.HasETF3EH},
+ {Name: "msa", Feature: &S390X.HasMSA},
+ {Name: "aes", Feature: &S390X.HasAES},
+ {Name: "aescbc", Feature: &S390X.HasAESCBC},
+ {Name: "aesctr", Feature: &S390X.HasAESCTR},
+ {Name: "aesgcm", Feature: &S390X.HasAESGCM},
+ {Name: "ghash", Feature: &S390X.HasGHASH},
+ {Name: "sha1", Feature: &S390X.HasSHA1},
+ {Name: "sha256", Feature: &S390X.HasSHA256},
+ {Name: "sha3", Feature: &S390X.HasSHA3},
+ {Name: "sha512", Feature: &S390X.HasSHA512},
+ {Name: "vx", Feature: &S390X.HasVX},
+ {Name: "vxe", Feature: &S390X.HasVXE},
+ }
+}
+
+// bitIsSet reports whether the bit at index is set. The bit index
+// is in big endian order, so bit index 0 is the leftmost bit.
+func bitIsSet(bits []uint64, index uint) bool {
+ return bits[index/64]&((1<<63)>>(index%64)) != 0
+}
+
+// facility is a bit index for the named facility.
+type facility uint8
+
+const (
+ // mandatory facilities
+ zarch facility = 1 // z architecture mode is active
+ stflef facility = 7 // store-facility-list-extended
+ ldisp facility = 18 // long-displacement
+ eimm facility = 21 // extended-immediate
+
+ // miscellaneous facilities
+ dfp facility = 42 // decimal-floating-point
+ etf3eh facility = 30 // extended-translation 3 enhancement
+
+ // cryptography facilities
+ msa facility = 17 // message-security-assist
+ msa3 facility = 76 // message-security-assist extension 3
+ msa4 facility = 77 // message-security-assist extension 4
+ msa5 facility = 57 // message-security-assist extension 5
+ msa8 facility = 146 // message-security-assist extension 8
+ msa9 facility = 155 // message-security-assist extension 9
+
+ // vector facilities
+ vx facility = 129 // vector facility
+ vxe facility = 135 // vector-enhancements 1
+ vxe2 facility = 148 // vector-enhancements 2
+)
+
+// facilityList contains the result of an STFLE call.
+// Bits are numbered in big endian order so the
+// leftmost bit (the MSB) is at index 0.
+type facilityList struct {
+ bits [4]uint64
+}
+
+// Has reports whether the given facilities are present.
+func (s *facilityList) Has(fs ...facility) bool {
+ if len(fs) == 0 {
+ panic("no facility bits provided")
+ }
+ for _, f := range fs {
+ if !bitIsSet(s.bits[:], uint(f)) {
+ return false
+ }
+ }
+ return true
+}
+
+// function is the code for the named cryptographic function.
+type function uint8
+
+const (
+ // KM{,A,C,CTR} function codes
+ aes128 function = 18 // AES-128
+ aes192 function = 19 // AES-192
+ aes256 function = 20 // AES-256
+
+ // K{I,L}MD function codes
+ sha1 function = 1 // SHA-1
+ sha256 function = 2 // SHA-256
+ sha512 function = 3 // SHA-512
+ sha3_224 function = 32 // SHA3-224
+ sha3_256 function = 33 // SHA3-256
+ sha3_384 function = 34 // SHA3-384
+ sha3_512 function = 35 // SHA3-512
+ shake128 function = 36 // SHAKE-128
+ shake256 function = 37 // SHAKE-256
+
+ // KLMD function codes
+ ghash function = 65 // GHASH
+)
+
+// queryResult contains the result of a Query function
+// call. Bits are numbered in big endian order so the
+// leftmost bit (the MSB) is at index 0.
+type queryResult struct {
+ bits [2]uint64
+}
+
+// Has reports whether the given functions are present.
+func (q *queryResult) Has(fns ...function) bool {
+ if len(fns) == 0 {
+ panic("no function codes provided")
+ }
+ for _, f := range fns {
+ if !bitIsSet(q.bits[:], uint(f)) {
+ return false
+ }
+ }
+ return true
+}
+
+func doinit() {
+ initS390Xbase()
+
+ // We need implementations of stfle, km and so on
+ // to detect cryptographic features.
+ if !haveAsmFunctions() {
+ return
+ }
+
+ // optional cryptographic functions
+ if S390X.HasMSA {
+ aes := []function{aes128, aes192, aes256}
+
+ // cipher message
+ km, kmc := kmQuery(), kmcQuery()
+ S390X.HasAES = km.Has(aes...)
+ S390X.HasAESCBC = kmc.Has(aes...)
+ if S390X.HasSTFLE {
+ facilities := stfle()
+ if facilities.Has(msa4) {
+ kmctr := kmctrQuery()
+ S390X.HasAESCTR = kmctr.Has(aes...)
+ }
+ if facilities.Has(msa8) {
+ kma := kmaQuery()
+ S390X.HasAESGCM = kma.Has(aes...)
+ }
+ }
+
+ // compute message digest
+ kimd := kimdQuery() // intermediate (no padding)
+ klmd := klmdQuery() // last (padding)
+ S390X.HasSHA1 = kimd.Has(sha1) && klmd.Has(sha1)
+ S390X.HasSHA256 = kimd.Has(sha256) && klmd.Has(sha256)
+ S390X.HasSHA512 = kimd.Has(sha512) && klmd.Has(sha512)
+ S390X.HasGHASH = kimd.Has(ghash) // KLMD-GHASH does not exist
+ sha3 := []function{
+ sha3_224, sha3_256, sha3_384, sha3_512,
+ shake128, shake256,
+ }
+ S390X.HasSHA3 = kimd.Has(sha3...) && klmd.Has(sha3...)
+ }
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_s390x.s b/vendor/golang.org/x/sys/cpu/cpu_s390x.s
new file mode 100644
index 000000000..96f81e209
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_s390x.s
@@ -0,0 +1,58 @@
+// Copyright 2019 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:build gc
+// +build gc
+
+#include "textflag.h"
+
+// func stfle() facilityList
+TEXT ·stfle(SB), NOSPLIT|NOFRAME, $0-32
+ MOVD $ret+0(FP), R1
+ MOVD $3, R0 // last doubleword index to store
+ XC $32, (R1), (R1) // clear 4 doublewords (32 bytes)
+ WORD $0xb2b01000 // store facility list extended (STFLE)
+ RET
+
+// func kmQuery() queryResult
+TEXT ·kmQuery(SB), NOSPLIT|NOFRAME, $0-16
+ MOVD $0, R0 // set function code to 0 (KM-Query)
+ MOVD $ret+0(FP), R1 // address of 16-byte return value
+ WORD $0xB92E0024 // cipher message (KM)
+ RET
+
+// func kmcQuery() queryResult
+TEXT ·kmcQuery(SB), NOSPLIT|NOFRAME, $0-16
+ MOVD $0, R0 // set function code to 0 (KMC-Query)
+ MOVD $ret+0(FP), R1 // address of 16-byte return value
+ WORD $0xB92F0024 // cipher message with chaining (KMC)
+ RET
+
+// func kmctrQuery() queryResult
+TEXT ·kmctrQuery(SB), NOSPLIT|NOFRAME, $0-16
+ MOVD $0, R0 // set function code to 0 (KMCTR-Query)
+ MOVD $ret+0(FP), R1 // address of 16-byte return value
+ WORD $0xB92D4024 // cipher message with counter (KMCTR)
+ RET
+
+// func kmaQuery() queryResult
+TEXT ·kmaQuery(SB), NOSPLIT|NOFRAME, $0-16
+ MOVD $0, R0 // set function code to 0 (KMA-Query)
+ MOVD $ret+0(FP), R1 // address of 16-byte return value
+ WORD $0xb9296024 // cipher message with authentication (KMA)
+ RET
+
+// func kimdQuery() queryResult
+TEXT ·kimdQuery(SB), NOSPLIT|NOFRAME, $0-16
+ MOVD $0, R0 // set function code to 0 (KIMD-Query)
+ MOVD $ret+0(FP), R1 // address of 16-byte return value
+ WORD $0xB93E0024 // compute intermediate message digest (KIMD)
+ RET
+
+// func klmdQuery() queryResult
+TEXT ·klmdQuery(SB), NOSPLIT|NOFRAME, $0-16
+ MOVD $0, R0 // set function code to 0 (KLMD-Query)
+ MOVD $ret+0(FP), R1 // address of 16-byte return value
+ WORD $0xB93F0024 // compute last message digest (KLMD)
+ RET
diff --git a/vendor/golang.org/x/sys/cpu/cpu_wasm.go b/vendor/golang.org/x/sys/cpu/cpu_wasm.go
new file mode 100644
index 000000000..7747d888a
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_wasm.go
@@ -0,0 +1,18 @@
+// Copyright 2019 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:build wasm
+// +build wasm
+
+package cpu
+
+// We're compiling the cpu package for an unknown (software-abstracted) CPU.
+// Make CacheLinePad an empty struct and hope that the usual struct alignment
+// rules are good enough.
+
+const cacheLineSize = 0
+
+func initOptions() {}
+
+func archInit() {}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_x86.go b/vendor/golang.org/x/sys/cpu/cpu_x86.go
new file mode 100644
index 000000000..5ea287b7e
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_x86.go
@@ -0,0 +1,144 @@
+// Copyright 2018 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:build 386 || amd64 || amd64p32
+// +build 386 amd64 amd64p32
+
+package cpu
+
+import "runtime"
+
+const cacheLineSize = 64
+
+func initOptions() {
+ options = []option{
+ {Name: "adx", Feature: &X86.HasADX},
+ {Name: "aes", Feature: &X86.HasAES},
+ {Name: "avx", Feature: &X86.HasAVX},
+ {Name: "avx2", Feature: &X86.HasAVX2},
+ {Name: "avx512", Feature: &X86.HasAVX512},
+ {Name: "avx512f", Feature: &X86.HasAVX512F},
+ {Name: "avx512cd", Feature: &X86.HasAVX512CD},
+ {Name: "avx512er", Feature: &X86.HasAVX512ER},
+ {Name: "avx512pf", Feature: &X86.HasAVX512PF},
+ {Name: "avx512vl", Feature: &X86.HasAVX512VL},
+ {Name: "avx512bw", Feature: &X86.HasAVX512BW},
+ {Name: "avx512dq", Feature: &X86.HasAVX512DQ},
+ {Name: "avx512ifma", Feature: &X86.HasAVX512IFMA},
+ {Name: "avx512vbmi", Feature: &X86.HasAVX512VBMI},
+ {Name: "avx512vnniw", Feature: &X86.HasAVX5124VNNIW},
+ {Name: "avx5124fmaps", Feature: &X86.HasAVX5124FMAPS},
+ {Name: "avx512vpopcntdq", Feature: &X86.HasAVX512VPOPCNTDQ},
+ {Name: "avx512vpclmulqdq", Feature: &X86.HasAVX512VPCLMULQDQ},
+ {Name: "avx512vnni", Feature: &X86.HasAVX512VNNI},
+ {Name: "avx512gfni", Feature: &X86.HasAVX512GFNI},
+ {Name: "avx512vaes", Feature: &X86.HasAVX512VAES},
+ {Name: "avx512vbmi2", Feature: &X86.HasAVX512VBMI2},
+ {Name: "avx512bitalg", Feature: &X86.HasAVX512BITALG},
+ {Name: "avx512bf16", Feature: &X86.HasAVX512BF16},
+ {Name: "bmi1", Feature: &X86.HasBMI1},
+ {Name: "bmi2", Feature: &X86.HasBMI2},
+ {Name: "cx16", Feature: &X86.HasCX16},
+ {Name: "erms", Feature: &X86.HasERMS},
+ {Name: "fma", Feature: &X86.HasFMA},
+ {Name: "osxsave", Feature: &X86.HasOSXSAVE},
+ {Name: "pclmulqdq", Feature: &X86.HasPCLMULQDQ},
+ {Name: "popcnt", Feature: &X86.HasPOPCNT},
+ {Name: "rdrand", Feature: &X86.HasRDRAND},
+ {Name: "rdseed", Feature: &X86.HasRDSEED},
+ {Name: "sse3", Feature: &X86.HasSSE3},
+ {Name: "sse41", Feature: &X86.HasSSE41},
+ {Name: "sse42", Feature: &X86.HasSSE42},
+ {Name: "ssse3", Feature: &X86.HasSSSE3},
+
+ // These capabilities should always be enabled on amd64:
+ {Name: "sse2", Feature: &X86.HasSSE2, Required: runtime.GOARCH == "amd64"},
+ }
+}
+
+func archInit() {
+
+ Initialized = true
+
+ maxID, _, _, _ := cpuid(0, 0)
+
+ if maxID < 1 {
+ return
+ }
+
+ _, _, ecx1, edx1 := cpuid(1, 0)
+ X86.HasSSE2 = isSet(26, edx1)
+
+ X86.HasSSE3 = isSet(0, ecx1)
+ X86.HasPCLMULQDQ = isSet(1, ecx1)
+ X86.HasSSSE3 = isSet(9, ecx1)
+ X86.HasFMA = isSet(12, ecx1)
+ X86.HasCX16 = isSet(13, ecx1)
+ X86.HasSSE41 = isSet(19, ecx1)
+ X86.HasSSE42 = isSet(20, ecx1)
+ X86.HasPOPCNT = isSet(23, ecx1)
+ X86.HasAES = isSet(25, ecx1)
+ X86.HasOSXSAVE = isSet(27, ecx1)
+ X86.HasRDRAND = isSet(30, ecx1)
+
+ var osSupportsAVX, osSupportsAVX512 bool
+ // For XGETBV, OSXSAVE bit is required and sufficient.
+ if X86.HasOSXSAVE {
+ eax, _ := xgetbv()
+ // Check if XMM and YMM registers have OS support.
+ osSupportsAVX = isSet(1, eax) && isSet(2, eax)
+
+ if runtime.GOOS == "darwin" {
+ // Check darwin commpage for AVX512 support. Necessary because:
+ // https://github.com/apple/darwin-xnu/blob/0a798f6738bc1db01281fc08ae024145e84df927/osfmk/i386/fpu.c#L175-L201
+ osSupportsAVX512 = osSupportsAVX && darwinSupportsAVX512()
+ } else {
+ // Check if OPMASK and ZMM registers have OS support.
+ osSupportsAVX512 = osSupportsAVX && isSet(5, eax) && isSet(6, eax) && isSet(7, eax)
+ }
+ }
+
+ X86.HasAVX = isSet(28, ecx1) && osSupportsAVX
+
+ if maxID < 7 {
+ return
+ }
+
+ _, ebx7, ecx7, edx7 := cpuid(7, 0)
+ X86.HasBMI1 = isSet(3, ebx7)
+ X86.HasAVX2 = isSet(5, ebx7) && osSupportsAVX
+ X86.HasBMI2 = isSet(8, ebx7)
+ X86.HasERMS = isSet(9, ebx7)
+ X86.HasRDSEED = isSet(18, ebx7)
+ X86.HasADX = isSet(19, ebx7)
+
+ X86.HasAVX512 = isSet(16, ebx7) && osSupportsAVX512 // Because avx-512 foundation is the core required extension
+ if X86.HasAVX512 {
+ X86.HasAVX512F = true
+ X86.HasAVX512CD = isSet(28, ebx7)
+ X86.HasAVX512ER = isSet(27, ebx7)
+ X86.HasAVX512PF = isSet(26, ebx7)
+ X86.HasAVX512VL = isSet(31, ebx7)
+ X86.HasAVX512BW = isSet(30, ebx7)
+ X86.HasAVX512DQ = isSet(17, ebx7)
+ X86.HasAVX512IFMA = isSet(21, ebx7)
+ X86.HasAVX512VBMI = isSet(1, ecx7)
+ X86.HasAVX5124VNNIW = isSet(2, edx7)
+ X86.HasAVX5124FMAPS = isSet(3, edx7)
+ X86.HasAVX512VPOPCNTDQ = isSet(14, ecx7)
+ X86.HasAVX512VPCLMULQDQ = isSet(10, ecx7)
+ X86.HasAVX512VNNI = isSet(11, ecx7)
+ X86.HasAVX512GFNI = isSet(8, ecx7)
+ X86.HasAVX512VAES = isSet(9, ecx7)
+ X86.HasAVX512VBMI2 = isSet(6, ecx7)
+ X86.HasAVX512BITALG = isSet(12, ecx7)
+
+ eax71, _, _, _ := cpuid(7, 1)
+ X86.HasAVX512BF16 = isSet(5, eax71)
+ }
+}
+
+func isSet(bitpos uint, value uint32) bool {
+ return value&(1<> 63))
+)
+
+// For those platforms don't have a 'cpuid' equivalent we use HWCAP/HWCAP2
+// These are initialized in cpu_$GOARCH.go
+// and should not be changed after they are initialized.
+var hwCap uint
+var hwCap2 uint
+
+func readHWCAP() error {
+ buf, err := ioutil.ReadFile(procAuxv)
+ if err != nil {
+ // e.g. on android /proc/self/auxv is not accessible, so silently
+ // ignore the error and leave Initialized = false. On some
+ // architectures (e.g. arm64) doinit() implements a fallback
+ // readout and will set Initialized = true again.
+ return err
+ }
+ bo := hostByteOrder()
+ for len(buf) >= 2*(uintSize/8) {
+ var tag, val uint
+ switch uintSize {
+ case 32:
+ tag = uint(bo.Uint32(buf[0:]))
+ val = uint(bo.Uint32(buf[4:]))
+ buf = buf[8:]
+ case 64:
+ tag = uint(bo.Uint64(buf[0:]))
+ val = uint(bo.Uint64(buf[8:]))
+ buf = buf[16:]
+ }
+ switch tag {
+ case _AT_HWCAP:
+ hwCap = val
+ case _AT_HWCAP2:
+ hwCap2 = val
+ }
+ }
+ return nil
+}
diff --git a/vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go b/vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go
new file mode 100644
index 000000000..a864f24d7
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go
@@ -0,0 +1,27 @@
+// Copyright 2020 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.
+
+// Recreate a getsystemcfg syscall handler instead of
+// using the one provided by x/sys/unix to avoid having
+// the dependency between them. (See golang.org/issue/32102)
+// Morever, this file will be used during the building of
+// gccgo's libgo and thus must not used a CGo method.
+
+//go:build aix && gccgo
+// +build aix,gccgo
+
+package cpu
+
+import (
+ "syscall"
+)
+
+//extern getsystemcfg
+func gccgoGetsystemcfg(label uint32) (r uint64)
+
+func callgetsystemcfg(label int) (r1 uintptr, e1 syscall.Errno) {
+ r1 = uintptr(gccgoGetsystemcfg(uint32(label)))
+ e1 = syscall.GetErrno()
+ return
+}
diff --git a/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go b/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go
new file mode 100644
index 000000000..904be42ff
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go
@@ -0,0 +1,36 @@
+// Copyright 2019 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.
+
+// Minimal copy of x/sys/unix so the cpu package can make a
+// system call on AIX without depending on x/sys/unix.
+// (See golang.org/issue/32102)
+
+//go:build aix && ppc64 && gc
+// +build aix,ppc64,gc
+
+package cpu
+
+import (
+ "syscall"
+ "unsafe"
+)
+
+//go:cgo_import_dynamic libc_getsystemcfg getsystemcfg "libc.a/shr_64.o"
+
+//go:linkname libc_getsystemcfg libc_getsystemcfg
+
+type syscallFunc uintptr
+
+var libc_getsystemcfg syscallFunc
+
+type errno = syscall.Errno
+
+// Implemented in runtime/syscall_aix.go.
+func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err errno)
+func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err errno)
+
+func callgetsystemcfg(label int) (r1 uintptr, e1 errno) {
+ r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getsystemcfg)), 1, uintptr(label), 0, 0, 0, 0, 0)
+ return
+}
diff --git a/vendor/golang.org/x/sys/unix/README.md b/vendor/golang.org/x/sys/unix/README.md
index 579d2d735..474efad0e 100644
--- a/vendor/golang.org/x/sys/unix/README.md
+++ b/vendor/golang.org/x/sys/unix/README.md
@@ -76,7 +76,7 @@ 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
+When porting Go to a new architecture/OS, this file must be implemented for
each GOOS/GOARCH pair.
### mksysnum
@@ -107,7 +107,7 @@ 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
+unexported `//sys` prototype, and then write a custom wrapper in
`syscall_${GOOS}.go`.
### types files
@@ -137,7 +137,7 @@ some `#if/#elif` macros in your include statements.
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
+and 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
diff --git a/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s b/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s
index 6b4027b33..db9171c2e 100644
--- a/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s
+++ b/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build gc
// +build gc
#include "textflag.h"
diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_386.s b/vendor/golang.org/x/sys/unix/asm_bsd_386.s
index 7f29275fa..e0fcd9b3d 100644
--- a/vendor/golang.org/x/sys/unix/asm_bsd_386.s
+++ b/vendor/golang.org/x/sys/unix/asm_bsd_386.s
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build (darwin || freebsd || netbsd || openbsd) && gc
-// +build darwin freebsd netbsd openbsd
+//go:build (freebsd || netbsd || openbsd) && gc
+// +build freebsd netbsd openbsd
// +build gc
#include "textflag.h"
diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_arm.s b/vendor/golang.org/x/sys/unix/asm_bsd_arm.s
index 98ebfad9d..d702d4adc 100644
--- a/vendor/golang.org/x/sys/unix/asm_bsd_arm.s
+++ b/vendor/golang.org/x/sys/unix/asm_bsd_arm.s
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build (darwin || freebsd || netbsd || openbsd) && gc
-// +build darwin freebsd netbsd openbsd
+//go:build (freebsd || netbsd || openbsd) && gc
+// +build freebsd netbsd openbsd
// +build gc
#include "textflag.h"
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_386.s b/vendor/golang.org/x/sys/unix/asm_linux_386.s
index 0655ecbfb..8fd101d07 100644
--- a/vendor/golang.org/x/sys/unix/asm_linux_386.s
+++ b/vendor/golang.org/x/sys/unix/asm_linux_386.s
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build gc
// +build gc
#include "textflag.h"
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_amd64.s b/vendor/golang.org/x/sys/unix/asm_linux_amd64.s
index bc3fb6ac3..7ed38e43c 100644
--- a/vendor/golang.org/x/sys/unix/asm_linux_amd64.s
+++ b/vendor/golang.org/x/sys/unix/asm_linux_amd64.s
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build gc
// +build gc
#include "textflag.h"
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_arm.s b/vendor/golang.org/x/sys/unix/asm_linux_arm.s
index 55b13c7ba..8ef1d5140 100644
--- a/vendor/golang.org/x/sys/unix/asm_linux_arm.s
+++ b/vendor/golang.org/x/sys/unix/asm_linux_arm.s
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build gc
// +build gc
#include "textflag.h"
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_arm64.s b/vendor/golang.org/x/sys/unix/asm_linux_arm64.s
index 22a83d8e3..98ae02760 100644
--- a/vendor/golang.org/x/sys/unix/asm_linux_arm64.s
+++ b/vendor/golang.org/x/sys/unix/asm_linux_arm64.s
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && arm64 && gc
// +build linux
// +build arm64
// +build gc
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s b/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
index dc222b90c..21231d2ce 100644
--- a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
+++ b/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (mips64 || mips64le) && gc
// +build linux
// +build mips64 mips64le
// +build gc
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s b/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
index d333f13cf..6783b26c6 100644
--- a/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
+++ b/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (mips || mipsle) && gc
// +build linux
// +build mips mipsle
// +build gc
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s b/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
index 459a629c2..19d498934 100644
--- a/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
+++ b/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (ppc64 || ppc64le) && gc
// +build linux
// +build ppc64 ppc64le
// +build gc
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s b/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s
index 04d38497c..e42eb81d5 100644
--- a/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s
+++ b/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build riscv64,gc
+//go:build riscv64 && gc
+// +build riscv64
+// +build gc
#include "textflag.h"
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_s390x.s b/vendor/golang.org/x/sys/unix/asm_linux_s390x.s
index cc303989e..c46aab339 100644
--- a/vendor/golang.org/x/sys/unix/asm_linux_s390x.s
+++ b/vendor/golang.org/x/sys/unix/asm_linux_s390x.s
@@ -2,8 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build s390x
+//go:build linux && s390x && gc
// +build linux
+// +build s390x
// +build gc
#include "textflag.h"
diff --git a/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s b/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s
index 47c93fcb6..5e7a1169c 100644
--- a/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s
+++ b/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build gc
// +build gc
#include "textflag.h"
diff --git a/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s b/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
index 1f2c755a7..f8c5394c1 100644
--- a/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
+++ b/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build gc
// +build gc
#include "textflag.h"
diff --git a/vendor/golang.org/x/sys/unix/fdset.go b/vendor/golang.org/x/sys/unix/fdset.go
index b1e07b220..a8068f94f 100644
--- a/vendor/golang.org/x/sys/unix/fdset.go
+++ b/vendor/golang.org/x/sys/unix/fdset.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
package unix
diff --git a/vendor/golang.org/x/sys/unix/ifreq_linux.go b/vendor/golang.org/x/sys/unix/ifreq_linux.go
new file mode 100644
index 000000000..934af313c
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/ifreq_linux.go
@@ -0,0 +1,149 @@
+// Copyright 2021 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:build linux
+// +build linux
+
+package unix
+
+import (
+ "bytes"
+ "unsafe"
+)
+
+// Helpers for dealing with ifreq since it contains a union and thus requires a
+// lot of unsafe.Pointer casts to use properly.
+
+// An Ifreq is a type-safe wrapper around the raw ifreq struct. An Ifreq
+// contains an interface name and a union of arbitrary data which can be
+// accessed using the Ifreq's methods. To create an Ifreq, use the NewIfreq
+// function.
+//
+// Use the Name method to access the stored interface name. The union data
+// fields can be get and set using the following methods:
+// - Uint16/SetUint16: flags
+// - Uint32/SetUint32: ifindex, metric, mtu
+type Ifreq struct{ raw ifreq }
+
+// NewIfreq creates an Ifreq with the input network interface name after
+// validating the name does not exceed IFNAMSIZ-1 (trailing NULL required)
+// bytes.
+func NewIfreq(name string) (*Ifreq, error) {
+ // Leave room for terminating NULL byte.
+ if len(name) >= IFNAMSIZ {
+ return nil, EINVAL
+ }
+
+ var ifr ifreq
+ copy(ifr.Ifrn[:], name)
+
+ return &Ifreq{raw: ifr}, nil
+}
+
+// TODO(mdlayher): get/set methods for hardware address sockaddr, char array, etc.
+
+// Name returns the interface name associated with the Ifreq.
+func (ifr *Ifreq) Name() string {
+ // BytePtrToString requires a NULL terminator or the program may crash. If
+ // one is not present, just return the empty string.
+ if !bytes.Contains(ifr.raw.Ifrn[:], []byte{0x00}) {
+ return ""
+ }
+
+ return BytePtrToString(&ifr.raw.Ifrn[0])
+}
+
+// According to netdevice(7), only AF_INET addresses are returned for numerous
+// sockaddr ioctls. For convenience, we expose these as Inet4Addr since the Port
+// field and other data is always empty.
+
+// Inet4Addr returns the Ifreq union data from an embedded sockaddr as a C
+// in_addr/Go []byte (4-byte IPv4 address) value. If the sockaddr family is not
+// AF_INET, an error is returned.
+func (ifr *Ifreq) Inet4Addr() ([]byte, error) {
+ raw := *(*RawSockaddrInet4)(unsafe.Pointer(&ifr.raw.Ifru[:SizeofSockaddrInet4][0]))
+ if raw.Family != AF_INET {
+ // Cannot safely interpret raw.Addr bytes as an IPv4 address.
+ return nil, EINVAL
+ }
+
+ return raw.Addr[:], nil
+}
+
+// SetInet4Addr sets a C in_addr/Go []byte (4-byte IPv4 address) value in an
+// embedded sockaddr within the Ifreq's union data. v must be 4 bytes in length
+// or an error will be returned.
+func (ifr *Ifreq) SetInet4Addr(v []byte) error {
+ if len(v) != 4 {
+ return EINVAL
+ }
+
+ var addr [4]byte
+ copy(addr[:], v)
+
+ ifr.clear()
+ *(*RawSockaddrInet4)(
+ unsafe.Pointer(&ifr.raw.Ifru[:SizeofSockaddrInet4][0]),
+ ) = RawSockaddrInet4{
+ // Always set IP family as ioctls would require it anyway.
+ Family: AF_INET,
+ Addr: addr,
+ }
+
+ return nil
+}
+
+// Uint16 returns the Ifreq union data as a C short/Go uint16 value.
+func (ifr *Ifreq) Uint16() uint16 {
+ return *(*uint16)(unsafe.Pointer(&ifr.raw.Ifru[:2][0]))
+}
+
+// SetUint16 sets a C short/Go uint16 value as the Ifreq's union data.
+func (ifr *Ifreq) SetUint16(v uint16) {
+ ifr.clear()
+ *(*uint16)(unsafe.Pointer(&ifr.raw.Ifru[:2][0])) = v
+}
+
+// Uint32 returns the Ifreq union data as a C int/Go uint32 value.
+func (ifr *Ifreq) Uint32() uint32 {
+ return *(*uint32)(unsafe.Pointer(&ifr.raw.Ifru[:4][0]))
+}
+
+// SetUint32 sets a C int/Go uint32 value as the Ifreq's union data.
+func (ifr *Ifreq) SetUint32(v uint32) {
+ ifr.clear()
+ *(*uint32)(unsafe.Pointer(&ifr.raw.Ifru[:4][0])) = v
+}
+
+// clear zeroes the ifreq's union field to prevent trailing garbage data from
+// being sent to the kernel if an ifreq is reused.
+func (ifr *Ifreq) clear() {
+ for i := range ifr.raw.Ifru {
+ ifr.raw.Ifru[i] = 0
+ }
+}
+
+// TODO(mdlayher): export as IfreqData? For now we can provide helpers such as
+// IoctlGetEthtoolDrvinfo which use these APIs under the hood.
+
+// An ifreqData is an Ifreq which carries pointer data. To produce an ifreqData,
+// use the Ifreq.withData method.
+type ifreqData struct {
+ name [IFNAMSIZ]byte
+ // A type separate from ifreq is required in order to comply with the
+ // unsafe.Pointer rules since the "pointer-ness" of data would not be
+ // preserved if it were cast into the byte array of a raw ifreq.
+ data unsafe.Pointer
+ // Pad to the same size as ifreq.
+ _ [len(ifreq{}.Ifru) - SizeofPtr]byte
+}
+
+// withData produces an ifreqData with the pointer p set for ioctls which require
+// arbitrary pointer data.
+func (ifr Ifreq) withData(p unsafe.Pointer) ifreqData {
+ return ifreqData{
+ name: ifr.raw.Ifrn,
+ data: p,
+ }
+}
diff --git a/vendor/golang.org/x/sys/unix/ioctl_linux.go b/vendor/golang.org/x/sys/unix/ioctl_linux.go
index 48773f730..1dadead21 100644
--- a/vendor/golang.org/x/sys/unix/ioctl_linux.go
+++ b/vendor/golang.org/x/sys/unix/ioctl_linux.go
@@ -5,7 +5,6 @@
package unix
import (
- "runtime"
"unsafe"
)
@@ -22,56 +21,42 @@ func IoctlRetInt(fd int, req uint) (int, error) {
func IoctlGetUint32(fd int, req uint) (uint32, error) {
var value uint32
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
+ err := ioctlPtr(fd, req, unsafe.Pointer(&value))
return value, err
}
func IoctlGetRTCTime(fd int) (*RTCTime, error) {
var value RTCTime
- err := ioctl(fd, RTC_RD_TIME, uintptr(unsafe.Pointer(&value)))
+ err := ioctlPtr(fd, RTC_RD_TIME, unsafe.Pointer(&value))
return &value, err
}
func IoctlSetRTCTime(fd int, value *RTCTime) error {
- err := ioctl(fd, RTC_SET_TIME, uintptr(unsafe.Pointer(value)))
- runtime.KeepAlive(value)
- return err
+ return ioctlPtr(fd, RTC_SET_TIME, unsafe.Pointer(value))
}
func IoctlGetRTCWkAlrm(fd int) (*RTCWkAlrm, error) {
var value RTCWkAlrm
- err := ioctl(fd, RTC_WKALM_RD, uintptr(unsafe.Pointer(&value)))
+ err := ioctlPtr(fd, RTC_WKALM_RD, unsafe.Pointer(&value))
return &value, err
}
func IoctlSetRTCWkAlrm(fd int, value *RTCWkAlrm) error {
- err := ioctl(fd, RTC_WKALM_SET, uintptr(unsafe.Pointer(value)))
- runtime.KeepAlive(value)
- return err
-}
-
-type ifreqEthtool struct {
- name [IFNAMSIZ]byte
- data unsafe.Pointer
+ return ioctlPtr(fd, RTC_WKALM_SET, unsafe.Pointer(value))
}
// IoctlGetEthtoolDrvinfo fetches ethtool driver information for the network
// device specified by ifname.
func IoctlGetEthtoolDrvinfo(fd int, ifname string) (*EthtoolDrvinfo, error) {
- // Leave room for terminating NULL byte.
- if len(ifname) >= IFNAMSIZ {
- return nil, EINVAL
+ ifr, err := NewIfreq(ifname)
+ if err != nil {
+ return nil, err
}
- value := EthtoolDrvinfo{
- Cmd: ETHTOOL_GDRVINFO,
- }
- ifreq := ifreqEthtool{
- data: unsafe.Pointer(&value),
- }
- copy(ifreq.name[:], ifname)
- err := ioctl(fd, SIOCETHTOOL, uintptr(unsafe.Pointer(&ifreq)))
- runtime.KeepAlive(ifreq)
+ value := EthtoolDrvinfo{Cmd: ETHTOOL_GDRVINFO}
+ ifrd := ifr.withData(unsafe.Pointer(&value))
+
+ err = ioctlIfreqData(fd, SIOCETHTOOL, &ifrd)
return &value, err
}
@@ -80,7 +65,7 @@ func IoctlGetEthtoolDrvinfo(fd int, ifname string) (*EthtoolDrvinfo, error) {
// https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html.
func IoctlGetWatchdogInfo(fd int) (*WatchdogInfo, error) {
var value WatchdogInfo
- err := ioctl(fd, WDIOC_GETSUPPORT, uintptr(unsafe.Pointer(&value)))
+ err := ioctlPtr(fd, WDIOC_GETSUPPORT, unsafe.Pointer(&value))
return &value, err
}
@@ -88,6 +73,7 @@ func IoctlGetWatchdogInfo(fd int) (*WatchdogInfo, error) {
// more information, see:
// https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html.
func IoctlWatchdogKeepalive(fd int) error {
+ // arg is ignored and not a pointer, so ioctl is fine instead of ioctlPtr.
return ioctl(fd, WDIOC_KEEPALIVE, 0)
}
@@ -95,9 +81,7 @@ func IoctlWatchdogKeepalive(fd int) error {
// range of data conveyed in value to the file associated with the file
// descriptor destFd. See the ioctl_ficlonerange(2) man page for details.
func IoctlFileCloneRange(destFd int, value *FileCloneRange) error {
- err := ioctl(destFd, FICLONERANGE, uintptr(unsafe.Pointer(value)))
- runtime.KeepAlive(value)
- return err
+ return ioctlPtr(destFd, FICLONERANGE, unsafe.Pointer(value))
}
// IoctlFileClone performs an FICLONE ioctl operation to clone the entire file
@@ -148,7 +132,7 @@ func IoctlFileDedupeRange(srcFd int, value *FileDedupeRange) error {
rawinfo.Reserved = value.Info[i].Reserved
}
- err := ioctl(srcFd, FIDEDUPERANGE, uintptr(unsafe.Pointer(&buf[0])))
+ err := ioctlPtr(srcFd, FIDEDUPERANGE, unsafe.Pointer(&buf[0]))
// Output
for i := range value.Info {
@@ -166,31 +150,47 @@ func IoctlFileDedupeRange(srcFd int, value *FileDedupeRange) error {
}
func IoctlHIDGetDesc(fd int, value *HIDRawReportDescriptor) error {
- err := ioctl(fd, HIDIOCGRDESC, uintptr(unsafe.Pointer(value)))
- runtime.KeepAlive(value)
- return err
+ return ioctlPtr(fd, HIDIOCGRDESC, unsafe.Pointer(value))
}
func IoctlHIDGetRawInfo(fd int) (*HIDRawDevInfo, error) {
var value HIDRawDevInfo
- err := ioctl(fd, HIDIOCGRAWINFO, uintptr(unsafe.Pointer(&value)))
+ err := ioctlPtr(fd, HIDIOCGRAWINFO, unsafe.Pointer(&value))
return &value, err
}
func IoctlHIDGetRawName(fd int) (string, error) {
var value [_HIDIOCGRAWNAME_LEN]byte
- err := ioctl(fd, _HIDIOCGRAWNAME, uintptr(unsafe.Pointer(&value[0])))
+ err := ioctlPtr(fd, _HIDIOCGRAWNAME, unsafe.Pointer(&value[0]))
return ByteSliceToString(value[:]), err
}
func IoctlHIDGetRawPhys(fd int) (string, error) {
var value [_HIDIOCGRAWPHYS_LEN]byte
- err := ioctl(fd, _HIDIOCGRAWPHYS, uintptr(unsafe.Pointer(&value[0])))
+ err := ioctlPtr(fd, _HIDIOCGRAWPHYS, unsafe.Pointer(&value[0]))
return ByteSliceToString(value[:]), err
}
func IoctlHIDGetRawUniq(fd int) (string, error) {
var value [_HIDIOCGRAWUNIQ_LEN]byte
- err := ioctl(fd, _HIDIOCGRAWUNIQ, uintptr(unsafe.Pointer(&value[0])))
+ err := ioctlPtr(fd, _HIDIOCGRAWUNIQ, unsafe.Pointer(&value[0]))
return ByteSliceToString(value[:]), err
}
+
+// IoctlIfreq performs an ioctl using an Ifreq structure for input and/or
+// output. See the netdevice(7) man page for details.
+func IoctlIfreq(fd int, req uint, value *Ifreq) error {
+ // It is possible we will add more fields to *Ifreq itself later to prevent
+ // misuse, so pass the raw *ifreq directly.
+ return ioctlPtr(fd, req, unsafe.Pointer(&value.raw))
+}
+
+// TODO(mdlayher): export if and when IfreqData is exported.
+
+// ioctlIfreqData performs an ioctl using an ifreqData structure for input
+// and/or output. See the netdevice(7) man page for details.
+func ioctlIfreqData(fd int, req uint, value *ifreqData) error {
+ // The memory layout of IfreqData (type-safe) and ifreq (not type-safe) are
+ // identical so pass *IfreqData directly.
+ return ioctlPtr(fd, req, unsafe.Pointer(value))
+}
diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh
index d727cad19..396aadf86 100644
--- a/vendor/golang.org/x/sys/unix/mkall.sh
+++ b/vendor/golang.org/x/sys/unix/mkall.sh
@@ -70,23 +70,11 @@ aix_ppc64)
mksyscall="go run mksyscall_aix_ppc64.go -aix"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
;;
-darwin_386)
- mkerrors="$mkerrors -m32"
- mksyscall="go run mksyscall.go -l32"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- mkasm="go run mkasm_darwin.go"
- ;;
darwin_amd64)
mkerrors="$mkerrors -m64"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
mkasm="go run mkasm_darwin.go"
;;
-darwin_arm)
- mkerrors="$mkerrors"
- mksyscall="go run mksyscall.go -l32"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- mkasm="go run mkasm_darwin.go"
- ;;
darwin_arm64)
mkerrors="$mkerrors -m64"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh
index 007358af8..850aafec1 100644
--- a/vendor/golang.org/x/sys/unix/mkerrors.sh
+++ b/vendor/golang.org/x/sys/unix/mkerrors.sh
@@ -217,8 +217,6 @@ struct ltchars {
#include
#include
#include
-#include
-#include
#include
#include
#include
@@ -231,6 +229,7 @@ struct ltchars {
#include
#include
#include
+#include
#include
#include
#include
@@ -239,6 +238,7 @@ struct ltchars {
#include
#include
#include
+#include
#include
#include
#include
@@ -258,6 +258,7 @@ struct ltchars {
#include
#include
+#include
#include
#if defined(__sparc__)
@@ -497,10 +498,14 @@ ccflags="$@"
$2 ~ /^O?XTABS$/ ||
$2 ~ /^TC[IO](ON|OFF)$/ ||
$2 ~ /^IN_/ ||
+ $2 ~ /^LANDLOCK_/ ||
$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
$2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ ||
- $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL)_/ ||
+ $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT)_/ ||
+ $2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ ||
+ $2 ~ /^NFC_.*_(MAX)?SIZE$/ ||
+ $2 ~ /^RAW_PAYLOAD_/ ||
$2 ~ /^TP_STATUS_/ ||
$2 ~ /^FALLOC_/ ||
$2 ~ /^ICMPV?6?_(FILTER|SEC)/ ||
@@ -558,6 +563,7 @@ ccflags="$@"
$2 ~ /^KEYCTL_/ ||
$2 ~ /^PERF_/ ||
$2 ~ /^SECCOMP_MODE_/ ||
+ $2 ~ /^SEEK_/ ||
$2 ~ /^SPLICE_/ ||
$2 ~ /^SYNC_FILE_RANGE_/ ||
$2 !~ /^AUDIT_RECORD_MAGIC/ &&
@@ -593,6 +599,9 @@ ccflags="$@"
$2 == "HID_MAX_DESCRIPTOR_SIZE" ||
$2 ~ /^_?HIDIOC/ ||
$2 ~ /^BUS_(USB|HIL|BLUETOOTH|VIRTUAL)$/ ||
+ $2 ~ /^MTD/ ||
+ $2 ~ /^OTP/ ||
+ $2 ~ /^MEM/ ||
$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)}
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go b/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go
index 5fc3cda6f..1596426b1 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go
@@ -17,7 +17,7 @@ import (
//sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno)
func fdopendir(fd int) (dir uintptr, err error) {
- r0, _, e1 := syscall_syscallPtr(funcPC(libc_fdopendir_trampoline), uintptr(fd), 0, 0)
+ r0, _, e1 := syscall_syscallPtr(libc_fdopendir_trampoline_addr, uintptr(fd), 0, 0)
dir = uintptr(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -25,7 +25,7 @@ func fdopendir(fd int) (dir uintptr, err error) {
return
}
-func libc_fdopendir_trampoline()
+var libc_fdopendir_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fdopendir fdopendir "/usr/lib/libSystem.B.dylib"
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go
index 9945e5f96..23f6b5760 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go
@@ -13,6 +13,7 @@
package unix
import (
+ "fmt"
"runtime"
"syscall"
"unsafe"
@@ -398,6 +399,38 @@ func GetsockoptXucred(fd, level, opt int) (*Xucred, error) {
return x, err
}
+func SysctlKinfoProcSlice(name string) ([]KinfoProc, error) {
+ mib, err := sysctlmib(name)
+ if err != nil {
+ return nil, err
+ }
+
+ // Find size.
+ n := uintptr(0)
+ if err := sysctl(mib, nil, &n, nil, 0); err != nil {
+ return nil, err
+ }
+ if n == 0 {
+ return nil, nil
+ }
+ if n%SizeofKinfoProc != 0 {
+ return nil, fmt.Errorf("sysctl() returned a size of %d, which is not a multiple of %d", n, SizeofKinfoProc)
+ }
+
+ // Read into buffer of that size.
+ buf := make([]KinfoProc, n/SizeofKinfoProc)
+ if err := sysctl(mib, (*byte)(unsafe.Pointer(&buf[0])), &n, nil, 0); err != nil {
+ return nil, err
+ }
+ if n%SizeofKinfoProc != 0 {
+ return nil, fmt.Errorf("sysctl() returned a size of %d, which is not a multiple of %d", n, SizeofKinfoProc)
+ }
+
+ // The actual call may return less than the original reported required
+ // size so ensure we deal with that.
+ return buf[:n/SizeofKinfoProc], nil
+}
+
//sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
/*
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go b/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
deleted file mode 100644
index 647467712..000000000
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
+++ /dev/null
@@ -1,51 +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.
-
-//go:build 386 && darwin
-// +build 386,darwin
-
-package unix
-
-import "syscall"
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: int32(sec), Usec: int32(usec)}
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint32(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (msghdr *Msghdr) SetIovlen(length int) {
- msghdr.Iovlen = int32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
-
-//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
-//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
-//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
-//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
-//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
-//sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
-//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
-//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
deleted file mode 100644
index d30735c5d..000000000
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
+++ /dev/null
@@ -1,51 +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 unix
-
-import "syscall"
-
-func ptrace1(request int, pid int, addr uintptr, data uintptr) error {
- return ENOTSUP
-}
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: int32(sec), Usec: int32(usec)}
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint32(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (msghdr *Msghdr) SetIovlen(length int) {
- msghdr.Iovlen = int32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
-
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
-//sys Fstatfs(fd int, stat *Statfs_t) (err error)
-//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT
-//sys Lstat(path string, stat *Stat_t) (err error)
-//sys Stat(path string, stat *Stat_t) (err error)
-//sys Statfs(path string, stat *Statfs_t) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go b/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
index 38bec3002..53c96641f 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
@@ -7,7 +7,7 @@
package unix
-import "unsafe"
+import _ "unsafe"
// Implemented in the runtime package (runtime/sys_darwin.go)
func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
@@ -25,10 +25,3 @@ func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
//go:linkname syscall_rawSyscall syscall.rawSyscall
//go:linkname syscall_rawSyscall6 syscall.rawSyscall6
//go:linkname syscall_syscallPtr syscall.syscallPtr
-
-// Find the entry point for f. See comments in runtime/proc.go for the
-// function of the same name.
-//go:nosplit
-func funcPC(f func()) uintptr {
- return **(**uintptr)(unsafe.Pointer(&f))
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_illumos.go b/vendor/golang.org/x/sys/unix/syscall_illumos.go
index c5c58806c..8d5f294c4 100644
--- a/vendor/golang.org/x/sys/unix/syscall_illumos.go
+++ b/vendor/golang.org/x/sys/unix/syscall_illumos.go
@@ -1,4 +1,4 @@
-// Copyright 2009 The Go Authors. All rights reserved.
+// Copyright 2021 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.
@@ -10,6 +10,8 @@
package unix
import (
+ "fmt"
+ "runtime"
"unsafe"
)
@@ -127,3 +129,58 @@ func Getmsg(fd int, cl []byte, data []byte) (retCl []byte, retData []byte, flags
}
return retCl, retData, flags, nil
}
+
+func IoctlSetIntRetInt(fd int, req uint, arg int) (int, error) {
+ return ioctlRet(fd, req, uintptr(arg))
+}
+
+func IoctlSetString(fd int, req uint, val string) error {
+ bs := make([]byte, len(val)+1)
+ copy(bs[:len(bs)-1], val)
+ err := ioctl(fd, req, uintptr(unsafe.Pointer(&bs[0])))
+ runtime.KeepAlive(&bs[0])
+ return err
+}
+
+// Lifreq Helpers
+
+func (l *Lifreq) SetName(name string) error {
+ if len(name) >= len(l.Name) {
+ return fmt.Errorf("name cannot be more than %d characters", len(l.Name)-1)
+ }
+ for i := range name {
+ l.Name[i] = int8(name[i])
+ }
+ return nil
+}
+
+func (l *Lifreq) SetLifruInt(d int) {
+ *(*int)(unsafe.Pointer(&l.Lifru[0])) = d
+}
+
+func (l *Lifreq) GetLifruInt() int {
+ return *(*int)(unsafe.Pointer(&l.Lifru[0]))
+}
+
+func (l *Lifreq) SetLifruUint(d uint) {
+ *(*uint)(unsafe.Pointer(&l.Lifru[0])) = d
+}
+
+func (l *Lifreq) GetLifruUint() uint {
+ return *(*uint)(unsafe.Pointer(&l.Lifru[0]))
+}
+
+func IoctlLifreq(fd int, req uint, l *Lifreq) error {
+ return ioctl(fd, req, uintptr(unsafe.Pointer(l)))
+}
+
+// Strioctl Helpers
+
+func (s *Strioctl) SetInt(i int) {
+ s.Len = int32(unsafe.Sizeof(i))
+ s.Dp = (*int8)(unsafe.Pointer(&i))
+}
+
+func IoctlSetStrioctlRetInt(fd int, req uint, s *Strioctl) (int, error) {
+ return ioctlRet(fd, req, uintptr(unsafe.Pointer(s)))
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go
index 4263953be..6a2c5cdaf 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux.go
@@ -13,7 +13,6 @@ package unix
import (
"encoding/binary"
- "runtime"
"syscall"
"unsafe"
)
@@ -38,6 +37,13 @@ func Creat(path string, mode uint32) (fd int, err error) {
return Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode)
}
+func EpollCreate(size int) (fd int, err error) {
+ if size <= 0 {
+ return -1, EINVAL
+ }
+ return EpollCreate1(0)
+}
+
//sys FanotifyInit(flags uint, event_f_flags uint) (fd int, err error)
//sys fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error)
@@ -66,11 +72,22 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
return fchmodat(dirfd, path, mode)
}
-//sys ioctl(fd int, req uint, arg uintptr) (err error)
+func InotifyInit() (fd int, err error) {
+ return InotifyInit1(0)
+}
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-// These are defined in ioctl.go and ioctl_linux.go.
+//sys ioctl(fd int, req uint, arg uintptr) (err error) = SYS_IOCTL
+//sys ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) = SYS_IOCTL
+
+// ioctl itself should not be exposed directly, but additional get/set functions
+// for specific types are permissible. These are defined in ioctl.go and
+// ioctl_linux.go.
+//
+// The third argument to ioctl is often a pointer but sometimes an integer.
+// Callers should use ioctlPtr when the third argument is a pointer and ioctl
+// when the third argument is an integer.
+//
+// TODO: some existing code incorrectly uses ioctl when it should use ioctlPtr.
//sys Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error)
@@ -102,6 +119,23 @@ func Openat2(dirfd int, path string, how *OpenHow) (fd int, err error) {
return openat2(dirfd, path, how, SizeofOpenHow)
}
+func Pipe(p []int) error {
+ return Pipe2(p, 0)
+}
+
+//sysnb pipe2(p *[2]_C_int, flags int) (err error)
+
+func Pipe2(p []int, flags int) error {
+ if len(p) != 2 {
+ return EINVAL
+ }
+ var pp [2]_C_int
+ err := pipe2(&pp, flags)
+ p[0] = int(pp[0])
+ p[1] = int(pp[1])
+ return err
+}
+
//sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error)
func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
@@ -161,27 +195,7 @@ func Utimes(path string, tv []Timeval) error {
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
func UtimesNano(path string, ts []Timespec) error {
- if ts == nil {
- err := utimensat(AT_FDCWD, path, nil, 0)
- if err != ENOSYS {
- return err
- }
- return utimes(path, nil)
- }
- if len(ts) != 2 {
- return EINVAL
- }
- err := utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
- if err != ENOSYS {
- return err
- }
- // If the utimensat syscall isn't available (utimensat was added to Linux
- // in 2.6.22, Released, 8 July 2007) then fall back to utimes
- var tv [2]Timeval
- for i := 0; i < 2; i++ {
- tv[i] = NsecToTimeval(TimespecToNsec(ts[i]))
- }
- return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
+ return UtimesNanoAt(AT_FDCWD, path, ts, 0)
}
func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
@@ -904,6 +918,46 @@ func (sa *SockaddrIUCV) sockaddr() (unsafe.Pointer, _Socklen, error) {
return unsafe.Pointer(&sa.raw), SizeofSockaddrIUCV, nil
}
+type SockaddrNFC struct {
+ DeviceIdx uint32
+ TargetIdx uint32
+ NFCProtocol uint32
+ raw RawSockaddrNFC
+}
+
+func (sa *SockaddrNFC) sockaddr() (unsafe.Pointer, _Socklen, error) {
+ sa.raw.Sa_family = AF_NFC
+ sa.raw.Dev_idx = sa.DeviceIdx
+ sa.raw.Target_idx = sa.TargetIdx
+ sa.raw.Nfc_protocol = sa.NFCProtocol
+ return unsafe.Pointer(&sa.raw), SizeofSockaddrNFC, nil
+}
+
+type SockaddrNFCLLCP struct {
+ DeviceIdx uint32
+ TargetIdx uint32
+ NFCProtocol uint32
+ DestinationSAP uint8
+ SourceSAP uint8
+ ServiceName string
+ raw RawSockaddrNFCLLCP
+}
+
+func (sa *SockaddrNFCLLCP) sockaddr() (unsafe.Pointer, _Socklen, error) {
+ sa.raw.Sa_family = AF_NFC
+ sa.raw.Dev_idx = sa.DeviceIdx
+ sa.raw.Target_idx = sa.TargetIdx
+ sa.raw.Nfc_protocol = sa.NFCProtocol
+ sa.raw.Dsap = sa.DestinationSAP
+ sa.raw.Ssap = sa.SourceSAP
+ if len(sa.ServiceName) > len(sa.raw.Service_name) {
+ return nil, 0, EINVAL
+ }
+ copy(sa.raw.Service_name[:], sa.ServiceName)
+ sa.raw.SetServiceNameLen(len(sa.ServiceName))
+ return unsafe.Pointer(&sa.raw), SizeofSockaddrNFCLLCP, nil
+}
+
var socketProtocol = func(fd int) (int, error) {
return GetsockoptInt(fd, SOL_SOCKET, SO_PROTOCOL)
}
@@ -1144,6 +1198,37 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
}
return sa, nil
}
+ case AF_NFC:
+ proto, err := socketProtocol(fd)
+ if err != nil {
+ return nil, err
+ }
+ switch proto {
+ case NFC_SOCKPROTO_RAW:
+ pp := (*RawSockaddrNFC)(unsafe.Pointer(rsa))
+ sa := &SockaddrNFC{
+ DeviceIdx: pp.Dev_idx,
+ TargetIdx: pp.Target_idx,
+ NFCProtocol: pp.Nfc_protocol,
+ }
+ return sa, nil
+ case NFC_SOCKPROTO_LLCP:
+ pp := (*RawSockaddrNFCLLCP)(unsafe.Pointer(rsa))
+ if uint64(pp.Service_name_len) > uint64(len(pp.Service_name)) {
+ return nil, EINVAL
+ }
+ sa := &SockaddrNFCLLCP{
+ DeviceIdx: pp.Dev_idx,
+ TargetIdx: pp.Target_idx,
+ NFCProtocol: pp.Nfc_protocol,
+ DestinationSAP: pp.Dsap,
+ SourceSAP: pp.Ssap,
+ ServiceName: string(pp.Service_name[:pp.Service_name_len]),
+ }
+ return sa, nil
+ default:
+ return nil, EINVAL
+ }
}
return nil, EAFNOSUPPORT
}
@@ -1151,7 +1236,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
func Accept(fd int) (nfd int, sa Sockaddr, err error) {
var rsa RawSockaddrAny
var len _Socklen = SizeofSockaddrAny
- nfd, err = accept(fd, &rsa, &len)
+ nfd, err = accept4(fd, &rsa, &len, 0)
if err != nil {
return
}
@@ -1273,6 +1358,13 @@ func SetsockoptTpacketReq3(fd, level, opt int, tp *TpacketReq3) error {
return setsockopt(fd, level, opt, unsafe.Pointer(tp), unsafe.Sizeof(*tp))
}
+func SetsockoptTCPRepairOpt(fd, level, opt int, o []TCPRepairOpt) (err error) {
+ if len(o) == 0 {
+ return EINVAL
+ }
+ return setsockopt(fd, level, opt, unsafe.Pointer(&o[0]), uintptr(SizeofTCPRepairOpt*len(o)))
+}
+
// Keyctl Commands (http://man7.org/linux/man-pages/man2/keyctl.2.html)
// KeyctlInt calls keyctl commands in which each argument is an int.
@@ -1727,11 +1819,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys Dup(oldfd int) (fd int, err error)
func Dup2(oldfd, newfd int) error {
- // Android O and newer blocks dup2; riscv and arm64 don't implement dup2.
- if runtime.GOOS == "android" || runtime.GOARCH == "riscv64" || runtime.GOARCH == "arm64" {
- return Dup3(oldfd, newfd, 0)
- }
- return dup2(oldfd, newfd)
+ return Dup3(oldfd, newfd, 0)
}
//sys Dup3(oldfd int, newfd int, flags int) (err error)
@@ -1784,7 +1872,7 @@ func Getpgrp() (pid int) {
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
//sys PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error)
//sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
-//sysnb prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64
+//sysnb Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64
//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)
//sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) = SYS_PSELECT6
//sys read(fd int, p []byte) (n int, err error)
@@ -2219,6 +2307,9 @@ type RemoteIovec struct {
//sys ProcessVMReadv(pid int, localIov []Iovec, remoteIov []RemoteIovec, flags uint) (n int, err error) = SYS_PROCESS_VM_READV
//sys ProcessVMWritev(pid int, localIov []Iovec, remoteIov []RemoteIovec, flags uint) (n int, err error) = SYS_PROCESS_VM_WRITEV
+//sys PidfdOpen(pid int, flags int) (fd int, err error) = SYS_PIDFD_OPEN
+//sys PidfdGetfd(pidfd int, targetfd int, flags int) (fd int, err error) = SYS_PIDFD_GETFD
+
/*
* Unimplemented
*/
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_386.go
index 7b52e5d8a..08b3f6a11 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_386.go
@@ -19,36 +19,8 @@ func setTimeval(sec, usec int64) Timeval {
return Timeval{Sec: int32(sec), Usec: int32(usec)}
}
-//sysnb pipe(p *[2]_C_int) (err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe(&pp)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
// 64-bit file system and 32-bit uid calls
// (386 default is 32-bit file system and 16-bit uid).
-//sys dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
@@ -59,7 +31,6 @@ func Pipe2(p []int, flags int) (err error) {
//sysnb Geteuid() (euid int) = SYS_GETEUID32
//sysnb Getgid() (gid int) = SYS_GETGID32
//sysnb Getuid() (uid int) = SYS_GETUID32
-//sysnb InotifyInit() (fd int, err error)
//sys Ioperm(from int, num int, on int) (err error)
//sys Iopl(level int) (err error)
//sys Lchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32
@@ -105,7 +76,7 @@ const rlimInf32 = ^uint32(0)
const rlimInf64 = ^uint64(0)
func Getrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, nil, rlim)
+ err = Prlimit(0, resource, nil, rlim)
if err != ENOSYS {
return err
}
@@ -133,7 +104,7 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
func Setrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, rlim, nil)
+ err = Prlimit(0, resource, rlim, nil)
if err != ENOSYS {
return err
}
@@ -378,6 +349,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
+func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
+ rsa.Service_name_len = uint32(length)
+}
+
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
func Poll(fds []PollFd, timeout int) (n int, err error) {
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
index 28b764115..dc31a15a8 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
@@ -7,8 +7,6 @@
package unix
-//sys dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
//sys Fchown(fd int, uid int, gid int) (err error)
@@ -21,17 +19,6 @@ package unix
//sysnb Getgid() (gid int)
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
//sysnb Getuid() (uid int)
-//sysnb inotifyInit() (fd int, err error)
-
-func InotifyInit() (fd int, err error) {
- // First try inotify_init1, because Android's seccomp policy blocks the latter.
- fd, err = InotifyInit1(0)
- if err == ENOSYS {
- fd, err = inotifyInit()
- }
- return
-}
-
//sys Ioperm(from int, num int, on int) (err error)
//sys Iopl(level int) (err error)
//sys Lchown(path string, uid int, gid int) (err error)
@@ -126,32 +113,6 @@ func setTimeval(sec, usec int64) Timeval {
return Timeval{Sec: sec, Usec: usec}
}
-//sysnb pipe(p *[2]_C_int) (err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe(&pp)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
func (r *PtraceRegs) PC() uint64 { return r.Rip }
func (r *PtraceRegs) SetPC(pc uint64) { r.Rip = pc }
@@ -172,6 +133,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
+func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
+ rsa.Service_name_len = uint64(length)
+}
+
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
func Poll(fds []PollFd, timeout int) (n int, err error) {
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
index 68877728e..1d136bae6 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
@@ -19,36 +19,6 @@ func setTimeval(sec, usec int64) Timeval {
return Timeval{Sec: int32(sec), Usec: int32(usec)}
}
-//sysnb pipe(p *[2]_C_int) (err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- // Try pipe2 first for Android O, then try pipe for kernel 2.6.23.
- err = pipe2(&pp, 0)
- if err == ENOSYS {
- err = pipe(&pp)
- }
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
newoffset, errno := seek(fd, offset, whence)
if errno != 0 {
@@ -76,8 +46,6 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
// 64-bit file system and 32-bit uid calls
// (16-bit uid calls are not always supported in newer kernels)
-//sys dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
@@ -86,7 +54,6 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
//sysnb Geteuid() (euid int) = SYS_GETEUID32
//sysnb Getgid() (gid int) = SYS_GETGID32
//sysnb Getuid() (uid int) = SYS_GETUID32
-//sysnb InotifyInit() (fd int, err error)
//sys Lchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32
//sys Listen(s int, n int) (err error)
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
@@ -184,7 +151,7 @@ const rlimInf32 = ^uint32(0)
const rlimInf64 = ^uint64(0)
func Getrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, nil, rlim)
+ err = Prlimit(0, resource, nil, rlim)
if err != ENOSYS {
return err
}
@@ -212,7 +179,7 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
func Setrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, rlim, nil)
+ err = Prlimit(0, resource, rlim, nil)
if err != ENOSYS {
return err
}
@@ -256,6 +223,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
+func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
+ rsa.Service_name_len = uint32(length)
+}
+
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
func Poll(fds []PollFd, timeout int) (n int, err error) {
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
index 7ed703476..9c715dc4a 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
@@ -9,13 +9,6 @@ package unix
import "unsafe"
-func EpollCreate(size int) (fd int, err error) {
- if size <= 0 {
- return -1, EINVAL
- }
- return EpollCreate1(0)
-}
-
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
//sys Fchown(fd int, uid int, gid int) (err error)
@@ -145,33 +138,9 @@ func utimes(path string, tv *[2]Timeval) (err error) {
return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
}
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, 0)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
// Getrlimit prefers the prlimit64 system call. See issue 38604.
func Getrlimit(resource int, rlim *Rlimit) error {
- err := prlimit(0, resource, nil, rlim)
+ err := Prlimit(0, resource, nil, rlim)
if err != ENOSYS {
return err
}
@@ -180,7 +149,7 @@ func Getrlimit(resource int, rlim *Rlimit) error {
// Setrlimit prefers the prlimit64 system call. See issue 38604.
func Setrlimit(resource int, rlim *Rlimit) error {
- err := prlimit(0, resource, rlim, nil)
+ err := Prlimit(0, resource, rlim, nil)
if err != ENOSYS {
return err
}
@@ -207,14 +176,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
-func InotifyInit() (fd int, err error) {
- return InotifyInit1(0)
+func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
+ rsa.Service_name_len = uint64(length)
}
-// dup2 exists because func Dup3 in syscall_linux.go references
-// it in an unreachable path. dup2 isn't available on arm64.
-func dup2(oldfd int, newfd int) error
-
func Pause() error {
_, err := ppoll(nil, 0, nil, nil)
return err
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
index 06dec06fa..d47ceafa2 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
@@ -8,8 +8,6 @@
package unix
-//sys dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
//sys Fchown(fd int, uid int, gid int) (err error)
@@ -94,30 +92,6 @@ func setTimeval(sec, usec int64) Timeval {
return Timeval{Sec: sec, Usec: usec}
}
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, 0)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
func Ioperm(from int, num int, on int) (err error) {
return ENOSYS
}
@@ -217,8 +191,8 @@ func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
-func InotifyInit() (fd int, err error) {
- return InotifyInit1(0)
+func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
+ rsa.Service_name_len = uint64(length)
}
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
index 8f0d0a5b5..27ee4db60 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
@@ -15,8 +15,6 @@ import (
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
-//sys dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
//sys Fchown(fd int, uid int, gid int) (err error)
@@ -60,7 +58,6 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sysnb InotifyInit() (fd int, err error)
//sys Ioperm(from int, num int, on int) (err error)
//sys Iopl(level int) (err error)
@@ -113,29 +110,6 @@ func setTimeval(sec, usec int64) Timeval {
return Timeval{Sec: int32(sec), Usec: int32(usec)}
}
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe() (p1 int, p2 int, err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- p[0], p[1], err = pipe()
- return
-}
-
//sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error)
func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
@@ -157,7 +131,7 @@ type rlimit32 struct {
//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT
func Getrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, nil, rlim)
+ err = Prlimit(0, resource, nil, rlim)
if err != ENOSYS {
return err
}
@@ -185,7 +159,7 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
func Setrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, rlim, nil)
+ err = Prlimit(0, resource, rlim, nil)
if err != ENOSYS {
return err
}
@@ -229,6 +203,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
+func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
+ rsa.Service_name_len = uint32(length)
+}
+
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
func Poll(fds []PollFd, timeout int) (n int, err error) {
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go
index 7e65e088d..299ba9de5 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go
@@ -3,8 +3,7 @@
// license that can be found in the LICENSE file.
//go:build linux && ppc
-// +build linux
-// +build ppc
+// +build linux,ppc
package unix
@@ -13,8 +12,6 @@ import (
"unsafe"
)
-//sys dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
//sys Fchown(fd int, uid int, gid int) (err error)
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
@@ -24,7 +21,6 @@ import (
//sysnb Geteuid() (euid int)
//sysnb Getgid() (gid int)
//sysnb Getuid() (uid int)
-//sysnb InotifyInit() (fd int, err error)
//sys Ioperm(from int, num int, on int) (err error)
//sys Iopl(level int) (err error)
//sys Lchown(path string, uid int, gid int) (err error)
@@ -143,7 +139,7 @@ const rlimInf32 = ^uint32(0)
const rlimInf64 = ^uint64(0)
func Getrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, nil, rlim)
+ err = Prlimit(0, resource, nil, rlim)
if err != ENOSYS {
return err
}
@@ -171,7 +167,7 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
func Setrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, rlim, nil)
+ err = Prlimit(0, resource, rlim, nil)
if err != ENOSYS {
return err
}
@@ -215,30 +211,8 @@ func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
-//sysnb pipe(p *[2]_C_int) (err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe(&pp)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
+func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
+ rsa.Service_name_len = uint32(length)
}
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
index 0b1f0d6da..0873b07b1 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
@@ -8,8 +8,6 @@
package unix
-//sys dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
//sys Fchown(fd int, uid int, gid int) (err error)
@@ -22,7 +20,6 @@ package unix
//sysnb Getgid() (gid int)
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = SYS_UGETRLIMIT
//sysnb Getuid() (uid int)
-//sysnb InotifyInit() (fd int, err error)
//sys Ioperm(from int, num int, on int) (err error)
//sys Iopl(level int) (err error)
//sys Lchown(path string, uid int, gid int) (err error)
@@ -100,30 +97,8 @@ func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
-//sysnb pipe(p *[2]_C_int) (err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe(&pp)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
+func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
+ rsa.Service_name_len = uint64(length)
}
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
index ce9bcd317..e2c5b32f9 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
@@ -9,13 +9,6 @@ package unix
import "unsafe"
-func EpollCreate(size int) (fd int, err error) {
- if size <= 0 {
- return -1, EINVAL
- }
- return EpollCreate1(0)
-}
-
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
//sys Fchown(fd int, uid int, gid int) (err error)
@@ -144,30 +137,6 @@ func utimes(path string, tv *[2]Timeval) (err error) {
return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
}
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, 0)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
func (r *PtraceRegs) PC() uint64 { return r.Pc }
func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc }
@@ -188,8 +157,8 @@ func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
-func InotifyInit() (fd int, err error) {
- return InotifyInit1(0)
+func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
+ rsa.Service_name_len = uint64(length)
}
func Pause() error {
@@ -225,7 +194,3 @@ func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error
}
return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags)
}
-
-// dup2 exists because func Dup3 in syscall_linux.go references
-// it in an unreachable path. dup2 isn't available on arm64.
-func dup2(oldfd int, newfd int) error
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
index a1e45694b..dfa204db4 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
@@ -11,8 +11,6 @@ import (
"unsafe"
)
-//sys dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
//sys Fchown(fd int, uid int, gid int) (err error)
@@ -25,7 +23,6 @@ import (
//sysnb Getgid() (gid int)
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
//sysnb Getuid() (uid int)
-//sysnb InotifyInit() (fd int, err error)
//sys Lchown(path string, uid int, gid int) (err error)
//sys Lstat(path string, stat *Stat_t) (err error)
//sys Pause() (err error)
@@ -77,30 +74,6 @@ func setTimeval(sec, usec int64) Timeval {
return Timeval{Sec: sec, Usec: usec}
}
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, 0) // pipe2 is the same as pipe when flags are set to 0.
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
func Ioperm(from int, num int, on int) (err error) {
return ENOSYS
}
@@ -129,6 +102,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
+func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
+ rsa.Service_name_len = uint64(length)
+}
+
// Linux on s390x uses the old mmap interface, which requires arguments to be passed in a struct.
// mmap2 also requires arguments to be passed in a struct; it is currently not exposed in .
func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
index 49055a3cf..4c54e0936 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
@@ -9,7 +9,6 @@ package unix
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
-//sys dup2(oldfd int, newfd int) (err error)
//sys Fchown(fd int, uid int, gid int) (err error)
//sys Fstat(fd int, stat *Stat_t) (err error)
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
@@ -20,7 +19,6 @@ package unix
//sysnb Getgid() (gid int)
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
//sysnb Getuid() (uid int)
-//sysnb InotifyInit() (fd int, err error)
//sys Lchown(path string, uid int, gid int) (err error)
//sys Listen(s int, n int) (err error)
//sys Lstat(path string, stat *Stat_t) (err error)
@@ -116,30 +114,8 @@ func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
-//sysnb pipe(p *[2]_C_int) (err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe(&pp)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
+func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
+ rsa.Service_name_len = uint64(length)
}
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go
index 77fcde7c1..d2a6495c7 100644
--- a/vendor/golang.org/x/sys/unix/syscall_solaris.go
+++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go
@@ -13,7 +13,10 @@
package unix
import (
+ "fmt"
+ "os"
"runtime"
+ "sync"
"syscall"
"unsafe"
)
@@ -744,3 +747,240 @@ func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, e
func Munmap(b []byte) (err error) {
return mapper.Munmap(b)
}
+
+// Event Ports
+
+type fileObjCookie struct {
+ fobj *fileObj
+ cookie interface{}
+}
+
+// EventPort provides a safe abstraction on top of Solaris/illumos Event Ports.
+type EventPort struct {
+ port int
+ mu sync.Mutex
+ fds map[uintptr]interface{}
+ paths map[string]*fileObjCookie
+}
+
+// PortEvent is an abstraction of the port_event C struct.
+// Compare Source against PORT_SOURCE_FILE or PORT_SOURCE_FD
+// to see if Path or Fd was the event source. The other will be
+// uninitialized.
+type PortEvent struct {
+ Cookie interface{}
+ Events int32
+ Fd uintptr
+ Path string
+ Source uint16
+ fobj *fileObj
+}
+
+// NewEventPort creates a new EventPort including the
+// underlying call to port_create(3c).
+func NewEventPort() (*EventPort, error) {
+ port, err := port_create()
+ if err != nil {
+ return nil, err
+ }
+ e := &EventPort{
+ port: port,
+ fds: make(map[uintptr]interface{}),
+ paths: make(map[string]*fileObjCookie),
+ }
+ return e, nil
+}
+
+//sys port_create() (n int, err error)
+//sys port_associate(port int, source int, object uintptr, events int, user *byte) (n int, err error)
+//sys port_dissociate(port int, source int, object uintptr) (n int, err error)
+//sys port_get(port int, pe *portEvent, timeout *Timespec) (n int, err error)
+//sys port_getn(port int, pe *portEvent, max uint32, nget *uint32, timeout *Timespec) (n int, err error)
+
+// Close closes the event port.
+func (e *EventPort) Close() error {
+ e.mu.Lock()
+ defer e.mu.Unlock()
+ e.fds = nil
+ e.paths = nil
+ return Close(e.port)
+}
+
+// PathIsWatched checks to see if path is associated with this EventPort.
+func (e *EventPort) PathIsWatched(path string) bool {
+ e.mu.Lock()
+ defer e.mu.Unlock()
+ _, found := e.paths[path]
+ return found
+}
+
+// FdIsWatched checks to see if fd is associated with this EventPort.
+func (e *EventPort) FdIsWatched(fd uintptr) bool {
+ e.mu.Lock()
+ defer e.mu.Unlock()
+ _, found := e.fds[fd]
+ return found
+}
+
+// AssociatePath wraps port_associate(3c) for a filesystem path including
+// creating the necessary file_obj from the provided stat information.
+func (e *EventPort) AssociatePath(path string, stat os.FileInfo, events int, cookie interface{}) error {
+ e.mu.Lock()
+ defer e.mu.Unlock()
+ if _, found := e.paths[path]; found {
+ return fmt.Errorf("%v is already associated with this Event Port", path)
+ }
+ fobj, err := createFileObj(path, stat)
+ if err != nil {
+ return err
+ }
+ fCookie := &fileObjCookie{fobj, cookie}
+ _, err = port_associate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(fobj)), events, (*byte)(unsafe.Pointer(&fCookie.cookie)))
+ if err != nil {
+ return err
+ }
+ e.paths[path] = fCookie
+ return nil
+}
+
+// DissociatePath wraps port_dissociate(3c) for a filesystem path.
+func (e *EventPort) DissociatePath(path string) error {
+ e.mu.Lock()
+ defer e.mu.Unlock()
+ f, ok := e.paths[path]
+ if !ok {
+ return fmt.Errorf("%v is not associated with this Event Port", path)
+ }
+ _, err := port_dissociate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(f.fobj)))
+ if err != nil {
+ return err
+ }
+ delete(e.paths, path)
+ return nil
+}
+
+// AssociateFd wraps calls to port_associate(3c) on file descriptors.
+func (e *EventPort) AssociateFd(fd uintptr, events int, cookie interface{}) error {
+ e.mu.Lock()
+ defer e.mu.Unlock()
+ if _, found := e.fds[fd]; found {
+ return fmt.Errorf("%v is already associated with this Event Port", fd)
+ }
+ pcookie := &cookie
+ _, err := port_associate(e.port, PORT_SOURCE_FD, fd, events, (*byte)(unsafe.Pointer(pcookie)))
+ if err != nil {
+ return err
+ }
+ e.fds[fd] = pcookie
+ return nil
+}
+
+// DissociateFd wraps calls to port_dissociate(3c) on file descriptors.
+func (e *EventPort) DissociateFd(fd uintptr) error {
+ e.mu.Lock()
+ defer e.mu.Unlock()
+ _, ok := e.fds[fd]
+ if !ok {
+ return fmt.Errorf("%v is not associated with this Event Port", fd)
+ }
+ _, err := port_dissociate(e.port, PORT_SOURCE_FD, fd)
+ if err != nil {
+ return err
+ }
+ delete(e.fds, fd)
+ return nil
+}
+
+func createFileObj(name string, stat os.FileInfo) (*fileObj, error) {
+ fobj := new(fileObj)
+ bs, err := ByteSliceFromString(name)
+ if err != nil {
+ return nil, err
+ }
+ fobj.Name = (*int8)(unsafe.Pointer(&bs[0]))
+ s := stat.Sys().(*syscall.Stat_t)
+ fobj.Atim.Sec = s.Atim.Sec
+ fobj.Atim.Nsec = s.Atim.Nsec
+ fobj.Mtim.Sec = s.Mtim.Sec
+ fobj.Mtim.Nsec = s.Mtim.Nsec
+ fobj.Ctim.Sec = s.Ctim.Sec
+ fobj.Ctim.Nsec = s.Ctim.Nsec
+ return fobj, nil
+}
+
+// GetOne wraps port_get(3c) and returns a single PortEvent.
+func (e *EventPort) GetOne(t *Timespec) (*PortEvent, error) {
+ pe := new(portEvent)
+ _, err := port_get(e.port, pe, t)
+ if err != nil {
+ return nil, err
+ }
+ p := new(PortEvent)
+ p.Events = pe.Events
+ p.Source = pe.Source
+ e.mu.Lock()
+ defer e.mu.Unlock()
+ switch pe.Source {
+ case PORT_SOURCE_FD:
+ p.Fd = uintptr(pe.Object)
+ cookie := (*interface{})(unsafe.Pointer(pe.User))
+ p.Cookie = *cookie
+ delete(e.fds, p.Fd)
+ case PORT_SOURCE_FILE:
+ p.fobj = (*fileObj)(unsafe.Pointer(uintptr(pe.Object)))
+ p.Path = BytePtrToString((*byte)(unsafe.Pointer(p.fobj.Name)))
+ cookie := (*interface{})(unsafe.Pointer(pe.User))
+ p.Cookie = *cookie
+ delete(e.paths, p.Path)
+ }
+ return p, nil
+}
+
+// Pending wraps port_getn(3c) and returns how many events are pending.
+func (e *EventPort) Pending() (int, error) {
+ var n uint32 = 0
+ _, err := port_getn(e.port, nil, 0, &n, nil)
+ return int(n), err
+}
+
+// Get wraps port_getn(3c) and fills a slice of PortEvent.
+// It will block until either min events have been received
+// or the timeout has been exceeded. It will return how many
+// events were actually received along with any error information.
+func (e *EventPort) Get(s []PortEvent, min int, timeout *Timespec) (int, error) {
+ if min == 0 {
+ return 0, fmt.Errorf("need to request at least one event or use Pending() instead")
+ }
+ if len(s) < min {
+ return 0, fmt.Errorf("len(s) (%d) is less than min events requested (%d)", len(s), min)
+ }
+ got := uint32(min)
+ max := uint32(len(s))
+ var err error
+ ps := make([]portEvent, max, max)
+ _, err = port_getn(e.port, &ps[0], max, &got, timeout)
+ // got will be trustworthy with ETIME, but not any other error.
+ if err != nil && err != ETIME {
+ return 0, err
+ }
+ e.mu.Lock()
+ defer e.mu.Unlock()
+ for i := 0; i < int(got); i++ {
+ s[i].Events = ps[i].Events
+ s[i].Source = ps[i].Source
+ switch ps[i].Source {
+ case PORT_SOURCE_FD:
+ s[i].Fd = uintptr(ps[i].Object)
+ cookie := (*interface{})(unsafe.Pointer(ps[i].User))
+ s[i].Cookie = *cookie
+ delete(e.fds, s[i].Fd)
+ case PORT_SOURCE_FILE:
+ s[i].fobj = (*fileObj)(unsafe.Pointer(uintptr(ps[i].Object)))
+ s[i].Path = BytePtrToString((*byte)(unsafe.Pointer(s[i].fobj.Name)))
+ cookie := (*interface{})(unsafe.Pointer(ps[i].User))
+ s[i].Cookie = *cookie
+ delete(e.paths, s[i].Path)
+ }
+ }
+ return int(got), err
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go
index a7618ceb5..cf296a243 100644
--- a/vendor/golang.org/x/sys/unix/syscall_unix.go
+++ b/vendor/golang.org/x/sys/unix/syscall_unix.go
@@ -313,6 +313,10 @@ func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) {
return
}
+func Send(s int, buf []byte, flags int) (err error) {
+ return sendto(s, buf, flags, nil, 0)
+}
+
func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error) {
ptr, n, err := to.sockaddr()
if err != nil {
diff --git a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
index 13f58d2b2..1ffd8bfcf 100644
--- a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
+++ b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
@@ -222,6 +222,8 @@ func (cmsg *Cmsghdr) SetLen(length int) {
//sys Creat(path string, mode uint32) (fd int, err error) = SYS___CREAT_A
//sys Dup(oldfd int) (fd int, err error)
//sys Dup2(oldfd int, newfd int) (err error)
+//sys Errno2() (er2 int) = SYS___ERRNO2
+//sys Err2ad() (eadd *int) = SYS___ERR2AD
//sys Exit(code int)
//sys Fchdir(fd int) (err error)
//sys Fchmod(fd int, mode uint32) (err error)
@@ -245,10 +247,12 @@ func Fstat(fd int, stat *Stat_t) (err error) {
//sys Poll(fds []PollFd, timeout int) (n int, err error) = SYS_POLL
//sys Times(tms *Tms) (ticks uintptr, err error) = SYS_TIMES
//sys W_Getmntent(buff *byte, size int) (lastsys int, err error) = SYS_W_GETMNTENT
+//sys W_Getmntent_A(buff *byte, size int) (lastsys int, err error) = SYS___W_GETMNTENT_A
-//sys Mount(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) = SYS___MOUNT_A
-//sys Unmount(filesystem string, mtm int) (err error) = SYS___UMOUNT_A
+//sys mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) = SYS___MOUNT_A
+//sys unmount(filesystem string, mtm int) (err error) = SYS___UMOUNT_A
//sys Chroot(path string) (err error) = SYS___CHROOT_A
+//sys Select(nmsgsfds int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (ret int, err error) = SYS_SELECT
//sysnb Uname(buf *Utsname) (err error) = SYS___UNAME_A
func Ptsname(fd int) (name string, err error) {
@@ -1779,3 +1783,47 @@ func SetNonblock(fd int, nonblocking bool) (err error) {
func Exec(argv0 string, argv []string, envv []string) error {
return syscall.Exec(argv0, argv, envv)
}
+
+func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) {
+ if needspace := 8 - len(fstype); needspace <= 0 {
+ fstype = fstype[:8]
+ } else {
+ fstype += " "[:needspace]
+ }
+ return mount_LE(target, source, fstype, uint32(flags), int32(len(data)), data)
+}
+
+func Unmount(name string, mtm int) (err error) {
+ // mountpoint is always a full path and starts with a '/'
+ // check if input string is not a mountpoint but a filesystem name
+ if name[0] != '/' {
+ return unmount(name, mtm)
+ }
+ // treat name as mountpoint
+ b2s := func(arr []byte) string {
+ nulli := bytes.IndexByte(arr, 0)
+ if nulli == -1 {
+ return string(arr)
+ } else {
+ return string(arr[:nulli])
+ }
+ }
+ var buffer struct {
+ header W_Mnth
+ fsinfo [64]W_Mntent
+ }
+ fsCount, err := W_Getmntent_A((*byte)(unsafe.Pointer(&buffer)), int(unsafe.Sizeof(buffer)))
+ if err != nil {
+ return err
+ }
+ if fsCount == 0 {
+ return EINVAL
+ }
+ for i := 0; i < fsCount; i++ {
+ if b2s(buffer.fsinfo[i].Mountpoint[:]) == name {
+ err = unmount(b2s(buffer.fsinfo[i].Fsname[:]), mtm)
+ break
+ }
+ }
+ return err
+}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go
deleted file mode 100644
index 7ee196f7f..000000000
--- a/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go
+++ /dev/null
@@ -1,1789 +0,0 @@
-// mkerrors.sh -m32
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build 386 && darwin
-// +build 386,darwin
-
-// Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -m32 _const.go
-
-package unix
-
-import "syscall"
-
-const (
- AF_APPLETALK = 0x10
- AF_CCITT = 0xa
- AF_CHAOS = 0x5
- AF_CNT = 0x15
- AF_COIP = 0x14
- AF_DATAKIT = 0x9
- AF_DECnet = 0xc
- AF_DLI = 0xd
- AF_E164 = 0x1c
- AF_ECMA = 0x8
- AF_HYLINK = 0xf
- AF_IEEE80211 = 0x25
- AF_IMPLINK = 0x3
- AF_INET = 0x2
- AF_INET6 = 0x1e
- AF_IPX = 0x17
- AF_ISDN = 0x1c
- AF_ISO = 0x7
- AF_LAT = 0xe
- AF_LINK = 0x12
- AF_LOCAL = 0x1
- AF_MAX = 0x28
- AF_NATM = 0x1f
- AF_NDRV = 0x1b
- AF_NETBIOS = 0x21
- AF_NS = 0x6
- AF_OSI = 0x7
- AF_PPP = 0x22
- AF_PUP = 0x4
- AF_RESERVED_36 = 0x24
- AF_ROUTE = 0x11
- AF_SIP = 0x18
- AF_SNA = 0xb
- AF_SYSTEM = 0x20
- AF_SYS_CONTROL = 0x2
- AF_UNIX = 0x1
- AF_UNSPEC = 0x0
- AF_UTUN = 0x26
- ALTWERASE = 0x200
- ATTR_BIT_MAP_COUNT = 0x5
- ATTR_CMN_ACCESSMASK = 0x20000
- ATTR_CMN_ACCTIME = 0x1000
- ATTR_CMN_ADDEDTIME = 0x10000000
- ATTR_CMN_BKUPTIME = 0x2000
- ATTR_CMN_CHGTIME = 0x800
- ATTR_CMN_CRTIME = 0x200
- ATTR_CMN_DATA_PROTECT_FLAGS = 0x40000000
- ATTR_CMN_DEVID = 0x2
- ATTR_CMN_DOCUMENT_ID = 0x100000
- ATTR_CMN_ERROR = 0x20000000
- ATTR_CMN_EXTENDED_SECURITY = 0x400000
- ATTR_CMN_FILEID = 0x2000000
- ATTR_CMN_FLAGS = 0x40000
- ATTR_CMN_FNDRINFO = 0x4000
- ATTR_CMN_FSID = 0x4
- ATTR_CMN_FULLPATH = 0x8000000
- ATTR_CMN_GEN_COUNT = 0x80000
- ATTR_CMN_GRPID = 0x10000
- ATTR_CMN_GRPUUID = 0x1000000
- ATTR_CMN_MODTIME = 0x400
- ATTR_CMN_NAME = 0x1
- ATTR_CMN_NAMEDATTRCOUNT = 0x80000
- ATTR_CMN_NAMEDATTRLIST = 0x100000
- ATTR_CMN_OBJID = 0x20
- ATTR_CMN_OBJPERMANENTID = 0x40
- ATTR_CMN_OBJTAG = 0x10
- ATTR_CMN_OBJTYPE = 0x8
- ATTR_CMN_OWNERID = 0x8000
- ATTR_CMN_PARENTID = 0x4000000
- ATTR_CMN_PAROBJID = 0x80
- ATTR_CMN_RETURNED_ATTRS = 0x80000000
- ATTR_CMN_SCRIPT = 0x100
- ATTR_CMN_SETMASK = 0x41c7ff00
- ATTR_CMN_USERACCESS = 0x200000
- ATTR_CMN_UUID = 0x800000
- ATTR_CMN_VALIDMASK = 0xffffffff
- ATTR_CMN_VOLSETMASK = 0x6700
- ATTR_FILE_ALLOCSIZE = 0x4
- ATTR_FILE_CLUMPSIZE = 0x10
- ATTR_FILE_DATAALLOCSIZE = 0x400
- ATTR_FILE_DATAEXTENTS = 0x800
- ATTR_FILE_DATALENGTH = 0x200
- ATTR_FILE_DEVTYPE = 0x20
- ATTR_FILE_FILETYPE = 0x40
- ATTR_FILE_FORKCOUNT = 0x80
- ATTR_FILE_FORKLIST = 0x100
- ATTR_FILE_IOBLOCKSIZE = 0x8
- ATTR_FILE_LINKCOUNT = 0x1
- ATTR_FILE_RSRCALLOCSIZE = 0x2000
- ATTR_FILE_RSRCEXTENTS = 0x4000
- ATTR_FILE_RSRCLENGTH = 0x1000
- ATTR_FILE_SETMASK = 0x20
- ATTR_FILE_TOTALSIZE = 0x2
- ATTR_FILE_VALIDMASK = 0x37ff
- ATTR_VOL_ALLOCATIONCLUMP = 0x40
- ATTR_VOL_ATTRIBUTES = 0x40000000
- ATTR_VOL_CAPABILITIES = 0x20000
- ATTR_VOL_DIRCOUNT = 0x400
- ATTR_VOL_ENCODINGSUSED = 0x10000
- ATTR_VOL_FILECOUNT = 0x200
- ATTR_VOL_FSTYPE = 0x1
- ATTR_VOL_INFO = 0x80000000
- ATTR_VOL_IOBLOCKSIZE = 0x80
- ATTR_VOL_MAXOBJCOUNT = 0x800
- ATTR_VOL_MINALLOCATION = 0x20
- ATTR_VOL_MOUNTEDDEVICE = 0x8000
- ATTR_VOL_MOUNTFLAGS = 0x4000
- ATTR_VOL_MOUNTPOINT = 0x1000
- ATTR_VOL_NAME = 0x2000
- ATTR_VOL_OBJCOUNT = 0x100
- ATTR_VOL_QUOTA_SIZE = 0x10000000
- ATTR_VOL_RESERVED_SIZE = 0x20000000
- ATTR_VOL_SETMASK = 0x80002000
- ATTR_VOL_SIGNATURE = 0x2
- ATTR_VOL_SIZE = 0x4
- ATTR_VOL_SPACEAVAIL = 0x10
- ATTR_VOL_SPACEFREE = 0x8
- ATTR_VOL_UUID = 0x40000
- ATTR_VOL_VALIDMASK = 0xf007ffff
- B0 = 0x0
- B110 = 0x6e
- B115200 = 0x1c200
- B1200 = 0x4b0
- B134 = 0x86
- B14400 = 0x3840
- B150 = 0x96
- B1800 = 0x708
- B19200 = 0x4b00
- B200 = 0xc8
- B230400 = 0x38400
- B2400 = 0x960
- B28800 = 0x7080
- B300 = 0x12c
- B38400 = 0x9600
- B4800 = 0x12c0
- B50 = 0x32
- B57600 = 0xe100
- B600 = 0x258
- B7200 = 0x1c20
- B75 = 0x4b
- B76800 = 0x12c00
- B9600 = 0x2580
- BIOCFLUSH = 0x20004268
- BIOCGBLEN = 0x40044266
- BIOCGDLT = 0x4004426a
- BIOCGDLTLIST = 0xc00c4279
- BIOCGETIF = 0x4020426b
- BIOCGHDRCMPLT = 0x40044274
- BIOCGRSIG = 0x40044272
- BIOCGRTIMEOUT = 0x4008426e
- BIOCGSEESENT = 0x40044276
- BIOCGSTATS = 0x4008426f
- BIOCIMMEDIATE = 0x80044270
- BIOCPROMISC = 0x20004269
- BIOCSBLEN = 0xc0044266
- BIOCSDLT = 0x80044278
- BIOCSETF = 0x80084267
- BIOCSETFNR = 0x8008427e
- BIOCSETIF = 0x8020426c
- BIOCSHDRCMPLT = 0x80044275
- BIOCSRSIG = 0x80044273
- BIOCSRTIMEOUT = 0x8008426d
- BIOCSSEESENT = 0x80044277
- BIOCVERSION = 0x40044271
- BPF_A = 0x10
- BPF_ABS = 0x20
- BPF_ADD = 0x0
- BPF_ALIGNMENT = 0x4
- BPF_ALU = 0x4
- BPF_AND = 0x50
- BPF_B = 0x10
- BPF_DIV = 0x30
- BPF_H = 0x8
- BPF_IMM = 0x0
- BPF_IND = 0x40
- BPF_JA = 0x0
- BPF_JEQ = 0x10
- BPF_JGE = 0x30
- BPF_JGT = 0x20
- BPF_JMP = 0x5
- BPF_JSET = 0x40
- BPF_K = 0x0
- BPF_LD = 0x0
- BPF_LDX = 0x1
- BPF_LEN = 0x80
- BPF_LSH = 0x60
- BPF_MAJOR_VERSION = 0x1
- BPF_MAXBUFSIZE = 0x80000
- BPF_MAXINSNS = 0x200
- BPF_MEM = 0x60
- BPF_MEMWORDS = 0x10
- BPF_MINBUFSIZE = 0x20
- BPF_MINOR_VERSION = 0x1
- BPF_MISC = 0x7
- BPF_MSH = 0xa0
- BPF_MUL = 0x20
- BPF_NEG = 0x80
- BPF_OR = 0x40
- BPF_RELEASE = 0x30bb6
- BPF_RET = 0x6
- BPF_RSH = 0x70
- BPF_ST = 0x2
- BPF_STX = 0x3
- BPF_SUB = 0x10
- BPF_TAX = 0x0
- BPF_TXA = 0x80
- BPF_W = 0x0
- BPF_X = 0x8
- BRKINT = 0x2
- BS0 = 0x0
- BS1 = 0x8000
- BSDLY = 0x8000
- CFLUSH = 0xf
- CLOCAL = 0x8000
- CLOCK_MONOTONIC = 0x6
- CLOCK_MONOTONIC_RAW = 0x4
- CLOCK_MONOTONIC_RAW_APPROX = 0x5
- CLOCK_PROCESS_CPUTIME_ID = 0xc
- CLOCK_REALTIME = 0x0
- CLOCK_THREAD_CPUTIME_ID = 0x10
- CLOCK_UPTIME_RAW = 0x8
- CLOCK_UPTIME_RAW_APPROX = 0x9
- CLONE_NOFOLLOW = 0x1
- CLONE_NOOWNERCOPY = 0x2
- CR0 = 0x0
- CR1 = 0x1000
- CR2 = 0x2000
- CR3 = 0x3000
- CRDLY = 0x3000
- CREAD = 0x800
- CRTSCTS = 0x30000
- CS5 = 0x0
- CS6 = 0x100
- CS7 = 0x200
- CS8 = 0x300
- CSIZE = 0x300
- CSTART = 0x11
- CSTATUS = 0x14
- CSTOP = 0x13
- CSTOPB = 0x400
- CSUSP = 0x1a
- CTLIOCGINFO = 0xc0644e03
- CTL_HW = 0x6
- CTL_KERN = 0x1
- CTL_MAXNAME = 0xc
- CTL_NET = 0x4
- DLT_A429 = 0xb8
- DLT_A653_ICM = 0xb9
- DLT_AIRONET_HEADER = 0x78
- DLT_AOS = 0xde
- DLT_APPLE_IP_OVER_IEEE1394 = 0x8a
- DLT_ARCNET = 0x7
- DLT_ARCNET_LINUX = 0x81
- DLT_ATM_CLIP = 0x13
- DLT_ATM_RFC1483 = 0xb
- DLT_AURORA = 0x7e
- DLT_AX25 = 0x3
- DLT_AX25_KISS = 0xca
- DLT_BACNET_MS_TP = 0xa5
- DLT_BLUETOOTH_HCI_H4 = 0xbb
- DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9
- DLT_CAN20B = 0xbe
- DLT_CAN_SOCKETCAN = 0xe3
- DLT_CHAOS = 0x5
- DLT_CHDLC = 0x68
- DLT_CISCO_IOS = 0x76
- DLT_C_HDLC = 0x68
- DLT_C_HDLC_WITH_DIR = 0xcd
- DLT_DBUS = 0xe7
- DLT_DECT = 0xdd
- DLT_DOCSIS = 0x8f
- DLT_DVB_CI = 0xeb
- DLT_ECONET = 0x73
- DLT_EN10MB = 0x1
- DLT_EN3MB = 0x2
- DLT_ENC = 0x6d
- DLT_ERF = 0xc5
- DLT_ERF_ETH = 0xaf
- DLT_ERF_POS = 0xb0
- DLT_FC_2 = 0xe0
- DLT_FC_2_WITH_FRAME_DELIMS = 0xe1
- DLT_FDDI = 0xa
- DLT_FLEXRAY = 0xd2
- DLT_FRELAY = 0x6b
- DLT_FRELAY_WITH_DIR = 0xce
- DLT_GCOM_SERIAL = 0xad
- DLT_GCOM_T1E1 = 0xac
- DLT_GPF_F = 0xab
- DLT_GPF_T = 0xaa
- DLT_GPRS_LLC = 0xa9
- DLT_GSMTAP_ABIS = 0xda
- DLT_GSMTAP_UM = 0xd9
- DLT_HHDLC = 0x79
- DLT_IBM_SN = 0x92
- DLT_IBM_SP = 0x91
- DLT_IEEE802 = 0x6
- DLT_IEEE802_11 = 0x69
- DLT_IEEE802_11_RADIO = 0x7f
- DLT_IEEE802_11_RADIO_AVS = 0xa3
- DLT_IEEE802_15_4 = 0xc3
- DLT_IEEE802_15_4_LINUX = 0xbf
- DLT_IEEE802_15_4_NOFCS = 0xe6
- DLT_IEEE802_15_4_NONASK_PHY = 0xd7
- DLT_IEEE802_16_MAC_CPS = 0xbc
- DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1
- DLT_IPFILTER = 0x74
- DLT_IPMB = 0xc7
- DLT_IPMB_LINUX = 0xd1
- DLT_IPNET = 0xe2
- DLT_IPOIB = 0xf2
- DLT_IPV4 = 0xe4
- DLT_IPV6 = 0xe5
- DLT_IP_OVER_FC = 0x7a
- DLT_JUNIPER_ATM1 = 0x89
- DLT_JUNIPER_ATM2 = 0x87
- DLT_JUNIPER_ATM_CEMIC = 0xee
- DLT_JUNIPER_CHDLC = 0xb5
- DLT_JUNIPER_ES = 0x84
- DLT_JUNIPER_ETHER = 0xb2
- DLT_JUNIPER_FIBRECHANNEL = 0xea
- DLT_JUNIPER_FRELAY = 0xb4
- DLT_JUNIPER_GGSN = 0x85
- DLT_JUNIPER_ISM = 0xc2
- DLT_JUNIPER_MFR = 0x86
- DLT_JUNIPER_MLFR = 0x83
- DLT_JUNIPER_MLPPP = 0x82
- DLT_JUNIPER_MONITOR = 0xa4
- DLT_JUNIPER_PIC_PEER = 0xae
- DLT_JUNIPER_PPP = 0xb3
- DLT_JUNIPER_PPPOE = 0xa7
- DLT_JUNIPER_PPPOE_ATM = 0xa8
- DLT_JUNIPER_SERVICES = 0x88
- DLT_JUNIPER_SRX_E2E = 0xe9
- DLT_JUNIPER_ST = 0xc8
- DLT_JUNIPER_VP = 0xb7
- DLT_JUNIPER_VS = 0xe8
- DLT_LAPB_WITH_DIR = 0xcf
- DLT_LAPD = 0xcb
- DLT_LIN = 0xd4
- DLT_LINUX_EVDEV = 0xd8
- DLT_LINUX_IRDA = 0x90
- DLT_LINUX_LAPD = 0xb1
- DLT_LINUX_PPP_WITHDIRECTION = 0xa6
- DLT_LINUX_SLL = 0x71
- DLT_LOOP = 0x6c
- DLT_LTALK = 0x72
- DLT_MATCHING_MAX = 0xf5
- DLT_MATCHING_MIN = 0x68
- DLT_MFR = 0xb6
- DLT_MOST = 0xd3
- DLT_MPEG_2_TS = 0xf3
- DLT_MPLS = 0xdb
- DLT_MTP2 = 0x8c
- DLT_MTP2_WITH_PHDR = 0x8b
- DLT_MTP3 = 0x8d
- DLT_MUX27010 = 0xec
- DLT_NETANALYZER = 0xf0
- DLT_NETANALYZER_TRANSPARENT = 0xf1
- DLT_NFC_LLCP = 0xf5
- DLT_NFLOG = 0xef
- DLT_NG40 = 0xf4
- DLT_NULL = 0x0
- DLT_PCI_EXP = 0x7d
- DLT_PFLOG = 0x75
- DLT_PFSYNC = 0x12
- DLT_PPI = 0xc0
- DLT_PPP = 0x9
- DLT_PPP_BSDOS = 0x10
- DLT_PPP_ETHER = 0x33
- DLT_PPP_PPPD = 0xa6
- DLT_PPP_SERIAL = 0x32
- DLT_PPP_WITH_DIR = 0xcc
- DLT_PPP_WITH_DIRECTION = 0xa6
- DLT_PRISM_HEADER = 0x77
- DLT_PRONET = 0x4
- DLT_RAIF1 = 0xc6
- DLT_RAW = 0xc
- DLT_RIO = 0x7c
- DLT_SCCP = 0x8e
- DLT_SITA = 0xc4
- DLT_SLIP = 0x8
- DLT_SLIP_BSDOS = 0xf
- DLT_STANAG_5066_D_PDU = 0xed
- DLT_SUNATM = 0x7b
- DLT_SYMANTEC_FIREWALL = 0x63
- DLT_TZSP = 0x80
- DLT_USB = 0xba
- DLT_USB_LINUX = 0xbd
- DLT_USB_LINUX_MMAPPED = 0xdc
- DLT_USER0 = 0x93
- DLT_USER1 = 0x94
- DLT_USER10 = 0x9d
- DLT_USER11 = 0x9e
- DLT_USER12 = 0x9f
- DLT_USER13 = 0xa0
- DLT_USER14 = 0xa1
- DLT_USER15 = 0xa2
- DLT_USER2 = 0x95
- DLT_USER3 = 0x96
- DLT_USER4 = 0x97
- DLT_USER5 = 0x98
- DLT_USER6 = 0x99
- DLT_USER7 = 0x9a
- DLT_USER8 = 0x9b
- DLT_USER9 = 0x9c
- DLT_WIHART = 0xdf
- DLT_X2E_SERIAL = 0xd5
- DLT_X2E_XORAYA = 0xd6
- DT_BLK = 0x6
- DT_CHR = 0x2
- DT_DIR = 0x4
- DT_FIFO = 0x1
- DT_LNK = 0xa
- DT_REG = 0x8
- DT_SOCK = 0xc
- DT_UNKNOWN = 0x0
- DT_WHT = 0xe
- ECHO = 0x8
- ECHOCTL = 0x40
- ECHOE = 0x2
- ECHOK = 0x4
- ECHOKE = 0x1
- ECHONL = 0x10
- ECHOPRT = 0x20
- EVFILT_AIO = -0x3
- EVFILT_EXCEPT = -0xf
- EVFILT_FS = -0x9
- EVFILT_MACHPORT = -0x8
- EVFILT_PROC = -0x5
- EVFILT_READ = -0x1
- EVFILT_SIGNAL = -0x6
- EVFILT_SYSCOUNT = 0xf
- EVFILT_THREADMARKER = 0xf
- EVFILT_TIMER = -0x7
- EVFILT_USER = -0xa
- EVFILT_VM = -0xc
- EVFILT_VNODE = -0x4
- EVFILT_WRITE = -0x2
- EV_ADD = 0x1
- EV_CLEAR = 0x20
- EV_DELETE = 0x2
- EV_DISABLE = 0x8
- EV_DISPATCH = 0x80
- EV_DISPATCH2 = 0x180
- EV_ENABLE = 0x4
- EV_EOF = 0x8000
- EV_ERROR = 0x4000
- EV_FLAG0 = 0x1000
- EV_FLAG1 = 0x2000
- EV_ONESHOT = 0x10
- EV_OOBAND = 0x2000
- EV_POLL = 0x1000
- EV_RECEIPT = 0x40
- EV_SYSFLAGS = 0xf000
- EV_UDATA_SPECIFIC = 0x100
- EV_VANISHED = 0x200
- EXTA = 0x4b00
- EXTB = 0x9600
- EXTPROC = 0x800
- FD_CLOEXEC = 0x1
- FD_SETSIZE = 0x400
- FF0 = 0x0
- FF1 = 0x4000
- FFDLY = 0x4000
- FLUSHO = 0x800000
- FSOPT_ATTR_CMN_EXTENDED = 0x20
- FSOPT_NOFOLLOW = 0x1
- FSOPT_NOINMEMUPDATE = 0x2
- FSOPT_PACK_INVAL_ATTRS = 0x8
- FSOPT_REPORT_FULLSIZE = 0x4
- F_ADDFILESIGS = 0x3d
- F_ADDFILESIGS_FOR_DYLD_SIM = 0x53
- F_ADDFILESIGS_RETURN = 0x61
- F_ADDSIGS = 0x3b
- F_ALLOCATEALL = 0x4
- F_ALLOCATECONTIG = 0x2
- F_BARRIERFSYNC = 0x55
- F_CHECK_LV = 0x62
- F_CHKCLEAN = 0x29
- F_DUPFD = 0x0
- F_DUPFD_CLOEXEC = 0x43
- F_FINDSIGS = 0x4e
- F_FLUSH_DATA = 0x28
- F_FREEZE_FS = 0x35
- F_FULLFSYNC = 0x33
- F_GETCODEDIR = 0x48
- F_GETFD = 0x1
- F_GETFL = 0x3
- F_GETLK = 0x7
- F_GETLKPID = 0x42
- F_GETNOSIGPIPE = 0x4a
- F_GETOWN = 0x5
- F_GETPATH = 0x32
- F_GETPATH_MTMINFO = 0x47
- F_GETPROTECTIONCLASS = 0x3f
- F_GETPROTECTIONLEVEL = 0x4d
- F_GLOBAL_NOCACHE = 0x37
- F_LOG2PHYS = 0x31
- F_LOG2PHYS_EXT = 0x41
- F_NOCACHE = 0x30
- F_NODIRECT = 0x3e
- F_OK = 0x0
- F_PATHPKG_CHECK = 0x34
- F_PEOFPOSMODE = 0x3
- F_PREALLOCATE = 0x2a
- F_PUNCHHOLE = 0x63
- F_RDADVISE = 0x2c
- F_RDAHEAD = 0x2d
- F_RDLCK = 0x1
- F_SETBACKINGSTORE = 0x46
- F_SETFD = 0x2
- F_SETFL = 0x4
- F_SETLK = 0x8
- F_SETLKW = 0x9
- F_SETLKWTIMEOUT = 0xa
- F_SETNOSIGPIPE = 0x49
- F_SETOWN = 0x6
- F_SETPROTECTIONCLASS = 0x40
- F_SETSIZE = 0x2b
- F_SINGLE_WRITER = 0x4c
- F_THAW_FS = 0x36
- F_TRANSCODEKEY = 0x4b
- F_TRIM_ACTIVE_FILE = 0x64
- F_UNLCK = 0x2
- F_VOLPOSMODE = 0x4
- F_WRLCK = 0x3
- HUPCL = 0x4000
- HW_MACHINE = 0x1
- ICANON = 0x100
- ICMP6_FILTER = 0x12
- ICRNL = 0x100
- IEXTEN = 0x400
- IFF_ALLMULTI = 0x200
- IFF_ALTPHYS = 0x4000
- IFF_BROADCAST = 0x2
- IFF_DEBUG = 0x4
- IFF_LINK0 = 0x1000
- IFF_LINK1 = 0x2000
- IFF_LINK2 = 0x4000
- IFF_LOOPBACK = 0x8
- IFF_MULTICAST = 0x8000
- IFF_NOARP = 0x80
- IFF_NOTRAILERS = 0x20
- IFF_OACTIVE = 0x400
- IFF_POINTOPOINT = 0x10
- IFF_PROMISC = 0x100
- IFF_RUNNING = 0x40
- IFF_SIMPLEX = 0x800
- IFF_UP = 0x1
- IFNAMSIZ = 0x10
- IFT_1822 = 0x2
- IFT_AAL5 = 0x31
- IFT_ARCNET = 0x23
- IFT_ARCNETPLUS = 0x24
- IFT_ATM = 0x25
- IFT_BRIDGE = 0xd1
- IFT_CARP = 0xf8
- IFT_CELLULAR = 0xff
- IFT_CEPT = 0x13
- IFT_DS3 = 0x1e
- IFT_ENC = 0xf4
- IFT_EON = 0x19
- IFT_ETHER = 0x6
- IFT_FAITH = 0x38
- IFT_FDDI = 0xf
- IFT_FRELAY = 0x20
- IFT_FRELAYDCE = 0x2c
- IFT_GIF = 0x37
- IFT_HDH1822 = 0x3
- IFT_HIPPI = 0x2f
- IFT_HSSI = 0x2e
- IFT_HY = 0xe
- IFT_IEEE1394 = 0x90
- IFT_IEEE8023ADLAG = 0x88
- IFT_ISDNBASIC = 0x14
- IFT_ISDNPRIMARY = 0x15
- IFT_ISO88022LLC = 0x29
- IFT_ISO88023 = 0x7
- IFT_ISO88024 = 0x8
- IFT_ISO88025 = 0x9
- IFT_ISO88026 = 0xa
- IFT_L2VLAN = 0x87
- IFT_LAPB = 0x10
- IFT_LOCALTALK = 0x2a
- IFT_LOOP = 0x18
- IFT_MIOX25 = 0x26
- IFT_MODEM = 0x30
- IFT_NSIP = 0x1b
- IFT_OTHER = 0x1
- IFT_P10 = 0xc
- IFT_P80 = 0xd
- IFT_PARA = 0x22
- IFT_PDP = 0xff
- IFT_PFLOG = 0xf5
- IFT_PFSYNC = 0xf6
- IFT_PKTAP = 0xfe
- IFT_PPP = 0x17
- IFT_PROPMUX = 0x36
- IFT_PROPVIRTUAL = 0x35
- IFT_PTPSERIAL = 0x16
- IFT_RS232 = 0x21
- IFT_SDLC = 0x11
- IFT_SIP = 0x1f
- IFT_SLIP = 0x1c
- IFT_SMDSDXI = 0x2b
- IFT_SMDSICIP = 0x34
- IFT_SONET = 0x27
- IFT_SONETPATH = 0x32
- IFT_SONETVT = 0x33
- IFT_STARLAN = 0xb
- IFT_STF = 0x39
- IFT_T1 = 0x12
- IFT_ULTRA = 0x1d
- IFT_V35 = 0x2d
- IFT_X25 = 0x5
- IFT_X25DDN = 0x4
- IFT_X25PLE = 0x28
- IFT_XETHER = 0x1a
- IGNBRK = 0x1
- IGNCR = 0x80
- IGNPAR = 0x4
- IMAXBEL = 0x2000
- INLCR = 0x40
- INPCK = 0x10
- IN_CLASSA_HOST = 0xffffff
- IN_CLASSA_MAX = 0x80
- IN_CLASSA_NET = 0xff000000
- IN_CLASSA_NSHIFT = 0x18
- IN_CLASSB_HOST = 0xffff
- IN_CLASSB_MAX = 0x10000
- IN_CLASSB_NET = 0xffff0000
- IN_CLASSB_NSHIFT = 0x10
- IN_CLASSC_HOST = 0xff
- IN_CLASSC_NET = 0xffffff00
- IN_CLASSC_NSHIFT = 0x8
- IN_CLASSD_HOST = 0xfffffff
- IN_CLASSD_NET = 0xf0000000
- IN_CLASSD_NSHIFT = 0x1c
- IN_LINKLOCALNETNUM = 0xa9fe0000
- IN_LOOPBACKNET = 0x7f
- IPPROTO_3PC = 0x22
- IPPROTO_ADFS = 0x44
- IPPROTO_AH = 0x33
- IPPROTO_AHIP = 0x3d
- IPPROTO_APES = 0x63
- IPPROTO_ARGUS = 0xd
- IPPROTO_AX25 = 0x5d
- IPPROTO_BHA = 0x31
- IPPROTO_BLT = 0x1e
- IPPROTO_BRSATMON = 0x4c
- IPPROTO_CFTP = 0x3e
- IPPROTO_CHAOS = 0x10
- IPPROTO_CMTP = 0x26
- IPPROTO_CPHB = 0x49
- IPPROTO_CPNX = 0x48
- IPPROTO_DDP = 0x25
- IPPROTO_DGP = 0x56
- IPPROTO_DIVERT = 0xfe
- IPPROTO_DONE = 0x101
- IPPROTO_DSTOPTS = 0x3c
- IPPROTO_EGP = 0x8
- IPPROTO_EMCON = 0xe
- IPPROTO_ENCAP = 0x62
- IPPROTO_EON = 0x50
- IPPROTO_ESP = 0x32
- IPPROTO_ETHERIP = 0x61
- IPPROTO_FRAGMENT = 0x2c
- IPPROTO_GGP = 0x3
- IPPROTO_GMTP = 0x64
- IPPROTO_GRE = 0x2f
- IPPROTO_HELLO = 0x3f
- IPPROTO_HMP = 0x14
- IPPROTO_HOPOPTS = 0x0
- IPPROTO_ICMP = 0x1
- IPPROTO_ICMPV6 = 0x3a
- IPPROTO_IDP = 0x16
- IPPROTO_IDPR = 0x23
- IPPROTO_IDRP = 0x2d
- IPPROTO_IGMP = 0x2
- IPPROTO_IGP = 0x55
- IPPROTO_IGRP = 0x58
- IPPROTO_IL = 0x28
- IPPROTO_INLSP = 0x34
- IPPROTO_INP = 0x20
- IPPROTO_IP = 0x0
- IPPROTO_IPCOMP = 0x6c
- IPPROTO_IPCV = 0x47
- IPPROTO_IPEIP = 0x5e
- IPPROTO_IPIP = 0x4
- IPPROTO_IPPC = 0x43
- IPPROTO_IPV4 = 0x4
- IPPROTO_IPV6 = 0x29
- IPPROTO_IRTP = 0x1c
- IPPROTO_KRYPTOLAN = 0x41
- IPPROTO_LARP = 0x5b
- IPPROTO_LEAF1 = 0x19
- IPPROTO_LEAF2 = 0x1a
- IPPROTO_MAX = 0x100
- IPPROTO_MAXID = 0x34
- IPPROTO_MEAS = 0x13
- IPPROTO_MHRP = 0x30
- IPPROTO_MICP = 0x5f
- IPPROTO_MTP = 0x5c
- IPPROTO_MUX = 0x12
- IPPROTO_ND = 0x4d
- IPPROTO_NHRP = 0x36
- IPPROTO_NONE = 0x3b
- IPPROTO_NSP = 0x1f
- IPPROTO_NVPII = 0xb
- IPPROTO_OSPFIGP = 0x59
- IPPROTO_PGM = 0x71
- IPPROTO_PIGP = 0x9
- IPPROTO_PIM = 0x67
- IPPROTO_PRM = 0x15
- IPPROTO_PUP = 0xc
- IPPROTO_PVP = 0x4b
- IPPROTO_RAW = 0xff
- IPPROTO_RCCMON = 0xa
- IPPROTO_RDP = 0x1b
- IPPROTO_ROUTING = 0x2b
- IPPROTO_RSVP = 0x2e
- IPPROTO_RVD = 0x42
- IPPROTO_SATEXPAK = 0x40
- IPPROTO_SATMON = 0x45
- IPPROTO_SCCSP = 0x60
- IPPROTO_SCTP = 0x84
- IPPROTO_SDRP = 0x2a
- IPPROTO_SEP = 0x21
- IPPROTO_SRPC = 0x5a
- IPPROTO_ST = 0x7
- IPPROTO_SVMTP = 0x52
- IPPROTO_SWIPE = 0x35
- IPPROTO_TCF = 0x57
- IPPROTO_TCP = 0x6
- IPPROTO_TP = 0x1d
- IPPROTO_TPXX = 0x27
- IPPROTO_TRUNK1 = 0x17
- IPPROTO_TRUNK2 = 0x18
- IPPROTO_TTP = 0x54
- IPPROTO_UDP = 0x11
- IPPROTO_VINES = 0x53
- IPPROTO_VISA = 0x46
- IPPROTO_VMTP = 0x51
- IPPROTO_WBEXPAK = 0x4f
- IPPROTO_WBMON = 0x4e
- IPPROTO_WSN = 0x4a
- IPPROTO_XNET = 0xf
- IPPROTO_XTP = 0x24
- IPV6_2292DSTOPTS = 0x17
- IPV6_2292HOPLIMIT = 0x14
- IPV6_2292HOPOPTS = 0x16
- IPV6_2292NEXTHOP = 0x15
- IPV6_2292PKTINFO = 0x13
- IPV6_2292PKTOPTIONS = 0x19
- IPV6_2292RTHDR = 0x18
- IPV6_BINDV6ONLY = 0x1b
- IPV6_BOUND_IF = 0x7d
- IPV6_CHECKSUM = 0x1a
- IPV6_DEFAULT_MULTICAST_HOPS = 0x1
- IPV6_DEFAULT_MULTICAST_LOOP = 0x1
- IPV6_DEFHLIM = 0x40
- IPV6_FAITH = 0x1d
- IPV6_FLOWINFO_MASK = 0xffffff0f
- IPV6_FLOWLABEL_MASK = 0xffff0f00
- IPV6_FLOW_ECN_MASK = 0x300
- IPV6_FRAGTTL = 0x3c
- IPV6_FW_ADD = 0x1e
- IPV6_FW_DEL = 0x1f
- IPV6_FW_FLUSH = 0x20
- IPV6_FW_GET = 0x22
- IPV6_FW_ZERO = 0x21
- IPV6_HLIMDEC = 0x1
- IPV6_IPSEC_POLICY = 0x1c
- IPV6_JOIN_GROUP = 0xc
- IPV6_LEAVE_GROUP = 0xd
- IPV6_MAXHLIM = 0xff
- IPV6_MAXOPTHDR = 0x800
- IPV6_MAXPACKET = 0xffff
- IPV6_MAX_GROUP_SRC_FILTER = 0x200
- IPV6_MAX_MEMBERSHIPS = 0xfff
- IPV6_MAX_SOCK_SRC_FILTER = 0x80
- IPV6_MIN_MEMBERSHIPS = 0x1f
- IPV6_MMTU = 0x500
- IPV6_MULTICAST_HOPS = 0xa
- IPV6_MULTICAST_IF = 0x9
- IPV6_MULTICAST_LOOP = 0xb
- IPV6_PORTRANGE = 0xe
- IPV6_PORTRANGE_DEFAULT = 0x0
- IPV6_PORTRANGE_HIGH = 0x1
- IPV6_PORTRANGE_LOW = 0x2
- IPV6_RECVTCLASS = 0x23
- IPV6_RTHDR_LOOSE = 0x0
- IPV6_RTHDR_STRICT = 0x1
- IPV6_RTHDR_TYPE_0 = 0x0
- IPV6_SOCKOPT_RESERVED1 = 0x3
- IPV6_TCLASS = 0x24
- IPV6_UNICAST_HOPS = 0x4
- IPV6_V6ONLY = 0x1b
- IPV6_VERSION = 0x60
- IPV6_VERSION_MASK = 0xf0
- IP_ADD_MEMBERSHIP = 0xc
- IP_ADD_SOURCE_MEMBERSHIP = 0x46
- IP_BLOCK_SOURCE = 0x48
- IP_BOUND_IF = 0x19
- IP_DEFAULT_MULTICAST_LOOP = 0x1
- IP_DEFAULT_MULTICAST_TTL = 0x1
- IP_DF = 0x4000
- IP_DROP_MEMBERSHIP = 0xd
- IP_DROP_SOURCE_MEMBERSHIP = 0x47
- IP_DUMMYNET_CONFIGURE = 0x3c
- IP_DUMMYNET_DEL = 0x3d
- IP_DUMMYNET_FLUSH = 0x3e
- IP_DUMMYNET_GET = 0x40
- IP_FAITH = 0x16
- IP_FW_ADD = 0x28
- IP_FW_DEL = 0x29
- IP_FW_FLUSH = 0x2a
- IP_FW_GET = 0x2c
- IP_FW_RESETLOG = 0x2d
- IP_FW_ZERO = 0x2b
- IP_HDRINCL = 0x2
- IP_IPSEC_POLICY = 0x15
- IP_MAXPACKET = 0xffff
- IP_MAX_GROUP_SRC_FILTER = 0x200
- IP_MAX_MEMBERSHIPS = 0xfff
- IP_MAX_SOCK_MUTE_FILTER = 0x80
- IP_MAX_SOCK_SRC_FILTER = 0x80
- IP_MF = 0x2000
- IP_MIN_MEMBERSHIPS = 0x1f
- IP_MSFILTER = 0x4a
- IP_MSS = 0x240
- IP_MULTICAST_IF = 0x9
- IP_MULTICAST_IFINDEX = 0x42
- IP_MULTICAST_LOOP = 0xb
- IP_MULTICAST_TTL = 0xa
- IP_MULTICAST_VIF = 0xe
- IP_NAT__XXX = 0x37
- IP_OFFMASK = 0x1fff
- IP_OLD_FW_ADD = 0x32
- IP_OLD_FW_DEL = 0x33
- IP_OLD_FW_FLUSH = 0x34
- IP_OLD_FW_GET = 0x36
- IP_OLD_FW_RESETLOG = 0x38
- IP_OLD_FW_ZERO = 0x35
- IP_OPTIONS = 0x1
- IP_PKTINFO = 0x1a
- IP_PORTRANGE = 0x13
- IP_PORTRANGE_DEFAULT = 0x0
- IP_PORTRANGE_HIGH = 0x1
- IP_PORTRANGE_LOW = 0x2
- IP_RECVDSTADDR = 0x7
- IP_RECVIF = 0x14
- IP_RECVOPTS = 0x5
- IP_RECVPKTINFO = 0x1a
- IP_RECVRETOPTS = 0x6
- IP_RECVTOS = 0x1b
- IP_RECVTTL = 0x18
- IP_RETOPTS = 0x8
- IP_RF = 0x8000
- IP_RSVP_OFF = 0x10
- IP_RSVP_ON = 0xf
- IP_RSVP_VIF_OFF = 0x12
- IP_RSVP_VIF_ON = 0x11
- IP_STRIPHDR = 0x17
- IP_TOS = 0x3
- IP_TRAFFIC_MGT_BACKGROUND = 0x41
- IP_TTL = 0x4
- IP_UNBLOCK_SOURCE = 0x49
- ISIG = 0x80
- ISTRIP = 0x20
- IUTF8 = 0x4000
- IXANY = 0x800
- IXOFF = 0x400
- IXON = 0x200
- KERN_HOSTNAME = 0xa
- KERN_OSRELEASE = 0x2
- KERN_OSTYPE = 0x1
- KERN_VERSION = 0x4
- LOCK_EX = 0x2
- LOCK_NB = 0x4
- LOCK_SH = 0x1
- LOCK_UN = 0x8
- MADV_CAN_REUSE = 0x9
- MADV_DONTNEED = 0x4
- MADV_FREE = 0x5
- MADV_FREE_REUSABLE = 0x7
- MADV_FREE_REUSE = 0x8
- MADV_NORMAL = 0x0
- MADV_PAGEOUT = 0xa
- MADV_RANDOM = 0x1
- MADV_SEQUENTIAL = 0x2
- MADV_WILLNEED = 0x3
- MADV_ZERO_WIRED_PAGES = 0x6
- MAP_ANON = 0x1000
- MAP_ANONYMOUS = 0x1000
- MAP_COPY = 0x2
- MAP_FILE = 0x0
- MAP_FIXED = 0x10
- MAP_HASSEMAPHORE = 0x200
- MAP_JIT = 0x800
- MAP_NOCACHE = 0x400
- MAP_NOEXTEND = 0x100
- MAP_NORESERVE = 0x40
- MAP_PRIVATE = 0x2
- MAP_RENAME = 0x20
- MAP_RESERVED0080 = 0x80
- MAP_RESILIENT_CODESIGN = 0x2000
- MAP_RESILIENT_MEDIA = 0x4000
- MAP_SHARED = 0x1
- MCL_CURRENT = 0x1
- MCL_FUTURE = 0x2
- MNT_ASYNC = 0x40
- MNT_AUTOMOUNTED = 0x400000
- MNT_CMDFLAGS = 0xf0000
- MNT_CPROTECT = 0x80
- MNT_DEFWRITE = 0x2000000
- MNT_DONTBROWSE = 0x100000
- MNT_DOVOLFS = 0x8000
- MNT_DWAIT = 0x4
- MNT_EXPORTED = 0x100
- MNT_FORCE = 0x80000
- MNT_IGNORE_OWNERSHIP = 0x200000
- MNT_JOURNALED = 0x800000
- MNT_LOCAL = 0x1000
- MNT_MULTILABEL = 0x4000000
- MNT_NOATIME = 0x10000000
- MNT_NOBLOCK = 0x20000
- MNT_NODEV = 0x10
- MNT_NOEXEC = 0x4
- MNT_NOSUID = 0x8
- MNT_NOUSERXATTR = 0x1000000
- MNT_NOWAIT = 0x2
- MNT_QUARANTINE = 0x400
- MNT_QUOTA = 0x2000
- MNT_RDONLY = 0x1
- MNT_RELOAD = 0x40000
- MNT_ROOTFS = 0x4000
- MNT_SYNCHRONOUS = 0x2
- MNT_UNION = 0x20
- MNT_UNKNOWNPERMISSIONS = 0x200000
- MNT_UPDATE = 0x10000
- MNT_VISFLAGMASK = 0x17f0f5ff
- MNT_WAIT = 0x1
- MSG_CTRUNC = 0x20
- MSG_DONTROUTE = 0x4
- MSG_DONTWAIT = 0x80
- MSG_EOF = 0x100
- MSG_EOR = 0x8
- MSG_FLUSH = 0x400
- MSG_HAVEMORE = 0x2000
- MSG_HOLD = 0x800
- MSG_NEEDSA = 0x10000
- MSG_OOB = 0x1
- MSG_PEEK = 0x2
- MSG_RCVMORE = 0x4000
- MSG_SEND = 0x1000
- MSG_TRUNC = 0x10
- MSG_WAITALL = 0x40
- MSG_WAITSTREAM = 0x200
- MS_ASYNC = 0x1
- MS_DEACTIVATE = 0x8
- MS_INVALIDATE = 0x2
- MS_KILLPAGES = 0x4
- MS_SYNC = 0x10
- NAME_MAX = 0xff
- NET_RT_DUMP = 0x1
- NET_RT_DUMP2 = 0x7
- NET_RT_FLAGS = 0x2
- NET_RT_IFLIST = 0x3
- NET_RT_IFLIST2 = 0x6
- NET_RT_MAXID = 0xa
- NET_RT_STAT = 0x4
- NET_RT_TRASH = 0x5
- NFDBITS = 0x20
- NL0 = 0x0
- NL1 = 0x100
- NL2 = 0x200
- NL3 = 0x300
- NLDLY = 0x300
- NOFLSH = 0x80000000
- NOKERNINFO = 0x2000000
- NOTE_ABSOLUTE = 0x8
- NOTE_ATTRIB = 0x8
- NOTE_BACKGROUND = 0x40
- NOTE_CHILD = 0x4
- NOTE_CRITICAL = 0x20
- NOTE_DELETE = 0x1
- NOTE_EXEC = 0x20000000
- NOTE_EXIT = 0x80000000
- NOTE_EXITSTATUS = 0x4000000
- NOTE_EXIT_CSERROR = 0x40000
- NOTE_EXIT_DECRYPTFAIL = 0x10000
- NOTE_EXIT_DETAIL = 0x2000000
- NOTE_EXIT_DETAIL_MASK = 0x70000
- NOTE_EXIT_MEMORY = 0x20000
- NOTE_EXIT_REPARENTED = 0x80000
- NOTE_EXTEND = 0x4
- NOTE_FFAND = 0x40000000
- NOTE_FFCOPY = 0xc0000000
- NOTE_FFCTRLMASK = 0xc0000000
- NOTE_FFLAGSMASK = 0xffffff
- NOTE_FFNOP = 0x0
- NOTE_FFOR = 0x80000000
- NOTE_FORK = 0x40000000
- NOTE_FUNLOCK = 0x100
- NOTE_LEEWAY = 0x10
- NOTE_LINK = 0x10
- NOTE_LOWAT = 0x1
- NOTE_MACH_CONTINUOUS_TIME = 0x80
- NOTE_NONE = 0x80
- NOTE_NSECONDS = 0x4
- NOTE_OOB = 0x2
- NOTE_PCTRLMASK = -0x100000
- NOTE_PDATAMASK = 0xfffff
- NOTE_REAP = 0x10000000
- NOTE_RENAME = 0x20
- NOTE_REVOKE = 0x40
- NOTE_SECONDS = 0x1
- NOTE_SIGNAL = 0x8000000
- NOTE_TRACK = 0x1
- NOTE_TRACKERR = 0x2
- NOTE_TRIGGER = 0x1000000
- NOTE_USECONDS = 0x2
- NOTE_VM_ERROR = 0x10000000
- NOTE_VM_PRESSURE = 0x80000000
- NOTE_VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000
- NOTE_VM_PRESSURE_TERMINATE = 0x40000000
- NOTE_WRITE = 0x2
- OCRNL = 0x10
- OFDEL = 0x20000
- OFILL = 0x80
- ONLCR = 0x2
- ONLRET = 0x40
- ONOCR = 0x20
- ONOEOT = 0x8
- OPOST = 0x1
- OXTABS = 0x4
- O_ACCMODE = 0x3
- O_ALERT = 0x20000000
- O_APPEND = 0x8
- O_ASYNC = 0x40
- O_CLOEXEC = 0x1000000
- O_CREAT = 0x200
- O_DIRECTORY = 0x100000
- O_DP_GETRAWENCRYPTED = 0x1
- O_DP_GETRAWUNENCRYPTED = 0x2
- O_DSYNC = 0x400000
- O_EVTONLY = 0x8000
- O_EXCL = 0x800
- O_EXLOCK = 0x20
- O_FSYNC = 0x80
- O_NDELAY = 0x4
- O_NOCTTY = 0x20000
- O_NOFOLLOW = 0x100
- O_NONBLOCK = 0x4
- O_POPUP = 0x80000000
- O_RDONLY = 0x0
- O_RDWR = 0x2
- O_SHLOCK = 0x10
- O_SYMLINK = 0x200000
- O_SYNC = 0x80
- O_TRUNC = 0x400
- O_WRONLY = 0x1
- PARENB = 0x1000
- PARMRK = 0x8
- PARODD = 0x2000
- PENDIN = 0x20000000
- PRIO_PGRP = 0x1
- PRIO_PROCESS = 0x0
- PRIO_USER = 0x2
- PROT_EXEC = 0x4
- PROT_NONE = 0x0
- PROT_READ = 0x1
- PROT_WRITE = 0x2
- PT_ATTACH = 0xa
- PT_ATTACHEXC = 0xe
- PT_CONTINUE = 0x7
- PT_DENY_ATTACH = 0x1f
- PT_DETACH = 0xb
- PT_FIRSTMACH = 0x20
- PT_FORCEQUOTA = 0x1e
- PT_KILL = 0x8
- PT_READ_D = 0x2
- PT_READ_I = 0x1
- PT_READ_U = 0x3
- PT_SIGEXC = 0xc
- PT_STEP = 0x9
- PT_THUPDATE = 0xd
- PT_TRACE_ME = 0x0
- PT_WRITE_D = 0x5
- PT_WRITE_I = 0x4
- PT_WRITE_U = 0x6
- RLIMIT_AS = 0x5
- RLIMIT_CORE = 0x4
- RLIMIT_CPU = 0x0
- RLIMIT_CPU_USAGE_MONITOR = 0x2
- RLIMIT_DATA = 0x2
- RLIMIT_FSIZE = 0x1
- RLIMIT_MEMLOCK = 0x6
- RLIMIT_NOFILE = 0x8
- RLIMIT_NPROC = 0x7
- RLIMIT_RSS = 0x5
- RLIMIT_STACK = 0x3
- RLIM_INFINITY = 0x7fffffffffffffff
- RTAX_AUTHOR = 0x6
- RTAX_BRD = 0x7
- RTAX_DST = 0x0
- RTAX_GATEWAY = 0x1
- RTAX_GENMASK = 0x3
- RTAX_IFA = 0x5
- RTAX_IFP = 0x4
- RTAX_MAX = 0x8
- RTAX_NETMASK = 0x2
- RTA_AUTHOR = 0x40
- RTA_BRD = 0x80
- RTA_DST = 0x1
- RTA_GATEWAY = 0x2
- RTA_GENMASK = 0x8
- RTA_IFA = 0x20
- RTA_IFP = 0x10
- RTA_NETMASK = 0x4
- RTF_BLACKHOLE = 0x1000
- RTF_BROADCAST = 0x400000
- RTF_CLONING = 0x100
- RTF_CONDEMNED = 0x2000000
- RTF_DELCLONE = 0x80
- RTF_DONE = 0x40
- RTF_DYNAMIC = 0x10
- RTF_GATEWAY = 0x2
- RTF_HOST = 0x4
- RTF_IFREF = 0x4000000
- RTF_IFSCOPE = 0x1000000
- RTF_LLINFO = 0x400
- RTF_LOCAL = 0x200000
- RTF_MODIFIED = 0x20
- RTF_MULTICAST = 0x800000
- RTF_NOIFREF = 0x2000
- RTF_PINNED = 0x100000
- RTF_PRCLONING = 0x10000
- RTF_PROTO1 = 0x8000
- RTF_PROTO2 = 0x4000
- RTF_PROTO3 = 0x40000
- RTF_PROXY = 0x8000000
- RTF_REJECT = 0x8
- RTF_ROUTER = 0x10000000
- RTF_STATIC = 0x800
- RTF_UP = 0x1
- RTF_WASCLONED = 0x20000
- RTF_XRESOLVE = 0x200
- RTM_ADD = 0x1
- RTM_CHANGE = 0x3
- RTM_DELADDR = 0xd
- RTM_DELETE = 0x2
- RTM_DELMADDR = 0x10
- RTM_GET = 0x4
- RTM_GET2 = 0x14
- RTM_IFINFO = 0xe
- RTM_IFINFO2 = 0x12
- RTM_LOCK = 0x8
- RTM_LOSING = 0x5
- RTM_MISS = 0x7
- RTM_NEWADDR = 0xc
- RTM_NEWMADDR = 0xf
- RTM_NEWMADDR2 = 0x13
- RTM_OLDADD = 0x9
- RTM_OLDDEL = 0xa
- RTM_REDIRECT = 0x6
- RTM_RESOLVE = 0xb
- RTM_RTTUNIT = 0xf4240
- RTM_VERSION = 0x5
- RTV_EXPIRE = 0x4
- RTV_HOPCOUNT = 0x2
- RTV_MTU = 0x1
- RTV_RPIPE = 0x8
- RTV_RTT = 0x40
- RTV_RTTVAR = 0x80
- RTV_SPIPE = 0x10
- RTV_SSTHRESH = 0x20
- RUSAGE_CHILDREN = -0x1
- RUSAGE_SELF = 0x0
- SCM_CREDS = 0x3
- SCM_RIGHTS = 0x1
- SCM_TIMESTAMP = 0x2
- SCM_TIMESTAMP_MONOTONIC = 0x4
- SHUT_RD = 0x0
- SHUT_RDWR = 0x2
- SHUT_WR = 0x1
- SIOCADDMULTI = 0x80206931
- SIOCAIFADDR = 0x8040691a
- SIOCARPIPLL = 0xc0206928
- SIOCATMARK = 0x40047307
- SIOCAUTOADDR = 0xc0206926
- SIOCAUTONETMASK = 0x80206927
- SIOCDELMULTI = 0x80206932
- SIOCDIFADDR = 0x80206919
- SIOCDIFPHYADDR = 0x80206941
- SIOCGDRVSPEC = 0xc01c697b
- SIOCGETVLAN = 0xc020697f
- SIOCGHIWAT = 0x40047301
- SIOCGIFADDR = 0xc0206921
- SIOCGIFALTMTU = 0xc0206948
- SIOCGIFASYNCMAP = 0xc020697c
- SIOCGIFBOND = 0xc0206947
- SIOCGIFBRDADDR = 0xc0206923
- SIOCGIFCAP = 0xc020695b
- SIOCGIFCONF = 0xc0086924
- SIOCGIFDEVMTU = 0xc0206944
- SIOCGIFDSTADDR = 0xc0206922
- SIOCGIFFLAGS = 0xc0206911
- SIOCGIFGENERIC = 0xc020693a
- SIOCGIFKPI = 0xc0206987
- SIOCGIFMAC = 0xc0206982
- SIOCGIFMEDIA = 0xc0286938
- SIOCGIFMETRIC = 0xc0206917
- SIOCGIFMTU = 0xc0206933
- SIOCGIFNETMASK = 0xc0206925
- SIOCGIFPDSTADDR = 0xc0206940
- SIOCGIFPHYS = 0xc0206935
- SIOCGIFPSRCADDR = 0xc020693f
- SIOCGIFSTATUS = 0xc331693d
- SIOCGIFVLAN = 0xc020697f
- SIOCGIFWAKEFLAGS = 0xc0206988
- SIOCGLOWAT = 0x40047303
- SIOCGPGRP = 0x40047309
- SIOCIFCREATE = 0xc0206978
- SIOCIFCREATE2 = 0xc020697a
- SIOCIFDESTROY = 0x80206979
- SIOCIFGCLONERS = 0xc00c6981
- SIOCRSLVMULTI = 0xc008693b
- SIOCSDRVSPEC = 0x801c697b
- SIOCSETVLAN = 0x8020697e
- SIOCSHIWAT = 0x80047300
- SIOCSIFADDR = 0x8020690c
- SIOCSIFALTMTU = 0x80206945
- SIOCSIFASYNCMAP = 0x8020697d
- SIOCSIFBOND = 0x80206946
- SIOCSIFBRDADDR = 0x80206913
- SIOCSIFCAP = 0x8020695a
- SIOCSIFDSTADDR = 0x8020690e
- SIOCSIFFLAGS = 0x80206910
- SIOCSIFGENERIC = 0x80206939
- SIOCSIFKPI = 0x80206986
- SIOCSIFLLADDR = 0x8020693c
- SIOCSIFMAC = 0x80206983
- SIOCSIFMEDIA = 0xc0206937
- SIOCSIFMETRIC = 0x80206918
- SIOCSIFMTU = 0x80206934
- SIOCSIFNETMASK = 0x80206916
- SIOCSIFPHYADDR = 0x8040693e
- SIOCSIFPHYS = 0x80206936
- SIOCSIFVLAN = 0x8020697e
- SIOCSLOWAT = 0x80047302
- SIOCSPGRP = 0x80047308
- SOCK_DGRAM = 0x2
- SOCK_MAXADDRLEN = 0xff
- SOCK_RAW = 0x3
- SOCK_RDM = 0x4
- SOCK_SEQPACKET = 0x5
- SOCK_STREAM = 0x1
- SOL_SOCKET = 0xffff
- SOMAXCONN = 0x80
- SO_ACCEPTCONN = 0x2
- SO_BROADCAST = 0x20
- SO_DEBUG = 0x1
- SO_DONTROUTE = 0x10
- SO_DONTTRUNC = 0x2000
- SO_ERROR = 0x1007
- SO_KEEPALIVE = 0x8
- SO_LABEL = 0x1010
- SO_LINGER = 0x80
- SO_LINGER_SEC = 0x1080
- SO_NETSVC_MARKING_LEVEL = 0x1119
- SO_NET_SERVICE_TYPE = 0x1116
- SO_NKE = 0x1021
- SO_NOADDRERR = 0x1023
- SO_NOSIGPIPE = 0x1022
- SO_NOTIFYCONFLICT = 0x1026
- SO_NP_EXTENSIONS = 0x1083
- SO_NREAD = 0x1020
- SO_NUMRCVPKT = 0x1112
- SO_NWRITE = 0x1024
- SO_OOBINLINE = 0x100
- SO_PEERLABEL = 0x1011
- SO_RANDOMPORT = 0x1082
- SO_RCVBUF = 0x1002
- SO_RCVLOWAT = 0x1004
- SO_RCVTIMEO = 0x1006
- SO_REUSEADDR = 0x4
- SO_REUSEPORT = 0x200
- SO_REUSESHAREUID = 0x1025
- SO_SNDBUF = 0x1001
- SO_SNDLOWAT = 0x1003
- SO_SNDTIMEO = 0x1005
- SO_TIMESTAMP = 0x400
- SO_TIMESTAMP_MONOTONIC = 0x800
- SO_TYPE = 0x1008
- SO_UPCALLCLOSEWAIT = 0x1027
- SO_USELOOPBACK = 0x40
- SO_WANTMORE = 0x4000
- SO_WANTOOBFLAG = 0x8000
- S_IEXEC = 0x40
- S_IFBLK = 0x6000
- S_IFCHR = 0x2000
- S_IFDIR = 0x4000
- S_IFIFO = 0x1000
- S_IFLNK = 0xa000
- S_IFMT = 0xf000
- S_IFREG = 0x8000
- S_IFSOCK = 0xc000
- S_IFWHT = 0xe000
- S_IREAD = 0x100
- S_IRGRP = 0x20
- S_IROTH = 0x4
- S_IRUSR = 0x100
- S_IRWXG = 0x38
- S_IRWXO = 0x7
- S_IRWXU = 0x1c0
- S_ISGID = 0x400
- S_ISTXT = 0x200
- S_ISUID = 0x800
- S_ISVTX = 0x200
- S_IWGRP = 0x10
- S_IWOTH = 0x2
- S_IWRITE = 0x80
- S_IWUSR = 0x80
- S_IXGRP = 0x8
- S_IXOTH = 0x1
- S_IXUSR = 0x40
- TAB0 = 0x0
- TAB1 = 0x400
- TAB2 = 0x800
- TAB3 = 0x4
- TABDLY = 0xc04
- TCIFLUSH = 0x1
- TCIOFF = 0x3
- TCIOFLUSH = 0x3
- TCION = 0x4
- TCOFLUSH = 0x2
- TCOOFF = 0x1
- TCOON = 0x2
- TCP_CONNECTIONTIMEOUT = 0x20
- TCP_CONNECTION_INFO = 0x106
- TCP_ENABLE_ECN = 0x104
- TCP_FASTOPEN = 0x105
- TCP_KEEPALIVE = 0x10
- TCP_KEEPCNT = 0x102
- TCP_KEEPINTVL = 0x101
- TCP_MAXHLEN = 0x3c
- TCP_MAXOLEN = 0x28
- TCP_MAXSEG = 0x2
- TCP_MAXWIN = 0xffff
- TCP_MAX_SACK = 0x4
- TCP_MAX_WINSHIFT = 0xe
- TCP_MINMSS = 0xd8
- TCP_MSS = 0x200
- TCP_NODELAY = 0x1
- TCP_NOOPT = 0x8
- TCP_NOPUSH = 0x4
- TCP_NOTSENT_LOWAT = 0x201
- TCP_RXT_CONNDROPTIME = 0x80
- TCP_RXT_FINDROP = 0x100
- TCP_SENDMOREACKS = 0x103
- TCSAFLUSH = 0x2
- TIOCCBRK = 0x2000747a
- TIOCCDTR = 0x20007478
- TIOCCONS = 0x80047462
- TIOCDCDTIMESTAMP = 0x40087458
- TIOCDRAIN = 0x2000745e
- TIOCDSIMICROCODE = 0x20007455
- TIOCEXCL = 0x2000740d
- TIOCEXT = 0x80047460
- TIOCFLUSH = 0x80047410
- TIOCGDRAINWAIT = 0x40047456
- TIOCGETA = 0x402c7413
- TIOCGETD = 0x4004741a
- TIOCGPGRP = 0x40047477
- TIOCGWINSZ = 0x40087468
- TIOCIXOFF = 0x20007480
- TIOCIXON = 0x20007481
- TIOCMBIC = 0x8004746b
- TIOCMBIS = 0x8004746c
- TIOCMGDTRWAIT = 0x4004745a
- TIOCMGET = 0x4004746a
- TIOCMODG = 0x40047403
- TIOCMODS = 0x80047404
- TIOCMSDTRWAIT = 0x8004745b
- TIOCMSET = 0x8004746d
- TIOCM_CAR = 0x40
- TIOCM_CD = 0x40
- TIOCM_CTS = 0x20
- TIOCM_DSR = 0x100
- TIOCM_DTR = 0x2
- TIOCM_LE = 0x1
- TIOCM_RI = 0x80
- TIOCM_RNG = 0x80
- TIOCM_RTS = 0x4
- TIOCM_SR = 0x10
- TIOCM_ST = 0x8
- TIOCNOTTY = 0x20007471
- TIOCNXCL = 0x2000740e
- TIOCOUTQ = 0x40047473
- TIOCPKT = 0x80047470
- TIOCPKT_DATA = 0x0
- TIOCPKT_DOSTOP = 0x20
- TIOCPKT_FLUSHREAD = 0x1
- TIOCPKT_FLUSHWRITE = 0x2
- TIOCPKT_IOCTL = 0x40
- TIOCPKT_NOSTOP = 0x10
- TIOCPKT_START = 0x8
- TIOCPKT_STOP = 0x4
- TIOCPTYGNAME = 0x40807453
- TIOCPTYGRANT = 0x20007454
- TIOCPTYUNLK = 0x20007452
- TIOCREMOTE = 0x80047469
- TIOCSBRK = 0x2000747b
- TIOCSCONS = 0x20007463
- TIOCSCTTY = 0x20007461
- TIOCSDRAINWAIT = 0x80047457
- TIOCSDTR = 0x20007479
- TIOCSETA = 0x802c7414
- TIOCSETAF = 0x802c7416
- TIOCSETAW = 0x802c7415
- TIOCSETD = 0x8004741b
- TIOCSIG = 0x2000745f
- TIOCSPGRP = 0x80047476
- TIOCSTART = 0x2000746e
- TIOCSTAT = 0x20007465
- TIOCSTI = 0x80017472
- TIOCSTOP = 0x2000746f
- TIOCSWINSZ = 0x80087467
- TIOCTIMESTAMP = 0x40087459
- TIOCUCNTL = 0x80047466
- TOSTOP = 0x400000
- VDISCARD = 0xf
- VDSUSP = 0xb
- VEOF = 0x0
- VEOL = 0x1
- VEOL2 = 0x2
- VERASE = 0x3
- VINTR = 0x8
- VKILL = 0x5
- VLNEXT = 0xe
- VMIN = 0x10
- VM_LOADAVG = 0x2
- VM_MACHFACTOR = 0x4
- VM_MAXID = 0x6
- VM_METER = 0x1
- VM_SWAPUSAGE = 0x5
- VQUIT = 0x9
- VREPRINT = 0x6
- VSTART = 0xc
- VSTATUS = 0x12
- VSTOP = 0xd
- VSUSP = 0xa
- VT0 = 0x0
- VT1 = 0x10000
- VTDLY = 0x10000
- VTIME = 0x11
- VWERASE = 0x4
- WCONTINUED = 0x10
- WCOREFLAG = 0x80
- WEXITED = 0x4
- WNOHANG = 0x1
- WNOWAIT = 0x20
- WORDSIZE = 0x20
- WSTOPPED = 0x8
- WUNTRACED = 0x2
- XATTR_CREATE = 0x2
- XATTR_NODEFAULT = 0x10
- XATTR_NOFOLLOW = 0x1
- XATTR_NOSECURITY = 0x8
- XATTR_REPLACE = 0x4
- XATTR_SHOWCOMPRESSION = 0x20
-)
-
-// Errors
-const (
- E2BIG = syscall.Errno(0x7)
- EACCES = syscall.Errno(0xd)
- EADDRINUSE = syscall.Errno(0x30)
- EADDRNOTAVAIL = syscall.Errno(0x31)
- EAFNOSUPPORT = syscall.Errno(0x2f)
- EAGAIN = syscall.Errno(0x23)
- EALREADY = syscall.Errno(0x25)
- EAUTH = syscall.Errno(0x50)
- EBADARCH = syscall.Errno(0x56)
- EBADEXEC = syscall.Errno(0x55)
- EBADF = syscall.Errno(0x9)
- EBADMACHO = syscall.Errno(0x58)
- EBADMSG = syscall.Errno(0x5e)
- EBADRPC = syscall.Errno(0x48)
- EBUSY = syscall.Errno(0x10)
- ECANCELED = syscall.Errno(0x59)
- ECHILD = syscall.Errno(0xa)
- ECONNABORTED = syscall.Errno(0x35)
- ECONNREFUSED = syscall.Errno(0x3d)
- ECONNRESET = syscall.Errno(0x36)
- EDEADLK = syscall.Errno(0xb)
- EDESTADDRREQ = syscall.Errno(0x27)
- EDEVERR = syscall.Errno(0x53)
- EDOM = syscall.Errno(0x21)
- EDQUOT = syscall.Errno(0x45)
- EEXIST = syscall.Errno(0x11)
- EFAULT = syscall.Errno(0xe)
- EFBIG = syscall.Errno(0x1b)
- EFTYPE = syscall.Errno(0x4f)
- EHOSTDOWN = syscall.Errno(0x40)
- EHOSTUNREACH = syscall.Errno(0x41)
- EIDRM = syscall.Errno(0x5a)
- EILSEQ = syscall.Errno(0x5c)
- EINPROGRESS = syscall.Errno(0x24)
- EINTR = syscall.Errno(0x4)
- EINVAL = syscall.Errno(0x16)
- EIO = syscall.Errno(0x5)
- EISCONN = syscall.Errno(0x38)
- EISDIR = syscall.Errno(0x15)
- ELAST = syscall.Errno(0x6a)
- ELOOP = syscall.Errno(0x3e)
- EMFILE = syscall.Errno(0x18)
- EMLINK = syscall.Errno(0x1f)
- EMSGSIZE = syscall.Errno(0x28)
- EMULTIHOP = syscall.Errno(0x5f)
- ENAMETOOLONG = syscall.Errno(0x3f)
- ENEEDAUTH = syscall.Errno(0x51)
- ENETDOWN = syscall.Errno(0x32)
- ENETRESET = syscall.Errno(0x34)
- ENETUNREACH = syscall.Errno(0x33)
- ENFILE = syscall.Errno(0x17)
- ENOATTR = syscall.Errno(0x5d)
- ENOBUFS = syscall.Errno(0x37)
- ENODATA = syscall.Errno(0x60)
- ENODEV = syscall.Errno(0x13)
- ENOENT = syscall.Errno(0x2)
- ENOEXEC = syscall.Errno(0x8)
- ENOLCK = syscall.Errno(0x4d)
- ENOLINK = syscall.Errno(0x61)
- ENOMEM = syscall.Errno(0xc)
- ENOMSG = syscall.Errno(0x5b)
- ENOPOLICY = syscall.Errno(0x67)
- ENOPROTOOPT = syscall.Errno(0x2a)
- ENOSPC = syscall.Errno(0x1c)
- ENOSR = syscall.Errno(0x62)
- ENOSTR = syscall.Errno(0x63)
- ENOSYS = syscall.Errno(0x4e)
- ENOTBLK = syscall.Errno(0xf)
- ENOTCONN = syscall.Errno(0x39)
- ENOTDIR = syscall.Errno(0x14)
- ENOTEMPTY = syscall.Errno(0x42)
- ENOTRECOVERABLE = syscall.Errno(0x68)
- ENOTSOCK = syscall.Errno(0x26)
- ENOTSUP = syscall.Errno(0x2d)
- ENOTTY = syscall.Errno(0x19)
- ENXIO = syscall.Errno(0x6)
- EOPNOTSUPP = syscall.Errno(0x66)
- EOVERFLOW = syscall.Errno(0x54)
- EOWNERDEAD = syscall.Errno(0x69)
- EPERM = syscall.Errno(0x1)
- EPFNOSUPPORT = syscall.Errno(0x2e)
- EPIPE = syscall.Errno(0x20)
- EPROCLIM = syscall.Errno(0x43)
- EPROCUNAVAIL = syscall.Errno(0x4c)
- EPROGMISMATCH = syscall.Errno(0x4b)
- EPROGUNAVAIL = syscall.Errno(0x4a)
- EPROTO = syscall.Errno(0x64)
- EPROTONOSUPPORT = syscall.Errno(0x2b)
- EPROTOTYPE = syscall.Errno(0x29)
- EPWROFF = syscall.Errno(0x52)
- EQFULL = syscall.Errno(0x6a)
- ERANGE = syscall.Errno(0x22)
- EREMOTE = syscall.Errno(0x47)
- EROFS = syscall.Errno(0x1e)
- ERPCMISMATCH = syscall.Errno(0x49)
- ESHLIBVERS = syscall.Errno(0x57)
- ESHUTDOWN = syscall.Errno(0x3a)
- ESOCKTNOSUPPORT = syscall.Errno(0x2c)
- ESPIPE = syscall.Errno(0x1d)
- ESRCH = syscall.Errno(0x3)
- ESTALE = syscall.Errno(0x46)
- ETIME = syscall.Errno(0x65)
- ETIMEDOUT = syscall.Errno(0x3c)
- ETOOMANYREFS = syscall.Errno(0x3b)
- ETXTBSY = syscall.Errno(0x1a)
- EUSERS = syscall.Errno(0x44)
- EWOULDBLOCK = syscall.Errno(0x23)
- EXDEV = syscall.Errno(0x12)
-)
-
-// Signals
-const (
- SIGABRT = syscall.Signal(0x6)
- SIGALRM = syscall.Signal(0xe)
- SIGBUS = syscall.Signal(0xa)
- SIGCHLD = syscall.Signal(0x14)
- SIGCONT = syscall.Signal(0x13)
- SIGEMT = syscall.Signal(0x7)
- SIGFPE = syscall.Signal(0x8)
- SIGHUP = syscall.Signal(0x1)
- SIGILL = syscall.Signal(0x4)
- SIGINFO = syscall.Signal(0x1d)
- SIGINT = syscall.Signal(0x2)
- SIGIO = syscall.Signal(0x17)
- SIGIOT = syscall.Signal(0x6)
- SIGKILL = syscall.Signal(0x9)
- SIGPIPE = syscall.Signal(0xd)
- SIGPROF = syscall.Signal(0x1b)
- SIGQUIT = syscall.Signal(0x3)
- SIGSEGV = syscall.Signal(0xb)
- SIGSTOP = syscall.Signal(0x11)
- SIGSYS = syscall.Signal(0xc)
- SIGTERM = syscall.Signal(0xf)
- SIGTRAP = syscall.Signal(0x5)
- SIGTSTP = syscall.Signal(0x12)
- SIGTTIN = syscall.Signal(0x15)
- SIGTTOU = syscall.Signal(0x16)
- SIGURG = syscall.Signal(0x10)
- SIGUSR1 = syscall.Signal(0x1e)
- SIGUSR2 = syscall.Signal(0x1f)
- SIGVTALRM = syscall.Signal(0x1a)
- SIGWINCH = syscall.Signal(0x1c)
- SIGXCPU = syscall.Signal(0x18)
- SIGXFSZ = syscall.Signal(0x19)
-)
-
-// Error table
-var errorList = [...]struct {
- num syscall.Errno
- name string
- desc string
-}{
- {1, "EPERM", "operation not permitted"},
- {2, "ENOENT", "no such file or directory"},
- {3, "ESRCH", "no such process"},
- {4, "EINTR", "interrupted system call"},
- {5, "EIO", "input/output error"},
- {6, "ENXIO", "device not configured"},
- {7, "E2BIG", "argument list too long"},
- {8, "ENOEXEC", "exec format error"},
- {9, "EBADF", "bad file descriptor"},
- {10, "ECHILD", "no child processes"},
- {11, "EDEADLK", "resource deadlock avoided"},
- {12, "ENOMEM", "cannot allocate memory"},
- {13, "EACCES", "permission denied"},
- {14, "EFAULT", "bad address"},
- {15, "ENOTBLK", "block device required"},
- {16, "EBUSY", "resource busy"},
- {17, "EEXIST", "file exists"},
- {18, "EXDEV", "cross-device link"},
- {19, "ENODEV", "operation not supported by device"},
- {20, "ENOTDIR", "not a directory"},
- {21, "EISDIR", "is a directory"},
- {22, "EINVAL", "invalid argument"},
- {23, "ENFILE", "too many open files in system"},
- {24, "EMFILE", "too many open files"},
- {25, "ENOTTY", "inappropriate ioctl for device"},
- {26, "ETXTBSY", "text file busy"},
- {27, "EFBIG", "file too large"},
- {28, "ENOSPC", "no space left on device"},
- {29, "ESPIPE", "illegal seek"},
- {30, "EROFS", "read-only file system"},
- {31, "EMLINK", "too many links"},
- {32, "EPIPE", "broken pipe"},
- {33, "EDOM", "numerical argument out of domain"},
- {34, "ERANGE", "result too large"},
- {35, "EAGAIN", "resource temporarily unavailable"},
- {36, "EINPROGRESS", "operation now in progress"},
- {37, "EALREADY", "operation already in progress"},
- {38, "ENOTSOCK", "socket operation on non-socket"},
- {39, "EDESTADDRREQ", "destination address required"},
- {40, "EMSGSIZE", "message too long"},
- {41, "EPROTOTYPE", "protocol wrong type for socket"},
- {42, "ENOPROTOOPT", "protocol not available"},
- {43, "EPROTONOSUPPORT", "protocol not supported"},
- {44, "ESOCKTNOSUPPORT", "socket type not supported"},
- {45, "ENOTSUP", "operation not supported"},
- {46, "EPFNOSUPPORT", "protocol family not supported"},
- {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
- {48, "EADDRINUSE", "address already in use"},
- {49, "EADDRNOTAVAIL", "can't assign requested address"},
- {50, "ENETDOWN", "network is down"},
- {51, "ENETUNREACH", "network is unreachable"},
- {52, "ENETRESET", "network dropped connection on reset"},
- {53, "ECONNABORTED", "software caused connection abort"},
- {54, "ECONNRESET", "connection reset by peer"},
- {55, "ENOBUFS", "no buffer space available"},
- {56, "EISCONN", "socket is already connected"},
- {57, "ENOTCONN", "socket is not connected"},
- {58, "ESHUTDOWN", "can't send after socket shutdown"},
- {59, "ETOOMANYREFS", "too many references: can't splice"},
- {60, "ETIMEDOUT", "operation timed out"},
- {61, "ECONNREFUSED", "connection refused"},
- {62, "ELOOP", "too many levels of symbolic links"},
- {63, "ENAMETOOLONG", "file name too long"},
- {64, "EHOSTDOWN", "host is down"},
- {65, "EHOSTUNREACH", "no route to host"},
- {66, "ENOTEMPTY", "directory not empty"},
- {67, "EPROCLIM", "too many processes"},
- {68, "EUSERS", "too many users"},
- {69, "EDQUOT", "disc quota exceeded"},
- {70, "ESTALE", "stale NFS file handle"},
- {71, "EREMOTE", "too many levels of remote in path"},
- {72, "EBADRPC", "RPC struct is bad"},
- {73, "ERPCMISMATCH", "RPC version wrong"},
- {74, "EPROGUNAVAIL", "RPC prog. not avail"},
- {75, "EPROGMISMATCH", "program version wrong"},
- {76, "EPROCUNAVAIL", "bad procedure for program"},
- {77, "ENOLCK", "no locks available"},
- {78, "ENOSYS", "function not implemented"},
- {79, "EFTYPE", "inappropriate file type or format"},
- {80, "EAUTH", "authentication error"},
- {81, "ENEEDAUTH", "need authenticator"},
- {82, "EPWROFF", "device power is off"},
- {83, "EDEVERR", "device error"},
- {84, "EOVERFLOW", "value too large to be stored in data type"},
- {85, "EBADEXEC", "bad executable (or shared library)"},
- {86, "EBADARCH", "bad CPU type in executable"},
- {87, "ESHLIBVERS", "shared library version mismatch"},
- {88, "EBADMACHO", "malformed Mach-o file"},
- {89, "ECANCELED", "operation canceled"},
- {90, "EIDRM", "identifier removed"},
- {91, "ENOMSG", "no message of desired type"},
- {92, "EILSEQ", "illegal byte sequence"},
- {93, "ENOATTR", "attribute not found"},
- {94, "EBADMSG", "bad message"},
- {95, "EMULTIHOP", "EMULTIHOP (Reserved)"},
- {96, "ENODATA", "no message available on STREAM"},
- {97, "ENOLINK", "ENOLINK (Reserved)"},
- {98, "ENOSR", "no STREAM resources"},
- {99, "ENOSTR", "not a STREAM"},
- {100, "EPROTO", "protocol error"},
- {101, "ETIME", "STREAM ioctl timeout"},
- {102, "EOPNOTSUPP", "operation not supported on socket"},
- {103, "ENOPOLICY", "policy not found"},
- {104, "ENOTRECOVERABLE", "state not recoverable"},
- {105, "EOWNERDEAD", "previous owner died"},
- {106, "EQFULL", "interface output queue is full"},
-}
-
-// Signal table
-var signalList = [...]struct {
- num syscall.Signal
- name string
- desc string
-}{
- {1, "SIGHUP", "hangup"},
- {2, "SIGINT", "interrupt"},
- {3, "SIGQUIT", "quit"},
- {4, "SIGILL", "illegal instruction"},
- {5, "SIGTRAP", "trace/BPT trap"},
- {6, "SIGABRT", "abort trap"},
- {7, "SIGEMT", "EMT trap"},
- {8, "SIGFPE", "floating point exception"},
- {9, "SIGKILL", "killed"},
- {10, "SIGBUS", "bus error"},
- {11, "SIGSEGV", "segmentation fault"},
- {12, "SIGSYS", "bad system call"},
- {13, "SIGPIPE", "broken pipe"},
- {14, "SIGALRM", "alarm clock"},
- {15, "SIGTERM", "terminated"},
- {16, "SIGURG", "urgent I/O condition"},
- {17, "SIGSTOP", "suspended (signal)"},
- {18, "SIGTSTP", "suspended"},
- {19, "SIGCONT", "continued"},
- {20, "SIGCHLD", "child exited"},
- {21, "SIGTTIN", "stopped (tty input)"},
- {22, "SIGTTOU", "stopped (tty output)"},
- {23, "SIGIO", "I/O possible"},
- {24, "SIGXCPU", "cputime limit exceeded"},
- {25, "SIGXFSZ", "filesize limit exceeded"},
- {26, "SIGVTALRM", "virtual timer expired"},
- {27, "SIGPROF", "profiling timer expired"},
- {28, "SIGWINCH", "window size changes"},
- {29, "SIGINFO", "information request"},
- {30, "SIGUSR1", "user defined signal 1"},
- {31, "SIGUSR2", "user defined signal 2"},
-}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
index 991996b60..a3a45fec5 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
@@ -1206,6 +1206,7 @@ const (
RTF_DONE = 0x40
RTF_DYNAMIC = 0x10
RTF_GATEWAY = 0x2
+ RTF_GLOBAL = 0x40000000
RTF_HOST = 0x4
RTF_IFREF = 0x4000000
RTF_IFSCOPE = 0x1000000
@@ -1262,6 +1263,11 @@ const (
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
SCM_TIMESTAMP_MONOTONIC = 0x4
+ SEEK_CUR = 0x1
+ SEEK_DATA = 0x4
+ SEEK_END = 0x2
+ SEEK_HOLE = 0x3
+ SEEK_SET = 0x0
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go
deleted file mode 100644
index e748cb110..000000000
--- a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go
+++ /dev/null
@@ -1,1789 +0,0 @@
-// mkerrors.sh
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build arm && darwin
-// +build arm,darwin
-
-// Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- _const.go
-
-package unix
-
-import "syscall"
-
-const (
- AF_APPLETALK = 0x10
- AF_CCITT = 0xa
- AF_CHAOS = 0x5
- AF_CNT = 0x15
- AF_COIP = 0x14
- AF_DATAKIT = 0x9
- AF_DECnet = 0xc
- AF_DLI = 0xd
- AF_E164 = 0x1c
- AF_ECMA = 0x8
- AF_HYLINK = 0xf
- AF_IEEE80211 = 0x25
- AF_IMPLINK = 0x3
- AF_INET = 0x2
- AF_INET6 = 0x1e
- AF_IPX = 0x17
- AF_ISDN = 0x1c
- AF_ISO = 0x7
- AF_LAT = 0xe
- AF_LINK = 0x12
- AF_LOCAL = 0x1
- AF_MAX = 0x28
- AF_NATM = 0x1f
- AF_NDRV = 0x1b
- AF_NETBIOS = 0x21
- AF_NS = 0x6
- AF_OSI = 0x7
- AF_PPP = 0x22
- AF_PUP = 0x4
- AF_RESERVED_36 = 0x24
- AF_ROUTE = 0x11
- AF_SIP = 0x18
- AF_SNA = 0xb
- AF_SYSTEM = 0x20
- AF_SYS_CONTROL = 0x2
- AF_UNIX = 0x1
- AF_UNSPEC = 0x0
- AF_UTUN = 0x26
- ALTWERASE = 0x200
- ATTR_BIT_MAP_COUNT = 0x5
- ATTR_CMN_ACCESSMASK = 0x20000
- ATTR_CMN_ACCTIME = 0x1000
- ATTR_CMN_ADDEDTIME = 0x10000000
- ATTR_CMN_BKUPTIME = 0x2000
- ATTR_CMN_CHGTIME = 0x800
- ATTR_CMN_CRTIME = 0x200
- ATTR_CMN_DATA_PROTECT_FLAGS = 0x40000000
- ATTR_CMN_DEVID = 0x2
- ATTR_CMN_DOCUMENT_ID = 0x100000
- ATTR_CMN_ERROR = 0x20000000
- ATTR_CMN_EXTENDED_SECURITY = 0x400000
- ATTR_CMN_FILEID = 0x2000000
- ATTR_CMN_FLAGS = 0x40000
- ATTR_CMN_FNDRINFO = 0x4000
- ATTR_CMN_FSID = 0x4
- ATTR_CMN_FULLPATH = 0x8000000
- ATTR_CMN_GEN_COUNT = 0x80000
- ATTR_CMN_GRPID = 0x10000
- ATTR_CMN_GRPUUID = 0x1000000
- ATTR_CMN_MODTIME = 0x400
- ATTR_CMN_NAME = 0x1
- ATTR_CMN_NAMEDATTRCOUNT = 0x80000
- ATTR_CMN_NAMEDATTRLIST = 0x100000
- ATTR_CMN_OBJID = 0x20
- ATTR_CMN_OBJPERMANENTID = 0x40
- ATTR_CMN_OBJTAG = 0x10
- ATTR_CMN_OBJTYPE = 0x8
- ATTR_CMN_OWNERID = 0x8000
- ATTR_CMN_PARENTID = 0x4000000
- ATTR_CMN_PAROBJID = 0x80
- ATTR_CMN_RETURNED_ATTRS = 0x80000000
- ATTR_CMN_SCRIPT = 0x100
- ATTR_CMN_SETMASK = 0x41c7ff00
- ATTR_CMN_USERACCESS = 0x200000
- ATTR_CMN_UUID = 0x800000
- ATTR_CMN_VALIDMASK = 0xffffffff
- ATTR_CMN_VOLSETMASK = 0x6700
- ATTR_FILE_ALLOCSIZE = 0x4
- ATTR_FILE_CLUMPSIZE = 0x10
- ATTR_FILE_DATAALLOCSIZE = 0x400
- ATTR_FILE_DATAEXTENTS = 0x800
- ATTR_FILE_DATALENGTH = 0x200
- ATTR_FILE_DEVTYPE = 0x20
- ATTR_FILE_FILETYPE = 0x40
- ATTR_FILE_FORKCOUNT = 0x80
- ATTR_FILE_FORKLIST = 0x100
- ATTR_FILE_IOBLOCKSIZE = 0x8
- ATTR_FILE_LINKCOUNT = 0x1
- ATTR_FILE_RSRCALLOCSIZE = 0x2000
- ATTR_FILE_RSRCEXTENTS = 0x4000
- ATTR_FILE_RSRCLENGTH = 0x1000
- ATTR_FILE_SETMASK = 0x20
- ATTR_FILE_TOTALSIZE = 0x2
- ATTR_FILE_VALIDMASK = 0x37ff
- ATTR_VOL_ALLOCATIONCLUMP = 0x40
- ATTR_VOL_ATTRIBUTES = 0x40000000
- ATTR_VOL_CAPABILITIES = 0x20000
- ATTR_VOL_DIRCOUNT = 0x400
- ATTR_VOL_ENCODINGSUSED = 0x10000
- ATTR_VOL_FILECOUNT = 0x200
- ATTR_VOL_FSTYPE = 0x1
- ATTR_VOL_INFO = 0x80000000
- ATTR_VOL_IOBLOCKSIZE = 0x80
- ATTR_VOL_MAXOBJCOUNT = 0x800
- ATTR_VOL_MINALLOCATION = 0x20
- ATTR_VOL_MOUNTEDDEVICE = 0x8000
- ATTR_VOL_MOUNTFLAGS = 0x4000
- ATTR_VOL_MOUNTPOINT = 0x1000
- ATTR_VOL_NAME = 0x2000
- ATTR_VOL_OBJCOUNT = 0x100
- ATTR_VOL_QUOTA_SIZE = 0x10000000
- ATTR_VOL_RESERVED_SIZE = 0x20000000
- ATTR_VOL_SETMASK = 0x80002000
- ATTR_VOL_SIGNATURE = 0x2
- ATTR_VOL_SIZE = 0x4
- ATTR_VOL_SPACEAVAIL = 0x10
- ATTR_VOL_SPACEFREE = 0x8
- ATTR_VOL_UUID = 0x40000
- ATTR_VOL_VALIDMASK = 0xf007ffff
- B0 = 0x0
- B110 = 0x6e
- B115200 = 0x1c200
- B1200 = 0x4b0
- B134 = 0x86
- B14400 = 0x3840
- B150 = 0x96
- B1800 = 0x708
- B19200 = 0x4b00
- B200 = 0xc8
- B230400 = 0x38400
- B2400 = 0x960
- B28800 = 0x7080
- B300 = 0x12c
- B38400 = 0x9600
- B4800 = 0x12c0
- B50 = 0x32
- B57600 = 0xe100
- B600 = 0x258
- B7200 = 0x1c20
- B75 = 0x4b
- B76800 = 0x12c00
- B9600 = 0x2580
- BIOCFLUSH = 0x20004268
- BIOCGBLEN = 0x40044266
- BIOCGDLT = 0x4004426a
- BIOCGDLTLIST = 0xc00c4279
- BIOCGETIF = 0x4020426b
- BIOCGHDRCMPLT = 0x40044274
- BIOCGRSIG = 0x40044272
- BIOCGRTIMEOUT = 0x4010426e
- BIOCGSEESENT = 0x40044276
- BIOCGSTATS = 0x4008426f
- BIOCIMMEDIATE = 0x80044270
- BIOCPROMISC = 0x20004269
- BIOCSBLEN = 0xc0044266
- BIOCSDLT = 0x80044278
- BIOCSETF = 0x80104267
- BIOCSETFNR = 0x8010427e
- BIOCSETIF = 0x8020426c
- BIOCSHDRCMPLT = 0x80044275
- BIOCSRSIG = 0x80044273
- BIOCSRTIMEOUT = 0x8010426d
- BIOCSSEESENT = 0x80044277
- BIOCVERSION = 0x40044271
- BPF_A = 0x10
- BPF_ABS = 0x20
- BPF_ADD = 0x0
- BPF_ALIGNMENT = 0x4
- BPF_ALU = 0x4
- BPF_AND = 0x50
- BPF_B = 0x10
- BPF_DIV = 0x30
- BPF_H = 0x8
- BPF_IMM = 0x0
- BPF_IND = 0x40
- BPF_JA = 0x0
- BPF_JEQ = 0x10
- BPF_JGE = 0x30
- BPF_JGT = 0x20
- BPF_JMP = 0x5
- BPF_JSET = 0x40
- BPF_K = 0x0
- BPF_LD = 0x0
- BPF_LDX = 0x1
- BPF_LEN = 0x80
- BPF_LSH = 0x60
- BPF_MAJOR_VERSION = 0x1
- BPF_MAXBUFSIZE = 0x80000
- BPF_MAXINSNS = 0x200
- BPF_MEM = 0x60
- BPF_MEMWORDS = 0x10
- BPF_MINBUFSIZE = 0x20
- BPF_MINOR_VERSION = 0x1
- BPF_MISC = 0x7
- BPF_MSH = 0xa0
- BPF_MUL = 0x20
- BPF_NEG = 0x80
- BPF_OR = 0x40
- BPF_RELEASE = 0x30bb6
- BPF_RET = 0x6
- BPF_RSH = 0x70
- BPF_ST = 0x2
- BPF_STX = 0x3
- BPF_SUB = 0x10
- BPF_TAX = 0x0
- BPF_TXA = 0x80
- BPF_W = 0x0
- BPF_X = 0x8
- BRKINT = 0x2
- BS0 = 0x0
- BS1 = 0x8000
- BSDLY = 0x8000
- CFLUSH = 0xf
- CLOCAL = 0x8000
- CLOCK_MONOTONIC = 0x6
- CLOCK_MONOTONIC_RAW = 0x4
- CLOCK_MONOTONIC_RAW_APPROX = 0x5
- CLOCK_PROCESS_CPUTIME_ID = 0xc
- CLOCK_REALTIME = 0x0
- CLOCK_THREAD_CPUTIME_ID = 0x10
- CLOCK_UPTIME_RAW = 0x8
- CLOCK_UPTIME_RAW_APPROX = 0x9
- CLONE_NOFOLLOW = 0x1
- CLONE_NOOWNERCOPY = 0x2
- CR0 = 0x0
- CR1 = 0x1000
- CR2 = 0x2000
- CR3 = 0x3000
- CRDLY = 0x3000
- CREAD = 0x800
- CRTSCTS = 0x30000
- CS5 = 0x0
- CS6 = 0x100
- CS7 = 0x200
- CS8 = 0x300
- CSIZE = 0x300
- CSTART = 0x11
- CSTATUS = 0x14
- CSTOP = 0x13
- CSTOPB = 0x400
- CSUSP = 0x1a
- CTLIOCGINFO = 0xc0644e03
- CTL_HW = 0x6
- CTL_KERN = 0x1
- CTL_MAXNAME = 0xc
- CTL_NET = 0x4
- DLT_A429 = 0xb8
- DLT_A653_ICM = 0xb9
- DLT_AIRONET_HEADER = 0x78
- DLT_AOS = 0xde
- DLT_APPLE_IP_OVER_IEEE1394 = 0x8a
- DLT_ARCNET = 0x7
- DLT_ARCNET_LINUX = 0x81
- DLT_ATM_CLIP = 0x13
- DLT_ATM_RFC1483 = 0xb
- DLT_AURORA = 0x7e
- DLT_AX25 = 0x3
- DLT_AX25_KISS = 0xca
- DLT_BACNET_MS_TP = 0xa5
- DLT_BLUETOOTH_HCI_H4 = 0xbb
- DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9
- DLT_CAN20B = 0xbe
- DLT_CAN_SOCKETCAN = 0xe3
- DLT_CHAOS = 0x5
- DLT_CHDLC = 0x68
- DLT_CISCO_IOS = 0x76
- DLT_C_HDLC = 0x68
- DLT_C_HDLC_WITH_DIR = 0xcd
- DLT_DBUS = 0xe7
- DLT_DECT = 0xdd
- DLT_DOCSIS = 0x8f
- DLT_DVB_CI = 0xeb
- DLT_ECONET = 0x73
- DLT_EN10MB = 0x1
- DLT_EN3MB = 0x2
- DLT_ENC = 0x6d
- DLT_ERF = 0xc5
- DLT_ERF_ETH = 0xaf
- DLT_ERF_POS = 0xb0
- DLT_FC_2 = 0xe0
- DLT_FC_2_WITH_FRAME_DELIMS = 0xe1
- DLT_FDDI = 0xa
- DLT_FLEXRAY = 0xd2
- DLT_FRELAY = 0x6b
- DLT_FRELAY_WITH_DIR = 0xce
- DLT_GCOM_SERIAL = 0xad
- DLT_GCOM_T1E1 = 0xac
- DLT_GPF_F = 0xab
- DLT_GPF_T = 0xaa
- DLT_GPRS_LLC = 0xa9
- DLT_GSMTAP_ABIS = 0xda
- DLT_GSMTAP_UM = 0xd9
- DLT_HHDLC = 0x79
- DLT_IBM_SN = 0x92
- DLT_IBM_SP = 0x91
- DLT_IEEE802 = 0x6
- DLT_IEEE802_11 = 0x69
- DLT_IEEE802_11_RADIO = 0x7f
- DLT_IEEE802_11_RADIO_AVS = 0xa3
- DLT_IEEE802_15_4 = 0xc3
- DLT_IEEE802_15_4_LINUX = 0xbf
- DLT_IEEE802_15_4_NOFCS = 0xe6
- DLT_IEEE802_15_4_NONASK_PHY = 0xd7
- DLT_IEEE802_16_MAC_CPS = 0xbc
- DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1
- DLT_IPFILTER = 0x74
- DLT_IPMB = 0xc7
- DLT_IPMB_LINUX = 0xd1
- DLT_IPNET = 0xe2
- DLT_IPOIB = 0xf2
- DLT_IPV4 = 0xe4
- DLT_IPV6 = 0xe5
- DLT_IP_OVER_FC = 0x7a
- DLT_JUNIPER_ATM1 = 0x89
- DLT_JUNIPER_ATM2 = 0x87
- DLT_JUNIPER_ATM_CEMIC = 0xee
- DLT_JUNIPER_CHDLC = 0xb5
- DLT_JUNIPER_ES = 0x84
- DLT_JUNIPER_ETHER = 0xb2
- DLT_JUNIPER_FIBRECHANNEL = 0xea
- DLT_JUNIPER_FRELAY = 0xb4
- DLT_JUNIPER_GGSN = 0x85
- DLT_JUNIPER_ISM = 0xc2
- DLT_JUNIPER_MFR = 0x86
- DLT_JUNIPER_MLFR = 0x83
- DLT_JUNIPER_MLPPP = 0x82
- DLT_JUNIPER_MONITOR = 0xa4
- DLT_JUNIPER_PIC_PEER = 0xae
- DLT_JUNIPER_PPP = 0xb3
- DLT_JUNIPER_PPPOE = 0xa7
- DLT_JUNIPER_PPPOE_ATM = 0xa8
- DLT_JUNIPER_SERVICES = 0x88
- DLT_JUNIPER_SRX_E2E = 0xe9
- DLT_JUNIPER_ST = 0xc8
- DLT_JUNIPER_VP = 0xb7
- DLT_JUNIPER_VS = 0xe8
- DLT_LAPB_WITH_DIR = 0xcf
- DLT_LAPD = 0xcb
- DLT_LIN = 0xd4
- DLT_LINUX_EVDEV = 0xd8
- DLT_LINUX_IRDA = 0x90
- DLT_LINUX_LAPD = 0xb1
- DLT_LINUX_PPP_WITHDIRECTION = 0xa6
- DLT_LINUX_SLL = 0x71
- DLT_LOOP = 0x6c
- DLT_LTALK = 0x72
- DLT_MATCHING_MAX = 0xf5
- DLT_MATCHING_MIN = 0x68
- DLT_MFR = 0xb6
- DLT_MOST = 0xd3
- DLT_MPEG_2_TS = 0xf3
- DLT_MPLS = 0xdb
- DLT_MTP2 = 0x8c
- DLT_MTP2_WITH_PHDR = 0x8b
- DLT_MTP3 = 0x8d
- DLT_MUX27010 = 0xec
- DLT_NETANALYZER = 0xf0
- DLT_NETANALYZER_TRANSPARENT = 0xf1
- DLT_NFC_LLCP = 0xf5
- DLT_NFLOG = 0xef
- DLT_NG40 = 0xf4
- DLT_NULL = 0x0
- DLT_PCI_EXP = 0x7d
- DLT_PFLOG = 0x75
- DLT_PFSYNC = 0x12
- DLT_PPI = 0xc0
- DLT_PPP = 0x9
- DLT_PPP_BSDOS = 0x10
- DLT_PPP_ETHER = 0x33
- DLT_PPP_PPPD = 0xa6
- DLT_PPP_SERIAL = 0x32
- DLT_PPP_WITH_DIR = 0xcc
- DLT_PPP_WITH_DIRECTION = 0xa6
- DLT_PRISM_HEADER = 0x77
- DLT_PRONET = 0x4
- DLT_RAIF1 = 0xc6
- DLT_RAW = 0xc
- DLT_RIO = 0x7c
- DLT_SCCP = 0x8e
- DLT_SITA = 0xc4
- DLT_SLIP = 0x8
- DLT_SLIP_BSDOS = 0xf
- DLT_STANAG_5066_D_PDU = 0xed
- DLT_SUNATM = 0x7b
- DLT_SYMANTEC_FIREWALL = 0x63
- DLT_TZSP = 0x80
- DLT_USB = 0xba
- DLT_USB_LINUX = 0xbd
- DLT_USB_LINUX_MMAPPED = 0xdc
- DLT_USER0 = 0x93
- DLT_USER1 = 0x94
- DLT_USER10 = 0x9d
- DLT_USER11 = 0x9e
- DLT_USER12 = 0x9f
- DLT_USER13 = 0xa0
- DLT_USER14 = 0xa1
- DLT_USER15 = 0xa2
- DLT_USER2 = 0x95
- DLT_USER3 = 0x96
- DLT_USER4 = 0x97
- DLT_USER5 = 0x98
- DLT_USER6 = 0x99
- DLT_USER7 = 0x9a
- DLT_USER8 = 0x9b
- DLT_USER9 = 0x9c
- DLT_WIHART = 0xdf
- DLT_X2E_SERIAL = 0xd5
- DLT_X2E_XORAYA = 0xd6
- DT_BLK = 0x6
- DT_CHR = 0x2
- DT_DIR = 0x4
- DT_FIFO = 0x1
- DT_LNK = 0xa
- DT_REG = 0x8
- DT_SOCK = 0xc
- DT_UNKNOWN = 0x0
- DT_WHT = 0xe
- ECHO = 0x8
- ECHOCTL = 0x40
- ECHOE = 0x2
- ECHOK = 0x4
- ECHOKE = 0x1
- ECHONL = 0x10
- ECHOPRT = 0x20
- EVFILT_AIO = -0x3
- EVFILT_EXCEPT = -0xf
- EVFILT_FS = -0x9
- EVFILT_MACHPORT = -0x8
- EVFILT_PROC = -0x5
- EVFILT_READ = -0x1
- EVFILT_SIGNAL = -0x6
- EVFILT_SYSCOUNT = 0xf
- EVFILT_THREADMARKER = 0xf
- EVFILT_TIMER = -0x7
- EVFILT_USER = -0xa
- EVFILT_VM = -0xc
- EVFILT_VNODE = -0x4
- EVFILT_WRITE = -0x2
- EV_ADD = 0x1
- EV_CLEAR = 0x20
- EV_DELETE = 0x2
- EV_DISABLE = 0x8
- EV_DISPATCH = 0x80
- EV_DISPATCH2 = 0x180
- EV_ENABLE = 0x4
- EV_EOF = 0x8000
- EV_ERROR = 0x4000
- EV_FLAG0 = 0x1000
- EV_FLAG1 = 0x2000
- EV_ONESHOT = 0x10
- EV_OOBAND = 0x2000
- EV_POLL = 0x1000
- EV_RECEIPT = 0x40
- EV_SYSFLAGS = 0xf000
- EV_UDATA_SPECIFIC = 0x100
- EV_VANISHED = 0x200
- EXTA = 0x4b00
- EXTB = 0x9600
- EXTPROC = 0x800
- FD_CLOEXEC = 0x1
- FD_SETSIZE = 0x400
- FF0 = 0x0
- FF1 = 0x4000
- FFDLY = 0x4000
- FLUSHO = 0x800000
- FSOPT_ATTR_CMN_EXTENDED = 0x20
- FSOPT_NOFOLLOW = 0x1
- FSOPT_NOINMEMUPDATE = 0x2
- FSOPT_PACK_INVAL_ATTRS = 0x8
- FSOPT_REPORT_FULLSIZE = 0x4
- F_ADDFILESIGS = 0x3d
- F_ADDFILESIGS_FOR_DYLD_SIM = 0x53
- F_ADDFILESIGS_RETURN = 0x61
- F_ADDSIGS = 0x3b
- F_ALLOCATEALL = 0x4
- F_ALLOCATECONTIG = 0x2
- F_BARRIERFSYNC = 0x55
- F_CHECK_LV = 0x62
- F_CHKCLEAN = 0x29
- F_DUPFD = 0x0
- F_DUPFD_CLOEXEC = 0x43
- F_FINDSIGS = 0x4e
- F_FLUSH_DATA = 0x28
- F_FREEZE_FS = 0x35
- F_FULLFSYNC = 0x33
- F_GETCODEDIR = 0x48
- F_GETFD = 0x1
- F_GETFL = 0x3
- F_GETLK = 0x7
- F_GETLKPID = 0x42
- F_GETNOSIGPIPE = 0x4a
- F_GETOWN = 0x5
- F_GETPATH = 0x32
- F_GETPATH_MTMINFO = 0x47
- F_GETPROTECTIONCLASS = 0x3f
- F_GETPROTECTIONLEVEL = 0x4d
- F_GLOBAL_NOCACHE = 0x37
- F_LOG2PHYS = 0x31
- F_LOG2PHYS_EXT = 0x41
- F_NOCACHE = 0x30
- F_NODIRECT = 0x3e
- F_OK = 0x0
- F_PATHPKG_CHECK = 0x34
- F_PEOFPOSMODE = 0x3
- F_PREALLOCATE = 0x2a
- F_PUNCHHOLE = 0x63
- F_RDADVISE = 0x2c
- F_RDAHEAD = 0x2d
- F_RDLCK = 0x1
- F_SETBACKINGSTORE = 0x46
- F_SETFD = 0x2
- F_SETFL = 0x4
- F_SETLK = 0x8
- F_SETLKW = 0x9
- F_SETLKWTIMEOUT = 0xa
- F_SETNOSIGPIPE = 0x49
- F_SETOWN = 0x6
- F_SETPROTECTIONCLASS = 0x40
- F_SETSIZE = 0x2b
- F_SINGLE_WRITER = 0x4c
- F_THAW_FS = 0x36
- F_TRANSCODEKEY = 0x4b
- F_TRIM_ACTIVE_FILE = 0x64
- F_UNLCK = 0x2
- F_VOLPOSMODE = 0x4
- F_WRLCK = 0x3
- HUPCL = 0x4000
- HW_MACHINE = 0x1
- ICANON = 0x100
- ICMP6_FILTER = 0x12
- ICRNL = 0x100
- IEXTEN = 0x400
- IFF_ALLMULTI = 0x200
- IFF_ALTPHYS = 0x4000
- IFF_BROADCAST = 0x2
- IFF_DEBUG = 0x4
- IFF_LINK0 = 0x1000
- IFF_LINK1 = 0x2000
- IFF_LINK2 = 0x4000
- IFF_LOOPBACK = 0x8
- IFF_MULTICAST = 0x8000
- IFF_NOARP = 0x80
- IFF_NOTRAILERS = 0x20
- IFF_OACTIVE = 0x400
- IFF_POINTOPOINT = 0x10
- IFF_PROMISC = 0x100
- IFF_RUNNING = 0x40
- IFF_SIMPLEX = 0x800
- IFF_UP = 0x1
- IFNAMSIZ = 0x10
- IFT_1822 = 0x2
- IFT_AAL5 = 0x31
- IFT_ARCNET = 0x23
- IFT_ARCNETPLUS = 0x24
- IFT_ATM = 0x25
- IFT_BRIDGE = 0xd1
- IFT_CARP = 0xf8
- IFT_CELLULAR = 0xff
- IFT_CEPT = 0x13
- IFT_DS3 = 0x1e
- IFT_ENC = 0xf4
- IFT_EON = 0x19
- IFT_ETHER = 0x6
- IFT_FAITH = 0x38
- IFT_FDDI = 0xf
- IFT_FRELAY = 0x20
- IFT_FRELAYDCE = 0x2c
- IFT_GIF = 0x37
- IFT_HDH1822 = 0x3
- IFT_HIPPI = 0x2f
- IFT_HSSI = 0x2e
- IFT_HY = 0xe
- IFT_IEEE1394 = 0x90
- IFT_IEEE8023ADLAG = 0x88
- IFT_ISDNBASIC = 0x14
- IFT_ISDNPRIMARY = 0x15
- IFT_ISO88022LLC = 0x29
- IFT_ISO88023 = 0x7
- IFT_ISO88024 = 0x8
- IFT_ISO88025 = 0x9
- IFT_ISO88026 = 0xa
- IFT_L2VLAN = 0x87
- IFT_LAPB = 0x10
- IFT_LOCALTALK = 0x2a
- IFT_LOOP = 0x18
- IFT_MIOX25 = 0x26
- IFT_MODEM = 0x30
- IFT_NSIP = 0x1b
- IFT_OTHER = 0x1
- IFT_P10 = 0xc
- IFT_P80 = 0xd
- IFT_PARA = 0x22
- IFT_PDP = 0xff
- IFT_PFLOG = 0xf5
- IFT_PFSYNC = 0xf6
- IFT_PKTAP = 0xfe
- IFT_PPP = 0x17
- IFT_PROPMUX = 0x36
- IFT_PROPVIRTUAL = 0x35
- IFT_PTPSERIAL = 0x16
- IFT_RS232 = 0x21
- IFT_SDLC = 0x11
- IFT_SIP = 0x1f
- IFT_SLIP = 0x1c
- IFT_SMDSDXI = 0x2b
- IFT_SMDSICIP = 0x34
- IFT_SONET = 0x27
- IFT_SONETPATH = 0x32
- IFT_SONETVT = 0x33
- IFT_STARLAN = 0xb
- IFT_STF = 0x39
- IFT_T1 = 0x12
- IFT_ULTRA = 0x1d
- IFT_V35 = 0x2d
- IFT_X25 = 0x5
- IFT_X25DDN = 0x4
- IFT_X25PLE = 0x28
- IFT_XETHER = 0x1a
- IGNBRK = 0x1
- IGNCR = 0x80
- IGNPAR = 0x4
- IMAXBEL = 0x2000
- INLCR = 0x40
- INPCK = 0x10
- IN_CLASSA_HOST = 0xffffff
- IN_CLASSA_MAX = 0x80
- IN_CLASSA_NET = 0xff000000
- IN_CLASSA_NSHIFT = 0x18
- IN_CLASSB_HOST = 0xffff
- IN_CLASSB_MAX = 0x10000
- IN_CLASSB_NET = 0xffff0000
- IN_CLASSB_NSHIFT = 0x10
- IN_CLASSC_HOST = 0xff
- IN_CLASSC_NET = 0xffffff00
- IN_CLASSC_NSHIFT = 0x8
- IN_CLASSD_HOST = 0xfffffff
- IN_CLASSD_NET = 0xf0000000
- IN_CLASSD_NSHIFT = 0x1c
- IN_LINKLOCALNETNUM = 0xa9fe0000
- IN_LOOPBACKNET = 0x7f
- IPPROTO_3PC = 0x22
- IPPROTO_ADFS = 0x44
- IPPROTO_AH = 0x33
- IPPROTO_AHIP = 0x3d
- IPPROTO_APES = 0x63
- IPPROTO_ARGUS = 0xd
- IPPROTO_AX25 = 0x5d
- IPPROTO_BHA = 0x31
- IPPROTO_BLT = 0x1e
- IPPROTO_BRSATMON = 0x4c
- IPPROTO_CFTP = 0x3e
- IPPROTO_CHAOS = 0x10
- IPPROTO_CMTP = 0x26
- IPPROTO_CPHB = 0x49
- IPPROTO_CPNX = 0x48
- IPPROTO_DDP = 0x25
- IPPROTO_DGP = 0x56
- IPPROTO_DIVERT = 0xfe
- IPPROTO_DONE = 0x101
- IPPROTO_DSTOPTS = 0x3c
- IPPROTO_EGP = 0x8
- IPPROTO_EMCON = 0xe
- IPPROTO_ENCAP = 0x62
- IPPROTO_EON = 0x50
- IPPROTO_ESP = 0x32
- IPPROTO_ETHERIP = 0x61
- IPPROTO_FRAGMENT = 0x2c
- IPPROTO_GGP = 0x3
- IPPROTO_GMTP = 0x64
- IPPROTO_GRE = 0x2f
- IPPROTO_HELLO = 0x3f
- IPPROTO_HMP = 0x14
- IPPROTO_HOPOPTS = 0x0
- IPPROTO_ICMP = 0x1
- IPPROTO_ICMPV6 = 0x3a
- IPPROTO_IDP = 0x16
- IPPROTO_IDPR = 0x23
- IPPROTO_IDRP = 0x2d
- IPPROTO_IGMP = 0x2
- IPPROTO_IGP = 0x55
- IPPROTO_IGRP = 0x58
- IPPROTO_IL = 0x28
- IPPROTO_INLSP = 0x34
- IPPROTO_INP = 0x20
- IPPROTO_IP = 0x0
- IPPROTO_IPCOMP = 0x6c
- IPPROTO_IPCV = 0x47
- IPPROTO_IPEIP = 0x5e
- IPPROTO_IPIP = 0x4
- IPPROTO_IPPC = 0x43
- IPPROTO_IPV4 = 0x4
- IPPROTO_IPV6 = 0x29
- IPPROTO_IRTP = 0x1c
- IPPROTO_KRYPTOLAN = 0x41
- IPPROTO_LARP = 0x5b
- IPPROTO_LEAF1 = 0x19
- IPPROTO_LEAF2 = 0x1a
- IPPROTO_MAX = 0x100
- IPPROTO_MAXID = 0x34
- IPPROTO_MEAS = 0x13
- IPPROTO_MHRP = 0x30
- IPPROTO_MICP = 0x5f
- IPPROTO_MTP = 0x5c
- IPPROTO_MUX = 0x12
- IPPROTO_ND = 0x4d
- IPPROTO_NHRP = 0x36
- IPPROTO_NONE = 0x3b
- IPPROTO_NSP = 0x1f
- IPPROTO_NVPII = 0xb
- IPPROTO_OSPFIGP = 0x59
- IPPROTO_PGM = 0x71
- IPPROTO_PIGP = 0x9
- IPPROTO_PIM = 0x67
- IPPROTO_PRM = 0x15
- IPPROTO_PUP = 0xc
- IPPROTO_PVP = 0x4b
- IPPROTO_RAW = 0xff
- IPPROTO_RCCMON = 0xa
- IPPROTO_RDP = 0x1b
- IPPROTO_ROUTING = 0x2b
- IPPROTO_RSVP = 0x2e
- IPPROTO_RVD = 0x42
- IPPROTO_SATEXPAK = 0x40
- IPPROTO_SATMON = 0x45
- IPPROTO_SCCSP = 0x60
- IPPROTO_SCTP = 0x84
- IPPROTO_SDRP = 0x2a
- IPPROTO_SEP = 0x21
- IPPROTO_SRPC = 0x5a
- IPPROTO_ST = 0x7
- IPPROTO_SVMTP = 0x52
- IPPROTO_SWIPE = 0x35
- IPPROTO_TCF = 0x57
- IPPROTO_TCP = 0x6
- IPPROTO_TP = 0x1d
- IPPROTO_TPXX = 0x27
- IPPROTO_TRUNK1 = 0x17
- IPPROTO_TRUNK2 = 0x18
- IPPROTO_TTP = 0x54
- IPPROTO_UDP = 0x11
- IPPROTO_VINES = 0x53
- IPPROTO_VISA = 0x46
- IPPROTO_VMTP = 0x51
- IPPROTO_WBEXPAK = 0x4f
- IPPROTO_WBMON = 0x4e
- IPPROTO_WSN = 0x4a
- IPPROTO_XNET = 0xf
- IPPROTO_XTP = 0x24
- IPV6_2292DSTOPTS = 0x17
- IPV6_2292HOPLIMIT = 0x14
- IPV6_2292HOPOPTS = 0x16
- IPV6_2292NEXTHOP = 0x15
- IPV6_2292PKTINFO = 0x13
- IPV6_2292PKTOPTIONS = 0x19
- IPV6_2292RTHDR = 0x18
- IPV6_BINDV6ONLY = 0x1b
- IPV6_BOUND_IF = 0x7d
- IPV6_CHECKSUM = 0x1a
- IPV6_DEFAULT_MULTICAST_HOPS = 0x1
- IPV6_DEFAULT_MULTICAST_LOOP = 0x1
- IPV6_DEFHLIM = 0x40
- IPV6_FAITH = 0x1d
- IPV6_FLOWINFO_MASK = 0xffffff0f
- IPV6_FLOWLABEL_MASK = 0xffff0f00
- IPV6_FLOW_ECN_MASK = 0x300
- IPV6_FRAGTTL = 0x3c
- IPV6_FW_ADD = 0x1e
- IPV6_FW_DEL = 0x1f
- IPV6_FW_FLUSH = 0x20
- IPV6_FW_GET = 0x22
- IPV6_FW_ZERO = 0x21
- IPV6_HLIMDEC = 0x1
- IPV6_IPSEC_POLICY = 0x1c
- IPV6_JOIN_GROUP = 0xc
- IPV6_LEAVE_GROUP = 0xd
- IPV6_MAXHLIM = 0xff
- IPV6_MAXOPTHDR = 0x800
- IPV6_MAXPACKET = 0xffff
- IPV6_MAX_GROUP_SRC_FILTER = 0x200
- IPV6_MAX_MEMBERSHIPS = 0xfff
- IPV6_MAX_SOCK_SRC_FILTER = 0x80
- IPV6_MIN_MEMBERSHIPS = 0x1f
- IPV6_MMTU = 0x500
- IPV6_MULTICAST_HOPS = 0xa
- IPV6_MULTICAST_IF = 0x9
- IPV6_MULTICAST_LOOP = 0xb
- IPV6_PORTRANGE = 0xe
- IPV6_PORTRANGE_DEFAULT = 0x0
- IPV6_PORTRANGE_HIGH = 0x1
- IPV6_PORTRANGE_LOW = 0x2
- IPV6_RECVTCLASS = 0x23
- IPV6_RTHDR_LOOSE = 0x0
- IPV6_RTHDR_STRICT = 0x1
- IPV6_RTHDR_TYPE_0 = 0x0
- IPV6_SOCKOPT_RESERVED1 = 0x3
- IPV6_TCLASS = 0x24
- IPV6_UNICAST_HOPS = 0x4
- IPV6_V6ONLY = 0x1b
- IPV6_VERSION = 0x60
- IPV6_VERSION_MASK = 0xf0
- IP_ADD_MEMBERSHIP = 0xc
- IP_ADD_SOURCE_MEMBERSHIP = 0x46
- IP_BLOCK_SOURCE = 0x48
- IP_BOUND_IF = 0x19
- IP_DEFAULT_MULTICAST_LOOP = 0x1
- IP_DEFAULT_MULTICAST_TTL = 0x1
- IP_DF = 0x4000
- IP_DROP_MEMBERSHIP = 0xd
- IP_DROP_SOURCE_MEMBERSHIP = 0x47
- IP_DUMMYNET_CONFIGURE = 0x3c
- IP_DUMMYNET_DEL = 0x3d
- IP_DUMMYNET_FLUSH = 0x3e
- IP_DUMMYNET_GET = 0x40
- IP_FAITH = 0x16
- IP_FW_ADD = 0x28
- IP_FW_DEL = 0x29
- IP_FW_FLUSH = 0x2a
- IP_FW_GET = 0x2c
- IP_FW_RESETLOG = 0x2d
- IP_FW_ZERO = 0x2b
- IP_HDRINCL = 0x2
- IP_IPSEC_POLICY = 0x15
- IP_MAXPACKET = 0xffff
- IP_MAX_GROUP_SRC_FILTER = 0x200
- IP_MAX_MEMBERSHIPS = 0xfff
- IP_MAX_SOCK_MUTE_FILTER = 0x80
- IP_MAX_SOCK_SRC_FILTER = 0x80
- IP_MF = 0x2000
- IP_MIN_MEMBERSHIPS = 0x1f
- IP_MSFILTER = 0x4a
- IP_MSS = 0x240
- IP_MULTICAST_IF = 0x9
- IP_MULTICAST_IFINDEX = 0x42
- IP_MULTICAST_LOOP = 0xb
- IP_MULTICAST_TTL = 0xa
- IP_MULTICAST_VIF = 0xe
- IP_NAT__XXX = 0x37
- IP_OFFMASK = 0x1fff
- IP_OLD_FW_ADD = 0x32
- IP_OLD_FW_DEL = 0x33
- IP_OLD_FW_FLUSH = 0x34
- IP_OLD_FW_GET = 0x36
- IP_OLD_FW_RESETLOG = 0x38
- IP_OLD_FW_ZERO = 0x35
- IP_OPTIONS = 0x1
- IP_PKTINFO = 0x1a
- IP_PORTRANGE = 0x13
- IP_PORTRANGE_DEFAULT = 0x0
- IP_PORTRANGE_HIGH = 0x1
- IP_PORTRANGE_LOW = 0x2
- IP_RECVDSTADDR = 0x7
- IP_RECVIF = 0x14
- IP_RECVOPTS = 0x5
- IP_RECVPKTINFO = 0x1a
- IP_RECVRETOPTS = 0x6
- IP_RECVTOS = 0x1b
- IP_RECVTTL = 0x18
- IP_RETOPTS = 0x8
- IP_RF = 0x8000
- IP_RSVP_OFF = 0x10
- IP_RSVP_ON = 0xf
- IP_RSVP_VIF_OFF = 0x12
- IP_RSVP_VIF_ON = 0x11
- IP_STRIPHDR = 0x17
- IP_TOS = 0x3
- IP_TRAFFIC_MGT_BACKGROUND = 0x41
- IP_TTL = 0x4
- IP_UNBLOCK_SOURCE = 0x49
- ISIG = 0x80
- ISTRIP = 0x20
- IUTF8 = 0x4000
- IXANY = 0x800
- IXOFF = 0x400
- IXON = 0x200
- KERN_HOSTNAME = 0xa
- KERN_OSRELEASE = 0x2
- KERN_OSTYPE = 0x1
- KERN_VERSION = 0x4
- LOCK_EX = 0x2
- LOCK_NB = 0x4
- LOCK_SH = 0x1
- LOCK_UN = 0x8
- MADV_CAN_REUSE = 0x9
- MADV_DONTNEED = 0x4
- MADV_FREE = 0x5
- MADV_FREE_REUSABLE = 0x7
- MADV_FREE_REUSE = 0x8
- MADV_NORMAL = 0x0
- MADV_PAGEOUT = 0xa
- MADV_RANDOM = 0x1
- MADV_SEQUENTIAL = 0x2
- MADV_WILLNEED = 0x3
- MADV_ZERO_WIRED_PAGES = 0x6
- MAP_ANON = 0x1000
- MAP_ANONYMOUS = 0x1000
- MAP_COPY = 0x2
- MAP_FILE = 0x0
- MAP_FIXED = 0x10
- MAP_HASSEMAPHORE = 0x200
- MAP_JIT = 0x800
- MAP_NOCACHE = 0x400
- MAP_NOEXTEND = 0x100
- MAP_NORESERVE = 0x40
- MAP_PRIVATE = 0x2
- MAP_RENAME = 0x20
- MAP_RESERVED0080 = 0x80
- MAP_RESILIENT_CODESIGN = 0x2000
- MAP_RESILIENT_MEDIA = 0x4000
- MAP_SHARED = 0x1
- MCL_CURRENT = 0x1
- MCL_FUTURE = 0x2
- MNT_ASYNC = 0x40
- MNT_AUTOMOUNTED = 0x400000
- MNT_CMDFLAGS = 0xf0000
- MNT_CPROTECT = 0x80
- MNT_DEFWRITE = 0x2000000
- MNT_DONTBROWSE = 0x100000
- MNT_DOVOLFS = 0x8000
- MNT_DWAIT = 0x4
- MNT_EXPORTED = 0x100
- MNT_FORCE = 0x80000
- MNT_IGNORE_OWNERSHIP = 0x200000
- MNT_JOURNALED = 0x800000
- MNT_LOCAL = 0x1000
- MNT_MULTILABEL = 0x4000000
- MNT_NOATIME = 0x10000000
- MNT_NOBLOCK = 0x20000
- MNT_NODEV = 0x10
- MNT_NOEXEC = 0x4
- MNT_NOSUID = 0x8
- MNT_NOUSERXATTR = 0x1000000
- MNT_NOWAIT = 0x2
- MNT_QUARANTINE = 0x400
- MNT_QUOTA = 0x2000
- MNT_RDONLY = 0x1
- MNT_RELOAD = 0x40000
- MNT_ROOTFS = 0x4000
- MNT_SYNCHRONOUS = 0x2
- MNT_UNION = 0x20
- MNT_UNKNOWNPERMISSIONS = 0x200000
- MNT_UPDATE = 0x10000
- MNT_VISFLAGMASK = 0x17f0f5ff
- MNT_WAIT = 0x1
- MSG_CTRUNC = 0x20
- MSG_DONTROUTE = 0x4
- MSG_DONTWAIT = 0x80
- MSG_EOF = 0x100
- MSG_EOR = 0x8
- MSG_FLUSH = 0x400
- MSG_HAVEMORE = 0x2000
- MSG_HOLD = 0x800
- MSG_NEEDSA = 0x10000
- MSG_OOB = 0x1
- MSG_PEEK = 0x2
- MSG_RCVMORE = 0x4000
- MSG_SEND = 0x1000
- MSG_TRUNC = 0x10
- MSG_WAITALL = 0x40
- MSG_WAITSTREAM = 0x200
- MS_ASYNC = 0x1
- MS_DEACTIVATE = 0x8
- MS_INVALIDATE = 0x2
- MS_KILLPAGES = 0x4
- MS_SYNC = 0x10
- NAME_MAX = 0xff
- NET_RT_DUMP = 0x1
- NET_RT_DUMP2 = 0x7
- NET_RT_FLAGS = 0x2
- NET_RT_IFLIST = 0x3
- NET_RT_IFLIST2 = 0x6
- NET_RT_MAXID = 0xa
- NET_RT_STAT = 0x4
- NET_RT_TRASH = 0x5
- NFDBITS = 0x20
- NL0 = 0x0
- NL1 = 0x100
- NL2 = 0x200
- NL3 = 0x300
- NLDLY = 0x300
- NOFLSH = 0x80000000
- NOKERNINFO = 0x2000000
- NOTE_ABSOLUTE = 0x8
- NOTE_ATTRIB = 0x8
- NOTE_BACKGROUND = 0x40
- NOTE_CHILD = 0x4
- NOTE_CRITICAL = 0x20
- NOTE_DELETE = 0x1
- NOTE_EXEC = 0x20000000
- NOTE_EXIT = 0x80000000
- NOTE_EXITSTATUS = 0x4000000
- NOTE_EXIT_CSERROR = 0x40000
- NOTE_EXIT_DECRYPTFAIL = 0x10000
- NOTE_EXIT_DETAIL = 0x2000000
- NOTE_EXIT_DETAIL_MASK = 0x70000
- NOTE_EXIT_MEMORY = 0x20000
- NOTE_EXIT_REPARENTED = 0x80000
- NOTE_EXTEND = 0x4
- NOTE_FFAND = 0x40000000
- NOTE_FFCOPY = 0xc0000000
- NOTE_FFCTRLMASK = 0xc0000000
- NOTE_FFLAGSMASK = 0xffffff
- NOTE_FFNOP = 0x0
- NOTE_FFOR = 0x80000000
- NOTE_FORK = 0x40000000
- NOTE_FUNLOCK = 0x100
- NOTE_LEEWAY = 0x10
- NOTE_LINK = 0x10
- NOTE_LOWAT = 0x1
- NOTE_MACH_CONTINUOUS_TIME = 0x80
- NOTE_NONE = 0x80
- NOTE_NSECONDS = 0x4
- NOTE_OOB = 0x2
- NOTE_PCTRLMASK = -0x100000
- NOTE_PDATAMASK = 0xfffff
- NOTE_REAP = 0x10000000
- NOTE_RENAME = 0x20
- NOTE_REVOKE = 0x40
- NOTE_SECONDS = 0x1
- NOTE_SIGNAL = 0x8000000
- NOTE_TRACK = 0x1
- NOTE_TRACKERR = 0x2
- NOTE_TRIGGER = 0x1000000
- NOTE_USECONDS = 0x2
- NOTE_VM_ERROR = 0x10000000
- NOTE_VM_PRESSURE = 0x80000000
- NOTE_VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000
- NOTE_VM_PRESSURE_TERMINATE = 0x40000000
- NOTE_WRITE = 0x2
- OCRNL = 0x10
- OFDEL = 0x20000
- OFILL = 0x80
- ONLCR = 0x2
- ONLRET = 0x40
- ONOCR = 0x20
- ONOEOT = 0x8
- OPOST = 0x1
- OXTABS = 0x4
- O_ACCMODE = 0x3
- O_ALERT = 0x20000000
- O_APPEND = 0x8
- O_ASYNC = 0x40
- O_CLOEXEC = 0x1000000
- O_CREAT = 0x200
- O_DIRECTORY = 0x100000
- O_DP_GETRAWENCRYPTED = 0x1
- O_DP_GETRAWUNENCRYPTED = 0x2
- O_DSYNC = 0x400000
- O_EVTONLY = 0x8000
- O_EXCL = 0x800
- O_EXLOCK = 0x20
- O_FSYNC = 0x80
- O_NDELAY = 0x4
- O_NOCTTY = 0x20000
- O_NOFOLLOW = 0x100
- O_NONBLOCK = 0x4
- O_POPUP = 0x80000000
- O_RDONLY = 0x0
- O_RDWR = 0x2
- O_SHLOCK = 0x10
- O_SYMLINK = 0x200000
- O_SYNC = 0x80
- O_TRUNC = 0x400
- O_WRONLY = 0x1
- PARENB = 0x1000
- PARMRK = 0x8
- PARODD = 0x2000
- PENDIN = 0x20000000
- PRIO_PGRP = 0x1
- PRIO_PROCESS = 0x0
- PRIO_USER = 0x2
- PROT_EXEC = 0x4
- PROT_NONE = 0x0
- PROT_READ = 0x1
- PROT_WRITE = 0x2
- PT_ATTACH = 0xa
- PT_ATTACHEXC = 0xe
- PT_CONTINUE = 0x7
- PT_DENY_ATTACH = 0x1f
- PT_DETACH = 0xb
- PT_FIRSTMACH = 0x20
- PT_FORCEQUOTA = 0x1e
- PT_KILL = 0x8
- PT_READ_D = 0x2
- PT_READ_I = 0x1
- PT_READ_U = 0x3
- PT_SIGEXC = 0xc
- PT_STEP = 0x9
- PT_THUPDATE = 0xd
- PT_TRACE_ME = 0x0
- PT_WRITE_D = 0x5
- PT_WRITE_I = 0x4
- PT_WRITE_U = 0x6
- RLIMIT_AS = 0x5
- RLIMIT_CORE = 0x4
- RLIMIT_CPU = 0x0
- RLIMIT_CPU_USAGE_MONITOR = 0x2
- RLIMIT_DATA = 0x2
- RLIMIT_FSIZE = 0x1
- RLIMIT_MEMLOCK = 0x6
- RLIMIT_NOFILE = 0x8
- RLIMIT_NPROC = 0x7
- RLIMIT_RSS = 0x5
- RLIMIT_STACK = 0x3
- RLIM_INFINITY = 0x7fffffffffffffff
- RTAX_AUTHOR = 0x6
- RTAX_BRD = 0x7
- RTAX_DST = 0x0
- RTAX_GATEWAY = 0x1
- RTAX_GENMASK = 0x3
- RTAX_IFA = 0x5
- RTAX_IFP = 0x4
- RTAX_MAX = 0x8
- RTAX_NETMASK = 0x2
- RTA_AUTHOR = 0x40
- RTA_BRD = 0x80
- RTA_DST = 0x1
- RTA_GATEWAY = 0x2
- RTA_GENMASK = 0x8
- RTA_IFA = 0x20
- RTA_IFP = 0x10
- RTA_NETMASK = 0x4
- RTF_BLACKHOLE = 0x1000
- RTF_BROADCAST = 0x400000
- RTF_CLONING = 0x100
- RTF_CONDEMNED = 0x2000000
- RTF_DELCLONE = 0x80
- RTF_DONE = 0x40
- RTF_DYNAMIC = 0x10
- RTF_GATEWAY = 0x2
- RTF_HOST = 0x4
- RTF_IFREF = 0x4000000
- RTF_IFSCOPE = 0x1000000
- RTF_LLINFO = 0x400
- RTF_LOCAL = 0x200000
- RTF_MODIFIED = 0x20
- RTF_MULTICAST = 0x800000
- RTF_NOIFREF = 0x2000
- RTF_PINNED = 0x100000
- RTF_PRCLONING = 0x10000
- RTF_PROTO1 = 0x8000
- RTF_PROTO2 = 0x4000
- RTF_PROTO3 = 0x40000
- RTF_PROXY = 0x8000000
- RTF_REJECT = 0x8
- RTF_ROUTER = 0x10000000
- RTF_STATIC = 0x800
- RTF_UP = 0x1
- RTF_WASCLONED = 0x20000
- RTF_XRESOLVE = 0x200
- RTM_ADD = 0x1
- RTM_CHANGE = 0x3
- RTM_DELADDR = 0xd
- RTM_DELETE = 0x2
- RTM_DELMADDR = 0x10
- RTM_GET = 0x4
- RTM_GET2 = 0x14
- RTM_IFINFO = 0xe
- RTM_IFINFO2 = 0x12
- RTM_LOCK = 0x8
- RTM_LOSING = 0x5
- RTM_MISS = 0x7
- RTM_NEWADDR = 0xc
- RTM_NEWMADDR = 0xf
- RTM_NEWMADDR2 = 0x13
- RTM_OLDADD = 0x9
- RTM_OLDDEL = 0xa
- RTM_REDIRECT = 0x6
- RTM_RESOLVE = 0xb
- RTM_RTTUNIT = 0xf4240
- RTM_VERSION = 0x5
- RTV_EXPIRE = 0x4
- RTV_HOPCOUNT = 0x2
- RTV_MTU = 0x1
- RTV_RPIPE = 0x8
- RTV_RTT = 0x40
- RTV_RTTVAR = 0x80
- RTV_SPIPE = 0x10
- RTV_SSTHRESH = 0x20
- RUSAGE_CHILDREN = -0x1
- RUSAGE_SELF = 0x0
- SCM_CREDS = 0x3
- SCM_RIGHTS = 0x1
- SCM_TIMESTAMP = 0x2
- SCM_TIMESTAMP_MONOTONIC = 0x4
- SHUT_RD = 0x0
- SHUT_RDWR = 0x2
- SHUT_WR = 0x1
- SIOCADDMULTI = 0x80206931
- SIOCAIFADDR = 0x8040691a
- SIOCARPIPLL = 0xc0206928
- SIOCATMARK = 0x40047307
- SIOCAUTOADDR = 0xc0206926
- SIOCAUTONETMASK = 0x80206927
- SIOCDELMULTI = 0x80206932
- SIOCDIFADDR = 0x80206919
- SIOCDIFPHYADDR = 0x80206941
- SIOCGDRVSPEC = 0xc028697b
- SIOCGETVLAN = 0xc020697f
- SIOCGHIWAT = 0x40047301
- SIOCGIFADDR = 0xc0206921
- SIOCGIFALTMTU = 0xc0206948
- SIOCGIFASYNCMAP = 0xc020697c
- SIOCGIFBOND = 0xc0206947
- SIOCGIFBRDADDR = 0xc0206923
- SIOCGIFCAP = 0xc020695b
- SIOCGIFCONF = 0xc00c6924
- SIOCGIFDEVMTU = 0xc0206944
- SIOCGIFDSTADDR = 0xc0206922
- SIOCGIFFLAGS = 0xc0206911
- SIOCGIFGENERIC = 0xc020693a
- SIOCGIFKPI = 0xc0206987
- SIOCGIFMAC = 0xc0206982
- SIOCGIFMEDIA = 0xc02c6938
- SIOCGIFMETRIC = 0xc0206917
- SIOCGIFMTU = 0xc0206933
- SIOCGIFNETMASK = 0xc0206925
- SIOCGIFPDSTADDR = 0xc0206940
- SIOCGIFPHYS = 0xc0206935
- SIOCGIFPSRCADDR = 0xc020693f
- SIOCGIFSTATUS = 0xc331693d
- SIOCGIFVLAN = 0xc020697f
- SIOCGIFWAKEFLAGS = 0xc0206988
- SIOCGLOWAT = 0x40047303
- SIOCGPGRP = 0x40047309
- SIOCIFCREATE = 0xc0206978
- SIOCIFCREATE2 = 0xc020697a
- SIOCIFDESTROY = 0x80206979
- SIOCIFGCLONERS = 0xc0106981
- SIOCRSLVMULTI = 0xc010693b
- SIOCSDRVSPEC = 0x8028697b
- SIOCSETVLAN = 0x8020697e
- SIOCSHIWAT = 0x80047300
- SIOCSIFADDR = 0x8020690c
- SIOCSIFALTMTU = 0x80206945
- SIOCSIFASYNCMAP = 0x8020697d
- SIOCSIFBOND = 0x80206946
- SIOCSIFBRDADDR = 0x80206913
- SIOCSIFCAP = 0x8020695a
- SIOCSIFDSTADDR = 0x8020690e
- SIOCSIFFLAGS = 0x80206910
- SIOCSIFGENERIC = 0x80206939
- SIOCSIFKPI = 0x80206986
- SIOCSIFLLADDR = 0x8020693c
- SIOCSIFMAC = 0x80206983
- SIOCSIFMEDIA = 0xc0206937
- SIOCSIFMETRIC = 0x80206918
- SIOCSIFMTU = 0x80206934
- SIOCSIFNETMASK = 0x80206916
- SIOCSIFPHYADDR = 0x8040693e
- SIOCSIFPHYS = 0x80206936
- SIOCSIFVLAN = 0x8020697e
- SIOCSLOWAT = 0x80047302
- SIOCSPGRP = 0x80047308
- SOCK_DGRAM = 0x2
- SOCK_MAXADDRLEN = 0xff
- SOCK_RAW = 0x3
- SOCK_RDM = 0x4
- SOCK_SEQPACKET = 0x5
- SOCK_STREAM = 0x1
- SOL_SOCKET = 0xffff
- SOMAXCONN = 0x80
- SO_ACCEPTCONN = 0x2
- SO_BROADCAST = 0x20
- SO_DEBUG = 0x1
- SO_DONTROUTE = 0x10
- SO_DONTTRUNC = 0x2000
- SO_ERROR = 0x1007
- SO_KEEPALIVE = 0x8
- SO_LABEL = 0x1010
- SO_LINGER = 0x80
- SO_LINGER_SEC = 0x1080
- SO_NETSVC_MARKING_LEVEL = 0x1119
- SO_NET_SERVICE_TYPE = 0x1116
- SO_NKE = 0x1021
- SO_NOADDRERR = 0x1023
- SO_NOSIGPIPE = 0x1022
- SO_NOTIFYCONFLICT = 0x1026
- SO_NP_EXTENSIONS = 0x1083
- SO_NREAD = 0x1020
- SO_NUMRCVPKT = 0x1112
- SO_NWRITE = 0x1024
- SO_OOBINLINE = 0x100
- SO_PEERLABEL = 0x1011
- SO_RANDOMPORT = 0x1082
- SO_RCVBUF = 0x1002
- SO_RCVLOWAT = 0x1004
- SO_RCVTIMEO = 0x1006
- SO_REUSEADDR = 0x4
- SO_REUSEPORT = 0x200
- SO_REUSESHAREUID = 0x1025
- SO_SNDBUF = 0x1001
- SO_SNDLOWAT = 0x1003
- SO_SNDTIMEO = 0x1005
- SO_TIMESTAMP = 0x400
- SO_TIMESTAMP_MONOTONIC = 0x800
- SO_TYPE = 0x1008
- SO_UPCALLCLOSEWAIT = 0x1027
- SO_USELOOPBACK = 0x40
- SO_WANTMORE = 0x4000
- SO_WANTOOBFLAG = 0x8000
- S_IEXEC = 0x40
- S_IFBLK = 0x6000
- S_IFCHR = 0x2000
- S_IFDIR = 0x4000
- S_IFIFO = 0x1000
- S_IFLNK = 0xa000
- S_IFMT = 0xf000
- S_IFREG = 0x8000
- S_IFSOCK = 0xc000
- S_IFWHT = 0xe000
- S_IREAD = 0x100
- S_IRGRP = 0x20
- S_IROTH = 0x4
- S_IRUSR = 0x100
- S_IRWXG = 0x38
- S_IRWXO = 0x7
- S_IRWXU = 0x1c0
- S_ISGID = 0x400
- S_ISTXT = 0x200
- S_ISUID = 0x800
- S_ISVTX = 0x200
- S_IWGRP = 0x10
- S_IWOTH = 0x2
- S_IWRITE = 0x80
- S_IWUSR = 0x80
- S_IXGRP = 0x8
- S_IXOTH = 0x1
- S_IXUSR = 0x40
- TAB0 = 0x0
- TAB1 = 0x400
- TAB2 = 0x800
- TAB3 = 0x4
- TABDLY = 0xc04
- TCIFLUSH = 0x1
- TCIOFF = 0x3
- TCIOFLUSH = 0x3
- TCION = 0x4
- TCOFLUSH = 0x2
- TCOOFF = 0x1
- TCOON = 0x2
- TCP_CONNECTIONTIMEOUT = 0x20
- TCP_CONNECTION_INFO = 0x106
- TCP_ENABLE_ECN = 0x104
- TCP_FASTOPEN = 0x105
- TCP_KEEPALIVE = 0x10
- TCP_KEEPCNT = 0x102
- TCP_KEEPINTVL = 0x101
- TCP_MAXHLEN = 0x3c
- TCP_MAXOLEN = 0x28
- TCP_MAXSEG = 0x2
- TCP_MAXWIN = 0xffff
- TCP_MAX_SACK = 0x4
- TCP_MAX_WINSHIFT = 0xe
- TCP_MINMSS = 0xd8
- TCP_MSS = 0x200
- TCP_NODELAY = 0x1
- TCP_NOOPT = 0x8
- TCP_NOPUSH = 0x4
- TCP_NOTSENT_LOWAT = 0x201
- TCP_RXT_CONNDROPTIME = 0x80
- TCP_RXT_FINDROP = 0x100
- TCP_SENDMOREACKS = 0x103
- TCSAFLUSH = 0x2
- TIOCCBRK = 0x2000747a
- TIOCCDTR = 0x20007478
- TIOCCONS = 0x80047462
- TIOCDCDTIMESTAMP = 0x40107458
- TIOCDRAIN = 0x2000745e
- TIOCDSIMICROCODE = 0x20007455
- TIOCEXCL = 0x2000740d
- TIOCEXT = 0x80047460
- TIOCFLUSH = 0x80047410
- TIOCGDRAINWAIT = 0x40047456
- TIOCGETA = 0x40487413
- TIOCGETD = 0x4004741a
- TIOCGPGRP = 0x40047477
- TIOCGWINSZ = 0x40087468
- TIOCIXOFF = 0x20007480
- TIOCIXON = 0x20007481
- TIOCMBIC = 0x8004746b
- TIOCMBIS = 0x8004746c
- TIOCMGDTRWAIT = 0x4004745a
- TIOCMGET = 0x4004746a
- TIOCMODG = 0x40047403
- TIOCMODS = 0x80047404
- TIOCMSDTRWAIT = 0x8004745b
- TIOCMSET = 0x8004746d
- TIOCM_CAR = 0x40
- TIOCM_CD = 0x40
- TIOCM_CTS = 0x20
- TIOCM_DSR = 0x100
- TIOCM_DTR = 0x2
- TIOCM_LE = 0x1
- TIOCM_RI = 0x80
- TIOCM_RNG = 0x80
- TIOCM_RTS = 0x4
- TIOCM_SR = 0x10
- TIOCM_ST = 0x8
- TIOCNOTTY = 0x20007471
- TIOCNXCL = 0x2000740e
- TIOCOUTQ = 0x40047473
- TIOCPKT = 0x80047470
- TIOCPKT_DATA = 0x0
- TIOCPKT_DOSTOP = 0x20
- TIOCPKT_FLUSHREAD = 0x1
- TIOCPKT_FLUSHWRITE = 0x2
- TIOCPKT_IOCTL = 0x40
- TIOCPKT_NOSTOP = 0x10
- TIOCPKT_START = 0x8
- TIOCPKT_STOP = 0x4
- TIOCPTYGNAME = 0x40807453
- TIOCPTYGRANT = 0x20007454
- TIOCPTYUNLK = 0x20007452
- TIOCREMOTE = 0x80047469
- TIOCSBRK = 0x2000747b
- TIOCSCONS = 0x20007463
- TIOCSCTTY = 0x20007461
- TIOCSDRAINWAIT = 0x80047457
- TIOCSDTR = 0x20007479
- TIOCSETA = 0x80487414
- TIOCSETAF = 0x80487416
- TIOCSETAW = 0x80487415
- TIOCSETD = 0x8004741b
- TIOCSIG = 0x2000745f
- TIOCSPGRP = 0x80047476
- TIOCSTART = 0x2000746e
- TIOCSTAT = 0x20007465
- TIOCSTI = 0x80017472
- TIOCSTOP = 0x2000746f
- TIOCSWINSZ = 0x80087467
- TIOCTIMESTAMP = 0x40107459
- TIOCUCNTL = 0x80047466
- TOSTOP = 0x400000
- VDISCARD = 0xf
- VDSUSP = 0xb
- VEOF = 0x0
- VEOL = 0x1
- VEOL2 = 0x2
- VERASE = 0x3
- VINTR = 0x8
- VKILL = 0x5
- VLNEXT = 0xe
- VMIN = 0x10
- VM_LOADAVG = 0x2
- VM_MACHFACTOR = 0x4
- VM_MAXID = 0x6
- VM_METER = 0x1
- VM_SWAPUSAGE = 0x5
- VQUIT = 0x9
- VREPRINT = 0x6
- VSTART = 0xc
- VSTATUS = 0x12
- VSTOP = 0xd
- VSUSP = 0xa
- VT0 = 0x0
- VT1 = 0x10000
- VTDLY = 0x10000
- VTIME = 0x11
- VWERASE = 0x4
- WCONTINUED = 0x10
- WCOREFLAG = 0x80
- WEXITED = 0x4
- WNOHANG = 0x1
- WNOWAIT = 0x20
- WORDSIZE = 0x40
- WSTOPPED = 0x8
- WUNTRACED = 0x2
- XATTR_CREATE = 0x2
- XATTR_NODEFAULT = 0x10
- XATTR_NOFOLLOW = 0x1
- XATTR_NOSECURITY = 0x8
- XATTR_REPLACE = 0x4
- XATTR_SHOWCOMPRESSION = 0x20
-)
-
-// Errors
-const (
- E2BIG = syscall.Errno(0x7)
- EACCES = syscall.Errno(0xd)
- EADDRINUSE = syscall.Errno(0x30)
- EADDRNOTAVAIL = syscall.Errno(0x31)
- EAFNOSUPPORT = syscall.Errno(0x2f)
- EAGAIN = syscall.Errno(0x23)
- EALREADY = syscall.Errno(0x25)
- EAUTH = syscall.Errno(0x50)
- EBADARCH = syscall.Errno(0x56)
- EBADEXEC = syscall.Errno(0x55)
- EBADF = syscall.Errno(0x9)
- EBADMACHO = syscall.Errno(0x58)
- EBADMSG = syscall.Errno(0x5e)
- EBADRPC = syscall.Errno(0x48)
- EBUSY = syscall.Errno(0x10)
- ECANCELED = syscall.Errno(0x59)
- ECHILD = syscall.Errno(0xa)
- ECONNABORTED = syscall.Errno(0x35)
- ECONNREFUSED = syscall.Errno(0x3d)
- ECONNRESET = syscall.Errno(0x36)
- EDEADLK = syscall.Errno(0xb)
- EDESTADDRREQ = syscall.Errno(0x27)
- EDEVERR = syscall.Errno(0x53)
- EDOM = syscall.Errno(0x21)
- EDQUOT = syscall.Errno(0x45)
- EEXIST = syscall.Errno(0x11)
- EFAULT = syscall.Errno(0xe)
- EFBIG = syscall.Errno(0x1b)
- EFTYPE = syscall.Errno(0x4f)
- EHOSTDOWN = syscall.Errno(0x40)
- EHOSTUNREACH = syscall.Errno(0x41)
- EIDRM = syscall.Errno(0x5a)
- EILSEQ = syscall.Errno(0x5c)
- EINPROGRESS = syscall.Errno(0x24)
- EINTR = syscall.Errno(0x4)
- EINVAL = syscall.Errno(0x16)
- EIO = syscall.Errno(0x5)
- EISCONN = syscall.Errno(0x38)
- EISDIR = syscall.Errno(0x15)
- ELAST = syscall.Errno(0x6a)
- ELOOP = syscall.Errno(0x3e)
- EMFILE = syscall.Errno(0x18)
- EMLINK = syscall.Errno(0x1f)
- EMSGSIZE = syscall.Errno(0x28)
- EMULTIHOP = syscall.Errno(0x5f)
- ENAMETOOLONG = syscall.Errno(0x3f)
- ENEEDAUTH = syscall.Errno(0x51)
- ENETDOWN = syscall.Errno(0x32)
- ENETRESET = syscall.Errno(0x34)
- ENETUNREACH = syscall.Errno(0x33)
- ENFILE = syscall.Errno(0x17)
- ENOATTR = syscall.Errno(0x5d)
- ENOBUFS = syscall.Errno(0x37)
- ENODATA = syscall.Errno(0x60)
- ENODEV = syscall.Errno(0x13)
- ENOENT = syscall.Errno(0x2)
- ENOEXEC = syscall.Errno(0x8)
- ENOLCK = syscall.Errno(0x4d)
- ENOLINK = syscall.Errno(0x61)
- ENOMEM = syscall.Errno(0xc)
- ENOMSG = syscall.Errno(0x5b)
- ENOPOLICY = syscall.Errno(0x67)
- ENOPROTOOPT = syscall.Errno(0x2a)
- ENOSPC = syscall.Errno(0x1c)
- ENOSR = syscall.Errno(0x62)
- ENOSTR = syscall.Errno(0x63)
- ENOSYS = syscall.Errno(0x4e)
- ENOTBLK = syscall.Errno(0xf)
- ENOTCONN = syscall.Errno(0x39)
- ENOTDIR = syscall.Errno(0x14)
- ENOTEMPTY = syscall.Errno(0x42)
- ENOTRECOVERABLE = syscall.Errno(0x68)
- ENOTSOCK = syscall.Errno(0x26)
- ENOTSUP = syscall.Errno(0x2d)
- ENOTTY = syscall.Errno(0x19)
- ENXIO = syscall.Errno(0x6)
- EOPNOTSUPP = syscall.Errno(0x66)
- EOVERFLOW = syscall.Errno(0x54)
- EOWNERDEAD = syscall.Errno(0x69)
- EPERM = syscall.Errno(0x1)
- EPFNOSUPPORT = syscall.Errno(0x2e)
- EPIPE = syscall.Errno(0x20)
- EPROCLIM = syscall.Errno(0x43)
- EPROCUNAVAIL = syscall.Errno(0x4c)
- EPROGMISMATCH = syscall.Errno(0x4b)
- EPROGUNAVAIL = syscall.Errno(0x4a)
- EPROTO = syscall.Errno(0x64)
- EPROTONOSUPPORT = syscall.Errno(0x2b)
- EPROTOTYPE = syscall.Errno(0x29)
- EPWROFF = syscall.Errno(0x52)
- EQFULL = syscall.Errno(0x6a)
- ERANGE = syscall.Errno(0x22)
- EREMOTE = syscall.Errno(0x47)
- EROFS = syscall.Errno(0x1e)
- ERPCMISMATCH = syscall.Errno(0x49)
- ESHLIBVERS = syscall.Errno(0x57)
- ESHUTDOWN = syscall.Errno(0x3a)
- ESOCKTNOSUPPORT = syscall.Errno(0x2c)
- ESPIPE = syscall.Errno(0x1d)
- ESRCH = syscall.Errno(0x3)
- ESTALE = syscall.Errno(0x46)
- ETIME = syscall.Errno(0x65)
- ETIMEDOUT = syscall.Errno(0x3c)
- ETOOMANYREFS = syscall.Errno(0x3b)
- ETXTBSY = syscall.Errno(0x1a)
- EUSERS = syscall.Errno(0x44)
- EWOULDBLOCK = syscall.Errno(0x23)
- EXDEV = syscall.Errno(0x12)
-)
-
-// Signals
-const (
- SIGABRT = syscall.Signal(0x6)
- SIGALRM = syscall.Signal(0xe)
- SIGBUS = syscall.Signal(0xa)
- SIGCHLD = syscall.Signal(0x14)
- SIGCONT = syscall.Signal(0x13)
- SIGEMT = syscall.Signal(0x7)
- SIGFPE = syscall.Signal(0x8)
- SIGHUP = syscall.Signal(0x1)
- SIGILL = syscall.Signal(0x4)
- SIGINFO = syscall.Signal(0x1d)
- SIGINT = syscall.Signal(0x2)
- SIGIO = syscall.Signal(0x17)
- SIGIOT = syscall.Signal(0x6)
- SIGKILL = syscall.Signal(0x9)
- SIGPIPE = syscall.Signal(0xd)
- SIGPROF = syscall.Signal(0x1b)
- SIGQUIT = syscall.Signal(0x3)
- SIGSEGV = syscall.Signal(0xb)
- SIGSTOP = syscall.Signal(0x11)
- SIGSYS = syscall.Signal(0xc)
- SIGTERM = syscall.Signal(0xf)
- SIGTRAP = syscall.Signal(0x5)
- SIGTSTP = syscall.Signal(0x12)
- SIGTTIN = syscall.Signal(0x15)
- SIGTTOU = syscall.Signal(0x16)
- SIGURG = syscall.Signal(0x10)
- SIGUSR1 = syscall.Signal(0x1e)
- SIGUSR2 = syscall.Signal(0x1f)
- SIGVTALRM = syscall.Signal(0x1a)
- SIGWINCH = syscall.Signal(0x1c)
- SIGXCPU = syscall.Signal(0x18)
- SIGXFSZ = syscall.Signal(0x19)
-)
-
-// Error table
-var errorList = [...]struct {
- num syscall.Errno
- name string
- desc string
-}{
- {1, "EPERM", "operation not permitted"},
- {2, "ENOENT", "no such file or directory"},
- {3, "ESRCH", "no such process"},
- {4, "EINTR", "interrupted system call"},
- {5, "EIO", "input/output error"},
- {6, "ENXIO", "device not configured"},
- {7, "E2BIG", "argument list too long"},
- {8, "ENOEXEC", "exec format error"},
- {9, "EBADF", "bad file descriptor"},
- {10, "ECHILD", "no child processes"},
- {11, "EDEADLK", "resource deadlock avoided"},
- {12, "ENOMEM", "cannot allocate memory"},
- {13, "EACCES", "permission denied"},
- {14, "EFAULT", "bad address"},
- {15, "ENOTBLK", "block device required"},
- {16, "EBUSY", "resource busy"},
- {17, "EEXIST", "file exists"},
- {18, "EXDEV", "cross-device link"},
- {19, "ENODEV", "operation not supported by device"},
- {20, "ENOTDIR", "not a directory"},
- {21, "EISDIR", "is a directory"},
- {22, "EINVAL", "invalid argument"},
- {23, "ENFILE", "too many open files in system"},
- {24, "EMFILE", "too many open files"},
- {25, "ENOTTY", "inappropriate ioctl for device"},
- {26, "ETXTBSY", "text file busy"},
- {27, "EFBIG", "file too large"},
- {28, "ENOSPC", "no space left on device"},
- {29, "ESPIPE", "illegal seek"},
- {30, "EROFS", "read-only file system"},
- {31, "EMLINK", "too many links"},
- {32, "EPIPE", "broken pipe"},
- {33, "EDOM", "numerical argument out of domain"},
- {34, "ERANGE", "result too large"},
- {35, "EAGAIN", "resource temporarily unavailable"},
- {36, "EINPROGRESS", "operation now in progress"},
- {37, "EALREADY", "operation already in progress"},
- {38, "ENOTSOCK", "socket operation on non-socket"},
- {39, "EDESTADDRREQ", "destination address required"},
- {40, "EMSGSIZE", "message too long"},
- {41, "EPROTOTYPE", "protocol wrong type for socket"},
- {42, "ENOPROTOOPT", "protocol not available"},
- {43, "EPROTONOSUPPORT", "protocol not supported"},
- {44, "ESOCKTNOSUPPORT", "socket type not supported"},
- {45, "ENOTSUP", "operation not supported"},
- {46, "EPFNOSUPPORT", "protocol family not supported"},
- {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
- {48, "EADDRINUSE", "address already in use"},
- {49, "EADDRNOTAVAIL", "can't assign requested address"},
- {50, "ENETDOWN", "network is down"},
- {51, "ENETUNREACH", "network is unreachable"},
- {52, "ENETRESET", "network dropped connection on reset"},
- {53, "ECONNABORTED", "software caused connection abort"},
- {54, "ECONNRESET", "connection reset by peer"},
- {55, "ENOBUFS", "no buffer space available"},
- {56, "EISCONN", "socket is already connected"},
- {57, "ENOTCONN", "socket is not connected"},
- {58, "ESHUTDOWN", "can't send after socket shutdown"},
- {59, "ETOOMANYREFS", "too many references: can't splice"},
- {60, "ETIMEDOUT", "operation timed out"},
- {61, "ECONNREFUSED", "connection refused"},
- {62, "ELOOP", "too many levels of symbolic links"},
- {63, "ENAMETOOLONG", "file name too long"},
- {64, "EHOSTDOWN", "host is down"},
- {65, "EHOSTUNREACH", "no route to host"},
- {66, "ENOTEMPTY", "directory not empty"},
- {67, "EPROCLIM", "too many processes"},
- {68, "EUSERS", "too many users"},
- {69, "EDQUOT", "disc quota exceeded"},
- {70, "ESTALE", "stale NFS file handle"},
- {71, "EREMOTE", "too many levels of remote in path"},
- {72, "EBADRPC", "RPC struct is bad"},
- {73, "ERPCMISMATCH", "RPC version wrong"},
- {74, "EPROGUNAVAIL", "RPC prog. not avail"},
- {75, "EPROGMISMATCH", "program version wrong"},
- {76, "EPROCUNAVAIL", "bad procedure for program"},
- {77, "ENOLCK", "no locks available"},
- {78, "ENOSYS", "function not implemented"},
- {79, "EFTYPE", "inappropriate file type or format"},
- {80, "EAUTH", "authentication error"},
- {81, "ENEEDAUTH", "need authenticator"},
- {82, "EPWROFF", "device power is off"},
- {83, "EDEVERR", "device error"},
- {84, "EOVERFLOW", "value too large to be stored in data type"},
- {85, "EBADEXEC", "bad executable (or shared library)"},
- {86, "EBADARCH", "bad CPU type in executable"},
- {87, "ESHLIBVERS", "shared library version mismatch"},
- {88, "EBADMACHO", "malformed Mach-o file"},
- {89, "ECANCELED", "operation canceled"},
- {90, "EIDRM", "identifier removed"},
- {91, "ENOMSG", "no message of desired type"},
- {92, "EILSEQ", "illegal byte sequence"},
- {93, "ENOATTR", "attribute not found"},
- {94, "EBADMSG", "bad message"},
- {95, "EMULTIHOP", "EMULTIHOP (Reserved)"},
- {96, "ENODATA", "no message available on STREAM"},
- {97, "ENOLINK", "ENOLINK (Reserved)"},
- {98, "ENOSR", "no STREAM resources"},
- {99, "ENOSTR", "not a STREAM"},
- {100, "EPROTO", "protocol error"},
- {101, "ETIME", "STREAM ioctl timeout"},
- {102, "EOPNOTSUPP", "operation not supported on socket"},
- {103, "ENOPOLICY", "policy not found"},
- {104, "ENOTRECOVERABLE", "state not recoverable"},
- {105, "EOWNERDEAD", "previous owner died"},
- {106, "EQFULL", "interface output queue is full"},
-}
-
-// Signal table
-var signalList = [...]struct {
- num syscall.Signal
- name string
- desc string
-}{
- {1, "SIGHUP", "hangup"},
- {2, "SIGINT", "interrupt"},
- {3, "SIGQUIT", "quit"},
- {4, "SIGILL", "illegal instruction"},
- {5, "SIGTRAP", "trace/BPT trap"},
- {6, "SIGABRT", "abort trap"},
- {7, "SIGEMT", "EMT trap"},
- {8, "SIGFPE", "floating point exception"},
- {9, "SIGKILL", "killed"},
- {10, "SIGBUS", "bus error"},
- {11, "SIGSEGV", "segmentation fault"},
- {12, "SIGSYS", "bad system call"},
- {13, "SIGPIPE", "broken pipe"},
- {14, "SIGALRM", "alarm clock"},
- {15, "SIGTERM", "terminated"},
- {16, "SIGURG", "urgent I/O condition"},
- {17, "SIGSTOP", "suspended (signal)"},
- {18, "SIGTSTP", "suspended"},
- {19, "SIGCONT", "continued"},
- {20, "SIGCHLD", "child exited"},
- {21, "SIGTTIN", "stopped (tty input)"},
- {22, "SIGTTOU", "stopped (tty output)"},
- {23, "SIGIO", "I/O possible"},
- {24, "SIGXCPU", "cputime limit exceeded"},
- {25, "SIGXFSZ", "filesize limit exceeded"},
- {26, "SIGVTALRM", "virtual timer expired"},
- {27, "SIGPROF", "profiling timer expired"},
- {28, "SIGWINCH", "window size changes"},
- {29, "SIGINFO", "information request"},
- {30, "SIGUSR1", "user defined signal 1"},
- {31, "SIGUSR2", "user defined signal 2"},
-}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
index e644eaf5e..31009d7f0 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
@@ -1206,6 +1206,7 @@ const (
RTF_DONE = 0x40
RTF_DYNAMIC = 0x10
RTF_GATEWAY = 0x2
+ RTF_GLOBAL = 0x40000000
RTF_HOST = 0x4
RTF_IFREF = 0x4000000
RTF_IFSCOPE = 0x1000000
@@ -1262,6 +1263,11 @@ const (
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
SCM_TIMESTAMP_MONOTONIC = 0x4
+ SEEK_CUR = 0x1
+ SEEK_DATA = 0x4
+ SEEK_END = 0x2
+ SEEK_HOLE = 0x3
+ SEEK_SET = 0x0
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go
index 9c7c5e165..440900112 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go
@@ -1297,6 +1297,11 @@ const (
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
SCM_TIME_INFO = 0x7
+ SEEK_CUR = 0x1
+ SEEK_DATA = 0x3
+ SEEK_END = 0x2
+ SEEK_HOLE = 0x4
+ SEEK_SET = 0x0
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go
index b265abb25..64520d312 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go
@@ -1298,6 +1298,11 @@ const (
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
SCM_TIME_INFO = 0x7
+ SEEK_CUR = 0x1
+ SEEK_DATA = 0x3
+ SEEK_END = 0x2
+ SEEK_HOLE = 0x4
+ SEEK_SET = 0x0
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go
index 3df99f285..99e9a0e06 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go
@@ -1276,6 +1276,11 @@ const (
SCM_CREDS = 0x3
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
+ SEEK_CUR = 0x1
+ SEEK_DATA = 0x3
+ SEEK_END = 0x2
+ SEEK_HOLE = 0x4
+ SEEK_SET = 0x0
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go
index 218d39906..4c8377114 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go
@@ -1298,6 +1298,11 @@ const (
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
SCM_TIME_INFO = 0x7
+ SEEK_CUR = 0x1
+ SEEK_DATA = 0x3
+ SEEK_END = 0x2
+ SEEK_HOLE = 0x4
+ SEEK_SET = 0x0
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go
index 35de419c6..b959fe195 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go
@@ -166,13 +166,16 @@ const (
BPF_ALU64 = 0x7
BPF_AND = 0x50
BPF_ARSH = 0xc0
+ BPF_ATOMIC = 0xc0
BPF_B = 0x10
BPF_BUILD_ID_SIZE = 0x14
BPF_CALL = 0x80
+ BPF_CMPXCHG = 0xf1
BPF_DIV = 0x30
BPF_DW = 0x18
BPF_END = 0xd0
BPF_EXIT = 0x90
+ BPF_FETCH = 0x1
BPF_FROM_BE = 0x8
BPF_FROM_LE = 0x0
BPF_FS_MAGIC = 0xcafe4a11
@@ -225,7 +228,11 @@ const (
BPF_OR = 0x40
BPF_PSEUDO_BTF_ID = 0x3
BPF_PSEUDO_CALL = 0x1
+ BPF_PSEUDO_FUNC = 0x4
+ BPF_PSEUDO_KFUNC_CALL = 0x2
BPF_PSEUDO_MAP_FD = 0x1
+ BPF_PSEUDO_MAP_IDX = 0x5
+ BPF_PSEUDO_MAP_IDX_VALUE = 0x6
BPF_PSEUDO_MAP_VALUE = 0x2
BPF_RET = 0x6
BPF_RSH = 0x70
@@ -240,6 +247,7 @@ const (
BPF_W = 0x0
BPF_X = 0x8
BPF_XADD = 0xc0
+ BPF_XCHG = 0xe1
BPF_XOR = 0xa0
BRKINT = 0x2
BS0 = 0x0
@@ -471,6 +479,8 @@ const (
DM_LIST_VERSIONS = 0xc138fd0d
DM_MAX_TYPE_NAME = 0x10
DM_NAME_LEN = 0x80
+ DM_NAME_LIST_FLAG_DOESNT_HAVE_UUID = 0x2
+ DM_NAME_LIST_FLAG_HAS_UUID = 0x1
DM_NOFLUSH_FLAG = 0x800
DM_PERSISTENT_DEV_FLAG = 0x8
DM_QUERY_INACTIVE_TABLE_FLAG = 0x1000
@@ -490,9 +500,9 @@ const (
DM_UUID_FLAG = 0x4000
DM_UUID_LEN = 0x81
DM_VERSION = 0xc138fd00
- DM_VERSION_EXTRA = "-ioctl (2020-10-01)"
+ DM_VERSION_EXTRA = "-ioctl (2021-03-22)"
DM_VERSION_MAJOR = 0x4
- DM_VERSION_MINOR = 0x2b
+ DM_VERSION_MINOR = 0x2d
DM_VERSION_PATCHLEVEL = 0x0
DT_BLK = 0x6
DT_CHR = 0x2
@@ -860,6 +870,7 @@ const (
FS_IOC_GET_ENCRYPTION_KEY_STATUS = 0xc080661a
FS_IOC_GET_ENCRYPTION_POLICY_EX = 0xc0096616
FS_IOC_MEASURE_VERITY = 0xc0046686
+ FS_IOC_READ_VERITY_METADATA = 0xc0286687
FS_IOC_REMOVE_ENCRYPTION_KEY = 0xc0406618
FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS = 0xc0406619
FS_KEY_DESCRIPTOR_SIZE = 0x8
@@ -875,6 +886,9 @@ const (
FS_VERITY_FL = 0x100000
FS_VERITY_HASH_ALG_SHA256 = 0x1
FS_VERITY_HASH_ALG_SHA512 = 0x2
+ FS_VERITY_METADATA_TYPE_DESCRIPTOR = 0x2
+ FS_VERITY_METADATA_TYPE_MERKLE_TREE = 0x1
+ FS_VERITY_METADATA_TYPE_SIGNATURE = 0x3
FUTEXFS_SUPER_MAGIC = 0xbad1dea
F_ADD_SEALS = 0x409
F_DUPFD = 0x0
@@ -973,12 +987,6 @@ const (
HPFS_SUPER_MAGIC = 0xf995e849
HUGETLBFS_MAGIC = 0x958458f6
IBSHIFT = 0x10
- ICMPV6_FILTER = 0x1
- ICMPV6_FILTER_BLOCK = 0x1
- ICMPV6_FILTER_BLOCKOTHERS = 0x3
- ICMPV6_FILTER_PASS = 0x2
- ICMPV6_FILTER_PASSONLY = 0x4
- ICMP_FILTER = 0x1
ICRNL = 0x100
IFA_F_DADFAILED = 0x8
IFA_F_DEPRECATED = 0x20
@@ -1249,6 +1257,7 @@ const (
KEXEC_ARCH_PARISC = 0xf0000
KEXEC_ARCH_PPC = 0x140000
KEXEC_ARCH_PPC64 = 0x150000
+ KEXEC_ARCH_RISCV = 0xf30000
KEXEC_ARCH_S390 = 0x160000
KEXEC_ARCH_SH = 0x2a0000
KEXEC_ARCH_X86_64 = 0x3e0000
@@ -1324,6 +1333,20 @@ const (
KEY_SPEC_THREAD_KEYRING = -0x1
KEY_SPEC_USER_KEYRING = -0x4
KEY_SPEC_USER_SESSION_KEYRING = -0x5
+ LANDLOCK_ACCESS_FS_EXECUTE = 0x1
+ LANDLOCK_ACCESS_FS_MAKE_BLOCK = 0x800
+ LANDLOCK_ACCESS_FS_MAKE_CHAR = 0x40
+ LANDLOCK_ACCESS_FS_MAKE_DIR = 0x80
+ LANDLOCK_ACCESS_FS_MAKE_FIFO = 0x400
+ LANDLOCK_ACCESS_FS_MAKE_REG = 0x100
+ LANDLOCK_ACCESS_FS_MAKE_SOCK = 0x200
+ LANDLOCK_ACCESS_FS_MAKE_SYM = 0x1000
+ LANDLOCK_ACCESS_FS_READ_DIR = 0x8
+ LANDLOCK_ACCESS_FS_READ_FILE = 0x4
+ LANDLOCK_ACCESS_FS_REMOVE_DIR = 0x10
+ LANDLOCK_ACCESS_FS_REMOVE_FILE = 0x20
+ LANDLOCK_ACCESS_FS_WRITE_FILE = 0x2
+ LANDLOCK_CREATE_RULESET_VERSION = 0x1
LINUX_REBOOT_CMD_CAD_OFF = 0x0
LINUX_REBOOT_CMD_CAD_ON = 0x89abcdef
LINUX_REBOOT_CMD_HALT = 0xcdef0123
@@ -1398,6 +1421,10 @@ const (
MCAST_LEAVE_SOURCE_GROUP = 0x2f
MCAST_MSFILTER = 0x30
MCAST_UNBLOCK_SOURCE = 0x2c
+ MEMGETREGIONINFO = 0xc0104d08
+ MEMREADOOB64 = 0xc0184d16
+ MEMWRITE = 0xc0304d18
+ MEMWRITEOOB64 = 0xc0184d15
MFD_ALLOW_SEALING = 0x2
MFD_CLOEXEC = 0x1
MFD_HUGETLB = 0x4
@@ -1486,7 +1513,35 @@ const (
MS_SYNCHRONOUS = 0x10
MS_UNBINDABLE = 0x20000
MS_VERBOSE = 0x8000
+ MTD_ABSENT = 0x0
+ MTD_BIT_WRITEABLE = 0x800
+ MTD_CAP_NANDFLASH = 0x400
+ MTD_CAP_NORFLASH = 0xc00
+ MTD_CAP_NVRAM = 0x1c00
+ MTD_CAP_RAM = 0x1c00
+ MTD_CAP_ROM = 0x0
+ MTD_DATAFLASH = 0x6
MTD_INODE_FS_MAGIC = 0x11307854
+ MTD_MAX_ECCPOS_ENTRIES = 0x40
+ MTD_MAX_OOBFREE_ENTRIES = 0x8
+ MTD_MLCNANDFLASH = 0x8
+ MTD_NANDECC_AUTOPLACE = 0x2
+ MTD_NANDECC_AUTOPL_USR = 0x4
+ MTD_NANDECC_OFF = 0x0
+ MTD_NANDECC_PLACE = 0x1
+ MTD_NANDECC_PLACEONLY = 0x3
+ MTD_NANDFLASH = 0x4
+ MTD_NORFLASH = 0x3
+ MTD_NO_ERASE = 0x1000
+ MTD_OTP_FACTORY = 0x1
+ MTD_OTP_OFF = 0x0
+ MTD_OTP_USER = 0x2
+ MTD_POWERUP_LOCK = 0x2000
+ MTD_RAM = 0x1
+ MTD_ROM = 0x2
+ MTD_SLC_ON_MLC_EMULATION = 0x4000
+ MTD_UBIVOLUME = 0x7
+ MTD_WRITEABLE = 0x400
NAME_MAX = 0xff
NCP_SUPER_MAGIC = 0x564c
NETLINK_ADD_MEMBERSHIP = 0x1
@@ -1526,6 +1581,59 @@ const (
NETLINK_XFRM = 0x6
NETNSA_MAX = 0x5
NETNSA_NSID_NOT_ASSIGNED = -0x1
+ NFC_ATR_REQ_GB_MAXSIZE = 0x30
+ NFC_ATR_REQ_MAXSIZE = 0x40
+ NFC_ATR_RES_GB_MAXSIZE = 0x2f
+ NFC_ATR_RES_MAXSIZE = 0x40
+ NFC_COMM_ACTIVE = 0x0
+ NFC_COMM_PASSIVE = 0x1
+ NFC_DEVICE_NAME_MAXSIZE = 0x8
+ NFC_DIRECTION_RX = 0x0
+ NFC_DIRECTION_TX = 0x1
+ NFC_FIRMWARE_NAME_MAXSIZE = 0x20
+ NFC_GB_MAXSIZE = 0x30
+ NFC_GENL_MCAST_EVENT_NAME = "events"
+ NFC_GENL_NAME = "nfc"
+ NFC_GENL_VERSION = 0x1
+ NFC_HEADER_SIZE = 0x1
+ NFC_ISO15693_UID_MAXSIZE = 0x8
+ NFC_LLCP_MAX_SERVICE_NAME = 0x3f
+ NFC_LLCP_MIUX = 0x1
+ NFC_LLCP_REMOTE_LTO = 0x3
+ NFC_LLCP_REMOTE_MIU = 0x2
+ NFC_LLCP_REMOTE_RW = 0x4
+ NFC_LLCP_RW = 0x0
+ NFC_NFCID1_MAXSIZE = 0xa
+ NFC_NFCID2_MAXSIZE = 0x8
+ NFC_NFCID3_MAXSIZE = 0xa
+ NFC_PROTO_FELICA = 0x3
+ NFC_PROTO_FELICA_MASK = 0x8
+ NFC_PROTO_ISO14443 = 0x4
+ NFC_PROTO_ISO14443_B = 0x6
+ NFC_PROTO_ISO14443_B_MASK = 0x40
+ NFC_PROTO_ISO14443_MASK = 0x10
+ NFC_PROTO_ISO15693 = 0x7
+ NFC_PROTO_ISO15693_MASK = 0x80
+ NFC_PROTO_JEWEL = 0x1
+ NFC_PROTO_JEWEL_MASK = 0x2
+ NFC_PROTO_MAX = 0x8
+ NFC_PROTO_MIFARE = 0x2
+ NFC_PROTO_MIFARE_MASK = 0x4
+ NFC_PROTO_NFC_DEP = 0x5
+ NFC_PROTO_NFC_DEP_MASK = 0x20
+ NFC_RAW_HEADER_SIZE = 0x2
+ NFC_RF_INITIATOR = 0x0
+ NFC_RF_NONE = 0x2
+ NFC_RF_TARGET = 0x1
+ NFC_SENSB_RES_MAXSIZE = 0xc
+ NFC_SENSF_RES_MAXSIZE = 0x12
+ NFC_SE_DISABLED = 0x0
+ NFC_SE_EMBEDDED = 0x2
+ NFC_SE_ENABLED = 0x1
+ NFC_SE_UICC = 0x1
+ NFC_SOCKPROTO_LLCP = 0x1
+ NFC_SOCKPROTO_MAX = 0x2
+ NFC_SOCKPROTO_RAW = 0x0
NFNETLINK_V0 = 0x0
NFNLGRP_ACCT_QUOTA = 0x8
NFNLGRP_CONNTRACK_DESTROY = 0x3
@@ -1543,11 +1651,12 @@ const (
NFNL_MSG_BATCH_END = 0x11
NFNL_NFA_NEST = 0x8000
NFNL_SUBSYS_ACCT = 0x7
- NFNL_SUBSYS_COUNT = 0xc
+ NFNL_SUBSYS_COUNT = 0xd
NFNL_SUBSYS_CTHELPER = 0x9
NFNL_SUBSYS_CTNETLINK = 0x1
NFNL_SUBSYS_CTNETLINK_EXP = 0x2
NFNL_SUBSYS_CTNETLINK_TIMEOUT = 0x8
+ NFNL_SUBSYS_HOOK = 0xc
NFNL_SUBSYS_IPSET = 0x6
NFNL_SUBSYS_NFTABLES = 0xa
NFNL_SUBSYS_NFT_COMPAT = 0xb
@@ -1663,16 +1772,25 @@ const (
PERF_ATTR_SIZE_VER4 = 0x68
PERF_ATTR_SIZE_VER5 = 0x70
PERF_ATTR_SIZE_VER6 = 0x78
+ PERF_ATTR_SIZE_VER7 = 0x80
PERF_AUX_FLAG_COLLISION = 0x8
+ PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT = 0x0
+ PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW = 0x100
PERF_AUX_FLAG_OVERWRITE = 0x2
PERF_AUX_FLAG_PARTIAL = 0x4
+ PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK = 0xff00
PERF_AUX_FLAG_TRUNCATED = 0x1
PERF_FLAG_FD_CLOEXEC = 0x8
PERF_FLAG_FD_NO_GROUP = 0x1
PERF_FLAG_FD_OUTPUT = 0x2
PERF_FLAG_PID_CGROUP = 0x4
+ PERF_HW_EVENT_MASK = 0xffffffff
PERF_MAX_CONTEXTS_PER_STACK = 0x8
PERF_MAX_STACK_DEPTH = 0x7f
+ PERF_MEM_BLK_ADDR = 0x4
+ PERF_MEM_BLK_DATA = 0x2
+ PERF_MEM_BLK_NA = 0x1
+ PERF_MEM_BLK_SHIFT = 0x28
PERF_MEM_LOCK_LOCKED = 0x2
PERF_MEM_LOCK_NA = 0x1
PERF_MEM_LOCK_SHIFT = 0x18
@@ -1725,6 +1843,7 @@ const (
PERF_MEM_TLB_OS = 0x40
PERF_MEM_TLB_SHIFT = 0x1a
PERF_MEM_TLB_WK = 0x20
+ PERF_PMU_TYPE_SHIFT = 0x20
PERF_RECORD_KSYMBOL_FLAGS_UNREGISTER = 0x1
PERF_RECORD_MISC_COMM_EXEC = 0x2000
PERF_RECORD_MISC_CPUMODE_MASK = 0x7
@@ -1736,12 +1855,14 @@ const (
PERF_RECORD_MISC_GUEST_USER = 0x5
PERF_RECORD_MISC_HYPERVISOR = 0x3
PERF_RECORD_MISC_KERNEL = 0x1
+ PERF_RECORD_MISC_MMAP_BUILD_ID = 0x4000
PERF_RECORD_MISC_MMAP_DATA = 0x2000
PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT = 0x1000
PERF_RECORD_MISC_SWITCH_OUT = 0x2000
PERF_RECORD_MISC_SWITCH_OUT_PREEMPT = 0x4000
PERF_RECORD_MISC_USER = 0x2
PERF_SAMPLE_BRANCH_PLM_ALL = 0x7
+ PERF_SAMPLE_WEIGHT_TYPE = 0x1004000
PIPEFS_MAGIC = 0x50495045
PPC_CMM_MAGIC = 0xc7571590
PPPIOCGNPMODE = 0xc008744c
@@ -1822,7 +1943,15 @@ const (
PR_PAC_APGAKEY = 0x10
PR_PAC_APIAKEY = 0x1
PR_PAC_APIBKEY = 0x2
+ PR_PAC_GET_ENABLED_KEYS = 0x3d
PR_PAC_RESET_KEYS = 0x36
+ PR_PAC_SET_ENABLED_KEYS = 0x3c
+ PR_SCHED_CORE = 0x3e
+ PR_SCHED_CORE_CREATE = 0x1
+ PR_SCHED_CORE_GET = 0x0
+ PR_SCHED_CORE_MAX = 0x4
+ PR_SCHED_CORE_SHARE_FROM = 0x3
+ PR_SCHED_CORE_SHARE_TO = 0x2
PR_SET_CHILD_SUBREAPER = 0x24
PR_SET_DUMPABLE = 0x4
PR_SET_ENDIAN = 0x14
@@ -1904,6 +2033,7 @@ const (
PTRACE_GETREGSET = 0x4204
PTRACE_GETSIGINFO = 0x4202
PTRACE_GETSIGMASK = 0x420a
+ PTRACE_GET_RSEQ_CONFIGURATION = 0x420f
PTRACE_GET_SYSCALL_INFO = 0x420e
PTRACE_INTERRUPT = 0x4207
PTRACE_KILL = 0x8
@@ -1945,6 +2075,11 @@ const (
QNX4_SUPER_MAGIC = 0x2f
QNX6_SUPER_MAGIC = 0x68191122
RAMFS_MAGIC = 0x858458f6
+ RAW_PAYLOAD_DIGITAL = 0x3
+ RAW_PAYLOAD_HCI = 0x2
+ RAW_PAYLOAD_LLCP = 0x0
+ RAW_PAYLOAD_NCI = 0x1
+ RAW_PAYLOAD_PROPRIETARY = 0x4
RDTGROUP_SUPER_MAGIC = 0x7655821
REISERFS_SUPER_MAGIC = 0x52654973
RENAME_EXCHANGE = 0x2
@@ -1995,6 +2130,10 @@ const (
RTCF_NAT = 0x800000
RTCF_VALVE = 0x200000
RTC_AF = 0x20
+ RTC_FEATURE_ALARM = 0x0
+ RTC_FEATURE_ALARM_RES_MINUTE = 0x1
+ RTC_FEATURE_CNT = 0x3
+ RTC_FEATURE_NEED_WEEK_DAY = 0x2
RTC_IRQF = 0x80
RTC_MAX_FREQ = 0x2000
RTC_PF = 0x40
@@ -2055,6 +2194,7 @@ const (
RTM_DELNEIGH = 0x1d
RTM_DELNETCONF = 0x51
RTM_DELNEXTHOP = 0x69
+ RTM_DELNEXTHOPBUCKET = 0x75
RTM_DELNSID = 0x59
RTM_DELQDISC = 0x25
RTM_DELROUTE = 0x19
@@ -2068,6 +2208,7 @@ const (
RTM_F_LOOKUP_TABLE = 0x1000
RTM_F_NOTIFY = 0x100
RTM_F_OFFLOAD = 0x4000
+ RTM_F_OFFLOAD_FAILED = 0x20000000
RTM_F_PREFIX = 0x800
RTM_F_TRAP = 0x8000
RTM_GETACTION = 0x32
@@ -2084,6 +2225,7 @@ const (
RTM_GETNEIGHTBL = 0x42
RTM_GETNETCONF = 0x52
RTM_GETNEXTHOP = 0x6a
+ RTM_GETNEXTHOPBUCKET = 0x76
RTM_GETNSID = 0x5a
RTM_GETQDISC = 0x26
RTM_GETROUTE = 0x1a
@@ -2092,7 +2234,7 @@ const (
RTM_GETTCLASS = 0x2a
RTM_GETTFILTER = 0x2e
RTM_GETVLAN = 0x72
- RTM_MAX = 0x73
+ RTM_MAX = 0x77
RTM_NEWACTION = 0x30
RTM_NEWADDR = 0x14
RTM_NEWADDRLABEL = 0x48
@@ -2106,6 +2248,7 @@ const (
RTM_NEWNEIGHTBL = 0x40
RTM_NEWNETCONF = 0x50
RTM_NEWNEXTHOP = 0x68
+ RTM_NEWNEXTHOPBUCKET = 0x74
RTM_NEWNSID = 0x58
RTM_NEWNVLAN = 0x70
RTM_NEWPREFIX = 0x34
@@ -2115,8 +2258,8 @@ const (
RTM_NEWSTATS = 0x5c
RTM_NEWTCLASS = 0x28
RTM_NEWTFILTER = 0x2c
- RTM_NR_FAMILIES = 0x19
- RTM_NR_MSGTYPES = 0x64
+ RTM_NR_FAMILIES = 0x1a
+ RTM_NR_MSGTYPES = 0x68
RTM_SETDCB = 0x4f
RTM_SETLINK = 0x13
RTM_SETNEIGHTBL = 0x43
@@ -2144,6 +2287,7 @@ const (
RTPROT_MROUTED = 0x11
RTPROT_MRT = 0xa
RTPROT_NTK = 0xf
+ RTPROT_OPENR = 0x63
RTPROT_OSPF = 0xbc
RTPROT_RA = 0x9
RTPROT_REDIRECT = 0x1
@@ -2174,7 +2318,14 @@ const (
SECCOMP_MODE_DISABLED = 0x0
SECCOMP_MODE_FILTER = 0x2
SECCOMP_MODE_STRICT = 0x1
+ SECRETMEM_MAGIC = 0x5345434d
SECURITYFS_MAGIC = 0x73636673
+ SEEK_CUR = 0x1
+ SEEK_DATA = 0x3
+ SEEK_END = 0x2
+ SEEK_HOLE = 0x4
+ SEEK_MAX = 0x4
+ SEEK_SET = 0x0
SELINUX_MAGIC = 0xf97cff8c
SHUT_RD = 0x0
SHUT_RDWR = 0x2
@@ -2421,6 +2572,14 @@ const (
TCOFLUSH = 0x1
TCOOFF = 0x0
TCOON = 0x1
+ TCPOPT_EOL = 0x0
+ TCPOPT_MAXSEG = 0x2
+ TCPOPT_NOP = 0x1
+ TCPOPT_SACK = 0x5
+ TCPOPT_SACK_PERMITTED = 0x4
+ TCPOPT_TIMESTAMP = 0x8
+ TCPOPT_TSTAMP_HDR = 0x101080a
+ TCPOPT_WINDOW = 0x3
TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
index e91a1a957..697811a46 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
@@ -60,6 +60,8 @@ const (
CS8 = 0x30
CSIZE = 0x30
CSTOPB = 0x40
+ ECCGETLAYOUT = 0x81484d11
+ ECCGETSTATS = 0x80104d12
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
@@ -123,6 +125,19 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MEMERASE = 0x40084d02
+ MEMERASE64 = 0x40104d14
+ MEMGETBADBLOCK = 0x40084d0b
+ MEMGETINFO = 0x80204d01
+ MEMGETOOBSEL = 0x80c84d0a
+ MEMGETREGIONCOUNT = 0x80044d07
+ MEMISLOCKED = 0x80084d17
+ MEMLOCK = 0x40084d05
+ MEMREADOOB = 0xc00c4d04
+ MEMSETBADBLOCK = 0x40084d0c
+ MEMUNLOCK = 0x40084d06
+ MEMWRITEOOB = 0xc00c4d03
+ MTDFILEMODE = 0x4d13
NFDBITS = 0x20
NLDLY = 0x100
NOFLSH = 0x80
@@ -132,6 +147,11 @@ const (
NS_GET_USERNS = 0xb701
OLCUC = 0x2
ONLCR = 0x4
+ OTPERASE = 0x400c4d19
+ OTPGETREGIONCOUNT = 0x40044d0e
+ OTPGETREGIONINFO = 0x400c4d0f
+ OTPLOCK = 0x800c4d10
+ OTPSELECT = 0x80044d0d
O_APPEND = 0x400
O_ASYNC = 0x2000
O_CLOEXEC = 0x80000
@@ -289,6 +309,7 @@ const (
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
+ SO_NETNS_COOKIE = 0x47
SO_NOFCS = 0x2b
SO_OOBINLINE = 0xa
SO_PASSCRED = 0x10
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
index a9cbac644..7d8d93bfc 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
@@ -60,6 +60,8 @@ const (
CS8 = 0x30
CSIZE = 0x30
CSTOPB = 0x40
+ ECCGETLAYOUT = 0x81484d11
+ ECCGETSTATS = 0x80104d12
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
@@ -123,6 +125,19 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MEMERASE = 0x40084d02
+ MEMERASE64 = 0x40104d14
+ MEMGETBADBLOCK = 0x40084d0b
+ MEMGETINFO = 0x80204d01
+ MEMGETOOBSEL = 0x80c84d0a
+ MEMGETREGIONCOUNT = 0x80044d07
+ MEMISLOCKED = 0x80084d17
+ MEMLOCK = 0x40084d05
+ MEMREADOOB = 0xc0104d04
+ MEMSETBADBLOCK = 0x40084d0c
+ MEMUNLOCK = 0x40084d06
+ MEMWRITEOOB = 0xc0104d03
+ MTDFILEMODE = 0x4d13
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
@@ -132,6 +147,11 @@ const (
NS_GET_USERNS = 0xb701
OLCUC = 0x2
ONLCR = 0x4
+ OTPERASE = 0x400c4d19
+ OTPGETREGIONCOUNT = 0x40044d0e
+ OTPGETREGIONINFO = 0x400c4d0f
+ OTPLOCK = 0x800c4d10
+ OTPSELECT = 0x80044d0d
O_APPEND = 0x400
O_ASYNC = 0x2000
O_CLOEXEC = 0x80000
@@ -290,6 +310,7 @@ const (
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
+ SO_NETNS_COOKIE = 0x47
SO_NOFCS = 0x2b
SO_OOBINLINE = 0xa
SO_PASSCRED = 0x10
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
index d74f3c15a..f707d5089 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
@@ -60,6 +60,8 @@ const (
CS8 = 0x30
CSIZE = 0x30
CSTOPB = 0x40
+ ECCGETLAYOUT = 0x81484d11
+ ECCGETSTATS = 0x80104d12
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
@@ -121,6 +123,19 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MEMERASE = 0x40084d02
+ MEMERASE64 = 0x40104d14
+ MEMGETBADBLOCK = 0x40084d0b
+ MEMGETINFO = 0x80204d01
+ MEMGETOOBSEL = 0x80c84d0a
+ MEMGETREGIONCOUNT = 0x80044d07
+ MEMISLOCKED = 0x80084d17
+ MEMLOCK = 0x40084d05
+ MEMREADOOB = 0xc00c4d04
+ MEMSETBADBLOCK = 0x40084d0c
+ MEMUNLOCK = 0x40084d06
+ MEMWRITEOOB = 0xc00c4d03
+ MTDFILEMODE = 0x4d13
NFDBITS = 0x20
NLDLY = 0x100
NOFLSH = 0x80
@@ -130,6 +145,11 @@ const (
NS_GET_USERNS = 0xb701
OLCUC = 0x2
ONLCR = 0x4
+ OTPERASE = 0x400c4d19
+ OTPGETREGIONCOUNT = 0x40044d0e
+ OTPGETREGIONINFO = 0x400c4d0f
+ OTPLOCK = 0x800c4d10
+ OTPSELECT = 0x80044d0d
O_APPEND = 0x400
O_ASYNC = 0x2000
O_CLOEXEC = 0x80000
@@ -296,6 +316,7 @@ const (
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
+ SO_NETNS_COOKIE = 0x47
SO_NOFCS = 0x2b
SO_OOBINLINE = 0xa
SO_PASSCRED = 0x10
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
index e1538995b..3a67a9c85 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
@@ -60,6 +60,8 @@ const (
CS8 = 0x30
CSIZE = 0x30
CSTOPB = 0x40
+ ECCGETLAYOUT = 0x81484d11
+ ECCGETSTATS = 0x80104d12
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
@@ -124,6 +126,19 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MEMERASE = 0x40084d02
+ MEMERASE64 = 0x40104d14
+ MEMGETBADBLOCK = 0x40084d0b
+ MEMGETINFO = 0x80204d01
+ MEMGETOOBSEL = 0x80c84d0a
+ MEMGETREGIONCOUNT = 0x80044d07
+ MEMISLOCKED = 0x80084d17
+ MEMLOCK = 0x40084d05
+ MEMREADOOB = 0xc0104d04
+ MEMSETBADBLOCK = 0x40084d0c
+ MEMUNLOCK = 0x40084d06
+ MEMWRITEOOB = 0xc0104d03
+ MTDFILEMODE = 0x4d13
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
@@ -133,6 +148,11 @@ const (
NS_GET_USERNS = 0xb701
OLCUC = 0x2
ONLCR = 0x4
+ OTPERASE = 0x400c4d19
+ OTPGETREGIONCOUNT = 0x40044d0e
+ OTPGETREGIONINFO = 0x400c4d0f
+ OTPLOCK = 0x800c4d10
+ OTPSELECT = 0x80044d0d
O_APPEND = 0x400
O_ASYNC = 0x2000
O_CLOEXEC = 0x80000
@@ -286,6 +306,7 @@ const (
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
+ SO_NETNS_COOKIE = 0x47
SO_NOFCS = 0x2b
SO_OOBINLINE = 0xa
SO_PASSCRED = 0x10
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
index 5e8e71ff8..a7ccef56c 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
@@ -60,6 +60,8 @@ const (
CS8 = 0x30
CSIZE = 0x30
CSTOPB = 0x40
+ ECCGETLAYOUT = 0x41484d11
+ ECCGETSTATS = 0x40104d12
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
@@ -121,6 +123,19 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MEMERASE = 0x80084d02
+ MEMERASE64 = 0x80104d14
+ MEMGETBADBLOCK = 0x80084d0b
+ MEMGETINFO = 0x40204d01
+ MEMGETOOBSEL = 0x40c84d0a
+ MEMGETREGIONCOUNT = 0x40044d07
+ MEMISLOCKED = 0x40084d17
+ MEMLOCK = 0x80084d05
+ MEMREADOOB = 0xc00c4d04
+ MEMSETBADBLOCK = 0x80084d0c
+ MEMUNLOCK = 0x80084d06
+ MEMWRITEOOB = 0xc00c4d03
+ MTDFILEMODE = 0x20004d13
NFDBITS = 0x20
NLDLY = 0x100
NOFLSH = 0x80
@@ -130,6 +145,11 @@ const (
NS_GET_USERNS = 0x2000b701
OLCUC = 0x2
ONLCR = 0x4
+ OTPERASE = 0x800c4d19
+ OTPGETREGIONCOUNT = 0x80044d0e
+ OTPGETREGIONINFO = 0x800c4d0f
+ OTPLOCK = 0x400c4d10
+ OTPSELECT = 0x40044d0d
O_APPEND = 0x8
O_ASYNC = 0x1000
O_CLOEXEC = 0x80000
@@ -289,6 +309,7 @@ const (
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
+ SO_NETNS_COOKIE = 0x47
SO_NOFCS = 0x2b
SO_OOBINLINE = 0x100
SO_PASSCRED = 0x11
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
index e670ee148..f7b7cec91 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
@@ -60,6 +60,8 @@ const (
CS8 = 0x30
CSIZE = 0x30
CSTOPB = 0x40
+ ECCGETLAYOUT = 0x41484d11
+ ECCGETSTATS = 0x40104d12
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
@@ -121,6 +123,19 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MEMERASE = 0x80084d02
+ MEMERASE64 = 0x80104d14
+ MEMGETBADBLOCK = 0x80084d0b
+ MEMGETINFO = 0x40204d01
+ MEMGETOOBSEL = 0x40c84d0a
+ MEMGETREGIONCOUNT = 0x40044d07
+ MEMISLOCKED = 0x40084d17
+ MEMLOCK = 0x80084d05
+ MEMREADOOB = 0xc0104d04
+ MEMSETBADBLOCK = 0x80084d0c
+ MEMUNLOCK = 0x80084d06
+ MEMWRITEOOB = 0xc0104d03
+ MTDFILEMODE = 0x20004d13
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
@@ -130,6 +145,11 @@ const (
NS_GET_USERNS = 0x2000b701
OLCUC = 0x2
ONLCR = 0x4
+ OTPERASE = 0x800c4d19
+ OTPGETREGIONCOUNT = 0x80044d0e
+ OTPGETREGIONINFO = 0x800c4d0f
+ OTPLOCK = 0x400c4d10
+ OTPSELECT = 0x40044d0d
O_APPEND = 0x8
O_ASYNC = 0x1000
O_CLOEXEC = 0x80000
@@ -289,6 +309,7 @@ const (
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
+ SO_NETNS_COOKIE = 0x47
SO_NOFCS = 0x2b
SO_OOBINLINE = 0x100
SO_PASSCRED = 0x11
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
index dd11eacb8..4fcacf958 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
@@ -60,6 +60,8 @@ const (
CS8 = 0x30
CSIZE = 0x30
CSTOPB = 0x40
+ ECCGETLAYOUT = 0x41484d11
+ ECCGETSTATS = 0x40104d12
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
@@ -121,6 +123,19 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MEMERASE = 0x80084d02
+ MEMERASE64 = 0x80104d14
+ MEMGETBADBLOCK = 0x80084d0b
+ MEMGETINFO = 0x40204d01
+ MEMGETOOBSEL = 0x40c84d0a
+ MEMGETREGIONCOUNT = 0x40044d07
+ MEMISLOCKED = 0x40084d17
+ MEMLOCK = 0x80084d05
+ MEMREADOOB = 0xc0104d04
+ MEMSETBADBLOCK = 0x80084d0c
+ MEMUNLOCK = 0x80084d06
+ MEMWRITEOOB = 0xc0104d03
+ MTDFILEMODE = 0x20004d13
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
@@ -130,6 +145,11 @@ const (
NS_GET_USERNS = 0x2000b701
OLCUC = 0x2
ONLCR = 0x4
+ OTPERASE = 0x800c4d19
+ OTPGETREGIONCOUNT = 0x80044d0e
+ OTPGETREGIONINFO = 0x800c4d0f
+ OTPLOCK = 0x400c4d10
+ OTPSELECT = 0x40044d0d
O_APPEND = 0x8
O_ASYNC = 0x1000
O_CLOEXEC = 0x80000
@@ -289,6 +309,7 @@ const (
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
+ SO_NETNS_COOKIE = 0x47
SO_NOFCS = 0x2b
SO_OOBINLINE = 0x100
SO_PASSCRED = 0x11
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
index a0a5b22ae..6f6c223a2 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
@@ -60,6 +60,8 @@ const (
CS8 = 0x30
CSIZE = 0x30
CSTOPB = 0x40
+ ECCGETLAYOUT = 0x41484d11
+ ECCGETSTATS = 0x40104d12
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
@@ -121,6 +123,19 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MEMERASE = 0x80084d02
+ MEMERASE64 = 0x80104d14
+ MEMGETBADBLOCK = 0x80084d0b
+ MEMGETINFO = 0x40204d01
+ MEMGETOOBSEL = 0x40c84d0a
+ MEMGETREGIONCOUNT = 0x40044d07
+ MEMISLOCKED = 0x40084d17
+ MEMLOCK = 0x80084d05
+ MEMREADOOB = 0xc00c4d04
+ MEMSETBADBLOCK = 0x80084d0c
+ MEMUNLOCK = 0x80084d06
+ MEMWRITEOOB = 0xc00c4d03
+ MTDFILEMODE = 0x20004d13
NFDBITS = 0x20
NLDLY = 0x100
NOFLSH = 0x80
@@ -130,6 +145,11 @@ const (
NS_GET_USERNS = 0x2000b701
OLCUC = 0x2
ONLCR = 0x4
+ OTPERASE = 0x800c4d19
+ OTPGETREGIONCOUNT = 0x80044d0e
+ OTPGETREGIONINFO = 0x800c4d0f
+ OTPLOCK = 0x400c4d10
+ OTPSELECT = 0x40044d0d
O_APPEND = 0x8
O_ASYNC = 0x1000
O_CLOEXEC = 0x80000
@@ -289,6 +309,7 @@ const (
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
+ SO_NETNS_COOKIE = 0x47
SO_NOFCS = 0x2b
SO_OOBINLINE = 0x100
SO_PASSCRED = 0x11
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go
index d9530e5fb..59e522bcf 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go
@@ -60,6 +60,8 @@ const (
CS8 = 0x300
CSIZE = 0x300
CSTOPB = 0x400
+ ECCGETLAYOUT = 0x41484d11
+ ECCGETSTATS = 0x40104d12
ECHOCTL = 0x40
ECHOE = 0x2
ECHOK = 0x4
@@ -121,6 +123,19 @@ const (
MCL_CURRENT = 0x2000
MCL_FUTURE = 0x4000
MCL_ONFAULT = 0x8000
+ MEMERASE = 0x80084d02
+ MEMERASE64 = 0x80104d14
+ MEMGETBADBLOCK = 0x80084d0b
+ MEMGETINFO = 0x40204d01
+ MEMGETOOBSEL = 0x40c84d0a
+ MEMGETREGIONCOUNT = 0x40044d07
+ MEMISLOCKED = 0x40084d17
+ MEMLOCK = 0x80084d05
+ MEMREADOOB = 0xc00c4d04
+ MEMSETBADBLOCK = 0x80084d0c
+ MEMUNLOCK = 0x80084d06
+ MEMWRITEOOB = 0xc00c4d03
+ MTDFILEMODE = 0x20004d13
NFDBITS = 0x20
NL2 = 0x200
NL3 = 0x300
@@ -132,6 +147,11 @@ const (
NS_GET_USERNS = 0x2000b701
OLCUC = 0x4
ONLCR = 0x2
+ OTPERASE = 0x800c4d19
+ OTPGETREGIONCOUNT = 0x80044d0e
+ OTPGETREGIONINFO = 0x800c4d0f
+ OTPLOCK = 0x400c4d10
+ OTPSELECT = 0x40044d0d
O_APPEND = 0x400
O_ASYNC = 0x2000
O_CLOEXEC = 0x80000
@@ -344,6 +364,7 @@ const (
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
+ SO_NETNS_COOKIE = 0x47
SO_NOFCS = 0x2b
SO_OOBINLINE = 0xa
SO_PASSCRED = 0x14
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
index e60102f6a..d4264a0f7 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
@@ -60,6 +60,8 @@ const (
CS8 = 0x300
CSIZE = 0x300
CSTOPB = 0x400
+ ECCGETLAYOUT = 0x41484d11
+ ECCGETSTATS = 0x40104d12
ECHOCTL = 0x40
ECHOE = 0x2
ECHOK = 0x4
@@ -121,6 +123,19 @@ const (
MCL_CURRENT = 0x2000
MCL_FUTURE = 0x4000
MCL_ONFAULT = 0x8000
+ MEMERASE = 0x80084d02
+ MEMERASE64 = 0x80104d14
+ MEMGETBADBLOCK = 0x80084d0b
+ MEMGETINFO = 0x40204d01
+ MEMGETOOBSEL = 0x40c84d0a
+ MEMGETREGIONCOUNT = 0x40044d07
+ MEMISLOCKED = 0x40084d17
+ MEMLOCK = 0x80084d05
+ MEMREADOOB = 0xc0104d04
+ MEMSETBADBLOCK = 0x80084d0c
+ MEMUNLOCK = 0x80084d06
+ MEMWRITEOOB = 0xc0104d03
+ MTDFILEMODE = 0x20004d13
NFDBITS = 0x40
NL2 = 0x200
NL3 = 0x300
@@ -132,6 +147,11 @@ const (
NS_GET_USERNS = 0x2000b701
OLCUC = 0x4
ONLCR = 0x2
+ OTPERASE = 0x800c4d19
+ OTPGETREGIONCOUNT = 0x80044d0e
+ OTPGETREGIONINFO = 0x800c4d0f
+ OTPLOCK = 0x400c4d10
+ OTPSELECT = 0x40044d0d
O_APPEND = 0x400
O_ASYNC = 0x2000
O_CLOEXEC = 0x80000
@@ -348,6 +368,7 @@ const (
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
+ SO_NETNS_COOKIE = 0x47
SO_NOFCS = 0x2b
SO_OOBINLINE = 0xa
SO_PASSCRED = 0x14
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
index 838ff4ea6..21cbec1dd 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
@@ -60,6 +60,8 @@ const (
CS8 = 0x300
CSIZE = 0x300
CSTOPB = 0x400
+ ECCGETLAYOUT = 0x41484d11
+ ECCGETSTATS = 0x40104d12
ECHOCTL = 0x40
ECHOE = 0x2
ECHOK = 0x4
@@ -121,6 +123,19 @@ const (
MCL_CURRENT = 0x2000
MCL_FUTURE = 0x4000
MCL_ONFAULT = 0x8000
+ MEMERASE = 0x80084d02
+ MEMERASE64 = 0x80104d14
+ MEMGETBADBLOCK = 0x80084d0b
+ MEMGETINFO = 0x40204d01
+ MEMGETOOBSEL = 0x40c84d0a
+ MEMGETREGIONCOUNT = 0x40044d07
+ MEMISLOCKED = 0x40084d17
+ MEMLOCK = 0x80084d05
+ MEMREADOOB = 0xc0104d04
+ MEMSETBADBLOCK = 0x80084d0c
+ MEMUNLOCK = 0x80084d06
+ MEMWRITEOOB = 0xc0104d03
+ MTDFILEMODE = 0x20004d13
NFDBITS = 0x40
NL2 = 0x200
NL3 = 0x300
@@ -132,6 +147,11 @@ const (
NS_GET_USERNS = 0x2000b701
OLCUC = 0x4
ONLCR = 0x2
+ OTPERASE = 0x800c4d19
+ OTPGETREGIONCOUNT = 0x80044d0e
+ OTPGETREGIONINFO = 0x800c4d0f
+ OTPLOCK = 0x400c4d10
+ OTPSELECT = 0x40044d0d
O_APPEND = 0x400
O_ASYNC = 0x2000
O_CLOEXEC = 0x80000
@@ -348,6 +368,7 @@ const (
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
+ SO_NETNS_COOKIE = 0x47
SO_NOFCS = 0x2b
SO_OOBINLINE = 0xa
SO_PASSCRED = 0x14
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
index 7cc98f09c..9b05bf12f 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
@@ -60,6 +60,8 @@ const (
CS8 = 0x30
CSIZE = 0x30
CSTOPB = 0x40
+ ECCGETLAYOUT = 0x81484d11
+ ECCGETSTATS = 0x80104d12
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
@@ -121,6 +123,19 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MEMERASE = 0x40084d02
+ MEMERASE64 = 0x40104d14
+ MEMGETBADBLOCK = 0x40084d0b
+ MEMGETINFO = 0x80204d01
+ MEMGETOOBSEL = 0x80c84d0a
+ MEMGETREGIONCOUNT = 0x80044d07
+ MEMISLOCKED = 0x80084d17
+ MEMLOCK = 0x40084d05
+ MEMREADOOB = 0xc0104d04
+ MEMSETBADBLOCK = 0x40084d0c
+ MEMUNLOCK = 0x40084d06
+ MEMWRITEOOB = 0xc0104d03
+ MTDFILEMODE = 0x4d13
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
@@ -130,6 +145,11 @@ const (
NS_GET_USERNS = 0xb701
OLCUC = 0x2
ONLCR = 0x4
+ OTPERASE = 0x400c4d19
+ OTPGETREGIONCOUNT = 0x40044d0e
+ OTPGETREGIONINFO = 0x400c4d0f
+ OTPLOCK = 0x800c4d10
+ OTPSELECT = 0x80044d0d
O_APPEND = 0x400
O_ASYNC = 0x2000
O_CLOEXEC = 0x80000
@@ -277,6 +297,7 @@ const (
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
+ SO_NETNS_COOKIE = 0x47
SO_NOFCS = 0x2b
SO_OOBINLINE = 0xa
SO_PASSCRED = 0x10
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
index a508392d2..bd82ace09 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
@@ -60,6 +60,8 @@ const (
CS8 = 0x30
CSIZE = 0x30
CSTOPB = 0x40
+ ECCGETLAYOUT = 0x81484d11
+ ECCGETSTATS = 0x80104d12
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
@@ -121,6 +123,19 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MEMERASE = 0x40084d02
+ MEMERASE64 = 0x40104d14
+ MEMGETBADBLOCK = 0x40084d0b
+ MEMGETINFO = 0x80204d01
+ MEMGETOOBSEL = 0x80c84d0a
+ MEMGETREGIONCOUNT = 0x80044d07
+ MEMISLOCKED = 0x80084d17
+ MEMLOCK = 0x40084d05
+ MEMREADOOB = 0xc0104d04
+ MEMSETBADBLOCK = 0x40084d0c
+ MEMUNLOCK = 0x40084d06
+ MEMWRITEOOB = 0xc0104d03
+ MTDFILEMODE = 0x4d13
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
@@ -130,6 +145,11 @@ const (
NS_GET_USERNS = 0xb701
OLCUC = 0x2
ONLCR = 0x4
+ OTPERASE = 0x400c4d19
+ OTPGETREGIONCOUNT = 0x40044d0e
+ OTPGETREGIONINFO = 0x400c4d0f
+ OTPLOCK = 0x800c4d10
+ OTPSELECT = 0x80044d0d
O_APPEND = 0x400
O_ASYNC = 0x2000
O_CLOEXEC = 0x80000
@@ -212,6 +232,8 @@ const (
PTRACE_POKE_SYSTEM_CALL = 0x5008
PTRACE_PROT = 0x15
PTRACE_SINGLEBLOCK = 0xc
+ PTRACE_SYSEMU = 0x1f
+ PTRACE_SYSEMU_SINGLESTEP = 0x20
PTRACE_TE_ABORT_RAND = 0x5011
PT_ACR0 = 0x90
PT_ACR1 = 0x94
@@ -350,6 +372,7 @@ const (
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
+ SO_NETNS_COOKIE = 0x47
SO_NOFCS = 0x2b
SO_OOBINLINE = 0xa
SO_PASSCRED = 0x10
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
index d5e2dc94f..1f8bded56 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
@@ -63,6 +63,8 @@ const (
CS8 = 0x30
CSIZE = 0x30
CSTOPB = 0x40
+ ECCGETLAYOUT = 0x41484d11
+ ECCGETSTATS = 0x40104d12
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
@@ -126,6 +128,19 @@ const (
MCL_CURRENT = 0x2000
MCL_FUTURE = 0x4000
MCL_ONFAULT = 0x8000
+ MEMERASE = 0x80084d02
+ MEMERASE64 = 0x80104d14
+ MEMGETBADBLOCK = 0x80084d0b
+ MEMGETINFO = 0x40204d01
+ MEMGETOOBSEL = 0x40c84d0a
+ MEMGETREGIONCOUNT = 0x40044d07
+ MEMISLOCKED = 0x40084d17
+ MEMLOCK = 0x80084d05
+ MEMREADOOB = 0xc0104d04
+ MEMSETBADBLOCK = 0x80084d0c
+ MEMUNLOCK = 0x80084d06
+ MEMWRITEOOB = 0xc0104d03
+ MTDFILEMODE = 0x20004d13
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
@@ -135,6 +150,11 @@ const (
NS_GET_USERNS = 0x2000b701
OLCUC = 0x2
ONLCR = 0x4
+ OTPERASE = 0x800c4d19
+ OTPGETREGIONCOUNT = 0x80044d0e
+ OTPGETREGIONINFO = 0x800c4d0f
+ OTPLOCK = 0x400c4d10
+ OTPSELECT = 0x40044d0d
O_APPEND = 0x8
O_ASYNC = 0x40
O_CLOEXEC = 0x400000
@@ -343,6 +363,7 @@ const (
SO_MARK = 0x22
SO_MAX_PACING_RATE = 0x31
SO_MEMINFO = 0x39
+ SO_NETNS_COOKIE = 0x50
SO_NOFCS = 0x27
SO_OOBINLINE = 0x100
SO_PASSCRED = 0x2
diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go
index 593cc0fef..6d56edc05 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go
@@ -1020,7 +1020,10 @@ const (
RLIMIT_CPU = 0x0
RLIMIT_DATA = 0x2
RLIMIT_FSIZE = 0x1
+ RLIMIT_MEMLOCK = 0x6
RLIMIT_NOFILE = 0x8
+ RLIMIT_NPROC = 0x7
+ RLIMIT_RSS = 0x5
RLIMIT_STACK = 0x3
RLIM_INFINITY = 0x7fffffffffffffff
RTAX_AUTHOR = 0x6
diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go
index a4e4c2231..aef6c0856 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go
@@ -1020,7 +1020,10 @@ const (
RLIMIT_CPU = 0x0
RLIMIT_DATA = 0x2
RLIMIT_FSIZE = 0x1
+ RLIMIT_MEMLOCK = 0x6
RLIMIT_NOFILE = 0x8
+ RLIMIT_NPROC = 0x7
+ RLIMIT_RSS = 0x5
RLIMIT_STACK = 0x3
RLIM_INFINITY = 0x7fffffffffffffff
RTAX_AUTHOR = 0x6
diff --git a/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go
index 4e87b4beb..fc7d0506f 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go
@@ -67,24 +67,43 @@ const (
IPPORT_RESERVED = 1024
IPPORT_USERRESERVED = 5000
IPPROTO_AH = 51
+ SOL_AH = 51
IPPROTO_DSTOPTS = 60
+ SOL_DSTOPTS = 60
IPPROTO_EGP = 8
+ SOL_EGP = 8
IPPROTO_ESP = 50
+ SOL_ESP = 50
IPPROTO_FRAGMENT = 44
+ SOL_FRAGMENT = 44
IPPROTO_GGP = 2
+ SOL_GGP = 2
IPPROTO_HOPOPTS = 0
+ SOL_HOPOPTS = 0
IPPROTO_ICMP = 1
+ SOL_ICMP = 1
IPPROTO_ICMPV6 = 58
+ SOL_ICMPV6 = 58
IPPROTO_IDP = 22
+ SOL_IDP = 22
IPPROTO_IP = 0
+ SOL_IP = 0
IPPROTO_IPV6 = 41
+ SOL_IPV6 = 41
IPPROTO_MAX = 256
+ SOL_MAX = 256
IPPROTO_NONE = 59
+ SOL_NONE = 59
IPPROTO_PUP = 12
+ SOL_PUP = 12
IPPROTO_RAW = 255
+ SOL_RAW = 255
IPPROTO_ROUTING = 43
+ SOL_ROUTING = 43
IPPROTO_TCP = 6
+ SOL_TCP = 6
IPPROTO_UDP = 17
+ SOL_UDP = 17
IPV6_ADDR_PREFERENCES = 32
IPV6_CHECKSUM = 19
IPV6_DONTFRAG = 29
@@ -186,6 +205,7 @@ const (
MTM_SYNCHONLY = 0x00000200
MTM_REMOUNT = 0x00000100
MTM_NOSECURITY = 0x00000080
+ NFDBITS = 0x20
O_ACCMODE = 0x03
O_APPEND = 0x08
O_ASYNCSIG = 0x0200
@@ -359,6 +379,8 @@ const (
S_IFMST = 0x00FF0000
TCP_KEEPALIVE = 0x8
TCP_NODELAY = 0x1
+ TCP_INFO = 0xb
+ TCP_USER_TIMEOUT = 0x1
TIOCGWINSZ = 0x4008a368
TIOCSWINSZ = 0x8008a367
TIOCSBRK = 0x2000a77b
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.go
deleted file mode 100644
index 48a62e390..000000000
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// go run mksyscall.go -l32 -tags darwin,386,go1.13 syscall_darwin.1_13.go
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build darwin && 386 && go1.13
-// +build darwin,386,go1.13
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-var _ syscall.Errno
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func closedir(dir uintptr) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_closedir_trampoline()
-
-//go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) {
- r0, _, _ := syscall_syscall(funcPC(libc_readdir_r_trampoline), uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
- res = Errno(r0)
- return
-}
-
-func libc_readdir_r_trampoline()
-
-//go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib"
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s
deleted file mode 100644
index 00da1ebfc..000000000
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s
+++ /dev/null
@@ -1,12 +0,0 @@
-// go run mkasm_darwin.go 386
-// Code generated by the command above; DO NOT EDIT.
-
-// +build go1.13
-
-#include "textflag.h"
-TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fdopendir(SB)
-TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0
- JMP libc_closedir(SB)
-TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0
- JMP libc_readdir_r(SB)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go
deleted file mode 100644
index a266636af..000000000
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go
+++ /dev/null
@@ -1,2431 +0,0 @@
-// go run mksyscall.go -l32 -tags darwin,386,go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build darwin && 386 && go1.12
-// +build darwin,386,go1.12
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-var _ syscall.Errno
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_getgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getgroups_trampoline()
-
-//go:cgo_import_dynamic libc_getgroups getgroups "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func setgroups(ngid int, gid *_Gid_t) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setgroups_trampoline()
-
-//go:cgo_import_dynamic libc_setgroups setgroups "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_wait4_trampoline), uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
- wpid = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_wait4_trampoline()
-
-//go:cgo_import_dynamic libc_wait4 wait4 "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_accept_trampoline), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_accept_trampoline()
-
-//go:cgo_import_dynamic libc_accept accept "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_bind_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_bind_trampoline()
-
-//go:cgo_import_dynamic libc_bind bind "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_connect_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_connect_trampoline()
-
-//go:cgo_import_dynamic libc_connect connect "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func socket(domain int, typ int, proto int) (fd int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_socket_trampoline), uintptr(domain), uintptr(typ), uintptr(proto))
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_socket_trampoline()
-
-//go:cgo_import_dynamic libc_socket socket "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_getsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getsockopt_trampoline()
-
-//go:cgo_import_dynamic libc_getsockopt getsockopt "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_setsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setsockopt_trampoline()
-
-//go:cgo_import_dynamic libc_setsockopt setsockopt "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getpeername_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getpeername_trampoline()
-
-//go:cgo_import_dynamic libc_getpeername getpeername "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getsockname_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getsockname_trampoline()
-
-//go:cgo_import_dynamic libc_getsockname getsockname "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Shutdown(s int, how int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_shutdown_trampoline), uintptr(s), uintptr(how), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_shutdown_trampoline()
-
-//go:cgo_import_dynamic libc_shutdown shutdown "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
- _, _, e1 := syscall_rawSyscall6(funcPC(libc_socketpair_trampoline), uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_socketpair_trampoline()
-
-//go:cgo_import_dynamic libc_socketpair socketpair "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
- var _p0 unsafe.Pointer
- if len(p) > 0 {
- _p0 = unsafe.Pointer(&p[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_recvfrom_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_recvfrom_trampoline()
-
-//go:cgo_import_dynamic libc_recvfrom recvfrom "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
- var _p0 unsafe.Pointer
- if len(buf) > 0 {
- _p0 = unsafe.Pointer(&buf[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_sendto_trampoline), uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_sendto_trampoline()
-
-//go:cgo_import_dynamic libc_sendto sendto "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_recvmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_recvmsg_trampoline()
-
-//go:cgo_import_dynamic libc_recvmsg recvmsg "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_sendmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_sendmsg_trampoline()
-
-//go:cgo_import_dynamic libc_sendmsg sendmsg "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_kevent_trampoline), uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_kevent_trampoline()
-
-//go:cgo_import_dynamic libc_kevent kevent "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func utimes(path string, timeval *[2]Timeval) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_utimes_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_utimes_trampoline()
-
-//go:cgo_import_dynamic libc_utimes utimes "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func futimes(fd int, timeval *[2]Timeval) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_futimes_trampoline), uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_futimes_trampoline()
-
-//go:cgo_import_dynamic libc_futimes futimes "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_poll_trampoline()
-
-//go:cgo_import_dynamic libc_poll poll "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Madvise(b []byte, behav int) (err error) {
- var _p0 unsafe.Pointer
- if len(b) > 0 {
- _p0 = unsafe.Pointer(&b[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall(funcPC(libc_madvise_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(behav))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_madvise_trampoline()
-
-//go:cgo_import_dynamic libc_madvise madvise "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mlock(b []byte) (err error) {
- var _p0 unsafe.Pointer
- if len(b) > 0 {
- _p0 = unsafe.Pointer(&b[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall(funcPC(libc_mlock_trampoline), uintptr(_p0), uintptr(len(b)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mlock_trampoline()
-
-//go:cgo_import_dynamic libc_mlock mlock "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mlockall(flags int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_mlockall_trampoline), uintptr(flags), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mlockall_trampoline()
-
-//go:cgo_import_dynamic libc_mlockall mlockall "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mprotect(b []byte, prot int) (err error) {
- var _p0 unsafe.Pointer
- if len(b) > 0 {
- _p0 = unsafe.Pointer(&b[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall(funcPC(libc_mprotect_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(prot))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mprotect_trampoline()
-
-//go:cgo_import_dynamic libc_mprotect mprotect "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Msync(b []byte, flags int) (err error) {
- var _p0 unsafe.Pointer
- if len(b) > 0 {
- _p0 = unsafe.Pointer(&b[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall(funcPC(libc_msync_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(flags))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_msync_trampoline()
-
-//go:cgo_import_dynamic libc_msync msync "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Munlock(b []byte) (err error) {
- var _p0 unsafe.Pointer
- if len(b) > 0 {
- _p0 = unsafe.Pointer(&b[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall(funcPC(libc_munlock_trampoline), uintptr(_p0), uintptr(len(b)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_munlock_trampoline()
-
-//go:cgo_import_dynamic libc_munlock munlock "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Munlockall() (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_munlockall_trampoline), 0, 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_munlockall_trampoline()
-
-//go:cgo_import_dynamic libc_munlockall munlockall "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func pipe(p *[2]int32) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), uintptr(unsafe.Pointer(p)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_pipe_trampoline()
-
-//go:cgo_import_dynamic libc_pipe pipe "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(attr)
- if err != nil {
- return
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_getxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
- sz = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getxattr_trampoline()
-
-//go:cgo_import_dynamic libc_getxattr getxattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(attr)
- if err != nil {
- return
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_fgetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
- sz = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fgetxattr_trampoline()
-
-//go:cgo_import_dynamic libc_fgetxattr fgetxattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(attr)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_setxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setxattr_trampoline()
-
-//go:cgo_import_dynamic libc_setxattr setxattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(attr)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_fsetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fsetxattr_trampoline()
-
-//go:cgo_import_dynamic libc_fsetxattr fsetxattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func removexattr(path string, attr string, options int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(attr)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_removexattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_removexattr_trampoline()
-
-//go:cgo_import_dynamic libc_removexattr removexattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func fremovexattr(fd int, attr string, options int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(attr)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_fremovexattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fremovexattr_trampoline()
-
-//go:cgo_import_dynamic libc_fremovexattr fremovexattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func listxattr(path string, dest *byte, size int, options int) (sz int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_listxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
- sz = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_listxattr_trampoline()
-
-//go:cgo_import_dynamic libc_listxattr listxattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_flistxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
- sz = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_flistxattr_trampoline()
-
-//go:cgo_import_dynamic libc_flistxattr flistxattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_setattrlist_trampoline), uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setattrlist_trampoline()
-
-//go:cgo_import_dynamic libc_setattrlist setattrlist "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func fcntl(fd int, cmd int, arg int) (val int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg))
- val = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fcntl_trampoline()
-
-//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func kill(pid int, signum int, posix int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_kill_trampoline()
-
-//go:cgo_import_dynamic libc_kill kill "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func ioctl(fd int, req uint, arg uintptr) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_ioctl_trampoline), uintptr(fd), uintptr(req), uintptr(arg))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_ioctl_trampoline()
-
-//go:cgo_import_dynamic libc_ioctl ioctl "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
- var _p0 unsafe.Pointer
- if len(mib) > 0 {
- _p0 = unsafe.Pointer(&mib[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_sysctl_trampoline()
-
-//go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
- _, _, e1 := syscall_syscall9(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(offset>>32), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_sendfile_trampoline()
-
-//go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Access(path string, mode uint32) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_access_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_access_trampoline()
-
-//go:cgo_import_dynamic libc_access access "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_adjtime_trampoline), uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_adjtime_trampoline()
-
-//go:cgo_import_dynamic libc_adjtime adjtime "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Chdir(path string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_chdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_chdir_trampoline()
-
-//go:cgo_import_dynamic libc_chdir chdir "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Chflags(path string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_chflags_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_chflags_trampoline()
-
-//go:cgo_import_dynamic libc_chflags chflags "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Chmod(path string, mode uint32) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_chmod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_chmod_trampoline()
-
-//go:cgo_import_dynamic libc_chmod chmod "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Chown(path string, uid int, gid int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_chown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_chown_trampoline()
-
-//go:cgo_import_dynamic libc_chown chown "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Chroot(path string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_chroot_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_chroot_trampoline()
-
-//go:cgo_import_dynamic libc_chroot chroot "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func ClockGettime(clockid int32, time *Timespec) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_clock_gettime_trampoline), uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_clock_gettime_trampoline()
-
-//go:cgo_import_dynamic libc_clock_gettime clock_gettime "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Close(fd int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_close_trampoline), uintptr(fd), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_close_trampoline()
-
-//go:cgo_import_dynamic libc_close close "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Clonefile(src string, dst string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(src)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(dst)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_clonefile_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_clonefile_trampoline()
-
-//go:cgo_import_dynamic libc_clonefile clonefile "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(src)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(dst)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_clonefileat_trampoline), uintptr(srcDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_clonefileat_trampoline()
-
-//go:cgo_import_dynamic libc_clonefileat clonefileat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Dup(fd int) (nfd int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0)
- nfd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_dup_trampoline()
-
-//go:cgo_import_dynamic libc_dup dup "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Dup2(from int, to int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_dup2_trampoline), uintptr(from), uintptr(to), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_dup2_trampoline()
-
-//go:cgo_import_dynamic libc_dup2 dup2 "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Exchangedata(path1 string, path2 string, options int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path1)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(path2)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_exchangedata_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_exchangedata_trampoline()
-
-//go:cgo_import_dynamic libc_exchangedata exchangedata "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Exit(code int) {
- syscall_syscall(funcPC(libc_exit_trampoline), uintptr(code), 0, 0)
- return
-}
-
-func libc_exit_trampoline()
-
-//go:cgo_import_dynamic libc_exit exit "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_faccessat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_faccessat_trampoline()
-
-//go:cgo_import_dynamic libc_faccessat faccessat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fchdir(fd int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchdir_trampoline), uintptr(fd), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fchdir_trampoline()
-
-//go:cgo_import_dynamic libc_fchdir fchdir "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fchflags(fd int, flags int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchflags_trampoline), uintptr(fd), uintptr(flags), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fchflags_trampoline()
-
-//go:cgo_import_dynamic libc_fchflags fchflags "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fchmod(fd int, mode uint32) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchmod_trampoline), uintptr(fd), uintptr(mode), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fchmod_trampoline()
-
-//go:cgo_import_dynamic libc_fchmod fchmod "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_fchmodat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fchmodat_trampoline()
-
-//go:cgo_import_dynamic libc_fchmodat fchmodat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fchown(fd int, uid int, gid int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchown_trampoline), uintptr(fd), uintptr(uid), uintptr(gid))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fchown_trampoline()
-
-//go:cgo_import_dynamic libc_fchown fchown "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_fchownat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fchownat_trampoline()
-
-//go:cgo_import_dynamic libc_fchownat fchownat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(dst)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_fclonefileat_trampoline), uintptr(srcDirfd), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fclonefileat_trampoline()
-
-//go:cgo_import_dynamic libc_fclonefileat fclonefileat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Flock(fd int, how int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_flock_trampoline()
-
-//go:cgo_import_dynamic libc_flock flock "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fpathconf(fd int, name int) (val int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_fpathconf_trampoline), uintptr(fd), uintptr(name), 0)
- val = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fpathconf_trampoline()
-
-//go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fsync(fd int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fsync_trampoline), uintptr(fd), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fsync_trampoline()
-
-//go:cgo_import_dynamic libc_fsync fsync "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Ftruncate(fd int, length int64) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_ftruncate_trampoline), uintptr(fd), uintptr(length), uintptr(length>>32))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_ftruncate_trampoline()
-
-//go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getcwd(buf []byte) (n int, err error) {
- var _p0 unsafe.Pointer
- if len(buf) > 0 {
- _p0 = unsafe.Pointer(&buf[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall(funcPC(libc_getcwd_trampoline), uintptr(_p0), uintptr(len(buf)), 0)
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getcwd_trampoline()
-
-//go:cgo_import_dynamic libc_getcwd getcwd "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getdtablesize() (size int) {
- r0, _, _ := syscall_syscall(funcPC(libc_getdtablesize_trampoline), 0, 0, 0)
- size = int(r0)
- return
-}
-
-func libc_getdtablesize_trampoline()
-
-//go:cgo_import_dynamic libc_getdtablesize getdtablesize "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getegid() (egid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getegid_trampoline), 0, 0, 0)
- egid = int(r0)
- return
-}
-
-func libc_getegid_trampoline()
-
-//go:cgo_import_dynamic libc_getegid getegid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Geteuid() (uid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_geteuid_trampoline), 0, 0, 0)
- uid = int(r0)
- return
-}
-
-func libc_geteuid_trampoline()
-
-//go:cgo_import_dynamic libc_geteuid geteuid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getgid() (gid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getgid_trampoline), 0, 0, 0)
- gid = int(r0)
- return
-}
-
-func libc_getgid_trampoline()
-
-//go:cgo_import_dynamic libc_getgid getgid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getpgid(pid int) (pgid int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_getpgid_trampoline), uintptr(pid), 0, 0)
- pgid = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getpgid_trampoline()
-
-//go:cgo_import_dynamic libc_getpgid getpgid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getpgrp() (pgrp int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getpgrp_trampoline), 0, 0, 0)
- pgrp = int(r0)
- return
-}
-
-func libc_getpgrp_trampoline()
-
-//go:cgo_import_dynamic libc_getpgrp getpgrp "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getpid() (pid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getpid_trampoline), 0, 0, 0)
- pid = int(r0)
- return
-}
-
-func libc_getpid_trampoline()
-
-//go:cgo_import_dynamic libc_getpid getpid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getppid() (ppid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getppid_trampoline), 0, 0, 0)
- ppid = int(r0)
- return
-}
-
-func libc_getppid_trampoline()
-
-//go:cgo_import_dynamic libc_getppid getppid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getpriority(which int, who int) (prio int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_getpriority_trampoline), uintptr(which), uintptr(who), 0)
- prio = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getpriority_trampoline()
-
-//go:cgo_import_dynamic libc_getpriority getpriority "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getrlimit(which int, lim *Rlimit) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getrlimit_trampoline()
-
-//go:cgo_import_dynamic libc_getrlimit getrlimit "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getrusage(who int, rusage *Rusage) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getrusage_trampoline), uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getrusage_trampoline()
-
-//go:cgo_import_dynamic libc_getrusage getrusage "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getsid(pid int) (sid int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_getsid_trampoline), uintptr(pid), 0, 0)
- sid = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getsid_trampoline()
-
-//go:cgo_import_dynamic libc_getsid getsid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Gettimeofday(tp *Timeval) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_gettimeofday_trampoline()
-
-//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getuid() (uid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0)
- uid = int(r0)
- return
-}
-
-func libc_getuid_trampoline()
-
-//go:cgo_import_dynamic libc_getuid getuid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Issetugid() (tainted bool) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_issetugid_trampoline), 0, 0, 0)
- tainted = bool(r0 != 0)
- return
-}
-
-func libc_issetugid_trampoline()
-
-//go:cgo_import_dynamic libc_issetugid issetugid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Kqueue() (fd int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_kqueue_trampoline), 0, 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_kqueue_trampoline()
-
-//go:cgo_import_dynamic libc_kqueue kqueue "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Lchown(path string, uid int, gid int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_lchown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_lchown_trampoline()
-
-//go:cgo_import_dynamic libc_lchown lchown "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Link(path string, link string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(link)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_link_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_link_trampoline()
-
-//go:cgo_import_dynamic libc_link link "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(link)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_linkat_trampoline), uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_linkat_trampoline()
-
-//go:cgo_import_dynamic libc_linkat linkat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Listen(s int, backlog int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_listen_trampoline), uintptr(s), uintptr(backlog), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_listen_trampoline()
-
-//go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mkdir(path string, mode uint32) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_mkdir_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mkdir_trampoline()
-
-//go:cgo_import_dynamic libc_mkdir mkdir "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mkdirat(dirfd int, path string, mode uint32) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_mkdirat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mkdirat_trampoline()
-
-//go:cgo_import_dynamic libc_mkdirat mkdirat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mkfifo(path string, mode uint32) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_mkfifo_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mkfifo_trampoline()
-
-//go:cgo_import_dynamic libc_mkfifo mkfifo "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mknod(path string, mode uint32, dev int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_mknod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mknod_trampoline()
-
-//go:cgo_import_dynamic libc_mknod mknod "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Open(path string, mode int, perm uint32) (fd int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- r0, _, e1 := syscall_syscall(funcPC(libc_open_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_open_trampoline()
-
-//go:cgo_import_dynamic libc_open open "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_openat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_openat_trampoline()
-
-//go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Pathconf(path string, name int) (val int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- r0, _, e1 := syscall_syscall(funcPC(libc_pathconf_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
- val = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_pathconf_trampoline()
-
-//go:cgo_import_dynamic libc_pathconf pathconf "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Pread(fd int, p []byte, offset int64) (n int, err error) {
- var _p0 unsafe.Pointer
- if len(p) > 0 {
- _p0 = unsafe.Pointer(&p[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_pread_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_pread_trampoline()
-
-//go:cgo_import_dynamic libc_pread pread "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
- var _p0 unsafe.Pointer
- if len(p) > 0 {
- _p0 = unsafe.Pointer(&p[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_pwrite_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_pwrite_trampoline()
-
-//go:cgo_import_dynamic libc_pwrite pwrite "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func read(fd int, p []byte) (n int, err error) {
- var _p0 unsafe.Pointer
- if len(p) > 0 {
- _p0 = unsafe.Pointer(&p[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_read_trampoline()
-
-//go:cgo_import_dynamic libc_read read "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Readlink(path string, buf []byte) (n int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 unsafe.Pointer
- if len(buf) > 0 {
- _p1 = unsafe.Pointer(&buf[0])
- } else {
- _p1 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall(funcPC(libc_readlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_readlink_trampoline()
-
-//go:cgo_import_dynamic libc_readlink readlink "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 unsafe.Pointer
- if len(buf) > 0 {
- _p1 = unsafe.Pointer(&buf[0])
- } else {
- _p1 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_readlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_readlinkat_trampoline()
-
-//go:cgo_import_dynamic libc_readlinkat readlinkat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Rename(from string, to string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(from)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(to)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_rename_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_rename_trampoline()
-
-//go:cgo_import_dynamic libc_rename rename "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Renameat(fromfd int, from string, tofd int, to string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(from)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(to)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_renameat_trampoline), uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_renameat_trampoline()
-
-//go:cgo_import_dynamic libc_renameat renameat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Revoke(path string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_revoke_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_revoke_trampoline()
-
-//go:cgo_import_dynamic libc_revoke revoke "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Rmdir(path string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_rmdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_rmdir_trampoline()
-
-//go:cgo_import_dynamic libc_rmdir rmdir "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
- r0, r1, e1 := syscall_syscall6(funcPC(libc_lseek_trampoline), uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0)
- newoffset = int64(int64(r1)<<32 | int64(r0))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_lseek_trampoline()
-
-//go:cgo_import_dynamic libc_lseek lseek "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_select_trampoline), uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_select_trampoline()
-
-//go:cgo_import_dynamic libc_select select "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setegid(egid int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_setegid_trampoline), uintptr(egid), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setegid_trampoline()
-
-//go:cgo_import_dynamic libc_setegid setegid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Seteuid(euid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_seteuid_trampoline), uintptr(euid), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_seteuid_trampoline()
-
-//go:cgo_import_dynamic libc_seteuid seteuid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setgid(gid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setgid_trampoline), uintptr(gid), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setgid_trampoline()
-
-//go:cgo_import_dynamic libc_setgid setgid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setlogin(name string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(name)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_setlogin_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setlogin_trampoline()
-
-//go:cgo_import_dynamic libc_setlogin setlogin "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setpgid(pid int, pgid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setpgid_trampoline), uintptr(pid), uintptr(pgid), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setpgid_trampoline()
-
-//go:cgo_import_dynamic libc_setpgid setpgid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setpriority(which int, who int, prio int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_setpriority_trampoline), uintptr(which), uintptr(who), uintptr(prio))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setpriority_trampoline()
-
-//go:cgo_import_dynamic libc_setpriority setpriority "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setprivexec(flag int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_setprivexec_trampoline), uintptr(flag), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setprivexec_trampoline()
-
-//go:cgo_import_dynamic libc_setprivexec setprivexec "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setregid(rgid int, egid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setregid_trampoline), uintptr(rgid), uintptr(egid), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setregid_trampoline()
-
-//go:cgo_import_dynamic libc_setregid setregid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setreuid(ruid int, euid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setreuid_trampoline), uintptr(ruid), uintptr(euid), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setreuid_trampoline()
-
-//go:cgo_import_dynamic libc_setreuid setreuid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setrlimit(which int, lim *Rlimit) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setrlimit_trampoline()
-
-//go:cgo_import_dynamic libc_setrlimit setrlimit "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setsid() (pid int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_setsid_trampoline), 0, 0, 0)
- pid = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setsid_trampoline()
-
-//go:cgo_import_dynamic libc_setsid setsid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Settimeofday(tp *Timeval) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_settimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_settimeofday_trampoline()
-
-//go:cgo_import_dynamic libc_settimeofday settimeofday "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setuid(uid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setuid_trampoline), uintptr(uid), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setuid_trampoline()
-
-//go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Symlink(path string, link string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(link)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_symlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_symlink_trampoline()
-
-//go:cgo_import_dynamic libc_symlink symlink "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(oldpath)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(newpath)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_symlinkat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_symlinkat_trampoline()
-
-//go:cgo_import_dynamic libc_symlinkat symlinkat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Sync() (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_sync_trampoline), 0, 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_sync_trampoline()
-
-//go:cgo_import_dynamic libc_sync sync "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Truncate(path string, length int64) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_truncate_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_truncate_trampoline()
-
-//go:cgo_import_dynamic libc_truncate truncate "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Umask(newmask int) (oldmask int) {
- r0, _, _ := syscall_syscall(funcPC(libc_umask_trampoline), uintptr(newmask), 0, 0)
- oldmask = int(r0)
- return
-}
-
-func libc_umask_trampoline()
-
-//go:cgo_import_dynamic libc_umask umask "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Undelete(path string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_undelete_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_undelete_trampoline()
-
-//go:cgo_import_dynamic libc_undelete undelete "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Unlink(path string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_unlink_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_unlink_trampoline()
-
-//go:cgo_import_dynamic libc_unlink unlink "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Unlinkat(dirfd int, path string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_unlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_unlinkat_trampoline()
-
-//go:cgo_import_dynamic libc_unlinkat unlinkat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Unmount(path string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_unmount_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_unmount_trampoline()
-
-//go:cgo_import_dynamic libc_unmount unmount "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func write(fd int, p []byte) (n int, err error) {
- var _p0 unsafe.Pointer
- if len(p) > 0 {
- _p0 = unsafe.Pointer(&p[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_write_trampoline()
-
-//go:cgo_import_dynamic libc_write write "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
- r0, _, e1 := syscall_syscall9(funcPC(libc_mmap_trampoline), uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0)
- ret = uintptr(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mmap_trampoline()
-
-//go:cgo_import_dynamic libc_mmap mmap "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func munmap(addr uintptr, length uintptr) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_munmap_trampoline), uintptr(addr), uintptr(length), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_munmap_trampoline()
-
-//go:cgo_import_dynamic libc_munmap munmap "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fstat(fd int, stat *Stat_t) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fstat64_trampoline()
-
-//go:cgo_import_dynamic libc_fstat64 fstat64 "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_fstatat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fstatat64_trampoline()
-
-//go:cgo_import_dynamic libc_fstatat64 fstatat64 "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fstatfs(fd int, stat *Statfs_t) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fstatfs64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fstatfs64_trampoline()
-
-//go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat64_trampoline), uintptr(buf), uintptr(size), uintptr(flags))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getfsstat64_trampoline()
-
-//go:cgo_import_dynamic libc_getfsstat64 getfsstat64 "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Lstat(path string, stat *Stat_t) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_lstat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_lstat64_trampoline()
-
-//go:cgo_import_dynamic libc_lstat64 lstat64 "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_ptrace_trampoline()
-
-//go:cgo_import_dynamic libc_ptrace ptrace "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Stat(path string, stat *Stat_t) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_stat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_stat64_trampoline()
-
-//go:cgo_import_dynamic libc_stat64 stat64 "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Statfs(path string, stat *Statfs_t) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_statfs64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_statfs64_trampoline()
-
-//go:cgo_import_dynamic libc_statfs64 statfs64 "/usr/lib/libSystem.B.dylib"
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s
deleted file mode 100644
index 1c53979a1..000000000
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s
+++ /dev/null
@@ -1,290 +0,0 @@
-// go run mkasm_darwin.go 386
-// Code generated by the command above; DO NOT EDIT.
-
-// +build go1.12
-
-#include "textflag.h"
-TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getgroups(SB)
-TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setgroups(SB)
-TEXT ·libc_wait4_trampoline(SB),NOSPLIT,$0-0
- JMP libc_wait4(SB)
-TEXT ·libc_accept_trampoline(SB),NOSPLIT,$0-0
- JMP libc_accept(SB)
-TEXT ·libc_bind_trampoline(SB),NOSPLIT,$0-0
- JMP libc_bind(SB)
-TEXT ·libc_connect_trampoline(SB),NOSPLIT,$0-0
- JMP libc_connect(SB)
-TEXT ·libc_socket_trampoline(SB),NOSPLIT,$0-0
- JMP libc_socket(SB)
-TEXT ·libc_getsockopt_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getsockopt(SB)
-TEXT ·libc_setsockopt_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setsockopt(SB)
-TEXT ·libc_getpeername_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getpeername(SB)
-TEXT ·libc_getsockname_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getsockname(SB)
-TEXT ·libc_shutdown_trampoline(SB),NOSPLIT,$0-0
- JMP libc_shutdown(SB)
-TEXT ·libc_socketpair_trampoline(SB),NOSPLIT,$0-0
- JMP libc_socketpair(SB)
-TEXT ·libc_recvfrom_trampoline(SB),NOSPLIT,$0-0
- JMP libc_recvfrom(SB)
-TEXT ·libc_sendto_trampoline(SB),NOSPLIT,$0-0
- JMP libc_sendto(SB)
-TEXT ·libc_recvmsg_trampoline(SB),NOSPLIT,$0-0
- JMP libc_recvmsg(SB)
-TEXT ·libc_sendmsg_trampoline(SB),NOSPLIT,$0-0
- JMP libc_sendmsg(SB)
-TEXT ·libc_kevent_trampoline(SB),NOSPLIT,$0-0
- JMP libc_kevent(SB)
-TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0
- JMP libc_utimes(SB)
-TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0
- JMP libc_futimes(SB)
-TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0
- JMP libc_poll(SB)
-TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0
- JMP libc_madvise(SB)
-TEXT ·libc_mlock_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mlock(SB)
-TEXT ·libc_mlockall_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mlockall(SB)
-TEXT ·libc_mprotect_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mprotect(SB)
-TEXT ·libc_msync_trampoline(SB),NOSPLIT,$0-0
- JMP libc_msync(SB)
-TEXT ·libc_munlock_trampoline(SB),NOSPLIT,$0-0
- JMP libc_munlock(SB)
-TEXT ·libc_munlockall_trampoline(SB),NOSPLIT,$0-0
- JMP libc_munlockall(SB)
-TEXT ·libc_pipe_trampoline(SB),NOSPLIT,$0-0
- JMP libc_pipe(SB)
-TEXT ·libc_getxattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getxattr(SB)
-TEXT ·libc_fgetxattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fgetxattr(SB)
-TEXT ·libc_setxattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setxattr(SB)
-TEXT ·libc_fsetxattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fsetxattr(SB)
-TEXT ·libc_removexattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_removexattr(SB)
-TEXT ·libc_fremovexattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fremovexattr(SB)
-TEXT ·libc_listxattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_listxattr(SB)
-TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_flistxattr(SB)
-TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setattrlist(SB)
-TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fcntl(SB)
-TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
- JMP libc_kill(SB)
-TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
- JMP libc_ioctl(SB)
-TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0
- JMP libc_sysctl(SB)
-TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0
- JMP libc_sendfile(SB)
-TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0
- JMP libc_access(SB)
-TEXT ·libc_adjtime_trampoline(SB),NOSPLIT,$0-0
- JMP libc_adjtime(SB)
-TEXT ·libc_chdir_trampoline(SB),NOSPLIT,$0-0
- JMP libc_chdir(SB)
-TEXT ·libc_chflags_trampoline(SB),NOSPLIT,$0-0
- JMP libc_chflags(SB)
-TEXT ·libc_chmod_trampoline(SB),NOSPLIT,$0-0
- JMP libc_chmod(SB)
-TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0
- JMP libc_chown(SB)
-TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0
- JMP libc_chroot(SB)
-TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0
- JMP libc_clock_gettime(SB)
-TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
- JMP libc_close(SB)
-TEXT ·libc_clonefile_trampoline(SB),NOSPLIT,$0-0
- JMP libc_clonefile(SB)
-TEXT ·libc_clonefileat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_clonefileat(SB)
-TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
- JMP libc_dup(SB)
-TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
- JMP libc_dup2(SB)
-TEXT ·libc_exchangedata_trampoline(SB),NOSPLIT,$0-0
- JMP libc_exchangedata(SB)
-TEXT ·libc_exit_trampoline(SB),NOSPLIT,$0-0
- JMP libc_exit(SB)
-TEXT ·libc_faccessat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_faccessat(SB)
-TEXT ·libc_fchdir_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fchdir(SB)
-TEXT ·libc_fchflags_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fchflags(SB)
-TEXT ·libc_fchmod_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fchmod(SB)
-TEXT ·libc_fchmodat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fchmodat(SB)
-TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fchown(SB)
-TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fchownat(SB)
-TEXT ·libc_fclonefileat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fclonefileat(SB)
-TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
- JMP libc_flock(SB)
-TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fpathconf(SB)
-TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fsync(SB)
-TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0
- JMP libc_ftruncate(SB)
-TEXT ·libc_getcwd_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getcwd(SB)
-TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getdtablesize(SB)
-TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getegid(SB)
-TEXT ·libc_geteuid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_geteuid(SB)
-TEXT ·libc_getgid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getgid(SB)
-TEXT ·libc_getpgid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getpgid(SB)
-TEXT ·libc_getpgrp_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getpgrp(SB)
-TEXT ·libc_getpid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getpid(SB)
-TEXT ·libc_getppid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getppid(SB)
-TEXT ·libc_getpriority_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getpriority(SB)
-TEXT ·libc_getrlimit_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getrlimit(SB)
-TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getrusage(SB)
-TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getsid(SB)
-TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
- JMP libc_gettimeofday(SB)
-TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getuid(SB)
-TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_issetugid(SB)
-TEXT ·libc_kqueue_trampoline(SB),NOSPLIT,$0-0
- JMP libc_kqueue(SB)
-TEXT ·libc_lchown_trampoline(SB),NOSPLIT,$0-0
- JMP libc_lchown(SB)
-TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0
- JMP libc_link(SB)
-TEXT ·libc_linkat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_linkat(SB)
-TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0
- JMP libc_listen(SB)
-TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mkdir(SB)
-TEXT ·libc_mkdirat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mkdirat(SB)
-TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mkfifo(SB)
-TEXT ·libc_mknod_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mknod(SB)
-TEXT ·libc_open_trampoline(SB),NOSPLIT,$0-0
- JMP libc_open(SB)
-TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_openat(SB)
-TEXT ·libc_pathconf_trampoline(SB),NOSPLIT,$0-0
- JMP libc_pathconf(SB)
-TEXT ·libc_pread_trampoline(SB),NOSPLIT,$0-0
- JMP libc_pread(SB)
-TEXT ·libc_pwrite_trampoline(SB),NOSPLIT,$0-0
- JMP libc_pwrite(SB)
-TEXT ·libc_read_trampoline(SB),NOSPLIT,$0-0
- JMP libc_read(SB)
-TEXT ·libc_readlink_trampoline(SB),NOSPLIT,$0-0
- JMP libc_readlink(SB)
-TEXT ·libc_readlinkat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_readlinkat(SB)
-TEXT ·libc_rename_trampoline(SB),NOSPLIT,$0-0
- JMP libc_rename(SB)
-TEXT ·libc_renameat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_renameat(SB)
-TEXT ·libc_revoke_trampoline(SB),NOSPLIT,$0-0
- JMP libc_revoke(SB)
-TEXT ·libc_rmdir_trampoline(SB),NOSPLIT,$0-0
- JMP libc_rmdir(SB)
-TEXT ·libc_lseek_trampoline(SB),NOSPLIT,$0-0
- JMP libc_lseek(SB)
-TEXT ·libc_select_trampoline(SB),NOSPLIT,$0-0
- JMP libc_select(SB)
-TEXT ·libc_setegid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setegid(SB)
-TEXT ·libc_seteuid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_seteuid(SB)
-TEXT ·libc_setgid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setgid(SB)
-TEXT ·libc_setlogin_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setlogin(SB)
-TEXT ·libc_setpgid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setpgid(SB)
-TEXT ·libc_setpriority_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setpriority(SB)
-TEXT ·libc_setprivexec_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setprivexec(SB)
-TEXT ·libc_setregid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setregid(SB)
-TEXT ·libc_setreuid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setreuid(SB)
-TEXT ·libc_setrlimit_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setrlimit(SB)
-TEXT ·libc_setsid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setsid(SB)
-TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0
- JMP libc_settimeofday(SB)
-TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setuid(SB)
-TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0
- JMP libc_symlink(SB)
-TEXT ·libc_symlinkat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_symlinkat(SB)
-TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0
- JMP libc_sync(SB)
-TEXT ·libc_truncate_trampoline(SB),NOSPLIT,$0-0
- JMP libc_truncate(SB)
-TEXT ·libc_umask_trampoline(SB),NOSPLIT,$0-0
- JMP libc_umask(SB)
-TEXT ·libc_undelete_trampoline(SB),NOSPLIT,$0-0
- JMP libc_undelete(SB)
-TEXT ·libc_unlink_trampoline(SB),NOSPLIT,$0-0
- JMP libc_unlink(SB)
-TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_unlinkat(SB)
-TEXT ·libc_unmount_trampoline(SB),NOSPLIT,$0-0
- JMP libc_unmount(SB)
-TEXT ·libc_write_trampoline(SB),NOSPLIT,$0-0
- JMP libc_write(SB)
-TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mmap(SB)
-TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
- JMP libc_munmap(SB)
-TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fstat64(SB)
-TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fstatat64(SB)
-TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fstatfs64(SB)
-TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getfsstat64(SB)
-TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0
- JMP libc_lstat64(SB)
-TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0
- JMP libc_ptrace(SB)
-TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0
- JMP libc_stat64(SB)
-TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0
- JMP libc_statfs64(SB)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go
index e36299ead..a06eb0932 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go
@@ -16,25 +16,25 @@ var _ syscall.Errno
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func closedir(dir uintptr) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0)
+ _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_closedir_trampoline()
+var libc_closedir_trampoline_addr uintptr
//go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) {
- r0, _, _ := syscall_syscall(funcPC(libc_readdir_r_trampoline), uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
+ r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
res = Errno(r0)
return
}
-func libc_readdir_r_trampoline()
+var libc_readdir_r_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib"
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s
index d671e8311..d6c3e25c0 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s
@@ -1,12 +1,25 @@
// go run mkasm_darwin.go amd64
// Code generated by the command above; DO NOT EDIT.
+//go:build go1.13
// +build go1.13
#include "textflag.h"
-TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0
+
+TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fdopendir(SB)
-TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB)
+
+TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_closedir(SB)
-TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8
+DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB)
+
+TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readdir_r(SB)
+
+GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8
+DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
index f41116288..d4efe8d45 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
@@ -16,7 +16,7 @@ var _ syscall.Errno
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_getgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
+ r0, _, e1 := syscall_rawSyscall(libc_getgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -24,28 +24,28 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
return
}
-func libc_getgroups_trampoline()
+var libc_getgroups_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getgroups getgroups "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func setgroups(ngid int, gid *_Gid_t) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
+ _, _, e1 := syscall_rawSyscall(libc_setgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setgroups_trampoline()
+var libc_setgroups_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setgroups setgroups "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_wait4_trampoline), uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_wait4_trampoline_addr, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -53,14 +53,14 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
return
}
-func libc_wait4_trampoline()
+var libc_wait4_trampoline_addr uintptr
//go:cgo_import_dynamic libc_wait4 wait4 "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_accept_trampoline), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
+ r0, _, e1 := syscall_syscall(libc_accept_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -68,42 +68,42 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
return
}
-func libc_accept_trampoline()
+var libc_accept_trampoline_addr uintptr
//go:cgo_import_dynamic libc_accept accept "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_bind_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen))
+ _, _, e1 := syscall_syscall(libc_bind_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_bind_trampoline()
+var libc_bind_trampoline_addr uintptr
//go:cgo_import_dynamic libc_bind bind "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_connect_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen))
+ _, _, e1 := syscall_syscall(libc_connect_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_connect_trampoline()
+var libc_connect_trampoline_addr uintptr
//go:cgo_import_dynamic libc_connect connect "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func socket(domain int, typ int, proto int) (fd int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_socket_trampoline), uintptr(domain), uintptr(typ), uintptr(proto))
+ r0, _, e1 := syscall_rawSyscall(libc_socket_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -111,91 +111,91 @@ func socket(domain int, typ int, proto int) (fd int, err error) {
return
}
-func libc_socket_trampoline()
+var libc_socket_trampoline_addr uintptr
//go:cgo_import_dynamic libc_socket socket "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_getsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
+ _, _, e1 := syscall_syscall6(libc_getsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_getsockopt_trampoline()
+var libc_getsockopt_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getsockopt getsockopt "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_setsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
+ _, _, e1 := syscall_syscall6(libc_setsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setsockopt_trampoline()
+var libc_setsockopt_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setsockopt setsockopt "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getpeername_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
+ _, _, e1 := syscall_rawSyscall(libc_getpeername_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_getpeername_trampoline()
+var libc_getpeername_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getpeername getpeername "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getsockname_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
+ _, _, e1 := syscall_rawSyscall(libc_getsockname_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_getsockname_trampoline()
+var libc_getsockname_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getsockname getsockname "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Shutdown(s int, how int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_shutdown_trampoline), uintptr(s), uintptr(how), 0)
+ _, _, e1 := syscall_syscall(libc_shutdown_trampoline_addr, uintptr(s), uintptr(how), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_shutdown_trampoline()
+var libc_shutdown_trampoline_addr uintptr
//go:cgo_import_dynamic libc_shutdown shutdown "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
- _, _, e1 := syscall_rawSyscall6(funcPC(libc_socketpair_trampoline), uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
+ _, _, e1 := syscall_rawSyscall6(libc_socketpair_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_socketpair_trampoline()
+var libc_socketpair_trampoline_addr uintptr
//go:cgo_import_dynamic libc_socketpair socketpair "/usr/lib/libSystem.B.dylib"
@@ -208,7 +208,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl
} else {
_p0 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_recvfrom_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
+ r0, _, e1 := syscall_syscall6(libc_recvfrom_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -216,7 +216,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl
return
}
-func libc_recvfrom_trampoline()
+var libc_recvfrom_trampoline_addr uintptr
//go:cgo_import_dynamic libc_recvfrom recvfrom "/usr/lib/libSystem.B.dylib"
@@ -229,21 +229,21 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall6(funcPC(libc_sendto_trampoline), uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
+ _, _, e1 := syscall_syscall6(libc_sendto_trampoline_addr, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_sendto_trampoline()
+var libc_sendto_trampoline_addr uintptr
//go:cgo_import_dynamic libc_sendto sendto "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_recvmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
+ r0, _, e1 := syscall_syscall(libc_recvmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -251,14 +251,14 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
return
}
-func libc_recvmsg_trampoline()
+var libc_recvmsg_trampoline_addr uintptr
//go:cgo_import_dynamic libc_recvmsg recvmsg "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_sendmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
+ r0, _, e1 := syscall_syscall(libc_sendmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -266,14 +266,14 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
return
}
-func libc_sendmsg_trampoline()
+var libc_sendmsg_trampoline_addr uintptr
//go:cgo_import_dynamic libc_sendmsg sendmsg "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_kevent_trampoline), uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
+ r0, _, e1 := syscall_syscall6(libc_kevent_trampoline_addr, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -281,7 +281,7 @@ func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, ne
return
}
-func libc_kevent_trampoline()
+var libc_kevent_trampoline_addr uintptr
//go:cgo_import_dynamic libc_kevent kevent "/usr/lib/libSystem.B.dylib"
@@ -293,35 +293,35 @@ func utimes(path string, timeval *[2]Timeval) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_utimes_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
+ _, _, e1 := syscall_syscall(libc_utimes_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_utimes_trampoline()
+var libc_utimes_trampoline_addr uintptr
//go:cgo_import_dynamic libc_utimes utimes "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func futimes(fd int, timeval *[2]Timeval) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_futimes_trampoline), uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
+ _, _, e1 := syscall_syscall(libc_futimes_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_futimes_trampoline()
+var libc_futimes_trampoline_addr uintptr
//go:cgo_import_dynamic libc_futimes futimes "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
+ r0, _, e1 := syscall_syscall(libc_poll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -329,7 +329,7 @@ func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
return
}
-func libc_poll_trampoline()
+var libc_poll_trampoline_addr uintptr
//go:cgo_import_dynamic libc_poll poll "/usr/lib/libSystem.B.dylib"
@@ -342,14 +342,14 @@ func Madvise(b []byte, behav int) (err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall(funcPC(libc_madvise_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(behav))
+ _, _, e1 := syscall_syscall(libc_madvise_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(behav))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_madvise_trampoline()
+var libc_madvise_trampoline_addr uintptr
//go:cgo_import_dynamic libc_madvise madvise "/usr/lib/libSystem.B.dylib"
@@ -362,28 +362,28 @@ func Mlock(b []byte) (err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall(funcPC(libc_mlock_trampoline), uintptr(_p0), uintptr(len(b)), 0)
+ _, _, e1 := syscall_syscall(libc_mlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mlock_trampoline()
+var libc_mlock_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mlock mlock "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlockall(flags int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_mlockall_trampoline), uintptr(flags), 0, 0)
+ _, _, e1 := syscall_syscall(libc_mlockall_trampoline_addr, uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mlockall_trampoline()
+var libc_mlockall_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mlockall mlockall "/usr/lib/libSystem.B.dylib"
@@ -396,14 +396,14 @@ func Mprotect(b []byte, prot int) (err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall(funcPC(libc_mprotect_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(prot))
+ _, _, e1 := syscall_syscall(libc_mprotect_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(prot))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mprotect_trampoline()
+var libc_mprotect_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mprotect mprotect "/usr/lib/libSystem.B.dylib"
@@ -416,14 +416,14 @@ func Msync(b []byte, flags int) (err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall(funcPC(libc_msync_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(flags))
+ _, _, e1 := syscall_syscall(libc_msync_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_msync_trampoline()
+var libc_msync_trampoline_addr uintptr
//go:cgo_import_dynamic libc_msync msync "/usr/lib/libSystem.B.dylib"
@@ -436,42 +436,42 @@ func Munlock(b []byte) (err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall(funcPC(libc_munlock_trampoline), uintptr(_p0), uintptr(len(b)), 0)
+ _, _, e1 := syscall_syscall(libc_munlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_munlock_trampoline()
+var libc_munlock_trampoline_addr uintptr
//go:cgo_import_dynamic libc_munlock munlock "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlockall() (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_munlockall_trampoline), 0, 0, 0)
+ _, _, e1 := syscall_syscall(libc_munlockall_trampoline_addr, 0, 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_munlockall_trampoline()
+var libc_munlockall_trampoline_addr uintptr
//go:cgo_import_dynamic libc_munlockall munlockall "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pipe(p *[2]int32) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), uintptr(unsafe.Pointer(p)), 0, 0)
+ _, _, e1 := syscall_rawSyscall(libc_pipe_trampoline_addr, uintptr(unsafe.Pointer(p)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_pipe_trampoline()
+var libc_pipe_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pipe pipe "/usr/lib/libSystem.B.dylib"
@@ -488,7 +488,7 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o
if err != nil {
return
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_getxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
+ r0, _, e1 := syscall_syscall6(libc_getxattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -496,7 +496,7 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o
return
}
-func libc_getxattr_trampoline()
+var libc_getxattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getxattr getxattr "/usr/lib/libSystem.B.dylib"
@@ -508,7 +508,7 @@ func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, optio
if err != nil {
return
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_fgetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
+ r0, _, e1 := syscall_syscall6(libc_fgetxattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -516,7 +516,7 @@ func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, optio
return
}
-func libc_fgetxattr_trampoline()
+var libc_fgetxattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fgetxattr fgetxattr "/usr/lib/libSystem.B.dylib"
@@ -533,14 +533,14 @@ func setxattr(path string, attr string, data *byte, size int, position uint32, o
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_setxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
+ _, _, e1 := syscall_syscall6(libc_setxattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setxattr_trampoline()
+var libc_setxattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setxattr setxattr "/usr/lib/libSystem.B.dylib"
@@ -552,14 +552,14 @@ func fsetxattr(fd int, attr string, data *byte, size int, position uint32, optio
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_fsetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
+ _, _, e1 := syscall_syscall6(libc_fsetxattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fsetxattr_trampoline()
+var libc_fsetxattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fsetxattr fsetxattr "/usr/lib/libSystem.B.dylib"
@@ -576,14 +576,14 @@ func removexattr(path string, attr string, options int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_removexattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
+ _, _, e1 := syscall_syscall(libc_removexattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_removexattr_trampoline()
+var libc_removexattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_removexattr removexattr "/usr/lib/libSystem.B.dylib"
@@ -595,14 +595,14 @@ func fremovexattr(fd int, attr string, options int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_fremovexattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options))
+ _, _, e1 := syscall_syscall(libc_fremovexattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fremovexattr_trampoline()
+var libc_fremovexattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fremovexattr fremovexattr "/usr/lib/libSystem.B.dylib"
@@ -614,7 +614,7 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro
if err != nil {
return
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_listxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_listxattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -622,14 +622,14 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro
return
}
-func libc_listxattr_trampoline()
+var libc_listxattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_listxattr listxattr "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_flistxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_flistxattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -637,28 +637,28 @@ func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) {
return
}
-func libc_flistxattr_trampoline()
+var libc_flistxattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_flistxattr flistxattr "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_setattrlist_trampoline), uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0)
+ _, _, e1 := syscall_syscall6(libc_setattrlist_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setattrlist_trampoline()
+var libc_setattrlist_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setattrlist setattrlist "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fcntl(fd int, cmd int, arg int) (val int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg))
+ r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -666,35 +666,35 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) {
return
}
-func libc_fcntl_trampoline()
+var libc_fcntl_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func kill(pid int, signum int, posix int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix))
+ _, _, e1 := syscall_syscall(libc_kill_trampoline_addr, uintptr(pid), uintptr(signum), uintptr(posix))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_kill_trampoline()
+var libc_kill_trampoline_addr uintptr
//go:cgo_import_dynamic libc_kill kill "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ioctl(fd int, req uint, arg uintptr) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_ioctl_trampoline), uintptr(fd), uintptr(req), uintptr(arg))
+ _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_ioctl_trampoline()
+var libc_ioctl_trampoline_addr uintptr
//go:cgo_import_dynamic libc_ioctl ioctl "/usr/lib/libSystem.B.dylib"
@@ -707,28 +707,28 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr)
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall6(funcPC(libc_sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
+ _, _, e1 := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_sysctl_trampoline()
+var libc_sysctl_trampoline_addr uintptr
//go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
+ _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_sendfile_trampoline()
+var libc_sendfile_trampoline_addr uintptr
//go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib"
@@ -740,28 +740,28 @@ func Access(path string, mode uint32) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_access_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
+ _, _, e1 := syscall_syscall(libc_access_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_access_trampoline()
+var libc_access_trampoline_addr uintptr
//go:cgo_import_dynamic libc_access access "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_adjtime_trampoline), uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
+ _, _, e1 := syscall_syscall(libc_adjtime_trampoline_addr, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_adjtime_trampoline()
+var libc_adjtime_trampoline_addr uintptr
//go:cgo_import_dynamic libc_adjtime adjtime "/usr/lib/libSystem.B.dylib"
@@ -773,14 +773,14 @@ func Chdir(path string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_chdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_chdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_chdir_trampoline()
+var libc_chdir_trampoline_addr uintptr
//go:cgo_import_dynamic libc_chdir chdir "/usr/lib/libSystem.B.dylib"
@@ -792,14 +792,14 @@ func Chflags(path string, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_chflags_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
+ _, _, e1 := syscall_syscall(libc_chflags_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_chflags_trampoline()
+var libc_chflags_trampoline_addr uintptr
//go:cgo_import_dynamic libc_chflags chflags "/usr/lib/libSystem.B.dylib"
@@ -811,14 +811,14 @@ func Chmod(path string, mode uint32) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_chmod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
+ _, _, e1 := syscall_syscall(libc_chmod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_chmod_trampoline()
+var libc_chmod_trampoline_addr uintptr
//go:cgo_import_dynamic libc_chmod chmod "/usr/lib/libSystem.B.dylib"
@@ -830,14 +830,14 @@ func Chown(path string, uid int, gid int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_chown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
+ _, _, e1 := syscall_syscall(libc_chown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_chown_trampoline()
+var libc_chown_trampoline_addr uintptr
//go:cgo_import_dynamic libc_chown chown "/usr/lib/libSystem.B.dylib"
@@ -849,42 +849,42 @@ func Chroot(path string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_chroot_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_chroot_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_chroot_trampoline()
+var libc_chroot_trampoline_addr uintptr
//go:cgo_import_dynamic libc_chroot chroot "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ClockGettime(clockid int32, time *Timespec) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_clock_gettime_trampoline), uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)
+ _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_clock_gettime_trampoline()
+var libc_clock_gettime_trampoline_addr uintptr
//go:cgo_import_dynamic libc_clock_gettime clock_gettime "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Close(fd int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_close_trampoline), uintptr(fd), 0, 0)
+ _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_close_trampoline()
+var libc_close_trampoline_addr uintptr
//go:cgo_import_dynamic libc_close close "/usr/lib/libSystem.B.dylib"
@@ -901,14 +901,14 @@ func Clonefile(src string, dst string, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_clonefile_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags))
+ _, _, e1 := syscall_syscall(libc_clonefile_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_clonefile_trampoline()
+var libc_clonefile_trampoline_addr uintptr
//go:cgo_import_dynamic libc_clonefile clonefile "/usr/lib/libSystem.B.dylib"
@@ -925,21 +925,21 @@ func Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int)
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_clonefileat_trampoline), uintptr(srcDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
+ _, _, e1 := syscall_syscall6(libc_clonefileat_trampoline_addr, uintptr(srcDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_clonefileat_trampoline()
+var libc_clonefileat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_clonefileat clonefileat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup(fd int) (nfd int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0)
+ r0, _, e1 := syscall_syscall(libc_dup_trampoline_addr, uintptr(fd), 0, 0)
nfd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -947,21 +947,21 @@ func Dup(fd int) (nfd int, err error) {
return
}
-func libc_dup_trampoline()
+var libc_dup_trampoline_addr uintptr
//go:cgo_import_dynamic libc_dup dup "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup2(from int, to int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_dup2_trampoline), uintptr(from), uintptr(to), 0)
+ _, _, e1 := syscall_syscall(libc_dup2_trampoline_addr, uintptr(from), uintptr(to), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_dup2_trampoline()
+var libc_dup2_trampoline_addr uintptr
//go:cgo_import_dynamic libc_dup2 dup2 "/usr/lib/libSystem.B.dylib"
@@ -978,25 +978,25 @@ func Exchangedata(path1 string, path2 string, options int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_exchangedata_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
+ _, _, e1 := syscall_syscall(libc_exchangedata_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_exchangedata_trampoline()
+var libc_exchangedata_trampoline_addr uintptr
//go:cgo_import_dynamic libc_exchangedata exchangedata "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Exit(code int) {
- syscall_syscall(funcPC(libc_exit_trampoline), uintptr(code), 0, 0)
+ syscall_syscall(libc_exit_trampoline_addr, uintptr(code), 0, 0)
return
}
-func libc_exit_trampoline()
+var libc_exit_trampoline_addr uintptr
//go:cgo_import_dynamic libc_exit exit "/usr/lib/libSystem.B.dylib"
@@ -1008,56 +1008,56 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_faccessat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
+ _, _, e1 := syscall_syscall6(libc_faccessat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_faccessat_trampoline()
+var libc_faccessat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_faccessat faccessat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchdir(fd int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchdir_trampoline), uintptr(fd), 0, 0)
+ _, _, e1 := syscall_syscall(libc_fchdir_trampoline_addr, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fchdir_trampoline()
+var libc_fchdir_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fchdir fchdir "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchflags(fd int, flags int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchflags_trampoline), uintptr(fd), uintptr(flags), 0)
+ _, _, e1 := syscall_syscall(libc_fchflags_trampoline_addr, uintptr(fd), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fchflags_trampoline()
+var libc_fchflags_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fchflags fchflags "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchmod(fd int, mode uint32) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchmod_trampoline), uintptr(fd), uintptr(mode), 0)
+ _, _, e1 := syscall_syscall(libc_fchmod_trampoline_addr, uintptr(fd), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fchmod_trampoline()
+var libc_fchmod_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fchmod fchmod "/usr/lib/libSystem.B.dylib"
@@ -1069,28 +1069,28 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_fchmodat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
+ _, _, e1 := syscall_syscall6(libc_fchmodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fchmodat_trampoline()
+var libc_fchmodat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fchmodat fchmodat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchown(fd int, uid int, gid int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchown_trampoline), uintptr(fd), uintptr(uid), uintptr(gid))
+ _, _, e1 := syscall_syscall(libc_fchown_trampoline_addr, uintptr(fd), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fchown_trampoline()
+var libc_fchown_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fchown fchown "/usr/lib/libSystem.B.dylib"
@@ -1102,14 +1102,14 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_fchownat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
+ _, _, e1 := syscall_syscall6(libc_fchownat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fchownat_trampoline()
+var libc_fchownat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fchownat fchownat "/usr/lib/libSystem.B.dylib"
@@ -1121,35 +1121,35 @@ func Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error)
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_fclonefileat_trampoline), uintptr(srcDirfd), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0)
+ _, _, e1 := syscall_syscall6(libc_fclonefileat_trampoline_addr, uintptr(srcDirfd), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fclonefileat_trampoline()
+var libc_fclonefileat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fclonefileat fclonefileat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Flock(fd int, how int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0)
+ _, _, e1 := syscall_syscall(libc_flock_trampoline_addr, uintptr(fd), uintptr(how), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_flock_trampoline()
+var libc_flock_trampoline_addr uintptr
//go:cgo_import_dynamic libc_flock flock "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fpathconf(fd int, name int) (val int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_fpathconf_trampoline), uintptr(fd), uintptr(name), 0)
+ r0, _, e1 := syscall_syscall(libc_fpathconf_trampoline_addr, uintptr(fd), uintptr(name), 0)
val = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1157,35 +1157,35 @@ func Fpathconf(fd int, name int) (val int, err error) {
return
}
-func libc_fpathconf_trampoline()
+var libc_fpathconf_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fsync(fd int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fsync_trampoline), uintptr(fd), 0, 0)
+ _, _, e1 := syscall_syscall(libc_fsync_trampoline_addr, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fsync_trampoline()
+var libc_fsync_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fsync fsync "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Ftruncate(fd int, length int64) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_ftruncate_trampoline), uintptr(fd), uintptr(length), 0)
+ _, _, e1 := syscall_syscall(libc_ftruncate_trampoline_addr, uintptr(fd), uintptr(length), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_ftruncate_trampoline()
+var libc_ftruncate_trampoline_addr uintptr
//go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib"
@@ -1198,7 +1198,7 @@ func Getcwd(buf []byte) (n int, err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall(funcPC(libc_getcwd_trampoline), uintptr(_p0), uintptr(len(buf)), 0)
+ r0, _, e1 := syscall_syscall(libc_getcwd_trampoline_addr, uintptr(_p0), uintptr(len(buf)), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1206,62 +1206,62 @@ func Getcwd(buf []byte) (n int, err error) {
return
}
-func libc_getcwd_trampoline()
+var libc_getcwd_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getcwd getcwd "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getdtablesize() (size int) {
- r0, _, _ := syscall_syscall(funcPC(libc_getdtablesize_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_syscall(libc_getdtablesize_trampoline_addr, 0, 0, 0)
size = int(r0)
return
}
-func libc_getdtablesize_trampoline()
+var libc_getdtablesize_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getdtablesize getdtablesize "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getegid() (egid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getegid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_getegid_trampoline_addr, 0, 0, 0)
egid = int(r0)
return
}
-func libc_getegid_trampoline()
+var libc_getegid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getegid getegid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Geteuid() (uid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_geteuid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_geteuid_trampoline_addr, 0, 0, 0)
uid = int(r0)
return
}
-func libc_geteuid_trampoline()
+var libc_geteuid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_geteuid geteuid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getgid() (gid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getgid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_getgid_trampoline_addr, 0, 0, 0)
gid = int(r0)
return
}
-func libc_getgid_trampoline()
+var libc_getgid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getgid getgid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpgid(pid int) (pgid int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_getpgid_trampoline), uintptr(pid), 0, 0)
+ r0, _, e1 := syscall_rawSyscall(libc_getpgid_trampoline_addr, uintptr(pid), 0, 0)
pgid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1269,50 +1269,50 @@ func Getpgid(pid int) (pgid int, err error) {
return
}
-func libc_getpgid_trampoline()
+var libc_getpgid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getpgid getpgid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpgrp() (pgrp int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getpgrp_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_getpgrp_trampoline_addr, 0, 0, 0)
pgrp = int(r0)
return
}
-func libc_getpgrp_trampoline()
+var libc_getpgrp_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getpgrp getpgrp "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpid() (pid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getpid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_getpid_trampoline_addr, 0, 0, 0)
pid = int(r0)
return
}
-func libc_getpid_trampoline()
+var libc_getpid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getpid getpid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getppid() (ppid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getppid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_getppid_trampoline_addr, 0, 0, 0)
ppid = int(r0)
return
}
-func libc_getppid_trampoline()
+var libc_getppid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getppid getppid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpriority(which int, who int) (prio int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_getpriority_trampoline), uintptr(which), uintptr(who), 0)
+ r0, _, e1 := syscall_syscall(libc_getpriority_trampoline_addr, uintptr(which), uintptr(who), 0)
prio = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1320,42 +1320,42 @@ func Getpriority(which int, who int) (prio int, err error) {
return
}
-func libc_getpriority_trampoline()
+var libc_getpriority_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getpriority getpriority "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getrlimit(which int, lim *Rlimit) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
+ _, _, e1 := syscall_rawSyscall(libc_getrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_getrlimit_trampoline()
+var libc_getrlimit_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getrlimit getrlimit "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getrusage(who int, rusage *Rusage) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getrusage_trampoline), uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
+ _, _, e1 := syscall_rawSyscall(libc_getrusage_trampoline_addr, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_getrusage_trampoline()
+var libc_getrusage_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getrusage getrusage "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getsid(pid int) (sid int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_getsid_trampoline), uintptr(pid), 0, 0)
+ r0, _, e1 := syscall_rawSyscall(libc_getsid_trampoline_addr, uintptr(pid), 0, 0)
sid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1363,52 +1363,52 @@ func Getsid(pid int) (sid int, err error) {
return
}
-func libc_getsid_trampoline()
+var libc_getsid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getsid getsid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Gettimeofday(tp *Timeval) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
+ _, _, e1 := syscall_rawSyscall(libc_gettimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_gettimeofday_trampoline()
+var libc_gettimeofday_trampoline_addr uintptr
//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getuid() (uid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_getuid_trampoline_addr, 0, 0, 0)
uid = int(r0)
return
}
-func libc_getuid_trampoline()
+var libc_getuid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getuid getuid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Issetugid() (tainted bool) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_issetugid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_issetugid_trampoline_addr, 0, 0, 0)
tainted = bool(r0 != 0)
return
}
-func libc_issetugid_trampoline()
+var libc_issetugid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_issetugid issetugid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Kqueue() (fd int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_kqueue_trampoline), 0, 0, 0)
+ r0, _, e1 := syscall_syscall(libc_kqueue_trampoline_addr, 0, 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1416,7 +1416,7 @@ func Kqueue() (fd int, err error) {
return
}
-func libc_kqueue_trampoline()
+var libc_kqueue_trampoline_addr uintptr
//go:cgo_import_dynamic libc_kqueue kqueue "/usr/lib/libSystem.B.dylib"
@@ -1428,14 +1428,14 @@ func Lchown(path string, uid int, gid int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_lchown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
+ _, _, e1 := syscall_syscall(libc_lchown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_lchown_trampoline()
+var libc_lchown_trampoline_addr uintptr
//go:cgo_import_dynamic libc_lchown lchown "/usr/lib/libSystem.B.dylib"
@@ -1452,14 +1452,14 @@ func Link(path string, link string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_link_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
+ _, _, e1 := syscall_syscall(libc_link_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_link_trampoline()
+var libc_link_trampoline_addr uintptr
//go:cgo_import_dynamic libc_link link "/usr/lib/libSystem.B.dylib"
@@ -1476,28 +1476,28 @@ func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err er
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_linkat_trampoline), uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
+ _, _, e1 := syscall_syscall6(libc_linkat_trampoline_addr, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_linkat_trampoline()
+var libc_linkat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_linkat linkat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Listen(s int, backlog int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_listen_trampoline), uintptr(s), uintptr(backlog), 0)
+ _, _, e1 := syscall_syscall(libc_listen_trampoline_addr, uintptr(s), uintptr(backlog), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_listen_trampoline()
+var libc_listen_trampoline_addr uintptr
//go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib"
@@ -1509,14 +1509,14 @@ func Mkdir(path string, mode uint32) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_mkdir_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
+ _, _, e1 := syscall_syscall(libc_mkdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mkdir_trampoline()
+var libc_mkdir_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mkdir mkdir "/usr/lib/libSystem.B.dylib"
@@ -1528,14 +1528,14 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_mkdirat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
+ _, _, e1 := syscall_syscall(libc_mkdirat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mkdirat_trampoline()
+var libc_mkdirat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mkdirat mkdirat "/usr/lib/libSystem.B.dylib"
@@ -1547,14 +1547,14 @@ func Mkfifo(path string, mode uint32) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_mkfifo_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
+ _, _, e1 := syscall_syscall(libc_mkfifo_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mkfifo_trampoline()
+var libc_mkfifo_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mkfifo mkfifo "/usr/lib/libSystem.B.dylib"
@@ -1566,14 +1566,14 @@ func Mknod(path string, mode uint32, dev int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_mknod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
+ _, _, e1 := syscall_syscall(libc_mknod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mknod_trampoline()
+var libc_mknod_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mknod mknod "/usr/lib/libSystem.B.dylib"
@@ -1585,7 +1585,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) {
if err != nil {
return
}
- r0, _, e1 := syscall_syscall(funcPC(libc_open_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
+ r0, _, e1 := syscall_syscall(libc_open_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1593,7 +1593,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) {
return
}
-func libc_open_trampoline()
+var libc_open_trampoline_addr uintptr
//go:cgo_import_dynamic libc_open open "/usr/lib/libSystem.B.dylib"
@@ -1605,7 +1605,7 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) {
if err != nil {
return
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_openat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_openat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1613,7 +1613,7 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) {
return
}
-func libc_openat_trampoline()
+var libc_openat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib"
@@ -1625,7 +1625,7 @@ func Pathconf(path string, name int) (val int, err error) {
if err != nil {
return
}
- r0, _, e1 := syscall_syscall(funcPC(libc_pathconf_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
+ r0, _, e1 := syscall_syscall(libc_pathconf_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
val = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1633,7 +1633,7 @@ func Pathconf(path string, name int) (val int, err error) {
return
}
-func libc_pathconf_trampoline()
+var libc_pathconf_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pathconf pathconf "/usr/lib/libSystem.B.dylib"
@@ -1646,7 +1646,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_pread_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_pread_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1654,7 +1654,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) {
return
}
-func libc_pread_trampoline()
+var libc_pread_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pread pread "/usr/lib/libSystem.B.dylib"
@@ -1667,7 +1667,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_pwrite_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_pwrite_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1675,7 +1675,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
return
}
-func libc_pwrite_trampoline()
+var libc_pwrite_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pwrite pwrite "/usr/lib/libSystem.B.dylib"
@@ -1688,7 +1688,7 @@ func read(fd int, p []byte) (n int, err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)))
+ r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1696,7 +1696,7 @@ func read(fd int, p []byte) (n int, err error) {
return
}
-func libc_read_trampoline()
+var libc_read_trampoline_addr uintptr
//go:cgo_import_dynamic libc_read read "/usr/lib/libSystem.B.dylib"
@@ -1714,7 +1714,7 @@ func Readlink(path string, buf []byte) (n int, err error) {
} else {
_p1 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall(funcPC(libc_readlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
+ r0, _, e1 := syscall_syscall(libc_readlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1722,7 +1722,7 @@ func Readlink(path string, buf []byte) (n int, err error) {
return
}
-func libc_readlink_trampoline()
+var libc_readlink_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readlink readlink "/usr/lib/libSystem.B.dylib"
@@ -1740,7 +1740,7 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
} else {
_p1 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_readlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_readlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1748,7 +1748,7 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
return
}
-func libc_readlinkat_trampoline()
+var libc_readlinkat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readlinkat readlinkat "/usr/lib/libSystem.B.dylib"
@@ -1765,14 +1765,14 @@ func Rename(from string, to string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_rename_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
+ _, _, e1 := syscall_syscall(libc_rename_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_rename_trampoline()
+var libc_rename_trampoline_addr uintptr
//go:cgo_import_dynamic libc_rename rename "/usr/lib/libSystem.B.dylib"
@@ -1789,14 +1789,14 @@ func Renameat(fromfd int, from string, tofd int, to string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_renameat_trampoline), uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
+ _, _, e1 := syscall_syscall6(libc_renameat_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_renameat_trampoline()
+var libc_renameat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_renameat renameat "/usr/lib/libSystem.B.dylib"
@@ -1808,14 +1808,14 @@ func Revoke(path string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_revoke_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_revoke_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_revoke_trampoline()
+var libc_revoke_trampoline_addr uintptr
//go:cgo_import_dynamic libc_revoke revoke "/usr/lib/libSystem.B.dylib"
@@ -1827,21 +1827,21 @@ func Rmdir(path string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_rmdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_rmdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_rmdir_trampoline()
+var libc_rmdir_trampoline_addr uintptr
//go:cgo_import_dynamic libc_rmdir rmdir "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_lseek_trampoline), uintptr(fd), uintptr(offset), uintptr(whence))
+ r0, _, e1 := syscall_syscall(libc_lseek_trampoline_addr, uintptr(fd), uintptr(offset), uintptr(whence))
newoffset = int64(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1849,14 +1849,14 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
return
}
-func libc_lseek_trampoline()
+var libc_lseek_trampoline_addr uintptr
//go:cgo_import_dynamic libc_lseek lseek "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_select_trampoline), uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
+ r0, _, e1 := syscall_syscall6(libc_select_trampoline_addr, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1864,49 +1864,49 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
return
}
-func libc_select_trampoline()
+var libc_select_trampoline_addr uintptr
//go:cgo_import_dynamic libc_select select "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setegid(egid int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_setegid_trampoline), uintptr(egid), 0, 0)
+ _, _, e1 := syscall_syscall(libc_setegid_trampoline_addr, uintptr(egid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setegid_trampoline()
+var libc_setegid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setegid setegid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Seteuid(euid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_seteuid_trampoline), uintptr(euid), 0, 0)
+ _, _, e1 := syscall_rawSyscall(libc_seteuid_trampoline_addr, uintptr(euid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_seteuid_trampoline()
+var libc_seteuid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_seteuid seteuid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setgid(gid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setgid_trampoline), uintptr(gid), 0, 0)
+ _, _, e1 := syscall_rawSyscall(libc_setgid_trampoline_addr, uintptr(gid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setgid_trampoline()
+var libc_setgid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setgid setgid "/usr/lib/libSystem.B.dylib"
@@ -1918,105 +1918,105 @@ func Setlogin(name string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_setlogin_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_setlogin_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setlogin_trampoline()
+var libc_setlogin_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setlogin setlogin "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setpgid(pid int, pgid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setpgid_trampoline), uintptr(pid), uintptr(pgid), 0)
+ _, _, e1 := syscall_rawSyscall(libc_setpgid_trampoline_addr, uintptr(pid), uintptr(pgid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setpgid_trampoline()
+var libc_setpgid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setpgid setpgid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setpriority(which int, who int, prio int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_setpriority_trampoline), uintptr(which), uintptr(who), uintptr(prio))
+ _, _, e1 := syscall_syscall(libc_setpriority_trampoline_addr, uintptr(which), uintptr(who), uintptr(prio))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setpriority_trampoline()
+var libc_setpriority_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setpriority setpriority "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setprivexec(flag int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_setprivexec_trampoline), uintptr(flag), 0, 0)
+ _, _, e1 := syscall_syscall(libc_setprivexec_trampoline_addr, uintptr(flag), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setprivexec_trampoline()
+var libc_setprivexec_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setprivexec setprivexec "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setregid(rgid int, egid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setregid_trampoline), uintptr(rgid), uintptr(egid), 0)
+ _, _, e1 := syscall_rawSyscall(libc_setregid_trampoline_addr, uintptr(rgid), uintptr(egid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setregid_trampoline()
+var libc_setregid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setregid setregid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setreuid(ruid int, euid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setreuid_trampoline), uintptr(ruid), uintptr(euid), 0)
+ _, _, e1 := syscall_rawSyscall(libc_setreuid_trampoline_addr, uintptr(ruid), uintptr(euid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setreuid_trampoline()
+var libc_setreuid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setreuid setreuid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setrlimit(which int, lim *Rlimit) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
+ _, _, e1 := syscall_rawSyscall(libc_setrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setrlimit_trampoline()
+var libc_setrlimit_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setrlimit setrlimit "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setsid() (pid int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_setsid_trampoline), 0, 0, 0)
+ r0, _, e1 := syscall_rawSyscall(libc_setsid_trampoline_addr, 0, 0, 0)
pid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -2024,35 +2024,35 @@ func Setsid() (pid int, err error) {
return
}
-func libc_setsid_trampoline()
+var libc_setsid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setsid setsid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Settimeofday(tp *Timeval) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_settimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
+ _, _, e1 := syscall_rawSyscall(libc_settimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_settimeofday_trampoline()
+var libc_settimeofday_trampoline_addr uintptr
//go:cgo_import_dynamic libc_settimeofday settimeofday "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setuid(uid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setuid_trampoline), uintptr(uid), 0, 0)
+ _, _, e1 := syscall_rawSyscall(libc_setuid_trampoline_addr, uintptr(uid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setuid_trampoline()
+var libc_setuid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib"
@@ -2069,14 +2069,14 @@ func Symlink(path string, link string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_symlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
+ _, _, e1 := syscall_syscall(libc_symlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_symlink_trampoline()
+var libc_symlink_trampoline_addr uintptr
//go:cgo_import_dynamic libc_symlink symlink "/usr/lib/libSystem.B.dylib"
@@ -2093,28 +2093,28 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_symlinkat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
+ _, _, e1 := syscall_syscall(libc_symlinkat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_symlinkat_trampoline()
+var libc_symlinkat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_symlinkat symlinkat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Sync() (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_sync_trampoline), 0, 0, 0)
+ _, _, e1 := syscall_syscall(libc_sync_trampoline_addr, 0, 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_sync_trampoline()
+var libc_sync_trampoline_addr uintptr
//go:cgo_import_dynamic libc_sync sync "/usr/lib/libSystem.B.dylib"
@@ -2126,26 +2126,26 @@ func Truncate(path string, length int64) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_truncate_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)
+ _, _, e1 := syscall_syscall(libc_truncate_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_truncate_trampoline()
+var libc_truncate_trampoline_addr uintptr
//go:cgo_import_dynamic libc_truncate truncate "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Umask(newmask int) (oldmask int) {
- r0, _, _ := syscall_syscall(funcPC(libc_umask_trampoline), uintptr(newmask), 0, 0)
+ r0, _, _ := syscall_syscall(libc_umask_trampoline_addr, uintptr(newmask), 0, 0)
oldmask = int(r0)
return
}
-func libc_umask_trampoline()
+var libc_umask_trampoline_addr uintptr
//go:cgo_import_dynamic libc_umask umask "/usr/lib/libSystem.B.dylib"
@@ -2157,14 +2157,14 @@ func Undelete(path string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_undelete_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_undelete_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_undelete_trampoline()
+var libc_undelete_trampoline_addr uintptr
//go:cgo_import_dynamic libc_undelete undelete "/usr/lib/libSystem.B.dylib"
@@ -2176,14 +2176,14 @@ func Unlink(path string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_unlink_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_unlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_unlink_trampoline()
+var libc_unlink_trampoline_addr uintptr
//go:cgo_import_dynamic libc_unlink unlink "/usr/lib/libSystem.B.dylib"
@@ -2195,14 +2195,14 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_unlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
+ _, _, e1 := syscall_syscall(libc_unlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_unlinkat_trampoline()
+var libc_unlinkat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_unlinkat unlinkat "/usr/lib/libSystem.B.dylib"
@@ -2214,14 +2214,14 @@ func Unmount(path string, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_unmount_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
+ _, _, e1 := syscall_syscall(libc_unmount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_unmount_trampoline()
+var libc_unmount_trampoline_addr uintptr
//go:cgo_import_dynamic libc_unmount unmount "/usr/lib/libSystem.B.dylib"
@@ -2234,7 +2234,7 @@ func write(fd int, p []byte) (n int, err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)))
+ r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -2242,14 +2242,14 @@ func write(fd int, p []byte) (n int, err error) {
return
}
-func libc_write_trampoline()
+var libc_write_trampoline_addr uintptr
//go:cgo_import_dynamic libc_write write "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_mmap_trampoline), uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
+ r0, _, e1 := syscall_syscall6(libc_mmap_trampoline_addr, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
ret = uintptr(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -2257,28 +2257,28 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (
return
}
-func libc_mmap_trampoline()
+var libc_mmap_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mmap mmap "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func munmap(addr uintptr, length uintptr) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_munmap_trampoline), uintptr(addr), uintptr(length), 0)
+ _, _, e1 := syscall_syscall(libc_munmap_trampoline_addr, uintptr(addr), uintptr(length), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_munmap_trampoline()
+var libc_munmap_trampoline_addr uintptr
//go:cgo_import_dynamic libc_munmap munmap "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
+ r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -2289,7 +2289,7 @@ func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
+ r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -2300,14 +2300,14 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fstat(fd int, stat *Stat_t) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
+ _, _, e1 := syscall_syscall(libc_fstat64_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fstat64_trampoline()
+var libc_fstat64_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fstat64 fstat64 "/usr/lib/libSystem.B.dylib"
@@ -2319,35 +2319,35 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_fstatat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
+ _, _, e1 := syscall_syscall6(libc_fstatat64_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fstatat64_trampoline()
+var libc_fstatat64_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fstatat64 fstatat64 "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fstatfs(fd int, stat *Statfs_t) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fstatfs64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
+ _, _, e1 := syscall_syscall(libc_fstatfs64_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fstatfs64_trampoline()
+var libc_fstatfs64_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat64_trampoline), uintptr(buf), uintptr(size), uintptr(flags))
+ r0, _, e1 := syscall_syscall(libc_getfsstat64_trampoline_addr, uintptr(buf), uintptr(size), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -2355,7 +2355,7 @@ func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) {
return
}
-func libc_getfsstat64_trampoline()
+var libc_getfsstat64_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getfsstat64 getfsstat64 "/usr/lib/libSystem.B.dylib"
@@ -2367,28 +2367,28 @@ func Lstat(path string, stat *Stat_t) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_lstat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
+ _, _, e1 := syscall_syscall(libc_lstat64_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_lstat64_trampoline()
+var libc_lstat64_trampoline_addr uintptr
//go:cgo_import_dynamic libc_lstat64 lstat64 "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
+ _, _, e1 := syscall_syscall6(libc_ptrace_trampoline_addr, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_ptrace_trampoline()
+var libc_ptrace_trampoline_addr uintptr
//go:cgo_import_dynamic libc_ptrace ptrace "/usr/lib/libSystem.B.dylib"
@@ -2400,14 +2400,14 @@ func Stat(path string, stat *Stat_t) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_stat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
+ _, _, e1 := syscall_syscall(libc_stat64_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_stat64_trampoline()
+var libc_stat64_trampoline_addr uintptr
//go:cgo_import_dynamic libc_stat64 stat64 "/usr/lib/libSystem.B.dylib"
@@ -2419,13 +2419,13 @@ func Statfs(path string, stat *Statfs_t) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_statfs64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
+ _, _, e1 := syscall_syscall(libc_statfs64_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_statfs64_trampoline()
+var libc_statfs64_trampoline_addr uintptr
//go:cgo_import_dynamic libc_statfs64 statfs64 "/usr/lib/libSystem.B.dylib"
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
index c77bd6e20..bc169c2ab 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
@@ -1,290 +1,859 @@
// go run mkasm_darwin.go amd64
// Code generated by the command above; DO NOT EDIT.
+//go:build go1.12
// +build go1.12
#include "textflag.h"
-TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0
+
+TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getgroups(SB)
-TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB)
+
+TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setgroups(SB)
-TEXT ·libc_wait4_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB)
+
+TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_wait4(SB)
-TEXT ·libc_accept_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8
+DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB)
+
+TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_accept(SB)
-TEXT ·libc_bind_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8
+DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB)
+
+TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_bind(SB)
-TEXT ·libc_connect_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8
+DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB)
+
+TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_connect(SB)
-TEXT ·libc_socket_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8
+DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB)
+
+TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_socket(SB)
-TEXT ·libc_getsockopt_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8
+DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB)
+
+TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getsockopt(SB)
-TEXT ·libc_setsockopt_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB)
+
+TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setsockopt(SB)
-TEXT ·libc_getpeername_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB)
+
+TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getpeername(SB)
-TEXT ·libc_getsockname_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB)
+
+TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getsockname(SB)
-TEXT ·libc_shutdown_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB)
+
+TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_shutdown(SB)
-TEXT ·libc_socketpair_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8
+DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB)
+
+TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_socketpair(SB)
-TEXT ·libc_recvfrom_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8
+DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB)
+
+TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_recvfrom(SB)
-TEXT ·libc_sendto_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8
+DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB)
+
+TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sendto(SB)
-TEXT ·libc_recvmsg_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8
+DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB)
+
+TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_recvmsg(SB)
-TEXT ·libc_sendmsg_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8
+DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB)
+
+TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sendmsg(SB)
-TEXT ·libc_kevent_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8
+DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB)
+
+TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_kevent(SB)
-TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8
+DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB)
+
+TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_utimes(SB)
-TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8
+DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB)
+
+TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_futimes(SB)
-TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8
+DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB)
+
+TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_poll(SB)
-TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8
+DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB)
+
+TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_madvise(SB)
-TEXT ·libc_mlock_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8
+DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB)
+
+TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mlock(SB)
-TEXT ·libc_mlockall_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB)
+
+TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mlockall(SB)
-TEXT ·libc_mprotect_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB)
+
+TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mprotect(SB)
-TEXT ·libc_msync_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB)
+
+TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_msync(SB)
-TEXT ·libc_munlock_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8
+DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB)
+
+TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_munlock(SB)
-TEXT ·libc_munlockall_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8
+DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB)
+
+TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_munlockall(SB)
-TEXT ·libc_pipe_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8
+DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB)
+
+TEXT libc_pipe_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pipe(SB)
-TEXT ·libc_getxattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_pipe_trampoline_addr(SB), RODATA, $8
+DATA ·libc_pipe_trampoline_addr(SB)/8, $libc_pipe_trampoline<>(SB)
+
+TEXT libc_getxattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getxattr(SB)
-TEXT ·libc_fgetxattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getxattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getxattr_trampoline_addr(SB)/8, $libc_getxattr_trampoline<>(SB)
+
+TEXT libc_fgetxattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fgetxattr(SB)
-TEXT ·libc_setxattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fgetxattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fgetxattr_trampoline_addr(SB)/8, $libc_fgetxattr_trampoline<>(SB)
+
+TEXT libc_setxattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setxattr(SB)
-TEXT ·libc_fsetxattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setxattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setxattr_trampoline_addr(SB)/8, $libc_setxattr_trampoline<>(SB)
+
+TEXT libc_fsetxattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fsetxattr(SB)
-TEXT ·libc_removexattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fsetxattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fsetxattr_trampoline_addr(SB)/8, $libc_fsetxattr_trampoline<>(SB)
+
+TEXT libc_removexattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_removexattr(SB)
-TEXT ·libc_fremovexattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_removexattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_removexattr_trampoline_addr(SB)/8, $libc_removexattr_trampoline<>(SB)
+
+TEXT libc_fremovexattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fremovexattr(SB)
-TEXT ·libc_listxattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fremovexattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fremovexattr_trampoline_addr(SB)/8, $libc_fremovexattr_trampoline<>(SB)
+
+TEXT libc_listxattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_listxattr(SB)
-TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_listxattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_listxattr_trampoline_addr(SB)/8, $libc_listxattr_trampoline<>(SB)
+
+TEXT libc_flistxattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_flistxattr(SB)
-TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_flistxattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_flistxattr_trampoline_addr(SB)/8, $libc_flistxattr_trampoline<>(SB)
+
+TEXT libc_setattrlist_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setattrlist(SB)
-TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setattrlist_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setattrlist_trampoline_addr(SB)/8, $libc_setattrlist_trampoline<>(SB)
+
+TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fcntl(SB)
-TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB)
+
+TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_kill(SB)
-TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8
+DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB)
+
+TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_ioctl(SB)
-TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8
+DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB)
+
+TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sysctl(SB)
-TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
+DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB)
+
+TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sendfile(SB)
-TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8
+DATA ·libc_sendfile_trampoline_addr(SB)/8, $libc_sendfile_trampoline<>(SB)
+
+TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_access(SB)
-TEXT ·libc_adjtime_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8
+DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB)
+
+TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_adjtime(SB)
-TEXT ·libc_chdir_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8
+DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB)
+
+TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_chdir(SB)
-TEXT ·libc_chflags_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8
+DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB)
+
+TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_chflags(SB)
-TEXT ·libc_chmod_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8
+DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB)
+
+TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_chmod(SB)
-TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8
+DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB)
+
+TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_chown(SB)
-TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8
+DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB)
+
+TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_chroot(SB)
-TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8
+DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB)
+
+TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_clock_gettime(SB)
-TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8
+DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB)
+
+TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_close(SB)
-TEXT ·libc_clonefile_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8
+DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB)
+
+TEXT libc_clonefile_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_clonefile(SB)
-TEXT ·libc_clonefileat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_clonefile_trampoline_addr(SB), RODATA, $8
+DATA ·libc_clonefile_trampoline_addr(SB)/8, $libc_clonefile_trampoline<>(SB)
+
+TEXT libc_clonefileat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_clonefileat(SB)
-TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_clonefileat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_clonefileat_trampoline_addr(SB)/8, $libc_clonefileat_trampoline<>(SB)
+
+TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_dup(SB)
-TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8
+DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB)
+
+TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_dup2(SB)
-TEXT ·libc_exchangedata_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8
+DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB)
+
+TEXT libc_exchangedata_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_exchangedata(SB)
-TEXT ·libc_exit_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_exchangedata_trampoline_addr(SB), RODATA, $8
+DATA ·libc_exchangedata_trampoline_addr(SB)/8, $libc_exchangedata_trampoline<>(SB)
+
+TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_exit(SB)
-TEXT ·libc_faccessat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8
+DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB)
+
+TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_faccessat(SB)
-TEXT ·libc_fchdir_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB)
+
+TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fchdir(SB)
-TEXT ·libc_fchflags_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB)
+
+TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fchflags(SB)
-TEXT ·libc_fchmod_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB)
+
+TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fchmod(SB)
-TEXT ·libc_fchmodat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB)
+
+TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fchmodat(SB)
-TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB)
+
+TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fchown(SB)
-TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB)
+
+TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fchownat(SB)
-TEXT ·libc_fclonefileat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB)
+
+TEXT libc_fclonefileat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fclonefileat(SB)
-TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fclonefileat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fclonefileat_trampoline_addr(SB)/8, $libc_fclonefileat_trampoline<>(SB)
+
+TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_flock(SB)
-TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8
+DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB)
+
+TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fpathconf(SB)
-TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB)
+
+TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fsync(SB)
-TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB)
+
+TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_ftruncate(SB)
-TEXT ·libc_getcwd_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8
+DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB)
+
+TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getcwd(SB)
-TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB)
+
+TEXT libc_getdtablesize_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getdtablesize(SB)
-TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getdtablesize_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getdtablesize_trampoline_addr(SB)/8, $libc_getdtablesize_trampoline<>(SB)
+
+TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getegid(SB)
-TEXT ·libc_geteuid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB)
+
+TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_geteuid(SB)
-TEXT ·libc_getgid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB)
+
+TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getgid(SB)
-TEXT ·libc_getpgid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB)
+
+TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getpgid(SB)
-TEXT ·libc_getpgrp_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB)
+
+TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getpgrp(SB)
-TEXT ·libc_getpid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB)
+
+TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getpid(SB)
-TEXT ·libc_getppid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB)
+
+TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getppid(SB)
-TEXT ·libc_getpriority_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB)
+
+TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getpriority(SB)
-TEXT ·libc_getrlimit_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB)
+
+TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getrlimit(SB)
-TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB)
+
+TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getrusage(SB)
-TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB)
+
+TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getsid(SB)
-TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB)
+
+TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_gettimeofday(SB)
-TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8
+DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB)
+
+TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getuid(SB)
-TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB)
+
+TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_issetugid(SB)
-TEXT ·libc_kqueue_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB)
+
+TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_kqueue(SB)
-TEXT ·libc_lchown_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8
+DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB)
+
+TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_lchown(SB)
-TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8
+DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB)
+
+TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_link(SB)
-TEXT ·libc_linkat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8
+DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB)
+
+TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_linkat(SB)
-TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB)
+
+TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_listen(SB)
-TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8
+DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB)
+
+TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mkdir(SB)
-TEXT ·libc_mkdirat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB)
+
+TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mkdirat(SB)
-TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB)
+
+TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mkfifo(SB)
-TEXT ·libc_mknod_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB)
+
+TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mknod(SB)
-TEXT ·libc_open_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB)
+
+TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_open(SB)
-TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8
+DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB)
+
+TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_openat(SB)
-TEXT ·libc_pathconf_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB)
+
+TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pathconf(SB)
-TEXT ·libc_pread_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8
+DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB)
+
+TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pread(SB)
-TEXT ·libc_pwrite_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8
+DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB)
+
+TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pwrite(SB)
-TEXT ·libc_read_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8
+DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB)
+
+TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_read(SB)
-TEXT ·libc_readlink_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8
+DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB)
+
+TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readlink(SB)
-TEXT ·libc_readlinkat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8
+DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB)
+
+TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readlinkat(SB)
-TEXT ·libc_rename_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB)
+
+TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_rename(SB)
-TEXT ·libc_renameat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8
+DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB)
+
+TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_renameat(SB)
-TEXT ·libc_revoke_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB)
+
+TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_revoke(SB)
-TEXT ·libc_rmdir_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8
+DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB)
+
+TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_rmdir(SB)
-TEXT ·libc_lseek_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8
+DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB)
+
+TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_lseek(SB)
-TEXT ·libc_select_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8
+DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB)
+
+TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_select(SB)
-TEXT ·libc_setegid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8
+DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB)
+
+TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setegid(SB)
-TEXT ·libc_seteuid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB)
+
+TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_seteuid(SB)
-TEXT ·libc_setgid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB)
+
+TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setgid(SB)
-TEXT ·libc_setlogin_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB)
+
+TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setlogin(SB)
-TEXT ·libc_setpgid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB)
+
+TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setpgid(SB)
-TEXT ·libc_setpriority_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB)
+
+TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setpriority(SB)
-TEXT ·libc_setprivexec_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB)
+
+TEXT libc_setprivexec_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setprivexec(SB)
-TEXT ·libc_setregid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setprivexec_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setprivexec_trampoline_addr(SB)/8, $libc_setprivexec_trampoline<>(SB)
+
+TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setregid(SB)
-TEXT ·libc_setreuid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB)
+
+TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setreuid(SB)
-TEXT ·libc_setrlimit_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB)
+
+TEXT libc_setrlimit_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setrlimit(SB)
-TEXT ·libc_setsid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setrlimit_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setrlimit_trampoline_addr(SB)/8, $libc_setrlimit_trampoline<>(SB)
+
+TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setsid(SB)
-TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB)
+
+TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_settimeofday(SB)
-TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8
+DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB)
+
+TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setuid(SB)
-TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB)
+
+TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_symlink(SB)
-TEXT ·libc_symlinkat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8
+DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB)
+
+TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_symlinkat(SB)
-TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB)
+
+TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sync(SB)
-TEXT ·libc_truncate_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8
+DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB)
+
+TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_truncate(SB)
-TEXT ·libc_umask_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8
+DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB)
+
+TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_umask(SB)
-TEXT ·libc_undelete_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8
+DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB)
+
+TEXT libc_undelete_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_undelete(SB)
-TEXT ·libc_unlink_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_undelete_trampoline_addr(SB), RODATA, $8
+DATA ·libc_undelete_trampoline_addr(SB)/8, $libc_undelete_trampoline<>(SB)
+
+TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_unlink(SB)
-TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8
+DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB)
+
+TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_unlinkat(SB)
-TEXT ·libc_unmount_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB)
+
+TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_unmount(SB)
-TEXT ·libc_write_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8
+DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB)
+
+TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_write(SB)
-TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8
+DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB)
+
+TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mmap(SB)
-TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB)
+
+TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_munmap(SB)
-TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8
+DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB)
+
+TEXT libc_fstat64_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fstat64(SB)
-TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fstat64_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fstat64_trampoline_addr(SB)/8, $libc_fstat64_trampoline<>(SB)
+
+TEXT libc_fstatat64_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fstatat64(SB)
-TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fstatat64_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fstatat64_trampoline_addr(SB)/8, $libc_fstatat64_trampoline<>(SB)
+
+TEXT libc_fstatfs64_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fstatfs64(SB)
-TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fstatfs64_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fstatfs64_trampoline_addr(SB)/8, $libc_fstatfs64_trampoline<>(SB)
+
+TEXT libc_getfsstat64_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getfsstat64(SB)
-TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getfsstat64_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getfsstat64_trampoline_addr(SB)/8, $libc_getfsstat64_trampoline<>(SB)
+
+TEXT libc_lstat64_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_lstat64(SB)
-TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_lstat64_trampoline_addr(SB), RODATA, $8
+DATA ·libc_lstat64_trampoline_addr(SB)/8, $libc_lstat64_trampoline<>(SB)
+
+TEXT libc_ptrace_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_ptrace(SB)
-TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_ptrace_trampoline_addr(SB), RODATA, $8
+DATA ·libc_ptrace_trampoline_addr(SB)/8, $libc_ptrace_trampoline<>(SB)
+
+TEXT libc_stat64_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_stat64(SB)
-TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_stat64_trampoline_addr(SB), RODATA, $8
+DATA ·libc_stat64_trampoline_addr(SB)/8, $libc_stat64_trampoline<>(SB)
+
+TEXT libc_statfs64_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_statfs64(SB)
+
+GLOBL ·libc_statfs64_trampoline_addr(SB), RODATA, $8
+DATA ·libc_statfs64_trampoline_addr(SB)/8, $libc_statfs64_trampoline<>(SB)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.go
deleted file mode 100644
index ed437f89a..000000000
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// go run mksyscall.go -l32 -tags darwin,arm,go1.13 syscall_darwin.1_13.go
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build darwin && arm && go1.13
-// +build darwin,arm,go1.13
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-var _ syscall.Errno
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func closedir(dir uintptr) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_closedir_trampoline()
-
-//go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) {
- r0, _, _ := syscall_syscall(funcPC(libc_readdir_r_trampoline), uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
- res = Errno(r0)
- return
-}
-
-func libc_readdir_r_trampoline()
-
-//go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib"
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s
deleted file mode 100644
index 488e55707..000000000
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s
+++ /dev/null
@@ -1,12 +0,0 @@
-// go run mkasm_darwin.go arm
-// Code generated by the command above; DO NOT EDIT.
-
-// +build go1.13
-
-#include "textflag.h"
-TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fdopendir(SB)
-TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0
- JMP libc_closedir(SB)
-TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0
- JMP libc_readdir_r(SB)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go
deleted file mode 100644
index 7f88cb5ea..000000000
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go
+++ /dev/null
@@ -1,2417 +0,0 @@
-// go run mksyscall.go -l32 -tags darwin,arm,go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_arm.go
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build darwin && arm && go1.12
-// +build darwin,arm,go1.12
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-var _ syscall.Errno
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_getgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getgroups_trampoline()
-
-//go:cgo_import_dynamic libc_getgroups getgroups "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func setgroups(ngid int, gid *_Gid_t) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setgroups_trampoline()
-
-//go:cgo_import_dynamic libc_setgroups setgroups "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_wait4_trampoline), uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
- wpid = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_wait4_trampoline()
-
-//go:cgo_import_dynamic libc_wait4 wait4 "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_accept_trampoline), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_accept_trampoline()
-
-//go:cgo_import_dynamic libc_accept accept "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_bind_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_bind_trampoline()
-
-//go:cgo_import_dynamic libc_bind bind "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_connect_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_connect_trampoline()
-
-//go:cgo_import_dynamic libc_connect connect "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func socket(domain int, typ int, proto int) (fd int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_socket_trampoline), uintptr(domain), uintptr(typ), uintptr(proto))
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_socket_trampoline()
-
-//go:cgo_import_dynamic libc_socket socket "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_getsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getsockopt_trampoline()
-
-//go:cgo_import_dynamic libc_getsockopt getsockopt "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_setsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setsockopt_trampoline()
-
-//go:cgo_import_dynamic libc_setsockopt setsockopt "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getpeername_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getpeername_trampoline()
-
-//go:cgo_import_dynamic libc_getpeername getpeername "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getsockname_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getsockname_trampoline()
-
-//go:cgo_import_dynamic libc_getsockname getsockname "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Shutdown(s int, how int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_shutdown_trampoline), uintptr(s), uintptr(how), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_shutdown_trampoline()
-
-//go:cgo_import_dynamic libc_shutdown shutdown "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
- _, _, e1 := syscall_rawSyscall6(funcPC(libc_socketpair_trampoline), uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_socketpair_trampoline()
-
-//go:cgo_import_dynamic libc_socketpair socketpair "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
- var _p0 unsafe.Pointer
- if len(p) > 0 {
- _p0 = unsafe.Pointer(&p[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_recvfrom_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_recvfrom_trampoline()
-
-//go:cgo_import_dynamic libc_recvfrom recvfrom "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
- var _p0 unsafe.Pointer
- if len(buf) > 0 {
- _p0 = unsafe.Pointer(&buf[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_sendto_trampoline), uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_sendto_trampoline()
-
-//go:cgo_import_dynamic libc_sendto sendto "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_recvmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_recvmsg_trampoline()
-
-//go:cgo_import_dynamic libc_recvmsg recvmsg "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_sendmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_sendmsg_trampoline()
-
-//go:cgo_import_dynamic libc_sendmsg sendmsg "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_kevent_trampoline), uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_kevent_trampoline()
-
-//go:cgo_import_dynamic libc_kevent kevent "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func utimes(path string, timeval *[2]Timeval) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_utimes_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_utimes_trampoline()
-
-//go:cgo_import_dynamic libc_utimes utimes "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func futimes(fd int, timeval *[2]Timeval) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_futimes_trampoline), uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_futimes_trampoline()
-
-//go:cgo_import_dynamic libc_futimes futimes "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_poll_trampoline()
-
-//go:cgo_import_dynamic libc_poll poll "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Madvise(b []byte, behav int) (err error) {
- var _p0 unsafe.Pointer
- if len(b) > 0 {
- _p0 = unsafe.Pointer(&b[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall(funcPC(libc_madvise_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(behav))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_madvise_trampoline()
-
-//go:cgo_import_dynamic libc_madvise madvise "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mlock(b []byte) (err error) {
- var _p0 unsafe.Pointer
- if len(b) > 0 {
- _p0 = unsafe.Pointer(&b[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall(funcPC(libc_mlock_trampoline), uintptr(_p0), uintptr(len(b)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mlock_trampoline()
-
-//go:cgo_import_dynamic libc_mlock mlock "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mlockall(flags int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_mlockall_trampoline), uintptr(flags), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mlockall_trampoline()
-
-//go:cgo_import_dynamic libc_mlockall mlockall "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mprotect(b []byte, prot int) (err error) {
- var _p0 unsafe.Pointer
- if len(b) > 0 {
- _p0 = unsafe.Pointer(&b[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall(funcPC(libc_mprotect_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(prot))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mprotect_trampoline()
-
-//go:cgo_import_dynamic libc_mprotect mprotect "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Msync(b []byte, flags int) (err error) {
- var _p0 unsafe.Pointer
- if len(b) > 0 {
- _p0 = unsafe.Pointer(&b[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall(funcPC(libc_msync_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(flags))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_msync_trampoline()
-
-//go:cgo_import_dynamic libc_msync msync "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Munlock(b []byte) (err error) {
- var _p0 unsafe.Pointer
- if len(b) > 0 {
- _p0 = unsafe.Pointer(&b[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall(funcPC(libc_munlock_trampoline), uintptr(_p0), uintptr(len(b)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_munlock_trampoline()
-
-//go:cgo_import_dynamic libc_munlock munlock "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Munlockall() (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_munlockall_trampoline), 0, 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_munlockall_trampoline()
-
-//go:cgo_import_dynamic libc_munlockall munlockall "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func pipe(p *[2]int32) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), uintptr(unsafe.Pointer(p)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_pipe_trampoline()
-
-//go:cgo_import_dynamic libc_pipe pipe "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(attr)
- if err != nil {
- return
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_getxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
- sz = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getxattr_trampoline()
-
-//go:cgo_import_dynamic libc_getxattr getxattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(attr)
- if err != nil {
- return
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_fgetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
- sz = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fgetxattr_trampoline()
-
-//go:cgo_import_dynamic libc_fgetxattr fgetxattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(attr)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_setxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setxattr_trampoline()
-
-//go:cgo_import_dynamic libc_setxattr setxattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(attr)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_fsetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fsetxattr_trampoline()
-
-//go:cgo_import_dynamic libc_fsetxattr fsetxattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func removexattr(path string, attr string, options int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(attr)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_removexattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_removexattr_trampoline()
-
-//go:cgo_import_dynamic libc_removexattr removexattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func fremovexattr(fd int, attr string, options int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(attr)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_fremovexattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fremovexattr_trampoline()
-
-//go:cgo_import_dynamic libc_fremovexattr fremovexattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func listxattr(path string, dest *byte, size int, options int) (sz int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_listxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
- sz = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_listxattr_trampoline()
-
-//go:cgo_import_dynamic libc_listxattr listxattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_flistxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
- sz = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_flistxattr_trampoline()
-
-//go:cgo_import_dynamic libc_flistxattr flistxattr "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_setattrlist_trampoline), uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setattrlist_trampoline()
-
-//go:cgo_import_dynamic libc_setattrlist setattrlist "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func fcntl(fd int, cmd int, arg int) (val int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg))
- val = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fcntl_trampoline()
-
-//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func kill(pid int, signum int, posix int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_kill_trampoline()
-
-//go:cgo_import_dynamic libc_kill kill "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func ioctl(fd int, req uint, arg uintptr) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_ioctl_trampoline), uintptr(fd), uintptr(req), uintptr(arg))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_ioctl_trampoline()
-
-//go:cgo_import_dynamic libc_ioctl ioctl "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
- var _p0 unsafe.Pointer
- if len(mib) > 0 {
- _p0 = unsafe.Pointer(&mib[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_sysctl_trampoline()
-
-//go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
- _, _, e1 := syscall_syscall9(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(offset>>32), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_sendfile_trampoline()
-
-//go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Access(path string, mode uint32) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_access_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_access_trampoline()
-
-//go:cgo_import_dynamic libc_access access "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_adjtime_trampoline), uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_adjtime_trampoline()
-
-//go:cgo_import_dynamic libc_adjtime adjtime "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Chdir(path string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_chdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_chdir_trampoline()
-
-//go:cgo_import_dynamic libc_chdir chdir "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Chflags(path string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_chflags_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_chflags_trampoline()
-
-//go:cgo_import_dynamic libc_chflags chflags "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Chmod(path string, mode uint32) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_chmod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_chmod_trampoline()
-
-//go:cgo_import_dynamic libc_chmod chmod "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Chown(path string, uid int, gid int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_chown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_chown_trampoline()
-
-//go:cgo_import_dynamic libc_chown chown "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Chroot(path string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_chroot_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_chroot_trampoline()
-
-//go:cgo_import_dynamic libc_chroot chroot "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func ClockGettime(clockid int32, time *Timespec) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_clock_gettime_trampoline), uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_clock_gettime_trampoline()
-
-//go:cgo_import_dynamic libc_clock_gettime clock_gettime "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Close(fd int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_close_trampoline), uintptr(fd), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_close_trampoline()
-
-//go:cgo_import_dynamic libc_close close "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Clonefile(src string, dst string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(src)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(dst)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_clonefile_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_clonefile_trampoline()
-
-//go:cgo_import_dynamic libc_clonefile clonefile "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(src)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(dst)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_clonefileat_trampoline), uintptr(srcDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_clonefileat_trampoline()
-
-//go:cgo_import_dynamic libc_clonefileat clonefileat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Dup(fd int) (nfd int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0)
- nfd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_dup_trampoline()
-
-//go:cgo_import_dynamic libc_dup dup "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Dup2(from int, to int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_dup2_trampoline), uintptr(from), uintptr(to), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_dup2_trampoline()
-
-//go:cgo_import_dynamic libc_dup2 dup2 "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Exchangedata(path1 string, path2 string, options int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path1)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(path2)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_exchangedata_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_exchangedata_trampoline()
-
-//go:cgo_import_dynamic libc_exchangedata exchangedata "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Exit(code int) {
- syscall_syscall(funcPC(libc_exit_trampoline), uintptr(code), 0, 0)
- return
-}
-
-func libc_exit_trampoline()
-
-//go:cgo_import_dynamic libc_exit exit "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_faccessat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_faccessat_trampoline()
-
-//go:cgo_import_dynamic libc_faccessat faccessat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fchdir(fd int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchdir_trampoline), uintptr(fd), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fchdir_trampoline()
-
-//go:cgo_import_dynamic libc_fchdir fchdir "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fchflags(fd int, flags int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchflags_trampoline), uintptr(fd), uintptr(flags), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fchflags_trampoline()
-
-//go:cgo_import_dynamic libc_fchflags fchflags "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fchmod(fd int, mode uint32) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchmod_trampoline), uintptr(fd), uintptr(mode), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fchmod_trampoline()
-
-//go:cgo_import_dynamic libc_fchmod fchmod "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_fchmodat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fchmodat_trampoline()
-
-//go:cgo_import_dynamic libc_fchmodat fchmodat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fchown(fd int, uid int, gid int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchown_trampoline), uintptr(fd), uintptr(uid), uintptr(gid))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fchown_trampoline()
-
-//go:cgo_import_dynamic libc_fchown fchown "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_fchownat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fchownat_trampoline()
-
-//go:cgo_import_dynamic libc_fchownat fchownat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(dst)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_fclonefileat_trampoline), uintptr(srcDirfd), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fclonefileat_trampoline()
-
-//go:cgo_import_dynamic libc_fclonefileat fclonefileat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Flock(fd int, how int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_flock_trampoline()
-
-//go:cgo_import_dynamic libc_flock flock "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fpathconf(fd int, name int) (val int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_fpathconf_trampoline), uintptr(fd), uintptr(name), 0)
- val = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fpathconf_trampoline()
-
-//go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fsync(fd int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fsync_trampoline), uintptr(fd), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fsync_trampoline()
-
-//go:cgo_import_dynamic libc_fsync fsync "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Ftruncate(fd int, length int64) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_ftruncate_trampoline), uintptr(fd), uintptr(length), uintptr(length>>32))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_ftruncate_trampoline()
-
-//go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getcwd(buf []byte) (n int, err error) {
- var _p0 unsafe.Pointer
- if len(buf) > 0 {
- _p0 = unsafe.Pointer(&buf[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall(funcPC(libc_getcwd_trampoline), uintptr(_p0), uintptr(len(buf)), 0)
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getcwd_trampoline()
-
-//go:cgo_import_dynamic libc_getcwd getcwd "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getdtablesize() (size int) {
- r0, _, _ := syscall_syscall(funcPC(libc_getdtablesize_trampoline), 0, 0, 0)
- size = int(r0)
- return
-}
-
-func libc_getdtablesize_trampoline()
-
-//go:cgo_import_dynamic libc_getdtablesize getdtablesize "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getegid() (egid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getegid_trampoline), 0, 0, 0)
- egid = int(r0)
- return
-}
-
-func libc_getegid_trampoline()
-
-//go:cgo_import_dynamic libc_getegid getegid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Geteuid() (uid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_geteuid_trampoline), 0, 0, 0)
- uid = int(r0)
- return
-}
-
-func libc_geteuid_trampoline()
-
-//go:cgo_import_dynamic libc_geteuid geteuid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getgid() (gid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getgid_trampoline), 0, 0, 0)
- gid = int(r0)
- return
-}
-
-func libc_getgid_trampoline()
-
-//go:cgo_import_dynamic libc_getgid getgid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getpgid(pid int) (pgid int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_getpgid_trampoline), uintptr(pid), 0, 0)
- pgid = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getpgid_trampoline()
-
-//go:cgo_import_dynamic libc_getpgid getpgid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getpgrp() (pgrp int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getpgrp_trampoline), 0, 0, 0)
- pgrp = int(r0)
- return
-}
-
-func libc_getpgrp_trampoline()
-
-//go:cgo_import_dynamic libc_getpgrp getpgrp "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getpid() (pid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getpid_trampoline), 0, 0, 0)
- pid = int(r0)
- return
-}
-
-func libc_getpid_trampoline()
-
-//go:cgo_import_dynamic libc_getpid getpid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getppid() (ppid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getppid_trampoline), 0, 0, 0)
- ppid = int(r0)
- return
-}
-
-func libc_getppid_trampoline()
-
-//go:cgo_import_dynamic libc_getppid getppid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getpriority(which int, who int) (prio int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_getpriority_trampoline), uintptr(which), uintptr(who), 0)
- prio = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getpriority_trampoline()
-
-//go:cgo_import_dynamic libc_getpriority getpriority "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getrlimit(which int, lim *Rlimit) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getrlimit_trampoline()
-
-//go:cgo_import_dynamic libc_getrlimit getrlimit "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getrusage(who int, rusage *Rusage) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getrusage_trampoline), uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getrusage_trampoline()
-
-//go:cgo_import_dynamic libc_getrusage getrusage "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getsid(pid int) (sid int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_getsid_trampoline), uintptr(pid), 0, 0)
- sid = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getsid_trampoline()
-
-//go:cgo_import_dynamic libc_getsid getsid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Gettimeofday(tp *Timeval) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_gettimeofday_trampoline()
-
-//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Getuid() (uid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0)
- uid = int(r0)
- return
-}
-
-func libc_getuid_trampoline()
-
-//go:cgo_import_dynamic libc_getuid getuid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Issetugid() (tainted bool) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_issetugid_trampoline), 0, 0, 0)
- tainted = bool(r0 != 0)
- return
-}
-
-func libc_issetugid_trampoline()
-
-//go:cgo_import_dynamic libc_issetugid issetugid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Kqueue() (fd int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_kqueue_trampoline), 0, 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_kqueue_trampoline()
-
-//go:cgo_import_dynamic libc_kqueue kqueue "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Lchown(path string, uid int, gid int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_lchown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_lchown_trampoline()
-
-//go:cgo_import_dynamic libc_lchown lchown "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Link(path string, link string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(link)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_link_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_link_trampoline()
-
-//go:cgo_import_dynamic libc_link link "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(link)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_linkat_trampoline), uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_linkat_trampoline()
-
-//go:cgo_import_dynamic libc_linkat linkat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Listen(s int, backlog int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_listen_trampoline), uintptr(s), uintptr(backlog), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_listen_trampoline()
-
-//go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mkdir(path string, mode uint32) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_mkdir_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mkdir_trampoline()
-
-//go:cgo_import_dynamic libc_mkdir mkdir "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mkdirat(dirfd int, path string, mode uint32) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_mkdirat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mkdirat_trampoline()
-
-//go:cgo_import_dynamic libc_mkdirat mkdirat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mkfifo(path string, mode uint32) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_mkfifo_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mkfifo_trampoline()
-
-//go:cgo_import_dynamic libc_mkfifo mkfifo "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Mknod(path string, mode uint32, dev int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_mknod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mknod_trampoline()
-
-//go:cgo_import_dynamic libc_mknod mknod "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Open(path string, mode int, perm uint32) (fd int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- r0, _, e1 := syscall_syscall(funcPC(libc_open_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_open_trampoline()
-
-//go:cgo_import_dynamic libc_open open "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_openat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_openat_trampoline()
-
-//go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Pathconf(path string, name int) (val int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- r0, _, e1 := syscall_syscall(funcPC(libc_pathconf_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
- val = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_pathconf_trampoline()
-
-//go:cgo_import_dynamic libc_pathconf pathconf "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Pread(fd int, p []byte, offset int64) (n int, err error) {
- var _p0 unsafe.Pointer
- if len(p) > 0 {
- _p0 = unsafe.Pointer(&p[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_pread_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_pread_trampoline()
-
-//go:cgo_import_dynamic libc_pread pread "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
- var _p0 unsafe.Pointer
- if len(p) > 0 {
- _p0 = unsafe.Pointer(&p[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_pwrite_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_pwrite_trampoline()
-
-//go:cgo_import_dynamic libc_pwrite pwrite "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func read(fd int, p []byte) (n int, err error) {
- var _p0 unsafe.Pointer
- if len(p) > 0 {
- _p0 = unsafe.Pointer(&p[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_read_trampoline()
-
-//go:cgo_import_dynamic libc_read read "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Readlink(path string, buf []byte) (n int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 unsafe.Pointer
- if len(buf) > 0 {
- _p1 = unsafe.Pointer(&buf[0])
- } else {
- _p1 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall(funcPC(libc_readlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_readlink_trampoline()
-
-//go:cgo_import_dynamic libc_readlink readlink "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 unsafe.Pointer
- if len(buf) > 0 {
- _p1 = unsafe.Pointer(&buf[0])
- } else {
- _p1 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall6(funcPC(libc_readlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_readlinkat_trampoline()
-
-//go:cgo_import_dynamic libc_readlinkat readlinkat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Rename(from string, to string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(from)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(to)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_rename_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_rename_trampoline()
-
-//go:cgo_import_dynamic libc_rename rename "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Renameat(fromfd int, from string, tofd int, to string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(from)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(to)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_renameat_trampoline), uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_renameat_trampoline()
-
-//go:cgo_import_dynamic libc_renameat renameat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Revoke(path string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_revoke_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_revoke_trampoline()
-
-//go:cgo_import_dynamic libc_revoke revoke "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Rmdir(path string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_rmdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_rmdir_trampoline()
-
-//go:cgo_import_dynamic libc_rmdir rmdir "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
- r0, r1, e1 := syscall_syscall6(funcPC(libc_lseek_trampoline), uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0)
- newoffset = int64(int64(r1)<<32 | int64(r0))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_lseek_trampoline()
-
-//go:cgo_import_dynamic libc_lseek lseek "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_select_trampoline), uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_select_trampoline()
-
-//go:cgo_import_dynamic libc_select select "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setegid(egid int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_setegid_trampoline), uintptr(egid), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setegid_trampoline()
-
-//go:cgo_import_dynamic libc_setegid setegid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Seteuid(euid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_seteuid_trampoline), uintptr(euid), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_seteuid_trampoline()
-
-//go:cgo_import_dynamic libc_seteuid seteuid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setgid(gid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setgid_trampoline), uintptr(gid), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setgid_trampoline()
-
-//go:cgo_import_dynamic libc_setgid setgid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setlogin(name string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(name)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_setlogin_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setlogin_trampoline()
-
-//go:cgo_import_dynamic libc_setlogin setlogin "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setpgid(pid int, pgid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setpgid_trampoline), uintptr(pid), uintptr(pgid), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setpgid_trampoline()
-
-//go:cgo_import_dynamic libc_setpgid setpgid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setpriority(which int, who int, prio int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_setpriority_trampoline), uintptr(which), uintptr(who), uintptr(prio))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setpriority_trampoline()
-
-//go:cgo_import_dynamic libc_setpriority setpriority "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setprivexec(flag int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_setprivexec_trampoline), uintptr(flag), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setprivexec_trampoline()
-
-//go:cgo_import_dynamic libc_setprivexec setprivexec "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setregid(rgid int, egid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setregid_trampoline), uintptr(rgid), uintptr(egid), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setregid_trampoline()
-
-//go:cgo_import_dynamic libc_setregid setregid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setreuid(ruid int, euid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setreuid_trampoline), uintptr(ruid), uintptr(euid), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setreuid_trampoline()
-
-//go:cgo_import_dynamic libc_setreuid setreuid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setrlimit(which int, lim *Rlimit) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setrlimit_trampoline()
-
-//go:cgo_import_dynamic libc_setrlimit setrlimit "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setsid() (pid int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_setsid_trampoline), 0, 0, 0)
- pid = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setsid_trampoline()
-
-//go:cgo_import_dynamic libc_setsid setsid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Settimeofday(tp *Timeval) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_settimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_settimeofday_trampoline()
-
-//go:cgo_import_dynamic libc_settimeofday settimeofday "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Setuid(uid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setuid_trampoline), uintptr(uid), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_setuid_trampoline()
-
-//go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Symlink(path string, link string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(link)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_symlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_symlink_trampoline()
-
-//go:cgo_import_dynamic libc_symlink symlink "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(oldpath)
- if err != nil {
- return
- }
- var _p1 *byte
- _p1, err = BytePtrFromString(newpath)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_symlinkat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_symlinkat_trampoline()
-
-//go:cgo_import_dynamic libc_symlinkat symlinkat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Sync() (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_sync_trampoline), 0, 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_sync_trampoline()
-
-//go:cgo_import_dynamic libc_sync sync "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Truncate(path string, length int64) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_truncate_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_truncate_trampoline()
-
-//go:cgo_import_dynamic libc_truncate truncate "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Umask(newmask int) (oldmask int) {
- r0, _, _ := syscall_syscall(funcPC(libc_umask_trampoline), uintptr(newmask), 0, 0)
- oldmask = int(r0)
- return
-}
-
-func libc_umask_trampoline()
-
-//go:cgo_import_dynamic libc_umask umask "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Undelete(path string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_undelete_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_undelete_trampoline()
-
-//go:cgo_import_dynamic libc_undelete undelete "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Unlink(path string) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_unlink_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_unlink_trampoline()
-
-//go:cgo_import_dynamic libc_unlink unlink "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Unlinkat(dirfd int, path string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_unlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_unlinkat_trampoline()
-
-//go:cgo_import_dynamic libc_unlinkat unlinkat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Unmount(path string, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_unmount_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_unmount_trampoline()
-
-//go:cgo_import_dynamic libc_unmount unmount "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func write(fd int, p []byte) (n int, err error) {
- var _p0 unsafe.Pointer
- if len(p) > 0 {
- _p0 = unsafe.Pointer(&p[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_write_trampoline()
-
-//go:cgo_import_dynamic libc_write write "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
- r0, _, e1 := syscall_syscall9(funcPC(libc_mmap_trampoline), uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0)
- ret = uintptr(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_mmap_trampoline()
-
-//go:cgo_import_dynamic libc_mmap mmap "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func munmap(addr uintptr, length uintptr) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_munmap_trampoline), uintptr(addr), uintptr(length), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_munmap_trampoline()
-
-//go:cgo_import_dynamic libc_munmap munmap "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fstat(fd int, stat *Stat_t) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fstat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fstat_trampoline()
-
-//go:cgo_import_dynamic libc_fstat fstat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall6(funcPC(libc_fstatat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fstatat_trampoline()
-
-//go:cgo_import_dynamic libc_fstatat fstatat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Fstatfs(fd int, stat *Statfs_t) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fstatfs_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_fstatfs_trampoline()
-
-//go:cgo_import_dynamic libc_fstatfs fstatfs "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat_trampoline), uintptr(buf), uintptr(size), uintptr(flags))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_getfsstat_trampoline()
-
-//go:cgo_import_dynamic libc_getfsstat getfsstat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Lstat(path string, stat *Stat_t) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_lstat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_lstat_trampoline()
-
-//go:cgo_import_dynamic libc_lstat lstat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Stat(path string, stat *Stat_t) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_stat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_stat_trampoline()
-
-//go:cgo_import_dynamic libc_stat stat "/usr/lib/libSystem.B.dylib"
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func Statfs(path string, stat *Statfs_t) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := syscall_syscall(funcPC(libc_statfs_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-func libc_statfs_trampoline()
-
-//go:cgo_import_dynamic libc_statfs statfs "/usr/lib/libSystem.B.dylib"
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s
deleted file mode 100644
index 5eec5f1d9..000000000
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s
+++ /dev/null
@@ -1,288 +0,0 @@
-// go run mkasm_darwin.go arm
-// Code generated by the command above; DO NOT EDIT.
-
-// +build go1.12
-
-#include "textflag.h"
-TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getgroups(SB)
-TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setgroups(SB)
-TEXT ·libc_wait4_trampoline(SB),NOSPLIT,$0-0
- JMP libc_wait4(SB)
-TEXT ·libc_accept_trampoline(SB),NOSPLIT,$0-0
- JMP libc_accept(SB)
-TEXT ·libc_bind_trampoline(SB),NOSPLIT,$0-0
- JMP libc_bind(SB)
-TEXT ·libc_connect_trampoline(SB),NOSPLIT,$0-0
- JMP libc_connect(SB)
-TEXT ·libc_socket_trampoline(SB),NOSPLIT,$0-0
- JMP libc_socket(SB)
-TEXT ·libc_getsockopt_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getsockopt(SB)
-TEXT ·libc_setsockopt_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setsockopt(SB)
-TEXT ·libc_getpeername_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getpeername(SB)
-TEXT ·libc_getsockname_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getsockname(SB)
-TEXT ·libc_shutdown_trampoline(SB),NOSPLIT,$0-0
- JMP libc_shutdown(SB)
-TEXT ·libc_socketpair_trampoline(SB),NOSPLIT,$0-0
- JMP libc_socketpair(SB)
-TEXT ·libc_recvfrom_trampoline(SB),NOSPLIT,$0-0
- JMP libc_recvfrom(SB)
-TEXT ·libc_sendto_trampoline(SB),NOSPLIT,$0-0
- JMP libc_sendto(SB)
-TEXT ·libc_recvmsg_trampoline(SB),NOSPLIT,$0-0
- JMP libc_recvmsg(SB)
-TEXT ·libc_sendmsg_trampoline(SB),NOSPLIT,$0-0
- JMP libc_sendmsg(SB)
-TEXT ·libc_kevent_trampoline(SB),NOSPLIT,$0-0
- JMP libc_kevent(SB)
-TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0
- JMP libc_utimes(SB)
-TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0
- JMP libc_futimes(SB)
-TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0
- JMP libc_poll(SB)
-TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0
- JMP libc_madvise(SB)
-TEXT ·libc_mlock_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mlock(SB)
-TEXT ·libc_mlockall_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mlockall(SB)
-TEXT ·libc_mprotect_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mprotect(SB)
-TEXT ·libc_msync_trampoline(SB),NOSPLIT,$0-0
- JMP libc_msync(SB)
-TEXT ·libc_munlock_trampoline(SB),NOSPLIT,$0-0
- JMP libc_munlock(SB)
-TEXT ·libc_munlockall_trampoline(SB),NOSPLIT,$0-0
- JMP libc_munlockall(SB)
-TEXT ·libc_pipe_trampoline(SB),NOSPLIT,$0-0
- JMP libc_pipe(SB)
-TEXT ·libc_getxattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getxattr(SB)
-TEXT ·libc_fgetxattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fgetxattr(SB)
-TEXT ·libc_setxattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setxattr(SB)
-TEXT ·libc_fsetxattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fsetxattr(SB)
-TEXT ·libc_removexattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_removexattr(SB)
-TEXT ·libc_fremovexattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fremovexattr(SB)
-TEXT ·libc_listxattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_listxattr(SB)
-TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0
- JMP libc_flistxattr(SB)
-TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setattrlist(SB)
-TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fcntl(SB)
-TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
- JMP libc_kill(SB)
-TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
- JMP libc_ioctl(SB)
-TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0
- JMP libc_sysctl(SB)
-TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0
- JMP libc_sendfile(SB)
-TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0
- JMP libc_access(SB)
-TEXT ·libc_adjtime_trampoline(SB),NOSPLIT,$0-0
- JMP libc_adjtime(SB)
-TEXT ·libc_chdir_trampoline(SB),NOSPLIT,$0-0
- JMP libc_chdir(SB)
-TEXT ·libc_chflags_trampoline(SB),NOSPLIT,$0-0
- JMP libc_chflags(SB)
-TEXT ·libc_chmod_trampoline(SB),NOSPLIT,$0-0
- JMP libc_chmod(SB)
-TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0
- JMP libc_chown(SB)
-TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0
- JMP libc_chroot(SB)
-TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0
- JMP libc_clock_gettime(SB)
-TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
- JMP libc_close(SB)
-TEXT ·libc_clonefile_trampoline(SB),NOSPLIT,$0-0
- JMP libc_clonefile(SB)
-TEXT ·libc_clonefileat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_clonefileat(SB)
-TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
- JMP libc_dup(SB)
-TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
- JMP libc_dup2(SB)
-TEXT ·libc_exchangedata_trampoline(SB),NOSPLIT,$0-0
- JMP libc_exchangedata(SB)
-TEXT ·libc_exit_trampoline(SB),NOSPLIT,$0-0
- JMP libc_exit(SB)
-TEXT ·libc_faccessat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_faccessat(SB)
-TEXT ·libc_fchdir_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fchdir(SB)
-TEXT ·libc_fchflags_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fchflags(SB)
-TEXT ·libc_fchmod_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fchmod(SB)
-TEXT ·libc_fchmodat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fchmodat(SB)
-TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fchown(SB)
-TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fchownat(SB)
-TEXT ·libc_fclonefileat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fclonefileat(SB)
-TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
- JMP libc_flock(SB)
-TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fpathconf(SB)
-TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fsync(SB)
-TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0
- JMP libc_ftruncate(SB)
-TEXT ·libc_getcwd_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getcwd(SB)
-TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getdtablesize(SB)
-TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getegid(SB)
-TEXT ·libc_geteuid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_geteuid(SB)
-TEXT ·libc_getgid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getgid(SB)
-TEXT ·libc_getpgid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getpgid(SB)
-TEXT ·libc_getpgrp_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getpgrp(SB)
-TEXT ·libc_getpid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getpid(SB)
-TEXT ·libc_getppid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getppid(SB)
-TEXT ·libc_getpriority_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getpriority(SB)
-TEXT ·libc_getrlimit_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getrlimit(SB)
-TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getrusage(SB)
-TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getsid(SB)
-TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
- JMP libc_gettimeofday(SB)
-TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getuid(SB)
-TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_issetugid(SB)
-TEXT ·libc_kqueue_trampoline(SB),NOSPLIT,$0-0
- JMP libc_kqueue(SB)
-TEXT ·libc_lchown_trampoline(SB),NOSPLIT,$0-0
- JMP libc_lchown(SB)
-TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0
- JMP libc_link(SB)
-TEXT ·libc_linkat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_linkat(SB)
-TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0
- JMP libc_listen(SB)
-TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mkdir(SB)
-TEXT ·libc_mkdirat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mkdirat(SB)
-TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mkfifo(SB)
-TEXT ·libc_mknod_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mknod(SB)
-TEXT ·libc_open_trampoline(SB),NOSPLIT,$0-0
- JMP libc_open(SB)
-TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_openat(SB)
-TEXT ·libc_pathconf_trampoline(SB),NOSPLIT,$0-0
- JMP libc_pathconf(SB)
-TEXT ·libc_pread_trampoline(SB),NOSPLIT,$0-0
- JMP libc_pread(SB)
-TEXT ·libc_pwrite_trampoline(SB),NOSPLIT,$0-0
- JMP libc_pwrite(SB)
-TEXT ·libc_read_trampoline(SB),NOSPLIT,$0-0
- JMP libc_read(SB)
-TEXT ·libc_readlink_trampoline(SB),NOSPLIT,$0-0
- JMP libc_readlink(SB)
-TEXT ·libc_readlinkat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_readlinkat(SB)
-TEXT ·libc_rename_trampoline(SB),NOSPLIT,$0-0
- JMP libc_rename(SB)
-TEXT ·libc_renameat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_renameat(SB)
-TEXT ·libc_revoke_trampoline(SB),NOSPLIT,$0-0
- JMP libc_revoke(SB)
-TEXT ·libc_rmdir_trampoline(SB),NOSPLIT,$0-0
- JMP libc_rmdir(SB)
-TEXT ·libc_lseek_trampoline(SB),NOSPLIT,$0-0
- JMP libc_lseek(SB)
-TEXT ·libc_select_trampoline(SB),NOSPLIT,$0-0
- JMP libc_select(SB)
-TEXT ·libc_setegid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setegid(SB)
-TEXT ·libc_seteuid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_seteuid(SB)
-TEXT ·libc_setgid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setgid(SB)
-TEXT ·libc_setlogin_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setlogin(SB)
-TEXT ·libc_setpgid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setpgid(SB)
-TEXT ·libc_setpriority_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setpriority(SB)
-TEXT ·libc_setprivexec_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setprivexec(SB)
-TEXT ·libc_setregid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setregid(SB)
-TEXT ·libc_setreuid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setreuid(SB)
-TEXT ·libc_setrlimit_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setrlimit(SB)
-TEXT ·libc_setsid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setsid(SB)
-TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0
- JMP libc_settimeofday(SB)
-TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0
- JMP libc_setuid(SB)
-TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0
- JMP libc_symlink(SB)
-TEXT ·libc_symlinkat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_symlinkat(SB)
-TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0
- JMP libc_sync(SB)
-TEXT ·libc_truncate_trampoline(SB),NOSPLIT,$0-0
- JMP libc_truncate(SB)
-TEXT ·libc_umask_trampoline(SB),NOSPLIT,$0-0
- JMP libc_umask(SB)
-TEXT ·libc_undelete_trampoline(SB),NOSPLIT,$0-0
- JMP libc_undelete(SB)
-TEXT ·libc_unlink_trampoline(SB),NOSPLIT,$0-0
- JMP libc_unlink(SB)
-TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_unlinkat(SB)
-TEXT ·libc_unmount_trampoline(SB),NOSPLIT,$0-0
- JMP libc_unmount(SB)
-TEXT ·libc_write_trampoline(SB),NOSPLIT,$0-0
- JMP libc_write(SB)
-TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0
- JMP libc_mmap(SB)
-TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
- JMP libc_munmap(SB)
-TEXT ·libc_fstat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fstat(SB)
-TEXT ·libc_fstatat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fstatat(SB)
-TEXT ·libc_fstatfs_trampoline(SB),NOSPLIT,$0-0
- JMP libc_fstatfs(SB)
-TEXT ·libc_getfsstat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_getfsstat(SB)
-TEXT ·libc_lstat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_lstat(SB)
-TEXT ·libc_stat_trampoline(SB),NOSPLIT,$0-0
- JMP libc_stat(SB)
-TEXT ·libc_statfs_trampoline(SB),NOSPLIT,$0-0
- JMP libc_statfs(SB)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go
index d30ec4e29..cec595d55 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go
@@ -16,25 +16,25 @@ var _ syscall.Errno
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func closedir(dir uintptr) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0)
+ _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_closedir_trampoline()
+var libc_closedir_trampoline_addr uintptr
//go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) {
- r0, _, _ := syscall_syscall(funcPC(libc_readdir_r_trampoline), uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
+ r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
res = Errno(r0)
return
}
-func libc_readdir_r_trampoline()
+var libc_readdir_r_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib"
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s
index b29dabb0f..357989722 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s
@@ -1,12 +1,25 @@
// go run mkasm_darwin.go arm64
// Code generated by the command above; DO NOT EDIT.
+//go:build go1.13
// +build go1.13
#include "textflag.h"
-TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0
+
+TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fdopendir(SB)
-TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB)
+
+TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_closedir(SB)
-TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8
+DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB)
+
+TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readdir_r(SB)
+
+GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8
+DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go
index a10df58d0..f2ee2bd33 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go
@@ -16,7 +16,7 @@ var _ syscall.Errno
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_getgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
+ r0, _, e1 := syscall_rawSyscall(libc_getgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -24,28 +24,28 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
return
}
-func libc_getgroups_trampoline()
+var libc_getgroups_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getgroups getgroups "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func setgroups(ngid int, gid *_Gid_t) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
+ _, _, e1 := syscall_rawSyscall(libc_setgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setgroups_trampoline()
+var libc_setgroups_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setgroups setgroups "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_wait4_trampoline), uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_wait4_trampoline_addr, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -53,14 +53,14 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
return
}
-func libc_wait4_trampoline()
+var libc_wait4_trampoline_addr uintptr
//go:cgo_import_dynamic libc_wait4 wait4 "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_accept_trampoline), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
+ r0, _, e1 := syscall_syscall(libc_accept_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -68,42 +68,42 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
return
}
-func libc_accept_trampoline()
+var libc_accept_trampoline_addr uintptr
//go:cgo_import_dynamic libc_accept accept "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_bind_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen))
+ _, _, e1 := syscall_syscall(libc_bind_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_bind_trampoline()
+var libc_bind_trampoline_addr uintptr
//go:cgo_import_dynamic libc_bind bind "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_connect_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen))
+ _, _, e1 := syscall_syscall(libc_connect_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_connect_trampoline()
+var libc_connect_trampoline_addr uintptr
//go:cgo_import_dynamic libc_connect connect "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func socket(domain int, typ int, proto int) (fd int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_socket_trampoline), uintptr(domain), uintptr(typ), uintptr(proto))
+ r0, _, e1 := syscall_rawSyscall(libc_socket_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -111,91 +111,91 @@ func socket(domain int, typ int, proto int) (fd int, err error) {
return
}
-func libc_socket_trampoline()
+var libc_socket_trampoline_addr uintptr
//go:cgo_import_dynamic libc_socket socket "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_getsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
+ _, _, e1 := syscall_syscall6(libc_getsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_getsockopt_trampoline()
+var libc_getsockopt_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getsockopt getsockopt "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_setsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
+ _, _, e1 := syscall_syscall6(libc_setsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setsockopt_trampoline()
+var libc_setsockopt_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setsockopt setsockopt "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getpeername_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
+ _, _, e1 := syscall_rawSyscall(libc_getpeername_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_getpeername_trampoline()
+var libc_getpeername_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getpeername getpeername "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getsockname_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
+ _, _, e1 := syscall_rawSyscall(libc_getsockname_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_getsockname_trampoline()
+var libc_getsockname_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getsockname getsockname "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Shutdown(s int, how int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_shutdown_trampoline), uintptr(s), uintptr(how), 0)
+ _, _, e1 := syscall_syscall(libc_shutdown_trampoline_addr, uintptr(s), uintptr(how), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_shutdown_trampoline()
+var libc_shutdown_trampoline_addr uintptr
//go:cgo_import_dynamic libc_shutdown shutdown "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
- _, _, e1 := syscall_rawSyscall6(funcPC(libc_socketpair_trampoline), uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
+ _, _, e1 := syscall_rawSyscall6(libc_socketpair_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_socketpair_trampoline()
+var libc_socketpair_trampoline_addr uintptr
//go:cgo_import_dynamic libc_socketpair socketpair "/usr/lib/libSystem.B.dylib"
@@ -208,7 +208,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl
} else {
_p0 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_recvfrom_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
+ r0, _, e1 := syscall_syscall6(libc_recvfrom_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -216,7 +216,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl
return
}
-func libc_recvfrom_trampoline()
+var libc_recvfrom_trampoline_addr uintptr
//go:cgo_import_dynamic libc_recvfrom recvfrom "/usr/lib/libSystem.B.dylib"
@@ -229,21 +229,21 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall6(funcPC(libc_sendto_trampoline), uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
+ _, _, e1 := syscall_syscall6(libc_sendto_trampoline_addr, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_sendto_trampoline()
+var libc_sendto_trampoline_addr uintptr
//go:cgo_import_dynamic libc_sendto sendto "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_recvmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
+ r0, _, e1 := syscall_syscall(libc_recvmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -251,14 +251,14 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
return
}
-func libc_recvmsg_trampoline()
+var libc_recvmsg_trampoline_addr uintptr
//go:cgo_import_dynamic libc_recvmsg recvmsg "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_sendmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
+ r0, _, e1 := syscall_syscall(libc_sendmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -266,14 +266,14 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
return
}
-func libc_sendmsg_trampoline()
+var libc_sendmsg_trampoline_addr uintptr
//go:cgo_import_dynamic libc_sendmsg sendmsg "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_kevent_trampoline), uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
+ r0, _, e1 := syscall_syscall6(libc_kevent_trampoline_addr, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -281,7 +281,7 @@ func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, ne
return
}
-func libc_kevent_trampoline()
+var libc_kevent_trampoline_addr uintptr
//go:cgo_import_dynamic libc_kevent kevent "/usr/lib/libSystem.B.dylib"
@@ -293,35 +293,35 @@ func utimes(path string, timeval *[2]Timeval) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_utimes_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
+ _, _, e1 := syscall_syscall(libc_utimes_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_utimes_trampoline()
+var libc_utimes_trampoline_addr uintptr
//go:cgo_import_dynamic libc_utimes utimes "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func futimes(fd int, timeval *[2]Timeval) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_futimes_trampoline), uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
+ _, _, e1 := syscall_syscall(libc_futimes_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_futimes_trampoline()
+var libc_futimes_trampoline_addr uintptr
//go:cgo_import_dynamic libc_futimes futimes "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
+ r0, _, e1 := syscall_syscall(libc_poll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -329,7 +329,7 @@ func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
return
}
-func libc_poll_trampoline()
+var libc_poll_trampoline_addr uintptr
//go:cgo_import_dynamic libc_poll poll "/usr/lib/libSystem.B.dylib"
@@ -342,14 +342,14 @@ func Madvise(b []byte, behav int) (err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall(funcPC(libc_madvise_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(behav))
+ _, _, e1 := syscall_syscall(libc_madvise_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(behav))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_madvise_trampoline()
+var libc_madvise_trampoline_addr uintptr
//go:cgo_import_dynamic libc_madvise madvise "/usr/lib/libSystem.B.dylib"
@@ -362,28 +362,28 @@ func Mlock(b []byte) (err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall(funcPC(libc_mlock_trampoline), uintptr(_p0), uintptr(len(b)), 0)
+ _, _, e1 := syscall_syscall(libc_mlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mlock_trampoline()
+var libc_mlock_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mlock mlock "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlockall(flags int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_mlockall_trampoline), uintptr(flags), 0, 0)
+ _, _, e1 := syscall_syscall(libc_mlockall_trampoline_addr, uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mlockall_trampoline()
+var libc_mlockall_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mlockall mlockall "/usr/lib/libSystem.B.dylib"
@@ -396,14 +396,14 @@ func Mprotect(b []byte, prot int) (err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall(funcPC(libc_mprotect_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(prot))
+ _, _, e1 := syscall_syscall(libc_mprotect_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(prot))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mprotect_trampoline()
+var libc_mprotect_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mprotect mprotect "/usr/lib/libSystem.B.dylib"
@@ -416,14 +416,14 @@ func Msync(b []byte, flags int) (err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall(funcPC(libc_msync_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(flags))
+ _, _, e1 := syscall_syscall(libc_msync_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_msync_trampoline()
+var libc_msync_trampoline_addr uintptr
//go:cgo_import_dynamic libc_msync msync "/usr/lib/libSystem.B.dylib"
@@ -436,42 +436,42 @@ func Munlock(b []byte) (err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall(funcPC(libc_munlock_trampoline), uintptr(_p0), uintptr(len(b)), 0)
+ _, _, e1 := syscall_syscall(libc_munlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_munlock_trampoline()
+var libc_munlock_trampoline_addr uintptr
//go:cgo_import_dynamic libc_munlock munlock "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlockall() (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_munlockall_trampoline), 0, 0, 0)
+ _, _, e1 := syscall_syscall(libc_munlockall_trampoline_addr, 0, 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_munlockall_trampoline()
+var libc_munlockall_trampoline_addr uintptr
//go:cgo_import_dynamic libc_munlockall munlockall "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pipe(p *[2]int32) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), uintptr(unsafe.Pointer(p)), 0, 0)
+ _, _, e1 := syscall_rawSyscall(libc_pipe_trampoline_addr, uintptr(unsafe.Pointer(p)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_pipe_trampoline()
+var libc_pipe_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pipe pipe "/usr/lib/libSystem.B.dylib"
@@ -488,7 +488,7 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o
if err != nil {
return
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_getxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
+ r0, _, e1 := syscall_syscall6(libc_getxattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -496,7 +496,7 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o
return
}
-func libc_getxattr_trampoline()
+var libc_getxattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getxattr getxattr "/usr/lib/libSystem.B.dylib"
@@ -508,7 +508,7 @@ func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, optio
if err != nil {
return
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_fgetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
+ r0, _, e1 := syscall_syscall6(libc_fgetxattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -516,7 +516,7 @@ func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, optio
return
}
-func libc_fgetxattr_trampoline()
+var libc_fgetxattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fgetxattr fgetxattr "/usr/lib/libSystem.B.dylib"
@@ -533,14 +533,14 @@ func setxattr(path string, attr string, data *byte, size int, position uint32, o
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_setxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
+ _, _, e1 := syscall_syscall6(libc_setxattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setxattr_trampoline()
+var libc_setxattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setxattr setxattr "/usr/lib/libSystem.B.dylib"
@@ -552,14 +552,14 @@ func fsetxattr(fd int, attr string, data *byte, size int, position uint32, optio
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_fsetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
+ _, _, e1 := syscall_syscall6(libc_fsetxattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fsetxattr_trampoline()
+var libc_fsetxattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fsetxattr fsetxattr "/usr/lib/libSystem.B.dylib"
@@ -576,14 +576,14 @@ func removexattr(path string, attr string, options int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_removexattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
+ _, _, e1 := syscall_syscall(libc_removexattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_removexattr_trampoline()
+var libc_removexattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_removexattr removexattr "/usr/lib/libSystem.B.dylib"
@@ -595,14 +595,14 @@ func fremovexattr(fd int, attr string, options int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_fremovexattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options))
+ _, _, e1 := syscall_syscall(libc_fremovexattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fremovexattr_trampoline()
+var libc_fremovexattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fremovexattr fremovexattr "/usr/lib/libSystem.B.dylib"
@@ -614,7 +614,7 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro
if err != nil {
return
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_listxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_listxattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -622,14 +622,14 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro
return
}
-func libc_listxattr_trampoline()
+var libc_listxattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_listxattr listxattr "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_flistxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_flistxattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -637,28 +637,28 @@ func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) {
return
}
-func libc_flistxattr_trampoline()
+var libc_flistxattr_trampoline_addr uintptr
//go:cgo_import_dynamic libc_flistxattr flistxattr "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_setattrlist_trampoline), uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0)
+ _, _, e1 := syscall_syscall6(libc_setattrlist_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setattrlist_trampoline()
+var libc_setattrlist_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setattrlist setattrlist "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fcntl(fd int, cmd int, arg int) (val int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg))
+ r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -666,35 +666,35 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) {
return
}
-func libc_fcntl_trampoline()
+var libc_fcntl_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func kill(pid int, signum int, posix int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix))
+ _, _, e1 := syscall_syscall(libc_kill_trampoline_addr, uintptr(pid), uintptr(signum), uintptr(posix))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_kill_trampoline()
+var libc_kill_trampoline_addr uintptr
//go:cgo_import_dynamic libc_kill kill "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ioctl(fd int, req uint, arg uintptr) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_ioctl_trampoline), uintptr(fd), uintptr(req), uintptr(arg))
+ _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_ioctl_trampoline()
+var libc_ioctl_trampoline_addr uintptr
//go:cgo_import_dynamic libc_ioctl ioctl "/usr/lib/libSystem.B.dylib"
@@ -707,28 +707,28 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr)
} else {
_p0 = unsafe.Pointer(&_zero)
}
- _, _, e1 := syscall_syscall6(funcPC(libc_sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
+ _, _, e1 := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_sysctl_trampoline()
+var libc_sysctl_trampoline_addr uintptr
//go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
+ _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_sendfile_trampoline()
+var libc_sendfile_trampoline_addr uintptr
//go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib"
@@ -740,28 +740,28 @@ func Access(path string, mode uint32) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_access_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
+ _, _, e1 := syscall_syscall(libc_access_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_access_trampoline()
+var libc_access_trampoline_addr uintptr
//go:cgo_import_dynamic libc_access access "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_adjtime_trampoline), uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
+ _, _, e1 := syscall_syscall(libc_adjtime_trampoline_addr, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_adjtime_trampoline()
+var libc_adjtime_trampoline_addr uintptr
//go:cgo_import_dynamic libc_adjtime adjtime "/usr/lib/libSystem.B.dylib"
@@ -773,14 +773,14 @@ func Chdir(path string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_chdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_chdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_chdir_trampoline()
+var libc_chdir_trampoline_addr uintptr
//go:cgo_import_dynamic libc_chdir chdir "/usr/lib/libSystem.B.dylib"
@@ -792,14 +792,14 @@ func Chflags(path string, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_chflags_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
+ _, _, e1 := syscall_syscall(libc_chflags_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_chflags_trampoline()
+var libc_chflags_trampoline_addr uintptr
//go:cgo_import_dynamic libc_chflags chflags "/usr/lib/libSystem.B.dylib"
@@ -811,14 +811,14 @@ func Chmod(path string, mode uint32) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_chmod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
+ _, _, e1 := syscall_syscall(libc_chmod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_chmod_trampoline()
+var libc_chmod_trampoline_addr uintptr
//go:cgo_import_dynamic libc_chmod chmod "/usr/lib/libSystem.B.dylib"
@@ -830,14 +830,14 @@ func Chown(path string, uid int, gid int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_chown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
+ _, _, e1 := syscall_syscall(libc_chown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_chown_trampoline()
+var libc_chown_trampoline_addr uintptr
//go:cgo_import_dynamic libc_chown chown "/usr/lib/libSystem.B.dylib"
@@ -849,42 +849,42 @@ func Chroot(path string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_chroot_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_chroot_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_chroot_trampoline()
+var libc_chroot_trampoline_addr uintptr
//go:cgo_import_dynamic libc_chroot chroot "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ClockGettime(clockid int32, time *Timespec) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_clock_gettime_trampoline), uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)
+ _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_clock_gettime_trampoline()
+var libc_clock_gettime_trampoline_addr uintptr
//go:cgo_import_dynamic libc_clock_gettime clock_gettime "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Close(fd int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_close_trampoline), uintptr(fd), 0, 0)
+ _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_close_trampoline()
+var libc_close_trampoline_addr uintptr
//go:cgo_import_dynamic libc_close close "/usr/lib/libSystem.B.dylib"
@@ -901,14 +901,14 @@ func Clonefile(src string, dst string, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_clonefile_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags))
+ _, _, e1 := syscall_syscall(libc_clonefile_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_clonefile_trampoline()
+var libc_clonefile_trampoline_addr uintptr
//go:cgo_import_dynamic libc_clonefile clonefile "/usr/lib/libSystem.B.dylib"
@@ -925,21 +925,21 @@ func Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int)
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_clonefileat_trampoline), uintptr(srcDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
+ _, _, e1 := syscall_syscall6(libc_clonefileat_trampoline_addr, uintptr(srcDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_clonefileat_trampoline()
+var libc_clonefileat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_clonefileat clonefileat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup(fd int) (nfd int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0)
+ r0, _, e1 := syscall_syscall(libc_dup_trampoline_addr, uintptr(fd), 0, 0)
nfd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -947,21 +947,21 @@ func Dup(fd int) (nfd int, err error) {
return
}
-func libc_dup_trampoline()
+var libc_dup_trampoline_addr uintptr
//go:cgo_import_dynamic libc_dup dup "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup2(from int, to int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_dup2_trampoline), uintptr(from), uintptr(to), 0)
+ _, _, e1 := syscall_syscall(libc_dup2_trampoline_addr, uintptr(from), uintptr(to), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_dup2_trampoline()
+var libc_dup2_trampoline_addr uintptr
//go:cgo_import_dynamic libc_dup2 dup2 "/usr/lib/libSystem.B.dylib"
@@ -978,25 +978,25 @@ func Exchangedata(path1 string, path2 string, options int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_exchangedata_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
+ _, _, e1 := syscall_syscall(libc_exchangedata_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_exchangedata_trampoline()
+var libc_exchangedata_trampoline_addr uintptr
//go:cgo_import_dynamic libc_exchangedata exchangedata "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Exit(code int) {
- syscall_syscall(funcPC(libc_exit_trampoline), uintptr(code), 0, 0)
+ syscall_syscall(libc_exit_trampoline_addr, uintptr(code), 0, 0)
return
}
-func libc_exit_trampoline()
+var libc_exit_trampoline_addr uintptr
//go:cgo_import_dynamic libc_exit exit "/usr/lib/libSystem.B.dylib"
@@ -1008,56 +1008,56 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_faccessat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
+ _, _, e1 := syscall_syscall6(libc_faccessat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_faccessat_trampoline()
+var libc_faccessat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_faccessat faccessat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchdir(fd int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchdir_trampoline), uintptr(fd), 0, 0)
+ _, _, e1 := syscall_syscall(libc_fchdir_trampoline_addr, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fchdir_trampoline()
+var libc_fchdir_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fchdir fchdir "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchflags(fd int, flags int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchflags_trampoline), uintptr(fd), uintptr(flags), 0)
+ _, _, e1 := syscall_syscall(libc_fchflags_trampoline_addr, uintptr(fd), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fchflags_trampoline()
+var libc_fchflags_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fchflags fchflags "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchmod(fd int, mode uint32) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchmod_trampoline), uintptr(fd), uintptr(mode), 0)
+ _, _, e1 := syscall_syscall(libc_fchmod_trampoline_addr, uintptr(fd), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fchmod_trampoline()
+var libc_fchmod_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fchmod fchmod "/usr/lib/libSystem.B.dylib"
@@ -1069,28 +1069,28 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_fchmodat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
+ _, _, e1 := syscall_syscall6(libc_fchmodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fchmodat_trampoline()
+var libc_fchmodat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fchmodat fchmodat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchown(fd int, uid int, gid int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fchown_trampoline), uintptr(fd), uintptr(uid), uintptr(gid))
+ _, _, e1 := syscall_syscall(libc_fchown_trampoline_addr, uintptr(fd), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fchown_trampoline()
+var libc_fchown_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fchown fchown "/usr/lib/libSystem.B.dylib"
@@ -1102,14 +1102,14 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_fchownat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
+ _, _, e1 := syscall_syscall6(libc_fchownat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fchownat_trampoline()
+var libc_fchownat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fchownat fchownat "/usr/lib/libSystem.B.dylib"
@@ -1121,35 +1121,35 @@ func Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error)
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_fclonefileat_trampoline), uintptr(srcDirfd), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0)
+ _, _, e1 := syscall_syscall6(libc_fclonefileat_trampoline_addr, uintptr(srcDirfd), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fclonefileat_trampoline()
+var libc_fclonefileat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fclonefileat fclonefileat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Flock(fd int, how int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0)
+ _, _, e1 := syscall_syscall(libc_flock_trampoline_addr, uintptr(fd), uintptr(how), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_flock_trampoline()
+var libc_flock_trampoline_addr uintptr
//go:cgo_import_dynamic libc_flock flock "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fpathconf(fd int, name int) (val int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_fpathconf_trampoline), uintptr(fd), uintptr(name), 0)
+ r0, _, e1 := syscall_syscall(libc_fpathconf_trampoline_addr, uintptr(fd), uintptr(name), 0)
val = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1157,35 +1157,35 @@ func Fpathconf(fd int, name int) (val int, err error) {
return
}
-func libc_fpathconf_trampoline()
+var libc_fpathconf_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fsync(fd int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fsync_trampoline), uintptr(fd), 0, 0)
+ _, _, e1 := syscall_syscall(libc_fsync_trampoline_addr, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fsync_trampoline()
+var libc_fsync_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fsync fsync "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Ftruncate(fd int, length int64) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_ftruncate_trampoline), uintptr(fd), uintptr(length), 0)
+ _, _, e1 := syscall_syscall(libc_ftruncate_trampoline_addr, uintptr(fd), uintptr(length), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_ftruncate_trampoline()
+var libc_ftruncate_trampoline_addr uintptr
//go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib"
@@ -1198,7 +1198,7 @@ func Getcwd(buf []byte) (n int, err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall(funcPC(libc_getcwd_trampoline), uintptr(_p0), uintptr(len(buf)), 0)
+ r0, _, e1 := syscall_syscall(libc_getcwd_trampoline_addr, uintptr(_p0), uintptr(len(buf)), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1206,62 +1206,62 @@ func Getcwd(buf []byte) (n int, err error) {
return
}
-func libc_getcwd_trampoline()
+var libc_getcwd_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getcwd getcwd "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getdtablesize() (size int) {
- r0, _, _ := syscall_syscall(funcPC(libc_getdtablesize_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_syscall(libc_getdtablesize_trampoline_addr, 0, 0, 0)
size = int(r0)
return
}
-func libc_getdtablesize_trampoline()
+var libc_getdtablesize_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getdtablesize getdtablesize "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getegid() (egid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getegid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_getegid_trampoline_addr, 0, 0, 0)
egid = int(r0)
return
}
-func libc_getegid_trampoline()
+var libc_getegid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getegid getegid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Geteuid() (uid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_geteuid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_geteuid_trampoline_addr, 0, 0, 0)
uid = int(r0)
return
}
-func libc_geteuid_trampoline()
+var libc_geteuid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_geteuid geteuid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getgid() (gid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getgid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_getgid_trampoline_addr, 0, 0, 0)
gid = int(r0)
return
}
-func libc_getgid_trampoline()
+var libc_getgid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getgid getgid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpgid(pid int) (pgid int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_getpgid_trampoline), uintptr(pid), 0, 0)
+ r0, _, e1 := syscall_rawSyscall(libc_getpgid_trampoline_addr, uintptr(pid), 0, 0)
pgid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1269,50 +1269,50 @@ func Getpgid(pid int) (pgid int, err error) {
return
}
-func libc_getpgid_trampoline()
+var libc_getpgid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getpgid getpgid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpgrp() (pgrp int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getpgrp_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_getpgrp_trampoline_addr, 0, 0, 0)
pgrp = int(r0)
return
}
-func libc_getpgrp_trampoline()
+var libc_getpgrp_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getpgrp getpgrp "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpid() (pid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getpid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_getpid_trampoline_addr, 0, 0, 0)
pid = int(r0)
return
}
-func libc_getpid_trampoline()
+var libc_getpid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getpid getpid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getppid() (ppid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getppid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_getppid_trampoline_addr, 0, 0, 0)
ppid = int(r0)
return
}
-func libc_getppid_trampoline()
+var libc_getppid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getppid getppid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpriority(which int, who int) (prio int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_getpriority_trampoline), uintptr(which), uintptr(who), 0)
+ r0, _, e1 := syscall_syscall(libc_getpriority_trampoline_addr, uintptr(which), uintptr(who), 0)
prio = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1320,42 +1320,42 @@ func Getpriority(which int, who int) (prio int, err error) {
return
}
-func libc_getpriority_trampoline()
+var libc_getpriority_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getpriority getpriority "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getrlimit(which int, lim *Rlimit) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
+ _, _, e1 := syscall_rawSyscall(libc_getrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_getrlimit_trampoline()
+var libc_getrlimit_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getrlimit getrlimit "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getrusage(who int, rusage *Rusage) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_getrusage_trampoline), uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
+ _, _, e1 := syscall_rawSyscall(libc_getrusage_trampoline_addr, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_getrusage_trampoline()
+var libc_getrusage_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getrusage getrusage "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getsid(pid int) (sid int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_getsid_trampoline), uintptr(pid), 0, 0)
+ r0, _, e1 := syscall_rawSyscall(libc_getsid_trampoline_addr, uintptr(pid), 0, 0)
sid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1363,52 +1363,52 @@ func Getsid(pid int) (sid int, err error) {
return
}
-func libc_getsid_trampoline()
+var libc_getsid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getsid getsid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Gettimeofday(tp *Timeval) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
+ _, _, e1 := syscall_rawSyscall(libc_gettimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_gettimeofday_trampoline()
+var libc_gettimeofday_trampoline_addr uintptr
//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getuid() (uid int) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_getuid_trampoline_addr, 0, 0, 0)
uid = int(r0)
return
}
-func libc_getuid_trampoline()
+var libc_getuid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getuid getuid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Issetugid() (tainted bool) {
- r0, _, _ := syscall_rawSyscall(funcPC(libc_issetugid_trampoline), 0, 0, 0)
+ r0, _, _ := syscall_rawSyscall(libc_issetugid_trampoline_addr, 0, 0, 0)
tainted = bool(r0 != 0)
return
}
-func libc_issetugid_trampoline()
+var libc_issetugid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_issetugid issetugid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Kqueue() (fd int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_kqueue_trampoline), 0, 0, 0)
+ r0, _, e1 := syscall_syscall(libc_kqueue_trampoline_addr, 0, 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1416,7 +1416,7 @@ func Kqueue() (fd int, err error) {
return
}
-func libc_kqueue_trampoline()
+var libc_kqueue_trampoline_addr uintptr
//go:cgo_import_dynamic libc_kqueue kqueue "/usr/lib/libSystem.B.dylib"
@@ -1428,14 +1428,14 @@ func Lchown(path string, uid int, gid int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_lchown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
+ _, _, e1 := syscall_syscall(libc_lchown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_lchown_trampoline()
+var libc_lchown_trampoline_addr uintptr
//go:cgo_import_dynamic libc_lchown lchown "/usr/lib/libSystem.B.dylib"
@@ -1452,14 +1452,14 @@ func Link(path string, link string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_link_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
+ _, _, e1 := syscall_syscall(libc_link_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_link_trampoline()
+var libc_link_trampoline_addr uintptr
//go:cgo_import_dynamic libc_link link "/usr/lib/libSystem.B.dylib"
@@ -1476,28 +1476,28 @@ func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err er
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_linkat_trampoline), uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
+ _, _, e1 := syscall_syscall6(libc_linkat_trampoline_addr, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_linkat_trampoline()
+var libc_linkat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_linkat linkat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Listen(s int, backlog int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_listen_trampoline), uintptr(s), uintptr(backlog), 0)
+ _, _, e1 := syscall_syscall(libc_listen_trampoline_addr, uintptr(s), uintptr(backlog), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_listen_trampoline()
+var libc_listen_trampoline_addr uintptr
//go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib"
@@ -1509,14 +1509,14 @@ func Mkdir(path string, mode uint32) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_mkdir_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
+ _, _, e1 := syscall_syscall(libc_mkdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mkdir_trampoline()
+var libc_mkdir_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mkdir mkdir "/usr/lib/libSystem.B.dylib"
@@ -1528,14 +1528,14 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_mkdirat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
+ _, _, e1 := syscall_syscall(libc_mkdirat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mkdirat_trampoline()
+var libc_mkdirat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mkdirat mkdirat "/usr/lib/libSystem.B.dylib"
@@ -1547,14 +1547,14 @@ func Mkfifo(path string, mode uint32) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_mkfifo_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
+ _, _, e1 := syscall_syscall(libc_mkfifo_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mkfifo_trampoline()
+var libc_mkfifo_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mkfifo mkfifo "/usr/lib/libSystem.B.dylib"
@@ -1566,14 +1566,14 @@ func Mknod(path string, mode uint32, dev int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_mknod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
+ _, _, e1 := syscall_syscall(libc_mknod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_mknod_trampoline()
+var libc_mknod_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mknod mknod "/usr/lib/libSystem.B.dylib"
@@ -1585,7 +1585,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) {
if err != nil {
return
}
- r0, _, e1 := syscall_syscall(funcPC(libc_open_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
+ r0, _, e1 := syscall_syscall(libc_open_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1593,7 +1593,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) {
return
}
-func libc_open_trampoline()
+var libc_open_trampoline_addr uintptr
//go:cgo_import_dynamic libc_open open "/usr/lib/libSystem.B.dylib"
@@ -1605,7 +1605,7 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) {
if err != nil {
return
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_openat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_openat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1613,7 +1613,7 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) {
return
}
-func libc_openat_trampoline()
+var libc_openat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib"
@@ -1625,7 +1625,7 @@ func Pathconf(path string, name int) (val int, err error) {
if err != nil {
return
}
- r0, _, e1 := syscall_syscall(funcPC(libc_pathconf_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
+ r0, _, e1 := syscall_syscall(libc_pathconf_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
val = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1633,7 +1633,7 @@ func Pathconf(path string, name int) (val int, err error) {
return
}
-func libc_pathconf_trampoline()
+var libc_pathconf_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pathconf pathconf "/usr/lib/libSystem.B.dylib"
@@ -1646,7 +1646,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_pread_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_pread_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1654,7 +1654,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) {
return
}
-func libc_pread_trampoline()
+var libc_pread_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pread pread "/usr/lib/libSystem.B.dylib"
@@ -1667,7 +1667,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_pwrite_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_pwrite_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1675,7 +1675,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
return
}
-func libc_pwrite_trampoline()
+var libc_pwrite_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pwrite pwrite "/usr/lib/libSystem.B.dylib"
@@ -1688,7 +1688,7 @@ func read(fd int, p []byte) (n int, err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)))
+ r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1696,7 +1696,7 @@ func read(fd int, p []byte) (n int, err error) {
return
}
-func libc_read_trampoline()
+var libc_read_trampoline_addr uintptr
//go:cgo_import_dynamic libc_read read "/usr/lib/libSystem.B.dylib"
@@ -1714,7 +1714,7 @@ func Readlink(path string, buf []byte) (n int, err error) {
} else {
_p1 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall(funcPC(libc_readlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
+ r0, _, e1 := syscall_syscall(libc_readlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1722,7 +1722,7 @@ func Readlink(path string, buf []byte) (n int, err error) {
return
}
-func libc_readlink_trampoline()
+var libc_readlink_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readlink readlink "/usr/lib/libSystem.B.dylib"
@@ -1740,7 +1740,7 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
} else {
_p1 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall6(funcPC(libc_readlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
+ r0, _, e1 := syscall_syscall6(libc_readlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1748,7 +1748,7 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
return
}
-func libc_readlinkat_trampoline()
+var libc_readlinkat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readlinkat readlinkat "/usr/lib/libSystem.B.dylib"
@@ -1765,14 +1765,14 @@ func Rename(from string, to string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_rename_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
+ _, _, e1 := syscall_syscall(libc_rename_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_rename_trampoline()
+var libc_rename_trampoline_addr uintptr
//go:cgo_import_dynamic libc_rename rename "/usr/lib/libSystem.B.dylib"
@@ -1789,14 +1789,14 @@ func Renameat(fromfd int, from string, tofd int, to string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_renameat_trampoline), uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
+ _, _, e1 := syscall_syscall6(libc_renameat_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_renameat_trampoline()
+var libc_renameat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_renameat renameat "/usr/lib/libSystem.B.dylib"
@@ -1808,14 +1808,14 @@ func Revoke(path string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_revoke_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_revoke_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_revoke_trampoline()
+var libc_revoke_trampoline_addr uintptr
//go:cgo_import_dynamic libc_revoke revoke "/usr/lib/libSystem.B.dylib"
@@ -1827,21 +1827,21 @@ func Rmdir(path string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_rmdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_rmdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_rmdir_trampoline()
+var libc_rmdir_trampoline_addr uintptr
//go:cgo_import_dynamic libc_rmdir rmdir "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_lseek_trampoline), uintptr(fd), uintptr(offset), uintptr(whence))
+ r0, _, e1 := syscall_syscall(libc_lseek_trampoline_addr, uintptr(fd), uintptr(offset), uintptr(whence))
newoffset = int64(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1849,14 +1849,14 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
return
}
-func libc_lseek_trampoline()
+var libc_lseek_trampoline_addr uintptr
//go:cgo_import_dynamic libc_lseek lseek "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_select_trampoline), uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
+ r0, _, e1 := syscall_syscall6(libc_select_trampoline_addr, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1864,49 +1864,49 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
return
}
-func libc_select_trampoline()
+var libc_select_trampoline_addr uintptr
//go:cgo_import_dynamic libc_select select "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setegid(egid int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_setegid_trampoline), uintptr(egid), 0, 0)
+ _, _, e1 := syscall_syscall(libc_setegid_trampoline_addr, uintptr(egid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setegid_trampoline()
+var libc_setegid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setegid setegid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Seteuid(euid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_seteuid_trampoline), uintptr(euid), 0, 0)
+ _, _, e1 := syscall_rawSyscall(libc_seteuid_trampoline_addr, uintptr(euid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_seteuid_trampoline()
+var libc_seteuid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_seteuid seteuid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setgid(gid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setgid_trampoline), uintptr(gid), 0, 0)
+ _, _, e1 := syscall_rawSyscall(libc_setgid_trampoline_addr, uintptr(gid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setgid_trampoline()
+var libc_setgid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setgid setgid "/usr/lib/libSystem.B.dylib"
@@ -1918,105 +1918,105 @@ func Setlogin(name string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_setlogin_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_setlogin_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setlogin_trampoline()
+var libc_setlogin_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setlogin setlogin "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setpgid(pid int, pgid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setpgid_trampoline), uintptr(pid), uintptr(pgid), 0)
+ _, _, e1 := syscall_rawSyscall(libc_setpgid_trampoline_addr, uintptr(pid), uintptr(pgid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setpgid_trampoline()
+var libc_setpgid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setpgid setpgid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setpriority(which int, who int, prio int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_setpriority_trampoline), uintptr(which), uintptr(who), uintptr(prio))
+ _, _, e1 := syscall_syscall(libc_setpriority_trampoline_addr, uintptr(which), uintptr(who), uintptr(prio))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setpriority_trampoline()
+var libc_setpriority_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setpriority setpriority "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setprivexec(flag int) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_setprivexec_trampoline), uintptr(flag), 0, 0)
+ _, _, e1 := syscall_syscall(libc_setprivexec_trampoline_addr, uintptr(flag), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setprivexec_trampoline()
+var libc_setprivexec_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setprivexec setprivexec "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setregid(rgid int, egid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setregid_trampoline), uintptr(rgid), uintptr(egid), 0)
+ _, _, e1 := syscall_rawSyscall(libc_setregid_trampoline_addr, uintptr(rgid), uintptr(egid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setregid_trampoline()
+var libc_setregid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setregid setregid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setreuid(ruid int, euid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setreuid_trampoline), uintptr(ruid), uintptr(euid), 0)
+ _, _, e1 := syscall_rawSyscall(libc_setreuid_trampoline_addr, uintptr(ruid), uintptr(euid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setreuid_trampoline()
+var libc_setreuid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setreuid setreuid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setrlimit(which int, lim *Rlimit) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
+ _, _, e1 := syscall_rawSyscall(libc_setrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setrlimit_trampoline()
+var libc_setrlimit_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setrlimit setrlimit "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setsid() (pid int, err error) {
- r0, _, e1 := syscall_rawSyscall(funcPC(libc_setsid_trampoline), 0, 0, 0)
+ r0, _, e1 := syscall_rawSyscall(libc_setsid_trampoline_addr, 0, 0, 0)
pid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -2024,35 +2024,35 @@ func Setsid() (pid int, err error) {
return
}
-func libc_setsid_trampoline()
+var libc_setsid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setsid setsid "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Settimeofday(tp *Timeval) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_settimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
+ _, _, e1 := syscall_rawSyscall(libc_settimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_settimeofday_trampoline()
+var libc_settimeofday_trampoline_addr uintptr
//go:cgo_import_dynamic libc_settimeofday settimeofday "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setuid(uid int) (err error) {
- _, _, e1 := syscall_rawSyscall(funcPC(libc_setuid_trampoline), uintptr(uid), 0, 0)
+ _, _, e1 := syscall_rawSyscall(libc_setuid_trampoline_addr, uintptr(uid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_setuid_trampoline()
+var libc_setuid_trampoline_addr uintptr
//go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib"
@@ -2069,14 +2069,14 @@ func Symlink(path string, link string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_symlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
+ _, _, e1 := syscall_syscall(libc_symlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_symlink_trampoline()
+var libc_symlink_trampoline_addr uintptr
//go:cgo_import_dynamic libc_symlink symlink "/usr/lib/libSystem.B.dylib"
@@ -2093,28 +2093,28 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_symlinkat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
+ _, _, e1 := syscall_syscall(libc_symlinkat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_symlinkat_trampoline()
+var libc_symlinkat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_symlinkat symlinkat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Sync() (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_sync_trampoline), 0, 0, 0)
+ _, _, e1 := syscall_syscall(libc_sync_trampoline_addr, 0, 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_sync_trampoline()
+var libc_sync_trampoline_addr uintptr
//go:cgo_import_dynamic libc_sync sync "/usr/lib/libSystem.B.dylib"
@@ -2126,26 +2126,26 @@ func Truncate(path string, length int64) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_truncate_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)
+ _, _, e1 := syscall_syscall(libc_truncate_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_truncate_trampoline()
+var libc_truncate_trampoline_addr uintptr
//go:cgo_import_dynamic libc_truncate truncate "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Umask(newmask int) (oldmask int) {
- r0, _, _ := syscall_syscall(funcPC(libc_umask_trampoline), uintptr(newmask), 0, 0)
+ r0, _, _ := syscall_syscall(libc_umask_trampoline_addr, uintptr(newmask), 0, 0)
oldmask = int(r0)
return
}
-func libc_umask_trampoline()
+var libc_umask_trampoline_addr uintptr
//go:cgo_import_dynamic libc_umask umask "/usr/lib/libSystem.B.dylib"
@@ -2157,14 +2157,14 @@ func Undelete(path string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_undelete_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_undelete_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_undelete_trampoline()
+var libc_undelete_trampoline_addr uintptr
//go:cgo_import_dynamic libc_undelete undelete "/usr/lib/libSystem.B.dylib"
@@ -2176,14 +2176,14 @@ func Unlink(path string) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_unlink_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0)
+ _, _, e1 := syscall_syscall(libc_unlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_unlink_trampoline()
+var libc_unlink_trampoline_addr uintptr
//go:cgo_import_dynamic libc_unlink unlink "/usr/lib/libSystem.B.dylib"
@@ -2195,14 +2195,14 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_unlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
+ _, _, e1 := syscall_syscall(libc_unlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_unlinkat_trampoline()
+var libc_unlinkat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_unlinkat unlinkat "/usr/lib/libSystem.B.dylib"
@@ -2214,14 +2214,14 @@ func Unmount(path string, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_unmount_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
+ _, _, e1 := syscall_syscall(libc_unmount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_unmount_trampoline()
+var libc_unmount_trampoline_addr uintptr
//go:cgo_import_dynamic libc_unmount unmount "/usr/lib/libSystem.B.dylib"
@@ -2234,7 +2234,7 @@ func write(fd int, p []byte) (n int, err error) {
} else {
_p0 = unsafe.Pointer(&_zero)
}
- r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)))
+ r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -2242,14 +2242,14 @@ func write(fd int, p []byte) (n int, err error) {
return
}
-func libc_write_trampoline()
+var libc_write_trampoline_addr uintptr
//go:cgo_import_dynamic libc_write write "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
- r0, _, e1 := syscall_syscall6(funcPC(libc_mmap_trampoline), uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
+ r0, _, e1 := syscall_syscall6(libc_mmap_trampoline_addr, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
ret = uintptr(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -2257,28 +2257,28 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (
return
}
-func libc_mmap_trampoline()
+var libc_mmap_trampoline_addr uintptr
//go:cgo_import_dynamic libc_mmap mmap "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func munmap(addr uintptr, length uintptr) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_munmap_trampoline), uintptr(addr), uintptr(length), 0)
+ _, _, e1 := syscall_syscall(libc_munmap_trampoline_addr, uintptr(addr), uintptr(length), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_munmap_trampoline()
+var libc_munmap_trampoline_addr uintptr
//go:cgo_import_dynamic libc_munmap munmap "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
+ r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -2289,7 +2289,7 @@ func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
+ r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -2300,14 +2300,14 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fstat(fd int, stat *Stat_t) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fstat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
+ _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fstat_trampoline()
+var libc_fstat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fstat fstat "/usr/lib/libSystem.B.dylib"
@@ -2319,35 +2319,35 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall6(funcPC(libc_fstatat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
+ _, _, e1 := syscall_syscall6(libc_fstatat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fstatat_trampoline()
+var libc_fstatat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fstatat fstatat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fstatfs(fd int, stat *Statfs_t) (err error) {
- _, _, e1 := syscall_syscall(funcPC(libc_fstatfs_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
+ _, _, e1 := syscall_syscall(libc_fstatfs_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_fstatfs_trampoline()
+var libc_fstatfs_trampoline_addr uintptr
//go:cgo_import_dynamic libc_fstatfs fstatfs "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) {
- r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat_trampoline), uintptr(buf), uintptr(size), uintptr(flags))
+ r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(buf), uintptr(size), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
@@ -2355,7 +2355,7 @@ func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) {
return
}
-func libc_getfsstat_trampoline()
+var libc_getfsstat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_getfsstat getfsstat "/usr/lib/libSystem.B.dylib"
@@ -2367,28 +2367,28 @@ func Lstat(path string, stat *Stat_t) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_lstat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
+ _, _, e1 := syscall_syscall(libc_lstat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_lstat_trampoline()
+var libc_lstat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_lstat lstat "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) {
- _, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
+ _, _, e1 := syscall_syscall6(libc_ptrace_trampoline_addr, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_ptrace_trampoline()
+var libc_ptrace_trampoline_addr uintptr
//go:cgo_import_dynamic libc_ptrace ptrace "/usr/lib/libSystem.B.dylib"
@@ -2400,14 +2400,14 @@ func Stat(path string, stat *Stat_t) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_stat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
+ _, _, e1 := syscall_syscall(libc_stat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_stat_trampoline()
+var libc_stat_trampoline_addr uintptr
//go:cgo_import_dynamic libc_stat stat "/usr/lib/libSystem.B.dylib"
@@ -2419,13 +2419,13 @@ func Statfs(path string, stat *Statfs_t) (err error) {
if err != nil {
return
}
- _, _, e1 := syscall_syscall(funcPC(libc_statfs_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
+ _, _, e1 := syscall_syscall(libc_statfs_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
-func libc_statfs_trampoline()
+var libc_statfs_trampoline_addr uintptr
//go:cgo_import_dynamic libc_statfs statfs "/usr/lib/libSystem.B.dylib"
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s
index 53c402bf6..33e19776d 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s
@@ -1,290 +1,859 @@
// go run mkasm_darwin.go arm64
// Code generated by the command above; DO NOT EDIT.
+//go:build go1.12
// +build go1.12
#include "textflag.h"
-TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0
+
+TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getgroups(SB)
-TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB)
+
+TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setgroups(SB)
-TEXT ·libc_wait4_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB)
+
+TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_wait4(SB)
-TEXT ·libc_accept_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8
+DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB)
+
+TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_accept(SB)
-TEXT ·libc_bind_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8
+DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB)
+
+TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_bind(SB)
-TEXT ·libc_connect_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8
+DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB)
+
+TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_connect(SB)
-TEXT ·libc_socket_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8
+DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB)
+
+TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_socket(SB)
-TEXT ·libc_getsockopt_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8
+DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB)
+
+TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getsockopt(SB)
-TEXT ·libc_setsockopt_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB)
+
+TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setsockopt(SB)
-TEXT ·libc_getpeername_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB)
+
+TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getpeername(SB)
-TEXT ·libc_getsockname_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB)
+
+TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getsockname(SB)
-TEXT ·libc_shutdown_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB)
+
+TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_shutdown(SB)
-TEXT ·libc_socketpair_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8
+DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB)
+
+TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_socketpair(SB)
-TEXT ·libc_recvfrom_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8
+DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB)
+
+TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_recvfrom(SB)
-TEXT ·libc_sendto_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8
+DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB)
+
+TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sendto(SB)
-TEXT ·libc_recvmsg_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8
+DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB)
+
+TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_recvmsg(SB)
-TEXT ·libc_sendmsg_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8
+DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB)
+
+TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sendmsg(SB)
-TEXT ·libc_kevent_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8
+DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB)
+
+TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_kevent(SB)
-TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8
+DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB)
+
+TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_utimes(SB)
-TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8
+DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB)
+
+TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_futimes(SB)
-TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8
+DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB)
+
+TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_poll(SB)
-TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8
+DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB)
+
+TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_madvise(SB)
-TEXT ·libc_mlock_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8
+DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB)
+
+TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mlock(SB)
-TEXT ·libc_mlockall_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB)
+
+TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mlockall(SB)
-TEXT ·libc_mprotect_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB)
+
+TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mprotect(SB)
-TEXT ·libc_msync_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB)
+
+TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_msync(SB)
-TEXT ·libc_munlock_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8
+DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB)
+
+TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_munlock(SB)
-TEXT ·libc_munlockall_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8
+DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB)
+
+TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_munlockall(SB)
-TEXT ·libc_pipe_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8
+DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB)
+
+TEXT libc_pipe_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pipe(SB)
-TEXT ·libc_getxattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_pipe_trampoline_addr(SB), RODATA, $8
+DATA ·libc_pipe_trampoline_addr(SB)/8, $libc_pipe_trampoline<>(SB)
+
+TEXT libc_getxattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getxattr(SB)
-TEXT ·libc_fgetxattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getxattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getxattr_trampoline_addr(SB)/8, $libc_getxattr_trampoline<>(SB)
+
+TEXT libc_fgetxattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fgetxattr(SB)
-TEXT ·libc_setxattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fgetxattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fgetxattr_trampoline_addr(SB)/8, $libc_fgetxattr_trampoline<>(SB)
+
+TEXT libc_setxattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setxattr(SB)
-TEXT ·libc_fsetxattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setxattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setxattr_trampoline_addr(SB)/8, $libc_setxattr_trampoline<>(SB)
+
+TEXT libc_fsetxattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fsetxattr(SB)
-TEXT ·libc_removexattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fsetxattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fsetxattr_trampoline_addr(SB)/8, $libc_fsetxattr_trampoline<>(SB)
+
+TEXT libc_removexattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_removexattr(SB)
-TEXT ·libc_fremovexattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_removexattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_removexattr_trampoline_addr(SB)/8, $libc_removexattr_trampoline<>(SB)
+
+TEXT libc_fremovexattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fremovexattr(SB)
-TEXT ·libc_listxattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fremovexattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fremovexattr_trampoline_addr(SB)/8, $libc_fremovexattr_trampoline<>(SB)
+
+TEXT libc_listxattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_listxattr(SB)
-TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_listxattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_listxattr_trampoline_addr(SB)/8, $libc_listxattr_trampoline<>(SB)
+
+TEXT libc_flistxattr_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_flistxattr(SB)
-TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_flistxattr_trampoline_addr(SB), RODATA, $8
+DATA ·libc_flistxattr_trampoline_addr(SB)/8, $libc_flistxattr_trampoline<>(SB)
+
+TEXT libc_setattrlist_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setattrlist(SB)
-TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setattrlist_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setattrlist_trampoline_addr(SB)/8, $libc_setattrlist_trampoline<>(SB)
+
+TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fcntl(SB)
-TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB)
+
+TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_kill(SB)
-TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8
+DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB)
+
+TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_ioctl(SB)
-TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8
+DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB)
+
+TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sysctl(SB)
-TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
+DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB)
+
+TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sendfile(SB)
-TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8
+DATA ·libc_sendfile_trampoline_addr(SB)/8, $libc_sendfile_trampoline<>(SB)
+
+TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_access(SB)
-TEXT ·libc_adjtime_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8
+DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB)
+
+TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_adjtime(SB)
-TEXT ·libc_chdir_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8
+DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB)
+
+TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_chdir(SB)
-TEXT ·libc_chflags_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8
+DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB)
+
+TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_chflags(SB)
-TEXT ·libc_chmod_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8
+DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB)
+
+TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_chmod(SB)
-TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8
+DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB)
+
+TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_chown(SB)
-TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8
+DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB)
+
+TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_chroot(SB)
-TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8
+DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB)
+
+TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_clock_gettime(SB)
-TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8
+DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB)
+
+TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_close(SB)
-TEXT ·libc_clonefile_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8
+DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB)
+
+TEXT libc_clonefile_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_clonefile(SB)
-TEXT ·libc_clonefileat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_clonefile_trampoline_addr(SB), RODATA, $8
+DATA ·libc_clonefile_trampoline_addr(SB)/8, $libc_clonefile_trampoline<>(SB)
+
+TEXT libc_clonefileat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_clonefileat(SB)
-TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_clonefileat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_clonefileat_trampoline_addr(SB)/8, $libc_clonefileat_trampoline<>(SB)
+
+TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_dup(SB)
-TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8
+DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB)
+
+TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_dup2(SB)
-TEXT ·libc_exchangedata_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8
+DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB)
+
+TEXT libc_exchangedata_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_exchangedata(SB)
-TEXT ·libc_exit_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_exchangedata_trampoline_addr(SB), RODATA, $8
+DATA ·libc_exchangedata_trampoline_addr(SB)/8, $libc_exchangedata_trampoline<>(SB)
+
+TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_exit(SB)
-TEXT ·libc_faccessat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8
+DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB)
+
+TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_faccessat(SB)
-TEXT ·libc_fchdir_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB)
+
+TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fchdir(SB)
-TEXT ·libc_fchflags_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB)
+
+TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fchflags(SB)
-TEXT ·libc_fchmod_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB)
+
+TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fchmod(SB)
-TEXT ·libc_fchmodat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB)
+
+TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fchmodat(SB)
-TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB)
+
+TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fchown(SB)
-TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB)
+
+TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fchownat(SB)
-TEXT ·libc_fclonefileat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB)
+
+TEXT libc_fclonefileat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fclonefileat(SB)
-TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fclonefileat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fclonefileat_trampoline_addr(SB)/8, $libc_fclonefileat_trampoline<>(SB)
+
+TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_flock(SB)
-TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8
+DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB)
+
+TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fpathconf(SB)
-TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB)
+
+TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fsync(SB)
-TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB)
+
+TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_ftruncate(SB)
-TEXT ·libc_getcwd_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8
+DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB)
+
+TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getcwd(SB)
-TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB)
+
+TEXT libc_getdtablesize_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getdtablesize(SB)
-TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getdtablesize_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getdtablesize_trampoline_addr(SB)/8, $libc_getdtablesize_trampoline<>(SB)
+
+TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getegid(SB)
-TEXT ·libc_geteuid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB)
+
+TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_geteuid(SB)
-TEXT ·libc_getgid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB)
+
+TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getgid(SB)
-TEXT ·libc_getpgid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB)
+
+TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getpgid(SB)
-TEXT ·libc_getpgrp_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB)
+
+TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getpgrp(SB)
-TEXT ·libc_getpid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB)
+
+TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getpid(SB)
-TEXT ·libc_getppid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB)
+
+TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getppid(SB)
-TEXT ·libc_getpriority_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB)
+
+TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getpriority(SB)
-TEXT ·libc_getrlimit_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB)
+
+TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getrlimit(SB)
-TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB)
+
+TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getrusage(SB)
-TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB)
+
+TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getsid(SB)
-TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB)
+
+TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_gettimeofday(SB)
-TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8
+DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB)
+
+TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getuid(SB)
-TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB)
+
+TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_issetugid(SB)
-TEXT ·libc_kqueue_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB)
+
+TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_kqueue(SB)
-TEXT ·libc_lchown_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8
+DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB)
+
+TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_lchown(SB)
-TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8
+DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB)
+
+TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_link(SB)
-TEXT ·libc_linkat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8
+DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB)
+
+TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_linkat(SB)
-TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB)
+
+TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_listen(SB)
-TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8
+DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB)
+
+TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mkdir(SB)
-TEXT ·libc_mkdirat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB)
+
+TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mkdirat(SB)
-TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB)
+
+TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mkfifo(SB)
-TEXT ·libc_mknod_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB)
+
+TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mknod(SB)
-TEXT ·libc_open_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB)
+
+TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_open(SB)
-TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8
+DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB)
+
+TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_openat(SB)
-TEXT ·libc_pathconf_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB)
+
+TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pathconf(SB)
-TEXT ·libc_pread_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8
+DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB)
+
+TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pread(SB)
-TEXT ·libc_pwrite_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8
+DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB)
+
+TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pwrite(SB)
-TEXT ·libc_read_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8
+DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB)
+
+TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_read(SB)
-TEXT ·libc_readlink_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8
+DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB)
+
+TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readlink(SB)
-TEXT ·libc_readlinkat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8
+DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB)
+
+TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readlinkat(SB)
-TEXT ·libc_rename_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB)
+
+TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_rename(SB)
-TEXT ·libc_renameat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8
+DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB)
+
+TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_renameat(SB)
-TEXT ·libc_revoke_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB)
+
+TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_revoke(SB)
-TEXT ·libc_rmdir_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8
+DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB)
+
+TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_rmdir(SB)
-TEXT ·libc_lseek_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8
+DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB)
+
+TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_lseek(SB)
-TEXT ·libc_select_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8
+DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB)
+
+TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_select(SB)
-TEXT ·libc_setegid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8
+DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB)
+
+TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setegid(SB)
-TEXT ·libc_seteuid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB)
+
+TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_seteuid(SB)
-TEXT ·libc_setgid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB)
+
+TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setgid(SB)
-TEXT ·libc_setlogin_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB)
+
+TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setlogin(SB)
-TEXT ·libc_setpgid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB)
+
+TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setpgid(SB)
-TEXT ·libc_setpriority_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB)
+
+TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setpriority(SB)
-TEXT ·libc_setprivexec_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB)
+
+TEXT libc_setprivexec_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setprivexec(SB)
-TEXT ·libc_setregid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setprivexec_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setprivexec_trampoline_addr(SB)/8, $libc_setprivexec_trampoline<>(SB)
+
+TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setregid(SB)
-TEXT ·libc_setreuid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB)
+
+TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setreuid(SB)
-TEXT ·libc_setrlimit_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB)
+
+TEXT libc_setrlimit_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setrlimit(SB)
-TEXT ·libc_setsid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setrlimit_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setrlimit_trampoline_addr(SB)/8, $libc_setrlimit_trampoline<>(SB)
+
+TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setsid(SB)
-TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB)
+
+TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_settimeofday(SB)
-TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8
+DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB)
+
+TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_setuid(SB)
-TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB)
+
+TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_symlink(SB)
-TEXT ·libc_symlinkat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8
+DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB)
+
+TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_symlinkat(SB)
-TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB)
+
+TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sync(SB)
-TEXT ·libc_truncate_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8
+DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB)
+
+TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_truncate(SB)
-TEXT ·libc_umask_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8
+DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB)
+
+TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_umask(SB)
-TEXT ·libc_undelete_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8
+DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB)
+
+TEXT libc_undelete_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_undelete(SB)
-TEXT ·libc_unlink_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_undelete_trampoline_addr(SB), RODATA, $8
+DATA ·libc_undelete_trampoline_addr(SB)/8, $libc_undelete_trampoline<>(SB)
+
+TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_unlink(SB)
-TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8
+DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB)
+
+TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_unlinkat(SB)
-TEXT ·libc_unmount_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB)
+
+TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_unmount(SB)
-TEXT ·libc_write_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8
+DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB)
+
+TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_write(SB)
-TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8
+DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB)
+
+TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_mmap(SB)
-TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB)
+
+TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_munmap(SB)
-TEXT ·libc_fstat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8
+DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB)
+
+TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fstat(SB)
-TEXT ·libc_fstatat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fstat_trampoline_addr(SB)/8, $libc_fstat_trampoline<>(SB)
+
+TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fstatat(SB)
-TEXT ·libc_fstatfs_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fstatat_trampoline_addr(SB)/8, $libc_fstatat_trampoline<>(SB)
+
+TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fstatfs(SB)
-TEXT ·libc_getfsstat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $8
+DATA ·libc_fstatfs_trampoline_addr(SB)/8, $libc_fstatfs_trampoline<>(SB)
+
+TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_getfsstat(SB)
-TEXT ·libc_lstat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getfsstat_trampoline_addr(SB)/8, $libc_getfsstat_trampoline<>(SB)
+
+TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_lstat(SB)
-TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_lstat_trampoline_addr(SB)/8, $libc_lstat_trampoline<>(SB)
+
+TEXT libc_ptrace_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_ptrace(SB)
-TEXT ·libc_stat_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_ptrace_trampoline_addr(SB), RODATA, $8
+DATA ·libc_ptrace_trampoline_addr(SB)/8, $libc_ptrace_trampoline<>(SB)
+
+TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_stat(SB)
-TEXT ·libc_statfs_trampoline(SB),NOSPLIT,$0-0
+
+GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $8
+DATA ·libc_stat_trampoline_addr(SB)/8, $libc_stat_trampoline<>(SB)
+
+TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_statfs(SB)
+
+GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $8
+DATA ·libc_statfs_trampoline_addr(SB)/8, $libc_statfs_trampoline<>(SB)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go
index 7305cc915..701f7eb88 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go
@@ -48,6 +48,16 @@ func ioctl(fd int, req uint, arg uintptr) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) {
+ _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(oldpath)
@@ -100,6 +110,16 @@ func openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err e
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func pipe2(p *[2]_C_int, flags int) (err error) {
+ _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0)
n = int(r0)
@@ -1201,7 +1221,7 @@ func PivotRoot(newroot string, putold string) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
@@ -1935,8 +1955,20 @@ func ProcessVMWritev(pid int, localIov []Iovec, remoteIov []RemoteIovec, flags u
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe2(p *[2]_C_int, flags int) (err error) {
- _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
+func PidfdOpen(pid int, flags int) (fd int, err error) {
+ r0, _, e1 := Syscall(SYS_PIDFD_OPEN, uintptr(pid), uintptr(flags), 0)
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func PidfdGetfd(pidfd int, targetfd int, flags int) (fd int, err error) {
+ r0, _, e1 := Syscall(SYS_PIDFD_GETFD, uintptr(pidfd), uintptr(targetfd), uintptr(flags))
+ fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go
index e37096e4d..7f3eccfcb 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go
@@ -46,37 +46,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe(p *[2]_C_int) (err error) {
- _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func dup2(oldfd int, newfd int) (err error) {
- _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func EpollCreate(size int) (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
@@ -181,17 +150,6 @@ func Getuid() (uid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyInit() (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func Ioperm(from int, num int, on int) (err error) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go
index 9919d8486..c1c9ac4dd 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go
@@ -46,27 +46,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func dup2(oldfd int, newfd int) (err error) {
- _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func EpollCreate(size int) (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
@@ -191,17 +170,6 @@ func Getuid() (uid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func inotifyInit() (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func Ioperm(from int, num int, on int) (err error) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))
if e1 != 0 {
@@ -711,16 +679,6 @@ func utimes(path string, times *[2]Timeval) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe(p *[2]_C_int) (err error) {
- _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
n = int(r0)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go
index 076754d48..d89b8be39 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go
@@ -46,16 +46,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe(p *[2]_C_int) (err error) {
- _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
@@ -235,27 +225,6 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func dup2(oldfd int, newfd int) (err error) {
- _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func EpollCreate(size int) (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
@@ -340,17 +309,6 @@ func Getuid() (uid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyInit() (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func Lchown(path string, uid int, gid int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go
index 4703cf3c3..9e609dd97 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go
@@ -46,27 +46,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func dup2(oldfd int, newfd int) (err error) {
- _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func EpollCreate(size int) (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
@@ -544,17 +523,6 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyInit() (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func Ioperm(from int, num int, on int) (err error) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))
if e1 != 0 {
@@ -706,18 +674,6 @@ func Pause() (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe() (p1 int, p2 int, err error) {
- r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
- p1 = int(r0)
- p2 = int(r1)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) {
r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset))
xaddr = uintptr(r0)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go
index a134f9a4d..46b1d82f2 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go
@@ -46,27 +46,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func dup2(oldfd int, newfd int) (err error) {
- _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func EpollCreate(size int) (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go
index b1fff2d94..ab2f9db75 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go
@@ -46,27 +46,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func dup2(oldfd int, newfd int) (err error) {
- _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func EpollCreate(size int) (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go
index d13d6da01..0d4a48bb1 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go
@@ -46,27 +46,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func dup2(oldfd int, newfd int) (err error) {
- _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func EpollCreate(size int) (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
@@ -544,17 +523,6 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyInit() (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func Ioperm(from int, num int, on int) (err error) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))
if e1 != 0 {
@@ -706,18 +674,6 @@ func Pause() (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe() (p1 int, p2 int, err error) {
- r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
- p1 = int(r0)
- p2 = int(r1)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) {
r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset))
xaddr = uintptr(r0)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go
index 927cf1a00..078f1cc6a 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go
@@ -46,27 +46,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func dup2(oldfd int, newfd int) (err error) {
- _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func EpollCreate(size int) (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
@@ -161,17 +140,6 @@ func Getuid() (uid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyInit() (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func Ioperm(from int, num int, on int) (err error) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))
if e1 != 0 {
@@ -717,16 +685,6 @@ func setrlimit(resource int, rlim *rlimit32) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe(p *[2]_C_int) (err error) {
- _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
n = int(r0)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go
index da8ec0396..791efbb78 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go
@@ -46,27 +46,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func dup2(oldfd int, newfd int) (err error) {
- _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func EpollCreate(size int) (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
@@ -191,17 +170,6 @@ func Getuid() (uid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyInit() (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func Ioperm(from int, num int, on int) (err error) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))
if e1 != 0 {
@@ -763,16 +731,6 @@ func utimes(path string, times *[2]Timeval) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe(p *[2]_C_int) (err error) {
- _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
n = int(r0)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go
index 083f493bb..dbc762169 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go
@@ -46,27 +46,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func dup2(oldfd int, newfd int) (err error) {
- _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func EpollCreate(size int) (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
@@ -191,17 +170,6 @@ func Getuid() (uid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyInit() (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func Ioperm(from int, num int, on int) (err error) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))
if e1 != 0 {
@@ -763,16 +731,6 @@ func utimes(path string, times *[2]Timeval) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe(p *[2]_C_int) (err error) {
- _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
n = int(r0)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go
index bb347407d..8f65b2ed4 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go
@@ -46,27 +46,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func dup2(oldfd int, newfd int) (err error) {
- _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
-func EpollCreate(size int) (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
@@ -191,17 +170,6 @@ func Getuid() (uid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyInit() (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func Lchown(path string, uid int, gid int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go
index 8edc517e1..227f0f888 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go
@@ -73,16 +73,6 @@ func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func dup2(oldfd int, newfd int) (err error) {
- _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
if e1 != 0 {
@@ -180,17 +170,6 @@ func Getuid() (uid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyInit() (fd int, err error) {
- r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
- fd = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func Lchown(path string, uid int, gid int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
@@ -721,16 +700,6 @@ func utimes(path string, times *[2]Timeval) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe(p *[2]_C_int) (err error) {
- _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
n = int(r0)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
index 4e18d5c99..b5f926cee 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
@@ -141,6 +141,11 @@ import (
//go:cgo_import_dynamic libc_getpeername getpeername "libsocket.so"
//go:cgo_import_dynamic libc_setsockopt setsockopt "libsocket.so"
//go:cgo_import_dynamic libc_recvfrom recvfrom "libsocket.so"
+//go:cgo_import_dynamic libc_port_create port_create "libc.so"
+//go:cgo_import_dynamic libc_port_associate port_associate "libc.so"
+//go:cgo_import_dynamic libc_port_dissociate port_dissociate "libc.so"
+//go:cgo_import_dynamic libc_port_get port_get "libc.so"
+//go:cgo_import_dynamic libc_port_getn port_getn "libc.so"
//go:linkname procpipe libc_pipe
//go:linkname procpipe2 libc_pipe2
@@ -272,6 +277,11 @@ import (
//go:linkname procgetpeername libc_getpeername
//go:linkname procsetsockopt libc_setsockopt
//go:linkname procrecvfrom libc_recvfrom
+//go:linkname procport_create libc_port_create
+//go:linkname procport_associate libc_port_associate
+//go:linkname procport_dissociate libc_port_dissociate
+//go:linkname procport_get libc_port_get
+//go:linkname procport_getn libc_port_getn
var (
procpipe,
@@ -403,7 +413,12 @@ var (
proc__xnet_getsockopt,
procgetpeername,
procsetsockopt,
- procrecvfrom syscallFunc
+ procrecvfrom,
+ procport_create,
+ procport_associate,
+ procport_dissociate,
+ procport_get,
+ procport_getn syscallFunc
)
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
@@ -1981,3 +1996,58 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func port_create() (n int, err error) {
+ r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_create)), 0, 0, 0, 0, 0, 0, 0)
+ n = int(r0)
+ if e1 != 0 {
+ err = e1
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func port_associate(port int, source int, object uintptr, events int, user *byte) (n int, err error) {
+ r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_associate)), 5, uintptr(port), uintptr(source), uintptr(object), uintptr(events), uintptr(unsafe.Pointer(user)), 0)
+ n = int(r0)
+ if e1 != 0 {
+ err = e1
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func port_dissociate(port int, source int, object uintptr) (n int, err error) {
+ r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_dissociate)), 3, uintptr(port), uintptr(source), uintptr(object), 0, 0, 0)
+ n = int(r0)
+ if e1 != 0 {
+ err = e1
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func port_get(port int, pe *portEvent, timeout *Timespec) (n int, err error) {
+ r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_get)), 3, uintptr(port), uintptr(unsafe.Pointer(pe)), uintptr(unsafe.Pointer(timeout)), 0, 0, 0)
+ n = int(r0)
+ if e1 != 0 {
+ err = e1
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func port_getn(port int, pe *portEvent, max uint32, nget *uint32, timeout *Timespec) (n int, err error) {
+ r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_getn)), 5, uintptr(port), uintptr(unsafe.Pointer(pe)), uintptr(max), uintptr(unsafe.Pointer(nget)), uintptr(unsafe.Pointer(timeout)), 0)
+ n = int(r0)
+ if e1 != 0 {
+ err = e1
+ }
+ return
+}
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go
index 8285ab841..f2079457c 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go
@@ -364,6 +364,22 @@ func Dup2(oldfd int, newfd int) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Errno2() (er2 int) {
+ uer2, _, _ := syscall_syscall(SYS___ERRNO2, 0, 0, 0)
+ er2 = int(uer2)
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func Err2ad() (eadd *int) {
+ ueadd, _, _ := syscall_syscall(SYS___ERR2AD, 0, 0, 0)
+ eadd = (*int)(unsafe.Pointer(ueadd))
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Exit(code int) {
syscall_syscall(SYS_EXIT, uintptr(code), 0, 0)
return
@@ -531,7 +547,18 @@ func W_Getmntent(buff *byte, size int) (lastsys int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mount(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) {
+func W_Getmntent_A(buff *byte, size int) (lastsys int, err error) {
+ r0, _, e1 := syscall_syscall(SYS___W_GETMNTENT_A, uintptr(unsafe.Pointer(buff)), uintptr(size), 0)
+ lastsys = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
@@ -561,7 +588,7 @@ func Mount(path string, filesystem string, fstype string, mtm uint32, parmlen in
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unmount(filesystem string, mtm int) (err error) {
+func unmount(filesystem string, mtm int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(filesystem)
if err != nil {
@@ -1215,3 +1242,14 @@ func utimes(path string, timeval *[2]Timeval) (err error) {
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func Select(nmsgsfds int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (ret int, err error) {
+ r0, _, e1 := syscall_syscall6(SYS_SELECT, uintptr(nmsgsfds), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
+ ret = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go b/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go
deleted file mode 100644
index 1794ffc92..000000000
--- a/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go
+++ /dev/null
@@ -1,438 +0,0 @@
-// go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/sys/syscall.h
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build 386 && darwin
-// +build 386,darwin
-
-package unix
-
-// Deprecated: Use libSystem wrappers instead of direct syscalls.
-const (
- SYS_SYSCALL = 0
- SYS_EXIT = 1
- SYS_FORK = 2
- SYS_READ = 3
- SYS_WRITE = 4
- SYS_OPEN = 5
- SYS_CLOSE = 6
- SYS_WAIT4 = 7
- SYS_LINK = 9
- SYS_UNLINK = 10
- SYS_CHDIR = 12
- SYS_FCHDIR = 13
- SYS_MKNOD = 14
- SYS_CHMOD = 15
- SYS_CHOWN = 16
- SYS_GETFSSTAT = 18
- SYS_GETPID = 20
- SYS_SETUID = 23
- SYS_GETUID = 24
- SYS_GETEUID = 25
- SYS_PTRACE = 26
- SYS_RECVMSG = 27
- SYS_SENDMSG = 28
- SYS_RECVFROM = 29
- SYS_ACCEPT = 30
- SYS_GETPEERNAME = 31
- SYS_GETSOCKNAME = 32
- SYS_ACCESS = 33
- SYS_CHFLAGS = 34
- SYS_FCHFLAGS = 35
- SYS_SYNC = 36
- SYS_KILL = 37
- SYS_GETPPID = 39
- SYS_DUP = 41
- SYS_PIPE = 42
- SYS_GETEGID = 43
- SYS_SIGACTION = 46
- SYS_GETGID = 47
- SYS_SIGPROCMASK = 48
- SYS_GETLOGIN = 49
- SYS_SETLOGIN = 50
- SYS_ACCT = 51
- SYS_SIGPENDING = 52
- SYS_SIGALTSTACK = 53
- SYS_IOCTL = 54
- SYS_REBOOT = 55
- SYS_REVOKE = 56
- SYS_SYMLINK = 57
- SYS_READLINK = 58
- SYS_EXECVE = 59
- SYS_UMASK = 60
- SYS_CHROOT = 61
- SYS_MSYNC = 65
- SYS_VFORK = 66
- SYS_MUNMAP = 73
- SYS_MPROTECT = 74
- SYS_MADVISE = 75
- SYS_MINCORE = 78
- SYS_GETGROUPS = 79
- SYS_SETGROUPS = 80
- SYS_GETPGRP = 81
- SYS_SETPGID = 82
- SYS_SETITIMER = 83
- SYS_SWAPON = 85
- SYS_GETITIMER = 86
- SYS_GETDTABLESIZE = 89
- SYS_DUP2 = 90
- SYS_FCNTL = 92
- SYS_SELECT = 93
- SYS_FSYNC = 95
- SYS_SETPRIORITY = 96
- SYS_SOCKET = 97
- SYS_CONNECT = 98
- SYS_GETPRIORITY = 100
- SYS_BIND = 104
- SYS_SETSOCKOPT = 105
- SYS_LISTEN = 106
- SYS_SIGSUSPEND = 111
- SYS_GETTIMEOFDAY = 116
- SYS_GETRUSAGE = 117
- SYS_GETSOCKOPT = 118
- SYS_READV = 120
- SYS_WRITEV = 121
- SYS_SETTIMEOFDAY = 122
- SYS_FCHOWN = 123
- SYS_FCHMOD = 124
- SYS_SETREUID = 126
- SYS_SETREGID = 127
- SYS_RENAME = 128
- SYS_FLOCK = 131
- SYS_MKFIFO = 132
- SYS_SENDTO = 133
- SYS_SHUTDOWN = 134
- SYS_SOCKETPAIR = 135
- SYS_MKDIR = 136
- SYS_RMDIR = 137
- SYS_UTIMES = 138
- SYS_FUTIMES = 139
- SYS_ADJTIME = 140
- SYS_GETHOSTUUID = 142
- SYS_SETSID = 147
- SYS_GETPGID = 151
- SYS_SETPRIVEXEC = 152
- SYS_PREAD = 153
- SYS_PWRITE = 154
- SYS_NFSSVC = 155
- SYS_STATFS = 157
- SYS_FSTATFS = 158
- SYS_UNMOUNT = 159
- SYS_GETFH = 161
- SYS_QUOTACTL = 165
- SYS_MOUNT = 167
- SYS_CSOPS = 169
- SYS_CSOPS_AUDITTOKEN = 170
- SYS_WAITID = 173
- SYS_KDEBUG_TYPEFILTER = 177
- SYS_KDEBUG_TRACE_STRING = 178
- SYS_KDEBUG_TRACE64 = 179
- SYS_KDEBUG_TRACE = 180
- SYS_SETGID = 181
- SYS_SETEGID = 182
- SYS_SETEUID = 183
- SYS_SIGRETURN = 184
- SYS_THREAD_SELFCOUNTS = 186
- SYS_FDATASYNC = 187
- SYS_STAT = 188
- SYS_FSTAT = 189
- SYS_LSTAT = 190
- SYS_PATHCONF = 191
- SYS_FPATHCONF = 192
- SYS_GETRLIMIT = 194
- SYS_SETRLIMIT = 195
- SYS_GETDIRENTRIES = 196
- SYS_MMAP = 197
- SYS_LSEEK = 199
- SYS_TRUNCATE = 200
- SYS_FTRUNCATE = 201
- SYS_SYSCTL = 202
- SYS_MLOCK = 203
- SYS_MUNLOCK = 204
- SYS_UNDELETE = 205
- SYS_OPEN_DPROTECTED_NP = 216
- SYS_GETATTRLIST = 220
- SYS_SETATTRLIST = 221
- SYS_GETDIRENTRIESATTR = 222
- SYS_EXCHANGEDATA = 223
- SYS_SEARCHFS = 225
- SYS_DELETE = 226
- SYS_COPYFILE = 227
- SYS_FGETATTRLIST = 228
- SYS_FSETATTRLIST = 229
- SYS_POLL = 230
- SYS_WATCHEVENT = 231
- SYS_WAITEVENT = 232
- SYS_MODWATCH = 233
- SYS_GETXATTR = 234
- SYS_FGETXATTR = 235
- SYS_SETXATTR = 236
- SYS_FSETXATTR = 237
- SYS_REMOVEXATTR = 238
- SYS_FREMOVEXATTR = 239
- SYS_LISTXATTR = 240
- SYS_FLISTXATTR = 241
- SYS_FSCTL = 242
- SYS_INITGROUPS = 243
- SYS_POSIX_SPAWN = 244
- SYS_FFSCTL = 245
- SYS_NFSCLNT = 247
- SYS_FHOPEN = 248
- SYS_MINHERIT = 250
- SYS_SEMSYS = 251
- SYS_MSGSYS = 252
- SYS_SHMSYS = 253
- SYS_SEMCTL = 254
- SYS_SEMGET = 255
- SYS_SEMOP = 256
- SYS_MSGCTL = 258
- SYS_MSGGET = 259
- SYS_MSGSND = 260
- SYS_MSGRCV = 261
- SYS_SHMAT = 262
- SYS_SHMCTL = 263
- SYS_SHMDT = 264
- SYS_SHMGET = 265
- SYS_SHM_OPEN = 266
- SYS_SHM_UNLINK = 267
- SYS_SEM_OPEN = 268
- SYS_SEM_CLOSE = 269
- SYS_SEM_UNLINK = 270
- SYS_SEM_WAIT = 271
- SYS_SEM_TRYWAIT = 272
- SYS_SEM_POST = 273
- SYS_SYSCTLBYNAME = 274
- SYS_OPEN_EXTENDED = 277
- SYS_UMASK_EXTENDED = 278
- SYS_STAT_EXTENDED = 279
- SYS_LSTAT_EXTENDED = 280
- SYS_FSTAT_EXTENDED = 281
- SYS_CHMOD_EXTENDED = 282
- SYS_FCHMOD_EXTENDED = 283
- SYS_ACCESS_EXTENDED = 284
- SYS_SETTID = 285
- SYS_GETTID = 286
- SYS_SETSGROUPS = 287
- SYS_GETSGROUPS = 288
- SYS_SETWGROUPS = 289
- SYS_GETWGROUPS = 290
- SYS_MKFIFO_EXTENDED = 291
- SYS_MKDIR_EXTENDED = 292
- SYS_IDENTITYSVC = 293
- SYS_SHARED_REGION_CHECK_NP = 294
- SYS_VM_PRESSURE_MONITOR = 296
- SYS_PSYNCH_RW_LONGRDLOCK = 297
- SYS_PSYNCH_RW_YIELDWRLOCK = 298
- SYS_PSYNCH_RW_DOWNGRADE = 299
- SYS_PSYNCH_RW_UPGRADE = 300
- SYS_PSYNCH_MUTEXWAIT = 301
- SYS_PSYNCH_MUTEXDROP = 302
- SYS_PSYNCH_CVBROAD = 303
- SYS_PSYNCH_CVSIGNAL = 304
- SYS_PSYNCH_CVWAIT = 305
- SYS_PSYNCH_RW_RDLOCK = 306
- SYS_PSYNCH_RW_WRLOCK = 307
- SYS_PSYNCH_RW_UNLOCK = 308
- SYS_PSYNCH_RW_UNLOCK2 = 309
- SYS_GETSID = 310
- SYS_SETTID_WITH_PID = 311
- SYS_PSYNCH_CVCLRPREPOST = 312
- SYS_AIO_FSYNC = 313
- SYS_AIO_RETURN = 314
- SYS_AIO_SUSPEND = 315
- SYS_AIO_CANCEL = 316
- SYS_AIO_ERROR = 317
- SYS_AIO_READ = 318
- SYS_AIO_WRITE = 319
- SYS_LIO_LISTIO = 320
- SYS_IOPOLICYSYS = 322
- SYS_PROCESS_POLICY = 323
- SYS_MLOCKALL = 324
- SYS_MUNLOCKALL = 325
- SYS_ISSETUGID = 327
- SYS___PTHREAD_KILL = 328
- SYS___PTHREAD_SIGMASK = 329
- SYS___SIGWAIT = 330
- SYS___DISABLE_THREADSIGNAL = 331
- SYS___PTHREAD_MARKCANCEL = 332
- SYS___PTHREAD_CANCELED = 333
- SYS___SEMWAIT_SIGNAL = 334
- SYS_PROC_INFO = 336
- SYS_SENDFILE = 337
- SYS_STAT64 = 338
- SYS_FSTAT64 = 339
- SYS_LSTAT64 = 340
- SYS_STAT64_EXTENDED = 341
- SYS_LSTAT64_EXTENDED = 342
- SYS_FSTAT64_EXTENDED = 343
- SYS_GETDIRENTRIES64 = 344
- SYS_STATFS64 = 345
- SYS_FSTATFS64 = 346
- SYS_GETFSSTAT64 = 347
- SYS___PTHREAD_CHDIR = 348
- SYS___PTHREAD_FCHDIR = 349
- SYS_AUDIT = 350
- SYS_AUDITON = 351
- SYS_GETAUID = 353
- SYS_SETAUID = 354
- SYS_GETAUDIT_ADDR = 357
- SYS_SETAUDIT_ADDR = 358
- SYS_AUDITCTL = 359
- SYS_BSDTHREAD_CREATE = 360
- SYS_BSDTHREAD_TERMINATE = 361
- SYS_KQUEUE = 362
- SYS_KEVENT = 363
- SYS_LCHOWN = 364
- SYS_BSDTHREAD_REGISTER = 366
- SYS_WORKQ_OPEN = 367
- SYS_WORKQ_KERNRETURN = 368
- SYS_KEVENT64 = 369
- SYS___OLD_SEMWAIT_SIGNAL = 370
- SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL = 371
- SYS_THREAD_SELFID = 372
- SYS_LEDGER = 373
- SYS_KEVENT_QOS = 374
- SYS_KEVENT_ID = 375
- SYS___MAC_EXECVE = 380
- SYS___MAC_SYSCALL = 381
- SYS___MAC_GET_FILE = 382
- SYS___MAC_SET_FILE = 383
- SYS___MAC_GET_LINK = 384
- SYS___MAC_SET_LINK = 385
- SYS___MAC_GET_PROC = 386
- SYS___MAC_SET_PROC = 387
- SYS___MAC_GET_FD = 388
- SYS___MAC_SET_FD = 389
- SYS___MAC_GET_PID = 390
- SYS_PSELECT = 394
- SYS_PSELECT_NOCANCEL = 395
- SYS_READ_NOCANCEL = 396
- SYS_WRITE_NOCANCEL = 397
- SYS_OPEN_NOCANCEL = 398
- SYS_CLOSE_NOCANCEL = 399
- SYS_WAIT4_NOCANCEL = 400
- SYS_RECVMSG_NOCANCEL = 401
- SYS_SENDMSG_NOCANCEL = 402
- SYS_RECVFROM_NOCANCEL = 403
- SYS_ACCEPT_NOCANCEL = 404
- SYS_MSYNC_NOCANCEL = 405
- SYS_FCNTL_NOCANCEL = 406
- SYS_SELECT_NOCANCEL = 407
- SYS_FSYNC_NOCANCEL = 408
- SYS_CONNECT_NOCANCEL = 409
- SYS_SIGSUSPEND_NOCANCEL = 410
- SYS_READV_NOCANCEL = 411
- SYS_WRITEV_NOCANCEL = 412
- SYS_SENDTO_NOCANCEL = 413
- SYS_PREAD_NOCANCEL = 414
- SYS_PWRITE_NOCANCEL = 415
- SYS_WAITID_NOCANCEL = 416
- SYS_POLL_NOCANCEL = 417
- SYS_MSGSND_NOCANCEL = 418
- SYS_MSGRCV_NOCANCEL = 419
- SYS_SEM_WAIT_NOCANCEL = 420
- SYS_AIO_SUSPEND_NOCANCEL = 421
- SYS___SIGWAIT_NOCANCEL = 422
- SYS___SEMWAIT_SIGNAL_NOCANCEL = 423
- SYS___MAC_MOUNT = 424
- SYS___MAC_GET_MOUNT = 425
- SYS___MAC_GETFSSTAT = 426
- SYS_FSGETPATH = 427
- SYS_AUDIT_SESSION_SELF = 428
- SYS_AUDIT_SESSION_JOIN = 429
- SYS_FILEPORT_MAKEPORT = 430
- SYS_FILEPORT_MAKEFD = 431
- SYS_AUDIT_SESSION_PORT = 432
- SYS_PID_SUSPEND = 433
- SYS_PID_RESUME = 434
- SYS_PID_HIBERNATE = 435
- SYS_PID_SHUTDOWN_SOCKETS = 436
- SYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438
- SYS_KAS_INFO = 439
- SYS_MEMORYSTATUS_CONTROL = 440
- SYS_GUARDED_OPEN_NP = 441
- SYS_GUARDED_CLOSE_NP = 442
- SYS_GUARDED_KQUEUE_NP = 443
- SYS_CHANGE_FDGUARD_NP = 444
- SYS_USRCTL = 445
- SYS_PROC_RLIMIT_CONTROL = 446
- SYS_CONNECTX = 447
- SYS_DISCONNECTX = 448
- SYS_PEELOFF = 449
- SYS_SOCKET_DELEGATE = 450
- SYS_TELEMETRY = 451
- SYS_PROC_UUID_POLICY = 452
- SYS_MEMORYSTATUS_GET_LEVEL = 453
- SYS_SYSTEM_OVERRIDE = 454
- SYS_VFS_PURGE = 455
- SYS_SFI_CTL = 456
- SYS_SFI_PIDCTL = 457
- SYS_COALITION = 458
- SYS_COALITION_INFO = 459
- SYS_NECP_MATCH_POLICY = 460
- SYS_GETATTRLISTBULK = 461
- SYS_CLONEFILEAT = 462
- SYS_OPENAT = 463
- SYS_OPENAT_NOCANCEL = 464
- SYS_RENAMEAT = 465
- SYS_FACCESSAT = 466
- SYS_FCHMODAT = 467
- SYS_FCHOWNAT = 468
- SYS_FSTATAT = 469
- SYS_FSTATAT64 = 470
- SYS_LINKAT = 471
- SYS_UNLINKAT = 472
- SYS_READLINKAT = 473
- SYS_SYMLINKAT = 474
- SYS_MKDIRAT = 475
- SYS_GETATTRLISTAT = 476
- SYS_PROC_TRACE_LOG = 477
- SYS_BSDTHREAD_CTL = 478
- SYS_OPENBYID_NP = 479
- SYS_RECVMSG_X = 480
- SYS_SENDMSG_X = 481
- SYS_THREAD_SELFUSAGE = 482
- SYS_CSRCTL = 483
- SYS_GUARDED_OPEN_DPROTECTED_NP = 484
- SYS_GUARDED_WRITE_NP = 485
- SYS_GUARDED_PWRITE_NP = 486
- SYS_GUARDED_WRITEV_NP = 487
- SYS_RENAMEATX_NP = 488
- SYS_MREMAP_ENCRYPTED = 489
- SYS_NETAGENT_TRIGGER = 490
- SYS_STACK_SNAPSHOT_WITH_CONFIG = 491
- SYS_MICROSTACKSHOT = 492
- SYS_GRAB_PGO_DATA = 493
- SYS_PERSONA = 494
- SYS_WORK_INTERVAL_CTL = 499
- SYS_GETENTROPY = 500
- SYS_NECP_OPEN = 501
- SYS_NECP_CLIENT_ACTION = 502
- SYS___NEXUS_OPEN = 503
- SYS___NEXUS_REGISTER = 504
- SYS___NEXUS_DEREGISTER = 505
- SYS___NEXUS_CREATE = 506
- SYS___NEXUS_DESTROY = 507
- SYS___NEXUS_GET_OPT = 508
- SYS___NEXUS_SET_OPT = 509
- SYS___CHANNEL_OPEN = 510
- SYS___CHANNEL_GET_INFO = 511
- SYS___CHANNEL_SYNC = 512
- SYS___CHANNEL_GET_OPT = 513
- SYS___CHANNEL_SET_OPT = 514
- SYS_ULOCK_WAIT = 515
- SYS_ULOCK_WAKE = 516
- SYS_FCLONEFILEAT = 517
- SYS_FS_SNAPSHOT = 518
- SYS_TERMINATE_WITH_PAYLOAD = 520
- SYS_ABORT_WITH_PAYLOAD = 521
- SYS_NECP_SESSION_OPEN = 522
- SYS_NECP_SESSION_ACTION = 523
- SYS_SETATTRLISTAT = 524
- SYS_NET_QOS_GUIDELINE = 525
- SYS_FMOUNT = 526
- SYS_NTP_ADJTIME = 527
- SYS_NTP_GETTIME = 528
- SYS_OS_FAULT_WITH_PAYLOAD = 529
- SYS_MAXSYSCALL = 530
- SYS_INVALID = 63
-)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go
deleted file mode 100644
index 6dc736449..000000000
--- a/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go
+++ /dev/null
@@ -1,438 +0,0 @@
-// go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk/usr/include/sys/syscall.h
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build arm && darwin
-// +build arm,darwin
-
-package unix
-
-// Deprecated: Use libSystem wrappers instead of direct syscalls.
-const (
- SYS_SYSCALL = 0
- SYS_EXIT = 1
- SYS_FORK = 2
- SYS_READ = 3
- SYS_WRITE = 4
- SYS_OPEN = 5
- SYS_CLOSE = 6
- SYS_WAIT4 = 7
- SYS_LINK = 9
- SYS_UNLINK = 10
- SYS_CHDIR = 12
- SYS_FCHDIR = 13
- SYS_MKNOD = 14
- SYS_CHMOD = 15
- SYS_CHOWN = 16
- SYS_GETFSSTAT = 18
- SYS_GETPID = 20
- SYS_SETUID = 23
- SYS_GETUID = 24
- SYS_GETEUID = 25
- SYS_PTRACE = 26
- SYS_RECVMSG = 27
- SYS_SENDMSG = 28
- SYS_RECVFROM = 29
- SYS_ACCEPT = 30
- SYS_GETPEERNAME = 31
- SYS_GETSOCKNAME = 32
- SYS_ACCESS = 33
- SYS_CHFLAGS = 34
- SYS_FCHFLAGS = 35
- SYS_SYNC = 36
- SYS_KILL = 37
- SYS_GETPPID = 39
- SYS_DUP = 41
- SYS_PIPE = 42
- SYS_GETEGID = 43
- SYS_SIGACTION = 46
- SYS_GETGID = 47
- SYS_SIGPROCMASK = 48
- SYS_GETLOGIN = 49
- SYS_SETLOGIN = 50
- SYS_ACCT = 51
- SYS_SIGPENDING = 52
- SYS_SIGALTSTACK = 53
- SYS_IOCTL = 54
- SYS_REBOOT = 55
- SYS_REVOKE = 56
- SYS_SYMLINK = 57
- SYS_READLINK = 58
- SYS_EXECVE = 59
- SYS_UMASK = 60
- SYS_CHROOT = 61
- SYS_MSYNC = 65
- SYS_VFORK = 66
- SYS_MUNMAP = 73
- SYS_MPROTECT = 74
- SYS_MADVISE = 75
- SYS_MINCORE = 78
- SYS_GETGROUPS = 79
- SYS_SETGROUPS = 80
- SYS_GETPGRP = 81
- SYS_SETPGID = 82
- SYS_SETITIMER = 83
- SYS_SWAPON = 85
- SYS_GETITIMER = 86
- SYS_GETDTABLESIZE = 89
- SYS_DUP2 = 90
- SYS_FCNTL = 92
- SYS_SELECT = 93
- SYS_FSYNC = 95
- SYS_SETPRIORITY = 96
- SYS_SOCKET = 97
- SYS_CONNECT = 98
- SYS_GETPRIORITY = 100
- SYS_BIND = 104
- SYS_SETSOCKOPT = 105
- SYS_LISTEN = 106
- SYS_SIGSUSPEND = 111
- SYS_GETTIMEOFDAY = 116
- SYS_GETRUSAGE = 117
- SYS_GETSOCKOPT = 118
- SYS_READV = 120
- SYS_WRITEV = 121
- SYS_SETTIMEOFDAY = 122
- SYS_FCHOWN = 123
- SYS_FCHMOD = 124
- SYS_SETREUID = 126
- SYS_SETREGID = 127
- SYS_RENAME = 128
- SYS_FLOCK = 131
- SYS_MKFIFO = 132
- SYS_SENDTO = 133
- SYS_SHUTDOWN = 134
- SYS_SOCKETPAIR = 135
- SYS_MKDIR = 136
- SYS_RMDIR = 137
- SYS_UTIMES = 138
- SYS_FUTIMES = 139
- SYS_ADJTIME = 140
- SYS_GETHOSTUUID = 142
- SYS_SETSID = 147
- SYS_GETPGID = 151
- SYS_SETPRIVEXEC = 152
- SYS_PREAD = 153
- SYS_PWRITE = 154
- SYS_NFSSVC = 155
- SYS_STATFS = 157
- SYS_FSTATFS = 158
- SYS_UNMOUNT = 159
- SYS_GETFH = 161
- SYS_QUOTACTL = 165
- SYS_MOUNT = 167
- SYS_CSOPS = 169
- SYS_CSOPS_AUDITTOKEN = 170
- SYS_WAITID = 173
- SYS_KDEBUG_TYPEFILTER = 177
- SYS_KDEBUG_TRACE_STRING = 178
- SYS_KDEBUG_TRACE64 = 179
- SYS_KDEBUG_TRACE = 180
- SYS_SETGID = 181
- SYS_SETEGID = 182
- SYS_SETEUID = 183
- SYS_SIGRETURN = 184
- SYS_THREAD_SELFCOUNTS = 186
- SYS_FDATASYNC = 187
- SYS_STAT = 188
- SYS_FSTAT = 189
- SYS_LSTAT = 190
- SYS_PATHCONF = 191
- SYS_FPATHCONF = 192
- SYS_GETRLIMIT = 194
- SYS_SETRLIMIT = 195
- SYS_GETDIRENTRIES = 196
- SYS_MMAP = 197
- SYS_LSEEK = 199
- SYS_TRUNCATE = 200
- SYS_FTRUNCATE = 201
- SYS_SYSCTL = 202
- SYS_MLOCK = 203
- SYS_MUNLOCK = 204
- SYS_UNDELETE = 205
- SYS_OPEN_DPROTECTED_NP = 216
- SYS_GETATTRLIST = 220
- SYS_SETATTRLIST = 221
- SYS_GETDIRENTRIESATTR = 222
- SYS_EXCHANGEDATA = 223
- SYS_SEARCHFS = 225
- SYS_DELETE = 226
- SYS_COPYFILE = 227
- SYS_FGETATTRLIST = 228
- SYS_FSETATTRLIST = 229
- SYS_POLL = 230
- SYS_WATCHEVENT = 231
- SYS_WAITEVENT = 232
- SYS_MODWATCH = 233
- SYS_GETXATTR = 234
- SYS_FGETXATTR = 235
- SYS_SETXATTR = 236
- SYS_FSETXATTR = 237
- SYS_REMOVEXATTR = 238
- SYS_FREMOVEXATTR = 239
- SYS_LISTXATTR = 240
- SYS_FLISTXATTR = 241
- SYS_FSCTL = 242
- SYS_INITGROUPS = 243
- SYS_POSIX_SPAWN = 244
- SYS_FFSCTL = 245
- SYS_NFSCLNT = 247
- SYS_FHOPEN = 248
- SYS_MINHERIT = 250
- SYS_SEMSYS = 251
- SYS_MSGSYS = 252
- SYS_SHMSYS = 253
- SYS_SEMCTL = 254
- SYS_SEMGET = 255
- SYS_SEMOP = 256
- SYS_MSGCTL = 258
- SYS_MSGGET = 259
- SYS_MSGSND = 260
- SYS_MSGRCV = 261
- SYS_SHMAT = 262
- SYS_SHMCTL = 263
- SYS_SHMDT = 264
- SYS_SHMGET = 265
- SYS_SHM_OPEN = 266
- SYS_SHM_UNLINK = 267
- SYS_SEM_OPEN = 268
- SYS_SEM_CLOSE = 269
- SYS_SEM_UNLINK = 270
- SYS_SEM_WAIT = 271
- SYS_SEM_TRYWAIT = 272
- SYS_SEM_POST = 273
- SYS_SYSCTLBYNAME = 274
- SYS_OPEN_EXTENDED = 277
- SYS_UMASK_EXTENDED = 278
- SYS_STAT_EXTENDED = 279
- SYS_LSTAT_EXTENDED = 280
- SYS_FSTAT_EXTENDED = 281
- SYS_CHMOD_EXTENDED = 282
- SYS_FCHMOD_EXTENDED = 283
- SYS_ACCESS_EXTENDED = 284
- SYS_SETTID = 285
- SYS_GETTID = 286
- SYS_SETSGROUPS = 287
- SYS_GETSGROUPS = 288
- SYS_SETWGROUPS = 289
- SYS_GETWGROUPS = 290
- SYS_MKFIFO_EXTENDED = 291
- SYS_MKDIR_EXTENDED = 292
- SYS_IDENTITYSVC = 293
- SYS_SHARED_REGION_CHECK_NP = 294
- SYS_VM_PRESSURE_MONITOR = 296
- SYS_PSYNCH_RW_LONGRDLOCK = 297
- SYS_PSYNCH_RW_YIELDWRLOCK = 298
- SYS_PSYNCH_RW_DOWNGRADE = 299
- SYS_PSYNCH_RW_UPGRADE = 300
- SYS_PSYNCH_MUTEXWAIT = 301
- SYS_PSYNCH_MUTEXDROP = 302
- SYS_PSYNCH_CVBROAD = 303
- SYS_PSYNCH_CVSIGNAL = 304
- SYS_PSYNCH_CVWAIT = 305
- SYS_PSYNCH_RW_RDLOCK = 306
- SYS_PSYNCH_RW_WRLOCK = 307
- SYS_PSYNCH_RW_UNLOCK = 308
- SYS_PSYNCH_RW_UNLOCK2 = 309
- SYS_GETSID = 310
- SYS_SETTID_WITH_PID = 311
- SYS_PSYNCH_CVCLRPREPOST = 312
- SYS_AIO_FSYNC = 313
- SYS_AIO_RETURN = 314
- SYS_AIO_SUSPEND = 315
- SYS_AIO_CANCEL = 316
- SYS_AIO_ERROR = 317
- SYS_AIO_READ = 318
- SYS_AIO_WRITE = 319
- SYS_LIO_LISTIO = 320
- SYS_IOPOLICYSYS = 322
- SYS_PROCESS_POLICY = 323
- SYS_MLOCKALL = 324
- SYS_MUNLOCKALL = 325
- SYS_ISSETUGID = 327
- SYS___PTHREAD_KILL = 328
- SYS___PTHREAD_SIGMASK = 329
- SYS___SIGWAIT = 330
- SYS___DISABLE_THREADSIGNAL = 331
- SYS___PTHREAD_MARKCANCEL = 332
- SYS___PTHREAD_CANCELED = 333
- SYS___SEMWAIT_SIGNAL = 334
- SYS_PROC_INFO = 336
- SYS_SENDFILE = 337
- SYS_STAT64 = 338
- SYS_FSTAT64 = 339
- SYS_LSTAT64 = 340
- SYS_STAT64_EXTENDED = 341
- SYS_LSTAT64_EXTENDED = 342
- SYS_FSTAT64_EXTENDED = 343
- SYS_GETDIRENTRIES64 = 344
- SYS_STATFS64 = 345
- SYS_FSTATFS64 = 346
- SYS_GETFSSTAT64 = 347
- SYS___PTHREAD_CHDIR = 348
- SYS___PTHREAD_FCHDIR = 349
- SYS_AUDIT = 350
- SYS_AUDITON = 351
- SYS_GETAUID = 353
- SYS_SETAUID = 354
- SYS_GETAUDIT_ADDR = 357
- SYS_SETAUDIT_ADDR = 358
- SYS_AUDITCTL = 359
- SYS_BSDTHREAD_CREATE = 360
- SYS_BSDTHREAD_TERMINATE = 361
- SYS_KQUEUE = 362
- SYS_KEVENT = 363
- SYS_LCHOWN = 364
- SYS_BSDTHREAD_REGISTER = 366
- SYS_WORKQ_OPEN = 367
- SYS_WORKQ_KERNRETURN = 368
- SYS_KEVENT64 = 369
- SYS___OLD_SEMWAIT_SIGNAL = 370
- SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL = 371
- SYS_THREAD_SELFID = 372
- SYS_LEDGER = 373
- SYS_KEVENT_QOS = 374
- SYS_KEVENT_ID = 375
- SYS___MAC_EXECVE = 380
- SYS___MAC_SYSCALL = 381
- SYS___MAC_GET_FILE = 382
- SYS___MAC_SET_FILE = 383
- SYS___MAC_GET_LINK = 384
- SYS___MAC_SET_LINK = 385
- SYS___MAC_GET_PROC = 386
- SYS___MAC_SET_PROC = 387
- SYS___MAC_GET_FD = 388
- SYS___MAC_SET_FD = 389
- SYS___MAC_GET_PID = 390
- SYS_PSELECT = 394
- SYS_PSELECT_NOCANCEL = 395
- SYS_READ_NOCANCEL = 396
- SYS_WRITE_NOCANCEL = 397
- SYS_OPEN_NOCANCEL = 398
- SYS_CLOSE_NOCANCEL = 399
- SYS_WAIT4_NOCANCEL = 400
- SYS_RECVMSG_NOCANCEL = 401
- SYS_SENDMSG_NOCANCEL = 402
- SYS_RECVFROM_NOCANCEL = 403
- SYS_ACCEPT_NOCANCEL = 404
- SYS_MSYNC_NOCANCEL = 405
- SYS_FCNTL_NOCANCEL = 406
- SYS_SELECT_NOCANCEL = 407
- SYS_FSYNC_NOCANCEL = 408
- SYS_CONNECT_NOCANCEL = 409
- SYS_SIGSUSPEND_NOCANCEL = 410
- SYS_READV_NOCANCEL = 411
- SYS_WRITEV_NOCANCEL = 412
- SYS_SENDTO_NOCANCEL = 413
- SYS_PREAD_NOCANCEL = 414
- SYS_PWRITE_NOCANCEL = 415
- SYS_WAITID_NOCANCEL = 416
- SYS_POLL_NOCANCEL = 417
- SYS_MSGSND_NOCANCEL = 418
- SYS_MSGRCV_NOCANCEL = 419
- SYS_SEM_WAIT_NOCANCEL = 420
- SYS_AIO_SUSPEND_NOCANCEL = 421
- SYS___SIGWAIT_NOCANCEL = 422
- SYS___SEMWAIT_SIGNAL_NOCANCEL = 423
- SYS___MAC_MOUNT = 424
- SYS___MAC_GET_MOUNT = 425
- SYS___MAC_GETFSSTAT = 426
- SYS_FSGETPATH = 427
- SYS_AUDIT_SESSION_SELF = 428
- SYS_AUDIT_SESSION_JOIN = 429
- SYS_FILEPORT_MAKEPORT = 430
- SYS_FILEPORT_MAKEFD = 431
- SYS_AUDIT_SESSION_PORT = 432
- SYS_PID_SUSPEND = 433
- SYS_PID_RESUME = 434
- SYS_PID_HIBERNATE = 435
- SYS_PID_SHUTDOWN_SOCKETS = 436
- SYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438
- SYS_KAS_INFO = 439
- SYS_MEMORYSTATUS_CONTROL = 440
- SYS_GUARDED_OPEN_NP = 441
- SYS_GUARDED_CLOSE_NP = 442
- SYS_GUARDED_KQUEUE_NP = 443
- SYS_CHANGE_FDGUARD_NP = 444
- SYS_USRCTL = 445
- SYS_PROC_RLIMIT_CONTROL = 446
- SYS_CONNECTX = 447
- SYS_DISCONNECTX = 448
- SYS_PEELOFF = 449
- SYS_SOCKET_DELEGATE = 450
- SYS_TELEMETRY = 451
- SYS_PROC_UUID_POLICY = 452
- SYS_MEMORYSTATUS_GET_LEVEL = 453
- SYS_SYSTEM_OVERRIDE = 454
- SYS_VFS_PURGE = 455
- SYS_SFI_CTL = 456
- SYS_SFI_PIDCTL = 457
- SYS_COALITION = 458
- SYS_COALITION_INFO = 459
- SYS_NECP_MATCH_POLICY = 460
- SYS_GETATTRLISTBULK = 461
- SYS_CLONEFILEAT = 462
- SYS_OPENAT = 463
- SYS_OPENAT_NOCANCEL = 464
- SYS_RENAMEAT = 465
- SYS_FACCESSAT = 466
- SYS_FCHMODAT = 467
- SYS_FCHOWNAT = 468
- SYS_FSTATAT = 469
- SYS_FSTATAT64 = 470
- SYS_LINKAT = 471
- SYS_UNLINKAT = 472
- SYS_READLINKAT = 473
- SYS_SYMLINKAT = 474
- SYS_MKDIRAT = 475
- SYS_GETATTRLISTAT = 476
- SYS_PROC_TRACE_LOG = 477
- SYS_BSDTHREAD_CTL = 478
- SYS_OPENBYID_NP = 479
- SYS_RECVMSG_X = 480
- SYS_SENDMSG_X = 481
- SYS_THREAD_SELFUSAGE = 482
- SYS_CSRCTL = 483
- SYS_GUARDED_OPEN_DPROTECTED_NP = 484
- SYS_GUARDED_WRITE_NP = 485
- SYS_GUARDED_PWRITE_NP = 486
- SYS_GUARDED_WRITEV_NP = 487
- SYS_RENAMEATX_NP = 488
- SYS_MREMAP_ENCRYPTED = 489
- SYS_NETAGENT_TRIGGER = 490
- SYS_STACK_SNAPSHOT_WITH_CONFIG = 491
- SYS_MICROSTACKSHOT = 492
- SYS_GRAB_PGO_DATA = 493
- SYS_PERSONA = 494
- SYS_WORK_INTERVAL_CTL = 499
- SYS_GETENTROPY = 500
- SYS_NECP_OPEN = 501
- SYS_NECP_CLIENT_ACTION = 502
- SYS___NEXUS_OPEN = 503
- SYS___NEXUS_REGISTER = 504
- SYS___NEXUS_DEREGISTER = 505
- SYS___NEXUS_CREATE = 506
- SYS___NEXUS_DESTROY = 507
- SYS___NEXUS_GET_OPT = 508
- SYS___NEXUS_SET_OPT = 509
- SYS___CHANNEL_OPEN = 510
- SYS___CHANNEL_GET_INFO = 511
- SYS___CHANNEL_SYNC = 512
- SYS___CHANNEL_GET_OPT = 513
- SYS___CHANNEL_SET_OPT = 514
- SYS_ULOCK_WAIT = 515
- SYS_ULOCK_WAKE = 516
- SYS_FCLONEFILEAT = 517
- SYS_FS_SNAPSHOT = 518
- SYS_TERMINATE_WITH_PAYLOAD = 520
- SYS_ABORT_WITH_PAYLOAD = 521
- SYS_NECP_SESSION_OPEN = 522
- SYS_NECP_SESSION_ACTION = 523
- SYS_SETATTRLISTAT = 524
- SYS_NET_QOS_GUIDELINE = 525
- SYS_FMOUNT = 526
- SYS_NTP_ADJTIME = 527
- SYS_NTP_GETTIME = 528
- SYS_OS_FAULT_WITH_PAYLOAD = 529
- SYS_MAXSYSCALL = 530
- SYS_INVALID = 63
-)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
index 8e5359713..aa7ce85d1 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
@@ -438,4 +438,10 @@ const (
SYS_FACCESSAT2 = 439
SYS_PROCESS_MADVISE = 440
SYS_EPOLL_PWAIT2 = 441
+ SYS_MOUNT_SETATTR = 442
+ SYS_QUOTACTL_FD = 443
+ SYS_LANDLOCK_CREATE_RULESET = 444
+ SYS_LANDLOCK_ADD_RULE = 445
+ SYS_LANDLOCK_RESTRICT_SELF = 446
+ SYS_MEMFD_SECRET = 447
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
index d7dceb769..b83032638 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
@@ -7,357 +7,363 @@
package unix
const (
- SYS_READ = 0
- SYS_WRITE = 1
- SYS_OPEN = 2
- SYS_CLOSE = 3
- SYS_STAT = 4
- SYS_FSTAT = 5
- SYS_LSTAT = 6
- SYS_POLL = 7
- SYS_LSEEK = 8
- SYS_MMAP = 9
- SYS_MPROTECT = 10
- SYS_MUNMAP = 11
- SYS_BRK = 12
- SYS_RT_SIGACTION = 13
- SYS_RT_SIGPROCMASK = 14
- SYS_RT_SIGRETURN = 15
- SYS_IOCTL = 16
- SYS_PREAD64 = 17
- SYS_PWRITE64 = 18
- SYS_READV = 19
- SYS_WRITEV = 20
- SYS_ACCESS = 21
- SYS_PIPE = 22
- SYS_SELECT = 23
- SYS_SCHED_YIELD = 24
- SYS_MREMAP = 25
- SYS_MSYNC = 26
- SYS_MINCORE = 27
- SYS_MADVISE = 28
- SYS_SHMGET = 29
- SYS_SHMAT = 30
- SYS_SHMCTL = 31
- SYS_DUP = 32
- SYS_DUP2 = 33
- SYS_PAUSE = 34
- SYS_NANOSLEEP = 35
- SYS_GETITIMER = 36
- SYS_ALARM = 37
- SYS_SETITIMER = 38
- SYS_GETPID = 39
- SYS_SENDFILE = 40
- SYS_SOCKET = 41
- SYS_CONNECT = 42
- SYS_ACCEPT = 43
- SYS_SENDTO = 44
- SYS_RECVFROM = 45
- SYS_SENDMSG = 46
- SYS_RECVMSG = 47
- SYS_SHUTDOWN = 48
- SYS_BIND = 49
- SYS_LISTEN = 50
- SYS_GETSOCKNAME = 51
- SYS_GETPEERNAME = 52
- SYS_SOCKETPAIR = 53
- SYS_SETSOCKOPT = 54
- SYS_GETSOCKOPT = 55
- SYS_CLONE = 56
- SYS_FORK = 57
- SYS_VFORK = 58
- SYS_EXECVE = 59
- SYS_EXIT = 60
- SYS_WAIT4 = 61
- SYS_KILL = 62
- SYS_UNAME = 63
- SYS_SEMGET = 64
- SYS_SEMOP = 65
- SYS_SEMCTL = 66
- SYS_SHMDT = 67
- SYS_MSGGET = 68
- SYS_MSGSND = 69
- SYS_MSGRCV = 70
- SYS_MSGCTL = 71
- SYS_FCNTL = 72
- SYS_FLOCK = 73
- SYS_FSYNC = 74
- SYS_FDATASYNC = 75
- SYS_TRUNCATE = 76
- SYS_FTRUNCATE = 77
- SYS_GETDENTS = 78
- SYS_GETCWD = 79
- SYS_CHDIR = 80
- SYS_FCHDIR = 81
- SYS_RENAME = 82
- SYS_MKDIR = 83
- SYS_RMDIR = 84
- SYS_CREAT = 85
- SYS_LINK = 86
- SYS_UNLINK = 87
- SYS_SYMLINK = 88
- SYS_READLINK = 89
- SYS_CHMOD = 90
- SYS_FCHMOD = 91
- SYS_CHOWN = 92
- SYS_FCHOWN = 93
- SYS_LCHOWN = 94
- SYS_UMASK = 95
- SYS_GETTIMEOFDAY = 96
- SYS_GETRLIMIT = 97
- SYS_GETRUSAGE = 98
- SYS_SYSINFO = 99
- SYS_TIMES = 100
- SYS_PTRACE = 101
- SYS_GETUID = 102
- SYS_SYSLOG = 103
- SYS_GETGID = 104
- SYS_SETUID = 105
- SYS_SETGID = 106
- SYS_GETEUID = 107
- SYS_GETEGID = 108
- SYS_SETPGID = 109
- SYS_GETPPID = 110
- SYS_GETPGRP = 111
- SYS_SETSID = 112
- SYS_SETREUID = 113
- SYS_SETREGID = 114
- SYS_GETGROUPS = 115
- SYS_SETGROUPS = 116
- SYS_SETRESUID = 117
- SYS_GETRESUID = 118
- SYS_SETRESGID = 119
- SYS_GETRESGID = 120
- SYS_GETPGID = 121
- SYS_SETFSUID = 122
- SYS_SETFSGID = 123
- SYS_GETSID = 124
- SYS_CAPGET = 125
- SYS_CAPSET = 126
- SYS_RT_SIGPENDING = 127
- SYS_RT_SIGTIMEDWAIT = 128
- SYS_RT_SIGQUEUEINFO = 129
- SYS_RT_SIGSUSPEND = 130
- SYS_SIGALTSTACK = 131
- SYS_UTIME = 132
- SYS_MKNOD = 133
- SYS_USELIB = 134
- SYS_PERSONALITY = 135
- SYS_USTAT = 136
- SYS_STATFS = 137
- SYS_FSTATFS = 138
- SYS_SYSFS = 139
- SYS_GETPRIORITY = 140
- SYS_SETPRIORITY = 141
- SYS_SCHED_SETPARAM = 142
- SYS_SCHED_GETPARAM = 143
- SYS_SCHED_SETSCHEDULER = 144
- SYS_SCHED_GETSCHEDULER = 145
- SYS_SCHED_GET_PRIORITY_MAX = 146
- SYS_SCHED_GET_PRIORITY_MIN = 147
- SYS_SCHED_RR_GET_INTERVAL = 148
- SYS_MLOCK = 149
- SYS_MUNLOCK = 150
- SYS_MLOCKALL = 151
- SYS_MUNLOCKALL = 152
- SYS_VHANGUP = 153
- SYS_MODIFY_LDT = 154
- SYS_PIVOT_ROOT = 155
- SYS__SYSCTL = 156
- SYS_PRCTL = 157
- SYS_ARCH_PRCTL = 158
- SYS_ADJTIMEX = 159
- SYS_SETRLIMIT = 160
- SYS_CHROOT = 161
- SYS_SYNC = 162
- SYS_ACCT = 163
- SYS_SETTIMEOFDAY = 164
- SYS_MOUNT = 165
- SYS_UMOUNT2 = 166
- SYS_SWAPON = 167
- SYS_SWAPOFF = 168
- SYS_REBOOT = 169
- SYS_SETHOSTNAME = 170
- SYS_SETDOMAINNAME = 171
- SYS_IOPL = 172
- SYS_IOPERM = 173
- SYS_CREATE_MODULE = 174
- SYS_INIT_MODULE = 175
- SYS_DELETE_MODULE = 176
- SYS_GET_KERNEL_SYMS = 177
- SYS_QUERY_MODULE = 178
- SYS_QUOTACTL = 179
- SYS_NFSSERVCTL = 180
- SYS_GETPMSG = 181
- SYS_PUTPMSG = 182
- SYS_AFS_SYSCALL = 183
- SYS_TUXCALL = 184
- SYS_SECURITY = 185
- SYS_GETTID = 186
- SYS_READAHEAD = 187
- SYS_SETXATTR = 188
- SYS_LSETXATTR = 189
- SYS_FSETXATTR = 190
- SYS_GETXATTR = 191
- SYS_LGETXATTR = 192
- SYS_FGETXATTR = 193
- SYS_LISTXATTR = 194
- SYS_LLISTXATTR = 195
- SYS_FLISTXATTR = 196
- SYS_REMOVEXATTR = 197
- SYS_LREMOVEXATTR = 198
- SYS_FREMOVEXATTR = 199
- SYS_TKILL = 200
- SYS_TIME = 201
- SYS_FUTEX = 202
- SYS_SCHED_SETAFFINITY = 203
- SYS_SCHED_GETAFFINITY = 204
- SYS_SET_THREAD_AREA = 205
- SYS_IO_SETUP = 206
- SYS_IO_DESTROY = 207
- SYS_IO_GETEVENTS = 208
- SYS_IO_SUBMIT = 209
- SYS_IO_CANCEL = 210
- SYS_GET_THREAD_AREA = 211
- SYS_LOOKUP_DCOOKIE = 212
- SYS_EPOLL_CREATE = 213
- SYS_EPOLL_CTL_OLD = 214
- SYS_EPOLL_WAIT_OLD = 215
- SYS_REMAP_FILE_PAGES = 216
- SYS_GETDENTS64 = 217
- SYS_SET_TID_ADDRESS = 218
- SYS_RESTART_SYSCALL = 219
- SYS_SEMTIMEDOP = 220
- SYS_FADVISE64 = 221
- SYS_TIMER_CREATE = 222
- SYS_TIMER_SETTIME = 223
- SYS_TIMER_GETTIME = 224
- SYS_TIMER_GETOVERRUN = 225
- SYS_TIMER_DELETE = 226
- SYS_CLOCK_SETTIME = 227
- SYS_CLOCK_GETTIME = 228
- SYS_CLOCK_GETRES = 229
- SYS_CLOCK_NANOSLEEP = 230
- SYS_EXIT_GROUP = 231
- SYS_EPOLL_WAIT = 232
- SYS_EPOLL_CTL = 233
- SYS_TGKILL = 234
- SYS_UTIMES = 235
- SYS_VSERVER = 236
- SYS_MBIND = 237
- SYS_SET_MEMPOLICY = 238
- SYS_GET_MEMPOLICY = 239
- SYS_MQ_OPEN = 240
- SYS_MQ_UNLINK = 241
- SYS_MQ_TIMEDSEND = 242
- SYS_MQ_TIMEDRECEIVE = 243
- SYS_MQ_NOTIFY = 244
- SYS_MQ_GETSETATTR = 245
- SYS_KEXEC_LOAD = 246
- SYS_WAITID = 247
- SYS_ADD_KEY = 248
- SYS_REQUEST_KEY = 249
- SYS_KEYCTL = 250
- SYS_IOPRIO_SET = 251
- SYS_IOPRIO_GET = 252
- SYS_INOTIFY_INIT = 253
- SYS_INOTIFY_ADD_WATCH = 254
- SYS_INOTIFY_RM_WATCH = 255
- SYS_MIGRATE_PAGES = 256
- SYS_OPENAT = 257
- SYS_MKDIRAT = 258
- SYS_MKNODAT = 259
- SYS_FCHOWNAT = 260
- SYS_FUTIMESAT = 261
- SYS_NEWFSTATAT = 262
- SYS_UNLINKAT = 263
- SYS_RENAMEAT = 264
- SYS_LINKAT = 265
- SYS_SYMLINKAT = 266
- SYS_READLINKAT = 267
- SYS_FCHMODAT = 268
- SYS_FACCESSAT = 269
- SYS_PSELECT6 = 270
- SYS_PPOLL = 271
- SYS_UNSHARE = 272
- SYS_SET_ROBUST_LIST = 273
- SYS_GET_ROBUST_LIST = 274
- SYS_SPLICE = 275
- SYS_TEE = 276
- SYS_SYNC_FILE_RANGE = 277
- SYS_VMSPLICE = 278
- SYS_MOVE_PAGES = 279
- SYS_UTIMENSAT = 280
- SYS_EPOLL_PWAIT = 281
- SYS_SIGNALFD = 282
- SYS_TIMERFD_CREATE = 283
- SYS_EVENTFD = 284
- SYS_FALLOCATE = 285
- SYS_TIMERFD_SETTIME = 286
- SYS_TIMERFD_GETTIME = 287
- SYS_ACCEPT4 = 288
- SYS_SIGNALFD4 = 289
- SYS_EVENTFD2 = 290
- SYS_EPOLL_CREATE1 = 291
- SYS_DUP3 = 292
- SYS_PIPE2 = 293
- SYS_INOTIFY_INIT1 = 294
- SYS_PREADV = 295
- SYS_PWRITEV = 296
- SYS_RT_TGSIGQUEUEINFO = 297
- SYS_PERF_EVENT_OPEN = 298
- SYS_RECVMMSG = 299
- SYS_FANOTIFY_INIT = 300
- SYS_FANOTIFY_MARK = 301
- SYS_PRLIMIT64 = 302
- SYS_NAME_TO_HANDLE_AT = 303
- SYS_OPEN_BY_HANDLE_AT = 304
- SYS_CLOCK_ADJTIME = 305
- SYS_SYNCFS = 306
- SYS_SENDMMSG = 307
- SYS_SETNS = 308
- SYS_GETCPU = 309
- SYS_PROCESS_VM_READV = 310
- SYS_PROCESS_VM_WRITEV = 311
- SYS_KCMP = 312
- SYS_FINIT_MODULE = 313
- SYS_SCHED_SETATTR = 314
- SYS_SCHED_GETATTR = 315
- SYS_RENAMEAT2 = 316
- SYS_SECCOMP = 317
- SYS_GETRANDOM = 318
- SYS_MEMFD_CREATE = 319
- SYS_KEXEC_FILE_LOAD = 320
- SYS_BPF = 321
- SYS_EXECVEAT = 322
- SYS_USERFAULTFD = 323
- SYS_MEMBARRIER = 324
- SYS_MLOCK2 = 325
- SYS_COPY_FILE_RANGE = 326
- SYS_PREADV2 = 327
- SYS_PWRITEV2 = 328
- SYS_PKEY_MPROTECT = 329
- SYS_PKEY_ALLOC = 330
- SYS_PKEY_FREE = 331
- SYS_STATX = 332
- SYS_IO_PGETEVENTS = 333
- SYS_RSEQ = 334
- SYS_PIDFD_SEND_SIGNAL = 424
- SYS_IO_URING_SETUP = 425
- SYS_IO_URING_ENTER = 426
- SYS_IO_URING_REGISTER = 427
- SYS_OPEN_TREE = 428
- SYS_MOVE_MOUNT = 429
- SYS_FSOPEN = 430
- SYS_FSCONFIG = 431
- SYS_FSMOUNT = 432
- SYS_FSPICK = 433
- SYS_PIDFD_OPEN = 434
- SYS_CLONE3 = 435
- SYS_CLOSE_RANGE = 436
- SYS_OPENAT2 = 437
- SYS_PIDFD_GETFD = 438
- SYS_FACCESSAT2 = 439
- SYS_PROCESS_MADVISE = 440
- SYS_EPOLL_PWAIT2 = 441
+ SYS_READ = 0
+ SYS_WRITE = 1
+ SYS_OPEN = 2
+ SYS_CLOSE = 3
+ SYS_STAT = 4
+ SYS_FSTAT = 5
+ SYS_LSTAT = 6
+ SYS_POLL = 7
+ SYS_LSEEK = 8
+ SYS_MMAP = 9
+ SYS_MPROTECT = 10
+ SYS_MUNMAP = 11
+ SYS_BRK = 12
+ SYS_RT_SIGACTION = 13
+ SYS_RT_SIGPROCMASK = 14
+ SYS_RT_SIGRETURN = 15
+ SYS_IOCTL = 16
+ SYS_PREAD64 = 17
+ SYS_PWRITE64 = 18
+ SYS_READV = 19
+ SYS_WRITEV = 20
+ SYS_ACCESS = 21
+ SYS_PIPE = 22
+ SYS_SELECT = 23
+ SYS_SCHED_YIELD = 24
+ SYS_MREMAP = 25
+ SYS_MSYNC = 26
+ SYS_MINCORE = 27
+ SYS_MADVISE = 28
+ SYS_SHMGET = 29
+ SYS_SHMAT = 30
+ SYS_SHMCTL = 31
+ SYS_DUP = 32
+ SYS_DUP2 = 33
+ SYS_PAUSE = 34
+ SYS_NANOSLEEP = 35
+ SYS_GETITIMER = 36
+ SYS_ALARM = 37
+ SYS_SETITIMER = 38
+ SYS_GETPID = 39
+ SYS_SENDFILE = 40
+ SYS_SOCKET = 41
+ SYS_CONNECT = 42
+ SYS_ACCEPT = 43
+ SYS_SENDTO = 44
+ SYS_RECVFROM = 45
+ SYS_SENDMSG = 46
+ SYS_RECVMSG = 47
+ SYS_SHUTDOWN = 48
+ SYS_BIND = 49
+ SYS_LISTEN = 50
+ SYS_GETSOCKNAME = 51
+ SYS_GETPEERNAME = 52
+ SYS_SOCKETPAIR = 53
+ SYS_SETSOCKOPT = 54
+ SYS_GETSOCKOPT = 55
+ SYS_CLONE = 56
+ SYS_FORK = 57
+ SYS_VFORK = 58
+ SYS_EXECVE = 59
+ SYS_EXIT = 60
+ SYS_WAIT4 = 61
+ SYS_KILL = 62
+ SYS_UNAME = 63
+ SYS_SEMGET = 64
+ SYS_SEMOP = 65
+ SYS_SEMCTL = 66
+ SYS_SHMDT = 67
+ SYS_MSGGET = 68
+ SYS_MSGSND = 69
+ SYS_MSGRCV = 70
+ SYS_MSGCTL = 71
+ SYS_FCNTL = 72
+ SYS_FLOCK = 73
+ SYS_FSYNC = 74
+ SYS_FDATASYNC = 75
+ SYS_TRUNCATE = 76
+ SYS_FTRUNCATE = 77
+ SYS_GETDENTS = 78
+ SYS_GETCWD = 79
+ SYS_CHDIR = 80
+ SYS_FCHDIR = 81
+ SYS_RENAME = 82
+ SYS_MKDIR = 83
+ SYS_RMDIR = 84
+ SYS_CREAT = 85
+ SYS_LINK = 86
+ SYS_UNLINK = 87
+ SYS_SYMLINK = 88
+ SYS_READLINK = 89
+ SYS_CHMOD = 90
+ SYS_FCHMOD = 91
+ SYS_CHOWN = 92
+ SYS_FCHOWN = 93
+ SYS_LCHOWN = 94
+ SYS_UMASK = 95
+ SYS_GETTIMEOFDAY = 96
+ SYS_GETRLIMIT = 97
+ SYS_GETRUSAGE = 98
+ SYS_SYSINFO = 99
+ SYS_TIMES = 100
+ SYS_PTRACE = 101
+ SYS_GETUID = 102
+ SYS_SYSLOG = 103
+ SYS_GETGID = 104
+ SYS_SETUID = 105
+ SYS_SETGID = 106
+ SYS_GETEUID = 107
+ SYS_GETEGID = 108
+ SYS_SETPGID = 109
+ SYS_GETPPID = 110
+ SYS_GETPGRP = 111
+ SYS_SETSID = 112
+ SYS_SETREUID = 113
+ SYS_SETREGID = 114
+ SYS_GETGROUPS = 115
+ SYS_SETGROUPS = 116
+ SYS_SETRESUID = 117
+ SYS_GETRESUID = 118
+ SYS_SETRESGID = 119
+ SYS_GETRESGID = 120
+ SYS_GETPGID = 121
+ SYS_SETFSUID = 122
+ SYS_SETFSGID = 123
+ SYS_GETSID = 124
+ SYS_CAPGET = 125
+ SYS_CAPSET = 126
+ SYS_RT_SIGPENDING = 127
+ SYS_RT_SIGTIMEDWAIT = 128
+ SYS_RT_SIGQUEUEINFO = 129
+ SYS_RT_SIGSUSPEND = 130
+ SYS_SIGALTSTACK = 131
+ SYS_UTIME = 132
+ SYS_MKNOD = 133
+ SYS_USELIB = 134
+ SYS_PERSONALITY = 135
+ SYS_USTAT = 136
+ SYS_STATFS = 137
+ SYS_FSTATFS = 138
+ SYS_SYSFS = 139
+ SYS_GETPRIORITY = 140
+ SYS_SETPRIORITY = 141
+ SYS_SCHED_SETPARAM = 142
+ SYS_SCHED_GETPARAM = 143
+ SYS_SCHED_SETSCHEDULER = 144
+ SYS_SCHED_GETSCHEDULER = 145
+ SYS_SCHED_GET_PRIORITY_MAX = 146
+ SYS_SCHED_GET_PRIORITY_MIN = 147
+ SYS_SCHED_RR_GET_INTERVAL = 148
+ SYS_MLOCK = 149
+ SYS_MUNLOCK = 150
+ SYS_MLOCKALL = 151
+ SYS_MUNLOCKALL = 152
+ SYS_VHANGUP = 153
+ SYS_MODIFY_LDT = 154
+ SYS_PIVOT_ROOT = 155
+ SYS__SYSCTL = 156
+ SYS_PRCTL = 157
+ SYS_ARCH_PRCTL = 158
+ SYS_ADJTIMEX = 159
+ SYS_SETRLIMIT = 160
+ SYS_CHROOT = 161
+ SYS_SYNC = 162
+ SYS_ACCT = 163
+ SYS_SETTIMEOFDAY = 164
+ SYS_MOUNT = 165
+ SYS_UMOUNT2 = 166
+ SYS_SWAPON = 167
+ SYS_SWAPOFF = 168
+ SYS_REBOOT = 169
+ SYS_SETHOSTNAME = 170
+ SYS_SETDOMAINNAME = 171
+ SYS_IOPL = 172
+ SYS_IOPERM = 173
+ SYS_CREATE_MODULE = 174
+ SYS_INIT_MODULE = 175
+ SYS_DELETE_MODULE = 176
+ SYS_GET_KERNEL_SYMS = 177
+ SYS_QUERY_MODULE = 178
+ SYS_QUOTACTL = 179
+ SYS_NFSSERVCTL = 180
+ SYS_GETPMSG = 181
+ SYS_PUTPMSG = 182
+ SYS_AFS_SYSCALL = 183
+ SYS_TUXCALL = 184
+ SYS_SECURITY = 185
+ SYS_GETTID = 186
+ SYS_READAHEAD = 187
+ SYS_SETXATTR = 188
+ SYS_LSETXATTR = 189
+ SYS_FSETXATTR = 190
+ SYS_GETXATTR = 191
+ SYS_LGETXATTR = 192
+ SYS_FGETXATTR = 193
+ SYS_LISTXATTR = 194
+ SYS_LLISTXATTR = 195
+ SYS_FLISTXATTR = 196
+ SYS_REMOVEXATTR = 197
+ SYS_LREMOVEXATTR = 198
+ SYS_FREMOVEXATTR = 199
+ SYS_TKILL = 200
+ SYS_TIME = 201
+ SYS_FUTEX = 202
+ SYS_SCHED_SETAFFINITY = 203
+ SYS_SCHED_GETAFFINITY = 204
+ SYS_SET_THREAD_AREA = 205
+ SYS_IO_SETUP = 206
+ SYS_IO_DESTROY = 207
+ SYS_IO_GETEVENTS = 208
+ SYS_IO_SUBMIT = 209
+ SYS_IO_CANCEL = 210
+ SYS_GET_THREAD_AREA = 211
+ SYS_LOOKUP_DCOOKIE = 212
+ SYS_EPOLL_CREATE = 213
+ SYS_EPOLL_CTL_OLD = 214
+ SYS_EPOLL_WAIT_OLD = 215
+ SYS_REMAP_FILE_PAGES = 216
+ SYS_GETDENTS64 = 217
+ SYS_SET_TID_ADDRESS = 218
+ SYS_RESTART_SYSCALL = 219
+ SYS_SEMTIMEDOP = 220
+ SYS_FADVISE64 = 221
+ SYS_TIMER_CREATE = 222
+ SYS_TIMER_SETTIME = 223
+ SYS_TIMER_GETTIME = 224
+ SYS_TIMER_GETOVERRUN = 225
+ SYS_TIMER_DELETE = 226
+ SYS_CLOCK_SETTIME = 227
+ SYS_CLOCK_GETTIME = 228
+ SYS_CLOCK_GETRES = 229
+ SYS_CLOCK_NANOSLEEP = 230
+ SYS_EXIT_GROUP = 231
+ SYS_EPOLL_WAIT = 232
+ SYS_EPOLL_CTL = 233
+ SYS_TGKILL = 234
+ SYS_UTIMES = 235
+ SYS_VSERVER = 236
+ SYS_MBIND = 237
+ SYS_SET_MEMPOLICY = 238
+ SYS_GET_MEMPOLICY = 239
+ SYS_MQ_OPEN = 240
+ SYS_MQ_UNLINK = 241
+ SYS_MQ_TIMEDSEND = 242
+ SYS_MQ_TIMEDRECEIVE = 243
+ SYS_MQ_NOTIFY = 244
+ SYS_MQ_GETSETATTR = 245
+ SYS_KEXEC_LOAD = 246
+ SYS_WAITID = 247
+ SYS_ADD_KEY = 248
+ SYS_REQUEST_KEY = 249
+ SYS_KEYCTL = 250
+ SYS_IOPRIO_SET = 251
+ SYS_IOPRIO_GET = 252
+ SYS_INOTIFY_INIT = 253
+ SYS_INOTIFY_ADD_WATCH = 254
+ SYS_INOTIFY_RM_WATCH = 255
+ SYS_MIGRATE_PAGES = 256
+ SYS_OPENAT = 257
+ SYS_MKDIRAT = 258
+ SYS_MKNODAT = 259
+ SYS_FCHOWNAT = 260
+ SYS_FUTIMESAT = 261
+ SYS_NEWFSTATAT = 262
+ SYS_UNLINKAT = 263
+ SYS_RENAMEAT = 264
+ SYS_LINKAT = 265
+ SYS_SYMLINKAT = 266
+ SYS_READLINKAT = 267
+ SYS_FCHMODAT = 268
+ SYS_FACCESSAT = 269
+ SYS_PSELECT6 = 270
+ SYS_PPOLL = 271
+ SYS_UNSHARE = 272
+ SYS_SET_ROBUST_LIST = 273
+ SYS_GET_ROBUST_LIST = 274
+ SYS_SPLICE = 275
+ SYS_TEE = 276
+ SYS_SYNC_FILE_RANGE = 277
+ SYS_VMSPLICE = 278
+ SYS_MOVE_PAGES = 279
+ SYS_UTIMENSAT = 280
+ SYS_EPOLL_PWAIT = 281
+ SYS_SIGNALFD = 282
+ SYS_TIMERFD_CREATE = 283
+ SYS_EVENTFD = 284
+ SYS_FALLOCATE = 285
+ SYS_TIMERFD_SETTIME = 286
+ SYS_TIMERFD_GETTIME = 287
+ SYS_ACCEPT4 = 288
+ SYS_SIGNALFD4 = 289
+ SYS_EVENTFD2 = 290
+ SYS_EPOLL_CREATE1 = 291
+ SYS_DUP3 = 292
+ SYS_PIPE2 = 293
+ SYS_INOTIFY_INIT1 = 294
+ SYS_PREADV = 295
+ SYS_PWRITEV = 296
+ SYS_RT_TGSIGQUEUEINFO = 297
+ SYS_PERF_EVENT_OPEN = 298
+ SYS_RECVMMSG = 299
+ SYS_FANOTIFY_INIT = 300
+ SYS_FANOTIFY_MARK = 301
+ SYS_PRLIMIT64 = 302
+ SYS_NAME_TO_HANDLE_AT = 303
+ SYS_OPEN_BY_HANDLE_AT = 304
+ SYS_CLOCK_ADJTIME = 305
+ SYS_SYNCFS = 306
+ SYS_SENDMMSG = 307
+ SYS_SETNS = 308
+ SYS_GETCPU = 309
+ SYS_PROCESS_VM_READV = 310
+ SYS_PROCESS_VM_WRITEV = 311
+ SYS_KCMP = 312
+ SYS_FINIT_MODULE = 313
+ SYS_SCHED_SETATTR = 314
+ SYS_SCHED_GETATTR = 315
+ SYS_RENAMEAT2 = 316
+ SYS_SECCOMP = 317
+ SYS_GETRANDOM = 318
+ SYS_MEMFD_CREATE = 319
+ SYS_KEXEC_FILE_LOAD = 320
+ SYS_BPF = 321
+ SYS_EXECVEAT = 322
+ SYS_USERFAULTFD = 323
+ SYS_MEMBARRIER = 324
+ SYS_MLOCK2 = 325
+ SYS_COPY_FILE_RANGE = 326
+ SYS_PREADV2 = 327
+ SYS_PWRITEV2 = 328
+ SYS_PKEY_MPROTECT = 329
+ SYS_PKEY_ALLOC = 330
+ SYS_PKEY_FREE = 331
+ SYS_STATX = 332
+ SYS_IO_PGETEVENTS = 333
+ SYS_RSEQ = 334
+ SYS_PIDFD_SEND_SIGNAL = 424
+ SYS_IO_URING_SETUP = 425
+ SYS_IO_URING_ENTER = 426
+ SYS_IO_URING_REGISTER = 427
+ SYS_OPEN_TREE = 428
+ SYS_MOVE_MOUNT = 429
+ SYS_FSOPEN = 430
+ SYS_FSCONFIG = 431
+ SYS_FSMOUNT = 432
+ SYS_FSPICK = 433
+ SYS_PIDFD_OPEN = 434
+ SYS_CLONE3 = 435
+ SYS_CLOSE_RANGE = 436
+ SYS_OPENAT2 = 437
+ SYS_PIDFD_GETFD = 438
+ SYS_FACCESSAT2 = 439
+ SYS_PROCESS_MADVISE = 440
+ SYS_EPOLL_PWAIT2 = 441
+ SYS_MOUNT_SETATTR = 442
+ SYS_QUOTACTL_FD = 443
+ SYS_LANDLOCK_CREATE_RULESET = 444
+ SYS_LANDLOCK_ADD_RULE = 445
+ SYS_LANDLOCK_RESTRICT_SELF = 446
+ SYS_MEMFD_SECRET = 447
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
index 04093a69f..d75f65a0a 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
@@ -402,4 +402,9 @@ const (
SYS_FACCESSAT2 = 439
SYS_PROCESS_MADVISE = 440
SYS_EPOLL_PWAIT2 = 441
+ SYS_MOUNT_SETATTR = 442
+ SYS_QUOTACTL_FD = 443
+ SYS_LANDLOCK_CREATE_RULESET = 444
+ SYS_LANDLOCK_ADD_RULE = 445
+ SYS_LANDLOCK_RESTRICT_SELF = 446
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
index 48f94f135..8b02f09e9 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
@@ -7,302 +7,308 @@
package unix
const (
- SYS_IO_SETUP = 0
- SYS_IO_DESTROY = 1
- SYS_IO_SUBMIT = 2
- SYS_IO_CANCEL = 3
- SYS_IO_GETEVENTS = 4
- SYS_SETXATTR = 5
- SYS_LSETXATTR = 6
- SYS_FSETXATTR = 7
- SYS_GETXATTR = 8
- SYS_LGETXATTR = 9
- SYS_FGETXATTR = 10
- SYS_LISTXATTR = 11
- SYS_LLISTXATTR = 12
- SYS_FLISTXATTR = 13
- SYS_REMOVEXATTR = 14
- SYS_LREMOVEXATTR = 15
- SYS_FREMOVEXATTR = 16
- SYS_GETCWD = 17
- SYS_LOOKUP_DCOOKIE = 18
- SYS_EVENTFD2 = 19
- SYS_EPOLL_CREATE1 = 20
- SYS_EPOLL_CTL = 21
- SYS_EPOLL_PWAIT = 22
- SYS_DUP = 23
- SYS_DUP3 = 24
- SYS_FCNTL = 25
- SYS_INOTIFY_INIT1 = 26
- SYS_INOTIFY_ADD_WATCH = 27
- SYS_INOTIFY_RM_WATCH = 28
- SYS_IOCTL = 29
- SYS_IOPRIO_SET = 30
- SYS_IOPRIO_GET = 31
- SYS_FLOCK = 32
- SYS_MKNODAT = 33
- SYS_MKDIRAT = 34
- SYS_UNLINKAT = 35
- SYS_SYMLINKAT = 36
- SYS_LINKAT = 37
- SYS_RENAMEAT = 38
- SYS_UMOUNT2 = 39
- SYS_MOUNT = 40
- SYS_PIVOT_ROOT = 41
- SYS_NFSSERVCTL = 42
- SYS_STATFS = 43
- SYS_FSTATFS = 44
- SYS_TRUNCATE = 45
- SYS_FTRUNCATE = 46
- SYS_FALLOCATE = 47
- SYS_FACCESSAT = 48
- SYS_CHDIR = 49
- SYS_FCHDIR = 50
- SYS_CHROOT = 51
- SYS_FCHMOD = 52
- SYS_FCHMODAT = 53
- SYS_FCHOWNAT = 54
- SYS_FCHOWN = 55
- SYS_OPENAT = 56
- SYS_CLOSE = 57
- SYS_VHANGUP = 58
- SYS_PIPE2 = 59
- SYS_QUOTACTL = 60
- SYS_GETDENTS64 = 61
- SYS_LSEEK = 62
- SYS_READ = 63
- SYS_WRITE = 64
- SYS_READV = 65
- SYS_WRITEV = 66
- SYS_PREAD64 = 67
- SYS_PWRITE64 = 68
- SYS_PREADV = 69
- SYS_PWRITEV = 70
- SYS_SENDFILE = 71
- SYS_PSELECT6 = 72
- SYS_PPOLL = 73
- SYS_SIGNALFD4 = 74
- SYS_VMSPLICE = 75
- SYS_SPLICE = 76
- SYS_TEE = 77
- SYS_READLINKAT = 78
- SYS_FSTATAT = 79
- SYS_FSTAT = 80
- SYS_SYNC = 81
- SYS_FSYNC = 82
- SYS_FDATASYNC = 83
- SYS_SYNC_FILE_RANGE = 84
- SYS_TIMERFD_CREATE = 85
- SYS_TIMERFD_SETTIME = 86
- SYS_TIMERFD_GETTIME = 87
- SYS_UTIMENSAT = 88
- SYS_ACCT = 89
- SYS_CAPGET = 90
- SYS_CAPSET = 91
- SYS_PERSONALITY = 92
- SYS_EXIT = 93
- SYS_EXIT_GROUP = 94
- SYS_WAITID = 95
- SYS_SET_TID_ADDRESS = 96
- SYS_UNSHARE = 97
- SYS_FUTEX = 98
- SYS_SET_ROBUST_LIST = 99
- SYS_GET_ROBUST_LIST = 100
- SYS_NANOSLEEP = 101
- SYS_GETITIMER = 102
- SYS_SETITIMER = 103
- SYS_KEXEC_LOAD = 104
- SYS_INIT_MODULE = 105
- SYS_DELETE_MODULE = 106
- SYS_TIMER_CREATE = 107
- SYS_TIMER_GETTIME = 108
- SYS_TIMER_GETOVERRUN = 109
- SYS_TIMER_SETTIME = 110
- SYS_TIMER_DELETE = 111
- SYS_CLOCK_SETTIME = 112
- SYS_CLOCK_GETTIME = 113
- SYS_CLOCK_GETRES = 114
- SYS_CLOCK_NANOSLEEP = 115
- SYS_SYSLOG = 116
- SYS_PTRACE = 117
- SYS_SCHED_SETPARAM = 118
- SYS_SCHED_SETSCHEDULER = 119
- SYS_SCHED_GETSCHEDULER = 120
- SYS_SCHED_GETPARAM = 121
- SYS_SCHED_SETAFFINITY = 122
- SYS_SCHED_GETAFFINITY = 123
- SYS_SCHED_YIELD = 124
- SYS_SCHED_GET_PRIORITY_MAX = 125
- SYS_SCHED_GET_PRIORITY_MIN = 126
- SYS_SCHED_RR_GET_INTERVAL = 127
- SYS_RESTART_SYSCALL = 128
- SYS_KILL = 129
- SYS_TKILL = 130
- SYS_TGKILL = 131
- SYS_SIGALTSTACK = 132
- SYS_RT_SIGSUSPEND = 133
- SYS_RT_SIGACTION = 134
- SYS_RT_SIGPROCMASK = 135
- SYS_RT_SIGPENDING = 136
- SYS_RT_SIGTIMEDWAIT = 137
- SYS_RT_SIGQUEUEINFO = 138
- SYS_RT_SIGRETURN = 139
- SYS_SETPRIORITY = 140
- SYS_GETPRIORITY = 141
- SYS_REBOOT = 142
- SYS_SETREGID = 143
- SYS_SETGID = 144
- SYS_SETREUID = 145
- SYS_SETUID = 146
- SYS_SETRESUID = 147
- SYS_GETRESUID = 148
- SYS_SETRESGID = 149
- SYS_GETRESGID = 150
- SYS_SETFSUID = 151
- SYS_SETFSGID = 152
- SYS_TIMES = 153
- SYS_SETPGID = 154
- SYS_GETPGID = 155
- SYS_GETSID = 156
- SYS_SETSID = 157
- SYS_GETGROUPS = 158
- SYS_SETGROUPS = 159
- SYS_UNAME = 160
- SYS_SETHOSTNAME = 161
- SYS_SETDOMAINNAME = 162
- SYS_GETRLIMIT = 163
- SYS_SETRLIMIT = 164
- SYS_GETRUSAGE = 165
- SYS_UMASK = 166
- SYS_PRCTL = 167
- SYS_GETCPU = 168
- SYS_GETTIMEOFDAY = 169
- SYS_SETTIMEOFDAY = 170
- SYS_ADJTIMEX = 171
- SYS_GETPID = 172
- SYS_GETPPID = 173
- SYS_GETUID = 174
- SYS_GETEUID = 175
- SYS_GETGID = 176
- SYS_GETEGID = 177
- SYS_GETTID = 178
- SYS_SYSINFO = 179
- SYS_MQ_OPEN = 180
- SYS_MQ_UNLINK = 181
- SYS_MQ_TIMEDSEND = 182
- SYS_MQ_TIMEDRECEIVE = 183
- SYS_MQ_NOTIFY = 184
- SYS_MQ_GETSETATTR = 185
- SYS_MSGGET = 186
- SYS_MSGCTL = 187
- SYS_MSGRCV = 188
- SYS_MSGSND = 189
- SYS_SEMGET = 190
- SYS_SEMCTL = 191
- SYS_SEMTIMEDOP = 192
- SYS_SEMOP = 193
- SYS_SHMGET = 194
- SYS_SHMCTL = 195
- SYS_SHMAT = 196
- SYS_SHMDT = 197
- SYS_SOCKET = 198
- SYS_SOCKETPAIR = 199
- SYS_BIND = 200
- SYS_LISTEN = 201
- SYS_ACCEPT = 202
- SYS_CONNECT = 203
- SYS_GETSOCKNAME = 204
- SYS_GETPEERNAME = 205
- SYS_SENDTO = 206
- SYS_RECVFROM = 207
- SYS_SETSOCKOPT = 208
- SYS_GETSOCKOPT = 209
- SYS_SHUTDOWN = 210
- SYS_SENDMSG = 211
- SYS_RECVMSG = 212
- SYS_READAHEAD = 213
- SYS_BRK = 214
- SYS_MUNMAP = 215
- SYS_MREMAP = 216
- SYS_ADD_KEY = 217
- SYS_REQUEST_KEY = 218
- SYS_KEYCTL = 219
- SYS_CLONE = 220
- SYS_EXECVE = 221
- SYS_MMAP = 222
- SYS_FADVISE64 = 223
- SYS_SWAPON = 224
- SYS_SWAPOFF = 225
- SYS_MPROTECT = 226
- SYS_MSYNC = 227
- SYS_MLOCK = 228
- SYS_MUNLOCK = 229
- SYS_MLOCKALL = 230
- SYS_MUNLOCKALL = 231
- SYS_MINCORE = 232
- SYS_MADVISE = 233
- SYS_REMAP_FILE_PAGES = 234
- SYS_MBIND = 235
- SYS_GET_MEMPOLICY = 236
- SYS_SET_MEMPOLICY = 237
- SYS_MIGRATE_PAGES = 238
- SYS_MOVE_PAGES = 239
- SYS_RT_TGSIGQUEUEINFO = 240
- SYS_PERF_EVENT_OPEN = 241
- SYS_ACCEPT4 = 242
- SYS_RECVMMSG = 243
- SYS_ARCH_SPECIFIC_SYSCALL = 244
- SYS_WAIT4 = 260
- SYS_PRLIMIT64 = 261
- SYS_FANOTIFY_INIT = 262
- SYS_FANOTIFY_MARK = 263
- SYS_NAME_TO_HANDLE_AT = 264
- SYS_OPEN_BY_HANDLE_AT = 265
- SYS_CLOCK_ADJTIME = 266
- SYS_SYNCFS = 267
- SYS_SETNS = 268
- SYS_SENDMMSG = 269
- SYS_PROCESS_VM_READV = 270
- SYS_PROCESS_VM_WRITEV = 271
- SYS_KCMP = 272
- SYS_FINIT_MODULE = 273
- SYS_SCHED_SETATTR = 274
- SYS_SCHED_GETATTR = 275
- SYS_RENAMEAT2 = 276
- SYS_SECCOMP = 277
- SYS_GETRANDOM = 278
- SYS_MEMFD_CREATE = 279
- SYS_BPF = 280
- SYS_EXECVEAT = 281
- SYS_USERFAULTFD = 282
- SYS_MEMBARRIER = 283
- SYS_MLOCK2 = 284
- SYS_COPY_FILE_RANGE = 285
- SYS_PREADV2 = 286
- SYS_PWRITEV2 = 287
- SYS_PKEY_MPROTECT = 288
- SYS_PKEY_ALLOC = 289
- SYS_PKEY_FREE = 290
- SYS_STATX = 291
- SYS_IO_PGETEVENTS = 292
- SYS_RSEQ = 293
- SYS_KEXEC_FILE_LOAD = 294
- SYS_PIDFD_SEND_SIGNAL = 424
- SYS_IO_URING_SETUP = 425
- SYS_IO_URING_ENTER = 426
- SYS_IO_URING_REGISTER = 427
- SYS_OPEN_TREE = 428
- SYS_MOVE_MOUNT = 429
- SYS_FSOPEN = 430
- SYS_FSCONFIG = 431
- SYS_FSMOUNT = 432
- SYS_FSPICK = 433
- SYS_PIDFD_OPEN = 434
- SYS_CLONE3 = 435
- SYS_CLOSE_RANGE = 436
- SYS_OPENAT2 = 437
- SYS_PIDFD_GETFD = 438
- SYS_FACCESSAT2 = 439
- SYS_PROCESS_MADVISE = 440
- SYS_EPOLL_PWAIT2 = 441
+ SYS_IO_SETUP = 0
+ SYS_IO_DESTROY = 1
+ SYS_IO_SUBMIT = 2
+ SYS_IO_CANCEL = 3
+ SYS_IO_GETEVENTS = 4
+ SYS_SETXATTR = 5
+ SYS_LSETXATTR = 6
+ SYS_FSETXATTR = 7
+ SYS_GETXATTR = 8
+ SYS_LGETXATTR = 9
+ SYS_FGETXATTR = 10
+ SYS_LISTXATTR = 11
+ SYS_LLISTXATTR = 12
+ SYS_FLISTXATTR = 13
+ SYS_REMOVEXATTR = 14
+ SYS_LREMOVEXATTR = 15
+ SYS_FREMOVEXATTR = 16
+ SYS_GETCWD = 17
+ SYS_LOOKUP_DCOOKIE = 18
+ SYS_EVENTFD2 = 19
+ SYS_EPOLL_CREATE1 = 20
+ SYS_EPOLL_CTL = 21
+ SYS_EPOLL_PWAIT = 22
+ SYS_DUP = 23
+ SYS_DUP3 = 24
+ SYS_FCNTL = 25
+ SYS_INOTIFY_INIT1 = 26
+ SYS_INOTIFY_ADD_WATCH = 27
+ SYS_INOTIFY_RM_WATCH = 28
+ SYS_IOCTL = 29
+ SYS_IOPRIO_SET = 30
+ SYS_IOPRIO_GET = 31
+ SYS_FLOCK = 32
+ SYS_MKNODAT = 33
+ SYS_MKDIRAT = 34
+ SYS_UNLINKAT = 35
+ SYS_SYMLINKAT = 36
+ SYS_LINKAT = 37
+ SYS_RENAMEAT = 38
+ SYS_UMOUNT2 = 39
+ SYS_MOUNT = 40
+ SYS_PIVOT_ROOT = 41
+ SYS_NFSSERVCTL = 42
+ SYS_STATFS = 43
+ SYS_FSTATFS = 44
+ SYS_TRUNCATE = 45
+ SYS_FTRUNCATE = 46
+ SYS_FALLOCATE = 47
+ SYS_FACCESSAT = 48
+ SYS_CHDIR = 49
+ SYS_FCHDIR = 50
+ SYS_CHROOT = 51
+ SYS_FCHMOD = 52
+ SYS_FCHMODAT = 53
+ SYS_FCHOWNAT = 54
+ SYS_FCHOWN = 55
+ SYS_OPENAT = 56
+ SYS_CLOSE = 57
+ SYS_VHANGUP = 58
+ SYS_PIPE2 = 59
+ SYS_QUOTACTL = 60
+ SYS_GETDENTS64 = 61
+ SYS_LSEEK = 62
+ SYS_READ = 63
+ SYS_WRITE = 64
+ SYS_READV = 65
+ SYS_WRITEV = 66
+ SYS_PREAD64 = 67
+ SYS_PWRITE64 = 68
+ SYS_PREADV = 69
+ SYS_PWRITEV = 70
+ SYS_SENDFILE = 71
+ SYS_PSELECT6 = 72
+ SYS_PPOLL = 73
+ SYS_SIGNALFD4 = 74
+ SYS_VMSPLICE = 75
+ SYS_SPLICE = 76
+ SYS_TEE = 77
+ SYS_READLINKAT = 78
+ SYS_FSTATAT = 79
+ SYS_FSTAT = 80
+ SYS_SYNC = 81
+ SYS_FSYNC = 82
+ SYS_FDATASYNC = 83
+ SYS_SYNC_FILE_RANGE = 84
+ SYS_TIMERFD_CREATE = 85
+ SYS_TIMERFD_SETTIME = 86
+ SYS_TIMERFD_GETTIME = 87
+ SYS_UTIMENSAT = 88
+ SYS_ACCT = 89
+ SYS_CAPGET = 90
+ SYS_CAPSET = 91
+ SYS_PERSONALITY = 92
+ SYS_EXIT = 93
+ SYS_EXIT_GROUP = 94
+ SYS_WAITID = 95
+ SYS_SET_TID_ADDRESS = 96
+ SYS_UNSHARE = 97
+ SYS_FUTEX = 98
+ SYS_SET_ROBUST_LIST = 99
+ SYS_GET_ROBUST_LIST = 100
+ SYS_NANOSLEEP = 101
+ SYS_GETITIMER = 102
+ SYS_SETITIMER = 103
+ SYS_KEXEC_LOAD = 104
+ SYS_INIT_MODULE = 105
+ SYS_DELETE_MODULE = 106
+ SYS_TIMER_CREATE = 107
+ SYS_TIMER_GETTIME = 108
+ SYS_TIMER_GETOVERRUN = 109
+ SYS_TIMER_SETTIME = 110
+ SYS_TIMER_DELETE = 111
+ SYS_CLOCK_SETTIME = 112
+ SYS_CLOCK_GETTIME = 113
+ SYS_CLOCK_GETRES = 114
+ SYS_CLOCK_NANOSLEEP = 115
+ SYS_SYSLOG = 116
+ SYS_PTRACE = 117
+ SYS_SCHED_SETPARAM = 118
+ SYS_SCHED_SETSCHEDULER = 119
+ SYS_SCHED_GETSCHEDULER = 120
+ SYS_SCHED_GETPARAM = 121
+ SYS_SCHED_SETAFFINITY = 122
+ SYS_SCHED_GETAFFINITY = 123
+ SYS_SCHED_YIELD = 124
+ SYS_SCHED_GET_PRIORITY_MAX = 125
+ SYS_SCHED_GET_PRIORITY_MIN = 126
+ SYS_SCHED_RR_GET_INTERVAL = 127
+ SYS_RESTART_SYSCALL = 128
+ SYS_KILL = 129
+ SYS_TKILL = 130
+ SYS_TGKILL = 131
+ SYS_SIGALTSTACK = 132
+ SYS_RT_SIGSUSPEND = 133
+ SYS_RT_SIGACTION = 134
+ SYS_RT_SIGPROCMASK = 135
+ SYS_RT_SIGPENDING = 136
+ SYS_RT_SIGTIMEDWAIT = 137
+ SYS_RT_SIGQUEUEINFO = 138
+ SYS_RT_SIGRETURN = 139
+ SYS_SETPRIORITY = 140
+ SYS_GETPRIORITY = 141
+ SYS_REBOOT = 142
+ SYS_SETREGID = 143
+ SYS_SETGID = 144
+ SYS_SETREUID = 145
+ SYS_SETUID = 146
+ SYS_SETRESUID = 147
+ SYS_GETRESUID = 148
+ SYS_SETRESGID = 149
+ SYS_GETRESGID = 150
+ SYS_SETFSUID = 151
+ SYS_SETFSGID = 152
+ SYS_TIMES = 153
+ SYS_SETPGID = 154
+ SYS_GETPGID = 155
+ SYS_GETSID = 156
+ SYS_SETSID = 157
+ SYS_GETGROUPS = 158
+ SYS_SETGROUPS = 159
+ SYS_UNAME = 160
+ SYS_SETHOSTNAME = 161
+ SYS_SETDOMAINNAME = 162
+ SYS_GETRLIMIT = 163
+ SYS_SETRLIMIT = 164
+ SYS_GETRUSAGE = 165
+ SYS_UMASK = 166
+ SYS_PRCTL = 167
+ SYS_GETCPU = 168
+ SYS_GETTIMEOFDAY = 169
+ SYS_SETTIMEOFDAY = 170
+ SYS_ADJTIMEX = 171
+ SYS_GETPID = 172
+ SYS_GETPPID = 173
+ SYS_GETUID = 174
+ SYS_GETEUID = 175
+ SYS_GETGID = 176
+ SYS_GETEGID = 177
+ SYS_GETTID = 178
+ SYS_SYSINFO = 179
+ SYS_MQ_OPEN = 180
+ SYS_MQ_UNLINK = 181
+ SYS_MQ_TIMEDSEND = 182
+ SYS_MQ_TIMEDRECEIVE = 183
+ SYS_MQ_NOTIFY = 184
+ SYS_MQ_GETSETATTR = 185
+ SYS_MSGGET = 186
+ SYS_MSGCTL = 187
+ SYS_MSGRCV = 188
+ SYS_MSGSND = 189
+ SYS_SEMGET = 190
+ SYS_SEMCTL = 191
+ SYS_SEMTIMEDOP = 192
+ SYS_SEMOP = 193
+ SYS_SHMGET = 194
+ SYS_SHMCTL = 195
+ SYS_SHMAT = 196
+ SYS_SHMDT = 197
+ SYS_SOCKET = 198
+ SYS_SOCKETPAIR = 199
+ SYS_BIND = 200
+ SYS_LISTEN = 201
+ SYS_ACCEPT = 202
+ SYS_CONNECT = 203
+ SYS_GETSOCKNAME = 204
+ SYS_GETPEERNAME = 205
+ SYS_SENDTO = 206
+ SYS_RECVFROM = 207
+ SYS_SETSOCKOPT = 208
+ SYS_GETSOCKOPT = 209
+ SYS_SHUTDOWN = 210
+ SYS_SENDMSG = 211
+ SYS_RECVMSG = 212
+ SYS_READAHEAD = 213
+ SYS_BRK = 214
+ SYS_MUNMAP = 215
+ SYS_MREMAP = 216
+ SYS_ADD_KEY = 217
+ SYS_REQUEST_KEY = 218
+ SYS_KEYCTL = 219
+ SYS_CLONE = 220
+ SYS_EXECVE = 221
+ SYS_MMAP = 222
+ SYS_FADVISE64 = 223
+ SYS_SWAPON = 224
+ SYS_SWAPOFF = 225
+ SYS_MPROTECT = 226
+ SYS_MSYNC = 227
+ SYS_MLOCK = 228
+ SYS_MUNLOCK = 229
+ SYS_MLOCKALL = 230
+ SYS_MUNLOCKALL = 231
+ SYS_MINCORE = 232
+ SYS_MADVISE = 233
+ SYS_REMAP_FILE_PAGES = 234
+ SYS_MBIND = 235
+ SYS_GET_MEMPOLICY = 236
+ SYS_SET_MEMPOLICY = 237
+ SYS_MIGRATE_PAGES = 238
+ SYS_MOVE_PAGES = 239
+ SYS_RT_TGSIGQUEUEINFO = 240
+ SYS_PERF_EVENT_OPEN = 241
+ SYS_ACCEPT4 = 242
+ SYS_RECVMMSG = 243
+ SYS_ARCH_SPECIFIC_SYSCALL = 244
+ SYS_WAIT4 = 260
+ SYS_PRLIMIT64 = 261
+ SYS_FANOTIFY_INIT = 262
+ SYS_FANOTIFY_MARK = 263
+ SYS_NAME_TO_HANDLE_AT = 264
+ SYS_OPEN_BY_HANDLE_AT = 265
+ SYS_CLOCK_ADJTIME = 266
+ SYS_SYNCFS = 267
+ SYS_SETNS = 268
+ SYS_SENDMMSG = 269
+ SYS_PROCESS_VM_READV = 270
+ SYS_PROCESS_VM_WRITEV = 271
+ SYS_KCMP = 272
+ SYS_FINIT_MODULE = 273
+ SYS_SCHED_SETATTR = 274
+ SYS_SCHED_GETATTR = 275
+ SYS_RENAMEAT2 = 276
+ SYS_SECCOMP = 277
+ SYS_GETRANDOM = 278
+ SYS_MEMFD_CREATE = 279
+ SYS_BPF = 280
+ SYS_EXECVEAT = 281
+ SYS_USERFAULTFD = 282
+ SYS_MEMBARRIER = 283
+ SYS_MLOCK2 = 284
+ SYS_COPY_FILE_RANGE = 285
+ SYS_PREADV2 = 286
+ SYS_PWRITEV2 = 287
+ SYS_PKEY_MPROTECT = 288
+ SYS_PKEY_ALLOC = 289
+ SYS_PKEY_FREE = 290
+ SYS_STATX = 291
+ SYS_IO_PGETEVENTS = 292
+ SYS_RSEQ = 293
+ SYS_KEXEC_FILE_LOAD = 294
+ SYS_PIDFD_SEND_SIGNAL = 424
+ SYS_IO_URING_SETUP = 425
+ SYS_IO_URING_ENTER = 426
+ SYS_IO_URING_REGISTER = 427
+ SYS_OPEN_TREE = 428
+ SYS_MOVE_MOUNT = 429
+ SYS_FSOPEN = 430
+ SYS_FSCONFIG = 431
+ SYS_FSMOUNT = 432
+ SYS_FSPICK = 433
+ SYS_PIDFD_OPEN = 434
+ SYS_CLONE3 = 435
+ SYS_CLOSE_RANGE = 436
+ SYS_OPENAT2 = 437
+ SYS_PIDFD_GETFD = 438
+ SYS_FACCESSAT2 = 439
+ SYS_PROCESS_MADVISE = 440
+ SYS_EPOLL_PWAIT2 = 441
+ SYS_MOUNT_SETATTR = 442
+ SYS_QUOTACTL_FD = 443
+ SYS_LANDLOCK_CREATE_RULESET = 444
+ SYS_LANDLOCK_ADD_RULE = 445
+ SYS_LANDLOCK_RESTRICT_SELF = 446
+ SYS_MEMFD_SECRET = 447
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
index 499978c3e..026695abb 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
@@ -423,4 +423,9 @@ const (
SYS_FACCESSAT2 = 4439
SYS_PROCESS_MADVISE = 4440
SYS_EPOLL_PWAIT2 = 4441
+ SYS_MOUNT_SETATTR = 4442
+ SYS_QUOTACTL_FD = 4443
+ SYS_LANDLOCK_CREATE_RULESET = 4444
+ SYS_LANDLOCK_ADD_RULE = 4445
+ SYS_LANDLOCK_RESTRICT_SELF = 4446
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
index 10d1db2be..7320ba958 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
@@ -7,350 +7,355 @@
package unix
const (
- SYS_READ = 5000
- SYS_WRITE = 5001
- SYS_OPEN = 5002
- SYS_CLOSE = 5003
- SYS_STAT = 5004
- SYS_FSTAT = 5005
- SYS_LSTAT = 5006
- SYS_POLL = 5007
- SYS_LSEEK = 5008
- SYS_MMAP = 5009
- SYS_MPROTECT = 5010
- SYS_MUNMAP = 5011
- SYS_BRK = 5012
- SYS_RT_SIGACTION = 5013
- SYS_RT_SIGPROCMASK = 5014
- SYS_IOCTL = 5015
- SYS_PREAD64 = 5016
- SYS_PWRITE64 = 5017
- SYS_READV = 5018
- SYS_WRITEV = 5019
- SYS_ACCESS = 5020
- SYS_PIPE = 5021
- SYS__NEWSELECT = 5022
- SYS_SCHED_YIELD = 5023
- SYS_MREMAP = 5024
- SYS_MSYNC = 5025
- SYS_MINCORE = 5026
- SYS_MADVISE = 5027
- SYS_SHMGET = 5028
- SYS_SHMAT = 5029
- SYS_SHMCTL = 5030
- SYS_DUP = 5031
- SYS_DUP2 = 5032
- SYS_PAUSE = 5033
- SYS_NANOSLEEP = 5034
- SYS_GETITIMER = 5035
- SYS_SETITIMER = 5036
- SYS_ALARM = 5037
- SYS_GETPID = 5038
- SYS_SENDFILE = 5039
- SYS_SOCKET = 5040
- SYS_CONNECT = 5041
- SYS_ACCEPT = 5042
- SYS_SENDTO = 5043
- SYS_RECVFROM = 5044
- SYS_SENDMSG = 5045
- SYS_RECVMSG = 5046
- SYS_SHUTDOWN = 5047
- SYS_BIND = 5048
- SYS_LISTEN = 5049
- SYS_GETSOCKNAME = 5050
- SYS_GETPEERNAME = 5051
- SYS_SOCKETPAIR = 5052
- SYS_SETSOCKOPT = 5053
- SYS_GETSOCKOPT = 5054
- SYS_CLONE = 5055
- SYS_FORK = 5056
- SYS_EXECVE = 5057
- SYS_EXIT = 5058
- SYS_WAIT4 = 5059
- SYS_KILL = 5060
- SYS_UNAME = 5061
- SYS_SEMGET = 5062
- SYS_SEMOP = 5063
- SYS_SEMCTL = 5064
- SYS_SHMDT = 5065
- SYS_MSGGET = 5066
- SYS_MSGSND = 5067
- SYS_MSGRCV = 5068
- SYS_MSGCTL = 5069
- SYS_FCNTL = 5070
- SYS_FLOCK = 5071
- SYS_FSYNC = 5072
- SYS_FDATASYNC = 5073
- SYS_TRUNCATE = 5074
- SYS_FTRUNCATE = 5075
- SYS_GETDENTS = 5076
- SYS_GETCWD = 5077
- SYS_CHDIR = 5078
- SYS_FCHDIR = 5079
- SYS_RENAME = 5080
- SYS_MKDIR = 5081
- SYS_RMDIR = 5082
- SYS_CREAT = 5083
- SYS_LINK = 5084
- SYS_UNLINK = 5085
- SYS_SYMLINK = 5086
- SYS_READLINK = 5087
- SYS_CHMOD = 5088
- SYS_FCHMOD = 5089
- SYS_CHOWN = 5090
- SYS_FCHOWN = 5091
- SYS_LCHOWN = 5092
- SYS_UMASK = 5093
- SYS_GETTIMEOFDAY = 5094
- SYS_GETRLIMIT = 5095
- SYS_GETRUSAGE = 5096
- SYS_SYSINFO = 5097
- SYS_TIMES = 5098
- SYS_PTRACE = 5099
- SYS_GETUID = 5100
- SYS_SYSLOG = 5101
- SYS_GETGID = 5102
- SYS_SETUID = 5103
- SYS_SETGID = 5104
- SYS_GETEUID = 5105
- SYS_GETEGID = 5106
- SYS_SETPGID = 5107
- SYS_GETPPID = 5108
- SYS_GETPGRP = 5109
- SYS_SETSID = 5110
- SYS_SETREUID = 5111
- SYS_SETREGID = 5112
- SYS_GETGROUPS = 5113
- SYS_SETGROUPS = 5114
- SYS_SETRESUID = 5115
- SYS_GETRESUID = 5116
- SYS_SETRESGID = 5117
- SYS_GETRESGID = 5118
- SYS_GETPGID = 5119
- SYS_SETFSUID = 5120
- SYS_SETFSGID = 5121
- SYS_GETSID = 5122
- SYS_CAPGET = 5123
- SYS_CAPSET = 5124
- SYS_RT_SIGPENDING = 5125
- SYS_RT_SIGTIMEDWAIT = 5126
- SYS_RT_SIGQUEUEINFO = 5127
- SYS_RT_SIGSUSPEND = 5128
- SYS_SIGALTSTACK = 5129
- SYS_UTIME = 5130
- SYS_MKNOD = 5131
- SYS_PERSONALITY = 5132
- SYS_USTAT = 5133
- SYS_STATFS = 5134
- SYS_FSTATFS = 5135
- SYS_SYSFS = 5136
- SYS_GETPRIORITY = 5137
- SYS_SETPRIORITY = 5138
- SYS_SCHED_SETPARAM = 5139
- SYS_SCHED_GETPARAM = 5140
- SYS_SCHED_SETSCHEDULER = 5141
- SYS_SCHED_GETSCHEDULER = 5142
- SYS_SCHED_GET_PRIORITY_MAX = 5143
- SYS_SCHED_GET_PRIORITY_MIN = 5144
- SYS_SCHED_RR_GET_INTERVAL = 5145
- SYS_MLOCK = 5146
- SYS_MUNLOCK = 5147
- SYS_MLOCKALL = 5148
- SYS_MUNLOCKALL = 5149
- SYS_VHANGUP = 5150
- SYS_PIVOT_ROOT = 5151
- SYS__SYSCTL = 5152
- SYS_PRCTL = 5153
- SYS_ADJTIMEX = 5154
- SYS_SETRLIMIT = 5155
- SYS_CHROOT = 5156
- SYS_SYNC = 5157
- SYS_ACCT = 5158
- SYS_SETTIMEOFDAY = 5159
- SYS_MOUNT = 5160
- SYS_UMOUNT2 = 5161
- SYS_SWAPON = 5162
- SYS_SWAPOFF = 5163
- SYS_REBOOT = 5164
- SYS_SETHOSTNAME = 5165
- SYS_SETDOMAINNAME = 5166
- SYS_CREATE_MODULE = 5167
- SYS_INIT_MODULE = 5168
- SYS_DELETE_MODULE = 5169
- SYS_GET_KERNEL_SYMS = 5170
- SYS_QUERY_MODULE = 5171
- SYS_QUOTACTL = 5172
- SYS_NFSSERVCTL = 5173
- SYS_GETPMSG = 5174
- SYS_PUTPMSG = 5175
- SYS_AFS_SYSCALL = 5176
- SYS_RESERVED177 = 5177
- SYS_GETTID = 5178
- SYS_READAHEAD = 5179
- SYS_SETXATTR = 5180
- SYS_LSETXATTR = 5181
- SYS_FSETXATTR = 5182
- SYS_GETXATTR = 5183
- SYS_LGETXATTR = 5184
- SYS_FGETXATTR = 5185
- SYS_LISTXATTR = 5186
- SYS_LLISTXATTR = 5187
- SYS_FLISTXATTR = 5188
- SYS_REMOVEXATTR = 5189
- SYS_LREMOVEXATTR = 5190
- SYS_FREMOVEXATTR = 5191
- SYS_TKILL = 5192
- SYS_RESERVED193 = 5193
- SYS_FUTEX = 5194
- SYS_SCHED_SETAFFINITY = 5195
- SYS_SCHED_GETAFFINITY = 5196
- SYS_CACHEFLUSH = 5197
- SYS_CACHECTL = 5198
- SYS_SYSMIPS = 5199
- SYS_IO_SETUP = 5200
- SYS_IO_DESTROY = 5201
- SYS_IO_GETEVENTS = 5202
- SYS_IO_SUBMIT = 5203
- SYS_IO_CANCEL = 5204
- SYS_EXIT_GROUP = 5205
- SYS_LOOKUP_DCOOKIE = 5206
- SYS_EPOLL_CREATE = 5207
- SYS_EPOLL_CTL = 5208
- SYS_EPOLL_WAIT = 5209
- SYS_REMAP_FILE_PAGES = 5210
- SYS_RT_SIGRETURN = 5211
- SYS_SET_TID_ADDRESS = 5212
- SYS_RESTART_SYSCALL = 5213
- SYS_SEMTIMEDOP = 5214
- SYS_FADVISE64 = 5215
- SYS_TIMER_CREATE = 5216
- SYS_TIMER_SETTIME = 5217
- SYS_TIMER_GETTIME = 5218
- SYS_TIMER_GETOVERRUN = 5219
- SYS_TIMER_DELETE = 5220
- SYS_CLOCK_SETTIME = 5221
- SYS_CLOCK_GETTIME = 5222
- SYS_CLOCK_GETRES = 5223
- SYS_CLOCK_NANOSLEEP = 5224
- SYS_TGKILL = 5225
- SYS_UTIMES = 5226
- SYS_MBIND = 5227
- SYS_GET_MEMPOLICY = 5228
- SYS_SET_MEMPOLICY = 5229
- SYS_MQ_OPEN = 5230
- SYS_MQ_UNLINK = 5231
- SYS_MQ_TIMEDSEND = 5232
- SYS_MQ_TIMEDRECEIVE = 5233
- SYS_MQ_NOTIFY = 5234
- SYS_MQ_GETSETATTR = 5235
- SYS_VSERVER = 5236
- SYS_WAITID = 5237
- SYS_ADD_KEY = 5239
- SYS_REQUEST_KEY = 5240
- SYS_KEYCTL = 5241
- SYS_SET_THREAD_AREA = 5242
- SYS_INOTIFY_INIT = 5243
- SYS_INOTIFY_ADD_WATCH = 5244
- SYS_INOTIFY_RM_WATCH = 5245
- SYS_MIGRATE_PAGES = 5246
- SYS_OPENAT = 5247
- SYS_MKDIRAT = 5248
- SYS_MKNODAT = 5249
- SYS_FCHOWNAT = 5250
- SYS_FUTIMESAT = 5251
- SYS_NEWFSTATAT = 5252
- SYS_UNLINKAT = 5253
- SYS_RENAMEAT = 5254
- SYS_LINKAT = 5255
- SYS_SYMLINKAT = 5256
- SYS_READLINKAT = 5257
- SYS_FCHMODAT = 5258
- SYS_FACCESSAT = 5259
- SYS_PSELECT6 = 5260
- SYS_PPOLL = 5261
- SYS_UNSHARE = 5262
- SYS_SPLICE = 5263
- SYS_SYNC_FILE_RANGE = 5264
- SYS_TEE = 5265
- SYS_VMSPLICE = 5266
- SYS_MOVE_PAGES = 5267
- SYS_SET_ROBUST_LIST = 5268
- SYS_GET_ROBUST_LIST = 5269
- SYS_KEXEC_LOAD = 5270
- SYS_GETCPU = 5271
- SYS_EPOLL_PWAIT = 5272
- SYS_IOPRIO_SET = 5273
- SYS_IOPRIO_GET = 5274
- SYS_UTIMENSAT = 5275
- SYS_SIGNALFD = 5276
- SYS_TIMERFD = 5277
- SYS_EVENTFD = 5278
- SYS_FALLOCATE = 5279
- SYS_TIMERFD_CREATE = 5280
- SYS_TIMERFD_GETTIME = 5281
- SYS_TIMERFD_SETTIME = 5282
- SYS_SIGNALFD4 = 5283
- SYS_EVENTFD2 = 5284
- SYS_EPOLL_CREATE1 = 5285
- SYS_DUP3 = 5286
- SYS_PIPE2 = 5287
- SYS_INOTIFY_INIT1 = 5288
- SYS_PREADV = 5289
- SYS_PWRITEV = 5290
- SYS_RT_TGSIGQUEUEINFO = 5291
- SYS_PERF_EVENT_OPEN = 5292
- SYS_ACCEPT4 = 5293
- SYS_RECVMMSG = 5294
- SYS_FANOTIFY_INIT = 5295
- SYS_FANOTIFY_MARK = 5296
- SYS_PRLIMIT64 = 5297
- SYS_NAME_TO_HANDLE_AT = 5298
- SYS_OPEN_BY_HANDLE_AT = 5299
- SYS_CLOCK_ADJTIME = 5300
- SYS_SYNCFS = 5301
- SYS_SENDMMSG = 5302
- SYS_SETNS = 5303
- SYS_PROCESS_VM_READV = 5304
- SYS_PROCESS_VM_WRITEV = 5305
- SYS_KCMP = 5306
- SYS_FINIT_MODULE = 5307
- SYS_GETDENTS64 = 5308
- SYS_SCHED_SETATTR = 5309
- SYS_SCHED_GETATTR = 5310
- SYS_RENAMEAT2 = 5311
- SYS_SECCOMP = 5312
- SYS_GETRANDOM = 5313
- SYS_MEMFD_CREATE = 5314
- SYS_BPF = 5315
- SYS_EXECVEAT = 5316
- SYS_USERFAULTFD = 5317
- SYS_MEMBARRIER = 5318
- SYS_MLOCK2 = 5319
- SYS_COPY_FILE_RANGE = 5320
- SYS_PREADV2 = 5321
- SYS_PWRITEV2 = 5322
- SYS_PKEY_MPROTECT = 5323
- SYS_PKEY_ALLOC = 5324
- SYS_PKEY_FREE = 5325
- SYS_STATX = 5326
- SYS_RSEQ = 5327
- SYS_IO_PGETEVENTS = 5328
- SYS_PIDFD_SEND_SIGNAL = 5424
- SYS_IO_URING_SETUP = 5425
- SYS_IO_URING_ENTER = 5426
- SYS_IO_URING_REGISTER = 5427
- SYS_OPEN_TREE = 5428
- SYS_MOVE_MOUNT = 5429
- SYS_FSOPEN = 5430
- SYS_FSCONFIG = 5431
- SYS_FSMOUNT = 5432
- SYS_FSPICK = 5433
- SYS_PIDFD_OPEN = 5434
- SYS_CLONE3 = 5435
- SYS_CLOSE_RANGE = 5436
- SYS_OPENAT2 = 5437
- SYS_PIDFD_GETFD = 5438
- SYS_FACCESSAT2 = 5439
- SYS_PROCESS_MADVISE = 5440
- SYS_EPOLL_PWAIT2 = 5441
+ SYS_READ = 5000
+ SYS_WRITE = 5001
+ SYS_OPEN = 5002
+ SYS_CLOSE = 5003
+ SYS_STAT = 5004
+ SYS_FSTAT = 5005
+ SYS_LSTAT = 5006
+ SYS_POLL = 5007
+ SYS_LSEEK = 5008
+ SYS_MMAP = 5009
+ SYS_MPROTECT = 5010
+ SYS_MUNMAP = 5011
+ SYS_BRK = 5012
+ SYS_RT_SIGACTION = 5013
+ SYS_RT_SIGPROCMASK = 5014
+ SYS_IOCTL = 5015
+ SYS_PREAD64 = 5016
+ SYS_PWRITE64 = 5017
+ SYS_READV = 5018
+ SYS_WRITEV = 5019
+ SYS_ACCESS = 5020
+ SYS_PIPE = 5021
+ SYS__NEWSELECT = 5022
+ SYS_SCHED_YIELD = 5023
+ SYS_MREMAP = 5024
+ SYS_MSYNC = 5025
+ SYS_MINCORE = 5026
+ SYS_MADVISE = 5027
+ SYS_SHMGET = 5028
+ SYS_SHMAT = 5029
+ SYS_SHMCTL = 5030
+ SYS_DUP = 5031
+ SYS_DUP2 = 5032
+ SYS_PAUSE = 5033
+ SYS_NANOSLEEP = 5034
+ SYS_GETITIMER = 5035
+ SYS_SETITIMER = 5036
+ SYS_ALARM = 5037
+ SYS_GETPID = 5038
+ SYS_SENDFILE = 5039
+ SYS_SOCKET = 5040
+ SYS_CONNECT = 5041
+ SYS_ACCEPT = 5042
+ SYS_SENDTO = 5043
+ SYS_RECVFROM = 5044
+ SYS_SENDMSG = 5045
+ SYS_RECVMSG = 5046
+ SYS_SHUTDOWN = 5047
+ SYS_BIND = 5048
+ SYS_LISTEN = 5049
+ SYS_GETSOCKNAME = 5050
+ SYS_GETPEERNAME = 5051
+ SYS_SOCKETPAIR = 5052
+ SYS_SETSOCKOPT = 5053
+ SYS_GETSOCKOPT = 5054
+ SYS_CLONE = 5055
+ SYS_FORK = 5056
+ SYS_EXECVE = 5057
+ SYS_EXIT = 5058
+ SYS_WAIT4 = 5059
+ SYS_KILL = 5060
+ SYS_UNAME = 5061
+ SYS_SEMGET = 5062
+ SYS_SEMOP = 5063
+ SYS_SEMCTL = 5064
+ SYS_SHMDT = 5065
+ SYS_MSGGET = 5066
+ SYS_MSGSND = 5067
+ SYS_MSGRCV = 5068
+ SYS_MSGCTL = 5069
+ SYS_FCNTL = 5070
+ SYS_FLOCK = 5071
+ SYS_FSYNC = 5072
+ SYS_FDATASYNC = 5073
+ SYS_TRUNCATE = 5074
+ SYS_FTRUNCATE = 5075
+ SYS_GETDENTS = 5076
+ SYS_GETCWD = 5077
+ SYS_CHDIR = 5078
+ SYS_FCHDIR = 5079
+ SYS_RENAME = 5080
+ SYS_MKDIR = 5081
+ SYS_RMDIR = 5082
+ SYS_CREAT = 5083
+ SYS_LINK = 5084
+ SYS_UNLINK = 5085
+ SYS_SYMLINK = 5086
+ SYS_READLINK = 5087
+ SYS_CHMOD = 5088
+ SYS_FCHMOD = 5089
+ SYS_CHOWN = 5090
+ SYS_FCHOWN = 5091
+ SYS_LCHOWN = 5092
+ SYS_UMASK = 5093
+ SYS_GETTIMEOFDAY = 5094
+ SYS_GETRLIMIT = 5095
+ SYS_GETRUSAGE = 5096
+ SYS_SYSINFO = 5097
+ SYS_TIMES = 5098
+ SYS_PTRACE = 5099
+ SYS_GETUID = 5100
+ SYS_SYSLOG = 5101
+ SYS_GETGID = 5102
+ SYS_SETUID = 5103
+ SYS_SETGID = 5104
+ SYS_GETEUID = 5105
+ SYS_GETEGID = 5106
+ SYS_SETPGID = 5107
+ SYS_GETPPID = 5108
+ SYS_GETPGRP = 5109
+ SYS_SETSID = 5110
+ SYS_SETREUID = 5111
+ SYS_SETREGID = 5112
+ SYS_GETGROUPS = 5113
+ SYS_SETGROUPS = 5114
+ SYS_SETRESUID = 5115
+ SYS_GETRESUID = 5116
+ SYS_SETRESGID = 5117
+ SYS_GETRESGID = 5118
+ SYS_GETPGID = 5119
+ SYS_SETFSUID = 5120
+ SYS_SETFSGID = 5121
+ SYS_GETSID = 5122
+ SYS_CAPGET = 5123
+ SYS_CAPSET = 5124
+ SYS_RT_SIGPENDING = 5125
+ SYS_RT_SIGTIMEDWAIT = 5126
+ SYS_RT_SIGQUEUEINFO = 5127
+ SYS_RT_SIGSUSPEND = 5128
+ SYS_SIGALTSTACK = 5129
+ SYS_UTIME = 5130
+ SYS_MKNOD = 5131
+ SYS_PERSONALITY = 5132
+ SYS_USTAT = 5133
+ SYS_STATFS = 5134
+ SYS_FSTATFS = 5135
+ SYS_SYSFS = 5136
+ SYS_GETPRIORITY = 5137
+ SYS_SETPRIORITY = 5138
+ SYS_SCHED_SETPARAM = 5139
+ SYS_SCHED_GETPARAM = 5140
+ SYS_SCHED_SETSCHEDULER = 5141
+ SYS_SCHED_GETSCHEDULER = 5142
+ SYS_SCHED_GET_PRIORITY_MAX = 5143
+ SYS_SCHED_GET_PRIORITY_MIN = 5144
+ SYS_SCHED_RR_GET_INTERVAL = 5145
+ SYS_MLOCK = 5146
+ SYS_MUNLOCK = 5147
+ SYS_MLOCKALL = 5148
+ SYS_MUNLOCKALL = 5149
+ SYS_VHANGUP = 5150
+ SYS_PIVOT_ROOT = 5151
+ SYS__SYSCTL = 5152
+ SYS_PRCTL = 5153
+ SYS_ADJTIMEX = 5154
+ SYS_SETRLIMIT = 5155
+ SYS_CHROOT = 5156
+ SYS_SYNC = 5157
+ SYS_ACCT = 5158
+ SYS_SETTIMEOFDAY = 5159
+ SYS_MOUNT = 5160
+ SYS_UMOUNT2 = 5161
+ SYS_SWAPON = 5162
+ SYS_SWAPOFF = 5163
+ SYS_REBOOT = 5164
+ SYS_SETHOSTNAME = 5165
+ SYS_SETDOMAINNAME = 5166
+ SYS_CREATE_MODULE = 5167
+ SYS_INIT_MODULE = 5168
+ SYS_DELETE_MODULE = 5169
+ SYS_GET_KERNEL_SYMS = 5170
+ SYS_QUERY_MODULE = 5171
+ SYS_QUOTACTL = 5172
+ SYS_NFSSERVCTL = 5173
+ SYS_GETPMSG = 5174
+ SYS_PUTPMSG = 5175
+ SYS_AFS_SYSCALL = 5176
+ SYS_RESERVED177 = 5177
+ SYS_GETTID = 5178
+ SYS_READAHEAD = 5179
+ SYS_SETXATTR = 5180
+ SYS_LSETXATTR = 5181
+ SYS_FSETXATTR = 5182
+ SYS_GETXATTR = 5183
+ SYS_LGETXATTR = 5184
+ SYS_FGETXATTR = 5185
+ SYS_LISTXATTR = 5186
+ SYS_LLISTXATTR = 5187
+ SYS_FLISTXATTR = 5188
+ SYS_REMOVEXATTR = 5189
+ SYS_LREMOVEXATTR = 5190
+ SYS_FREMOVEXATTR = 5191
+ SYS_TKILL = 5192
+ SYS_RESERVED193 = 5193
+ SYS_FUTEX = 5194
+ SYS_SCHED_SETAFFINITY = 5195
+ SYS_SCHED_GETAFFINITY = 5196
+ SYS_CACHEFLUSH = 5197
+ SYS_CACHECTL = 5198
+ SYS_SYSMIPS = 5199
+ SYS_IO_SETUP = 5200
+ SYS_IO_DESTROY = 5201
+ SYS_IO_GETEVENTS = 5202
+ SYS_IO_SUBMIT = 5203
+ SYS_IO_CANCEL = 5204
+ SYS_EXIT_GROUP = 5205
+ SYS_LOOKUP_DCOOKIE = 5206
+ SYS_EPOLL_CREATE = 5207
+ SYS_EPOLL_CTL = 5208
+ SYS_EPOLL_WAIT = 5209
+ SYS_REMAP_FILE_PAGES = 5210
+ SYS_RT_SIGRETURN = 5211
+ SYS_SET_TID_ADDRESS = 5212
+ SYS_RESTART_SYSCALL = 5213
+ SYS_SEMTIMEDOP = 5214
+ SYS_FADVISE64 = 5215
+ SYS_TIMER_CREATE = 5216
+ SYS_TIMER_SETTIME = 5217
+ SYS_TIMER_GETTIME = 5218
+ SYS_TIMER_GETOVERRUN = 5219
+ SYS_TIMER_DELETE = 5220
+ SYS_CLOCK_SETTIME = 5221
+ SYS_CLOCK_GETTIME = 5222
+ SYS_CLOCK_GETRES = 5223
+ SYS_CLOCK_NANOSLEEP = 5224
+ SYS_TGKILL = 5225
+ SYS_UTIMES = 5226
+ SYS_MBIND = 5227
+ SYS_GET_MEMPOLICY = 5228
+ SYS_SET_MEMPOLICY = 5229
+ SYS_MQ_OPEN = 5230
+ SYS_MQ_UNLINK = 5231
+ SYS_MQ_TIMEDSEND = 5232
+ SYS_MQ_TIMEDRECEIVE = 5233
+ SYS_MQ_NOTIFY = 5234
+ SYS_MQ_GETSETATTR = 5235
+ SYS_VSERVER = 5236
+ SYS_WAITID = 5237
+ SYS_ADD_KEY = 5239
+ SYS_REQUEST_KEY = 5240
+ SYS_KEYCTL = 5241
+ SYS_SET_THREAD_AREA = 5242
+ SYS_INOTIFY_INIT = 5243
+ SYS_INOTIFY_ADD_WATCH = 5244
+ SYS_INOTIFY_RM_WATCH = 5245
+ SYS_MIGRATE_PAGES = 5246
+ SYS_OPENAT = 5247
+ SYS_MKDIRAT = 5248
+ SYS_MKNODAT = 5249
+ SYS_FCHOWNAT = 5250
+ SYS_FUTIMESAT = 5251
+ SYS_NEWFSTATAT = 5252
+ SYS_UNLINKAT = 5253
+ SYS_RENAMEAT = 5254
+ SYS_LINKAT = 5255
+ SYS_SYMLINKAT = 5256
+ SYS_READLINKAT = 5257
+ SYS_FCHMODAT = 5258
+ SYS_FACCESSAT = 5259
+ SYS_PSELECT6 = 5260
+ SYS_PPOLL = 5261
+ SYS_UNSHARE = 5262
+ SYS_SPLICE = 5263
+ SYS_SYNC_FILE_RANGE = 5264
+ SYS_TEE = 5265
+ SYS_VMSPLICE = 5266
+ SYS_MOVE_PAGES = 5267
+ SYS_SET_ROBUST_LIST = 5268
+ SYS_GET_ROBUST_LIST = 5269
+ SYS_KEXEC_LOAD = 5270
+ SYS_GETCPU = 5271
+ SYS_EPOLL_PWAIT = 5272
+ SYS_IOPRIO_SET = 5273
+ SYS_IOPRIO_GET = 5274
+ SYS_UTIMENSAT = 5275
+ SYS_SIGNALFD = 5276
+ SYS_TIMERFD = 5277
+ SYS_EVENTFD = 5278
+ SYS_FALLOCATE = 5279
+ SYS_TIMERFD_CREATE = 5280
+ SYS_TIMERFD_GETTIME = 5281
+ SYS_TIMERFD_SETTIME = 5282
+ SYS_SIGNALFD4 = 5283
+ SYS_EVENTFD2 = 5284
+ SYS_EPOLL_CREATE1 = 5285
+ SYS_DUP3 = 5286
+ SYS_PIPE2 = 5287
+ SYS_INOTIFY_INIT1 = 5288
+ SYS_PREADV = 5289
+ SYS_PWRITEV = 5290
+ SYS_RT_TGSIGQUEUEINFO = 5291
+ SYS_PERF_EVENT_OPEN = 5292
+ SYS_ACCEPT4 = 5293
+ SYS_RECVMMSG = 5294
+ SYS_FANOTIFY_INIT = 5295
+ SYS_FANOTIFY_MARK = 5296
+ SYS_PRLIMIT64 = 5297
+ SYS_NAME_TO_HANDLE_AT = 5298
+ SYS_OPEN_BY_HANDLE_AT = 5299
+ SYS_CLOCK_ADJTIME = 5300
+ SYS_SYNCFS = 5301
+ SYS_SENDMMSG = 5302
+ SYS_SETNS = 5303
+ SYS_PROCESS_VM_READV = 5304
+ SYS_PROCESS_VM_WRITEV = 5305
+ SYS_KCMP = 5306
+ SYS_FINIT_MODULE = 5307
+ SYS_GETDENTS64 = 5308
+ SYS_SCHED_SETATTR = 5309
+ SYS_SCHED_GETATTR = 5310
+ SYS_RENAMEAT2 = 5311
+ SYS_SECCOMP = 5312
+ SYS_GETRANDOM = 5313
+ SYS_MEMFD_CREATE = 5314
+ SYS_BPF = 5315
+ SYS_EXECVEAT = 5316
+ SYS_USERFAULTFD = 5317
+ SYS_MEMBARRIER = 5318
+ SYS_MLOCK2 = 5319
+ SYS_COPY_FILE_RANGE = 5320
+ SYS_PREADV2 = 5321
+ SYS_PWRITEV2 = 5322
+ SYS_PKEY_MPROTECT = 5323
+ SYS_PKEY_ALLOC = 5324
+ SYS_PKEY_FREE = 5325
+ SYS_STATX = 5326
+ SYS_RSEQ = 5327
+ SYS_IO_PGETEVENTS = 5328
+ SYS_PIDFD_SEND_SIGNAL = 5424
+ SYS_IO_URING_SETUP = 5425
+ SYS_IO_URING_ENTER = 5426
+ SYS_IO_URING_REGISTER = 5427
+ SYS_OPEN_TREE = 5428
+ SYS_MOVE_MOUNT = 5429
+ SYS_FSOPEN = 5430
+ SYS_FSCONFIG = 5431
+ SYS_FSMOUNT = 5432
+ SYS_FSPICK = 5433
+ SYS_PIDFD_OPEN = 5434
+ SYS_CLONE3 = 5435
+ SYS_CLOSE_RANGE = 5436
+ SYS_OPENAT2 = 5437
+ SYS_PIDFD_GETFD = 5438
+ SYS_FACCESSAT2 = 5439
+ SYS_PROCESS_MADVISE = 5440
+ SYS_EPOLL_PWAIT2 = 5441
+ SYS_MOUNT_SETATTR = 5442
+ SYS_QUOTACTL_FD = 5443
+ SYS_LANDLOCK_CREATE_RULESET = 5444
+ SYS_LANDLOCK_ADD_RULE = 5445
+ SYS_LANDLOCK_RESTRICT_SELF = 5446
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
index 208d5dcd5..45082dd67 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
@@ -7,350 +7,355 @@
package unix
const (
- SYS_READ = 5000
- SYS_WRITE = 5001
- SYS_OPEN = 5002
- SYS_CLOSE = 5003
- SYS_STAT = 5004
- SYS_FSTAT = 5005
- SYS_LSTAT = 5006
- SYS_POLL = 5007
- SYS_LSEEK = 5008
- SYS_MMAP = 5009
- SYS_MPROTECT = 5010
- SYS_MUNMAP = 5011
- SYS_BRK = 5012
- SYS_RT_SIGACTION = 5013
- SYS_RT_SIGPROCMASK = 5014
- SYS_IOCTL = 5015
- SYS_PREAD64 = 5016
- SYS_PWRITE64 = 5017
- SYS_READV = 5018
- SYS_WRITEV = 5019
- SYS_ACCESS = 5020
- SYS_PIPE = 5021
- SYS__NEWSELECT = 5022
- SYS_SCHED_YIELD = 5023
- SYS_MREMAP = 5024
- SYS_MSYNC = 5025
- SYS_MINCORE = 5026
- SYS_MADVISE = 5027
- SYS_SHMGET = 5028
- SYS_SHMAT = 5029
- SYS_SHMCTL = 5030
- SYS_DUP = 5031
- SYS_DUP2 = 5032
- SYS_PAUSE = 5033
- SYS_NANOSLEEP = 5034
- SYS_GETITIMER = 5035
- SYS_SETITIMER = 5036
- SYS_ALARM = 5037
- SYS_GETPID = 5038
- SYS_SENDFILE = 5039
- SYS_SOCKET = 5040
- SYS_CONNECT = 5041
- SYS_ACCEPT = 5042
- SYS_SENDTO = 5043
- SYS_RECVFROM = 5044
- SYS_SENDMSG = 5045
- SYS_RECVMSG = 5046
- SYS_SHUTDOWN = 5047
- SYS_BIND = 5048
- SYS_LISTEN = 5049
- SYS_GETSOCKNAME = 5050
- SYS_GETPEERNAME = 5051
- SYS_SOCKETPAIR = 5052
- SYS_SETSOCKOPT = 5053
- SYS_GETSOCKOPT = 5054
- SYS_CLONE = 5055
- SYS_FORK = 5056
- SYS_EXECVE = 5057
- SYS_EXIT = 5058
- SYS_WAIT4 = 5059
- SYS_KILL = 5060
- SYS_UNAME = 5061
- SYS_SEMGET = 5062
- SYS_SEMOP = 5063
- SYS_SEMCTL = 5064
- SYS_SHMDT = 5065
- SYS_MSGGET = 5066
- SYS_MSGSND = 5067
- SYS_MSGRCV = 5068
- SYS_MSGCTL = 5069
- SYS_FCNTL = 5070
- SYS_FLOCK = 5071
- SYS_FSYNC = 5072
- SYS_FDATASYNC = 5073
- SYS_TRUNCATE = 5074
- SYS_FTRUNCATE = 5075
- SYS_GETDENTS = 5076
- SYS_GETCWD = 5077
- SYS_CHDIR = 5078
- SYS_FCHDIR = 5079
- SYS_RENAME = 5080
- SYS_MKDIR = 5081
- SYS_RMDIR = 5082
- SYS_CREAT = 5083
- SYS_LINK = 5084
- SYS_UNLINK = 5085
- SYS_SYMLINK = 5086
- SYS_READLINK = 5087
- SYS_CHMOD = 5088
- SYS_FCHMOD = 5089
- SYS_CHOWN = 5090
- SYS_FCHOWN = 5091
- SYS_LCHOWN = 5092
- SYS_UMASK = 5093
- SYS_GETTIMEOFDAY = 5094
- SYS_GETRLIMIT = 5095
- SYS_GETRUSAGE = 5096
- SYS_SYSINFO = 5097
- SYS_TIMES = 5098
- SYS_PTRACE = 5099
- SYS_GETUID = 5100
- SYS_SYSLOG = 5101
- SYS_GETGID = 5102
- SYS_SETUID = 5103
- SYS_SETGID = 5104
- SYS_GETEUID = 5105
- SYS_GETEGID = 5106
- SYS_SETPGID = 5107
- SYS_GETPPID = 5108
- SYS_GETPGRP = 5109
- SYS_SETSID = 5110
- SYS_SETREUID = 5111
- SYS_SETREGID = 5112
- SYS_GETGROUPS = 5113
- SYS_SETGROUPS = 5114
- SYS_SETRESUID = 5115
- SYS_GETRESUID = 5116
- SYS_SETRESGID = 5117
- SYS_GETRESGID = 5118
- SYS_GETPGID = 5119
- SYS_SETFSUID = 5120
- SYS_SETFSGID = 5121
- SYS_GETSID = 5122
- SYS_CAPGET = 5123
- SYS_CAPSET = 5124
- SYS_RT_SIGPENDING = 5125
- SYS_RT_SIGTIMEDWAIT = 5126
- SYS_RT_SIGQUEUEINFO = 5127
- SYS_RT_SIGSUSPEND = 5128
- SYS_SIGALTSTACK = 5129
- SYS_UTIME = 5130
- SYS_MKNOD = 5131
- SYS_PERSONALITY = 5132
- SYS_USTAT = 5133
- SYS_STATFS = 5134
- SYS_FSTATFS = 5135
- SYS_SYSFS = 5136
- SYS_GETPRIORITY = 5137
- SYS_SETPRIORITY = 5138
- SYS_SCHED_SETPARAM = 5139
- SYS_SCHED_GETPARAM = 5140
- SYS_SCHED_SETSCHEDULER = 5141
- SYS_SCHED_GETSCHEDULER = 5142
- SYS_SCHED_GET_PRIORITY_MAX = 5143
- SYS_SCHED_GET_PRIORITY_MIN = 5144
- SYS_SCHED_RR_GET_INTERVAL = 5145
- SYS_MLOCK = 5146
- SYS_MUNLOCK = 5147
- SYS_MLOCKALL = 5148
- SYS_MUNLOCKALL = 5149
- SYS_VHANGUP = 5150
- SYS_PIVOT_ROOT = 5151
- SYS__SYSCTL = 5152
- SYS_PRCTL = 5153
- SYS_ADJTIMEX = 5154
- SYS_SETRLIMIT = 5155
- SYS_CHROOT = 5156
- SYS_SYNC = 5157
- SYS_ACCT = 5158
- SYS_SETTIMEOFDAY = 5159
- SYS_MOUNT = 5160
- SYS_UMOUNT2 = 5161
- SYS_SWAPON = 5162
- SYS_SWAPOFF = 5163
- SYS_REBOOT = 5164
- SYS_SETHOSTNAME = 5165
- SYS_SETDOMAINNAME = 5166
- SYS_CREATE_MODULE = 5167
- SYS_INIT_MODULE = 5168
- SYS_DELETE_MODULE = 5169
- SYS_GET_KERNEL_SYMS = 5170
- SYS_QUERY_MODULE = 5171
- SYS_QUOTACTL = 5172
- SYS_NFSSERVCTL = 5173
- SYS_GETPMSG = 5174
- SYS_PUTPMSG = 5175
- SYS_AFS_SYSCALL = 5176
- SYS_RESERVED177 = 5177
- SYS_GETTID = 5178
- SYS_READAHEAD = 5179
- SYS_SETXATTR = 5180
- SYS_LSETXATTR = 5181
- SYS_FSETXATTR = 5182
- SYS_GETXATTR = 5183
- SYS_LGETXATTR = 5184
- SYS_FGETXATTR = 5185
- SYS_LISTXATTR = 5186
- SYS_LLISTXATTR = 5187
- SYS_FLISTXATTR = 5188
- SYS_REMOVEXATTR = 5189
- SYS_LREMOVEXATTR = 5190
- SYS_FREMOVEXATTR = 5191
- SYS_TKILL = 5192
- SYS_RESERVED193 = 5193
- SYS_FUTEX = 5194
- SYS_SCHED_SETAFFINITY = 5195
- SYS_SCHED_GETAFFINITY = 5196
- SYS_CACHEFLUSH = 5197
- SYS_CACHECTL = 5198
- SYS_SYSMIPS = 5199
- SYS_IO_SETUP = 5200
- SYS_IO_DESTROY = 5201
- SYS_IO_GETEVENTS = 5202
- SYS_IO_SUBMIT = 5203
- SYS_IO_CANCEL = 5204
- SYS_EXIT_GROUP = 5205
- SYS_LOOKUP_DCOOKIE = 5206
- SYS_EPOLL_CREATE = 5207
- SYS_EPOLL_CTL = 5208
- SYS_EPOLL_WAIT = 5209
- SYS_REMAP_FILE_PAGES = 5210
- SYS_RT_SIGRETURN = 5211
- SYS_SET_TID_ADDRESS = 5212
- SYS_RESTART_SYSCALL = 5213
- SYS_SEMTIMEDOP = 5214
- SYS_FADVISE64 = 5215
- SYS_TIMER_CREATE = 5216
- SYS_TIMER_SETTIME = 5217
- SYS_TIMER_GETTIME = 5218
- SYS_TIMER_GETOVERRUN = 5219
- SYS_TIMER_DELETE = 5220
- SYS_CLOCK_SETTIME = 5221
- SYS_CLOCK_GETTIME = 5222
- SYS_CLOCK_GETRES = 5223
- SYS_CLOCK_NANOSLEEP = 5224
- SYS_TGKILL = 5225
- SYS_UTIMES = 5226
- SYS_MBIND = 5227
- SYS_GET_MEMPOLICY = 5228
- SYS_SET_MEMPOLICY = 5229
- SYS_MQ_OPEN = 5230
- SYS_MQ_UNLINK = 5231
- SYS_MQ_TIMEDSEND = 5232
- SYS_MQ_TIMEDRECEIVE = 5233
- SYS_MQ_NOTIFY = 5234
- SYS_MQ_GETSETATTR = 5235
- SYS_VSERVER = 5236
- SYS_WAITID = 5237
- SYS_ADD_KEY = 5239
- SYS_REQUEST_KEY = 5240
- SYS_KEYCTL = 5241
- SYS_SET_THREAD_AREA = 5242
- SYS_INOTIFY_INIT = 5243
- SYS_INOTIFY_ADD_WATCH = 5244
- SYS_INOTIFY_RM_WATCH = 5245
- SYS_MIGRATE_PAGES = 5246
- SYS_OPENAT = 5247
- SYS_MKDIRAT = 5248
- SYS_MKNODAT = 5249
- SYS_FCHOWNAT = 5250
- SYS_FUTIMESAT = 5251
- SYS_NEWFSTATAT = 5252
- SYS_UNLINKAT = 5253
- SYS_RENAMEAT = 5254
- SYS_LINKAT = 5255
- SYS_SYMLINKAT = 5256
- SYS_READLINKAT = 5257
- SYS_FCHMODAT = 5258
- SYS_FACCESSAT = 5259
- SYS_PSELECT6 = 5260
- SYS_PPOLL = 5261
- SYS_UNSHARE = 5262
- SYS_SPLICE = 5263
- SYS_SYNC_FILE_RANGE = 5264
- SYS_TEE = 5265
- SYS_VMSPLICE = 5266
- SYS_MOVE_PAGES = 5267
- SYS_SET_ROBUST_LIST = 5268
- SYS_GET_ROBUST_LIST = 5269
- SYS_KEXEC_LOAD = 5270
- SYS_GETCPU = 5271
- SYS_EPOLL_PWAIT = 5272
- SYS_IOPRIO_SET = 5273
- SYS_IOPRIO_GET = 5274
- SYS_UTIMENSAT = 5275
- SYS_SIGNALFD = 5276
- SYS_TIMERFD = 5277
- SYS_EVENTFD = 5278
- SYS_FALLOCATE = 5279
- SYS_TIMERFD_CREATE = 5280
- SYS_TIMERFD_GETTIME = 5281
- SYS_TIMERFD_SETTIME = 5282
- SYS_SIGNALFD4 = 5283
- SYS_EVENTFD2 = 5284
- SYS_EPOLL_CREATE1 = 5285
- SYS_DUP3 = 5286
- SYS_PIPE2 = 5287
- SYS_INOTIFY_INIT1 = 5288
- SYS_PREADV = 5289
- SYS_PWRITEV = 5290
- SYS_RT_TGSIGQUEUEINFO = 5291
- SYS_PERF_EVENT_OPEN = 5292
- SYS_ACCEPT4 = 5293
- SYS_RECVMMSG = 5294
- SYS_FANOTIFY_INIT = 5295
- SYS_FANOTIFY_MARK = 5296
- SYS_PRLIMIT64 = 5297
- SYS_NAME_TO_HANDLE_AT = 5298
- SYS_OPEN_BY_HANDLE_AT = 5299
- SYS_CLOCK_ADJTIME = 5300
- SYS_SYNCFS = 5301
- SYS_SENDMMSG = 5302
- SYS_SETNS = 5303
- SYS_PROCESS_VM_READV = 5304
- SYS_PROCESS_VM_WRITEV = 5305
- SYS_KCMP = 5306
- SYS_FINIT_MODULE = 5307
- SYS_GETDENTS64 = 5308
- SYS_SCHED_SETATTR = 5309
- SYS_SCHED_GETATTR = 5310
- SYS_RENAMEAT2 = 5311
- SYS_SECCOMP = 5312
- SYS_GETRANDOM = 5313
- SYS_MEMFD_CREATE = 5314
- SYS_BPF = 5315
- SYS_EXECVEAT = 5316
- SYS_USERFAULTFD = 5317
- SYS_MEMBARRIER = 5318
- SYS_MLOCK2 = 5319
- SYS_COPY_FILE_RANGE = 5320
- SYS_PREADV2 = 5321
- SYS_PWRITEV2 = 5322
- SYS_PKEY_MPROTECT = 5323
- SYS_PKEY_ALLOC = 5324
- SYS_PKEY_FREE = 5325
- SYS_STATX = 5326
- SYS_RSEQ = 5327
- SYS_IO_PGETEVENTS = 5328
- SYS_PIDFD_SEND_SIGNAL = 5424
- SYS_IO_URING_SETUP = 5425
- SYS_IO_URING_ENTER = 5426
- SYS_IO_URING_REGISTER = 5427
- SYS_OPEN_TREE = 5428
- SYS_MOVE_MOUNT = 5429
- SYS_FSOPEN = 5430
- SYS_FSCONFIG = 5431
- SYS_FSMOUNT = 5432
- SYS_FSPICK = 5433
- SYS_PIDFD_OPEN = 5434
- SYS_CLONE3 = 5435
- SYS_CLOSE_RANGE = 5436
- SYS_OPENAT2 = 5437
- SYS_PIDFD_GETFD = 5438
- SYS_FACCESSAT2 = 5439
- SYS_PROCESS_MADVISE = 5440
- SYS_EPOLL_PWAIT2 = 5441
+ SYS_READ = 5000
+ SYS_WRITE = 5001
+ SYS_OPEN = 5002
+ SYS_CLOSE = 5003
+ SYS_STAT = 5004
+ SYS_FSTAT = 5005
+ SYS_LSTAT = 5006
+ SYS_POLL = 5007
+ SYS_LSEEK = 5008
+ SYS_MMAP = 5009
+ SYS_MPROTECT = 5010
+ SYS_MUNMAP = 5011
+ SYS_BRK = 5012
+ SYS_RT_SIGACTION = 5013
+ SYS_RT_SIGPROCMASK = 5014
+ SYS_IOCTL = 5015
+ SYS_PREAD64 = 5016
+ SYS_PWRITE64 = 5017
+ SYS_READV = 5018
+ SYS_WRITEV = 5019
+ SYS_ACCESS = 5020
+ SYS_PIPE = 5021
+ SYS__NEWSELECT = 5022
+ SYS_SCHED_YIELD = 5023
+ SYS_MREMAP = 5024
+ SYS_MSYNC = 5025
+ SYS_MINCORE = 5026
+ SYS_MADVISE = 5027
+ SYS_SHMGET = 5028
+ SYS_SHMAT = 5029
+ SYS_SHMCTL = 5030
+ SYS_DUP = 5031
+ SYS_DUP2 = 5032
+ SYS_PAUSE = 5033
+ SYS_NANOSLEEP = 5034
+ SYS_GETITIMER = 5035
+ SYS_SETITIMER = 5036
+ SYS_ALARM = 5037
+ SYS_GETPID = 5038
+ SYS_SENDFILE = 5039
+ SYS_SOCKET = 5040
+ SYS_CONNECT = 5041
+ SYS_ACCEPT = 5042
+ SYS_SENDTO = 5043
+ SYS_RECVFROM = 5044
+ SYS_SENDMSG = 5045
+ SYS_RECVMSG = 5046
+ SYS_SHUTDOWN = 5047
+ SYS_BIND = 5048
+ SYS_LISTEN = 5049
+ SYS_GETSOCKNAME = 5050
+ SYS_GETPEERNAME = 5051
+ SYS_SOCKETPAIR = 5052
+ SYS_SETSOCKOPT = 5053
+ SYS_GETSOCKOPT = 5054
+ SYS_CLONE = 5055
+ SYS_FORK = 5056
+ SYS_EXECVE = 5057
+ SYS_EXIT = 5058
+ SYS_WAIT4 = 5059
+ SYS_KILL = 5060
+ SYS_UNAME = 5061
+ SYS_SEMGET = 5062
+ SYS_SEMOP = 5063
+ SYS_SEMCTL = 5064
+ SYS_SHMDT = 5065
+ SYS_MSGGET = 5066
+ SYS_MSGSND = 5067
+ SYS_MSGRCV = 5068
+ SYS_MSGCTL = 5069
+ SYS_FCNTL = 5070
+ SYS_FLOCK = 5071
+ SYS_FSYNC = 5072
+ SYS_FDATASYNC = 5073
+ SYS_TRUNCATE = 5074
+ SYS_FTRUNCATE = 5075
+ SYS_GETDENTS = 5076
+ SYS_GETCWD = 5077
+ SYS_CHDIR = 5078
+ SYS_FCHDIR = 5079
+ SYS_RENAME = 5080
+ SYS_MKDIR = 5081
+ SYS_RMDIR = 5082
+ SYS_CREAT = 5083
+ SYS_LINK = 5084
+ SYS_UNLINK = 5085
+ SYS_SYMLINK = 5086
+ SYS_READLINK = 5087
+ SYS_CHMOD = 5088
+ SYS_FCHMOD = 5089
+ SYS_CHOWN = 5090
+ SYS_FCHOWN = 5091
+ SYS_LCHOWN = 5092
+ SYS_UMASK = 5093
+ SYS_GETTIMEOFDAY = 5094
+ SYS_GETRLIMIT = 5095
+ SYS_GETRUSAGE = 5096
+ SYS_SYSINFO = 5097
+ SYS_TIMES = 5098
+ SYS_PTRACE = 5099
+ SYS_GETUID = 5100
+ SYS_SYSLOG = 5101
+ SYS_GETGID = 5102
+ SYS_SETUID = 5103
+ SYS_SETGID = 5104
+ SYS_GETEUID = 5105
+ SYS_GETEGID = 5106
+ SYS_SETPGID = 5107
+ SYS_GETPPID = 5108
+ SYS_GETPGRP = 5109
+ SYS_SETSID = 5110
+ SYS_SETREUID = 5111
+ SYS_SETREGID = 5112
+ SYS_GETGROUPS = 5113
+ SYS_SETGROUPS = 5114
+ SYS_SETRESUID = 5115
+ SYS_GETRESUID = 5116
+ SYS_SETRESGID = 5117
+ SYS_GETRESGID = 5118
+ SYS_GETPGID = 5119
+ SYS_SETFSUID = 5120
+ SYS_SETFSGID = 5121
+ SYS_GETSID = 5122
+ SYS_CAPGET = 5123
+ SYS_CAPSET = 5124
+ SYS_RT_SIGPENDING = 5125
+ SYS_RT_SIGTIMEDWAIT = 5126
+ SYS_RT_SIGQUEUEINFO = 5127
+ SYS_RT_SIGSUSPEND = 5128
+ SYS_SIGALTSTACK = 5129
+ SYS_UTIME = 5130
+ SYS_MKNOD = 5131
+ SYS_PERSONALITY = 5132
+ SYS_USTAT = 5133
+ SYS_STATFS = 5134
+ SYS_FSTATFS = 5135
+ SYS_SYSFS = 5136
+ SYS_GETPRIORITY = 5137
+ SYS_SETPRIORITY = 5138
+ SYS_SCHED_SETPARAM = 5139
+ SYS_SCHED_GETPARAM = 5140
+ SYS_SCHED_SETSCHEDULER = 5141
+ SYS_SCHED_GETSCHEDULER = 5142
+ SYS_SCHED_GET_PRIORITY_MAX = 5143
+ SYS_SCHED_GET_PRIORITY_MIN = 5144
+ SYS_SCHED_RR_GET_INTERVAL = 5145
+ SYS_MLOCK = 5146
+ SYS_MUNLOCK = 5147
+ SYS_MLOCKALL = 5148
+ SYS_MUNLOCKALL = 5149
+ SYS_VHANGUP = 5150
+ SYS_PIVOT_ROOT = 5151
+ SYS__SYSCTL = 5152
+ SYS_PRCTL = 5153
+ SYS_ADJTIMEX = 5154
+ SYS_SETRLIMIT = 5155
+ SYS_CHROOT = 5156
+ SYS_SYNC = 5157
+ SYS_ACCT = 5158
+ SYS_SETTIMEOFDAY = 5159
+ SYS_MOUNT = 5160
+ SYS_UMOUNT2 = 5161
+ SYS_SWAPON = 5162
+ SYS_SWAPOFF = 5163
+ SYS_REBOOT = 5164
+ SYS_SETHOSTNAME = 5165
+ SYS_SETDOMAINNAME = 5166
+ SYS_CREATE_MODULE = 5167
+ SYS_INIT_MODULE = 5168
+ SYS_DELETE_MODULE = 5169
+ SYS_GET_KERNEL_SYMS = 5170
+ SYS_QUERY_MODULE = 5171
+ SYS_QUOTACTL = 5172
+ SYS_NFSSERVCTL = 5173
+ SYS_GETPMSG = 5174
+ SYS_PUTPMSG = 5175
+ SYS_AFS_SYSCALL = 5176
+ SYS_RESERVED177 = 5177
+ SYS_GETTID = 5178
+ SYS_READAHEAD = 5179
+ SYS_SETXATTR = 5180
+ SYS_LSETXATTR = 5181
+ SYS_FSETXATTR = 5182
+ SYS_GETXATTR = 5183
+ SYS_LGETXATTR = 5184
+ SYS_FGETXATTR = 5185
+ SYS_LISTXATTR = 5186
+ SYS_LLISTXATTR = 5187
+ SYS_FLISTXATTR = 5188
+ SYS_REMOVEXATTR = 5189
+ SYS_LREMOVEXATTR = 5190
+ SYS_FREMOVEXATTR = 5191
+ SYS_TKILL = 5192
+ SYS_RESERVED193 = 5193
+ SYS_FUTEX = 5194
+ SYS_SCHED_SETAFFINITY = 5195
+ SYS_SCHED_GETAFFINITY = 5196
+ SYS_CACHEFLUSH = 5197
+ SYS_CACHECTL = 5198
+ SYS_SYSMIPS = 5199
+ SYS_IO_SETUP = 5200
+ SYS_IO_DESTROY = 5201
+ SYS_IO_GETEVENTS = 5202
+ SYS_IO_SUBMIT = 5203
+ SYS_IO_CANCEL = 5204
+ SYS_EXIT_GROUP = 5205
+ SYS_LOOKUP_DCOOKIE = 5206
+ SYS_EPOLL_CREATE = 5207
+ SYS_EPOLL_CTL = 5208
+ SYS_EPOLL_WAIT = 5209
+ SYS_REMAP_FILE_PAGES = 5210
+ SYS_RT_SIGRETURN = 5211
+ SYS_SET_TID_ADDRESS = 5212
+ SYS_RESTART_SYSCALL = 5213
+ SYS_SEMTIMEDOP = 5214
+ SYS_FADVISE64 = 5215
+ SYS_TIMER_CREATE = 5216
+ SYS_TIMER_SETTIME = 5217
+ SYS_TIMER_GETTIME = 5218
+ SYS_TIMER_GETOVERRUN = 5219
+ SYS_TIMER_DELETE = 5220
+ SYS_CLOCK_SETTIME = 5221
+ SYS_CLOCK_GETTIME = 5222
+ SYS_CLOCK_GETRES = 5223
+ SYS_CLOCK_NANOSLEEP = 5224
+ SYS_TGKILL = 5225
+ SYS_UTIMES = 5226
+ SYS_MBIND = 5227
+ SYS_GET_MEMPOLICY = 5228
+ SYS_SET_MEMPOLICY = 5229
+ SYS_MQ_OPEN = 5230
+ SYS_MQ_UNLINK = 5231
+ SYS_MQ_TIMEDSEND = 5232
+ SYS_MQ_TIMEDRECEIVE = 5233
+ SYS_MQ_NOTIFY = 5234
+ SYS_MQ_GETSETATTR = 5235
+ SYS_VSERVER = 5236
+ SYS_WAITID = 5237
+ SYS_ADD_KEY = 5239
+ SYS_REQUEST_KEY = 5240
+ SYS_KEYCTL = 5241
+ SYS_SET_THREAD_AREA = 5242
+ SYS_INOTIFY_INIT = 5243
+ SYS_INOTIFY_ADD_WATCH = 5244
+ SYS_INOTIFY_RM_WATCH = 5245
+ SYS_MIGRATE_PAGES = 5246
+ SYS_OPENAT = 5247
+ SYS_MKDIRAT = 5248
+ SYS_MKNODAT = 5249
+ SYS_FCHOWNAT = 5250
+ SYS_FUTIMESAT = 5251
+ SYS_NEWFSTATAT = 5252
+ SYS_UNLINKAT = 5253
+ SYS_RENAMEAT = 5254
+ SYS_LINKAT = 5255
+ SYS_SYMLINKAT = 5256
+ SYS_READLINKAT = 5257
+ SYS_FCHMODAT = 5258
+ SYS_FACCESSAT = 5259
+ SYS_PSELECT6 = 5260
+ SYS_PPOLL = 5261
+ SYS_UNSHARE = 5262
+ SYS_SPLICE = 5263
+ SYS_SYNC_FILE_RANGE = 5264
+ SYS_TEE = 5265
+ SYS_VMSPLICE = 5266
+ SYS_MOVE_PAGES = 5267
+ SYS_SET_ROBUST_LIST = 5268
+ SYS_GET_ROBUST_LIST = 5269
+ SYS_KEXEC_LOAD = 5270
+ SYS_GETCPU = 5271
+ SYS_EPOLL_PWAIT = 5272
+ SYS_IOPRIO_SET = 5273
+ SYS_IOPRIO_GET = 5274
+ SYS_UTIMENSAT = 5275
+ SYS_SIGNALFD = 5276
+ SYS_TIMERFD = 5277
+ SYS_EVENTFD = 5278
+ SYS_FALLOCATE = 5279
+ SYS_TIMERFD_CREATE = 5280
+ SYS_TIMERFD_GETTIME = 5281
+ SYS_TIMERFD_SETTIME = 5282
+ SYS_SIGNALFD4 = 5283
+ SYS_EVENTFD2 = 5284
+ SYS_EPOLL_CREATE1 = 5285
+ SYS_DUP3 = 5286
+ SYS_PIPE2 = 5287
+ SYS_INOTIFY_INIT1 = 5288
+ SYS_PREADV = 5289
+ SYS_PWRITEV = 5290
+ SYS_RT_TGSIGQUEUEINFO = 5291
+ SYS_PERF_EVENT_OPEN = 5292
+ SYS_ACCEPT4 = 5293
+ SYS_RECVMMSG = 5294
+ SYS_FANOTIFY_INIT = 5295
+ SYS_FANOTIFY_MARK = 5296
+ SYS_PRLIMIT64 = 5297
+ SYS_NAME_TO_HANDLE_AT = 5298
+ SYS_OPEN_BY_HANDLE_AT = 5299
+ SYS_CLOCK_ADJTIME = 5300
+ SYS_SYNCFS = 5301
+ SYS_SENDMMSG = 5302
+ SYS_SETNS = 5303
+ SYS_PROCESS_VM_READV = 5304
+ SYS_PROCESS_VM_WRITEV = 5305
+ SYS_KCMP = 5306
+ SYS_FINIT_MODULE = 5307
+ SYS_GETDENTS64 = 5308
+ SYS_SCHED_SETATTR = 5309
+ SYS_SCHED_GETATTR = 5310
+ SYS_RENAMEAT2 = 5311
+ SYS_SECCOMP = 5312
+ SYS_GETRANDOM = 5313
+ SYS_MEMFD_CREATE = 5314
+ SYS_BPF = 5315
+ SYS_EXECVEAT = 5316
+ SYS_USERFAULTFD = 5317
+ SYS_MEMBARRIER = 5318
+ SYS_MLOCK2 = 5319
+ SYS_COPY_FILE_RANGE = 5320
+ SYS_PREADV2 = 5321
+ SYS_PWRITEV2 = 5322
+ SYS_PKEY_MPROTECT = 5323
+ SYS_PKEY_ALLOC = 5324
+ SYS_PKEY_FREE = 5325
+ SYS_STATX = 5326
+ SYS_RSEQ = 5327
+ SYS_IO_PGETEVENTS = 5328
+ SYS_PIDFD_SEND_SIGNAL = 5424
+ SYS_IO_URING_SETUP = 5425
+ SYS_IO_URING_ENTER = 5426
+ SYS_IO_URING_REGISTER = 5427
+ SYS_OPEN_TREE = 5428
+ SYS_MOVE_MOUNT = 5429
+ SYS_FSOPEN = 5430
+ SYS_FSCONFIG = 5431
+ SYS_FSMOUNT = 5432
+ SYS_FSPICK = 5433
+ SYS_PIDFD_OPEN = 5434
+ SYS_CLONE3 = 5435
+ SYS_CLOSE_RANGE = 5436
+ SYS_OPENAT2 = 5437
+ SYS_PIDFD_GETFD = 5438
+ SYS_FACCESSAT2 = 5439
+ SYS_PROCESS_MADVISE = 5440
+ SYS_EPOLL_PWAIT2 = 5441
+ SYS_MOUNT_SETATTR = 5442
+ SYS_QUOTACTL_FD = 5443
+ SYS_LANDLOCK_CREATE_RULESET = 5444
+ SYS_LANDLOCK_ADD_RULE = 5445
+ SYS_LANDLOCK_RESTRICT_SELF = 5446
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
index f8250602e..570a857a5 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
@@ -423,4 +423,9 @@ const (
SYS_FACCESSAT2 = 4439
SYS_PROCESS_MADVISE = 4440
SYS_EPOLL_PWAIT2 = 4441
+ SYS_MOUNT_SETATTR = 4442
+ SYS_QUOTACTL_FD = 4443
+ SYS_LANDLOCK_CREATE_RULESET = 4444
+ SYS_LANDLOCK_ADD_RULE = 4445
+ SYS_LANDLOCK_RESTRICT_SELF = 4446
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
index 7693656a6..638498d62 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
@@ -430,4 +430,9 @@ const (
SYS_FACCESSAT2 = 439
SYS_PROCESS_MADVISE = 440
SYS_EPOLL_PWAIT2 = 441
+ SYS_MOUNT_SETATTR = 442
+ SYS_QUOTACTL_FD = 443
+ SYS_LANDLOCK_CREATE_RULESET = 444
+ SYS_LANDLOCK_ADD_RULE = 445
+ SYS_LANDLOCK_RESTRICT_SELF = 446
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
index d5ed3ff51..702beebfe 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
@@ -7,399 +7,404 @@
package unix
const (
- SYS_RESTART_SYSCALL = 0
- SYS_EXIT = 1
- SYS_FORK = 2
- SYS_READ = 3
- SYS_WRITE = 4
- SYS_OPEN = 5
- SYS_CLOSE = 6
- SYS_WAITPID = 7
- SYS_CREAT = 8
- SYS_LINK = 9
- SYS_UNLINK = 10
- SYS_EXECVE = 11
- SYS_CHDIR = 12
- SYS_TIME = 13
- SYS_MKNOD = 14
- SYS_CHMOD = 15
- SYS_LCHOWN = 16
- SYS_BREAK = 17
- SYS_OLDSTAT = 18
- SYS_LSEEK = 19
- SYS_GETPID = 20
- SYS_MOUNT = 21
- SYS_UMOUNT = 22
- SYS_SETUID = 23
- SYS_GETUID = 24
- SYS_STIME = 25
- SYS_PTRACE = 26
- SYS_ALARM = 27
- SYS_OLDFSTAT = 28
- SYS_PAUSE = 29
- SYS_UTIME = 30
- SYS_STTY = 31
- SYS_GTTY = 32
- SYS_ACCESS = 33
- SYS_NICE = 34
- SYS_FTIME = 35
- SYS_SYNC = 36
- SYS_KILL = 37
- SYS_RENAME = 38
- SYS_MKDIR = 39
- SYS_RMDIR = 40
- SYS_DUP = 41
- SYS_PIPE = 42
- SYS_TIMES = 43
- SYS_PROF = 44
- SYS_BRK = 45
- SYS_SETGID = 46
- SYS_GETGID = 47
- SYS_SIGNAL = 48
- SYS_GETEUID = 49
- SYS_GETEGID = 50
- SYS_ACCT = 51
- SYS_UMOUNT2 = 52
- SYS_LOCK = 53
- SYS_IOCTL = 54
- SYS_FCNTL = 55
- SYS_MPX = 56
- SYS_SETPGID = 57
- SYS_ULIMIT = 58
- SYS_OLDOLDUNAME = 59
- SYS_UMASK = 60
- SYS_CHROOT = 61
- SYS_USTAT = 62
- SYS_DUP2 = 63
- SYS_GETPPID = 64
- SYS_GETPGRP = 65
- SYS_SETSID = 66
- SYS_SIGACTION = 67
- SYS_SGETMASK = 68
- SYS_SSETMASK = 69
- SYS_SETREUID = 70
- SYS_SETREGID = 71
- SYS_SIGSUSPEND = 72
- SYS_SIGPENDING = 73
- SYS_SETHOSTNAME = 74
- SYS_SETRLIMIT = 75
- SYS_GETRLIMIT = 76
- SYS_GETRUSAGE = 77
- SYS_GETTIMEOFDAY = 78
- SYS_SETTIMEOFDAY = 79
- SYS_GETGROUPS = 80
- SYS_SETGROUPS = 81
- SYS_SELECT = 82
- SYS_SYMLINK = 83
- SYS_OLDLSTAT = 84
- SYS_READLINK = 85
- SYS_USELIB = 86
- SYS_SWAPON = 87
- SYS_REBOOT = 88
- SYS_READDIR = 89
- SYS_MMAP = 90
- SYS_MUNMAP = 91
- SYS_TRUNCATE = 92
- SYS_FTRUNCATE = 93
- SYS_FCHMOD = 94
- SYS_FCHOWN = 95
- SYS_GETPRIORITY = 96
- SYS_SETPRIORITY = 97
- SYS_PROFIL = 98
- SYS_STATFS = 99
- SYS_FSTATFS = 100
- SYS_IOPERM = 101
- SYS_SOCKETCALL = 102
- SYS_SYSLOG = 103
- SYS_SETITIMER = 104
- SYS_GETITIMER = 105
- SYS_STAT = 106
- SYS_LSTAT = 107
- SYS_FSTAT = 108
- SYS_OLDUNAME = 109
- SYS_IOPL = 110
- SYS_VHANGUP = 111
- SYS_IDLE = 112
- SYS_VM86 = 113
- SYS_WAIT4 = 114
- SYS_SWAPOFF = 115
- SYS_SYSINFO = 116
- SYS_IPC = 117
- SYS_FSYNC = 118
- SYS_SIGRETURN = 119
- SYS_CLONE = 120
- SYS_SETDOMAINNAME = 121
- SYS_UNAME = 122
- SYS_MODIFY_LDT = 123
- SYS_ADJTIMEX = 124
- SYS_MPROTECT = 125
- SYS_SIGPROCMASK = 126
- SYS_CREATE_MODULE = 127
- SYS_INIT_MODULE = 128
- SYS_DELETE_MODULE = 129
- SYS_GET_KERNEL_SYMS = 130
- SYS_QUOTACTL = 131
- SYS_GETPGID = 132
- SYS_FCHDIR = 133
- SYS_BDFLUSH = 134
- SYS_SYSFS = 135
- SYS_PERSONALITY = 136
- SYS_AFS_SYSCALL = 137
- SYS_SETFSUID = 138
- SYS_SETFSGID = 139
- SYS__LLSEEK = 140
- SYS_GETDENTS = 141
- SYS__NEWSELECT = 142
- SYS_FLOCK = 143
- SYS_MSYNC = 144
- SYS_READV = 145
- SYS_WRITEV = 146
- SYS_GETSID = 147
- SYS_FDATASYNC = 148
- SYS__SYSCTL = 149
- SYS_MLOCK = 150
- SYS_MUNLOCK = 151
- SYS_MLOCKALL = 152
- SYS_MUNLOCKALL = 153
- SYS_SCHED_SETPARAM = 154
- SYS_SCHED_GETPARAM = 155
- SYS_SCHED_SETSCHEDULER = 156
- SYS_SCHED_GETSCHEDULER = 157
- SYS_SCHED_YIELD = 158
- SYS_SCHED_GET_PRIORITY_MAX = 159
- SYS_SCHED_GET_PRIORITY_MIN = 160
- SYS_SCHED_RR_GET_INTERVAL = 161
- SYS_NANOSLEEP = 162
- SYS_MREMAP = 163
- SYS_SETRESUID = 164
- SYS_GETRESUID = 165
- SYS_QUERY_MODULE = 166
- SYS_POLL = 167
- SYS_NFSSERVCTL = 168
- SYS_SETRESGID = 169
- SYS_GETRESGID = 170
- SYS_PRCTL = 171
- SYS_RT_SIGRETURN = 172
- SYS_RT_SIGACTION = 173
- SYS_RT_SIGPROCMASK = 174
- SYS_RT_SIGPENDING = 175
- SYS_RT_SIGTIMEDWAIT = 176
- SYS_RT_SIGQUEUEINFO = 177
- SYS_RT_SIGSUSPEND = 178
- SYS_PREAD64 = 179
- SYS_PWRITE64 = 180
- SYS_CHOWN = 181
- SYS_GETCWD = 182
- SYS_CAPGET = 183
- SYS_CAPSET = 184
- SYS_SIGALTSTACK = 185
- SYS_SENDFILE = 186
- SYS_GETPMSG = 187
- SYS_PUTPMSG = 188
- SYS_VFORK = 189
- SYS_UGETRLIMIT = 190
- SYS_READAHEAD = 191
- SYS_PCICONFIG_READ = 198
- SYS_PCICONFIG_WRITE = 199
- SYS_PCICONFIG_IOBASE = 200
- SYS_MULTIPLEXER = 201
- SYS_GETDENTS64 = 202
- SYS_PIVOT_ROOT = 203
- SYS_MADVISE = 205
- SYS_MINCORE = 206
- SYS_GETTID = 207
- SYS_TKILL = 208
- SYS_SETXATTR = 209
- SYS_LSETXATTR = 210
- SYS_FSETXATTR = 211
- SYS_GETXATTR = 212
- SYS_LGETXATTR = 213
- SYS_FGETXATTR = 214
- SYS_LISTXATTR = 215
- SYS_LLISTXATTR = 216
- SYS_FLISTXATTR = 217
- SYS_REMOVEXATTR = 218
- SYS_LREMOVEXATTR = 219
- SYS_FREMOVEXATTR = 220
- SYS_FUTEX = 221
- SYS_SCHED_SETAFFINITY = 222
- SYS_SCHED_GETAFFINITY = 223
- SYS_TUXCALL = 225
- SYS_IO_SETUP = 227
- SYS_IO_DESTROY = 228
- SYS_IO_GETEVENTS = 229
- SYS_IO_SUBMIT = 230
- SYS_IO_CANCEL = 231
- SYS_SET_TID_ADDRESS = 232
- SYS_FADVISE64 = 233
- SYS_EXIT_GROUP = 234
- SYS_LOOKUP_DCOOKIE = 235
- SYS_EPOLL_CREATE = 236
- SYS_EPOLL_CTL = 237
- SYS_EPOLL_WAIT = 238
- SYS_REMAP_FILE_PAGES = 239
- SYS_TIMER_CREATE = 240
- SYS_TIMER_SETTIME = 241
- SYS_TIMER_GETTIME = 242
- SYS_TIMER_GETOVERRUN = 243
- SYS_TIMER_DELETE = 244
- SYS_CLOCK_SETTIME = 245
- SYS_CLOCK_GETTIME = 246
- SYS_CLOCK_GETRES = 247
- SYS_CLOCK_NANOSLEEP = 248
- SYS_SWAPCONTEXT = 249
- SYS_TGKILL = 250
- SYS_UTIMES = 251
- SYS_STATFS64 = 252
- SYS_FSTATFS64 = 253
- SYS_RTAS = 255
- SYS_SYS_DEBUG_SETCONTEXT = 256
- SYS_MIGRATE_PAGES = 258
- SYS_MBIND = 259
- SYS_GET_MEMPOLICY = 260
- SYS_SET_MEMPOLICY = 261
- SYS_MQ_OPEN = 262
- SYS_MQ_UNLINK = 263
- SYS_MQ_TIMEDSEND = 264
- SYS_MQ_TIMEDRECEIVE = 265
- SYS_MQ_NOTIFY = 266
- SYS_MQ_GETSETATTR = 267
- SYS_KEXEC_LOAD = 268
- SYS_ADD_KEY = 269
- SYS_REQUEST_KEY = 270
- SYS_KEYCTL = 271
- SYS_WAITID = 272
- SYS_IOPRIO_SET = 273
- SYS_IOPRIO_GET = 274
- SYS_INOTIFY_INIT = 275
- SYS_INOTIFY_ADD_WATCH = 276
- SYS_INOTIFY_RM_WATCH = 277
- SYS_SPU_RUN = 278
- SYS_SPU_CREATE = 279
- SYS_PSELECT6 = 280
- SYS_PPOLL = 281
- SYS_UNSHARE = 282
- SYS_SPLICE = 283
- SYS_TEE = 284
- SYS_VMSPLICE = 285
- SYS_OPENAT = 286
- SYS_MKDIRAT = 287
- SYS_MKNODAT = 288
- SYS_FCHOWNAT = 289
- SYS_FUTIMESAT = 290
- SYS_NEWFSTATAT = 291
- SYS_UNLINKAT = 292
- SYS_RENAMEAT = 293
- SYS_LINKAT = 294
- SYS_SYMLINKAT = 295
- SYS_READLINKAT = 296
- SYS_FCHMODAT = 297
- SYS_FACCESSAT = 298
- SYS_GET_ROBUST_LIST = 299
- SYS_SET_ROBUST_LIST = 300
- SYS_MOVE_PAGES = 301
- SYS_GETCPU = 302
- SYS_EPOLL_PWAIT = 303
- SYS_UTIMENSAT = 304
- SYS_SIGNALFD = 305
- SYS_TIMERFD_CREATE = 306
- SYS_EVENTFD = 307
- SYS_SYNC_FILE_RANGE2 = 308
- SYS_FALLOCATE = 309
- SYS_SUBPAGE_PROT = 310
- SYS_TIMERFD_SETTIME = 311
- SYS_TIMERFD_GETTIME = 312
- SYS_SIGNALFD4 = 313
- SYS_EVENTFD2 = 314
- SYS_EPOLL_CREATE1 = 315
- SYS_DUP3 = 316
- SYS_PIPE2 = 317
- SYS_INOTIFY_INIT1 = 318
- SYS_PERF_EVENT_OPEN = 319
- SYS_PREADV = 320
- SYS_PWRITEV = 321
- SYS_RT_TGSIGQUEUEINFO = 322
- SYS_FANOTIFY_INIT = 323
- SYS_FANOTIFY_MARK = 324
- SYS_PRLIMIT64 = 325
- SYS_SOCKET = 326
- SYS_BIND = 327
- SYS_CONNECT = 328
- SYS_LISTEN = 329
- SYS_ACCEPT = 330
- SYS_GETSOCKNAME = 331
- SYS_GETPEERNAME = 332
- SYS_SOCKETPAIR = 333
- SYS_SEND = 334
- SYS_SENDTO = 335
- SYS_RECV = 336
- SYS_RECVFROM = 337
- SYS_SHUTDOWN = 338
- SYS_SETSOCKOPT = 339
- SYS_GETSOCKOPT = 340
- SYS_SENDMSG = 341
- SYS_RECVMSG = 342
- SYS_RECVMMSG = 343
- SYS_ACCEPT4 = 344
- SYS_NAME_TO_HANDLE_AT = 345
- SYS_OPEN_BY_HANDLE_AT = 346
- SYS_CLOCK_ADJTIME = 347
- SYS_SYNCFS = 348
- SYS_SENDMMSG = 349
- SYS_SETNS = 350
- SYS_PROCESS_VM_READV = 351
- SYS_PROCESS_VM_WRITEV = 352
- SYS_FINIT_MODULE = 353
- SYS_KCMP = 354
- SYS_SCHED_SETATTR = 355
- SYS_SCHED_GETATTR = 356
- SYS_RENAMEAT2 = 357
- SYS_SECCOMP = 358
- SYS_GETRANDOM = 359
- SYS_MEMFD_CREATE = 360
- SYS_BPF = 361
- SYS_EXECVEAT = 362
- SYS_SWITCH_ENDIAN = 363
- SYS_USERFAULTFD = 364
- SYS_MEMBARRIER = 365
- SYS_MLOCK2 = 378
- SYS_COPY_FILE_RANGE = 379
- SYS_PREADV2 = 380
- SYS_PWRITEV2 = 381
- SYS_KEXEC_FILE_LOAD = 382
- SYS_STATX = 383
- SYS_PKEY_ALLOC = 384
- SYS_PKEY_FREE = 385
- SYS_PKEY_MPROTECT = 386
- SYS_RSEQ = 387
- SYS_IO_PGETEVENTS = 388
- SYS_SEMTIMEDOP = 392
- SYS_SEMGET = 393
- SYS_SEMCTL = 394
- SYS_SHMGET = 395
- SYS_SHMCTL = 396
- SYS_SHMAT = 397
- SYS_SHMDT = 398
- SYS_MSGGET = 399
- SYS_MSGSND = 400
- SYS_MSGRCV = 401
- SYS_MSGCTL = 402
- SYS_PIDFD_SEND_SIGNAL = 424
- SYS_IO_URING_SETUP = 425
- SYS_IO_URING_ENTER = 426
- SYS_IO_URING_REGISTER = 427
- SYS_OPEN_TREE = 428
- SYS_MOVE_MOUNT = 429
- SYS_FSOPEN = 430
- SYS_FSCONFIG = 431
- SYS_FSMOUNT = 432
- SYS_FSPICK = 433
- SYS_PIDFD_OPEN = 434
- SYS_CLONE3 = 435
- SYS_CLOSE_RANGE = 436
- SYS_OPENAT2 = 437
- SYS_PIDFD_GETFD = 438
- SYS_FACCESSAT2 = 439
- SYS_PROCESS_MADVISE = 440
- SYS_EPOLL_PWAIT2 = 441
+ SYS_RESTART_SYSCALL = 0
+ SYS_EXIT = 1
+ SYS_FORK = 2
+ SYS_READ = 3
+ SYS_WRITE = 4
+ SYS_OPEN = 5
+ SYS_CLOSE = 6
+ SYS_WAITPID = 7
+ SYS_CREAT = 8
+ SYS_LINK = 9
+ SYS_UNLINK = 10
+ SYS_EXECVE = 11
+ SYS_CHDIR = 12
+ SYS_TIME = 13
+ SYS_MKNOD = 14
+ SYS_CHMOD = 15
+ SYS_LCHOWN = 16
+ SYS_BREAK = 17
+ SYS_OLDSTAT = 18
+ SYS_LSEEK = 19
+ SYS_GETPID = 20
+ SYS_MOUNT = 21
+ SYS_UMOUNT = 22
+ SYS_SETUID = 23
+ SYS_GETUID = 24
+ SYS_STIME = 25
+ SYS_PTRACE = 26
+ SYS_ALARM = 27
+ SYS_OLDFSTAT = 28
+ SYS_PAUSE = 29
+ SYS_UTIME = 30
+ SYS_STTY = 31
+ SYS_GTTY = 32
+ SYS_ACCESS = 33
+ SYS_NICE = 34
+ SYS_FTIME = 35
+ SYS_SYNC = 36
+ SYS_KILL = 37
+ SYS_RENAME = 38
+ SYS_MKDIR = 39
+ SYS_RMDIR = 40
+ SYS_DUP = 41
+ SYS_PIPE = 42
+ SYS_TIMES = 43
+ SYS_PROF = 44
+ SYS_BRK = 45
+ SYS_SETGID = 46
+ SYS_GETGID = 47
+ SYS_SIGNAL = 48
+ SYS_GETEUID = 49
+ SYS_GETEGID = 50
+ SYS_ACCT = 51
+ SYS_UMOUNT2 = 52
+ SYS_LOCK = 53
+ SYS_IOCTL = 54
+ SYS_FCNTL = 55
+ SYS_MPX = 56
+ SYS_SETPGID = 57
+ SYS_ULIMIT = 58
+ SYS_OLDOLDUNAME = 59
+ SYS_UMASK = 60
+ SYS_CHROOT = 61
+ SYS_USTAT = 62
+ SYS_DUP2 = 63
+ SYS_GETPPID = 64
+ SYS_GETPGRP = 65
+ SYS_SETSID = 66
+ SYS_SIGACTION = 67
+ SYS_SGETMASK = 68
+ SYS_SSETMASK = 69
+ SYS_SETREUID = 70
+ SYS_SETREGID = 71
+ SYS_SIGSUSPEND = 72
+ SYS_SIGPENDING = 73
+ SYS_SETHOSTNAME = 74
+ SYS_SETRLIMIT = 75
+ SYS_GETRLIMIT = 76
+ SYS_GETRUSAGE = 77
+ SYS_GETTIMEOFDAY = 78
+ SYS_SETTIMEOFDAY = 79
+ SYS_GETGROUPS = 80
+ SYS_SETGROUPS = 81
+ SYS_SELECT = 82
+ SYS_SYMLINK = 83
+ SYS_OLDLSTAT = 84
+ SYS_READLINK = 85
+ SYS_USELIB = 86
+ SYS_SWAPON = 87
+ SYS_REBOOT = 88
+ SYS_READDIR = 89
+ SYS_MMAP = 90
+ SYS_MUNMAP = 91
+ SYS_TRUNCATE = 92
+ SYS_FTRUNCATE = 93
+ SYS_FCHMOD = 94
+ SYS_FCHOWN = 95
+ SYS_GETPRIORITY = 96
+ SYS_SETPRIORITY = 97
+ SYS_PROFIL = 98
+ SYS_STATFS = 99
+ SYS_FSTATFS = 100
+ SYS_IOPERM = 101
+ SYS_SOCKETCALL = 102
+ SYS_SYSLOG = 103
+ SYS_SETITIMER = 104
+ SYS_GETITIMER = 105
+ SYS_STAT = 106
+ SYS_LSTAT = 107
+ SYS_FSTAT = 108
+ SYS_OLDUNAME = 109
+ SYS_IOPL = 110
+ SYS_VHANGUP = 111
+ SYS_IDLE = 112
+ SYS_VM86 = 113
+ SYS_WAIT4 = 114
+ SYS_SWAPOFF = 115
+ SYS_SYSINFO = 116
+ SYS_IPC = 117
+ SYS_FSYNC = 118
+ SYS_SIGRETURN = 119
+ SYS_CLONE = 120
+ SYS_SETDOMAINNAME = 121
+ SYS_UNAME = 122
+ SYS_MODIFY_LDT = 123
+ SYS_ADJTIMEX = 124
+ SYS_MPROTECT = 125
+ SYS_SIGPROCMASK = 126
+ SYS_CREATE_MODULE = 127
+ SYS_INIT_MODULE = 128
+ SYS_DELETE_MODULE = 129
+ SYS_GET_KERNEL_SYMS = 130
+ SYS_QUOTACTL = 131
+ SYS_GETPGID = 132
+ SYS_FCHDIR = 133
+ SYS_BDFLUSH = 134
+ SYS_SYSFS = 135
+ SYS_PERSONALITY = 136
+ SYS_AFS_SYSCALL = 137
+ SYS_SETFSUID = 138
+ SYS_SETFSGID = 139
+ SYS__LLSEEK = 140
+ SYS_GETDENTS = 141
+ SYS__NEWSELECT = 142
+ SYS_FLOCK = 143
+ SYS_MSYNC = 144
+ SYS_READV = 145
+ SYS_WRITEV = 146
+ SYS_GETSID = 147
+ SYS_FDATASYNC = 148
+ SYS__SYSCTL = 149
+ SYS_MLOCK = 150
+ SYS_MUNLOCK = 151
+ SYS_MLOCKALL = 152
+ SYS_MUNLOCKALL = 153
+ SYS_SCHED_SETPARAM = 154
+ SYS_SCHED_GETPARAM = 155
+ SYS_SCHED_SETSCHEDULER = 156
+ SYS_SCHED_GETSCHEDULER = 157
+ SYS_SCHED_YIELD = 158
+ SYS_SCHED_GET_PRIORITY_MAX = 159
+ SYS_SCHED_GET_PRIORITY_MIN = 160
+ SYS_SCHED_RR_GET_INTERVAL = 161
+ SYS_NANOSLEEP = 162
+ SYS_MREMAP = 163
+ SYS_SETRESUID = 164
+ SYS_GETRESUID = 165
+ SYS_QUERY_MODULE = 166
+ SYS_POLL = 167
+ SYS_NFSSERVCTL = 168
+ SYS_SETRESGID = 169
+ SYS_GETRESGID = 170
+ SYS_PRCTL = 171
+ SYS_RT_SIGRETURN = 172
+ SYS_RT_SIGACTION = 173
+ SYS_RT_SIGPROCMASK = 174
+ SYS_RT_SIGPENDING = 175
+ SYS_RT_SIGTIMEDWAIT = 176
+ SYS_RT_SIGQUEUEINFO = 177
+ SYS_RT_SIGSUSPEND = 178
+ SYS_PREAD64 = 179
+ SYS_PWRITE64 = 180
+ SYS_CHOWN = 181
+ SYS_GETCWD = 182
+ SYS_CAPGET = 183
+ SYS_CAPSET = 184
+ SYS_SIGALTSTACK = 185
+ SYS_SENDFILE = 186
+ SYS_GETPMSG = 187
+ SYS_PUTPMSG = 188
+ SYS_VFORK = 189
+ SYS_UGETRLIMIT = 190
+ SYS_READAHEAD = 191
+ SYS_PCICONFIG_READ = 198
+ SYS_PCICONFIG_WRITE = 199
+ SYS_PCICONFIG_IOBASE = 200
+ SYS_MULTIPLEXER = 201
+ SYS_GETDENTS64 = 202
+ SYS_PIVOT_ROOT = 203
+ SYS_MADVISE = 205
+ SYS_MINCORE = 206
+ SYS_GETTID = 207
+ SYS_TKILL = 208
+ SYS_SETXATTR = 209
+ SYS_LSETXATTR = 210
+ SYS_FSETXATTR = 211
+ SYS_GETXATTR = 212
+ SYS_LGETXATTR = 213
+ SYS_FGETXATTR = 214
+ SYS_LISTXATTR = 215
+ SYS_LLISTXATTR = 216
+ SYS_FLISTXATTR = 217
+ SYS_REMOVEXATTR = 218
+ SYS_LREMOVEXATTR = 219
+ SYS_FREMOVEXATTR = 220
+ SYS_FUTEX = 221
+ SYS_SCHED_SETAFFINITY = 222
+ SYS_SCHED_GETAFFINITY = 223
+ SYS_TUXCALL = 225
+ SYS_IO_SETUP = 227
+ SYS_IO_DESTROY = 228
+ SYS_IO_GETEVENTS = 229
+ SYS_IO_SUBMIT = 230
+ SYS_IO_CANCEL = 231
+ SYS_SET_TID_ADDRESS = 232
+ SYS_FADVISE64 = 233
+ SYS_EXIT_GROUP = 234
+ SYS_LOOKUP_DCOOKIE = 235
+ SYS_EPOLL_CREATE = 236
+ SYS_EPOLL_CTL = 237
+ SYS_EPOLL_WAIT = 238
+ SYS_REMAP_FILE_PAGES = 239
+ SYS_TIMER_CREATE = 240
+ SYS_TIMER_SETTIME = 241
+ SYS_TIMER_GETTIME = 242
+ SYS_TIMER_GETOVERRUN = 243
+ SYS_TIMER_DELETE = 244
+ SYS_CLOCK_SETTIME = 245
+ SYS_CLOCK_GETTIME = 246
+ SYS_CLOCK_GETRES = 247
+ SYS_CLOCK_NANOSLEEP = 248
+ SYS_SWAPCONTEXT = 249
+ SYS_TGKILL = 250
+ SYS_UTIMES = 251
+ SYS_STATFS64 = 252
+ SYS_FSTATFS64 = 253
+ SYS_RTAS = 255
+ SYS_SYS_DEBUG_SETCONTEXT = 256
+ SYS_MIGRATE_PAGES = 258
+ SYS_MBIND = 259
+ SYS_GET_MEMPOLICY = 260
+ SYS_SET_MEMPOLICY = 261
+ SYS_MQ_OPEN = 262
+ SYS_MQ_UNLINK = 263
+ SYS_MQ_TIMEDSEND = 264
+ SYS_MQ_TIMEDRECEIVE = 265
+ SYS_MQ_NOTIFY = 266
+ SYS_MQ_GETSETATTR = 267
+ SYS_KEXEC_LOAD = 268
+ SYS_ADD_KEY = 269
+ SYS_REQUEST_KEY = 270
+ SYS_KEYCTL = 271
+ SYS_WAITID = 272
+ SYS_IOPRIO_SET = 273
+ SYS_IOPRIO_GET = 274
+ SYS_INOTIFY_INIT = 275
+ SYS_INOTIFY_ADD_WATCH = 276
+ SYS_INOTIFY_RM_WATCH = 277
+ SYS_SPU_RUN = 278
+ SYS_SPU_CREATE = 279
+ SYS_PSELECT6 = 280
+ SYS_PPOLL = 281
+ SYS_UNSHARE = 282
+ SYS_SPLICE = 283
+ SYS_TEE = 284
+ SYS_VMSPLICE = 285
+ SYS_OPENAT = 286
+ SYS_MKDIRAT = 287
+ SYS_MKNODAT = 288
+ SYS_FCHOWNAT = 289
+ SYS_FUTIMESAT = 290
+ SYS_NEWFSTATAT = 291
+ SYS_UNLINKAT = 292
+ SYS_RENAMEAT = 293
+ SYS_LINKAT = 294
+ SYS_SYMLINKAT = 295
+ SYS_READLINKAT = 296
+ SYS_FCHMODAT = 297
+ SYS_FACCESSAT = 298
+ SYS_GET_ROBUST_LIST = 299
+ SYS_SET_ROBUST_LIST = 300
+ SYS_MOVE_PAGES = 301
+ SYS_GETCPU = 302
+ SYS_EPOLL_PWAIT = 303
+ SYS_UTIMENSAT = 304
+ SYS_SIGNALFD = 305
+ SYS_TIMERFD_CREATE = 306
+ SYS_EVENTFD = 307
+ SYS_SYNC_FILE_RANGE2 = 308
+ SYS_FALLOCATE = 309
+ SYS_SUBPAGE_PROT = 310
+ SYS_TIMERFD_SETTIME = 311
+ SYS_TIMERFD_GETTIME = 312
+ SYS_SIGNALFD4 = 313
+ SYS_EVENTFD2 = 314
+ SYS_EPOLL_CREATE1 = 315
+ SYS_DUP3 = 316
+ SYS_PIPE2 = 317
+ SYS_INOTIFY_INIT1 = 318
+ SYS_PERF_EVENT_OPEN = 319
+ SYS_PREADV = 320
+ SYS_PWRITEV = 321
+ SYS_RT_TGSIGQUEUEINFO = 322
+ SYS_FANOTIFY_INIT = 323
+ SYS_FANOTIFY_MARK = 324
+ SYS_PRLIMIT64 = 325
+ SYS_SOCKET = 326
+ SYS_BIND = 327
+ SYS_CONNECT = 328
+ SYS_LISTEN = 329
+ SYS_ACCEPT = 330
+ SYS_GETSOCKNAME = 331
+ SYS_GETPEERNAME = 332
+ SYS_SOCKETPAIR = 333
+ SYS_SEND = 334
+ SYS_SENDTO = 335
+ SYS_RECV = 336
+ SYS_RECVFROM = 337
+ SYS_SHUTDOWN = 338
+ SYS_SETSOCKOPT = 339
+ SYS_GETSOCKOPT = 340
+ SYS_SENDMSG = 341
+ SYS_RECVMSG = 342
+ SYS_RECVMMSG = 343
+ SYS_ACCEPT4 = 344
+ SYS_NAME_TO_HANDLE_AT = 345
+ SYS_OPEN_BY_HANDLE_AT = 346
+ SYS_CLOCK_ADJTIME = 347
+ SYS_SYNCFS = 348
+ SYS_SENDMMSG = 349
+ SYS_SETNS = 350
+ SYS_PROCESS_VM_READV = 351
+ SYS_PROCESS_VM_WRITEV = 352
+ SYS_FINIT_MODULE = 353
+ SYS_KCMP = 354
+ SYS_SCHED_SETATTR = 355
+ SYS_SCHED_GETATTR = 356
+ SYS_RENAMEAT2 = 357
+ SYS_SECCOMP = 358
+ SYS_GETRANDOM = 359
+ SYS_MEMFD_CREATE = 360
+ SYS_BPF = 361
+ SYS_EXECVEAT = 362
+ SYS_SWITCH_ENDIAN = 363
+ SYS_USERFAULTFD = 364
+ SYS_MEMBARRIER = 365
+ SYS_MLOCK2 = 378
+ SYS_COPY_FILE_RANGE = 379
+ SYS_PREADV2 = 380
+ SYS_PWRITEV2 = 381
+ SYS_KEXEC_FILE_LOAD = 382
+ SYS_STATX = 383
+ SYS_PKEY_ALLOC = 384
+ SYS_PKEY_FREE = 385
+ SYS_PKEY_MPROTECT = 386
+ SYS_RSEQ = 387
+ SYS_IO_PGETEVENTS = 388
+ SYS_SEMTIMEDOP = 392
+ SYS_SEMGET = 393
+ SYS_SEMCTL = 394
+ SYS_SHMGET = 395
+ SYS_SHMCTL = 396
+ SYS_SHMAT = 397
+ SYS_SHMDT = 398
+ SYS_MSGGET = 399
+ SYS_MSGSND = 400
+ SYS_MSGRCV = 401
+ SYS_MSGCTL = 402
+ SYS_PIDFD_SEND_SIGNAL = 424
+ SYS_IO_URING_SETUP = 425
+ SYS_IO_URING_ENTER = 426
+ SYS_IO_URING_REGISTER = 427
+ SYS_OPEN_TREE = 428
+ SYS_MOVE_MOUNT = 429
+ SYS_FSOPEN = 430
+ SYS_FSCONFIG = 431
+ SYS_FSMOUNT = 432
+ SYS_FSPICK = 433
+ SYS_PIDFD_OPEN = 434
+ SYS_CLONE3 = 435
+ SYS_CLOSE_RANGE = 436
+ SYS_OPENAT2 = 437
+ SYS_PIDFD_GETFD = 438
+ SYS_FACCESSAT2 = 439
+ SYS_PROCESS_MADVISE = 440
+ SYS_EPOLL_PWAIT2 = 441
+ SYS_MOUNT_SETATTR = 442
+ SYS_QUOTACTL_FD = 443
+ SYS_LANDLOCK_CREATE_RULESET = 444
+ SYS_LANDLOCK_ADD_RULE = 445
+ SYS_LANDLOCK_RESTRICT_SELF = 446
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
index e29b4424c..bfc87ea44 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
@@ -7,399 +7,404 @@
package unix
const (
- SYS_RESTART_SYSCALL = 0
- SYS_EXIT = 1
- SYS_FORK = 2
- SYS_READ = 3
- SYS_WRITE = 4
- SYS_OPEN = 5
- SYS_CLOSE = 6
- SYS_WAITPID = 7
- SYS_CREAT = 8
- SYS_LINK = 9
- SYS_UNLINK = 10
- SYS_EXECVE = 11
- SYS_CHDIR = 12
- SYS_TIME = 13
- SYS_MKNOD = 14
- SYS_CHMOD = 15
- SYS_LCHOWN = 16
- SYS_BREAK = 17
- SYS_OLDSTAT = 18
- SYS_LSEEK = 19
- SYS_GETPID = 20
- SYS_MOUNT = 21
- SYS_UMOUNT = 22
- SYS_SETUID = 23
- SYS_GETUID = 24
- SYS_STIME = 25
- SYS_PTRACE = 26
- SYS_ALARM = 27
- SYS_OLDFSTAT = 28
- SYS_PAUSE = 29
- SYS_UTIME = 30
- SYS_STTY = 31
- SYS_GTTY = 32
- SYS_ACCESS = 33
- SYS_NICE = 34
- SYS_FTIME = 35
- SYS_SYNC = 36
- SYS_KILL = 37
- SYS_RENAME = 38
- SYS_MKDIR = 39
- SYS_RMDIR = 40
- SYS_DUP = 41
- SYS_PIPE = 42
- SYS_TIMES = 43
- SYS_PROF = 44
- SYS_BRK = 45
- SYS_SETGID = 46
- SYS_GETGID = 47
- SYS_SIGNAL = 48
- SYS_GETEUID = 49
- SYS_GETEGID = 50
- SYS_ACCT = 51
- SYS_UMOUNT2 = 52
- SYS_LOCK = 53
- SYS_IOCTL = 54
- SYS_FCNTL = 55
- SYS_MPX = 56
- SYS_SETPGID = 57
- SYS_ULIMIT = 58
- SYS_OLDOLDUNAME = 59
- SYS_UMASK = 60
- SYS_CHROOT = 61
- SYS_USTAT = 62
- SYS_DUP2 = 63
- SYS_GETPPID = 64
- SYS_GETPGRP = 65
- SYS_SETSID = 66
- SYS_SIGACTION = 67
- SYS_SGETMASK = 68
- SYS_SSETMASK = 69
- SYS_SETREUID = 70
- SYS_SETREGID = 71
- SYS_SIGSUSPEND = 72
- SYS_SIGPENDING = 73
- SYS_SETHOSTNAME = 74
- SYS_SETRLIMIT = 75
- SYS_GETRLIMIT = 76
- SYS_GETRUSAGE = 77
- SYS_GETTIMEOFDAY = 78
- SYS_SETTIMEOFDAY = 79
- SYS_GETGROUPS = 80
- SYS_SETGROUPS = 81
- SYS_SELECT = 82
- SYS_SYMLINK = 83
- SYS_OLDLSTAT = 84
- SYS_READLINK = 85
- SYS_USELIB = 86
- SYS_SWAPON = 87
- SYS_REBOOT = 88
- SYS_READDIR = 89
- SYS_MMAP = 90
- SYS_MUNMAP = 91
- SYS_TRUNCATE = 92
- SYS_FTRUNCATE = 93
- SYS_FCHMOD = 94
- SYS_FCHOWN = 95
- SYS_GETPRIORITY = 96
- SYS_SETPRIORITY = 97
- SYS_PROFIL = 98
- SYS_STATFS = 99
- SYS_FSTATFS = 100
- SYS_IOPERM = 101
- SYS_SOCKETCALL = 102
- SYS_SYSLOG = 103
- SYS_SETITIMER = 104
- SYS_GETITIMER = 105
- SYS_STAT = 106
- SYS_LSTAT = 107
- SYS_FSTAT = 108
- SYS_OLDUNAME = 109
- SYS_IOPL = 110
- SYS_VHANGUP = 111
- SYS_IDLE = 112
- SYS_VM86 = 113
- SYS_WAIT4 = 114
- SYS_SWAPOFF = 115
- SYS_SYSINFO = 116
- SYS_IPC = 117
- SYS_FSYNC = 118
- SYS_SIGRETURN = 119
- SYS_CLONE = 120
- SYS_SETDOMAINNAME = 121
- SYS_UNAME = 122
- SYS_MODIFY_LDT = 123
- SYS_ADJTIMEX = 124
- SYS_MPROTECT = 125
- SYS_SIGPROCMASK = 126
- SYS_CREATE_MODULE = 127
- SYS_INIT_MODULE = 128
- SYS_DELETE_MODULE = 129
- SYS_GET_KERNEL_SYMS = 130
- SYS_QUOTACTL = 131
- SYS_GETPGID = 132
- SYS_FCHDIR = 133
- SYS_BDFLUSH = 134
- SYS_SYSFS = 135
- SYS_PERSONALITY = 136
- SYS_AFS_SYSCALL = 137
- SYS_SETFSUID = 138
- SYS_SETFSGID = 139
- SYS__LLSEEK = 140
- SYS_GETDENTS = 141
- SYS__NEWSELECT = 142
- SYS_FLOCK = 143
- SYS_MSYNC = 144
- SYS_READV = 145
- SYS_WRITEV = 146
- SYS_GETSID = 147
- SYS_FDATASYNC = 148
- SYS__SYSCTL = 149
- SYS_MLOCK = 150
- SYS_MUNLOCK = 151
- SYS_MLOCKALL = 152
- SYS_MUNLOCKALL = 153
- SYS_SCHED_SETPARAM = 154
- SYS_SCHED_GETPARAM = 155
- SYS_SCHED_SETSCHEDULER = 156
- SYS_SCHED_GETSCHEDULER = 157
- SYS_SCHED_YIELD = 158
- SYS_SCHED_GET_PRIORITY_MAX = 159
- SYS_SCHED_GET_PRIORITY_MIN = 160
- SYS_SCHED_RR_GET_INTERVAL = 161
- SYS_NANOSLEEP = 162
- SYS_MREMAP = 163
- SYS_SETRESUID = 164
- SYS_GETRESUID = 165
- SYS_QUERY_MODULE = 166
- SYS_POLL = 167
- SYS_NFSSERVCTL = 168
- SYS_SETRESGID = 169
- SYS_GETRESGID = 170
- SYS_PRCTL = 171
- SYS_RT_SIGRETURN = 172
- SYS_RT_SIGACTION = 173
- SYS_RT_SIGPROCMASK = 174
- SYS_RT_SIGPENDING = 175
- SYS_RT_SIGTIMEDWAIT = 176
- SYS_RT_SIGQUEUEINFO = 177
- SYS_RT_SIGSUSPEND = 178
- SYS_PREAD64 = 179
- SYS_PWRITE64 = 180
- SYS_CHOWN = 181
- SYS_GETCWD = 182
- SYS_CAPGET = 183
- SYS_CAPSET = 184
- SYS_SIGALTSTACK = 185
- SYS_SENDFILE = 186
- SYS_GETPMSG = 187
- SYS_PUTPMSG = 188
- SYS_VFORK = 189
- SYS_UGETRLIMIT = 190
- SYS_READAHEAD = 191
- SYS_PCICONFIG_READ = 198
- SYS_PCICONFIG_WRITE = 199
- SYS_PCICONFIG_IOBASE = 200
- SYS_MULTIPLEXER = 201
- SYS_GETDENTS64 = 202
- SYS_PIVOT_ROOT = 203
- SYS_MADVISE = 205
- SYS_MINCORE = 206
- SYS_GETTID = 207
- SYS_TKILL = 208
- SYS_SETXATTR = 209
- SYS_LSETXATTR = 210
- SYS_FSETXATTR = 211
- SYS_GETXATTR = 212
- SYS_LGETXATTR = 213
- SYS_FGETXATTR = 214
- SYS_LISTXATTR = 215
- SYS_LLISTXATTR = 216
- SYS_FLISTXATTR = 217
- SYS_REMOVEXATTR = 218
- SYS_LREMOVEXATTR = 219
- SYS_FREMOVEXATTR = 220
- SYS_FUTEX = 221
- SYS_SCHED_SETAFFINITY = 222
- SYS_SCHED_GETAFFINITY = 223
- SYS_TUXCALL = 225
- SYS_IO_SETUP = 227
- SYS_IO_DESTROY = 228
- SYS_IO_GETEVENTS = 229
- SYS_IO_SUBMIT = 230
- SYS_IO_CANCEL = 231
- SYS_SET_TID_ADDRESS = 232
- SYS_FADVISE64 = 233
- SYS_EXIT_GROUP = 234
- SYS_LOOKUP_DCOOKIE = 235
- SYS_EPOLL_CREATE = 236
- SYS_EPOLL_CTL = 237
- SYS_EPOLL_WAIT = 238
- SYS_REMAP_FILE_PAGES = 239
- SYS_TIMER_CREATE = 240
- SYS_TIMER_SETTIME = 241
- SYS_TIMER_GETTIME = 242
- SYS_TIMER_GETOVERRUN = 243
- SYS_TIMER_DELETE = 244
- SYS_CLOCK_SETTIME = 245
- SYS_CLOCK_GETTIME = 246
- SYS_CLOCK_GETRES = 247
- SYS_CLOCK_NANOSLEEP = 248
- SYS_SWAPCONTEXT = 249
- SYS_TGKILL = 250
- SYS_UTIMES = 251
- SYS_STATFS64 = 252
- SYS_FSTATFS64 = 253
- SYS_RTAS = 255
- SYS_SYS_DEBUG_SETCONTEXT = 256
- SYS_MIGRATE_PAGES = 258
- SYS_MBIND = 259
- SYS_GET_MEMPOLICY = 260
- SYS_SET_MEMPOLICY = 261
- SYS_MQ_OPEN = 262
- SYS_MQ_UNLINK = 263
- SYS_MQ_TIMEDSEND = 264
- SYS_MQ_TIMEDRECEIVE = 265
- SYS_MQ_NOTIFY = 266
- SYS_MQ_GETSETATTR = 267
- SYS_KEXEC_LOAD = 268
- SYS_ADD_KEY = 269
- SYS_REQUEST_KEY = 270
- SYS_KEYCTL = 271
- SYS_WAITID = 272
- SYS_IOPRIO_SET = 273
- SYS_IOPRIO_GET = 274
- SYS_INOTIFY_INIT = 275
- SYS_INOTIFY_ADD_WATCH = 276
- SYS_INOTIFY_RM_WATCH = 277
- SYS_SPU_RUN = 278
- SYS_SPU_CREATE = 279
- SYS_PSELECT6 = 280
- SYS_PPOLL = 281
- SYS_UNSHARE = 282
- SYS_SPLICE = 283
- SYS_TEE = 284
- SYS_VMSPLICE = 285
- SYS_OPENAT = 286
- SYS_MKDIRAT = 287
- SYS_MKNODAT = 288
- SYS_FCHOWNAT = 289
- SYS_FUTIMESAT = 290
- SYS_NEWFSTATAT = 291
- SYS_UNLINKAT = 292
- SYS_RENAMEAT = 293
- SYS_LINKAT = 294
- SYS_SYMLINKAT = 295
- SYS_READLINKAT = 296
- SYS_FCHMODAT = 297
- SYS_FACCESSAT = 298
- SYS_GET_ROBUST_LIST = 299
- SYS_SET_ROBUST_LIST = 300
- SYS_MOVE_PAGES = 301
- SYS_GETCPU = 302
- SYS_EPOLL_PWAIT = 303
- SYS_UTIMENSAT = 304
- SYS_SIGNALFD = 305
- SYS_TIMERFD_CREATE = 306
- SYS_EVENTFD = 307
- SYS_SYNC_FILE_RANGE2 = 308
- SYS_FALLOCATE = 309
- SYS_SUBPAGE_PROT = 310
- SYS_TIMERFD_SETTIME = 311
- SYS_TIMERFD_GETTIME = 312
- SYS_SIGNALFD4 = 313
- SYS_EVENTFD2 = 314
- SYS_EPOLL_CREATE1 = 315
- SYS_DUP3 = 316
- SYS_PIPE2 = 317
- SYS_INOTIFY_INIT1 = 318
- SYS_PERF_EVENT_OPEN = 319
- SYS_PREADV = 320
- SYS_PWRITEV = 321
- SYS_RT_TGSIGQUEUEINFO = 322
- SYS_FANOTIFY_INIT = 323
- SYS_FANOTIFY_MARK = 324
- SYS_PRLIMIT64 = 325
- SYS_SOCKET = 326
- SYS_BIND = 327
- SYS_CONNECT = 328
- SYS_LISTEN = 329
- SYS_ACCEPT = 330
- SYS_GETSOCKNAME = 331
- SYS_GETPEERNAME = 332
- SYS_SOCKETPAIR = 333
- SYS_SEND = 334
- SYS_SENDTO = 335
- SYS_RECV = 336
- SYS_RECVFROM = 337
- SYS_SHUTDOWN = 338
- SYS_SETSOCKOPT = 339
- SYS_GETSOCKOPT = 340
- SYS_SENDMSG = 341
- SYS_RECVMSG = 342
- SYS_RECVMMSG = 343
- SYS_ACCEPT4 = 344
- SYS_NAME_TO_HANDLE_AT = 345
- SYS_OPEN_BY_HANDLE_AT = 346
- SYS_CLOCK_ADJTIME = 347
- SYS_SYNCFS = 348
- SYS_SENDMMSG = 349
- SYS_SETNS = 350
- SYS_PROCESS_VM_READV = 351
- SYS_PROCESS_VM_WRITEV = 352
- SYS_FINIT_MODULE = 353
- SYS_KCMP = 354
- SYS_SCHED_SETATTR = 355
- SYS_SCHED_GETATTR = 356
- SYS_RENAMEAT2 = 357
- SYS_SECCOMP = 358
- SYS_GETRANDOM = 359
- SYS_MEMFD_CREATE = 360
- SYS_BPF = 361
- SYS_EXECVEAT = 362
- SYS_SWITCH_ENDIAN = 363
- SYS_USERFAULTFD = 364
- SYS_MEMBARRIER = 365
- SYS_MLOCK2 = 378
- SYS_COPY_FILE_RANGE = 379
- SYS_PREADV2 = 380
- SYS_PWRITEV2 = 381
- SYS_KEXEC_FILE_LOAD = 382
- SYS_STATX = 383
- SYS_PKEY_ALLOC = 384
- SYS_PKEY_FREE = 385
- SYS_PKEY_MPROTECT = 386
- SYS_RSEQ = 387
- SYS_IO_PGETEVENTS = 388
- SYS_SEMTIMEDOP = 392
- SYS_SEMGET = 393
- SYS_SEMCTL = 394
- SYS_SHMGET = 395
- SYS_SHMCTL = 396
- SYS_SHMAT = 397
- SYS_SHMDT = 398
- SYS_MSGGET = 399
- SYS_MSGSND = 400
- SYS_MSGRCV = 401
- SYS_MSGCTL = 402
- SYS_PIDFD_SEND_SIGNAL = 424
- SYS_IO_URING_SETUP = 425
- SYS_IO_URING_ENTER = 426
- SYS_IO_URING_REGISTER = 427
- SYS_OPEN_TREE = 428
- SYS_MOVE_MOUNT = 429
- SYS_FSOPEN = 430
- SYS_FSCONFIG = 431
- SYS_FSMOUNT = 432
- SYS_FSPICK = 433
- SYS_PIDFD_OPEN = 434
- SYS_CLONE3 = 435
- SYS_CLOSE_RANGE = 436
- SYS_OPENAT2 = 437
- SYS_PIDFD_GETFD = 438
- SYS_FACCESSAT2 = 439
- SYS_PROCESS_MADVISE = 440
- SYS_EPOLL_PWAIT2 = 441
+ SYS_RESTART_SYSCALL = 0
+ SYS_EXIT = 1
+ SYS_FORK = 2
+ SYS_READ = 3
+ SYS_WRITE = 4
+ SYS_OPEN = 5
+ SYS_CLOSE = 6
+ SYS_WAITPID = 7
+ SYS_CREAT = 8
+ SYS_LINK = 9
+ SYS_UNLINK = 10
+ SYS_EXECVE = 11
+ SYS_CHDIR = 12
+ SYS_TIME = 13
+ SYS_MKNOD = 14
+ SYS_CHMOD = 15
+ SYS_LCHOWN = 16
+ SYS_BREAK = 17
+ SYS_OLDSTAT = 18
+ SYS_LSEEK = 19
+ SYS_GETPID = 20
+ SYS_MOUNT = 21
+ SYS_UMOUNT = 22
+ SYS_SETUID = 23
+ SYS_GETUID = 24
+ SYS_STIME = 25
+ SYS_PTRACE = 26
+ SYS_ALARM = 27
+ SYS_OLDFSTAT = 28
+ SYS_PAUSE = 29
+ SYS_UTIME = 30
+ SYS_STTY = 31
+ SYS_GTTY = 32
+ SYS_ACCESS = 33
+ SYS_NICE = 34
+ SYS_FTIME = 35
+ SYS_SYNC = 36
+ SYS_KILL = 37
+ SYS_RENAME = 38
+ SYS_MKDIR = 39
+ SYS_RMDIR = 40
+ SYS_DUP = 41
+ SYS_PIPE = 42
+ SYS_TIMES = 43
+ SYS_PROF = 44
+ SYS_BRK = 45
+ SYS_SETGID = 46
+ SYS_GETGID = 47
+ SYS_SIGNAL = 48
+ SYS_GETEUID = 49
+ SYS_GETEGID = 50
+ SYS_ACCT = 51
+ SYS_UMOUNT2 = 52
+ SYS_LOCK = 53
+ SYS_IOCTL = 54
+ SYS_FCNTL = 55
+ SYS_MPX = 56
+ SYS_SETPGID = 57
+ SYS_ULIMIT = 58
+ SYS_OLDOLDUNAME = 59
+ SYS_UMASK = 60
+ SYS_CHROOT = 61
+ SYS_USTAT = 62
+ SYS_DUP2 = 63
+ SYS_GETPPID = 64
+ SYS_GETPGRP = 65
+ SYS_SETSID = 66
+ SYS_SIGACTION = 67
+ SYS_SGETMASK = 68
+ SYS_SSETMASK = 69
+ SYS_SETREUID = 70
+ SYS_SETREGID = 71
+ SYS_SIGSUSPEND = 72
+ SYS_SIGPENDING = 73
+ SYS_SETHOSTNAME = 74
+ SYS_SETRLIMIT = 75
+ SYS_GETRLIMIT = 76
+ SYS_GETRUSAGE = 77
+ SYS_GETTIMEOFDAY = 78
+ SYS_SETTIMEOFDAY = 79
+ SYS_GETGROUPS = 80
+ SYS_SETGROUPS = 81
+ SYS_SELECT = 82
+ SYS_SYMLINK = 83
+ SYS_OLDLSTAT = 84
+ SYS_READLINK = 85
+ SYS_USELIB = 86
+ SYS_SWAPON = 87
+ SYS_REBOOT = 88
+ SYS_READDIR = 89
+ SYS_MMAP = 90
+ SYS_MUNMAP = 91
+ SYS_TRUNCATE = 92
+ SYS_FTRUNCATE = 93
+ SYS_FCHMOD = 94
+ SYS_FCHOWN = 95
+ SYS_GETPRIORITY = 96
+ SYS_SETPRIORITY = 97
+ SYS_PROFIL = 98
+ SYS_STATFS = 99
+ SYS_FSTATFS = 100
+ SYS_IOPERM = 101
+ SYS_SOCKETCALL = 102
+ SYS_SYSLOG = 103
+ SYS_SETITIMER = 104
+ SYS_GETITIMER = 105
+ SYS_STAT = 106
+ SYS_LSTAT = 107
+ SYS_FSTAT = 108
+ SYS_OLDUNAME = 109
+ SYS_IOPL = 110
+ SYS_VHANGUP = 111
+ SYS_IDLE = 112
+ SYS_VM86 = 113
+ SYS_WAIT4 = 114
+ SYS_SWAPOFF = 115
+ SYS_SYSINFO = 116
+ SYS_IPC = 117
+ SYS_FSYNC = 118
+ SYS_SIGRETURN = 119
+ SYS_CLONE = 120
+ SYS_SETDOMAINNAME = 121
+ SYS_UNAME = 122
+ SYS_MODIFY_LDT = 123
+ SYS_ADJTIMEX = 124
+ SYS_MPROTECT = 125
+ SYS_SIGPROCMASK = 126
+ SYS_CREATE_MODULE = 127
+ SYS_INIT_MODULE = 128
+ SYS_DELETE_MODULE = 129
+ SYS_GET_KERNEL_SYMS = 130
+ SYS_QUOTACTL = 131
+ SYS_GETPGID = 132
+ SYS_FCHDIR = 133
+ SYS_BDFLUSH = 134
+ SYS_SYSFS = 135
+ SYS_PERSONALITY = 136
+ SYS_AFS_SYSCALL = 137
+ SYS_SETFSUID = 138
+ SYS_SETFSGID = 139
+ SYS__LLSEEK = 140
+ SYS_GETDENTS = 141
+ SYS__NEWSELECT = 142
+ SYS_FLOCK = 143
+ SYS_MSYNC = 144
+ SYS_READV = 145
+ SYS_WRITEV = 146
+ SYS_GETSID = 147
+ SYS_FDATASYNC = 148
+ SYS__SYSCTL = 149
+ SYS_MLOCK = 150
+ SYS_MUNLOCK = 151
+ SYS_MLOCKALL = 152
+ SYS_MUNLOCKALL = 153
+ SYS_SCHED_SETPARAM = 154
+ SYS_SCHED_GETPARAM = 155
+ SYS_SCHED_SETSCHEDULER = 156
+ SYS_SCHED_GETSCHEDULER = 157
+ SYS_SCHED_YIELD = 158
+ SYS_SCHED_GET_PRIORITY_MAX = 159
+ SYS_SCHED_GET_PRIORITY_MIN = 160
+ SYS_SCHED_RR_GET_INTERVAL = 161
+ SYS_NANOSLEEP = 162
+ SYS_MREMAP = 163
+ SYS_SETRESUID = 164
+ SYS_GETRESUID = 165
+ SYS_QUERY_MODULE = 166
+ SYS_POLL = 167
+ SYS_NFSSERVCTL = 168
+ SYS_SETRESGID = 169
+ SYS_GETRESGID = 170
+ SYS_PRCTL = 171
+ SYS_RT_SIGRETURN = 172
+ SYS_RT_SIGACTION = 173
+ SYS_RT_SIGPROCMASK = 174
+ SYS_RT_SIGPENDING = 175
+ SYS_RT_SIGTIMEDWAIT = 176
+ SYS_RT_SIGQUEUEINFO = 177
+ SYS_RT_SIGSUSPEND = 178
+ SYS_PREAD64 = 179
+ SYS_PWRITE64 = 180
+ SYS_CHOWN = 181
+ SYS_GETCWD = 182
+ SYS_CAPGET = 183
+ SYS_CAPSET = 184
+ SYS_SIGALTSTACK = 185
+ SYS_SENDFILE = 186
+ SYS_GETPMSG = 187
+ SYS_PUTPMSG = 188
+ SYS_VFORK = 189
+ SYS_UGETRLIMIT = 190
+ SYS_READAHEAD = 191
+ SYS_PCICONFIG_READ = 198
+ SYS_PCICONFIG_WRITE = 199
+ SYS_PCICONFIG_IOBASE = 200
+ SYS_MULTIPLEXER = 201
+ SYS_GETDENTS64 = 202
+ SYS_PIVOT_ROOT = 203
+ SYS_MADVISE = 205
+ SYS_MINCORE = 206
+ SYS_GETTID = 207
+ SYS_TKILL = 208
+ SYS_SETXATTR = 209
+ SYS_LSETXATTR = 210
+ SYS_FSETXATTR = 211
+ SYS_GETXATTR = 212
+ SYS_LGETXATTR = 213
+ SYS_FGETXATTR = 214
+ SYS_LISTXATTR = 215
+ SYS_LLISTXATTR = 216
+ SYS_FLISTXATTR = 217
+ SYS_REMOVEXATTR = 218
+ SYS_LREMOVEXATTR = 219
+ SYS_FREMOVEXATTR = 220
+ SYS_FUTEX = 221
+ SYS_SCHED_SETAFFINITY = 222
+ SYS_SCHED_GETAFFINITY = 223
+ SYS_TUXCALL = 225
+ SYS_IO_SETUP = 227
+ SYS_IO_DESTROY = 228
+ SYS_IO_GETEVENTS = 229
+ SYS_IO_SUBMIT = 230
+ SYS_IO_CANCEL = 231
+ SYS_SET_TID_ADDRESS = 232
+ SYS_FADVISE64 = 233
+ SYS_EXIT_GROUP = 234
+ SYS_LOOKUP_DCOOKIE = 235
+ SYS_EPOLL_CREATE = 236
+ SYS_EPOLL_CTL = 237
+ SYS_EPOLL_WAIT = 238
+ SYS_REMAP_FILE_PAGES = 239
+ SYS_TIMER_CREATE = 240
+ SYS_TIMER_SETTIME = 241
+ SYS_TIMER_GETTIME = 242
+ SYS_TIMER_GETOVERRUN = 243
+ SYS_TIMER_DELETE = 244
+ SYS_CLOCK_SETTIME = 245
+ SYS_CLOCK_GETTIME = 246
+ SYS_CLOCK_GETRES = 247
+ SYS_CLOCK_NANOSLEEP = 248
+ SYS_SWAPCONTEXT = 249
+ SYS_TGKILL = 250
+ SYS_UTIMES = 251
+ SYS_STATFS64 = 252
+ SYS_FSTATFS64 = 253
+ SYS_RTAS = 255
+ SYS_SYS_DEBUG_SETCONTEXT = 256
+ SYS_MIGRATE_PAGES = 258
+ SYS_MBIND = 259
+ SYS_GET_MEMPOLICY = 260
+ SYS_SET_MEMPOLICY = 261
+ SYS_MQ_OPEN = 262
+ SYS_MQ_UNLINK = 263
+ SYS_MQ_TIMEDSEND = 264
+ SYS_MQ_TIMEDRECEIVE = 265
+ SYS_MQ_NOTIFY = 266
+ SYS_MQ_GETSETATTR = 267
+ SYS_KEXEC_LOAD = 268
+ SYS_ADD_KEY = 269
+ SYS_REQUEST_KEY = 270
+ SYS_KEYCTL = 271
+ SYS_WAITID = 272
+ SYS_IOPRIO_SET = 273
+ SYS_IOPRIO_GET = 274
+ SYS_INOTIFY_INIT = 275
+ SYS_INOTIFY_ADD_WATCH = 276
+ SYS_INOTIFY_RM_WATCH = 277
+ SYS_SPU_RUN = 278
+ SYS_SPU_CREATE = 279
+ SYS_PSELECT6 = 280
+ SYS_PPOLL = 281
+ SYS_UNSHARE = 282
+ SYS_SPLICE = 283
+ SYS_TEE = 284
+ SYS_VMSPLICE = 285
+ SYS_OPENAT = 286
+ SYS_MKDIRAT = 287
+ SYS_MKNODAT = 288
+ SYS_FCHOWNAT = 289
+ SYS_FUTIMESAT = 290
+ SYS_NEWFSTATAT = 291
+ SYS_UNLINKAT = 292
+ SYS_RENAMEAT = 293
+ SYS_LINKAT = 294
+ SYS_SYMLINKAT = 295
+ SYS_READLINKAT = 296
+ SYS_FCHMODAT = 297
+ SYS_FACCESSAT = 298
+ SYS_GET_ROBUST_LIST = 299
+ SYS_SET_ROBUST_LIST = 300
+ SYS_MOVE_PAGES = 301
+ SYS_GETCPU = 302
+ SYS_EPOLL_PWAIT = 303
+ SYS_UTIMENSAT = 304
+ SYS_SIGNALFD = 305
+ SYS_TIMERFD_CREATE = 306
+ SYS_EVENTFD = 307
+ SYS_SYNC_FILE_RANGE2 = 308
+ SYS_FALLOCATE = 309
+ SYS_SUBPAGE_PROT = 310
+ SYS_TIMERFD_SETTIME = 311
+ SYS_TIMERFD_GETTIME = 312
+ SYS_SIGNALFD4 = 313
+ SYS_EVENTFD2 = 314
+ SYS_EPOLL_CREATE1 = 315
+ SYS_DUP3 = 316
+ SYS_PIPE2 = 317
+ SYS_INOTIFY_INIT1 = 318
+ SYS_PERF_EVENT_OPEN = 319
+ SYS_PREADV = 320
+ SYS_PWRITEV = 321
+ SYS_RT_TGSIGQUEUEINFO = 322
+ SYS_FANOTIFY_INIT = 323
+ SYS_FANOTIFY_MARK = 324
+ SYS_PRLIMIT64 = 325
+ SYS_SOCKET = 326
+ SYS_BIND = 327
+ SYS_CONNECT = 328
+ SYS_LISTEN = 329
+ SYS_ACCEPT = 330
+ SYS_GETSOCKNAME = 331
+ SYS_GETPEERNAME = 332
+ SYS_SOCKETPAIR = 333
+ SYS_SEND = 334
+ SYS_SENDTO = 335
+ SYS_RECV = 336
+ SYS_RECVFROM = 337
+ SYS_SHUTDOWN = 338
+ SYS_SETSOCKOPT = 339
+ SYS_GETSOCKOPT = 340
+ SYS_SENDMSG = 341
+ SYS_RECVMSG = 342
+ SYS_RECVMMSG = 343
+ SYS_ACCEPT4 = 344
+ SYS_NAME_TO_HANDLE_AT = 345
+ SYS_OPEN_BY_HANDLE_AT = 346
+ SYS_CLOCK_ADJTIME = 347
+ SYS_SYNCFS = 348
+ SYS_SENDMMSG = 349
+ SYS_SETNS = 350
+ SYS_PROCESS_VM_READV = 351
+ SYS_PROCESS_VM_WRITEV = 352
+ SYS_FINIT_MODULE = 353
+ SYS_KCMP = 354
+ SYS_SCHED_SETATTR = 355
+ SYS_SCHED_GETATTR = 356
+ SYS_RENAMEAT2 = 357
+ SYS_SECCOMP = 358
+ SYS_GETRANDOM = 359
+ SYS_MEMFD_CREATE = 360
+ SYS_BPF = 361
+ SYS_EXECVEAT = 362
+ SYS_SWITCH_ENDIAN = 363
+ SYS_USERFAULTFD = 364
+ SYS_MEMBARRIER = 365
+ SYS_MLOCK2 = 378
+ SYS_COPY_FILE_RANGE = 379
+ SYS_PREADV2 = 380
+ SYS_PWRITEV2 = 381
+ SYS_KEXEC_FILE_LOAD = 382
+ SYS_STATX = 383
+ SYS_PKEY_ALLOC = 384
+ SYS_PKEY_FREE = 385
+ SYS_PKEY_MPROTECT = 386
+ SYS_RSEQ = 387
+ SYS_IO_PGETEVENTS = 388
+ SYS_SEMTIMEDOP = 392
+ SYS_SEMGET = 393
+ SYS_SEMCTL = 394
+ SYS_SHMGET = 395
+ SYS_SHMCTL = 396
+ SYS_SHMAT = 397
+ SYS_SHMDT = 398
+ SYS_MSGGET = 399
+ SYS_MSGSND = 400
+ SYS_MSGRCV = 401
+ SYS_MSGCTL = 402
+ SYS_PIDFD_SEND_SIGNAL = 424
+ SYS_IO_URING_SETUP = 425
+ SYS_IO_URING_ENTER = 426
+ SYS_IO_URING_REGISTER = 427
+ SYS_OPEN_TREE = 428
+ SYS_MOVE_MOUNT = 429
+ SYS_FSOPEN = 430
+ SYS_FSCONFIG = 431
+ SYS_FSMOUNT = 432
+ SYS_FSPICK = 433
+ SYS_PIDFD_OPEN = 434
+ SYS_CLONE3 = 435
+ SYS_CLOSE_RANGE = 436
+ SYS_OPENAT2 = 437
+ SYS_PIDFD_GETFD = 438
+ SYS_FACCESSAT2 = 439
+ SYS_PROCESS_MADVISE = 440
+ SYS_EPOLL_PWAIT2 = 441
+ SYS_MOUNT_SETATTR = 442
+ SYS_QUOTACTL_FD = 443
+ SYS_LANDLOCK_CREATE_RULESET = 444
+ SYS_LANDLOCK_ADD_RULE = 445
+ SYS_LANDLOCK_RESTRICT_SELF = 446
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
index 41deed6c3..a390e147d 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
@@ -7,301 +7,306 @@
package unix
const (
- SYS_IO_SETUP = 0
- SYS_IO_DESTROY = 1
- SYS_IO_SUBMIT = 2
- SYS_IO_CANCEL = 3
- SYS_IO_GETEVENTS = 4
- SYS_SETXATTR = 5
- SYS_LSETXATTR = 6
- SYS_FSETXATTR = 7
- SYS_GETXATTR = 8
- SYS_LGETXATTR = 9
- SYS_FGETXATTR = 10
- SYS_LISTXATTR = 11
- SYS_LLISTXATTR = 12
- SYS_FLISTXATTR = 13
- SYS_REMOVEXATTR = 14
- SYS_LREMOVEXATTR = 15
- SYS_FREMOVEXATTR = 16
- SYS_GETCWD = 17
- SYS_LOOKUP_DCOOKIE = 18
- SYS_EVENTFD2 = 19
- SYS_EPOLL_CREATE1 = 20
- SYS_EPOLL_CTL = 21
- SYS_EPOLL_PWAIT = 22
- SYS_DUP = 23
- SYS_DUP3 = 24
- SYS_FCNTL = 25
- SYS_INOTIFY_INIT1 = 26
- SYS_INOTIFY_ADD_WATCH = 27
- SYS_INOTIFY_RM_WATCH = 28
- SYS_IOCTL = 29
- SYS_IOPRIO_SET = 30
- SYS_IOPRIO_GET = 31
- SYS_FLOCK = 32
- SYS_MKNODAT = 33
- SYS_MKDIRAT = 34
- SYS_UNLINKAT = 35
- SYS_SYMLINKAT = 36
- SYS_LINKAT = 37
- SYS_UMOUNT2 = 39
- SYS_MOUNT = 40
- SYS_PIVOT_ROOT = 41
- SYS_NFSSERVCTL = 42
- SYS_STATFS = 43
- SYS_FSTATFS = 44
- SYS_TRUNCATE = 45
- SYS_FTRUNCATE = 46
- SYS_FALLOCATE = 47
- SYS_FACCESSAT = 48
- SYS_CHDIR = 49
- SYS_FCHDIR = 50
- SYS_CHROOT = 51
- SYS_FCHMOD = 52
- SYS_FCHMODAT = 53
- SYS_FCHOWNAT = 54
- SYS_FCHOWN = 55
- SYS_OPENAT = 56
- SYS_CLOSE = 57
- SYS_VHANGUP = 58
- SYS_PIPE2 = 59
- SYS_QUOTACTL = 60
- SYS_GETDENTS64 = 61
- SYS_LSEEK = 62
- SYS_READ = 63
- SYS_WRITE = 64
- SYS_READV = 65
- SYS_WRITEV = 66
- SYS_PREAD64 = 67
- SYS_PWRITE64 = 68
- SYS_PREADV = 69
- SYS_PWRITEV = 70
- SYS_SENDFILE = 71
- SYS_PSELECT6 = 72
- SYS_PPOLL = 73
- SYS_SIGNALFD4 = 74
- SYS_VMSPLICE = 75
- SYS_SPLICE = 76
- SYS_TEE = 77
- SYS_READLINKAT = 78
- SYS_FSTATAT = 79
- SYS_FSTAT = 80
- SYS_SYNC = 81
- SYS_FSYNC = 82
- SYS_FDATASYNC = 83
- SYS_SYNC_FILE_RANGE = 84
- SYS_TIMERFD_CREATE = 85
- SYS_TIMERFD_SETTIME = 86
- SYS_TIMERFD_GETTIME = 87
- SYS_UTIMENSAT = 88
- SYS_ACCT = 89
- SYS_CAPGET = 90
- SYS_CAPSET = 91
- SYS_PERSONALITY = 92
- SYS_EXIT = 93
- SYS_EXIT_GROUP = 94
- SYS_WAITID = 95
- SYS_SET_TID_ADDRESS = 96
- SYS_UNSHARE = 97
- SYS_FUTEX = 98
- SYS_SET_ROBUST_LIST = 99
- SYS_GET_ROBUST_LIST = 100
- SYS_NANOSLEEP = 101
- SYS_GETITIMER = 102
- SYS_SETITIMER = 103
- SYS_KEXEC_LOAD = 104
- SYS_INIT_MODULE = 105
- SYS_DELETE_MODULE = 106
- SYS_TIMER_CREATE = 107
- SYS_TIMER_GETTIME = 108
- SYS_TIMER_GETOVERRUN = 109
- SYS_TIMER_SETTIME = 110
- SYS_TIMER_DELETE = 111
- SYS_CLOCK_SETTIME = 112
- SYS_CLOCK_GETTIME = 113
- SYS_CLOCK_GETRES = 114
- SYS_CLOCK_NANOSLEEP = 115
- SYS_SYSLOG = 116
- SYS_PTRACE = 117
- SYS_SCHED_SETPARAM = 118
- SYS_SCHED_SETSCHEDULER = 119
- SYS_SCHED_GETSCHEDULER = 120
- SYS_SCHED_GETPARAM = 121
- SYS_SCHED_SETAFFINITY = 122
- SYS_SCHED_GETAFFINITY = 123
- SYS_SCHED_YIELD = 124
- SYS_SCHED_GET_PRIORITY_MAX = 125
- SYS_SCHED_GET_PRIORITY_MIN = 126
- SYS_SCHED_RR_GET_INTERVAL = 127
- SYS_RESTART_SYSCALL = 128
- SYS_KILL = 129
- SYS_TKILL = 130
- SYS_TGKILL = 131
- SYS_SIGALTSTACK = 132
- SYS_RT_SIGSUSPEND = 133
- SYS_RT_SIGACTION = 134
- SYS_RT_SIGPROCMASK = 135
- SYS_RT_SIGPENDING = 136
- SYS_RT_SIGTIMEDWAIT = 137
- SYS_RT_SIGQUEUEINFO = 138
- SYS_RT_SIGRETURN = 139
- SYS_SETPRIORITY = 140
- SYS_GETPRIORITY = 141
- SYS_REBOOT = 142
- SYS_SETREGID = 143
- SYS_SETGID = 144
- SYS_SETREUID = 145
- SYS_SETUID = 146
- SYS_SETRESUID = 147
- SYS_GETRESUID = 148
- SYS_SETRESGID = 149
- SYS_GETRESGID = 150
- SYS_SETFSUID = 151
- SYS_SETFSGID = 152
- SYS_TIMES = 153
- SYS_SETPGID = 154
- SYS_GETPGID = 155
- SYS_GETSID = 156
- SYS_SETSID = 157
- SYS_GETGROUPS = 158
- SYS_SETGROUPS = 159
- SYS_UNAME = 160
- SYS_SETHOSTNAME = 161
- SYS_SETDOMAINNAME = 162
- SYS_GETRLIMIT = 163
- SYS_SETRLIMIT = 164
- SYS_GETRUSAGE = 165
- SYS_UMASK = 166
- SYS_PRCTL = 167
- SYS_GETCPU = 168
- SYS_GETTIMEOFDAY = 169
- SYS_SETTIMEOFDAY = 170
- SYS_ADJTIMEX = 171
- SYS_GETPID = 172
- SYS_GETPPID = 173
- SYS_GETUID = 174
- SYS_GETEUID = 175
- SYS_GETGID = 176
- SYS_GETEGID = 177
- SYS_GETTID = 178
- SYS_SYSINFO = 179
- SYS_MQ_OPEN = 180
- SYS_MQ_UNLINK = 181
- SYS_MQ_TIMEDSEND = 182
- SYS_MQ_TIMEDRECEIVE = 183
- SYS_MQ_NOTIFY = 184
- SYS_MQ_GETSETATTR = 185
- SYS_MSGGET = 186
- SYS_MSGCTL = 187
- SYS_MSGRCV = 188
- SYS_MSGSND = 189
- SYS_SEMGET = 190
- SYS_SEMCTL = 191
- SYS_SEMTIMEDOP = 192
- SYS_SEMOP = 193
- SYS_SHMGET = 194
- SYS_SHMCTL = 195
- SYS_SHMAT = 196
- SYS_SHMDT = 197
- SYS_SOCKET = 198
- SYS_SOCKETPAIR = 199
- SYS_BIND = 200
- SYS_LISTEN = 201
- SYS_ACCEPT = 202
- SYS_CONNECT = 203
- SYS_GETSOCKNAME = 204
- SYS_GETPEERNAME = 205
- SYS_SENDTO = 206
- SYS_RECVFROM = 207
- SYS_SETSOCKOPT = 208
- SYS_GETSOCKOPT = 209
- SYS_SHUTDOWN = 210
- SYS_SENDMSG = 211
- SYS_RECVMSG = 212
- SYS_READAHEAD = 213
- SYS_BRK = 214
- SYS_MUNMAP = 215
- SYS_MREMAP = 216
- SYS_ADD_KEY = 217
- SYS_REQUEST_KEY = 218
- SYS_KEYCTL = 219
- SYS_CLONE = 220
- SYS_EXECVE = 221
- SYS_MMAP = 222
- SYS_FADVISE64 = 223
- SYS_SWAPON = 224
- SYS_SWAPOFF = 225
- SYS_MPROTECT = 226
- SYS_MSYNC = 227
- SYS_MLOCK = 228
- SYS_MUNLOCK = 229
- SYS_MLOCKALL = 230
- SYS_MUNLOCKALL = 231
- SYS_MINCORE = 232
- SYS_MADVISE = 233
- SYS_REMAP_FILE_PAGES = 234
- SYS_MBIND = 235
- SYS_GET_MEMPOLICY = 236
- SYS_SET_MEMPOLICY = 237
- SYS_MIGRATE_PAGES = 238
- SYS_MOVE_PAGES = 239
- SYS_RT_TGSIGQUEUEINFO = 240
- SYS_PERF_EVENT_OPEN = 241
- SYS_ACCEPT4 = 242
- SYS_RECVMMSG = 243
- SYS_ARCH_SPECIFIC_SYSCALL = 244
- SYS_WAIT4 = 260
- SYS_PRLIMIT64 = 261
- SYS_FANOTIFY_INIT = 262
- SYS_FANOTIFY_MARK = 263
- SYS_NAME_TO_HANDLE_AT = 264
- SYS_OPEN_BY_HANDLE_AT = 265
- SYS_CLOCK_ADJTIME = 266
- SYS_SYNCFS = 267
- SYS_SETNS = 268
- SYS_SENDMMSG = 269
- SYS_PROCESS_VM_READV = 270
- SYS_PROCESS_VM_WRITEV = 271
- SYS_KCMP = 272
- SYS_FINIT_MODULE = 273
- SYS_SCHED_SETATTR = 274
- SYS_SCHED_GETATTR = 275
- SYS_RENAMEAT2 = 276
- SYS_SECCOMP = 277
- SYS_GETRANDOM = 278
- SYS_MEMFD_CREATE = 279
- SYS_BPF = 280
- SYS_EXECVEAT = 281
- SYS_USERFAULTFD = 282
- SYS_MEMBARRIER = 283
- SYS_MLOCK2 = 284
- SYS_COPY_FILE_RANGE = 285
- SYS_PREADV2 = 286
- SYS_PWRITEV2 = 287
- SYS_PKEY_MPROTECT = 288
- SYS_PKEY_ALLOC = 289
- SYS_PKEY_FREE = 290
- SYS_STATX = 291
- SYS_IO_PGETEVENTS = 292
- SYS_RSEQ = 293
- SYS_KEXEC_FILE_LOAD = 294
- SYS_PIDFD_SEND_SIGNAL = 424
- SYS_IO_URING_SETUP = 425
- SYS_IO_URING_ENTER = 426
- SYS_IO_URING_REGISTER = 427
- SYS_OPEN_TREE = 428
- SYS_MOVE_MOUNT = 429
- SYS_FSOPEN = 430
- SYS_FSCONFIG = 431
- SYS_FSMOUNT = 432
- SYS_FSPICK = 433
- SYS_PIDFD_OPEN = 434
- SYS_CLONE3 = 435
- SYS_CLOSE_RANGE = 436
- SYS_OPENAT2 = 437
- SYS_PIDFD_GETFD = 438
- SYS_FACCESSAT2 = 439
- SYS_PROCESS_MADVISE = 440
- SYS_EPOLL_PWAIT2 = 441
+ SYS_IO_SETUP = 0
+ SYS_IO_DESTROY = 1
+ SYS_IO_SUBMIT = 2
+ SYS_IO_CANCEL = 3
+ SYS_IO_GETEVENTS = 4
+ SYS_SETXATTR = 5
+ SYS_LSETXATTR = 6
+ SYS_FSETXATTR = 7
+ SYS_GETXATTR = 8
+ SYS_LGETXATTR = 9
+ SYS_FGETXATTR = 10
+ SYS_LISTXATTR = 11
+ SYS_LLISTXATTR = 12
+ SYS_FLISTXATTR = 13
+ SYS_REMOVEXATTR = 14
+ SYS_LREMOVEXATTR = 15
+ SYS_FREMOVEXATTR = 16
+ SYS_GETCWD = 17
+ SYS_LOOKUP_DCOOKIE = 18
+ SYS_EVENTFD2 = 19
+ SYS_EPOLL_CREATE1 = 20
+ SYS_EPOLL_CTL = 21
+ SYS_EPOLL_PWAIT = 22
+ SYS_DUP = 23
+ SYS_DUP3 = 24
+ SYS_FCNTL = 25
+ SYS_INOTIFY_INIT1 = 26
+ SYS_INOTIFY_ADD_WATCH = 27
+ SYS_INOTIFY_RM_WATCH = 28
+ SYS_IOCTL = 29
+ SYS_IOPRIO_SET = 30
+ SYS_IOPRIO_GET = 31
+ SYS_FLOCK = 32
+ SYS_MKNODAT = 33
+ SYS_MKDIRAT = 34
+ SYS_UNLINKAT = 35
+ SYS_SYMLINKAT = 36
+ SYS_LINKAT = 37
+ SYS_UMOUNT2 = 39
+ SYS_MOUNT = 40
+ SYS_PIVOT_ROOT = 41
+ SYS_NFSSERVCTL = 42
+ SYS_STATFS = 43
+ SYS_FSTATFS = 44
+ SYS_TRUNCATE = 45
+ SYS_FTRUNCATE = 46
+ SYS_FALLOCATE = 47
+ SYS_FACCESSAT = 48
+ SYS_CHDIR = 49
+ SYS_FCHDIR = 50
+ SYS_CHROOT = 51
+ SYS_FCHMOD = 52
+ SYS_FCHMODAT = 53
+ SYS_FCHOWNAT = 54
+ SYS_FCHOWN = 55
+ SYS_OPENAT = 56
+ SYS_CLOSE = 57
+ SYS_VHANGUP = 58
+ SYS_PIPE2 = 59
+ SYS_QUOTACTL = 60
+ SYS_GETDENTS64 = 61
+ SYS_LSEEK = 62
+ SYS_READ = 63
+ SYS_WRITE = 64
+ SYS_READV = 65
+ SYS_WRITEV = 66
+ SYS_PREAD64 = 67
+ SYS_PWRITE64 = 68
+ SYS_PREADV = 69
+ SYS_PWRITEV = 70
+ SYS_SENDFILE = 71
+ SYS_PSELECT6 = 72
+ SYS_PPOLL = 73
+ SYS_SIGNALFD4 = 74
+ SYS_VMSPLICE = 75
+ SYS_SPLICE = 76
+ SYS_TEE = 77
+ SYS_READLINKAT = 78
+ SYS_FSTATAT = 79
+ SYS_FSTAT = 80
+ SYS_SYNC = 81
+ SYS_FSYNC = 82
+ SYS_FDATASYNC = 83
+ SYS_SYNC_FILE_RANGE = 84
+ SYS_TIMERFD_CREATE = 85
+ SYS_TIMERFD_SETTIME = 86
+ SYS_TIMERFD_GETTIME = 87
+ SYS_UTIMENSAT = 88
+ SYS_ACCT = 89
+ SYS_CAPGET = 90
+ SYS_CAPSET = 91
+ SYS_PERSONALITY = 92
+ SYS_EXIT = 93
+ SYS_EXIT_GROUP = 94
+ SYS_WAITID = 95
+ SYS_SET_TID_ADDRESS = 96
+ SYS_UNSHARE = 97
+ SYS_FUTEX = 98
+ SYS_SET_ROBUST_LIST = 99
+ SYS_GET_ROBUST_LIST = 100
+ SYS_NANOSLEEP = 101
+ SYS_GETITIMER = 102
+ SYS_SETITIMER = 103
+ SYS_KEXEC_LOAD = 104
+ SYS_INIT_MODULE = 105
+ SYS_DELETE_MODULE = 106
+ SYS_TIMER_CREATE = 107
+ SYS_TIMER_GETTIME = 108
+ SYS_TIMER_GETOVERRUN = 109
+ SYS_TIMER_SETTIME = 110
+ SYS_TIMER_DELETE = 111
+ SYS_CLOCK_SETTIME = 112
+ SYS_CLOCK_GETTIME = 113
+ SYS_CLOCK_GETRES = 114
+ SYS_CLOCK_NANOSLEEP = 115
+ SYS_SYSLOG = 116
+ SYS_PTRACE = 117
+ SYS_SCHED_SETPARAM = 118
+ SYS_SCHED_SETSCHEDULER = 119
+ SYS_SCHED_GETSCHEDULER = 120
+ SYS_SCHED_GETPARAM = 121
+ SYS_SCHED_SETAFFINITY = 122
+ SYS_SCHED_GETAFFINITY = 123
+ SYS_SCHED_YIELD = 124
+ SYS_SCHED_GET_PRIORITY_MAX = 125
+ SYS_SCHED_GET_PRIORITY_MIN = 126
+ SYS_SCHED_RR_GET_INTERVAL = 127
+ SYS_RESTART_SYSCALL = 128
+ SYS_KILL = 129
+ SYS_TKILL = 130
+ SYS_TGKILL = 131
+ SYS_SIGALTSTACK = 132
+ SYS_RT_SIGSUSPEND = 133
+ SYS_RT_SIGACTION = 134
+ SYS_RT_SIGPROCMASK = 135
+ SYS_RT_SIGPENDING = 136
+ SYS_RT_SIGTIMEDWAIT = 137
+ SYS_RT_SIGQUEUEINFO = 138
+ SYS_RT_SIGRETURN = 139
+ SYS_SETPRIORITY = 140
+ SYS_GETPRIORITY = 141
+ SYS_REBOOT = 142
+ SYS_SETREGID = 143
+ SYS_SETGID = 144
+ SYS_SETREUID = 145
+ SYS_SETUID = 146
+ SYS_SETRESUID = 147
+ SYS_GETRESUID = 148
+ SYS_SETRESGID = 149
+ SYS_GETRESGID = 150
+ SYS_SETFSUID = 151
+ SYS_SETFSGID = 152
+ SYS_TIMES = 153
+ SYS_SETPGID = 154
+ SYS_GETPGID = 155
+ SYS_GETSID = 156
+ SYS_SETSID = 157
+ SYS_GETGROUPS = 158
+ SYS_SETGROUPS = 159
+ SYS_UNAME = 160
+ SYS_SETHOSTNAME = 161
+ SYS_SETDOMAINNAME = 162
+ SYS_GETRLIMIT = 163
+ SYS_SETRLIMIT = 164
+ SYS_GETRUSAGE = 165
+ SYS_UMASK = 166
+ SYS_PRCTL = 167
+ SYS_GETCPU = 168
+ SYS_GETTIMEOFDAY = 169
+ SYS_SETTIMEOFDAY = 170
+ SYS_ADJTIMEX = 171
+ SYS_GETPID = 172
+ SYS_GETPPID = 173
+ SYS_GETUID = 174
+ SYS_GETEUID = 175
+ SYS_GETGID = 176
+ SYS_GETEGID = 177
+ SYS_GETTID = 178
+ SYS_SYSINFO = 179
+ SYS_MQ_OPEN = 180
+ SYS_MQ_UNLINK = 181
+ SYS_MQ_TIMEDSEND = 182
+ SYS_MQ_TIMEDRECEIVE = 183
+ SYS_MQ_NOTIFY = 184
+ SYS_MQ_GETSETATTR = 185
+ SYS_MSGGET = 186
+ SYS_MSGCTL = 187
+ SYS_MSGRCV = 188
+ SYS_MSGSND = 189
+ SYS_SEMGET = 190
+ SYS_SEMCTL = 191
+ SYS_SEMTIMEDOP = 192
+ SYS_SEMOP = 193
+ SYS_SHMGET = 194
+ SYS_SHMCTL = 195
+ SYS_SHMAT = 196
+ SYS_SHMDT = 197
+ SYS_SOCKET = 198
+ SYS_SOCKETPAIR = 199
+ SYS_BIND = 200
+ SYS_LISTEN = 201
+ SYS_ACCEPT = 202
+ SYS_CONNECT = 203
+ SYS_GETSOCKNAME = 204
+ SYS_GETPEERNAME = 205
+ SYS_SENDTO = 206
+ SYS_RECVFROM = 207
+ SYS_SETSOCKOPT = 208
+ SYS_GETSOCKOPT = 209
+ SYS_SHUTDOWN = 210
+ SYS_SENDMSG = 211
+ SYS_RECVMSG = 212
+ SYS_READAHEAD = 213
+ SYS_BRK = 214
+ SYS_MUNMAP = 215
+ SYS_MREMAP = 216
+ SYS_ADD_KEY = 217
+ SYS_REQUEST_KEY = 218
+ SYS_KEYCTL = 219
+ SYS_CLONE = 220
+ SYS_EXECVE = 221
+ SYS_MMAP = 222
+ SYS_FADVISE64 = 223
+ SYS_SWAPON = 224
+ SYS_SWAPOFF = 225
+ SYS_MPROTECT = 226
+ SYS_MSYNC = 227
+ SYS_MLOCK = 228
+ SYS_MUNLOCK = 229
+ SYS_MLOCKALL = 230
+ SYS_MUNLOCKALL = 231
+ SYS_MINCORE = 232
+ SYS_MADVISE = 233
+ SYS_REMAP_FILE_PAGES = 234
+ SYS_MBIND = 235
+ SYS_GET_MEMPOLICY = 236
+ SYS_SET_MEMPOLICY = 237
+ SYS_MIGRATE_PAGES = 238
+ SYS_MOVE_PAGES = 239
+ SYS_RT_TGSIGQUEUEINFO = 240
+ SYS_PERF_EVENT_OPEN = 241
+ SYS_ACCEPT4 = 242
+ SYS_RECVMMSG = 243
+ SYS_ARCH_SPECIFIC_SYSCALL = 244
+ SYS_WAIT4 = 260
+ SYS_PRLIMIT64 = 261
+ SYS_FANOTIFY_INIT = 262
+ SYS_FANOTIFY_MARK = 263
+ SYS_NAME_TO_HANDLE_AT = 264
+ SYS_OPEN_BY_HANDLE_AT = 265
+ SYS_CLOCK_ADJTIME = 266
+ SYS_SYNCFS = 267
+ SYS_SETNS = 268
+ SYS_SENDMMSG = 269
+ SYS_PROCESS_VM_READV = 270
+ SYS_PROCESS_VM_WRITEV = 271
+ SYS_KCMP = 272
+ SYS_FINIT_MODULE = 273
+ SYS_SCHED_SETATTR = 274
+ SYS_SCHED_GETATTR = 275
+ SYS_RENAMEAT2 = 276
+ SYS_SECCOMP = 277
+ SYS_GETRANDOM = 278
+ SYS_MEMFD_CREATE = 279
+ SYS_BPF = 280
+ SYS_EXECVEAT = 281
+ SYS_USERFAULTFD = 282
+ SYS_MEMBARRIER = 283
+ SYS_MLOCK2 = 284
+ SYS_COPY_FILE_RANGE = 285
+ SYS_PREADV2 = 286
+ SYS_PWRITEV2 = 287
+ SYS_PKEY_MPROTECT = 288
+ SYS_PKEY_ALLOC = 289
+ SYS_PKEY_FREE = 290
+ SYS_STATX = 291
+ SYS_IO_PGETEVENTS = 292
+ SYS_RSEQ = 293
+ SYS_KEXEC_FILE_LOAD = 294
+ SYS_PIDFD_SEND_SIGNAL = 424
+ SYS_IO_URING_SETUP = 425
+ SYS_IO_URING_ENTER = 426
+ SYS_IO_URING_REGISTER = 427
+ SYS_OPEN_TREE = 428
+ SYS_MOVE_MOUNT = 429
+ SYS_FSOPEN = 430
+ SYS_FSCONFIG = 431
+ SYS_FSMOUNT = 432
+ SYS_FSPICK = 433
+ SYS_PIDFD_OPEN = 434
+ SYS_CLONE3 = 435
+ SYS_CLOSE_RANGE = 436
+ SYS_OPENAT2 = 437
+ SYS_PIDFD_GETFD = 438
+ SYS_FACCESSAT2 = 439
+ SYS_PROCESS_MADVISE = 440
+ SYS_EPOLL_PWAIT2 = 441
+ SYS_MOUNT_SETATTR = 442
+ SYS_QUOTACTL_FD = 443
+ SYS_LANDLOCK_CREATE_RULESET = 444
+ SYS_LANDLOCK_ADD_RULE = 445
+ SYS_LANDLOCK_RESTRICT_SELF = 446
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
index 8e53a9e8c..3e791e6cd 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
@@ -7,364 +7,369 @@
package unix
const (
- SYS_EXIT = 1
- SYS_FORK = 2
- SYS_READ = 3
- SYS_WRITE = 4
- SYS_OPEN = 5
- SYS_CLOSE = 6
- SYS_RESTART_SYSCALL = 7
- SYS_CREAT = 8
- SYS_LINK = 9
- SYS_UNLINK = 10
- SYS_EXECVE = 11
- SYS_CHDIR = 12
- SYS_MKNOD = 14
- SYS_CHMOD = 15
- SYS_LSEEK = 19
- SYS_GETPID = 20
- SYS_MOUNT = 21
- SYS_UMOUNT = 22
- SYS_PTRACE = 26
- SYS_ALARM = 27
- SYS_PAUSE = 29
- SYS_UTIME = 30
- SYS_ACCESS = 33
- SYS_NICE = 34
- SYS_SYNC = 36
- SYS_KILL = 37
- SYS_RENAME = 38
- SYS_MKDIR = 39
- SYS_RMDIR = 40
- SYS_DUP = 41
- SYS_PIPE = 42
- SYS_TIMES = 43
- SYS_BRK = 45
- SYS_SIGNAL = 48
- SYS_ACCT = 51
- SYS_UMOUNT2 = 52
- SYS_IOCTL = 54
- SYS_FCNTL = 55
- SYS_SETPGID = 57
- SYS_UMASK = 60
- SYS_CHROOT = 61
- SYS_USTAT = 62
- SYS_DUP2 = 63
- SYS_GETPPID = 64
- SYS_GETPGRP = 65
- SYS_SETSID = 66
- SYS_SIGACTION = 67
- SYS_SIGSUSPEND = 72
- SYS_SIGPENDING = 73
- SYS_SETHOSTNAME = 74
- SYS_SETRLIMIT = 75
- SYS_GETRUSAGE = 77
- SYS_GETTIMEOFDAY = 78
- SYS_SETTIMEOFDAY = 79
- SYS_SYMLINK = 83
- SYS_READLINK = 85
- SYS_USELIB = 86
- SYS_SWAPON = 87
- SYS_REBOOT = 88
- SYS_READDIR = 89
- SYS_MMAP = 90
- SYS_MUNMAP = 91
- SYS_TRUNCATE = 92
- SYS_FTRUNCATE = 93
- SYS_FCHMOD = 94
- SYS_GETPRIORITY = 96
- SYS_SETPRIORITY = 97
- SYS_STATFS = 99
- SYS_FSTATFS = 100
- SYS_SOCKETCALL = 102
- SYS_SYSLOG = 103
- SYS_SETITIMER = 104
- SYS_GETITIMER = 105
- SYS_STAT = 106
- SYS_LSTAT = 107
- SYS_FSTAT = 108
- SYS_LOOKUP_DCOOKIE = 110
- SYS_VHANGUP = 111
- SYS_IDLE = 112
- SYS_WAIT4 = 114
- SYS_SWAPOFF = 115
- SYS_SYSINFO = 116
- SYS_IPC = 117
- SYS_FSYNC = 118
- SYS_SIGRETURN = 119
- SYS_CLONE = 120
- SYS_SETDOMAINNAME = 121
- SYS_UNAME = 122
- SYS_ADJTIMEX = 124
- SYS_MPROTECT = 125
- SYS_SIGPROCMASK = 126
- SYS_CREATE_MODULE = 127
- SYS_INIT_MODULE = 128
- SYS_DELETE_MODULE = 129
- SYS_GET_KERNEL_SYMS = 130
- SYS_QUOTACTL = 131
- SYS_GETPGID = 132
- SYS_FCHDIR = 133
- SYS_BDFLUSH = 134
- SYS_SYSFS = 135
- SYS_PERSONALITY = 136
- SYS_AFS_SYSCALL = 137
- SYS_GETDENTS = 141
- SYS_SELECT = 142
- SYS_FLOCK = 143
- SYS_MSYNC = 144
- SYS_READV = 145
- SYS_WRITEV = 146
- SYS_GETSID = 147
- SYS_FDATASYNC = 148
- SYS__SYSCTL = 149
- SYS_MLOCK = 150
- SYS_MUNLOCK = 151
- SYS_MLOCKALL = 152
- SYS_MUNLOCKALL = 153
- SYS_SCHED_SETPARAM = 154
- SYS_SCHED_GETPARAM = 155
- SYS_SCHED_SETSCHEDULER = 156
- SYS_SCHED_GETSCHEDULER = 157
- SYS_SCHED_YIELD = 158
- SYS_SCHED_GET_PRIORITY_MAX = 159
- SYS_SCHED_GET_PRIORITY_MIN = 160
- SYS_SCHED_RR_GET_INTERVAL = 161
- SYS_NANOSLEEP = 162
- SYS_MREMAP = 163
- SYS_QUERY_MODULE = 167
- SYS_POLL = 168
- SYS_NFSSERVCTL = 169
- SYS_PRCTL = 172
- SYS_RT_SIGRETURN = 173
- SYS_RT_SIGACTION = 174
- SYS_RT_SIGPROCMASK = 175
- SYS_RT_SIGPENDING = 176
- SYS_RT_SIGTIMEDWAIT = 177
- SYS_RT_SIGQUEUEINFO = 178
- SYS_RT_SIGSUSPEND = 179
- SYS_PREAD64 = 180
- SYS_PWRITE64 = 181
- SYS_GETCWD = 183
- SYS_CAPGET = 184
- SYS_CAPSET = 185
- SYS_SIGALTSTACK = 186
- SYS_SENDFILE = 187
- SYS_GETPMSG = 188
- SYS_PUTPMSG = 189
- SYS_VFORK = 190
- SYS_GETRLIMIT = 191
- SYS_LCHOWN = 198
- SYS_GETUID = 199
- SYS_GETGID = 200
- SYS_GETEUID = 201
- SYS_GETEGID = 202
- SYS_SETREUID = 203
- SYS_SETREGID = 204
- SYS_GETGROUPS = 205
- SYS_SETGROUPS = 206
- SYS_FCHOWN = 207
- SYS_SETRESUID = 208
- SYS_GETRESUID = 209
- SYS_SETRESGID = 210
- SYS_GETRESGID = 211
- SYS_CHOWN = 212
- SYS_SETUID = 213
- SYS_SETGID = 214
- SYS_SETFSUID = 215
- SYS_SETFSGID = 216
- SYS_PIVOT_ROOT = 217
- SYS_MINCORE = 218
- SYS_MADVISE = 219
- SYS_GETDENTS64 = 220
- SYS_READAHEAD = 222
- SYS_SETXATTR = 224
- SYS_LSETXATTR = 225
- SYS_FSETXATTR = 226
- SYS_GETXATTR = 227
- SYS_LGETXATTR = 228
- SYS_FGETXATTR = 229
- SYS_LISTXATTR = 230
- SYS_LLISTXATTR = 231
- SYS_FLISTXATTR = 232
- SYS_REMOVEXATTR = 233
- SYS_LREMOVEXATTR = 234
- SYS_FREMOVEXATTR = 235
- SYS_GETTID = 236
- SYS_TKILL = 237
- SYS_FUTEX = 238
- SYS_SCHED_SETAFFINITY = 239
- SYS_SCHED_GETAFFINITY = 240
- SYS_TGKILL = 241
- SYS_IO_SETUP = 243
- SYS_IO_DESTROY = 244
- SYS_IO_GETEVENTS = 245
- SYS_IO_SUBMIT = 246
- SYS_IO_CANCEL = 247
- SYS_EXIT_GROUP = 248
- SYS_EPOLL_CREATE = 249
- SYS_EPOLL_CTL = 250
- SYS_EPOLL_WAIT = 251
- SYS_SET_TID_ADDRESS = 252
- SYS_FADVISE64 = 253
- SYS_TIMER_CREATE = 254
- SYS_TIMER_SETTIME = 255
- SYS_TIMER_GETTIME = 256
- SYS_TIMER_GETOVERRUN = 257
- SYS_TIMER_DELETE = 258
- SYS_CLOCK_SETTIME = 259
- SYS_CLOCK_GETTIME = 260
- SYS_CLOCK_GETRES = 261
- SYS_CLOCK_NANOSLEEP = 262
- SYS_STATFS64 = 265
- SYS_FSTATFS64 = 266
- SYS_REMAP_FILE_PAGES = 267
- SYS_MBIND = 268
- SYS_GET_MEMPOLICY = 269
- SYS_SET_MEMPOLICY = 270
- SYS_MQ_OPEN = 271
- SYS_MQ_UNLINK = 272
- SYS_MQ_TIMEDSEND = 273
- SYS_MQ_TIMEDRECEIVE = 274
- SYS_MQ_NOTIFY = 275
- SYS_MQ_GETSETATTR = 276
- SYS_KEXEC_LOAD = 277
- SYS_ADD_KEY = 278
- SYS_REQUEST_KEY = 279
- SYS_KEYCTL = 280
- SYS_WAITID = 281
- SYS_IOPRIO_SET = 282
- SYS_IOPRIO_GET = 283
- SYS_INOTIFY_INIT = 284
- SYS_INOTIFY_ADD_WATCH = 285
- SYS_INOTIFY_RM_WATCH = 286
- SYS_MIGRATE_PAGES = 287
- SYS_OPENAT = 288
- SYS_MKDIRAT = 289
- SYS_MKNODAT = 290
- SYS_FCHOWNAT = 291
- SYS_FUTIMESAT = 292
- SYS_NEWFSTATAT = 293
- SYS_UNLINKAT = 294
- SYS_RENAMEAT = 295
- SYS_LINKAT = 296
- SYS_SYMLINKAT = 297
- SYS_READLINKAT = 298
- SYS_FCHMODAT = 299
- SYS_FACCESSAT = 300
- SYS_PSELECT6 = 301
- SYS_PPOLL = 302
- SYS_UNSHARE = 303
- SYS_SET_ROBUST_LIST = 304
- SYS_GET_ROBUST_LIST = 305
- SYS_SPLICE = 306
- SYS_SYNC_FILE_RANGE = 307
- SYS_TEE = 308
- SYS_VMSPLICE = 309
- SYS_MOVE_PAGES = 310
- SYS_GETCPU = 311
- SYS_EPOLL_PWAIT = 312
- SYS_UTIMES = 313
- SYS_FALLOCATE = 314
- SYS_UTIMENSAT = 315
- SYS_SIGNALFD = 316
- SYS_TIMERFD = 317
- SYS_EVENTFD = 318
- SYS_TIMERFD_CREATE = 319
- SYS_TIMERFD_SETTIME = 320
- SYS_TIMERFD_GETTIME = 321
- SYS_SIGNALFD4 = 322
- SYS_EVENTFD2 = 323
- SYS_INOTIFY_INIT1 = 324
- SYS_PIPE2 = 325
- SYS_DUP3 = 326
- SYS_EPOLL_CREATE1 = 327
- SYS_PREADV = 328
- SYS_PWRITEV = 329
- SYS_RT_TGSIGQUEUEINFO = 330
- SYS_PERF_EVENT_OPEN = 331
- SYS_FANOTIFY_INIT = 332
- SYS_FANOTIFY_MARK = 333
- SYS_PRLIMIT64 = 334
- SYS_NAME_TO_HANDLE_AT = 335
- SYS_OPEN_BY_HANDLE_AT = 336
- SYS_CLOCK_ADJTIME = 337
- SYS_SYNCFS = 338
- SYS_SETNS = 339
- SYS_PROCESS_VM_READV = 340
- SYS_PROCESS_VM_WRITEV = 341
- SYS_S390_RUNTIME_INSTR = 342
- SYS_KCMP = 343
- SYS_FINIT_MODULE = 344
- SYS_SCHED_SETATTR = 345
- SYS_SCHED_GETATTR = 346
- SYS_RENAMEAT2 = 347
- SYS_SECCOMP = 348
- SYS_GETRANDOM = 349
- SYS_MEMFD_CREATE = 350
- SYS_BPF = 351
- SYS_S390_PCI_MMIO_WRITE = 352
- SYS_S390_PCI_MMIO_READ = 353
- SYS_EXECVEAT = 354
- SYS_USERFAULTFD = 355
- SYS_MEMBARRIER = 356
- SYS_RECVMMSG = 357
- SYS_SENDMMSG = 358
- SYS_SOCKET = 359
- SYS_SOCKETPAIR = 360
- SYS_BIND = 361
- SYS_CONNECT = 362
- SYS_LISTEN = 363
- SYS_ACCEPT4 = 364
- SYS_GETSOCKOPT = 365
- SYS_SETSOCKOPT = 366
- SYS_GETSOCKNAME = 367
- SYS_GETPEERNAME = 368
- SYS_SENDTO = 369
- SYS_SENDMSG = 370
- SYS_RECVFROM = 371
- SYS_RECVMSG = 372
- SYS_SHUTDOWN = 373
- SYS_MLOCK2 = 374
- SYS_COPY_FILE_RANGE = 375
- SYS_PREADV2 = 376
- SYS_PWRITEV2 = 377
- SYS_S390_GUARDED_STORAGE = 378
- SYS_STATX = 379
- SYS_S390_STHYI = 380
- SYS_KEXEC_FILE_LOAD = 381
- SYS_IO_PGETEVENTS = 382
- SYS_RSEQ = 383
- SYS_PKEY_MPROTECT = 384
- SYS_PKEY_ALLOC = 385
- SYS_PKEY_FREE = 386
- SYS_SEMTIMEDOP = 392
- SYS_SEMGET = 393
- SYS_SEMCTL = 394
- SYS_SHMGET = 395
- SYS_SHMCTL = 396
- SYS_SHMAT = 397
- SYS_SHMDT = 398
- SYS_MSGGET = 399
- SYS_MSGSND = 400
- SYS_MSGRCV = 401
- SYS_MSGCTL = 402
- SYS_PIDFD_SEND_SIGNAL = 424
- SYS_IO_URING_SETUP = 425
- SYS_IO_URING_ENTER = 426
- SYS_IO_URING_REGISTER = 427
- SYS_OPEN_TREE = 428
- SYS_MOVE_MOUNT = 429
- SYS_FSOPEN = 430
- SYS_FSCONFIG = 431
- SYS_FSMOUNT = 432
- SYS_FSPICK = 433
- SYS_PIDFD_OPEN = 434
- SYS_CLONE3 = 435
- SYS_CLOSE_RANGE = 436
- SYS_OPENAT2 = 437
- SYS_PIDFD_GETFD = 438
- SYS_FACCESSAT2 = 439
- SYS_PROCESS_MADVISE = 440
- SYS_EPOLL_PWAIT2 = 441
+ SYS_EXIT = 1
+ SYS_FORK = 2
+ SYS_READ = 3
+ SYS_WRITE = 4
+ SYS_OPEN = 5
+ SYS_CLOSE = 6
+ SYS_RESTART_SYSCALL = 7
+ SYS_CREAT = 8
+ SYS_LINK = 9
+ SYS_UNLINK = 10
+ SYS_EXECVE = 11
+ SYS_CHDIR = 12
+ SYS_MKNOD = 14
+ SYS_CHMOD = 15
+ SYS_LSEEK = 19
+ SYS_GETPID = 20
+ SYS_MOUNT = 21
+ SYS_UMOUNT = 22
+ SYS_PTRACE = 26
+ SYS_ALARM = 27
+ SYS_PAUSE = 29
+ SYS_UTIME = 30
+ SYS_ACCESS = 33
+ SYS_NICE = 34
+ SYS_SYNC = 36
+ SYS_KILL = 37
+ SYS_RENAME = 38
+ SYS_MKDIR = 39
+ SYS_RMDIR = 40
+ SYS_DUP = 41
+ SYS_PIPE = 42
+ SYS_TIMES = 43
+ SYS_BRK = 45
+ SYS_SIGNAL = 48
+ SYS_ACCT = 51
+ SYS_UMOUNT2 = 52
+ SYS_IOCTL = 54
+ SYS_FCNTL = 55
+ SYS_SETPGID = 57
+ SYS_UMASK = 60
+ SYS_CHROOT = 61
+ SYS_USTAT = 62
+ SYS_DUP2 = 63
+ SYS_GETPPID = 64
+ SYS_GETPGRP = 65
+ SYS_SETSID = 66
+ SYS_SIGACTION = 67
+ SYS_SIGSUSPEND = 72
+ SYS_SIGPENDING = 73
+ SYS_SETHOSTNAME = 74
+ SYS_SETRLIMIT = 75
+ SYS_GETRUSAGE = 77
+ SYS_GETTIMEOFDAY = 78
+ SYS_SETTIMEOFDAY = 79
+ SYS_SYMLINK = 83
+ SYS_READLINK = 85
+ SYS_USELIB = 86
+ SYS_SWAPON = 87
+ SYS_REBOOT = 88
+ SYS_READDIR = 89
+ SYS_MMAP = 90
+ SYS_MUNMAP = 91
+ SYS_TRUNCATE = 92
+ SYS_FTRUNCATE = 93
+ SYS_FCHMOD = 94
+ SYS_GETPRIORITY = 96
+ SYS_SETPRIORITY = 97
+ SYS_STATFS = 99
+ SYS_FSTATFS = 100
+ SYS_SOCKETCALL = 102
+ SYS_SYSLOG = 103
+ SYS_SETITIMER = 104
+ SYS_GETITIMER = 105
+ SYS_STAT = 106
+ SYS_LSTAT = 107
+ SYS_FSTAT = 108
+ SYS_LOOKUP_DCOOKIE = 110
+ SYS_VHANGUP = 111
+ SYS_IDLE = 112
+ SYS_WAIT4 = 114
+ SYS_SWAPOFF = 115
+ SYS_SYSINFO = 116
+ SYS_IPC = 117
+ SYS_FSYNC = 118
+ SYS_SIGRETURN = 119
+ SYS_CLONE = 120
+ SYS_SETDOMAINNAME = 121
+ SYS_UNAME = 122
+ SYS_ADJTIMEX = 124
+ SYS_MPROTECT = 125
+ SYS_SIGPROCMASK = 126
+ SYS_CREATE_MODULE = 127
+ SYS_INIT_MODULE = 128
+ SYS_DELETE_MODULE = 129
+ SYS_GET_KERNEL_SYMS = 130
+ SYS_QUOTACTL = 131
+ SYS_GETPGID = 132
+ SYS_FCHDIR = 133
+ SYS_BDFLUSH = 134
+ SYS_SYSFS = 135
+ SYS_PERSONALITY = 136
+ SYS_AFS_SYSCALL = 137
+ SYS_GETDENTS = 141
+ SYS_SELECT = 142
+ SYS_FLOCK = 143
+ SYS_MSYNC = 144
+ SYS_READV = 145
+ SYS_WRITEV = 146
+ SYS_GETSID = 147
+ SYS_FDATASYNC = 148
+ SYS__SYSCTL = 149
+ SYS_MLOCK = 150
+ SYS_MUNLOCK = 151
+ SYS_MLOCKALL = 152
+ SYS_MUNLOCKALL = 153
+ SYS_SCHED_SETPARAM = 154
+ SYS_SCHED_GETPARAM = 155
+ SYS_SCHED_SETSCHEDULER = 156
+ SYS_SCHED_GETSCHEDULER = 157
+ SYS_SCHED_YIELD = 158
+ SYS_SCHED_GET_PRIORITY_MAX = 159
+ SYS_SCHED_GET_PRIORITY_MIN = 160
+ SYS_SCHED_RR_GET_INTERVAL = 161
+ SYS_NANOSLEEP = 162
+ SYS_MREMAP = 163
+ SYS_QUERY_MODULE = 167
+ SYS_POLL = 168
+ SYS_NFSSERVCTL = 169
+ SYS_PRCTL = 172
+ SYS_RT_SIGRETURN = 173
+ SYS_RT_SIGACTION = 174
+ SYS_RT_SIGPROCMASK = 175
+ SYS_RT_SIGPENDING = 176
+ SYS_RT_SIGTIMEDWAIT = 177
+ SYS_RT_SIGQUEUEINFO = 178
+ SYS_RT_SIGSUSPEND = 179
+ SYS_PREAD64 = 180
+ SYS_PWRITE64 = 181
+ SYS_GETCWD = 183
+ SYS_CAPGET = 184
+ SYS_CAPSET = 185
+ SYS_SIGALTSTACK = 186
+ SYS_SENDFILE = 187
+ SYS_GETPMSG = 188
+ SYS_PUTPMSG = 189
+ SYS_VFORK = 190
+ SYS_GETRLIMIT = 191
+ SYS_LCHOWN = 198
+ SYS_GETUID = 199
+ SYS_GETGID = 200
+ SYS_GETEUID = 201
+ SYS_GETEGID = 202
+ SYS_SETREUID = 203
+ SYS_SETREGID = 204
+ SYS_GETGROUPS = 205
+ SYS_SETGROUPS = 206
+ SYS_FCHOWN = 207
+ SYS_SETRESUID = 208
+ SYS_GETRESUID = 209
+ SYS_SETRESGID = 210
+ SYS_GETRESGID = 211
+ SYS_CHOWN = 212
+ SYS_SETUID = 213
+ SYS_SETGID = 214
+ SYS_SETFSUID = 215
+ SYS_SETFSGID = 216
+ SYS_PIVOT_ROOT = 217
+ SYS_MINCORE = 218
+ SYS_MADVISE = 219
+ SYS_GETDENTS64 = 220
+ SYS_READAHEAD = 222
+ SYS_SETXATTR = 224
+ SYS_LSETXATTR = 225
+ SYS_FSETXATTR = 226
+ SYS_GETXATTR = 227
+ SYS_LGETXATTR = 228
+ SYS_FGETXATTR = 229
+ SYS_LISTXATTR = 230
+ SYS_LLISTXATTR = 231
+ SYS_FLISTXATTR = 232
+ SYS_REMOVEXATTR = 233
+ SYS_LREMOVEXATTR = 234
+ SYS_FREMOVEXATTR = 235
+ SYS_GETTID = 236
+ SYS_TKILL = 237
+ SYS_FUTEX = 238
+ SYS_SCHED_SETAFFINITY = 239
+ SYS_SCHED_GETAFFINITY = 240
+ SYS_TGKILL = 241
+ SYS_IO_SETUP = 243
+ SYS_IO_DESTROY = 244
+ SYS_IO_GETEVENTS = 245
+ SYS_IO_SUBMIT = 246
+ SYS_IO_CANCEL = 247
+ SYS_EXIT_GROUP = 248
+ SYS_EPOLL_CREATE = 249
+ SYS_EPOLL_CTL = 250
+ SYS_EPOLL_WAIT = 251
+ SYS_SET_TID_ADDRESS = 252
+ SYS_FADVISE64 = 253
+ SYS_TIMER_CREATE = 254
+ SYS_TIMER_SETTIME = 255
+ SYS_TIMER_GETTIME = 256
+ SYS_TIMER_GETOVERRUN = 257
+ SYS_TIMER_DELETE = 258
+ SYS_CLOCK_SETTIME = 259
+ SYS_CLOCK_GETTIME = 260
+ SYS_CLOCK_GETRES = 261
+ SYS_CLOCK_NANOSLEEP = 262
+ SYS_STATFS64 = 265
+ SYS_FSTATFS64 = 266
+ SYS_REMAP_FILE_PAGES = 267
+ SYS_MBIND = 268
+ SYS_GET_MEMPOLICY = 269
+ SYS_SET_MEMPOLICY = 270
+ SYS_MQ_OPEN = 271
+ SYS_MQ_UNLINK = 272
+ SYS_MQ_TIMEDSEND = 273
+ SYS_MQ_TIMEDRECEIVE = 274
+ SYS_MQ_NOTIFY = 275
+ SYS_MQ_GETSETATTR = 276
+ SYS_KEXEC_LOAD = 277
+ SYS_ADD_KEY = 278
+ SYS_REQUEST_KEY = 279
+ SYS_KEYCTL = 280
+ SYS_WAITID = 281
+ SYS_IOPRIO_SET = 282
+ SYS_IOPRIO_GET = 283
+ SYS_INOTIFY_INIT = 284
+ SYS_INOTIFY_ADD_WATCH = 285
+ SYS_INOTIFY_RM_WATCH = 286
+ SYS_MIGRATE_PAGES = 287
+ SYS_OPENAT = 288
+ SYS_MKDIRAT = 289
+ SYS_MKNODAT = 290
+ SYS_FCHOWNAT = 291
+ SYS_FUTIMESAT = 292
+ SYS_NEWFSTATAT = 293
+ SYS_UNLINKAT = 294
+ SYS_RENAMEAT = 295
+ SYS_LINKAT = 296
+ SYS_SYMLINKAT = 297
+ SYS_READLINKAT = 298
+ SYS_FCHMODAT = 299
+ SYS_FACCESSAT = 300
+ SYS_PSELECT6 = 301
+ SYS_PPOLL = 302
+ SYS_UNSHARE = 303
+ SYS_SET_ROBUST_LIST = 304
+ SYS_GET_ROBUST_LIST = 305
+ SYS_SPLICE = 306
+ SYS_SYNC_FILE_RANGE = 307
+ SYS_TEE = 308
+ SYS_VMSPLICE = 309
+ SYS_MOVE_PAGES = 310
+ SYS_GETCPU = 311
+ SYS_EPOLL_PWAIT = 312
+ SYS_UTIMES = 313
+ SYS_FALLOCATE = 314
+ SYS_UTIMENSAT = 315
+ SYS_SIGNALFD = 316
+ SYS_TIMERFD = 317
+ SYS_EVENTFD = 318
+ SYS_TIMERFD_CREATE = 319
+ SYS_TIMERFD_SETTIME = 320
+ SYS_TIMERFD_GETTIME = 321
+ SYS_SIGNALFD4 = 322
+ SYS_EVENTFD2 = 323
+ SYS_INOTIFY_INIT1 = 324
+ SYS_PIPE2 = 325
+ SYS_DUP3 = 326
+ SYS_EPOLL_CREATE1 = 327
+ SYS_PREADV = 328
+ SYS_PWRITEV = 329
+ SYS_RT_TGSIGQUEUEINFO = 330
+ SYS_PERF_EVENT_OPEN = 331
+ SYS_FANOTIFY_INIT = 332
+ SYS_FANOTIFY_MARK = 333
+ SYS_PRLIMIT64 = 334
+ SYS_NAME_TO_HANDLE_AT = 335
+ SYS_OPEN_BY_HANDLE_AT = 336
+ SYS_CLOCK_ADJTIME = 337
+ SYS_SYNCFS = 338
+ SYS_SETNS = 339
+ SYS_PROCESS_VM_READV = 340
+ SYS_PROCESS_VM_WRITEV = 341
+ SYS_S390_RUNTIME_INSTR = 342
+ SYS_KCMP = 343
+ SYS_FINIT_MODULE = 344
+ SYS_SCHED_SETATTR = 345
+ SYS_SCHED_GETATTR = 346
+ SYS_RENAMEAT2 = 347
+ SYS_SECCOMP = 348
+ SYS_GETRANDOM = 349
+ SYS_MEMFD_CREATE = 350
+ SYS_BPF = 351
+ SYS_S390_PCI_MMIO_WRITE = 352
+ SYS_S390_PCI_MMIO_READ = 353
+ SYS_EXECVEAT = 354
+ SYS_USERFAULTFD = 355
+ SYS_MEMBARRIER = 356
+ SYS_RECVMMSG = 357
+ SYS_SENDMMSG = 358
+ SYS_SOCKET = 359
+ SYS_SOCKETPAIR = 360
+ SYS_BIND = 361
+ SYS_CONNECT = 362
+ SYS_LISTEN = 363
+ SYS_ACCEPT4 = 364
+ SYS_GETSOCKOPT = 365
+ SYS_SETSOCKOPT = 366
+ SYS_GETSOCKNAME = 367
+ SYS_GETPEERNAME = 368
+ SYS_SENDTO = 369
+ SYS_SENDMSG = 370
+ SYS_RECVFROM = 371
+ SYS_RECVMSG = 372
+ SYS_SHUTDOWN = 373
+ SYS_MLOCK2 = 374
+ SYS_COPY_FILE_RANGE = 375
+ SYS_PREADV2 = 376
+ SYS_PWRITEV2 = 377
+ SYS_S390_GUARDED_STORAGE = 378
+ SYS_STATX = 379
+ SYS_S390_STHYI = 380
+ SYS_KEXEC_FILE_LOAD = 381
+ SYS_IO_PGETEVENTS = 382
+ SYS_RSEQ = 383
+ SYS_PKEY_MPROTECT = 384
+ SYS_PKEY_ALLOC = 385
+ SYS_PKEY_FREE = 386
+ SYS_SEMTIMEDOP = 392
+ SYS_SEMGET = 393
+ SYS_SEMCTL = 394
+ SYS_SHMGET = 395
+ SYS_SHMCTL = 396
+ SYS_SHMAT = 397
+ SYS_SHMDT = 398
+ SYS_MSGGET = 399
+ SYS_MSGSND = 400
+ SYS_MSGRCV = 401
+ SYS_MSGCTL = 402
+ SYS_PIDFD_SEND_SIGNAL = 424
+ SYS_IO_URING_SETUP = 425
+ SYS_IO_URING_ENTER = 426
+ SYS_IO_URING_REGISTER = 427
+ SYS_OPEN_TREE = 428
+ SYS_MOVE_MOUNT = 429
+ SYS_FSOPEN = 430
+ SYS_FSCONFIG = 431
+ SYS_FSMOUNT = 432
+ SYS_FSPICK = 433
+ SYS_PIDFD_OPEN = 434
+ SYS_CLONE3 = 435
+ SYS_CLOSE_RANGE = 436
+ SYS_OPENAT2 = 437
+ SYS_PIDFD_GETFD = 438
+ SYS_FACCESSAT2 = 439
+ SYS_PROCESS_MADVISE = 440
+ SYS_EPOLL_PWAIT2 = 441
+ SYS_MOUNT_SETATTR = 442
+ SYS_QUOTACTL_FD = 443
+ SYS_LANDLOCK_CREATE_RULESET = 444
+ SYS_LANDLOCK_ADD_RULE = 445
+ SYS_LANDLOCK_RESTRICT_SELF = 446
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
index 596e5bc7d..78802a5cf 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
@@ -7,378 +7,383 @@
package unix
const (
- SYS_RESTART_SYSCALL = 0
- SYS_EXIT = 1
- SYS_FORK = 2
- SYS_READ = 3
- SYS_WRITE = 4
- SYS_OPEN = 5
- SYS_CLOSE = 6
- SYS_WAIT4 = 7
- SYS_CREAT = 8
- SYS_LINK = 9
- SYS_UNLINK = 10
- SYS_EXECV = 11
- SYS_CHDIR = 12
- SYS_CHOWN = 13
- SYS_MKNOD = 14
- SYS_CHMOD = 15
- SYS_LCHOWN = 16
- SYS_BRK = 17
- SYS_PERFCTR = 18
- SYS_LSEEK = 19
- SYS_GETPID = 20
- SYS_CAPGET = 21
- SYS_CAPSET = 22
- SYS_SETUID = 23
- SYS_GETUID = 24
- SYS_VMSPLICE = 25
- SYS_PTRACE = 26
- SYS_ALARM = 27
- SYS_SIGALTSTACK = 28
- SYS_PAUSE = 29
- SYS_UTIME = 30
- SYS_ACCESS = 33
- SYS_NICE = 34
- SYS_SYNC = 36
- SYS_KILL = 37
- SYS_STAT = 38
- SYS_SENDFILE = 39
- SYS_LSTAT = 40
- SYS_DUP = 41
- SYS_PIPE = 42
- SYS_TIMES = 43
- SYS_UMOUNT2 = 45
- SYS_SETGID = 46
- SYS_GETGID = 47
- SYS_SIGNAL = 48
- SYS_GETEUID = 49
- SYS_GETEGID = 50
- SYS_ACCT = 51
- SYS_MEMORY_ORDERING = 52
- SYS_IOCTL = 54
- SYS_REBOOT = 55
- SYS_SYMLINK = 57
- SYS_READLINK = 58
- SYS_EXECVE = 59
- SYS_UMASK = 60
- SYS_CHROOT = 61
- SYS_FSTAT = 62
- SYS_FSTAT64 = 63
- SYS_GETPAGESIZE = 64
- SYS_MSYNC = 65
- SYS_VFORK = 66
- SYS_PREAD64 = 67
- SYS_PWRITE64 = 68
- SYS_MMAP = 71
- SYS_MUNMAP = 73
- SYS_MPROTECT = 74
- SYS_MADVISE = 75
- SYS_VHANGUP = 76
- SYS_MINCORE = 78
- SYS_GETGROUPS = 79
- SYS_SETGROUPS = 80
- SYS_GETPGRP = 81
- SYS_SETITIMER = 83
- SYS_SWAPON = 85
- SYS_GETITIMER = 86
- SYS_SETHOSTNAME = 88
- SYS_DUP2 = 90
- SYS_FCNTL = 92
- SYS_SELECT = 93
- SYS_FSYNC = 95
- SYS_SETPRIORITY = 96
- SYS_SOCKET = 97
- SYS_CONNECT = 98
- SYS_ACCEPT = 99
- SYS_GETPRIORITY = 100
- SYS_RT_SIGRETURN = 101
- SYS_RT_SIGACTION = 102
- SYS_RT_SIGPROCMASK = 103
- SYS_RT_SIGPENDING = 104
- SYS_RT_SIGTIMEDWAIT = 105
- SYS_RT_SIGQUEUEINFO = 106
- SYS_RT_SIGSUSPEND = 107
- SYS_SETRESUID = 108
- SYS_GETRESUID = 109
- SYS_SETRESGID = 110
- SYS_GETRESGID = 111
- SYS_RECVMSG = 113
- SYS_SENDMSG = 114
- SYS_GETTIMEOFDAY = 116
- SYS_GETRUSAGE = 117
- SYS_GETSOCKOPT = 118
- SYS_GETCWD = 119
- SYS_READV = 120
- SYS_WRITEV = 121
- SYS_SETTIMEOFDAY = 122
- SYS_FCHOWN = 123
- SYS_FCHMOD = 124
- SYS_RECVFROM = 125
- SYS_SETREUID = 126
- SYS_SETREGID = 127
- SYS_RENAME = 128
- SYS_TRUNCATE = 129
- SYS_FTRUNCATE = 130
- SYS_FLOCK = 131
- SYS_LSTAT64 = 132
- SYS_SENDTO = 133
- SYS_SHUTDOWN = 134
- SYS_SOCKETPAIR = 135
- SYS_MKDIR = 136
- SYS_RMDIR = 137
- SYS_UTIMES = 138
- SYS_STAT64 = 139
- SYS_SENDFILE64 = 140
- SYS_GETPEERNAME = 141
- SYS_FUTEX = 142
- SYS_GETTID = 143
- SYS_GETRLIMIT = 144
- SYS_SETRLIMIT = 145
- SYS_PIVOT_ROOT = 146
- SYS_PRCTL = 147
- SYS_PCICONFIG_READ = 148
- SYS_PCICONFIG_WRITE = 149
- SYS_GETSOCKNAME = 150
- SYS_INOTIFY_INIT = 151
- SYS_INOTIFY_ADD_WATCH = 152
- SYS_POLL = 153
- SYS_GETDENTS64 = 154
- SYS_INOTIFY_RM_WATCH = 156
- SYS_STATFS = 157
- SYS_FSTATFS = 158
- SYS_UMOUNT = 159
- SYS_SCHED_SET_AFFINITY = 160
- SYS_SCHED_GET_AFFINITY = 161
- SYS_GETDOMAINNAME = 162
- SYS_SETDOMAINNAME = 163
- SYS_UTRAP_INSTALL = 164
- SYS_QUOTACTL = 165
- SYS_SET_TID_ADDRESS = 166
- SYS_MOUNT = 167
- SYS_USTAT = 168
- SYS_SETXATTR = 169
- SYS_LSETXATTR = 170
- SYS_FSETXATTR = 171
- SYS_GETXATTR = 172
- SYS_LGETXATTR = 173
- SYS_GETDENTS = 174
- SYS_SETSID = 175
- SYS_FCHDIR = 176
- SYS_FGETXATTR = 177
- SYS_LISTXATTR = 178
- SYS_LLISTXATTR = 179
- SYS_FLISTXATTR = 180
- SYS_REMOVEXATTR = 181
- SYS_LREMOVEXATTR = 182
- SYS_SIGPENDING = 183
- SYS_QUERY_MODULE = 184
- SYS_SETPGID = 185
- SYS_FREMOVEXATTR = 186
- SYS_TKILL = 187
- SYS_EXIT_GROUP = 188
- SYS_UNAME = 189
- SYS_INIT_MODULE = 190
- SYS_PERSONALITY = 191
- SYS_REMAP_FILE_PAGES = 192
- SYS_EPOLL_CREATE = 193
- SYS_EPOLL_CTL = 194
- SYS_EPOLL_WAIT = 195
- SYS_IOPRIO_SET = 196
- SYS_GETPPID = 197
- SYS_SIGACTION = 198
- SYS_SGETMASK = 199
- SYS_SSETMASK = 200
- SYS_SIGSUSPEND = 201
- SYS_OLDLSTAT = 202
- SYS_USELIB = 203
- SYS_READDIR = 204
- SYS_READAHEAD = 205
- SYS_SOCKETCALL = 206
- SYS_SYSLOG = 207
- SYS_LOOKUP_DCOOKIE = 208
- SYS_FADVISE64 = 209
- SYS_FADVISE64_64 = 210
- SYS_TGKILL = 211
- SYS_WAITPID = 212
- SYS_SWAPOFF = 213
- SYS_SYSINFO = 214
- SYS_IPC = 215
- SYS_SIGRETURN = 216
- SYS_CLONE = 217
- SYS_IOPRIO_GET = 218
- SYS_ADJTIMEX = 219
- SYS_SIGPROCMASK = 220
- SYS_CREATE_MODULE = 221
- SYS_DELETE_MODULE = 222
- SYS_GET_KERNEL_SYMS = 223
- SYS_GETPGID = 224
- SYS_BDFLUSH = 225
- SYS_SYSFS = 226
- SYS_AFS_SYSCALL = 227
- SYS_SETFSUID = 228
- SYS_SETFSGID = 229
- SYS__NEWSELECT = 230
- SYS_SPLICE = 232
- SYS_STIME = 233
- SYS_STATFS64 = 234
- SYS_FSTATFS64 = 235
- SYS__LLSEEK = 236
- SYS_MLOCK = 237
- SYS_MUNLOCK = 238
- SYS_MLOCKALL = 239
- SYS_MUNLOCKALL = 240
- SYS_SCHED_SETPARAM = 241
- SYS_SCHED_GETPARAM = 242
- SYS_SCHED_SETSCHEDULER = 243
- SYS_SCHED_GETSCHEDULER = 244
- SYS_SCHED_YIELD = 245
- SYS_SCHED_GET_PRIORITY_MAX = 246
- SYS_SCHED_GET_PRIORITY_MIN = 247
- SYS_SCHED_RR_GET_INTERVAL = 248
- SYS_NANOSLEEP = 249
- SYS_MREMAP = 250
- SYS__SYSCTL = 251
- SYS_GETSID = 252
- SYS_FDATASYNC = 253
- SYS_NFSSERVCTL = 254
- SYS_SYNC_FILE_RANGE = 255
- SYS_CLOCK_SETTIME = 256
- SYS_CLOCK_GETTIME = 257
- SYS_CLOCK_GETRES = 258
- SYS_CLOCK_NANOSLEEP = 259
- SYS_SCHED_GETAFFINITY = 260
- SYS_SCHED_SETAFFINITY = 261
- SYS_TIMER_SETTIME = 262
- SYS_TIMER_GETTIME = 263
- SYS_TIMER_GETOVERRUN = 264
- SYS_TIMER_DELETE = 265
- SYS_TIMER_CREATE = 266
- SYS_VSERVER = 267
- SYS_IO_SETUP = 268
- SYS_IO_DESTROY = 269
- SYS_IO_SUBMIT = 270
- SYS_IO_CANCEL = 271
- SYS_IO_GETEVENTS = 272
- SYS_MQ_OPEN = 273
- SYS_MQ_UNLINK = 274
- SYS_MQ_TIMEDSEND = 275
- SYS_MQ_TIMEDRECEIVE = 276
- SYS_MQ_NOTIFY = 277
- SYS_MQ_GETSETATTR = 278
- SYS_WAITID = 279
- SYS_TEE = 280
- SYS_ADD_KEY = 281
- SYS_REQUEST_KEY = 282
- SYS_KEYCTL = 283
- SYS_OPENAT = 284
- SYS_MKDIRAT = 285
- SYS_MKNODAT = 286
- SYS_FCHOWNAT = 287
- SYS_FUTIMESAT = 288
- SYS_FSTATAT64 = 289
- SYS_UNLINKAT = 290
- SYS_RENAMEAT = 291
- SYS_LINKAT = 292
- SYS_SYMLINKAT = 293
- SYS_READLINKAT = 294
- SYS_FCHMODAT = 295
- SYS_FACCESSAT = 296
- SYS_PSELECT6 = 297
- SYS_PPOLL = 298
- SYS_UNSHARE = 299
- SYS_SET_ROBUST_LIST = 300
- SYS_GET_ROBUST_LIST = 301
- SYS_MIGRATE_PAGES = 302
- SYS_MBIND = 303
- SYS_GET_MEMPOLICY = 304
- SYS_SET_MEMPOLICY = 305
- SYS_KEXEC_LOAD = 306
- SYS_MOVE_PAGES = 307
- SYS_GETCPU = 308
- SYS_EPOLL_PWAIT = 309
- SYS_UTIMENSAT = 310
- SYS_SIGNALFD = 311
- SYS_TIMERFD_CREATE = 312
- SYS_EVENTFD = 313
- SYS_FALLOCATE = 314
- SYS_TIMERFD_SETTIME = 315
- SYS_TIMERFD_GETTIME = 316
- SYS_SIGNALFD4 = 317
- SYS_EVENTFD2 = 318
- SYS_EPOLL_CREATE1 = 319
- SYS_DUP3 = 320
- SYS_PIPE2 = 321
- SYS_INOTIFY_INIT1 = 322
- SYS_ACCEPT4 = 323
- SYS_PREADV = 324
- SYS_PWRITEV = 325
- SYS_RT_TGSIGQUEUEINFO = 326
- SYS_PERF_EVENT_OPEN = 327
- SYS_RECVMMSG = 328
- SYS_FANOTIFY_INIT = 329
- SYS_FANOTIFY_MARK = 330
- SYS_PRLIMIT64 = 331
- SYS_NAME_TO_HANDLE_AT = 332
- SYS_OPEN_BY_HANDLE_AT = 333
- SYS_CLOCK_ADJTIME = 334
- SYS_SYNCFS = 335
- SYS_SENDMMSG = 336
- SYS_SETNS = 337
- SYS_PROCESS_VM_READV = 338
- SYS_PROCESS_VM_WRITEV = 339
- SYS_KERN_FEATURES = 340
- SYS_KCMP = 341
- SYS_FINIT_MODULE = 342
- SYS_SCHED_SETATTR = 343
- SYS_SCHED_GETATTR = 344
- SYS_RENAMEAT2 = 345
- SYS_SECCOMP = 346
- SYS_GETRANDOM = 347
- SYS_MEMFD_CREATE = 348
- SYS_BPF = 349
- SYS_EXECVEAT = 350
- SYS_MEMBARRIER = 351
- SYS_USERFAULTFD = 352
- SYS_BIND = 353
- SYS_LISTEN = 354
- SYS_SETSOCKOPT = 355
- SYS_MLOCK2 = 356
- SYS_COPY_FILE_RANGE = 357
- SYS_PREADV2 = 358
- SYS_PWRITEV2 = 359
- SYS_STATX = 360
- SYS_IO_PGETEVENTS = 361
- SYS_PKEY_MPROTECT = 362
- SYS_PKEY_ALLOC = 363
- SYS_PKEY_FREE = 364
- SYS_RSEQ = 365
- SYS_SEMTIMEDOP = 392
- SYS_SEMGET = 393
- SYS_SEMCTL = 394
- SYS_SHMGET = 395
- SYS_SHMCTL = 396
- SYS_SHMAT = 397
- SYS_SHMDT = 398
- SYS_MSGGET = 399
- SYS_MSGSND = 400
- SYS_MSGRCV = 401
- SYS_MSGCTL = 402
- SYS_PIDFD_SEND_SIGNAL = 424
- SYS_IO_URING_SETUP = 425
- SYS_IO_URING_ENTER = 426
- SYS_IO_URING_REGISTER = 427
- SYS_OPEN_TREE = 428
- SYS_MOVE_MOUNT = 429
- SYS_FSOPEN = 430
- SYS_FSCONFIG = 431
- SYS_FSMOUNT = 432
- SYS_FSPICK = 433
- SYS_PIDFD_OPEN = 434
- SYS_CLOSE_RANGE = 436
- SYS_OPENAT2 = 437
- SYS_PIDFD_GETFD = 438
- SYS_FACCESSAT2 = 439
- SYS_PROCESS_MADVISE = 440
- SYS_EPOLL_PWAIT2 = 441
+ SYS_RESTART_SYSCALL = 0
+ SYS_EXIT = 1
+ SYS_FORK = 2
+ SYS_READ = 3
+ SYS_WRITE = 4
+ SYS_OPEN = 5
+ SYS_CLOSE = 6
+ SYS_WAIT4 = 7
+ SYS_CREAT = 8
+ SYS_LINK = 9
+ SYS_UNLINK = 10
+ SYS_EXECV = 11
+ SYS_CHDIR = 12
+ SYS_CHOWN = 13
+ SYS_MKNOD = 14
+ SYS_CHMOD = 15
+ SYS_LCHOWN = 16
+ SYS_BRK = 17
+ SYS_PERFCTR = 18
+ SYS_LSEEK = 19
+ SYS_GETPID = 20
+ SYS_CAPGET = 21
+ SYS_CAPSET = 22
+ SYS_SETUID = 23
+ SYS_GETUID = 24
+ SYS_VMSPLICE = 25
+ SYS_PTRACE = 26
+ SYS_ALARM = 27
+ SYS_SIGALTSTACK = 28
+ SYS_PAUSE = 29
+ SYS_UTIME = 30
+ SYS_ACCESS = 33
+ SYS_NICE = 34
+ SYS_SYNC = 36
+ SYS_KILL = 37
+ SYS_STAT = 38
+ SYS_SENDFILE = 39
+ SYS_LSTAT = 40
+ SYS_DUP = 41
+ SYS_PIPE = 42
+ SYS_TIMES = 43
+ SYS_UMOUNT2 = 45
+ SYS_SETGID = 46
+ SYS_GETGID = 47
+ SYS_SIGNAL = 48
+ SYS_GETEUID = 49
+ SYS_GETEGID = 50
+ SYS_ACCT = 51
+ SYS_MEMORY_ORDERING = 52
+ SYS_IOCTL = 54
+ SYS_REBOOT = 55
+ SYS_SYMLINK = 57
+ SYS_READLINK = 58
+ SYS_EXECVE = 59
+ SYS_UMASK = 60
+ SYS_CHROOT = 61
+ SYS_FSTAT = 62
+ SYS_FSTAT64 = 63
+ SYS_GETPAGESIZE = 64
+ SYS_MSYNC = 65
+ SYS_VFORK = 66
+ SYS_PREAD64 = 67
+ SYS_PWRITE64 = 68
+ SYS_MMAP = 71
+ SYS_MUNMAP = 73
+ SYS_MPROTECT = 74
+ SYS_MADVISE = 75
+ SYS_VHANGUP = 76
+ SYS_MINCORE = 78
+ SYS_GETGROUPS = 79
+ SYS_SETGROUPS = 80
+ SYS_GETPGRP = 81
+ SYS_SETITIMER = 83
+ SYS_SWAPON = 85
+ SYS_GETITIMER = 86
+ SYS_SETHOSTNAME = 88
+ SYS_DUP2 = 90
+ SYS_FCNTL = 92
+ SYS_SELECT = 93
+ SYS_FSYNC = 95
+ SYS_SETPRIORITY = 96
+ SYS_SOCKET = 97
+ SYS_CONNECT = 98
+ SYS_ACCEPT = 99
+ SYS_GETPRIORITY = 100
+ SYS_RT_SIGRETURN = 101
+ SYS_RT_SIGACTION = 102
+ SYS_RT_SIGPROCMASK = 103
+ SYS_RT_SIGPENDING = 104
+ SYS_RT_SIGTIMEDWAIT = 105
+ SYS_RT_SIGQUEUEINFO = 106
+ SYS_RT_SIGSUSPEND = 107
+ SYS_SETRESUID = 108
+ SYS_GETRESUID = 109
+ SYS_SETRESGID = 110
+ SYS_GETRESGID = 111
+ SYS_RECVMSG = 113
+ SYS_SENDMSG = 114
+ SYS_GETTIMEOFDAY = 116
+ SYS_GETRUSAGE = 117
+ SYS_GETSOCKOPT = 118
+ SYS_GETCWD = 119
+ SYS_READV = 120
+ SYS_WRITEV = 121
+ SYS_SETTIMEOFDAY = 122
+ SYS_FCHOWN = 123
+ SYS_FCHMOD = 124
+ SYS_RECVFROM = 125
+ SYS_SETREUID = 126
+ SYS_SETREGID = 127
+ SYS_RENAME = 128
+ SYS_TRUNCATE = 129
+ SYS_FTRUNCATE = 130
+ SYS_FLOCK = 131
+ SYS_LSTAT64 = 132
+ SYS_SENDTO = 133
+ SYS_SHUTDOWN = 134
+ SYS_SOCKETPAIR = 135
+ SYS_MKDIR = 136
+ SYS_RMDIR = 137
+ SYS_UTIMES = 138
+ SYS_STAT64 = 139
+ SYS_SENDFILE64 = 140
+ SYS_GETPEERNAME = 141
+ SYS_FUTEX = 142
+ SYS_GETTID = 143
+ SYS_GETRLIMIT = 144
+ SYS_SETRLIMIT = 145
+ SYS_PIVOT_ROOT = 146
+ SYS_PRCTL = 147
+ SYS_PCICONFIG_READ = 148
+ SYS_PCICONFIG_WRITE = 149
+ SYS_GETSOCKNAME = 150
+ SYS_INOTIFY_INIT = 151
+ SYS_INOTIFY_ADD_WATCH = 152
+ SYS_POLL = 153
+ SYS_GETDENTS64 = 154
+ SYS_INOTIFY_RM_WATCH = 156
+ SYS_STATFS = 157
+ SYS_FSTATFS = 158
+ SYS_UMOUNT = 159
+ SYS_SCHED_SET_AFFINITY = 160
+ SYS_SCHED_GET_AFFINITY = 161
+ SYS_GETDOMAINNAME = 162
+ SYS_SETDOMAINNAME = 163
+ SYS_UTRAP_INSTALL = 164
+ SYS_QUOTACTL = 165
+ SYS_SET_TID_ADDRESS = 166
+ SYS_MOUNT = 167
+ SYS_USTAT = 168
+ SYS_SETXATTR = 169
+ SYS_LSETXATTR = 170
+ SYS_FSETXATTR = 171
+ SYS_GETXATTR = 172
+ SYS_LGETXATTR = 173
+ SYS_GETDENTS = 174
+ SYS_SETSID = 175
+ SYS_FCHDIR = 176
+ SYS_FGETXATTR = 177
+ SYS_LISTXATTR = 178
+ SYS_LLISTXATTR = 179
+ SYS_FLISTXATTR = 180
+ SYS_REMOVEXATTR = 181
+ SYS_LREMOVEXATTR = 182
+ SYS_SIGPENDING = 183
+ SYS_QUERY_MODULE = 184
+ SYS_SETPGID = 185
+ SYS_FREMOVEXATTR = 186
+ SYS_TKILL = 187
+ SYS_EXIT_GROUP = 188
+ SYS_UNAME = 189
+ SYS_INIT_MODULE = 190
+ SYS_PERSONALITY = 191
+ SYS_REMAP_FILE_PAGES = 192
+ SYS_EPOLL_CREATE = 193
+ SYS_EPOLL_CTL = 194
+ SYS_EPOLL_WAIT = 195
+ SYS_IOPRIO_SET = 196
+ SYS_GETPPID = 197
+ SYS_SIGACTION = 198
+ SYS_SGETMASK = 199
+ SYS_SSETMASK = 200
+ SYS_SIGSUSPEND = 201
+ SYS_OLDLSTAT = 202
+ SYS_USELIB = 203
+ SYS_READDIR = 204
+ SYS_READAHEAD = 205
+ SYS_SOCKETCALL = 206
+ SYS_SYSLOG = 207
+ SYS_LOOKUP_DCOOKIE = 208
+ SYS_FADVISE64 = 209
+ SYS_FADVISE64_64 = 210
+ SYS_TGKILL = 211
+ SYS_WAITPID = 212
+ SYS_SWAPOFF = 213
+ SYS_SYSINFO = 214
+ SYS_IPC = 215
+ SYS_SIGRETURN = 216
+ SYS_CLONE = 217
+ SYS_IOPRIO_GET = 218
+ SYS_ADJTIMEX = 219
+ SYS_SIGPROCMASK = 220
+ SYS_CREATE_MODULE = 221
+ SYS_DELETE_MODULE = 222
+ SYS_GET_KERNEL_SYMS = 223
+ SYS_GETPGID = 224
+ SYS_BDFLUSH = 225
+ SYS_SYSFS = 226
+ SYS_AFS_SYSCALL = 227
+ SYS_SETFSUID = 228
+ SYS_SETFSGID = 229
+ SYS__NEWSELECT = 230
+ SYS_SPLICE = 232
+ SYS_STIME = 233
+ SYS_STATFS64 = 234
+ SYS_FSTATFS64 = 235
+ SYS__LLSEEK = 236
+ SYS_MLOCK = 237
+ SYS_MUNLOCK = 238
+ SYS_MLOCKALL = 239
+ SYS_MUNLOCKALL = 240
+ SYS_SCHED_SETPARAM = 241
+ SYS_SCHED_GETPARAM = 242
+ SYS_SCHED_SETSCHEDULER = 243
+ SYS_SCHED_GETSCHEDULER = 244
+ SYS_SCHED_YIELD = 245
+ SYS_SCHED_GET_PRIORITY_MAX = 246
+ SYS_SCHED_GET_PRIORITY_MIN = 247
+ SYS_SCHED_RR_GET_INTERVAL = 248
+ SYS_NANOSLEEP = 249
+ SYS_MREMAP = 250
+ SYS__SYSCTL = 251
+ SYS_GETSID = 252
+ SYS_FDATASYNC = 253
+ SYS_NFSSERVCTL = 254
+ SYS_SYNC_FILE_RANGE = 255
+ SYS_CLOCK_SETTIME = 256
+ SYS_CLOCK_GETTIME = 257
+ SYS_CLOCK_GETRES = 258
+ SYS_CLOCK_NANOSLEEP = 259
+ SYS_SCHED_GETAFFINITY = 260
+ SYS_SCHED_SETAFFINITY = 261
+ SYS_TIMER_SETTIME = 262
+ SYS_TIMER_GETTIME = 263
+ SYS_TIMER_GETOVERRUN = 264
+ SYS_TIMER_DELETE = 265
+ SYS_TIMER_CREATE = 266
+ SYS_VSERVER = 267
+ SYS_IO_SETUP = 268
+ SYS_IO_DESTROY = 269
+ SYS_IO_SUBMIT = 270
+ SYS_IO_CANCEL = 271
+ SYS_IO_GETEVENTS = 272
+ SYS_MQ_OPEN = 273
+ SYS_MQ_UNLINK = 274
+ SYS_MQ_TIMEDSEND = 275
+ SYS_MQ_TIMEDRECEIVE = 276
+ SYS_MQ_NOTIFY = 277
+ SYS_MQ_GETSETATTR = 278
+ SYS_WAITID = 279
+ SYS_TEE = 280
+ SYS_ADD_KEY = 281
+ SYS_REQUEST_KEY = 282
+ SYS_KEYCTL = 283
+ SYS_OPENAT = 284
+ SYS_MKDIRAT = 285
+ SYS_MKNODAT = 286
+ SYS_FCHOWNAT = 287
+ SYS_FUTIMESAT = 288
+ SYS_FSTATAT64 = 289
+ SYS_UNLINKAT = 290
+ SYS_RENAMEAT = 291
+ SYS_LINKAT = 292
+ SYS_SYMLINKAT = 293
+ SYS_READLINKAT = 294
+ SYS_FCHMODAT = 295
+ SYS_FACCESSAT = 296
+ SYS_PSELECT6 = 297
+ SYS_PPOLL = 298
+ SYS_UNSHARE = 299
+ SYS_SET_ROBUST_LIST = 300
+ SYS_GET_ROBUST_LIST = 301
+ SYS_MIGRATE_PAGES = 302
+ SYS_MBIND = 303
+ SYS_GET_MEMPOLICY = 304
+ SYS_SET_MEMPOLICY = 305
+ SYS_KEXEC_LOAD = 306
+ SYS_MOVE_PAGES = 307
+ SYS_GETCPU = 308
+ SYS_EPOLL_PWAIT = 309
+ SYS_UTIMENSAT = 310
+ SYS_SIGNALFD = 311
+ SYS_TIMERFD_CREATE = 312
+ SYS_EVENTFD = 313
+ SYS_FALLOCATE = 314
+ SYS_TIMERFD_SETTIME = 315
+ SYS_TIMERFD_GETTIME = 316
+ SYS_SIGNALFD4 = 317
+ SYS_EVENTFD2 = 318
+ SYS_EPOLL_CREATE1 = 319
+ SYS_DUP3 = 320
+ SYS_PIPE2 = 321
+ SYS_INOTIFY_INIT1 = 322
+ SYS_ACCEPT4 = 323
+ SYS_PREADV = 324
+ SYS_PWRITEV = 325
+ SYS_RT_TGSIGQUEUEINFO = 326
+ SYS_PERF_EVENT_OPEN = 327
+ SYS_RECVMMSG = 328
+ SYS_FANOTIFY_INIT = 329
+ SYS_FANOTIFY_MARK = 330
+ SYS_PRLIMIT64 = 331
+ SYS_NAME_TO_HANDLE_AT = 332
+ SYS_OPEN_BY_HANDLE_AT = 333
+ SYS_CLOCK_ADJTIME = 334
+ SYS_SYNCFS = 335
+ SYS_SENDMMSG = 336
+ SYS_SETNS = 337
+ SYS_PROCESS_VM_READV = 338
+ SYS_PROCESS_VM_WRITEV = 339
+ SYS_KERN_FEATURES = 340
+ SYS_KCMP = 341
+ SYS_FINIT_MODULE = 342
+ SYS_SCHED_SETATTR = 343
+ SYS_SCHED_GETATTR = 344
+ SYS_RENAMEAT2 = 345
+ SYS_SECCOMP = 346
+ SYS_GETRANDOM = 347
+ SYS_MEMFD_CREATE = 348
+ SYS_BPF = 349
+ SYS_EXECVEAT = 350
+ SYS_MEMBARRIER = 351
+ SYS_USERFAULTFD = 352
+ SYS_BIND = 353
+ SYS_LISTEN = 354
+ SYS_SETSOCKOPT = 355
+ SYS_MLOCK2 = 356
+ SYS_COPY_FILE_RANGE = 357
+ SYS_PREADV2 = 358
+ SYS_PWRITEV2 = 359
+ SYS_STATX = 360
+ SYS_IO_PGETEVENTS = 361
+ SYS_PKEY_MPROTECT = 362
+ SYS_PKEY_ALLOC = 363
+ SYS_PKEY_FREE = 364
+ SYS_RSEQ = 365
+ SYS_SEMTIMEDOP = 392
+ SYS_SEMGET = 393
+ SYS_SEMCTL = 394
+ SYS_SHMGET = 395
+ SYS_SHMCTL = 396
+ SYS_SHMAT = 397
+ SYS_SHMDT = 398
+ SYS_MSGGET = 399
+ SYS_MSGSND = 400
+ SYS_MSGRCV = 401
+ SYS_MSGCTL = 402
+ SYS_PIDFD_SEND_SIGNAL = 424
+ SYS_IO_URING_SETUP = 425
+ SYS_IO_URING_ENTER = 426
+ SYS_IO_URING_REGISTER = 427
+ SYS_OPEN_TREE = 428
+ SYS_MOVE_MOUNT = 429
+ SYS_FSOPEN = 430
+ SYS_FSCONFIG = 431
+ SYS_FSMOUNT = 432
+ SYS_FSPICK = 433
+ SYS_PIDFD_OPEN = 434
+ SYS_CLOSE_RANGE = 436
+ SYS_OPENAT2 = 437
+ SYS_PIDFD_GETFD = 438
+ SYS_FACCESSAT2 = 439
+ SYS_PROCESS_MADVISE = 440
+ SYS_EPOLL_PWAIT2 = 441
+ SYS_MOUNT_SETATTR = 442
+ SYS_QUOTACTL_FD = 443
+ SYS_LANDLOCK_CREATE_RULESET = 444
+ SYS_LANDLOCK_ADD_RULE = 445
+ SYS_LANDLOCK_RESTRICT_SELF = 446
)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go b/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go
deleted file mode 100644
index 883b64a27..000000000
--- a/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go
+++ /dev/null
@@ -1,524 +0,0 @@
-// cgo -godefs types_darwin.go | go run mkpost.go
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build 386 && darwin
-// +build 386,darwin
-
-package unix
-
-const (
- SizeofPtr = 0x4
- SizeofShort = 0x2
- SizeofInt = 0x4
- SizeofLong = 0x4
- SizeofLongLong = 0x8
-)
-
-type (
- _C_short int16
- _C_int int32
- _C_long int32
- _C_long_long int64
-)
-
-type Timespec struct {
- Sec int32
- Nsec int32
-}
-
-type Timeval struct {
- Sec int32
- Usec int32
-}
-
-type Timeval32 struct{}
-
-type Rusage struct {
- Utime Timeval
- Stime Timeval
- Maxrss int32
- Ixrss int32
- Idrss int32
- Isrss int32
- Minflt int32
- Majflt int32
- Nswap int32
- Inblock int32
- Oublock int32
- Msgsnd int32
- Msgrcv int32
- Nsignals int32
- Nvcsw int32
- Nivcsw int32
-}
-
-type Rlimit struct {
- Cur uint64
- Max uint64
-}
-
-type _Gid_t uint32
-
-type Stat_t struct {
- Dev int32
- Mode uint16
- Nlink uint16
- Ino uint64
- Uid uint32
- Gid uint32
- Rdev int32
- Atim Timespec
- Mtim Timespec
- Ctim Timespec
- Btim Timespec
- Size int64
- Blocks int64
- Blksize int32
- Flags uint32
- Gen uint32
- Lspare int32
- Qspare [2]int64
-}
-
-type Statfs_t struct {
- Bsize uint32
- Iosize int32
- Blocks uint64
- Bfree uint64
- Bavail uint64
- Files uint64
- Ffree uint64
- Fsid Fsid
- Owner uint32
- Type uint32
- Flags uint32
- Fssubtype uint32
- Fstypename [16]byte
- Mntonname [1024]byte
- Mntfromname [1024]byte
- Reserved [8]uint32
-}
-
-type Flock_t struct {
- Start int64
- Len int64
- Pid int32
- Type int16
- Whence int16
-}
-
-type Fstore_t struct {
- Flags uint32
- Posmode int32
- Offset int64
- Length int64
- Bytesalloc int64
-}
-
-type Radvisory_t struct {
- Offset int64
- Count int32
-}
-
-type Fbootstraptransfer_t struct {
- Offset int64
- Length uint32
- Buffer *byte
-}
-
-type Log2phys_t struct {
- Flags uint32
- Contigbytes int64
- Devoffset int64
-}
-
-type Fsid struct {
- Val [2]int32
-}
-
-type Dirent struct {
- Ino uint64
- Seekoff uint64
- Reclen uint16
- Namlen uint16
- Type uint8
- Name [1024]int8
- _ [3]byte
-}
-
-const (
- PathMax = 0x400
-)
-
-type RawSockaddrInet4 struct {
- Len uint8
- Family uint8
- Port uint16
- Addr [4]byte /* in_addr */
- Zero [8]int8
-}
-
-type RawSockaddrInet6 struct {
- Len uint8
- Family uint8
- Port uint16
- Flowinfo uint32
- Addr [16]byte /* in6_addr */
- Scope_id uint32
-}
-
-type RawSockaddrUnix struct {
- Len uint8
- Family uint8
- Path [104]int8
-}
-
-type RawSockaddrDatalink struct {
- Len uint8
- Family uint8
- Index uint16
- Type uint8
- Nlen uint8
- Alen uint8
- Slen uint8
- Data [12]int8
-}
-
-type RawSockaddr struct {
- Len uint8
- Family uint8
- Data [14]int8
-}
-
-type RawSockaddrAny struct {
- Addr RawSockaddr
- Pad [92]int8
-}
-
-type RawSockaddrCtl struct {
- Sc_len uint8
- Sc_family uint8
- Ss_sysaddr uint16
- Sc_id uint32
- Sc_unit uint32
- Sc_reserved [5]uint32
-}
-
-type _Socklen uint32
-
-type Linger struct {
- Onoff int32
- Linger int32
-}
-
-type Iovec struct {
- Base *byte
- Len uint32
-}
-
-type IPMreq struct {
- Multiaddr [4]byte /* in_addr */
- Interface [4]byte /* in_addr */
-}
-
-type IPMreqn struct {
- Multiaddr [4]byte /* in_addr */
- Address [4]byte /* in_addr */
- Ifindex int32
-}
-
-type IPv6Mreq struct {
- Multiaddr [16]byte /* in6_addr */
- Interface uint32
-}
-
-type Msghdr struct {
- Name *byte
- Namelen uint32
- Iov *Iovec
- Iovlen int32
- Control *byte
- Controllen uint32
- Flags int32
-}
-
-type Cmsghdr struct {
- Len uint32
- Level int32
- Type int32
-}
-
-type Inet4Pktinfo struct {
- Ifindex uint32
- Spec_dst [4]byte /* in_addr */
- Addr [4]byte /* in_addr */
-}
-
-type Inet6Pktinfo struct {
- Addr [16]byte /* in6_addr */
- Ifindex uint32
-}
-
-type IPv6MTUInfo struct {
- Addr RawSockaddrInet6
- Mtu uint32
-}
-
-type ICMPv6Filter struct {
- Filt [8]uint32
-}
-
-const (
- SizeofSockaddrInet4 = 0x10
- SizeofSockaddrInet6 = 0x1c
- SizeofSockaddrAny = 0x6c
- SizeofSockaddrUnix = 0x6a
- SizeofSockaddrDatalink = 0x14
- SizeofSockaddrCtl = 0x20
- SizeofLinger = 0x8
- SizeofIovec = 0x8
- SizeofIPMreq = 0x8
- SizeofIPMreqn = 0xc
- SizeofIPv6Mreq = 0x14
- SizeofMsghdr = 0x1c
- SizeofCmsghdr = 0xc
- SizeofInet4Pktinfo = 0xc
- SizeofInet6Pktinfo = 0x14
- SizeofIPv6MTUInfo = 0x20
- SizeofICMPv6Filter = 0x20
-)
-
-const (
- PTRACE_TRACEME = 0x0
- PTRACE_CONT = 0x7
- PTRACE_KILL = 0x8
-)
-
-type Kevent_t struct {
- Ident uint32
- Filter int16
- Flags uint16
- Fflags uint32
- Data int32
- Udata *byte
-}
-
-type FdSet struct {
- Bits [32]int32
-}
-
-const (
- SizeofIfMsghdr = 0x70
- SizeofIfData = 0x60
- SizeofIfaMsghdr = 0x14
- SizeofIfmaMsghdr = 0x10
- SizeofIfmaMsghdr2 = 0x14
- SizeofRtMsghdr = 0x5c
- SizeofRtMetrics = 0x38
-)
-
-type IfMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Data IfData
-}
-
-type IfData struct {
- Type uint8
- Typelen uint8
- Physical uint8
- Addrlen uint8
- Hdrlen uint8
- Recvquota uint8
- Xmitquota uint8
- Unused1 uint8
- Mtu uint32
- Metric uint32
- Baudrate uint32
- Ipackets uint32
- Ierrors uint32
- Opackets uint32
- Oerrors uint32
- Collisions uint32
- Ibytes uint32
- Obytes uint32
- Imcasts uint32
- Omcasts uint32
- Iqdrops uint32
- Noproto uint32
- Recvtiming uint32
- Xmittiming uint32
- Lastchange Timeval
- Unused2 uint32
- Hwassist uint32
- Reserved1 uint32
- Reserved2 uint32
-}
-
-type IfaMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Metric int32
-}
-
-type IfmaMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- _ [2]byte
-}
-
-type IfmaMsghdr2 struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Refcount int32
-}
-
-type RtMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Index uint16
- Flags int32
- Addrs int32
- Pid int32
- Seq int32
- Errno int32
- Use int32
- Inits uint32
- Rmx RtMetrics
-}
-
-type RtMetrics struct {
- Locks uint32
- Mtu uint32
- Hopcount uint32
- Expire int32
- Recvpipe uint32
- Sendpipe uint32
- Ssthresh uint32
- Rtt uint32
- Rttvar uint32
- Pksent uint32
- State uint32
- Filler [3]uint32
-}
-
-const (
- SizeofBpfVersion = 0x4
- SizeofBpfStat = 0x8
- SizeofBpfProgram = 0x8
- SizeofBpfInsn = 0x8
- SizeofBpfHdr = 0x14
-)
-
-type BpfVersion struct {
- Major uint16
- Minor uint16
-}
-
-type BpfStat struct {
- Recv uint32
- Drop uint32
-}
-
-type BpfProgram struct {
- Len uint32
- Insns *BpfInsn
-}
-
-type BpfInsn struct {
- Code uint16
- Jt uint8
- Jf uint8
- K uint32
-}
-
-type BpfHdr struct {
- Tstamp Timeval
- Caplen uint32
- Datalen uint32
- Hdrlen uint16
- _ [2]byte
-}
-
-type Termios struct {
- Iflag uint32
- Oflag uint32
- Cflag uint32
- Lflag uint32
- Cc [20]uint8
- Ispeed uint32
- Ospeed uint32
-}
-
-type Winsize struct {
- Row uint16
- Col uint16
- Xpixel uint16
- Ypixel uint16
-}
-
-const (
- AT_FDCWD = -0x2
- AT_REMOVEDIR = 0x80
- AT_SYMLINK_FOLLOW = 0x40
- AT_SYMLINK_NOFOLLOW = 0x20
-)
-
-type PollFd struct {
- Fd int32
- Events int16
- Revents int16
-}
-
-const (
- POLLERR = 0x8
- POLLHUP = 0x10
- POLLIN = 0x1
- POLLNVAL = 0x20
- POLLOUT = 0x4
- POLLPRI = 0x2
- POLLRDBAND = 0x80
- POLLRDNORM = 0x40
- POLLWRBAND = 0x100
- POLLWRNORM = 0x4
-)
-
-type Utsname struct {
- Sysname [256]byte
- Nodename [256]byte
- Release [256]byte
- Version [256]byte
- Machine [256]byte
-}
-
-const SizeofClockinfo = 0x14
-
-type Clockinfo struct {
- Hz int32
- Tick int32
- Tickadj int32
- Stathz int32
- Profhz int32
-}
-
-type CtlInfo struct {
- Id uint32
- Name [96]byte
-}
diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go
index 2673e6c59..4c8dc0ba2 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go
@@ -535,3 +535,107 @@ type CtlInfo struct {
Id uint32
Name [96]byte
}
+
+const SizeofKinfoProc = 0x288
+
+type Eproc struct {
+ Paddr uintptr
+ Sess uintptr
+ Pcred Pcred
+ Ucred Ucred
+ Vm Vmspace
+ Ppid int32
+ Pgid int32
+ Jobc int16
+ Tdev int32
+ Tpgid int32
+ Tsess uintptr
+ Wmesg [8]int8
+ Xsize int32
+ Xrssize int16
+ Xccount int16
+ Xswrss int16
+ Flag int32
+ Login [12]int8
+ Spare [4]int32
+ _ [4]byte
+}
+
+type ExternProc struct {
+ P_starttime Timeval
+ P_vmspace *Vmspace
+ P_sigacts uintptr
+ P_flag int32
+ P_stat int8
+ P_pid int32
+ P_oppid int32
+ P_dupfd int32
+ User_stack *int8
+ Exit_thread *byte
+ P_debugger int32
+ Sigwait int32
+ P_estcpu uint32
+ P_cpticks int32
+ P_pctcpu uint32
+ P_wchan *byte
+ P_wmesg *int8
+ P_swtime uint32
+ P_slptime uint32
+ P_realtimer Itimerval
+ P_rtime Timeval
+ P_uticks uint64
+ P_sticks uint64
+ P_iticks uint64
+ P_traceflag int32
+ P_tracep uintptr
+ P_siglist int32
+ P_textvp uintptr
+ P_holdcnt int32
+ P_sigmask uint32
+ P_sigignore uint32
+ P_sigcatch uint32
+ P_priority uint8
+ P_usrpri uint8
+ P_nice int8
+ P_comm [17]int8
+ P_pgrp uintptr
+ P_addr uintptr
+ P_xstat uint16
+ P_acflag uint16
+ P_ru *Rusage
+}
+
+type Itimerval struct {
+ Interval Timeval
+ Value Timeval
+}
+
+type KinfoProc struct {
+ Proc ExternProc
+ Eproc Eproc
+}
+
+type Vmspace struct {
+ Dummy int32
+ Dummy2 *int8
+ Dummy3 [5]int32
+ Dummy4 [3]*int8
+}
+
+type Pcred struct {
+ Pc_lock [72]int8
+ Pc_ucred uintptr
+ P_ruid uint32
+ P_svuid uint32
+ P_rgid uint32
+ P_svgid uint32
+ P_refcnt int32
+ _ [4]byte
+}
+
+type Ucred struct {
+ Ref int32
+ Uid uint32
+ Ngroups int16
+ Groups [16]uint32
+}
diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go b/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go
deleted file mode 100644
index eef513385..000000000
--- a/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go
+++ /dev/null
@@ -1,524 +0,0 @@
-// cgo -godefs types_darwin.go | go run mkpost.go
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build arm && darwin
-// +build arm,darwin
-
-package unix
-
-const (
- SizeofPtr = 0x4
- SizeofShort = 0x2
- SizeofInt = 0x4
- SizeofLong = 0x4
- SizeofLongLong = 0x8
-)
-
-type (
- _C_short int16
- _C_int int32
- _C_long int32
- _C_long_long int64
-)
-
-type Timespec struct {
- Sec int32
- Nsec int32
-}
-
-type Timeval struct {
- Sec int32
- Usec int32
-}
-
-type Timeval32 struct{}
-
-type Rusage struct {
- Utime Timeval
- Stime Timeval
- Maxrss int32
- Ixrss int32
- Idrss int32
- Isrss int32
- Minflt int32
- Majflt int32
- Nswap int32
- Inblock int32
- Oublock int32
- Msgsnd int32
- Msgrcv int32
- Nsignals int32
- Nvcsw int32
- Nivcsw int32
-}
-
-type Rlimit struct {
- Cur uint64
- Max uint64
-}
-
-type _Gid_t uint32
-
-type Stat_t struct {
- Dev int32
- Mode uint16
- Nlink uint16
- Ino uint64
- Uid uint32
- Gid uint32
- Rdev int32
- Atim Timespec
- Mtim Timespec
- Ctim Timespec
- Btim Timespec
- Size int64
- Blocks int64
- Blksize int32
- Flags uint32
- Gen uint32
- Lspare int32
- Qspare [2]int64
-}
-
-type Statfs_t struct {
- Bsize uint32
- Iosize int32
- Blocks uint64
- Bfree uint64
- Bavail uint64
- Files uint64
- Ffree uint64
- Fsid Fsid
- Owner uint32
- Type uint32
- Flags uint32
- Fssubtype uint32
- Fstypename [16]byte
- Mntonname [1024]byte
- Mntfromname [1024]byte
- Reserved [8]uint32
-}
-
-type Flock_t struct {
- Start int64
- Len int64
- Pid int32
- Type int16
- Whence int16
-}
-
-type Fstore_t struct {
- Flags uint32
- Posmode int32
- Offset int64
- Length int64
- Bytesalloc int64
-}
-
-type Radvisory_t struct {
- Offset int64
- Count int32
-}
-
-type Fbootstraptransfer_t struct {
- Offset int64
- Length uint32
- Buffer *byte
-}
-
-type Log2phys_t struct {
- Flags uint32
- Contigbytes int64
- Devoffset int64
-}
-
-type Fsid struct {
- Val [2]int32
-}
-
-type Dirent struct {
- Ino uint64
- Seekoff uint64
- Reclen uint16
- Namlen uint16
- Type uint8
- Name [1024]int8
- _ [3]byte
-}
-
-const (
- PathMax = 0x400
-)
-
-type RawSockaddrInet4 struct {
- Len uint8
- Family uint8
- Port uint16
- Addr [4]byte /* in_addr */
- Zero [8]int8
-}
-
-type RawSockaddrInet6 struct {
- Len uint8
- Family uint8
- Port uint16
- Flowinfo uint32
- Addr [16]byte /* in6_addr */
- Scope_id uint32
-}
-
-type RawSockaddrUnix struct {
- Len uint8
- Family uint8
- Path [104]int8
-}
-
-type RawSockaddrDatalink struct {
- Len uint8
- Family uint8
- Index uint16
- Type uint8
- Nlen uint8
- Alen uint8
- Slen uint8
- Data [12]int8
-}
-
-type RawSockaddr struct {
- Len uint8
- Family uint8
- Data [14]int8
-}
-
-type RawSockaddrAny struct {
- Addr RawSockaddr
- Pad [92]int8
-}
-
-type RawSockaddrCtl struct {
- Sc_len uint8
- Sc_family uint8
- Ss_sysaddr uint16
- Sc_id uint32
- Sc_unit uint32
- Sc_reserved [5]uint32
-}
-
-type _Socklen uint32
-
-type Linger struct {
- Onoff int32
- Linger int32
-}
-
-type Iovec struct {
- Base *byte
- Len uint32
-}
-
-type IPMreq struct {
- Multiaddr [4]byte /* in_addr */
- Interface [4]byte /* in_addr */
-}
-
-type IPMreqn struct {
- Multiaddr [4]byte /* in_addr */
- Address [4]byte /* in_addr */
- Ifindex int32
-}
-
-type IPv6Mreq struct {
- Multiaddr [16]byte /* in6_addr */
- Interface uint32
-}
-
-type Msghdr struct {
- Name *byte
- Namelen uint32
- Iov *Iovec
- Iovlen int32
- Control *byte
- Controllen uint32
- Flags int32
-}
-
-type Cmsghdr struct {
- Len uint32
- Level int32
- Type int32
-}
-
-type Inet4Pktinfo struct {
- Ifindex uint32
- Spec_dst [4]byte /* in_addr */
- Addr [4]byte /* in_addr */
-}
-
-type Inet6Pktinfo struct {
- Addr [16]byte /* in6_addr */
- Ifindex uint32
-}
-
-type IPv6MTUInfo struct {
- Addr RawSockaddrInet6
- Mtu uint32
-}
-
-type ICMPv6Filter struct {
- Filt [8]uint32
-}
-
-const (
- SizeofSockaddrInet4 = 0x10
- SizeofSockaddrInet6 = 0x1c
- SizeofSockaddrAny = 0x6c
- SizeofSockaddrUnix = 0x6a
- SizeofSockaddrDatalink = 0x14
- SizeofSockaddrCtl = 0x20
- SizeofLinger = 0x8
- SizeofIovec = 0x8
- SizeofIPMreq = 0x8
- SizeofIPMreqn = 0xc
- SizeofIPv6Mreq = 0x14
- SizeofMsghdr = 0x1c
- SizeofCmsghdr = 0xc
- SizeofInet4Pktinfo = 0xc
- SizeofInet6Pktinfo = 0x14
- SizeofIPv6MTUInfo = 0x20
- SizeofICMPv6Filter = 0x20
-)
-
-const (
- PTRACE_TRACEME = 0x0
- PTRACE_CONT = 0x7
- PTRACE_KILL = 0x8
-)
-
-type Kevent_t struct {
- Ident uint32
- Filter int16
- Flags uint16
- Fflags uint32
- Data int32
- Udata *byte
-}
-
-type FdSet struct {
- Bits [32]int32
-}
-
-const (
- SizeofIfMsghdr = 0x70
- SizeofIfData = 0x60
- SizeofIfaMsghdr = 0x14
- SizeofIfmaMsghdr = 0x10
- SizeofIfmaMsghdr2 = 0x14
- SizeofRtMsghdr = 0x5c
- SizeofRtMetrics = 0x38
-)
-
-type IfMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Data IfData
-}
-
-type IfData struct {
- Type uint8
- Typelen uint8
- Physical uint8
- Addrlen uint8
- Hdrlen uint8
- Recvquota uint8
- Xmitquota uint8
- Unused1 uint8
- Mtu uint32
- Metric uint32
- Baudrate uint32
- Ipackets uint32
- Ierrors uint32
- Opackets uint32
- Oerrors uint32
- Collisions uint32
- Ibytes uint32
- Obytes uint32
- Imcasts uint32
- Omcasts uint32
- Iqdrops uint32
- Noproto uint32
- Recvtiming uint32
- Xmittiming uint32
- Lastchange Timeval
- Unused2 uint32
- Hwassist uint32
- Reserved1 uint32
- Reserved2 uint32
-}
-
-type IfaMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Metric int32
-}
-
-type IfmaMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- _ [2]byte
-}
-
-type IfmaMsghdr2 struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Refcount int32
-}
-
-type RtMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Index uint16
- Flags int32
- Addrs int32
- Pid int32
- Seq int32
- Errno int32
- Use int32
- Inits uint32
- Rmx RtMetrics
-}
-
-type RtMetrics struct {
- Locks uint32
- Mtu uint32
- Hopcount uint32
- Expire int32
- Recvpipe uint32
- Sendpipe uint32
- Ssthresh uint32
- Rtt uint32
- Rttvar uint32
- Pksent uint32
- State uint32
- Filler [3]uint32
-}
-
-const (
- SizeofBpfVersion = 0x4
- SizeofBpfStat = 0x8
- SizeofBpfProgram = 0x8
- SizeofBpfInsn = 0x8
- SizeofBpfHdr = 0x14
-)
-
-type BpfVersion struct {
- Major uint16
- Minor uint16
-}
-
-type BpfStat struct {
- Recv uint32
- Drop uint32
-}
-
-type BpfProgram struct {
- Len uint32
- Insns *BpfInsn
-}
-
-type BpfInsn struct {
- Code uint16
- Jt uint8
- Jf uint8
- K uint32
-}
-
-type BpfHdr struct {
- Tstamp Timeval
- Caplen uint32
- Datalen uint32
- Hdrlen uint16
- _ [2]byte
-}
-
-type Termios struct {
- Iflag uint32
- Oflag uint32
- Cflag uint32
- Lflag uint32
- Cc [20]uint8
- Ispeed uint32
- Ospeed uint32
-}
-
-type Winsize struct {
- Row uint16
- Col uint16
- Xpixel uint16
- Ypixel uint16
-}
-
-const (
- AT_FDCWD = -0x2
- AT_REMOVEDIR = 0x80
- AT_SYMLINK_FOLLOW = 0x40
- AT_SYMLINK_NOFOLLOW = 0x20
-)
-
-type PollFd struct {
- Fd int32
- Events int16
- Revents int16
-}
-
-const (
- POLLERR = 0x8
- POLLHUP = 0x10
- POLLIN = 0x1
- POLLNVAL = 0x20
- POLLOUT = 0x4
- POLLPRI = 0x2
- POLLRDBAND = 0x80
- POLLRDNORM = 0x40
- POLLWRBAND = 0x100
- POLLWRNORM = 0x4
-)
-
-type Utsname struct {
- Sysname [256]byte
- Nodename [256]byte
- Release [256]byte
- Version [256]byte
- Machine [256]byte
-}
-
-const SizeofClockinfo = 0x14
-
-type Clockinfo struct {
- Hz int32
- Tick int32
- Tickadj int32
- Stathz int32
- Profhz int32
-}
-
-type CtlInfo struct {
- Id uint32
- Name [96]byte
-}
diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go
index 1465cbcff..96f0e6ae2 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go
@@ -535,3 +535,107 @@ type CtlInfo struct {
Id uint32
Name [96]byte
}
+
+const SizeofKinfoProc = 0x288
+
+type Eproc struct {
+ Paddr uintptr
+ Sess uintptr
+ Pcred Pcred
+ Ucred Ucred
+ Vm Vmspace
+ Ppid int32
+ Pgid int32
+ Jobc int16
+ Tdev int32
+ Tpgid int32
+ Tsess uintptr
+ Wmesg [8]int8
+ Xsize int32
+ Xrssize int16
+ Xccount int16
+ Xswrss int16
+ Flag int32
+ Login [12]int8
+ Spare [4]int32
+ _ [4]byte
+}
+
+type ExternProc struct {
+ P_starttime Timeval
+ P_vmspace *Vmspace
+ P_sigacts uintptr
+ P_flag int32
+ P_stat int8
+ P_pid int32
+ P_oppid int32
+ P_dupfd int32
+ User_stack *int8
+ Exit_thread *byte
+ P_debugger int32
+ Sigwait int32
+ P_estcpu uint32
+ P_cpticks int32
+ P_pctcpu uint32
+ P_wchan *byte
+ P_wmesg *int8
+ P_swtime uint32
+ P_slptime uint32
+ P_realtimer Itimerval
+ P_rtime Timeval
+ P_uticks uint64
+ P_sticks uint64
+ P_iticks uint64
+ P_traceflag int32
+ P_tracep uintptr
+ P_siglist int32
+ P_textvp uintptr
+ P_holdcnt int32
+ P_sigmask uint32
+ P_sigignore uint32
+ P_sigcatch uint32
+ P_priority uint8
+ P_usrpri uint8
+ P_nice int8
+ P_comm [17]int8
+ P_pgrp uintptr
+ P_addr uintptr
+ P_xstat uint16
+ P_acflag uint16
+ P_ru *Rusage
+}
+
+type Itimerval struct {
+ Interval Timeval
+ Value Timeval
+}
+
+type KinfoProc struct {
+ Proc ExternProc
+ Eproc Eproc
+}
+
+type Vmspace struct {
+ Dummy int32
+ Dummy2 *int8
+ Dummy3 [5]int32
+ Dummy4 [3]*int8
+}
+
+type Pcred struct {
+ Pc_lock [72]int8
+ Pc_ucred uintptr
+ P_ruid uint32
+ P_svuid uint32
+ P_rgid uint32
+ P_svgid uint32
+ P_refcnt int32
+ _ [4]byte
+}
+
+type Ucred struct {
+ Ref int32
+ Uid uint32
+ Ngroups int16
+ Groups [16]uint32
+}
diff --git a/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go
index 1d049d7a1..d0ba8e9b8 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go
@@ -431,6 +431,9 @@ type Winsize struct {
const (
AT_FDCWD = 0xfffafdcd
AT_SYMLINK_NOFOLLOW = 0x1
+ AT_REMOVEDIR = 0x2
+ AT_EACCESS = 0x4
+ AT_SYMLINK_FOLLOW = 0x8
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go
index c51bc88ff..4eec078e5 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go
@@ -31,6 +31,8 @@ type Timeval struct {
Usec int32
}
+type Time_t int32
+
type Rusage struct {
Utime Timeval
Stime Timeval
@@ -672,9 +674,10 @@ type Winsize struct {
const (
AT_FDCWD = -0x64
- AT_REMOVEDIR = 0x800
- AT_SYMLINK_FOLLOW = 0x400
+ AT_EACCESS = 0x100
AT_SYMLINK_NOFOLLOW = 0x200
+ AT_SYMLINK_FOLLOW = 0x400
+ AT_REMOVEDIR = 0x800
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go
index 395b69187..7622904a5 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go
@@ -31,6 +31,8 @@ type Timeval struct {
Usec int64
}
+type Time_t int64
+
type Rusage struct {
Utime Timeval
Stime Timeval
@@ -675,9 +677,10 @@ type Winsize struct {
const (
AT_FDCWD = -0x64
- AT_REMOVEDIR = 0x800
- AT_SYMLINK_FOLLOW = 0x400
+ AT_EACCESS = 0x100
AT_SYMLINK_NOFOLLOW = 0x200
+ AT_SYMLINK_FOLLOW = 0x400
+ AT_REMOVEDIR = 0x800
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go
index d3f9d2541..19223ce8e 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go
@@ -33,6 +33,8 @@ type Timeval struct {
_ [4]byte
}
+type Time_t int32
+
type Rusage struct {
Utime Timeval
Stime Timeval
@@ -656,9 +658,10 @@ type Winsize struct {
const (
AT_FDCWD = -0x64
- AT_REMOVEDIR = 0x800
- AT_SYMLINK_FOLLOW = 0x400
+ AT_EACCESS = 0x100
AT_SYMLINK_NOFOLLOW = 0x200
+ AT_SYMLINK_FOLLOW = 0x400
+ AT_REMOVEDIR = 0x800
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go
index 434d6e8e8..8e3e33f67 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go
@@ -31,6 +31,8 @@ type Timeval struct {
Usec int64
}
+type Time_t int64
+
type Rusage struct {
Utime Timeval
Stime Timeval
@@ -653,9 +655,10 @@ type Winsize struct {
const (
AT_FDCWD = -0x64
- AT_REMOVEDIR = 0x800
- AT_SYMLINK_FOLLOW = 0x400
+ AT_EACCESS = 0x100
AT_SYMLINK_NOFOLLOW = 0x200
+ AT_SYMLINK_FOLLOW = 0x400
+ AT_REMOVEDIR = 0x800
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go
index 1137a5a1f..4c485261d 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go
@@ -13,6 +13,8 @@ const (
I_STR = 0x5308
I_POP = 0x5303
I_PUSH = 0x5302
+ I_LINK = 0x530c
+ I_UNLINK = 0x530d
I_PLINK = 0x5316
I_PUNLINK = 0x5317
@@ -25,14 +27,14 @@ type strbuf struct {
Buf *int8
}
-type strioctl struct {
+type Strioctl struct {
Cmd int32
Timout int32
Len int32
Dp *int8
}
-type lifreq struct {
+type Lifreq struct {
Name [32]int8
Lifru1 [4]byte
Type uint32
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go
index 3bfc6f732..06dcd787b 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go
@@ -351,6 +351,13 @@ type RawSockaddrIUCV struct {
Name [8]int8
}
+type RawSockaddrNFC struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+}
+
type _Socklen uint32
type Linger struct {
@@ -445,6 +452,11 @@ type CanFilter struct {
Mask uint32
}
+type TCPRepairOpt struct {
+ Code uint32
+ Val uint32
+}
+
const (
SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c
@@ -464,6 +476,7 @@ const (
SizeofSockaddrL2TPIP = 0x10
SizeofSockaddrL2TPIP6 = 0x20
SizeofSockaddrIUCV = 0x20
+ SizeofSockaddrNFC = 0x10
SizeofLinger = 0x8
SizeofIPMreq = 0x8
SizeofIPMreqn = 0xc
@@ -476,6 +489,7 @@ const (
SizeofUcred = 0xc
SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
+ SizeofTCPRepairOpt = 0x8
)
const (
@@ -673,6 +687,16 @@ type NdMsg struct {
Type uint8
}
+const (
+ ICMP_FILTER = 0x1
+
+ ICMPV6_FILTER = 0x1
+ ICMPV6_FILTER_BLOCK = 0x1
+ ICMPV6_FILTER_BLOCKOTHERS = 0x3
+ ICMPV6_FILTER_PASS = 0x2
+ ICMPV6_FILTER_PASSONLY = 0x4
+)
+
const (
SizeofSockFilter = 0x8
)
@@ -993,7 +1017,7 @@ const (
PERF_COUNT_SW_EMULATION_FAULTS = 0x8
PERF_COUNT_SW_DUMMY = 0x9
PERF_COUNT_SW_BPF_OUTPUT = 0xa
- PERF_COUNT_SW_MAX = 0xb
+ PERF_COUNT_SW_MAX = 0xc
PERF_SAMPLE_IP = 0x1
PERF_SAMPLE_TID = 0x2
PERF_SAMPLE_TIME = 0x4
@@ -1016,7 +1040,10 @@ const (
PERF_SAMPLE_PHYS_ADDR = 0x80000
PERF_SAMPLE_AUX = 0x100000
PERF_SAMPLE_CGROUP = 0x200000
- PERF_SAMPLE_MAX = 0x1000000
+ PERF_SAMPLE_DATA_PAGE_SIZE = 0x400000
+ PERF_SAMPLE_CODE_PAGE_SIZE = 0x800000
+ PERF_SAMPLE_WEIGHT_STRUCT = 0x1000000
+ PERF_SAMPLE_MAX = 0x2000000
PERF_SAMPLE_BRANCH_USER_SHIFT = 0x0
PERF_SAMPLE_BRANCH_KERNEL_SHIFT = 0x1
PERF_SAMPLE_BRANCH_HV_SHIFT = 0x2
@@ -1762,6 +1789,8 @@ const (
NFPROTO_NUMPROTO = 0xd
)
+const SO_ORIGINAL_DST = 0x50
+
type Nfgenmsg struct {
Nfgen_family uint8
Version uint8
@@ -2327,8 +2356,8 @@ const (
SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000
SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000
- SOF_TIMESTAMPING_LAST = 0x4000
- SOF_TIMESTAMPING_MASK = 0x7fff
+ SOF_TIMESTAMPING_LAST = 0x8000
+ SOF_TIMESTAMPING_MASK = 0xffff
SCM_TSTAMP_SND = 0x0
SCM_TSTAMP_SCHED = 0x1
@@ -2904,7 +2933,7 @@ const (
DEVLINK_CMD_TRAP_POLICER_NEW = 0x47
DEVLINK_CMD_TRAP_POLICER_DEL = 0x48
DEVLINK_CMD_HEALTH_REPORTER_TEST = 0x49
- DEVLINK_CMD_MAX = 0x49
+ DEVLINK_CMD_MAX = 0x4d
DEVLINK_PORT_TYPE_NOTSET = 0x0
DEVLINK_PORT_TYPE_AUTO = 0x1
DEVLINK_PORT_TYPE_ETH = 0x2
@@ -3126,7 +3155,8 @@ const (
DEVLINK_ATTR_REMOTE_RELOAD_STATS = 0xa1
DEVLINK_ATTR_RELOAD_ACTION_INFO = 0xa2
DEVLINK_ATTR_RELOAD_ACTION_STATS = 0xa3
- DEVLINK_ATTR_MAX = 0xa3
+ DEVLINK_ATTR_PORT_PCI_SF_NUMBER = 0xa4
+ DEVLINK_ATTR_MAX = 0xa9
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
@@ -3140,7 +3170,9 @@ const (
DEVLINK_RESOURCE_UNIT_ENTRY = 0x0
DEVLINK_PORT_FUNCTION_ATTR_UNSPEC = 0x0
DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR = 0x1
- DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x1
+ DEVLINK_PORT_FN_ATTR_STATE = 0x2
+ DEVLINK_PORT_FN_ATTR_OPSTATE = 0x3
+ DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x3
)
type FsverityDigest struct {
@@ -3420,7 +3452,7 @@ const (
ETHTOOL_MSG_CABLE_TEST_ACT = 0x1a
ETHTOOL_MSG_CABLE_TEST_TDR_ACT = 0x1b
ETHTOOL_MSG_TUNNEL_INFO_GET = 0x1c
- ETHTOOL_MSG_USER_MAX = 0x1c
+ ETHTOOL_MSG_USER_MAX = 0x21
ETHTOOL_MSG_KERNEL_NONE = 0x0
ETHTOOL_MSG_STRSET_GET_REPLY = 0x1
ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2
@@ -3451,7 +3483,7 @@ const (
ETHTOOL_MSG_CABLE_TEST_NTF = 0x1b
ETHTOOL_MSG_CABLE_TEST_TDR_NTF = 0x1c
ETHTOOL_MSG_TUNNEL_INFO_GET_REPLY = 0x1d
- ETHTOOL_MSG_KERNEL_MAX = 0x1d
+ ETHTOOL_MSG_KERNEL_MAX = 0x22
ETHTOOL_A_HEADER_UNSPEC = 0x0
ETHTOOL_A_HEADER_DEV_INDEX = 0x1
ETHTOOL_A_HEADER_DEV_NAME = 0x2
@@ -3509,7 +3541,8 @@ const (
ETHTOOL_A_LINKMODES_DUPLEX = 0x6
ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG = 0x7
ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE = 0x8
- ETHTOOL_A_LINKMODES_MAX = 0x8
+ ETHTOOL_A_LINKMODES_LANES = 0x9
+ ETHTOOL_A_LINKMODES_MAX = 0x9
ETHTOOL_A_LINKSTATE_UNSPEC = 0x0
ETHTOOL_A_LINKSTATE_HEADER = 0x1
ETHTOOL_A_LINKSTATE_LINK = 0x2
@@ -3735,3 +3768,171 @@ const (
NLMSGERR_ATTR_OFFS = 0x2
NLMSGERR_ATTR_COOKIE = 0x3
)
+
+type (
+ EraseInfo struct {
+ Start uint32
+ Length uint32
+ }
+ EraseInfo64 struct {
+ Start uint64
+ Length uint64
+ }
+ MtdOobBuf struct {
+ Start uint32
+ Length uint32
+ Ptr *uint8
+ }
+ MtdOobBuf64 struct {
+ Start uint64
+ Pad uint32
+ Length uint32
+ Ptr uint64
+ }
+ MtdWriteReq struct {
+ Start uint64
+ Len uint64
+ Ooblen uint64
+ Data uint64
+ Oob uint64
+ Mode uint8
+ _ [7]uint8
+ }
+ MtdInfo struct {
+ Type uint8
+ Flags uint32
+ Size uint32
+ Erasesize uint32
+ Writesize uint32
+ Oobsize uint32
+ _ uint64
+ }
+ RegionInfo struct {
+ Offset uint32
+ Erasesize uint32
+ Numblocks uint32
+ Regionindex uint32
+ }
+ OtpInfo struct {
+ Start uint32
+ Length uint32
+ Locked uint32
+ }
+ NandOobinfo struct {
+ Useecc uint32
+ Eccbytes uint32
+ Oobfree [8][2]uint32
+ Eccpos [32]uint32
+ }
+ NandOobfree struct {
+ Offset uint32
+ Length uint32
+ }
+ NandEcclayout struct {
+ Eccbytes uint32
+ Eccpos [64]uint32
+ Oobavail uint32
+ Oobfree [8]NandOobfree
+ }
+ MtdEccStats struct {
+ Corrected uint32
+ Failed uint32
+ Badblocks uint32
+ Bbtblocks uint32
+ }
+)
+
+const (
+ MTD_OPS_PLACE_OOB = 0x0
+ MTD_OPS_AUTO_OOB = 0x1
+ MTD_OPS_RAW = 0x2
+)
+
+const (
+ MTD_FILE_MODE_NORMAL = 0x0
+ MTD_FILE_MODE_OTP_FACTORY = 0x1
+ MTD_FILE_MODE_OTP_USER = 0x2
+ MTD_FILE_MODE_RAW = 0x3
+)
+
+const (
+ NFC_CMD_UNSPEC = 0x0
+ NFC_CMD_GET_DEVICE = 0x1
+ NFC_CMD_DEV_UP = 0x2
+ NFC_CMD_DEV_DOWN = 0x3
+ NFC_CMD_DEP_LINK_UP = 0x4
+ NFC_CMD_DEP_LINK_DOWN = 0x5
+ NFC_CMD_START_POLL = 0x6
+ NFC_CMD_STOP_POLL = 0x7
+ NFC_CMD_GET_TARGET = 0x8
+ NFC_EVENT_TARGETS_FOUND = 0x9
+ NFC_EVENT_DEVICE_ADDED = 0xa
+ NFC_EVENT_DEVICE_REMOVED = 0xb
+ NFC_EVENT_TARGET_LOST = 0xc
+ NFC_EVENT_TM_ACTIVATED = 0xd
+ NFC_EVENT_TM_DEACTIVATED = 0xe
+ NFC_CMD_LLC_GET_PARAMS = 0xf
+ NFC_CMD_LLC_SET_PARAMS = 0x10
+ NFC_CMD_ENABLE_SE = 0x11
+ NFC_CMD_DISABLE_SE = 0x12
+ NFC_CMD_LLC_SDREQ = 0x13
+ NFC_EVENT_LLC_SDRES = 0x14
+ NFC_CMD_FW_DOWNLOAD = 0x15
+ NFC_EVENT_SE_ADDED = 0x16
+ NFC_EVENT_SE_REMOVED = 0x17
+ NFC_EVENT_SE_CONNECTIVITY = 0x18
+ NFC_EVENT_SE_TRANSACTION = 0x19
+ NFC_CMD_GET_SE = 0x1a
+ NFC_CMD_SE_IO = 0x1b
+ NFC_CMD_ACTIVATE_TARGET = 0x1c
+ NFC_CMD_VENDOR = 0x1d
+ NFC_CMD_DEACTIVATE_TARGET = 0x1e
+ NFC_ATTR_UNSPEC = 0x0
+ NFC_ATTR_DEVICE_INDEX = 0x1
+ NFC_ATTR_DEVICE_NAME = 0x2
+ NFC_ATTR_PROTOCOLS = 0x3
+ NFC_ATTR_TARGET_INDEX = 0x4
+ NFC_ATTR_TARGET_SENS_RES = 0x5
+ NFC_ATTR_TARGET_SEL_RES = 0x6
+ NFC_ATTR_TARGET_NFCID1 = 0x7
+ NFC_ATTR_TARGET_SENSB_RES = 0x8
+ NFC_ATTR_TARGET_SENSF_RES = 0x9
+ NFC_ATTR_COMM_MODE = 0xa
+ NFC_ATTR_RF_MODE = 0xb
+ NFC_ATTR_DEVICE_POWERED = 0xc
+ NFC_ATTR_IM_PROTOCOLS = 0xd
+ NFC_ATTR_TM_PROTOCOLS = 0xe
+ NFC_ATTR_LLC_PARAM_LTO = 0xf
+ NFC_ATTR_LLC_PARAM_RW = 0x10
+ NFC_ATTR_LLC_PARAM_MIUX = 0x11
+ NFC_ATTR_SE = 0x12
+ NFC_ATTR_LLC_SDP = 0x13
+ NFC_ATTR_FIRMWARE_NAME = 0x14
+ NFC_ATTR_SE_INDEX = 0x15
+ NFC_ATTR_SE_TYPE = 0x16
+ NFC_ATTR_SE_AID = 0x17
+ NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS = 0x18
+ NFC_ATTR_SE_APDU = 0x19
+ NFC_ATTR_TARGET_ISO15693_DSFID = 0x1a
+ NFC_ATTR_TARGET_ISO15693_UID = 0x1b
+ NFC_ATTR_SE_PARAMS = 0x1c
+ NFC_ATTR_VENDOR_ID = 0x1d
+ NFC_ATTR_VENDOR_SUBCMD = 0x1e
+ NFC_ATTR_VENDOR_DATA = 0x1f
+ NFC_SDP_ATTR_UNSPEC = 0x0
+ NFC_SDP_ATTR_URI = 0x1
+ NFC_SDP_ATTR_SAP = 0x2
+)
+
+type LandlockRulesetAttr struct {
+ Access_fs uint64
+}
+
+type LandlockPathBeneathAttr struct {
+ Allowed_access uint64
+ Parent_fd int32
+}
+
+const (
+ LANDLOCK_RULE_PATH_BENEATH = 0x1
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go
index 4d4d283de..3219adeda 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go
@@ -128,6 +128,17 @@ const (
FADV_NOREUSE = 0x5
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint32
+}
+
type RawSockaddr struct {
Family uint16
Data [14]int8
@@ -159,10 +170,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [16]byte
+}
+
const (
- SizeofIovec = 0x8
- SizeofMsghdr = 0x1c
- SizeofCmsghdr = 0xc
+ SizeofSockaddrNFCLLCP = 0x58
+ SizeofIovec = 0x8
+ SizeofMsghdr = 0x1c
+ SizeofCmsghdr = 0xc
)
const (
@@ -618,3 +635,7 @@ const (
PPS_GETCAP = 0x800470a3
PPS_FETCH = 0xc00470a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x800
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
index 8a2eed5ec..16acd3bcb 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
@@ -130,6 +130,17 @@ const (
FADV_NOREUSE = 0x5
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint64
+}
+
type RawSockaddr struct {
Family uint16
Data [14]int8
@@ -162,10 +173,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [24]byte
+}
+
const (
- SizeofIovec = 0x10
- SizeofMsghdr = 0x38
- SizeofCmsghdr = 0x10
+ SizeofSockaddrNFCLLCP = 0x60
+ SizeofIovec = 0x10
+ SizeofMsghdr = 0x38
+ SizeofCmsghdr = 0x10
)
const (
@@ -636,3 +653,7 @@ const (
PPS_GETCAP = 0x800870a3
PPS_FETCH = 0xc00870a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x800
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
index 94b34add6..c4982a229 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
@@ -134,6 +134,17 @@ const (
FADV_NOREUSE = 0x5
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint32
+}
+
type RawSockaddr struct {
Family uint16
Data [14]uint8
@@ -165,10 +176,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [16]byte
+}
+
const (
- SizeofIovec = 0x8
- SizeofMsghdr = 0x1c
- SizeofCmsghdr = 0xc
+ SizeofSockaddrNFCLLCP = 0x58
+ SizeofIovec = 0x8
+ SizeofMsghdr = 0x1c
+ SizeofCmsghdr = 0xc
)
const (
@@ -613,3 +630,7 @@ const (
PPS_GETCAP = 0x800470a3
PPS_FETCH = 0xc00470a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x800
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
index 2143de4d5..98bb8a41a 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
@@ -131,6 +131,17 @@ const (
FADV_NOREUSE = 0x5
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint64
+}
+
type RawSockaddr struct {
Family uint16
Data [14]int8
@@ -163,10 +174,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [24]byte
+}
+
const (
- SizeofIovec = 0x10
- SizeofMsghdr = 0x38
- SizeofCmsghdr = 0x10
+ SizeofSockaddrNFCLLCP = 0x60
+ SizeofIovec = 0x10
+ SizeofMsghdr = 0x38
+ SizeofCmsghdr = 0x10
)
const (
@@ -615,3 +632,7 @@ const (
PPS_GETCAP = 0x800870a3
PPS_FETCH = 0xc00870a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x800
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
index a40216eee..d5bfc3565 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
@@ -133,6 +133,17 @@ const (
FADV_NOREUSE = 0x5
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint32
+}
+
type RawSockaddr struct {
Family uint16
Data [14]int8
@@ -164,10 +175,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [16]byte
+}
+
const (
- SizeofIovec = 0x8
- SizeofMsghdr = 0x1c
- SizeofCmsghdr = 0xc
+ SizeofSockaddrNFCLLCP = 0x58
+ SizeofIovec = 0x8
+ SizeofMsghdr = 0x1c
+ SizeofCmsghdr = 0xc
)
const (
@@ -619,3 +636,7 @@ const (
PPS_GETCAP = 0x400470a3
PPS_FETCH = 0xc00470a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x80
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
index e834b069f..b52c568dc 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
@@ -131,6 +131,17 @@ const (
FADV_NOREUSE = 0x5
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint64
+}
+
type RawSockaddr struct {
Family uint16
Data [14]int8
@@ -163,10 +174,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [24]byte
+}
+
const (
- SizeofIovec = 0x10
- SizeofMsghdr = 0x38
- SizeofCmsghdr = 0x10
+ SizeofSockaddrNFCLLCP = 0x60
+ SizeofIovec = 0x10
+ SizeofMsghdr = 0x38
+ SizeofCmsghdr = 0x10
)
const (
@@ -618,3 +635,7 @@ const (
PPS_GETCAP = 0x400870a3
PPS_FETCH = 0xc00870a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x80
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
index e31083b04..a340b84b9 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
@@ -131,6 +131,17 @@ const (
FADV_NOREUSE = 0x5
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint64
+}
+
type RawSockaddr struct {
Family uint16
Data [14]int8
@@ -163,10 +174,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [24]byte
+}
+
const (
- SizeofIovec = 0x10
- SizeofMsghdr = 0x38
- SizeofCmsghdr = 0x10
+ SizeofSockaddrNFCLLCP = 0x60
+ SizeofIovec = 0x10
+ SizeofMsghdr = 0x38
+ SizeofCmsghdr = 0x10
)
const (
@@ -618,3 +635,7 @@ const (
PPS_GETCAP = 0x400870a3
PPS_FETCH = 0xc00870a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x80
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
index 42811f7fb..b43d8e2ce 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
@@ -133,6 +133,17 @@ const (
FADV_NOREUSE = 0x5
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint32
+}
+
type RawSockaddr struct {
Family uint16
Data [14]int8
@@ -164,10 +175,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [16]byte
+}
+
const (
- SizeofIovec = 0x8
- SizeofMsghdr = 0x1c
- SizeofCmsghdr = 0xc
+ SizeofSockaddrNFCLLCP = 0x58
+ SizeofIovec = 0x8
+ SizeofMsghdr = 0x1c
+ SizeofCmsghdr = 0xc
)
const (
@@ -619,3 +636,7 @@ const (
PPS_GETCAP = 0x400470a3
PPS_FETCH = 0xc00470a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x80
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go
index af7a72017..efd7313a7 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go
@@ -134,6 +134,17 @@ const (
FADV_NOREUSE = 0x5
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint32
+}
+
type RawSockaddr struct {
Family uint16
Data [14]uint8
@@ -165,10 +176,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [16]byte
+}
+
const (
- SizeofIovec = 0x8
- SizeofMsghdr = 0x1c
- SizeofCmsghdr = 0xc
+ SizeofSockaddrNFCLLCP = 0x58
+ SizeofIovec = 0x8
+ SizeofMsghdr = 0x1c
+ SizeofCmsghdr = 0xc
)
const (
@@ -625,3 +642,7 @@ const (
PPS_GETCAP = 0x400470a3
PPS_FETCH = 0xc00470a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x800
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
index 2a3afbaef..22cedda57 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
@@ -132,6 +132,17 @@ const (
FADV_NOREUSE = 0x5
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint64
+}
+
type RawSockaddr struct {
Family uint16
Data [14]uint8
@@ -164,10 +175,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [24]byte
+}
+
const (
- SizeofIovec = 0x10
- SizeofMsghdr = 0x38
- SizeofCmsghdr = 0x10
+ SizeofSockaddrNFCLLCP = 0x60
+ SizeofIovec = 0x10
+ SizeofMsghdr = 0x38
+ SizeofCmsghdr = 0x10
)
const (
@@ -625,3 +642,7 @@ const (
PPS_GETCAP = 0x400870a3
PPS_FETCH = 0xc00870a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x800
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
index c0de30a65..452a76df1 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
@@ -132,6 +132,17 @@ const (
FADV_NOREUSE = 0x5
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint64
+}
+
type RawSockaddr struct {
Family uint16
Data [14]uint8
@@ -164,10 +175,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [24]byte
+}
+
const (
- SizeofIovec = 0x10
- SizeofMsghdr = 0x38
- SizeofCmsghdr = 0x10
+ SizeofSockaddrNFCLLCP = 0x60
+ SizeofIovec = 0x10
+ SizeofMsghdr = 0x38
+ SizeofCmsghdr = 0x10
)
const (
@@ -625,3 +642,7 @@ const (
PPS_GETCAP = 0x400870a3
PPS_FETCH = 0xc00870a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x800
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go
index 74faf2e91..96c667df4 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go
@@ -131,6 +131,17 @@ const (
FADV_NOREUSE = 0x5
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint64
+}
+
type RawSockaddr struct {
Family uint16
Data [14]uint8
@@ -163,10 +174,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [24]byte
+}
+
const (
- SizeofIovec = 0x10
- SizeofMsghdr = 0x38
- SizeofCmsghdr = 0x10
+ SizeofSockaddrNFCLLCP = 0x60
+ SizeofIovec = 0x10
+ SizeofMsghdr = 0x38
+ SizeofCmsghdr = 0x10
)
const (
@@ -643,3 +660,7 @@ const (
PPS_GETCAP = 0x800870a3
PPS_FETCH = 0xc00870a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x800
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
index 9a8f0c2c6..af04ee174 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
@@ -130,6 +130,17 @@ const (
FADV_NOREUSE = 0x7
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint64
+}
+
type RawSockaddr struct {
Family uint16
Data [14]int8
@@ -162,10 +173,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [24]byte
+}
+
const (
- SizeofIovec = 0x10
- SizeofMsghdr = 0x38
- SizeofCmsghdr = 0x10
+ SizeofSockaddrNFCLLCP = 0x60
+ SizeofIovec = 0x10
+ SizeofMsghdr = 0x38
+ SizeofCmsghdr = 0x10
)
const (
@@ -639,3 +656,7 @@ const (
PPS_GETCAP = 0x800870a3
PPS_FETCH = 0xc00870a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x800
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go
index 72cdda75b..6f385cf6a 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go
@@ -134,6 +134,17 @@ const (
FADV_NOREUSE = 0x5
)
+type RawSockaddrNFCLLCP struct {
+ Sa_family uint16
+ Dev_idx uint32
+ Target_idx uint32
+ Nfc_protocol uint32
+ Dsap uint8
+ Ssap uint8
+ Service_name [63]uint8
+ Service_name_len uint64
+}
+
type RawSockaddr struct {
Family uint16
Data [14]int8
@@ -166,10 +177,16 @@ type Cmsghdr struct {
Type int32
}
+type ifreq struct {
+ Ifrn [16]byte
+ Ifru [24]byte
+}
+
const (
- SizeofIovec = 0x10
- SizeofMsghdr = 0x38
- SizeofCmsghdr = 0x10
+ SizeofSockaddrNFCLLCP = 0x60
+ SizeofIovec = 0x10
+ SizeofMsghdr = 0x38
+ SizeofCmsghdr = 0x10
)
const (
@@ -620,3 +637,7 @@ const (
PPS_GETCAP = 0x400870a3
PPS_FETCH = 0xc00870a4
)
+
+const (
+ PIDFD_NONBLOCK = 0x4000
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go
index b10e73abf..2fd2060e6 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go
@@ -445,8 +445,10 @@ type Ptmget struct {
const (
AT_FDCWD = -0x64
- AT_SYMLINK_FOLLOW = 0x400
+ AT_EACCESS = 0x100
AT_SYMLINK_NOFOLLOW = 0x200
+ AT_SYMLINK_FOLLOW = 0x400
+ AT_REMOVEDIR = 0x800
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go
index 28ed6d55a..6a5a1a8ae 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go
@@ -453,8 +453,10 @@ type Ptmget struct {
const (
AT_FDCWD = -0x64
- AT_SYMLINK_FOLLOW = 0x400
+ AT_EACCESS = 0x100
AT_SYMLINK_NOFOLLOW = 0x200
+ AT_SYMLINK_FOLLOW = 0x400
+ AT_REMOVEDIR = 0x800
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go
index 4ba196ebe..84cc8d01e 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go
@@ -450,8 +450,10 @@ type Ptmget struct {
const (
AT_FDCWD = -0x64
- AT_SYMLINK_FOLLOW = 0x400
+ AT_EACCESS = 0x100
AT_SYMLINK_NOFOLLOW = 0x200
+ AT_SYMLINK_FOLLOW = 0x400
+ AT_REMOVEDIR = 0x800
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go
index dd642bd9c..c844e7096 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go
@@ -453,8 +453,10 @@ type Ptmget struct {
const (
AT_FDCWD = -0x64
- AT_SYMLINK_FOLLOW = 0x400
+ AT_EACCESS = 0x100
AT_SYMLINK_NOFOLLOW = 0x200
+ AT_SYMLINK_FOLLOW = 0x400
+ AT_REMOVEDIR = 0x800
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go
index 1fdb0e5fa..2a8b1e6f7 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go
@@ -438,8 +438,10 @@ type Winsize struct {
const (
AT_FDCWD = -0x64
- AT_SYMLINK_FOLLOW = 0x4
+ AT_EACCESS = 0x1
AT_SYMLINK_NOFOLLOW = 0x2
+ AT_SYMLINK_FOLLOW = 0x4
+ AT_REMOVEDIR = 0x8
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go
index e2fc93c7c..b1759cf70 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go
@@ -438,8 +438,10 @@ type Winsize struct {
const (
AT_FDCWD = -0x64
- AT_SYMLINK_FOLLOW = 0x4
+ AT_EACCESS = 0x1
AT_SYMLINK_NOFOLLOW = 0x2
+ AT_SYMLINK_FOLLOW = 0x4
+ AT_REMOVEDIR = 0x8
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go
index 8d34b5a2f..e807de206 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go
@@ -439,8 +439,10 @@ type Winsize struct {
const (
AT_FDCWD = -0x64
- AT_SYMLINK_FOLLOW = 0x4
+ AT_EACCESS = 0x1
AT_SYMLINK_NOFOLLOW = 0x2
+ AT_SYMLINK_FOLLOW = 0x4
+ AT_REMOVEDIR = 0x8
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go
index ea8f1a0d9..ff3aecaee 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go
@@ -432,8 +432,10 @@ type Winsize struct {
const (
AT_FDCWD = -0x64
- AT_SYMLINK_FOLLOW = 0x4
+ AT_EACCESS = 0x1
AT_SYMLINK_NOFOLLOW = 0x2
+ AT_SYMLINK_FOLLOW = 0x4
+ AT_REMOVEDIR = 0x8
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go
index ec6e8bc3f..9ecda6917 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go
@@ -432,8 +432,10 @@ type Winsize struct {
const (
AT_FDCWD = -0x64
- AT_SYMLINK_FOLLOW = 0x4
+ AT_EACCESS = 0x1
AT_SYMLINK_NOFOLLOW = 0x2
+ AT_SYMLINK_FOLLOW = 0x4
+ AT_REMOVEDIR = 0x8
)
type PollFd struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go
index 85effef9c..ad4aad279 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go
@@ -440,3 +440,43 @@ const (
POLLWRBAND = 0x100
POLLWRNORM = 0x4
)
+
+type fileObj struct {
+ Atim Timespec
+ Mtim Timespec
+ Ctim Timespec
+ Pad [3]uint64
+ Name *int8
+}
+
+type portEvent struct {
+ Events int32
+ Source uint16
+ Pad uint16
+ Object uint64
+ User *byte
+}
+
+const (
+ PORT_SOURCE_AIO = 0x1
+ PORT_SOURCE_TIMER = 0x2
+ PORT_SOURCE_USER = 0x3
+ PORT_SOURCE_FD = 0x4
+ PORT_SOURCE_ALERT = 0x5
+ PORT_SOURCE_MQ = 0x6
+ PORT_SOURCE_FILE = 0x7
+ PORT_ALERT_SET = 0x1
+ PORT_ALERT_UPDATE = 0x2
+ PORT_ALERT_INVALID = 0x3
+ FILE_ACCESS = 0x1
+ FILE_MODIFIED = 0x2
+ FILE_ATTRIB = 0x4
+ FILE_TRUNC = 0x100000
+ FILE_NOFOLLOW = 0x10000000
+ FILE_DELETE = 0x10
+ FILE_RENAME_TO = 0x20
+ FILE_RENAME_FROM = 0x40
+ UNMOUNTED = 0x20000000
+ MOUNTEDOVER = 0x40000000
+ FILE_EXCEPTION = 0x60000070
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go
index 8bffde78e..4ab638cb9 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go
@@ -347,6 +347,10 @@ type Dirent struct {
Name [256]byte
}
+type FdSet struct {
+ Bits [64]int32
+}
+
// This struct is packed on z/OS so it can't be used directly.
type Flock_t struct {
Type int16
diff --git a/vendor/golang.org/x/sys/windows/empty.s b/vendor/golang.org/x/sys/windows/empty.s
index 69309e4da..fdbbbcd31 100644
--- a/vendor/golang.org/x/sys/windows/empty.s
+++ b/vendor/golang.org/x/sys/windows/empty.s
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !go1.12
// +build !go1.12
// This file is here to allow bodyless functions with go:linkname for Go 1.11
diff --git a/vendor/golang.org/x/sys/windows/exec_windows.go b/vendor/golang.org/x/sys/windows/exec_windows.go
index 9eb1fb633..7a11e83b7 100644
--- a/vendor/golang.org/x/sys/windows/exec_windows.go
+++ b/vendor/golang.org/x/sys/windows/exec_windows.go
@@ -9,6 +9,8 @@ package windows
import (
errorspkg "errors"
"unsafe"
+
+ "golang.org/x/sys/internal/unsafeheader"
)
// EscapeArg rewrites command line argument s as prescribed
@@ -78,6 +80,40 @@ func EscapeArg(s string) string {
return string(qs[:j])
}
+// ComposeCommandLine escapes and joins the given arguments suitable for use as a Windows command line,
+// in CreateProcess's CommandLine argument, CreateService/ChangeServiceConfig's BinaryPathName argument,
+// or any program that uses CommandLineToArgv.
+func ComposeCommandLine(args []string) string {
+ var commandLine string
+ for i := range args {
+ if i > 0 {
+ commandLine += " "
+ }
+ commandLine += EscapeArg(args[i])
+ }
+ return commandLine
+}
+
+// DecomposeCommandLine breaks apart its argument command line into unescaped parts using CommandLineToArgv,
+// as gathered from GetCommandLine, QUERY_SERVICE_CONFIG's BinaryPathName argument, or elsewhere that
+// command lines are passed around.
+func DecomposeCommandLine(commandLine string) ([]string, error) {
+ if len(commandLine) == 0 {
+ return []string{}, nil
+ }
+ var argc int32
+ argv, err := CommandLineToArgv(StringToUTF16Ptr(commandLine), &argc)
+ if err != nil {
+ return nil, err
+ }
+ defer LocalFree(Handle(unsafe.Pointer(argv)))
+ var args []string
+ for _, v := range (*argv)[:argc] {
+ args = append(args, UTF16ToString((*v)[:]))
+ }
+ return args, nil
+}
+
func CloseOnExec(fd Handle) {
SetHandleInformation(Handle(fd), HANDLE_FLAG_INHERIT, 0)
}
@@ -101,8 +137,8 @@ func FullPath(name string) (path string, err error) {
}
}
-// NewProcThreadAttributeList allocates a new ProcThreadAttributeList, with the requested maximum number of attributes.
-func NewProcThreadAttributeList(maxAttrCount uint32) (*ProcThreadAttributeList, error) {
+// NewProcThreadAttributeList allocates a new ProcThreadAttributeListContainer, with the requested maximum number of attributes.
+func NewProcThreadAttributeList(maxAttrCount uint32) (*ProcThreadAttributeListContainer, error) {
var size uintptr
err := initializeProcThreadAttributeList(nil, maxAttrCount, 0, &size)
if err != ERROR_INSUFFICIENT_BUFFER {
@@ -111,10 +147,9 @@ func NewProcThreadAttributeList(maxAttrCount uint32) (*ProcThreadAttributeList,
}
return nil, err
}
- const psize = unsafe.Sizeof(uintptr(0))
// size is guaranteed to be ≥1 by InitializeProcThreadAttributeList.
- al := (*ProcThreadAttributeList)(unsafe.Pointer(&make([]unsafe.Pointer, (size+psize-1)/psize)[0]))
- err = initializeProcThreadAttributeList(al, maxAttrCount, 0, &size)
+ al := &ProcThreadAttributeListContainer{data: (*ProcThreadAttributeList)(unsafe.Pointer(&make([]byte, size)[0]))}
+ err = initializeProcThreadAttributeList(al.data, maxAttrCount, 0, &size)
if err != nil {
return nil, err
}
@@ -122,11 +157,39 @@ func NewProcThreadAttributeList(maxAttrCount uint32) (*ProcThreadAttributeList,
}
// Update modifies the ProcThreadAttributeList using UpdateProcThreadAttribute.
-func (al *ProcThreadAttributeList) Update(attribute uintptr, flags uint32, value unsafe.Pointer, size uintptr, prevValue unsafe.Pointer, returnedSize *uintptr) error {
- return updateProcThreadAttribute(al, flags, attribute, value, size, prevValue, returnedSize)
+// Note that the value passed to this function will be copied into memory
+// allocated by LocalAlloc, the contents of which should not contain any
+// Go-managed pointers, even if the passed value itself is a Go-managed
+// pointer.
+func (al *ProcThreadAttributeListContainer) Update(attribute uintptr, value unsafe.Pointer, size uintptr) error {
+ alloc, err := LocalAlloc(LMEM_FIXED, uint32(size))
+ if err != nil {
+ return err
+ }
+ var src, dst []byte
+ hdr := (*unsafeheader.Slice)(unsafe.Pointer(&src))
+ hdr.Data = value
+ hdr.Cap = int(size)
+ hdr.Len = int(size)
+ hdr = (*unsafeheader.Slice)(unsafe.Pointer(&dst))
+ hdr.Data = unsafe.Pointer(alloc)
+ hdr.Cap = int(size)
+ hdr.Len = int(size)
+ copy(dst, src)
+ al.heapAllocations = append(al.heapAllocations, alloc)
+ return updateProcThreadAttribute(al.data, 0, attribute, unsafe.Pointer(alloc), size, nil, nil)
}
// Delete frees ProcThreadAttributeList's resources.
-func (al *ProcThreadAttributeList) Delete() {
- deleteProcThreadAttributeList(al)
+func (al *ProcThreadAttributeListContainer) Delete() {
+ deleteProcThreadAttributeList(al.data)
+ for i := range al.heapAllocations {
+ LocalFree(Handle(al.heapAllocations[i]))
+ }
+ al.heapAllocations = nil
+}
+
+// List returns the actual ProcThreadAttributeList to be passed to StartupInfoEx.
+func (al *ProcThreadAttributeListContainer) List() *ProcThreadAttributeList {
+ return al.data
}
diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go
index 111c10d3a..d414ef13b 100644
--- a/vendor/golang.org/x/sys/windows/security_windows.go
+++ b/vendor/golang.org/x/sys/windows/security_windows.go
@@ -889,6 +889,7 @@ type WTS_SESSION_INFO struct {
//sys WTSQueryUserToken(session uint32, token *Token) (err error) = wtsapi32.WTSQueryUserToken
//sys WTSEnumerateSessions(handle Handle, reserved uint32, version uint32, sessions **WTS_SESSION_INFO, count *uint32) (err error) = wtsapi32.WTSEnumerateSessionsW
//sys WTSFreeMemory(ptr uintptr) = wtsapi32.WTSFreeMemory
+//sys WTSGetActiveConsoleSessionId() (sessionID uint32)
type ACL struct {
aclRevision byte
diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go
index bb6aaf89e..1215b2ae2 100644
--- a/vendor/golang.org/x/sys/windows/syscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/syscall_windows.go
@@ -220,6 +220,7 @@ func NewCallbackCDecl(fn interface{}) uintptr {
//sys CancelIo(s Handle) (err error)
//sys CancelIoEx(s Handle, o *Overlapped) (err error)
//sys CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) = CreateProcessW
+//sys CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) = advapi32.CreateProcessAsUserW
//sys initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrcount uint32, flags uint32, size *uintptr) (err error) = InitializeProcThreadAttributeList
//sys deleteProcThreadAttributeList(attrlist *ProcThreadAttributeList) = DeleteProcThreadAttributeList
//sys updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, attr uintptr, value unsafe.Pointer, size uintptr, prevvalue unsafe.Pointer, returnedsize *uintptr) (err error) = UpdateProcThreadAttribute
diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go
index 23fe18ece..17f03312d 100644
--- a/vendor/golang.org/x/sys/windows/types_windows.go
+++ b/vendor/golang.org/x/sys/windows/types_windows.go
@@ -680,7 +680,7 @@ const (
WTD_CHOICE_CERT = 5
WTD_STATEACTION_IGNORE = 0x00000000
- WTD_STATEACTION_VERIFY = 0x00000010
+ WTD_STATEACTION_VERIFY = 0x00000001
WTD_STATEACTION_CLOSE = 0x00000002
WTD_STATEACTION_AUTO_CACHE = 0x00000003
WTD_STATEACTION_AUTO_CACHE_FLUSH = 0x00000004
@@ -909,14 +909,15 @@ type StartupInfoEx struct {
// ProcThreadAttributeList is a placeholder type to represent a PROC_THREAD_ATTRIBUTE_LIST.
//
-// To create a *ProcThreadAttributeList, use NewProcThreadAttributeList, and
-// free its memory using ProcThreadAttributeList.Delete.
-type ProcThreadAttributeList struct {
- // This is of type unsafe.Pointer, not of type byte or uintptr, because
- // the contents of it is mostly a list of pointers, and in most cases,
- // that's a list of pointers to Go-allocated objects. In order to keep
- // the GC from collecting these objects, we declare this as unsafe.Pointer.
- _ [1]unsafe.Pointer
+// To create a *ProcThreadAttributeList, use NewProcThreadAttributeList, update
+// it with ProcThreadAttributeListContainer.Update, free its memory using
+// ProcThreadAttributeListContainer.Delete, and access the list itself using
+// ProcThreadAttributeListContainer.List.
+type ProcThreadAttributeList struct{}
+
+type ProcThreadAttributeListContainer struct {
+ data *ProcThreadAttributeList
+ heapAllocations []uintptr
}
type ProcessInformation struct {
diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
index 559bc845c..2083ec376 100644
--- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
@@ -69,6 +69,7 @@ var (
procConvertStringSecurityDescriptorToSecurityDescriptorW = modadvapi32.NewProc("ConvertStringSecurityDescriptorToSecurityDescriptorW")
procConvertStringSidToSidW = modadvapi32.NewProc("ConvertStringSidToSidW")
procCopySid = modadvapi32.NewProc("CopySid")
+ procCreateProcessAsUserW = modadvapi32.NewProc("CreateProcessAsUserW")
procCreateServiceW = modadvapi32.NewProc("CreateServiceW")
procCreateWellKnownSid = modadvapi32.NewProc("CreateWellKnownSid")
procCryptAcquireContextW = modadvapi32.NewProc("CryptAcquireContextW")
@@ -345,6 +346,7 @@ var (
procVirtualLock = modkernel32.NewProc("VirtualLock")
procVirtualProtect = modkernel32.NewProc("VirtualProtect")
procVirtualUnlock = modkernel32.NewProc("VirtualUnlock")
+ procWTSGetActiveConsoleSessionId = modkernel32.NewProc("WTSGetActiveConsoleSessionId")
procWaitForMultipleObjects = modkernel32.NewProc("WaitForMultipleObjects")
procWaitForSingleObject = modkernel32.NewProc("WaitForSingleObject")
procWriteConsoleW = modkernel32.NewProc("WriteConsoleW")
@@ -553,6 +555,18 @@ func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) {
return
}
+func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) {
+ var _p0 uint32
+ if inheritHandles {
+ _p0 = 1
+ }
+ r1, _, e1 := syscall.Syscall12(procCreateProcessAsUserW.Addr(), 11, uintptr(token), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0)
+ if r1 == 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
func CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) {
r0, _, e1 := syscall.Syscall15(procCreateServiceW.Addr(), 13, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(unsafe.Pointer(displayName)), uintptr(access), uintptr(srvType), uintptr(startType), uintptr(errCtl), uintptr(unsafe.Pointer(pathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), 0, 0)
handle = Handle(r0)
@@ -2979,6 +2993,12 @@ func VirtualUnlock(addr uintptr, length uintptr) (err error) {
return
}
+func WTSGetActiveConsoleSessionId() (sessionID uint32) {
+ r0, _, _ := syscall.Syscall(procWTSGetActiveConsoleSessionId.Addr(), 0, 0, 0, 0)
+ sessionID = uint32(r0)
+ return
+}
+
func waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMilliseconds uint32) (event uint32, err error) {
var _p0 uint32
if waitAll {
diff --git a/vendor/golang.org/x/text/internal/language/common.go b/vendor/golang.org/x/text/internal/language/common.go
new file mode 100644
index 000000000..cdfdb7497
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/common.go
@@ -0,0 +1,16 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+package language
+
+// This file contains code common to the maketables.go and the package code.
+
+// AliasType is the type of an alias in AliasMap.
+type AliasType int8
+
+const (
+ Deprecated AliasType = iota
+ Macro
+ Legacy
+
+ AliasTypeUnknown AliasType = -1
+)
diff --git a/vendor/golang.org/x/text/internal/language/compact.go b/vendor/golang.org/x/text/internal/language/compact.go
new file mode 100644
index 000000000..46a001507
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/compact.go
@@ -0,0 +1,29 @@
+// Copyright 2018 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 language
+
+// CompactCoreInfo is a compact integer with the three core tags encoded.
+type CompactCoreInfo uint32
+
+// GetCompactCore generates a uint32 value that is guaranteed to be unique for
+// different language, region, and script values.
+func GetCompactCore(t Tag) (cci CompactCoreInfo, ok bool) {
+ if t.LangID > langNoIndexOffset {
+ return 0, false
+ }
+ cci |= CompactCoreInfo(t.LangID) << (8 + 12)
+ cci |= CompactCoreInfo(t.ScriptID) << 12
+ cci |= CompactCoreInfo(t.RegionID)
+ return cci, true
+}
+
+// Tag generates a tag from c.
+func (c CompactCoreInfo) Tag() Tag {
+ return Tag{
+ LangID: Language(c >> 20),
+ RegionID: Region(c & 0x3ff),
+ ScriptID: Script(c>>12) & 0xff,
+ }
+}
diff --git a/vendor/golang.org/x/text/internal/language/compact/compact.go b/vendor/golang.org/x/text/internal/language/compact/compact.go
new file mode 100644
index 000000000..1b36935ef
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/compact/compact.go
@@ -0,0 +1,61 @@
+// Copyright 2018 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 compact defines a compact representation of language tags.
+//
+// Common language tags (at least all for which locale information is defined
+// in CLDR) are assigned a unique index. Each Tag is associated with such an
+// ID for selecting language-related resources (such as translations) as well
+// as one for selecting regional defaults (currency, number formatting, etc.)
+//
+// It may want to export this functionality at some point, but at this point
+// this is only available for use within x/text.
+package compact // import "golang.org/x/text/internal/language/compact"
+
+import (
+ "sort"
+ "strings"
+
+ "golang.org/x/text/internal/language"
+)
+
+// ID is an integer identifying a single tag.
+type ID uint16
+
+func getCoreIndex(t language.Tag) (id ID, ok bool) {
+ cci, ok := language.GetCompactCore(t)
+ if !ok {
+ return 0, false
+ }
+ i := sort.Search(len(coreTags), func(i int) bool {
+ return cci <= coreTags[i]
+ })
+ if i == len(coreTags) || coreTags[i] != cci {
+ return 0, false
+ }
+ return ID(i), true
+}
+
+// Parent returns the ID of the parent or the root ID if id is already the root.
+func (id ID) Parent() ID {
+ return parents[id]
+}
+
+// Tag converts id to an internal language Tag.
+func (id ID) Tag() language.Tag {
+ if int(id) >= len(coreTags) {
+ return specialTags[int(id)-len(coreTags)]
+ }
+ return coreTags[id].Tag()
+}
+
+var specialTags []language.Tag
+
+func init() {
+ tags := strings.Split(specialTagsStr, " ")
+ specialTags = make([]language.Tag, len(tags))
+ for i, t := range tags {
+ specialTags[i] = language.MustParse(t)
+ }
+}
diff --git a/vendor/golang.org/x/text/internal/language/compact/language.go b/vendor/golang.org/x/text/internal/language/compact/language.go
new file mode 100644
index 000000000..83816a72a
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/compact/language.go
@@ -0,0 +1,260 @@
+// 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 gen.go gen_index.go -output tables.go
+//go:generate go run gen_parents.go
+
+package compact
+
+// TODO: Remove above NOTE after:
+// - verifying that tables are dropped correctly (most notably matcher tables).
+
+import (
+ "strings"
+
+ "golang.org/x/text/internal/language"
+)
+
+// Tag represents a BCP 47 language tag. It is used to specify an instance of a
+// specific language or locale. All language tag values are guaranteed to be
+// well-formed.
+type Tag struct {
+ // NOTE: exported tags will become part of the public API.
+ language ID
+ locale ID
+ full fullTag // always a language.Tag for now.
+}
+
+const _und = 0
+
+type fullTag interface {
+ IsRoot() bool
+ Parent() language.Tag
+}
+
+// Make a compact Tag from a fully specified internal language Tag.
+func Make(t language.Tag) (tag Tag) {
+ if region := t.TypeForKey("rg"); len(region) == 6 && region[2:] == "zzzz" {
+ if r, err := language.ParseRegion(region[:2]); err == nil {
+ tFull := t
+ t, _ = t.SetTypeForKey("rg", "")
+ // TODO: should we not consider "va" for the language tag?
+ var exact1, exact2 bool
+ tag.language, exact1 = FromTag(t)
+ t.RegionID = r
+ tag.locale, exact2 = FromTag(t)
+ if !exact1 || !exact2 {
+ tag.full = tFull
+ }
+ return tag
+ }
+ }
+ lang, ok := FromTag(t)
+ tag.language = lang
+ tag.locale = lang
+ if !ok {
+ tag.full = t
+ }
+ return tag
+}
+
+// Tag returns an internal language Tag version of this tag.
+func (t Tag) Tag() language.Tag {
+ if t.full != nil {
+ return t.full.(language.Tag)
+ }
+ tag := t.language.Tag()
+ if t.language != t.locale {
+ loc := t.locale.Tag()
+ tag, _ = tag.SetTypeForKey("rg", strings.ToLower(loc.RegionID.String())+"zzzz")
+ }
+ return tag
+}
+
+// IsCompact reports whether this tag is fully defined in terms of ID.
+func (t *Tag) IsCompact() bool {
+ return t.full == nil
+}
+
+// MayHaveVariants reports whether a tag may have variants. If it returns false
+// it is guaranteed the tag does not have variants.
+func (t Tag) MayHaveVariants() bool {
+ return t.full != nil || int(t.language) >= len(coreTags)
+}
+
+// MayHaveExtensions reports whether a tag may have extensions. If it returns
+// false it is guaranteed the tag does not have them.
+func (t Tag) MayHaveExtensions() bool {
+ return t.full != nil ||
+ int(t.language) >= len(coreTags) ||
+ t.language != t.locale
+}
+
+// IsRoot returns true if t is equal to language "und".
+func (t Tag) IsRoot() bool {
+ if t.full != nil {
+ return t.full.IsRoot()
+ }
+ return t.language == _und
+}
+
+// Parent returns the CLDR parent of t. In CLDR, missing fields in data for a
+// specific language are substituted with fields from the parent language.
+// The parent for a language may change for newer versions of CLDR.
+func (t Tag) Parent() Tag {
+ if t.full != nil {
+ return Make(t.full.Parent())
+ }
+ if t.language != t.locale {
+ // Simulate stripping -u-rg-xxxxxx
+ return Tag{language: t.language, locale: t.language}
+ }
+ // TODO: use parent lookup table once cycle from internal package is
+ // removed. Probably by internalizing the table and declaring this fast
+ // enough.
+ // lang := compactID(internal.Parent(uint16(t.language)))
+ lang, _ := FromTag(t.language.Tag().Parent())
+ return Tag{language: lang, locale: lang}
+}
+
+// returns token t and the rest of the string.
+func nextToken(s string) (t, tail string) {
+ p := strings.Index(s[1:], "-")
+ if p == -1 {
+ return s[1:], ""
+ }
+ p++
+ return s[1:p], s[p:]
+}
+
+// LanguageID returns an index, where 0 <= index < NumCompactTags, for tags
+// for which data exists in the text repository.The index will change over time
+// and should not be stored in persistent storage. If t does not match a compact
+// index, exact will be false and the compact index will be returned for the
+// first match after repeatedly taking the Parent of t.
+func LanguageID(t Tag) (id ID, exact bool) {
+ return t.language, t.full == nil
+}
+
+// RegionalID returns the ID for the regional variant of this tag. This index is
+// used to indicate region-specific overrides, such as default currency, default
+// calendar and week data, default time cycle, and default measurement system
+// and unit preferences.
+//
+// For instance, the tag en-GB-u-rg-uszzzz specifies British English with US
+// settings for currency, number formatting, etc. The CompactIndex for this tag
+// will be that for en-GB, while the RegionalID will be the one corresponding to
+// en-US.
+func RegionalID(t Tag) (id ID, exact bool) {
+ return t.locale, t.full == nil
+}
+
+// LanguageTag returns t stripped of regional variant indicators.
+//
+// At the moment this means it is stripped of a regional and variant subtag "rg"
+// and "va" in the "u" extension.
+func (t Tag) LanguageTag() Tag {
+ if t.full == nil {
+ return Tag{language: t.language, locale: t.language}
+ }
+ tt := t.Tag()
+ tt.SetTypeForKey("rg", "")
+ tt.SetTypeForKey("va", "")
+ return Make(tt)
+}
+
+// RegionalTag returns the regional variant of the tag.
+//
+// At the moment this means that the region is set from the regional subtag
+// "rg" in the "u" extension.
+func (t Tag) RegionalTag() Tag {
+ rt := Tag{language: t.locale, locale: t.locale}
+ if t.full == nil {
+ return rt
+ }
+ b := language.Builder{}
+ tag := t.Tag()
+ // tag, _ = tag.SetTypeForKey("rg", "")
+ b.SetTag(t.locale.Tag())
+ if v := tag.Variants(); v != "" {
+ for _, v := range strings.Split(v, "-") {
+ b.AddVariant(v)
+ }
+ }
+ for _, e := range tag.Extensions() {
+ b.AddExt(e)
+ }
+ return t
+}
+
+// FromTag reports closest matching ID for an internal language Tag.
+func FromTag(t language.Tag) (id ID, exact bool) {
+ // TODO: perhaps give more frequent tags a lower index.
+ // TODO: we could make the indexes stable. This will excluded some
+ // possibilities for optimization, so don't do this quite yet.
+ exact = true
+
+ b, s, r := t.Raw()
+ if t.HasString() {
+ if t.IsPrivateUse() {
+ // We have no entries for user-defined tags.
+ return 0, false
+ }
+ hasExtra := false
+ if t.HasVariants() {
+ if t.HasExtensions() {
+ build := language.Builder{}
+ build.SetTag(language.Tag{LangID: b, ScriptID: s, RegionID: r})
+ build.AddVariant(t.Variants())
+ exact = false
+ t = build.Make()
+ }
+ hasExtra = true
+ } else if _, ok := t.Extension('u'); ok {
+ // TODO: va may mean something else. Consider not considering it.
+ // Strip all but the 'va' entry.
+ old := t
+ variant := t.TypeForKey("va")
+ t = language.Tag{LangID: b, ScriptID: s, RegionID: r}
+ if variant != "" {
+ t, _ = t.SetTypeForKey("va", variant)
+ hasExtra = true
+ }
+ exact = old == t
+ } else {
+ exact = false
+ }
+ if hasExtra {
+ // We have some variants.
+ for i, s := range specialTags {
+ if s == t {
+ return ID(i + len(coreTags)), exact
+ }
+ }
+ exact = false
+ }
+ }
+ if x, ok := getCoreIndex(t); ok {
+ return x, exact
+ }
+ exact = false
+ if r != 0 && s == 0 {
+ // Deal with cases where an extra script is inserted for the region.
+ t, _ := t.Maximize()
+ if x, ok := getCoreIndex(t); ok {
+ return x, exact
+ }
+ }
+ for t = t.Parent(); t != root; t = t.Parent() {
+ // No variants specified: just compare core components.
+ // The key has the form lllssrrr, where l, s, and r are nibbles for
+ // respectively the langID, scriptID, and regionID.
+ if x, ok := getCoreIndex(t); ok {
+ return x, exact
+ }
+ }
+ return 0, exact
+}
+
+var root = language.Tag{}
diff --git a/vendor/golang.org/x/text/internal/language/compact/parents.go b/vendor/golang.org/x/text/internal/language/compact/parents.go
new file mode 100644
index 000000000..8d810723c
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/compact/parents.go
@@ -0,0 +1,120 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+package compact
+
+// parents maps a compact index of a tag to the compact index of the parent of
+// this tag.
+var parents = []ID{ // 775 elements
+ // Entry 0 - 3F
+ 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0004, 0x0000, 0x0006,
+ 0x0000, 0x0008, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a,
+ 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a,
+ 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a,
+ 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000,
+ 0x0000, 0x0028, 0x0000, 0x002a, 0x0000, 0x002c, 0x0000, 0x0000,
+ 0x002f, 0x002e, 0x002e, 0x0000, 0x0033, 0x0000, 0x0035, 0x0000,
+ 0x0037, 0x0000, 0x0039, 0x0000, 0x003b, 0x0000, 0x0000, 0x003e,
+ // Entry 40 - 7F
+ 0x0000, 0x0040, 0x0040, 0x0000, 0x0043, 0x0043, 0x0000, 0x0046,
+ 0x0000, 0x0048, 0x0000, 0x0000, 0x004b, 0x004a, 0x004a, 0x0000,
+ 0x004f, 0x004f, 0x004f, 0x004f, 0x0000, 0x0054, 0x0054, 0x0000,
+ 0x0057, 0x0000, 0x0059, 0x0000, 0x005b, 0x0000, 0x005d, 0x005d,
+ 0x0000, 0x0060, 0x0000, 0x0062, 0x0000, 0x0064, 0x0000, 0x0066,
+ 0x0066, 0x0000, 0x0069, 0x0000, 0x006b, 0x006b, 0x006b, 0x006b,
+ 0x006b, 0x006b, 0x006b, 0x0000, 0x0073, 0x0000, 0x0075, 0x0000,
+ 0x0077, 0x0000, 0x0000, 0x007a, 0x0000, 0x007c, 0x0000, 0x007e,
+ // Entry 80 - BF
+ 0x0000, 0x0080, 0x0080, 0x0000, 0x0083, 0x0083, 0x0000, 0x0086,
+ 0x0087, 0x0087, 0x0087, 0x0086, 0x0088, 0x0087, 0x0087, 0x0087,
+ 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0088,
+ 0x0087, 0x0087, 0x0087, 0x0087, 0x0088, 0x0087, 0x0088, 0x0087,
+ 0x0087, 0x0088, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087,
+ 0x0087, 0x0087, 0x0087, 0x0086, 0x0087, 0x0087, 0x0087, 0x0087,
+ 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087,
+ 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0086, 0x0087, 0x0086,
+ // Entry C0 - FF
+ 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087,
+ 0x0088, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087,
+ 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0088, 0x0087,
+ 0x0087, 0x0088, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087,
+ 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0086, 0x0086, 0x0087,
+ 0x0087, 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0000,
+ 0x00ef, 0x0000, 0x00f1, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2,
+ 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f1, 0x00f2, 0x00f1, 0x00f1,
+ // Entry 100 - 13F
+ 0x00f2, 0x00f2, 0x00f1, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f1,
+ 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x0000, 0x010e,
+ 0x0000, 0x0110, 0x0000, 0x0112, 0x0000, 0x0114, 0x0114, 0x0000,
+ 0x0117, 0x0117, 0x0117, 0x0117, 0x0000, 0x011c, 0x0000, 0x011e,
+ 0x0000, 0x0120, 0x0120, 0x0000, 0x0123, 0x0123, 0x0123, 0x0123,
+ 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123,
+ 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123,
+ 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123,
+ // Entry 140 - 17F
+ 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123,
+ 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123,
+ 0x0123, 0x0123, 0x0000, 0x0152, 0x0000, 0x0154, 0x0000, 0x0156,
+ 0x0000, 0x0158, 0x0000, 0x015a, 0x0000, 0x015c, 0x015c, 0x015c,
+ 0x0000, 0x0160, 0x0000, 0x0000, 0x0163, 0x0000, 0x0165, 0x0000,
+ 0x0167, 0x0167, 0x0167, 0x0000, 0x016b, 0x0000, 0x016d, 0x0000,
+ 0x016f, 0x0000, 0x0171, 0x0171, 0x0000, 0x0174, 0x0000, 0x0176,
+ 0x0000, 0x0178, 0x0000, 0x017a, 0x0000, 0x017c, 0x0000, 0x017e,
+ // Entry 180 - 1BF
+ 0x0000, 0x0000, 0x0000, 0x0182, 0x0000, 0x0184, 0x0184, 0x0184,
+ 0x0184, 0x0000, 0x0000, 0x0000, 0x018b, 0x0000, 0x0000, 0x018e,
+ 0x0000, 0x0000, 0x0191, 0x0000, 0x0000, 0x0000, 0x0195, 0x0000,
+ 0x0197, 0x0000, 0x0000, 0x019a, 0x0000, 0x0000, 0x019d, 0x0000,
+ 0x019f, 0x0000, 0x01a1, 0x0000, 0x01a3, 0x0000, 0x01a5, 0x0000,
+ 0x01a7, 0x0000, 0x01a9, 0x0000, 0x01ab, 0x0000, 0x01ad, 0x0000,
+ 0x01af, 0x0000, 0x01b1, 0x01b1, 0x0000, 0x01b4, 0x0000, 0x01b6,
+ 0x0000, 0x01b8, 0x0000, 0x01ba, 0x0000, 0x01bc, 0x0000, 0x0000,
+ // Entry 1C0 - 1FF
+ 0x01bf, 0x0000, 0x01c1, 0x0000, 0x01c3, 0x0000, 0x01c5, 0x0000,
+ 0x01c7, 0x0000, 0x01c9, 0x0000, 0x01cb, 0x01cb, 0x01cb, 0x01cb,
+ 0x0000, 0x01d0, 0x0000, 0x01d2, 0x01d2, 0x0000, 0x01d5, 0x0000,
+ 0x01d7, 0x0000, 0x01d9, 0x0000, 0x01db, 0x0000, 0x01dd, 0x0000,
+ 0x01df, 0x01df, 0x0000, 0x01e2, 0x0000, 0x01e4, 0x0000, 0x01e6,
+ 0x0000, 0x01e8, 0x0000, 0x01ea, 0x0000, 0x01ec, 0x0000, 0x01ee,
+ 0x0000, 0x01f0, 0x0000, 0x0000, 0x01f3, 0x0000, 0x01f5, 0x01f5,
+ 0x01f5, 0x0000, 0x01f9, 0x0000, 0x01fb, 0x0000, 0x01fd, 0x0000,
+ // Entry 200 - 23F
+ 0x01ff, 0x0000, 0x0000, 0x0202, 0x0000, 0x0204, 0x0204, 0x0000,
+ 0x0207, 0x0000, 0x0209, 0x0209, 0x0000, 0x020c, 0x020c, 0x0000,
+ 0x020f, 0x020f, 0x020f, 0x020f, 0x020f, 0x020f, 0x020f, 0x0000,
+ 0x0217, 0x0000, 0x0219, 0x0000, 0x021b, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0221, 0x0000, 0x0000, 0x0224, 0x0000, 0x0226,
+ 0x0226, 0x0000, 0x0229, 0x0000, 0x022b, 0x022b, 0x0000, 0x0000,
+ 0x022f, 0x022e, 0x022e, 0x0000, 0x0000, 0x0234, 0x0000, 0x0236,
+ 0x0000, 0x0238, 0x0000, 0x0244, 0x023a, 0x0244, 0x0244, 0x0244,
+ // Entry 240 - 27F
+ 0x0244, 0x0244, 0x0244, 0x0244, 0x023a, 0x0244, 0x0244, 0x0000,
+ 0x0247, 0x0247, 0x0247, 0x0000, 0x024b, 0x0000, 0x024d, 0x0000,
+ 0x024f, 0x024f, 0x0000, 0x0252, 0x0000, 0x0254, 0x0254, 0x0254,
+ 0x0254, 0x0254, 0x0254, 0x0000, 0x025b, 0x0000, 0x025d, 0x0000,
+ 0x025f, 0x0000, 0x0261, 0x0000, 0x0263, 0x0000, 0x0265, 0x0000,
+ 0x0000, 0x0268, 0x0268, 0x0268, 0x0000, 0x026c, 0x0000, 0x026e,
+ 0x0000, 0x0270, 0x0000, 0x0000, 0x0000, 0x0274, 0x0273, 0x0273,
+ 0x0000, 0x0278, 0x0000, 0x027a, 0x0000, 0x027c, 0x0000, 0x0000,
+ // Entry 280 - 2BF
+ 0x0000, 0x0000, 0x0281, 0x0000, 0x0000, 0x0284, 0x0000, 0x0286,
+ 0x0286, 0x0286, 0x0286, 0x0000, 0x028b, 0x028b, 0x028b, 0x0000,
+ 0x028f, 0x028f, 0x028f, 0x028f, 0x028f, 0x0000, 0x0295, 0x0295,
+ 0x0295, 0x0295, 0x0000, 0x0000, 0x0000, 0x0000, 0x029d, 0x029d,
+ 0x029d, 0x0000, 0x02a1, 0x02a1, 0x02a1, 0x02a1, 0x0000, 0x0000,
+ 0x02a7, 0x02a7, 0x02a7, 0x02a7, 0x0000, 0x02ac, 0x0000, 0x02ae,
+ 0x02ae, 0x0000, 0x02b1, 0x0000, 0x02b3, 0x0000, 0x02b5, 0x02b5,
+ 0x0000, 0x0000, 0x02b9, 0x0000, 0x0000, 0x0000, 0x02bd, 0x0000,
+ // Entry 2C0 - 2FF
+ 0x02bf, 0x02bf, 0x0000, 0x0000, 0x02c3, 0x0000, 0x02c5, 0x0000,
+ 0x02c7, 0x0000, 0x02c9, 0x0000, 0x02cb, 0x0000, 0x02cd, 0x02cd,
+ 0x0000, 0x0000, 0x02d1, 0x0000, 0x02d3, 0x02d0, 0x02d0, 0x0000,
+ 0x0000, 0x02d8, 0x02d7, 0x02d7, 0x0000, 0x0000, 0x02dd, 0x0000,
+ 0x02df, 0x0000, 0x02e1, 0x0000, 0x0000, 0x02e4, 0x0000, 0x02e6,
+ 0x0000, 0x0000, 0x02e9, 0x0000, 0x02eb, 0x0000, 0x02ed, 0x0000,
+ 0x02ef, 0x02ef, 0x0000, 0x0000, 0x02f3, 0x02f2, 0x02f2, 0x0000,
+ 0x02f7, 0x0000, 0x02f9, 0x02f9, 0x02f9, 0x02f9, 0x02f9, 0x0000,
+ // Entry 300 - 33F
+ 0x02ff, 0x0300, 0x02ff, 0x0000, 0x0303, 0x0051, 0x00e6,
+} // Size: 1574 bytes
+
+// Total table size 1574 bytes (1KiB); checksum: 895AAF0B
diff --git a/vendor/golang.org/x/text/internal/language/compact/tables.go b/vendor/golang.org/x/text/internal/language/compact/tables.go
new file mode 100644
index 000000000..fe7ad9ea7
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/compact/tables.go
@@ -0,0 +1,1015 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+package compact
+
+import "golang.org/x/text/internal/language"
+
+// CLDRVersion is the CLDR version from which the tables in this package are derived.
+const CLDRVersion = "32"
+
+// NumCompactTags is the number of common tags. The maximum tag is
+// NumCompactTags-1.
+const NumCompactTags = 775
+const (
+ undIndex ID = 0
+ afIndex ID = 1
+ afNAIndex ID = 2
+ afZAIndex ID = 3
+ agqIndex ID = 4
+ agqCMIndex ID = 5
+ akIndex ID = 6
+ akGHIndex ID = 7
+ amIndex ID = 8
+ amETIndex ID = 9
+ arIndex ID = 10
+ ar001Index ID = 11
+ arAEIndex ID = 12
+ arBHIndex ID = 13
+ arDJIndex ID = 14
+ arDZIndex ID = 15
+ arEGIndex ID = 16
+ arEHIndex ID = 17
+ arERIndex ID = 18
+ arILIndex ID = 19
+ arIQIndex ID = 20
+ arJOIndex ID = 21
+ arKMIndex ID = 22
+ arKWIndex ID = 23
+ arLBIndex ID = 24
+ arLYIndex ID = 25
+ arMAIndex ID = 26
+ arMRIndex ID = 27
+ arOMIndex ID = 28
+ arPSIndex ID = 29
+ arQAIndex ID = 30
+ arSAIndex ID = 31
+ arSDIndex ID = 32
+ arSOIndex ID = 33
+ arSSIndex ID = 34
+ arSYIndex ID = 35
+ arTDIndex ID = 36
+ arTNIndex ID = 37
+ arYEIndex ID = 38
+ arsIndex ID = 39
+ asIndex ID = 40
+ asINIndex ID = 41
+ asaIndex ID = 42
+ asaTZIndex ID = 43
+ astIndex ID = 44
+ astESIndex ID = 45
+ azIndex ID = 46
+ azCyrlIndex ID = 47
+ azCyrlAZIndex ID = 48
+ azLatnIndex ID = 49
+ azLatnAZIndex ID = 50
+ basIndex ID = 51
+ basCMIndex ID = 52
+ beIndex ID = 53
+ beBYIndex ID = 54
+ bemIndex ID = 55
+ bemZMIndex ID = 56
+ bezIndex ID = 57
+ bezTZIndex ID = 58
+ bgIndex ID = 59
+ bgBGIndex ID = 60
+ bhIndex ID = 61
+ bmIndex ID = 62
+ bmMLIndex ID = 63
+ bnIndex ID = 64
+ bnBDIndex ID = 65
+ bnINIndex ID = 66
+ boIndex ID = 67
+ boCNIndex ID = 68
+ boINIndex ID = 69
+ brIndex ID = 70
+ brFRIndex ID = 71
+ brxIndex ID = 72
+ brxINIndex ID = 73
+ bsIndex ID = 74
+ bsCyrlIndex ID = 75
+ bsCyrlBAIndex ID = 76
+ bsLatnIndex ID = 77
+ bsLatnBAIndex ID = 78
+ caIndex ID = 79
+ caADIndex ID = 80
+ caESIndex ID = 81
+ caFRIndex ID = 82
+ caITIndex ID = 83
+ ccpIndex ID = 84
+ ccpBDIndex ID = 85
+ ccpINIndex ID = 86
+ ceIndex ID = 87
+ ceRUIndex ID = 88
+ cggIndex ID = 89
+ cggUGIndex ID = 90
+ chrIndex ID = 91
+ chrUSIndex ID = 92
+ ckbIndex ID = 93
+ ckbIQIndex ID = 94
+ ckbIRIndex ID = 95
+ csIndex ID = 96
+ csCZIndex ID = 97
+ cuIndex ID = 98
+ cuRUIndex ID = 99
+ cyIndex ID = 100
+ cyGBIndex ID = 101
+ daIndex ID = 102
+ daDKIndex ID = 103
+ daGLIndex ID = 104
+ davIndex ID = 105
+ davKEIndex ID = 106
+ deIndex ID = 107
+ deATIndex ID = 108
+ deBEIndex ID = 109
+ deCHIndex ID = 110
+ deDEIndex ID = 111
+ deITIndex ID = 112
+ deLIIndex ID = 113
+ deLUIndex ID = 114
+ djeIndex ID = 115
+ djeNEIndex ID = 116
+ dsbIndex ID = 117
+ dsbDEIndex ID = 118
+ duaIndex ID = 119
+ duaCMIndex ID = 120
+ dvIndex ID = 121
+ dyoIndex ID = 122
+ dyoSNIndex ID = 123
+ dzIndex ID = 124
+ dzBTIndex ID = 125
+ ebuIndex ID = 126
+ ebuKEIndex ID = 127
+ eeIndex ID = 128
+ eeGHIndex ID = 129
+ eeTGIndex ID = 130
+ elIndex ID = 131
+ elCYIndex ID = 132
+ elGRIndex ID = 133
+ enIndex ID = 134
+ en001Index ID = 135
+ en150Index ID = 136
+ enAGIndex ID = 137
+ enAIIndex ID = 138
+ enASIndex ID = 139
+ enATIndex ID = 140
+ enAUIndex ID = 141
+ enBBIndex ID = 142
+ enBEIndex ID = 143
+ enBIIndex ID = 144
+ enBMIndex ID = 145
+ enBSIndex ID = 146
+ enBWIndex ID = 147
+ enBZIndex ID = 148
+ enCAIndex ID = 149
+ enCCIndex ID = 150
+ enCHIndex ID = 151
+ enCKIndex ID = 152
+ enCMIndex ID = 153
+ enCXIndex ID = 154
+ enCYIndex ID = 155
+ enDEIndex ID = 156
+ enDGIndex ID = 157
+ enDKIndex ID = 158
+ enDMIndex ID = 159
+ enERIndex ID = 160
+ enFIIndex ID = 161
+ enFJIndex ID = 162
+ enFKIndex ID = 163
+ enFMIndex ID = 164
+ enGBIndex ID = 165
+ enGDIndex ID = 166
+ enGGIndex ID = 167
+ enGHIndex ID = 168
+ enGIIndex ID = 169
+ enGMIndex ID = 170
+ enGUIndex ID = 171
+ enGYIndex ID = 172
+ enHKIndex ID = 173
+ enIEIndex ID = 174
+ enILIndex ID = 175
+ enIMIndex ID = 176
+ enINIndex ID = 177
+ enIOIndex ID = 178
+ enJEIndex ID = 179
+ enJMIndex ID = 180
+ enKEIndex ID = 181
+ enKIIndex ID = 182
+ enKNIndex ID = 183
+ enKYIndex ID = 184
+ enLCIndex ID = 185
+ enLRIndex ID = 186
+ enLSIndex ID = 187
+ enMGIndex ID = 188
+ enMHIndex ID = 189
+ enMOIndex ID = 190
+ enMPIndex ID = 191
+ enMSIndex ID = 192
+ enMTIndex ID = 193
+ enMUIndex ID = 194
+ enMWIndex ID = 195
+ enMYIndex ID = 196
+ enNAIndex ID = 197
+ enNFIndex ID = 198
+ enNGIndex ID = 199
+ enNLIndex ID = 200
+ enNRIndex ID = 201
+ enNUIndex ID = 202
+ enNZIndex ID = 203
+ enPGIndex ID = 204
+ enPHIndex ID = 205
+ enPKIndex ID = 206
+ enPNIndex ID = 207
+ enPRIndex ID = 208
+ enPWIndex ID = 209
+ enRWIndex ID = 210
+ enSBIndex ID = 211
+ enSCIndex ID = 212
+ enSDIndex ID = 213
+ enSEIndex ID = 214
+ enSGIndex ID = 215
+ enSHIndex ID = 216
+ enSIIndex ID = 217
+ enSLIndex ID = 218
+ enSSIndex ID = 219
+ enSXIndex ID = 220
+ enSZIndex ID = 221
+ enTCIndex ID = 222
+ enTKIndex ID = 223
+ enTOIndex ID = 224
+ enTTIndex ID = 225
+ enTVIndex ID = 226
+ enTZIndex ID = 227
+ enUGIndex ID = 228
+ enUMIndex ID = 229
+ enUSIndex ID = 230
+ enVCIndex ID = 231
+ enVGIndex ID = 232
+ enVIIndex ID = 233
+ enVUIndex ID = 234
+ enWSIndex ID = 235
+ enZAIndex ID = 236
+ enZMIndex ID = 237
+ enZWIndex ID = 238
+ eoIndex ID = 239
+ eo001Index ID = 240
+ esIndex ID = 241
+ es419Index ID = 242
+ esARIndex ID = 243
+ esBOIndex ID = 244
+ esBRIndex ID = 245
+ esBZIndex ID = 246
+ esCLIndex ID = 247
+ esCOIndex ID = 248
+ esCRIndex ID = 249
+ esCUIndex ID = 250
+ esDOIndex ID = 251
+ esEAIndex ID = 252
+ esECIndex ID = 253
+ esESIndex ID = 254
+ esGQIndex ID = 255
+ esGTIndex ID = 256
+ esHNIndex ID = 257
+ esICIndex ID = 258
+ esMXIndex ID = 259
+ esNIIndex ID = 260
+ esPAIndex ID = 261
+ esPEIndex ID = 262
+ esPHIndex ID = 263
+ esPRIndex ID = 264
+ esPYIndex ID = 265
+ esSVIndex ID = 266
+ esUSIndex ID = 267
+ esUYIndex ID = 268
+ esVEIndex ID = 269
+ etIndex ID = 270
+ etEEIndex ID = 271
+ euIndex ID = 272
+ euESIndex ID = 273
+ ewoIndex ID = 274
+ ewoCMIndex ID = 275
+ faIndex ID = 276
+ faAFIndex ID = 277
+ faIRIndex ID = 278
+ ffIndex ID = 279
+ ffCMIndex ID = 280
+ ffGNIndex ID = 281
+ ffMRIndex ID = 282
+ ffSNIndex ID = 283
+ fiIndex ID = 284
+ fiFIIndex ID = 285
+ filIndex ID = 286
+ filPHIndex ID = 287
+ foIndex ID = 288
+ foDKIndex ID = 289
+ foFOIndex ID = 290
+ frIndex ID = 291
+ frBEIndex ID = 292
+ frBFIndex ID = 293
+ frBIIndex ID = 294
+ frBJIndex ID = 295
+ frBLIndex ID = 296
+ frCAIndex ID = 297
+ frCDIndex ID = 298
+ frCFIndex ID = 299
+ frCGIndex ID = 300
+ frCHIndex ID = 301
+ frCIIndex ID = 302
+ frCMIndex ID = 303
+ frDJIndex ID = 304
+ frDZIndex ID = 305
+ frFRIndex ID = 306
+ frGAIndex ID = 307
+ frGFIndex ID = 308
+ frGNIndex ID = 309
+ frGPIndex ID = 310
+ frGQIndex ID = 311
+ frHTIndex ID = 312
+ frKMIndex ID = 313
+ frLUIndex ID = 314
+ frMAIndex ID = 315
+ frMCIndex ID = 316
+ frMFIndex ID = 317
+ frMGIndex ID = 318
+ frMLIndex ID = 319
+ frMQIndex ID = 320
+ frMRIndex ID = 321
+ frMUIndex ID = 322
+ frNCIndex ID = 323
+ frNEIndex ID = 324
+ frPFIndex ID = 325
+ frPMIndex ID = 326
+ frREIndex ID = 327
+ frRWIndex ID = 328
+ frSCIndex ID = 329
+ frSNIndex ID = 330
+ frSYIndex ID = 331
+ frTDIndex ID = 332
+ frTGIndex ID = 333
+ frTNIndex ID = 334
+ frVUIndex ID = 335
+ frWFIndex ID = 336
+ frYTIndex ID = 337
+ furIndex ID = 338
+ furITIndex ID = 339
+ fyIndex ID = 340
+ fyNLIndex ID = 341
+ gaIndex ID = 342
+ gaIEIndex ID = 343
+ gdIndex ID = 344
+ gdGBIndex ID = 345
+ glIndex ID = 346
+ glESIndex ID = 347
+ gswIndex ID = 348
+ gswCHIndex ID = 349
+ gswFRIndex ID = 350
+ gswLIIndex ID = 351
+ guIndex ID = 352
+ guINIndex ID = 353
+ guwIndex ID = 354
+ guzIndex ID = 355
+ guzKEIndex ID = 356
+ gvIndex ID = 357
+ gvIMIndex ID = 358
+ haIndex ID = 359
+ haGHIndex ID = 360
+ haNEIndex ID = 361
+ haNGIndex ID = 362
+ hawIndex ID = 363
+ hawUSIndex ID = 364
+ heIndex ID = 365
+ heILIndex ID = 366
+ hiIndex ID = 367
+ hiINIndex ID = 368
+ hrIndex ID = 369
+ hrBAIndex ID = 370
+ hrHRIndex ID = 371
+ hsbIndex ID = 372
+ hsbDEIndex ID = 373
+ huIndex ID = 374
+ huHUIndex ID = 375
+ hyIndex ID = 376
+ hyAMIndex ID = 377
+ idIndex ID = 378
+ idIDIndex ID = 379
+ igIndex ID = 380
+ igNGIndex ID = 381
+ iiIndex ID = 382
+ iiCNIndex ID = 383
+ inIndex ID = 384
+ ioIndex ID = 385
+ isIndex ID = 386
+ isISIndex ID = 387
+ itIndex ID = 388
+ itCHIndex ID = 389
+ itITIndex ID = 390
+ itSMIndex ID = 391
+ itVAIndex ID = 392
+ iuIndex ID = 393
+ iwIndex ID = 394
+ jaIndex ID = 395
+ jaJPIndex ID = 396
+ jboIndex ID = 397
+ jgoIndex ID = 398
+ jgoCMIndex ID = 399
+ jiIndex ID = 400
+ jmcIndex ID = 401
+ jmcTZIndex ID = 402
+ jvIndex ID = 403
+ jwIndex ID = 404
+ kaIndex ID = 405
+ kaGEIndex ID = 406
+ kabIndex ID = 407
+ kabDZIndex ID = 408
+ kajIndex ID = 409
+ kamIndex ID = 410
+ kamKEIndex ID = 411
+ kcgIndex ID = 412
+ kdeIndex ID = 413
+ kdeTZIndex ID = 414
+ keaIndex ID = 415
+ keaCVIndex ID = 416
+ khqIndex ID = 417
+ khqMLIndex ID = 418
+ kiIndex ID = 419
+ kiKEIndex ID = 420
+ kkIndex ID = 421
+ kkKZIndex ID = 422
+ kkjIndex ID = 423
+ kkjCMIndex ID = 424
+ klIndex ID = 425
+ klGLIndex ID = 426
+ klnIndex ID = 427
+ klnKEIndex ID = 428
+ kmIndex ID = 429
+ kmKHIndex ID = 430
+ knIndex ID = 431
+ knINIndex ID = 432
+ koIndex ID = 433
+ koKPIndex ID = 434
+ koKRIndex ID = 435
+ kokIndex ID = 436
+ kokINIndex ID = 437
+ ksIndex ID = 438
+ ksINIndex ID = 439
+ ksbIndex ID = 440
+ ksbTZIndex ID = 441
+ ksfIndex ID = 442
+ ksfCMIndex ID = 443
+ kshIndex ID = 444
+ kshDEIndex ID = 445
+ kuIndex ID = 446
+ kwIndex ID = 447
+ kwGBIndex ID = 448
+ kyIndex ID = 449
+ kyKGIndex ID = 450
+ lagIndex ID = 451
+ lagTZIndex ID = 452
+ lbIndex ID = 453
+ lbLUIndex ID = 454
+ lgIndex ID = 455
+ lgUGIndex ID = 456
+ lktIndex ID = 457
+ lktUSIndex ID = 458
+ lnIndex ID = 459
+ lnAOIndex ID = 460
+ lnCDIndex ID = 461
+ lnCFIndex ID = 462
+ lnCGIndex ID = 463
+ loIndex ID = 464
+ loLAIndex ID = 465
+ lrcIndex ID = 466
+ lrcIQIndex ID = 467
+ lrcIRIndex ID = 468
+ ltIndex ID = 469
+ ltLTIndex ID = 470
+ luIndex ID = 471
+ luCDIndex ID = 472
+ luoIndex ID = 473
+ luoKEIndex ID = 474
+ luyIndex ID = 475
+ luyKEIndex ID = 476
+ lvIndex ID = 477
+ lvLVIndex ID = 478
+ masIndex ID = 479
+ masKEIndex ID = 480
+ masTZIndex ID = 481
+ merIndex ID = 482
+ merKEIndex ID = 483
+ mfeIndex ID = 484
+ mfeMUIndex ID = 485
+ mgIndex ID = 486
+ mgMGIndex ID = 487
+ mghIndex ID = 488
+ mghMZIndex ID = 489
+ mgoIndex ID = 490
+ mgoCMIndex ID = 491
+ mkIndex ID = 492
+ mkMKIndex ID = 493
+ mlIndex ID = 494
+ mlINIndex ID = 495
+ mnIndex ID = 496
+ mnMNIndex ID = 497
+ moIndex ID = 498
+ mrIndex ID = 499
+ mrINIndex ID = 500
+ msIndex ID = 501
+ msBNIndex ID = 502
+ msMYIndex ID = 503
+ msSGIndex ID = 504
+ mtIndex ID = 505
+ mtMTIndex ID = 506
+ muaIndex ID = 507
+ muaCMIndex ID = 508
+ myIndex ID = 509
+ myMMIndex ID = 510
+ mznIndex ID = 511
+ mznIRIndex ID = 512
+ nahIndex ID = 513
+ naqIndex ID = 514
+ naqNAIndex ID = 515
+ nbIndex ID = 516
+ nbNOIndex ID = 517
+ nbSJIndex ID = 518
+ ndIndex ID = 519
+ ndZWIndex ID = 520
+ ndsIndex ID = 521
+ ndsDEIndex ID = 522
+ ndsNLIndex ID = 523
+ neIndex ID = 524
+ neINIndex ID = 525
+ neNPIndex ID = 526
+ nlIndex ID = 527
+ nlAWIndex ID = 528
+ nlBEIndex ID = 529
+ nlBQIndex ID = 530
+ nlCWIndex ID = 531
+ nlNLIndex ID = 532
+ nlSRIndex ID = 533
+ nlSXIndex ID = 534
+ nmgIndex ID = 535
+ nmgCMIndex ID = 536
+ nnIndex ID = 537
+ nnNOIndex ID = 538
+ nnhIndex ID = 539
+ nnhCMIndex ID = 540
+ noIndex ID = 541
+ nqoIndex ID = 542
+ nrIndex ID = 543
+ nsoIndex ID = 544
+ nusIndex ID = 545
+ nusSSIndex ID = 546
+ nyIndex ID = 547
+ nynIndex ID = 548
+ nynUGIndex ID = 549
+ omIndex ID = 550
+ omETIndex ID = 551
+ omKEIndex ID = 552
+ orIndex ID = 553
+ orINIndex ID = 554
+ osIndex ID = 555
+ osGEIndex ID = 556
+ osRUIndex ID = 557
+ paIndex ID = 558
+ paArabIndex ID = 559
+ paArabPKIndex ID = 560
+ paGuruIndex ID = 561
+ paGuruINIndex ID = 562
+ papIndex ID = 563
+ plIndex ID = 564
+ plPLIndex ID = 565
+ prgIndex ID = 566
+ prg001Index ID = 567
+ psIndex ID = 568
+ psAFIndex ID = 569
+ ptIndex ID = 570
+ ptAOIndex ID = 571
+ ptBRIndex ID = 572
+ ptCHIndex ID = 573
+ ptCVIndex ID = 574
+ ptGQIndex ID = 575
+ ptGWIndex ID = 576
+ ptLUIndex ID = 577
+ ptMOIndex ID = 578
+ ptMZIndex ID = 579
+ ptPTIndex ID = 580
+ ptSTIndex ID = 581
+ ptTLIndex ID = 582
+ quIndex ID = 583
+ quBOIndex ID = 584
+ quECIndex ID = 585
+ quPEIndex ID = 586
+ rmIndex ID = 587
+ rmCHIndex ID = 588
+ rnIndex ID = 589
+ rnBIIndex ID = 590
+ roIndex ID = 591
+ roMDIndex ID = 592
+ roROIndex ID = 593
+ rofIndex ID = 594
+ rofTZIndex ID = 595
+ ruIndex ID = 596
+ ruBYIndex ID = 597
+ ruKGIndex ID = 598
+ ruKZIndex ID = 599
+ ruMDIndex ID = 600
+ ruRUIndex ID = 601
+ ruUAIndex ID = 602
+ rwIndex ID = 603
+ rwRWIndex ID = 604
+ rwkIndex ID = 605
+ rwkTZIndex ID = 606
+ sahIndex ID = 607
+ sahRUIndex ID = 608
+ saqIndex ID = 609
+ saqKEIndex ID = 610
+ sbpIndex ID = 611
+ sbpTZIndex ID = 612
+ sdIndex ID = 613
+ sdPKIndex ID = 614
+ sdhIndex ID = 615
+ seIndex ID = 616
+ seFIIndex ID = 617
+ seNOIndex ID = 618
+ seSEIndex ID = 619
+ sehIndex ID = 620
+ sehMZIndex ID = 621
+ sesIndex ID = 622
+ sesMLIndex ID = 623
+ sgIndex ID = 624
+ sgCFIndex ID = 625
+ shIndex ID = 626
+ shiIndex ID = 627
+ shiLatnIndex ID = 628
+ shiLatnMAIndex ID = 629
+ shiTfngIndex ID = 630
+ shiTfngMAIndex ID = 631
+ siIndex ID = 632
+ siLKIndex ID = 633
+ skIndex ID = 634
+ skSKIndex ID = 635
+ slIndex ID = 636
+ slSIIndex ID = 637
+ smaIndex ID = 638
+ smiIndex ID = 639
+ smjIndex ID = 640
+ smnIndex ID = 641
+ smnFIIndex ID = 642
+ smsIndex ID = 643
+ snIndex ID = 644
+ snZWIndex ID = 645
+ soIndex ID = 646
+ soDJIndex ID = 647
+ soETIndex ID = 648
+ soKEIndex ID = 649
+ soSOIndex ID = 650
+ sqIndex ID = 651
+ sqALIndex ID = 652
+ sqMKIndex ID = 653
+ sqXKIndex ID = 654
+ srIndex ID = 655
+ srCyrlIndex ID = 656
+ srCyrlBAIndex ID = 657
+ srCyrlMEIndex ID = 658
+ srCyrlRSIndex ID = 659
+ srCyrlXKIndex ID = 660
+ srLatnIndex ID = 661
+ srLatnBAIndex ID = 662
+ srLatnMEIndex ID = 663
+ srLatnRSIndex ID = 664
+ srLatnXKIndex ID = 665
+ ssIndex ID = 666
+ ssyIndex ID = 667
+ stIndex ID = 668
+ svIndex ID = 669
+ svAXIndex ID = 670
+ svFIIndex ID = 671
+ svSEIndex ID = 672
+ swIndex ID = 673
+ swCDIndex ID = 674
+ swKEIndex ID = 675
+ swTZIndex ID = 676
+ swUGIndex ID = 677
+ syrIndex ID = 678
+ taIndex ID = 679
+ taINIndex ID = 680
+ taLKIndex ID = 681
+ taMYIndex ID = 682
+ taSGIndex ID = 683
+ teIndex ID = 684
+ teINIndex ID = 685
+ teoIndex ID = 686
+ teoKEIndex ID = 687
+ teoUGIndex ID = 688
+ tgIndex ID = 689
+ tgTJIndex ID = 690
+ thIndex ID = 691
+ thTHIndex ID = 692
+ tiIndex ID = 693
+ tiERIndex ID = 694
+ tiETIndex ID = 695
+ tigIndex ID = 696
+ tkIndex ID = 697
+ tkTMIndex ID = 698
+ tlIndex ID = 699
+ tnIndex ID = 700
+ toIndex ID = 701
+ toTOIndex ID = 702
+ trIndex ID = 703
+ trCYIndex ID = 704
+ trTRIndex ID = 705
+ tsIndex ID = 706
+ ttIndex ID = 707
+ ttRUIndex ID = 708
+ twqIndex ID = 709
+ twqNEIndex ID = 710
+ tzmIndex ID = 711
+ tzmMAIndex ID = 712
+ ugIndex ID = 713
+ ugCNIndex ID = 714
+ ukIndex ID = 715
+ ukUAIndex ID = 716
+ urIndex ID = 717
+ urINIndex ID = 718
+ urPKIndex ID = 719
+ uzIndex ID = 720
+ uzArabIndex ID = 721
+ uzArabAFIndex ID = 722
+ uzCyrlIndex ID = 723
+ uzCyrlUZIndex ID = 724
+ uzLatnIndex ID = 725
+ uzLatnUZIndex ID = 726
+ vaiIndex ID = 727
+ vaiLatnIndex ID = 728
+ vaiLatnLRIndex ID = 729
+ vaiVaiiIndex ID = 730
+ vaiVaiiLRIndex ID = 731
+ veIndex ID = 732
+ viIndex ID = 733
+ viVNIndex ID = 734
+ voIndex ID = 735
+ vo001Index ID = 736
+ vunIndex ID = 737
+ vunTZIndex ID = 738
+ waIndex ID = 739
+ waeIndex ID = 740
+ waeCHIndex ID = 741
+ woIndex ID = 742
+ woSNIndex ID = 743
+ xhIndex ID = 744
+ xogIndex ID = 745
+ xogUGIndex ID = 746
+ yavIndex ID = 747
+ yavCMIndex ID = 748
+ yiIndex ID = 749
+ yi001Index ID = 750
+ yoIndex ID = 751
+ yoBJIndex ID = 752
+ yoNGIndex ID = 753
+ yueIndex ID = 754
+ yueHansIndex ID = 755
+ yueHansCNIndex ID = 756
+ yueHantIndex ID = 757
+ yueHantHKIndex ID = 758
+ zghIndex ID = 759
+ zghMAIndex ID = 760
+ zhIndex ID = 761
+ zhHansIndex ID = 762
+ zhHansCNIndex ID = 763
+ zhHansHKIndex ID = 764
+ zhHansMOIndex ID = 765
+ zhHansSGIndex ID = 766
+ zhHantIndex ID = 767
+ zhHantHKIndex ID = 768
+ zhHantMOIndex ID = 769
+ zhHantTWIndex ID = 770
+ zuIndex ID = 771
+ zuZAIndex ID = 772
+ caESvalenciaIndex ID = 773
+ enUSuvaposixIndex ID = 774
+)
+
+var coreTags = []language.CompactCoreInfo{ // 773 elements
+ // Entry 0 - 1F
+ 0x00000000, 0x01600000, 0x016000d2, 0x01600161,
+ 0x01c00000, 0x01c00052, 0x02100000, 0x02100080,
+ 0x02700000, 0x0270006f, 0x03a00000, 0x03a00001,
+ 0x03a00023, 0x03a00039, 0x03a00062, 0x03a00067,
+ 0x03a0006b, 0x03a0006c, 0x03a0006d, 0x03a00097,
+ 0x03a0009b, 0x03a000a1, 0x03a000a8, 0x03a000ac,
+ 0x03a000b0, 0x03a000b9, 0x03a000ba, 0x03a000c9,
+ 0x03a000e1, 0x03a000ed, 0x03a000f3, 0x03a00108,
+ // Entry 20 - 3F
+ 0x03a0010b, 0x03a00115, 0x03a00117, 0x03a0011c,
+ 0x03a00120, 0x03a00128, 0x03a0015e, 0x04000000,
+ 0x04300000, 0x04300099, 0x04400000, 0x0440012f,
+ 0x04800000, 0x0480006e, 0x05800000, 0x05820000,
+ 0x05820032, 0x0585a000, 0x0585a032, 0x05e00000,
+ 0x05e00052, 0x07100000, 0x07100047, 0x07500000,
+ 0x07500162, 0x07900000, 0x0790012f, 0x07e00000,
+ 0x07e00038, 0x08200000, 0x0a000000, 0x0a0000c3,
+ // Entry 40 - 5F
+ 0x0a500000, 0x0a500035, 0x0a500099, 0x0a900000,
+ 0x0a900053, 0x0a900099, 0x0b200000, 0x0b200078,
+ 0x0b500000, 0x0b500099, 0x0b700000, 0x0b720000,
+ 0x0b720033, 0x0b75a000, 0x0b75a033, 0x0d700000,
+ 0x0d700022, 0x0d70006e, 0x0d700078, 0x0d70009e,
+ 0x0db00000, 0x0db00035, 0x0db00099, 0x0dc00000,
+ 0x0dc00106, 0x0df00000, 0x0df00131, 0x0e500000,
+ 0x0e500135, 0x0e900000, 0x0e90009b, 0x0e90009c,
+ // Entry 60 - 7F
+ 0x0fa00000, 0x0fa0005e, 0x0fe00000, 0x0fe00106,
+ 0x10000000, 0x1000007b, 0x10100000, 0x10100063,
+ 0x10100082, 0x10800000, 0x108000a4, 0x10d00000,
+ 0x10d0002e, 0x10d00036, 0x10d0004e, 0x10d00060,
+ 0x10d0009e, 0x10d000b2, 0x10d000b7, 0x11700000,
+ 0x117000d4, 0x11f00000, 0x11f00060, 0x12400000,
+ 0x12400052, 0x12800000, 0x12b00000, 0x12b00114,
+ 0x12d00000, 0x12d00043, 0x12f00000, 0x12f000a4,
+ // Entry 80 - 9F
+ 0x13000000, 0x13000080, 0x13000122, 0x13600000,
+ 0x1360005d, 0x13600087, 0x13900000, 0x13900001,
+ 0x1390001a, 0x13900025, 0x13900026, 0x1390002d,
+ 0x1390002e, 0x1390002f, 0x13900034, 0x13900036,
+ 0x1390003a, 0x1390003d, 0x13900042, 0x13900046,
+ 0x13900048, 0x13900049, 0x1390004a, 0x1390004e,
+ 0x13900050, 0x13900052, 0x1390005c, 0x1390005d,
+ 0x13900060, 0x13900061, 0x13900063, 0x13900064,
+ // Entry A0 - BF
+ 0x1390006d, 0x13900072, 0x13900073, 0x13900074,
+ 0x13900075, 0x1390007b, 0x1390007c, 0x1390007f,
+ 0x13900080, 0x13900081, 0x13900083, 0x1390008a,
+ 0x1390008c, 0x1390008d, 0x13900096, 0x13900097,
+ 0x13900098, 0x13900099, 0x1390009a, 0x1390009f,
+ 0x139000a0, 0x139000a4, 0x139000a7, 0x139000a9,
+ 0x139000ad, 0x139000b1, 0x139000b4, 0x139000b5,
+ 0x139000bf, 0x139000c0, 0x139000c6, 0x139000c7,
+ // Entry C0 - DF
+ 0x139000ca, 0x139000cb, 0x139000cc, 0x139000ce,
+ 0x139000d0, 0x139000d2, 0x139000d5, 0x139000d6,
+ 0x139000d9, 0x139000dd, 0x139000df, 0x139000e0,
+ 0x139000e6, 0x139000e7, 0x139000e8, 0x139000eb,
+ 0x139000ec, 0x139000f0, 0x13900107, 0x13900109,
+ 0x1390010a, 0x1390010b, 0x1390010c, 0x1390010d,
+ 0x1390010e, 0x1390010f, 0x13900112, 0x13900117,
+ 0x1390011b, 0x1390011d, 0x1390011f, 0x13900125,
+ // Entry E0 - FF
+ 0x13900129, 0x1390012c, 0x1390012d, 0x1390012f,
+ 0x13900131, 0x13900133, 0x13900135, 0x13900139,
+ 0x1390013c, 0x1390013d, 0x1390013f, 0x13900142,
+ 0x13900161, 0x13900162, 0x13900164, 0x13c00000,
+ 0x13c00001, 0x13e00000, 0x13e0001f, 0x13e0002c,
+ 0x13e0003f, 0x13e00041, 0x13e00048, 0x13e00051,
+ 0x13e00054, 0x13e00056, 0x13e00059, 0x13e00065,
+ 0x13e00068, 0x13e00069, 0x13e0006e, 0x13e00086,
+ // Entry 100 - 11F
+ 0x13e00089, 0x13e0008f, 0x13e00094, 0x13e000cf,
+ 0x13e000d8, 0x13e000e2, 0x13e000e4, 0x13e000e7,
+ 0x13e000ec, 0x13e000f1, 0x13e0011a, 0x13e00135,
+ 0x13e00136, 0x13e0013b, 0x14000000, 0x1400006a,
+ 0x14500000, 0x1450006e, 0x14600000, 0x14600052,
+ 0x14800000, 0x14800024, 0x1480009c, 0x14e00000,
+ 0x14e00052, 0x14e00084, 0x14e000c9, 0x14e00114,
+ 0x15100000, 0x15100072, 0x15300000, 0x153000e7,
+ // Entry 120 - 13F
+ 0x15800000, 0x15800063, 0x15800076, 0x15e00000,
+ 0x15e00036, 0x15e00037, 0x15e0003a, 0x15e0003b,
+ 0x15e0003c, 0x15e00049, 0x15e0004b, 0x15e0004c,
+ 0x15e0004d, 0x15e0004e, 0x15e0004f, 0x15e00052,
+ 0x15e00062, 0x15e00067, 0x15e00078, 0x15e0007a,
+ 0x15e0007e, 0x15e00084, 0x15e00085, 0x15e00086,
+ 0x15e00091, 0x15e000a8, 0x15e000b7, 0x15e000ba,
+ 0x15e000bb, 0x15e000be, 0x15e000bf, 0x15e000c3,
+ // Entry 140 - 15F
+ 0x15e000c8, 0x15e000c9, 0x15e000cc, 0x15e000d3,
+ 0x15e000d4, 0x15e000e5, 0x15e000ea, 0x15e00102,
+ 0x15e00107, 0x15e0010a, 0x15e00114, 0x15e0011c,
+ 0x15e00120, 0x15e00122, 0x15e00128, 0x15e0013f,
+ 0x15e00140, 0x15e0015f, 0x16900000, 0x1690009e,
+ 0x16d00000, 0x16d000d9, 0x16e00000, 0x16e00096,
+ 0x17e00000, 0x17e0007b, 0x19000000, 0x1900006e,
+ 0x1a300000, 0x1a30004e, 0x1a300078, 0x1a3000b2,
+ // Entry 160 - 17F
+ 0x1a400000, 0x1a400099, 0x1a900000, 0x1ab00000,
+ 0x1ab000a4, 0x1ac00000, 0x1ac00098, 0x1b400000,
+ 0x1b400080, 0x1b4000d4, 0x1b4000d6, 0x1b800000,
+ 0x1b800135, 0x1bc00000, 0x1bc00097, 0x1be00000,
+ 0x1be00099, 0x1d100000, 0x1d100033, 0x1d100090,
+ 0x1d200000, 0x1d200060, 0x1d500000, 0x1d500092,
+ 0x1d700000, 0x1d700028, 0x1e100000, 0x1e100095,
+ 0x1e700000, 0x1e7000d6, 0x1ea00000, 0x1ea00053,
+ // Entry 180 - 19F
+ 0x1f300000, 0x1f500000, 0x1f800000, 0x1f80009d,
+ 0x1f900000, 0x1f90004e, 0x1f90009e, 0x1f900113,
+ 0x1f900138, 0x1fa00000, 0x1fb00000, 0x20000000,
+ 0x200000a2, 0x20300000, 0x20700000, 0x20700052,
+ 0x20800000, 0x20a00000, 0x20a0012f, 0x20e00000,
+ 0x20f00000, 0x21000000, 0x2100007d, 0x21200000,
+ 0x21200067, 0x21600000, 0x21700000, 0x217000a4,
+ 0x21f00000, 0x22300000, 0x2230012f, 0x22700000,
+ // Entry 1A0 - 1BF
+ 0x2270005a, 0x23400000, 0x234000c3, 0x23900000,
+ 0x239000a4, 0x24200000, 0x242000ae, 0x24400000,
+ 0x24400052, 0x24500000, 0x24500082, 0x24600000,
+ 0x246000a4, 0x24a00000, 0x24a000a6, 0x25100000,
+ 0x25100099, 0x25400000, 0x254000aa, 0x254000ab,
+ 0x25600000, 0x25600099, 0x26a00000, 0x26a00099,
+ 0x26b00000, 0x26b0012f, 0x26d00000, 0x26d00052,
+ 0x26e00000, 0x26e00060, 0x27400000, 0x28100000,
+ // Entry 1C0 - 1DF
+ 0x2810007b, 0x28a00000, 0x28a000a5, 0x29100000,
+ 0x2910012f, 0x29500000, 0x295000b7, 0x2a300000,
+ 0x2a300131, 0x2af00000, 0x2af00135, 0x2b500000,
+ 0x2b50002a, 0x2b50004b, 0x2b50004c, 0x2b50004d,
+ 0x2b800000, 0x2b8000af, 0x2bf00000, 0x2bf0009b,
+ 0x2bf0009c, 0x2c000000, 0x2c0000b6, 0x2c200000,
+ 0x2c20004b, 0x2c400000, 0x2c4000a4, 0x2c500000,
+ 0x2c5000a4, 0x2c700000, 0x2c7000b8, 0x2d100000,
+ // Entry 1E0 - 1FF
+ 0x2d1000a4, 0x2d10012f, 0x2e900000, 0x2e9000a4,
+ 0x2ed00000, 0x2ed000cc, 0x2f100000, 0x2f1000bf,
+ 0x2f200000, 0x2f2000d1, 0x2f400000, 0x2f400052,
+ 0x2ff00000, 0x2ff000c2, 0x30400000, 0x30400099,
+ 0x30b00000, 0x30b000c5, 0x31000000, 0x31b00000,
+ 0x31b00099, 0x31f00000, 0x31f0003e, 0x31f000d0,
+ 0x31f0010d, 0x32000000, 0x320000cb, 0x32500000,
+ 0x32500052, 0x33100000, 0x331000c4, 0x33a00000,
+ // Entry 200 - 21F
+ 0x33a0009c, 0x34100000, 0x34500000, 0x345000d2,
+ 0x34700000, 0x347000da, 0x34700110, 0x34e00000,
+ 0x34e00164, 0x35000000, 0x35000060, 0x350000d9,
+ 0x35100000, 0x35100099, 0x351000db, 0x36700000,
+ 0x36700030, 0x36700036, 0x36700040, 0x3670005b,
+ 0x367000d9, 0x36700116, 0x3670011b, 0x36800000,
+ 0x36800052, 0x36a00000, 0x36a000da, 0x36c00000,
+ 0x36c00052, 0x36f00000, 0x37500000, 0x37600000,
+ // Entry 220 - 23F
+ 0x37a00000, 0x38000000, 0x38000117, 0x38700000,
+ 0x38900000, 0x38900131, 0x39000000, 0x3900006f,
+ 0x390000a4, 0x39500000, 0x39500099, 0x39800000,
+ 0x3980007d, 0x39800106, 0x39d00000, 0x39d05000,
+ 0x39d050e8, 0x39d36000, 0x39d36099, 0x3a100000,
+ 0x3b300000, 0x3b3000e9, 0x3bd00000, 0x3bd00001,
+ 0x3be00000, 0x3be00024, 0x3c000000, 0x3c00002a,
+ 0x3c000041, 0x3c00004e, 0x3c00005a, 0x3c000086,
+ // Entry 240 - 25F
+ 0x3c00008b, 0x3c0000b7, 0x3c0000c6, 0x3c0000d1,
+ 0x3c0000ee, 0x3c000118, 0x3c000126, 0x3c400000,
+ 0x3c40003f, 0x3c400069, 0x3c4000e4, 0x3d400000,
+ 0x3d40004e, 0x3d900000, 0x3d90003a, 0x3dc00000,
+ 0x3dc000bc, 0x3dc00104, 0x3de00000, 0x3de0012f,
+ 0x3e200000, 0x3e200047, 0x3e2000a5, 0x3e2000ae,
+ 0x3e2000bc, 0x3e200106, 0x3e200130, 0x3e500000,
+ 0x3e500107, 0x3e600000, 0x3e60012f, 0x3eb00000,
+ // Entry 260 - 27F
+ 0x3eb00106, 0x3ec00000, 0x3ec000a4, 0x3f300000,
+ 0x3f30012f, 0x3fa00000, 0x3fa000e8, 0x3fc00000,
+ 0x3fd00000, 0x3fd00072, 0x3fd000da, 0x3fd0010c,
+ 0x3ff00000, 0x3ff000d1, 0x40100000, 0x401000c3,
+ 0x40200000, 0x4020004c, 0x40700000, 0x40800000,
+ 0x4085a000, 0x4085a0ba, 0x408e3000, 0x408e30ba,
+ 0x40c00000, 0x40c000b3, 0x41200000, 0x41200111,
+ 0x41600000, 0x4160010f, 0x41c00000, 0x41d00000,
+ // Entry 280 - 29F
+ 0x41e00000, 0x41f00000, 0x41f00072, 0x42200000,
+ 0x42300000, 0x42300164, 0x42900000, 0x42900062,
+ 0x4290006f, 0x429000a4, 0x42900115, 0x43100000,
+ 0x43100027, 0x431000c2, 0x4310014d, 0x43200000,
+ 0x43220000, 0x43220033, 0x432200bd, 0x43220105,
+ 0x4322014d, 0x4325a000, 0x4325a033, 0x4325a0bd,
+ 0x4325a105, 0x4325a14d, 0x43700000, 0x43a00000,
+ 0x43b00000, 0x44400000, 0x44400031, 0x44400072,
+ // Entry 2A0 - 2BF
+ 0x4440010c, 0x44500000, 0x4450004b, 0x445000a4,
+ 0x4450012f, 0x44500131, 0x44e00000, 0x45000000,
+ 0x45000099, 0x450000b3, 0x450000d0, 0x4500010d,
+ 0x46100000, 0x46100099, 0x46400000, 0x464000a4,
+ 0x46400131, 0x46700000, 0x46700124, 0x46b00000,
+ 0x46b00123, 0x46f00000, 0x46f0006d, 0x46f0006f,
+ 0x47100000, 0x47600000, 0x47600127, 0x47a00000,
+ 0x48000000, 0x48200000, 0x48200129, 0x48a00000,
+ // Entry 2C0 - 2DF
+ 0x48a0005d, 0x48a0012b, 0x48e00000, 0x49400000,
+ 0x49400106, 0x4a400000, 0x4a4000d4, 0x4a900000,
+ 0x4a9000ba, 0x4ac00000, 0x4ac00053, 0x4ae00000,
+ 0x4ae00130, 0x4b400000, 0x4b400099, 0x4b4000e8,
+ 0x4bc00000, 0x4bc05000, 0x4bc05024, 0x4bc20000,
+ 0x4bc20137, 0x4bc5a000, 0x4bc5a137, 0x4be00000,
+ 0x4be5a000, 0x4be5a0b4, 0x4beeb000, 0x4beeb0b4,
+ 0x4c000000, 0x4c300000, 0x4c30013e, 0x4c900000,
+ // Entry 2E0 - 2FF
+ 0x4c900001, 0x4cc00000, 0x4cc0012f, 0x4ce00000,
+ 0x4cf00000, 0x4cf0004e, 0x4e500000, 0x4e500114,
+ 0x4f200000, 0x4fb00000, 0x4fb00131, 0x50900000,
+ 0x50900052, 0x51200000, 0x51200001, 0x51800000,
+ 0x5180003b, 0x518000d6, 0x51f00000, 0x51f3b000,
+ 0x51f3b053, 0x51f3c000, 0x51f3c08d, 0x52800000,
+ 0x528000ba, 0x52900000, 0x5293b000, 0x5293b053,
+ 0x5293b08d, 0x5293b0c6, 0x5293b10d, 0x5293c000,
+ // Entry 300 - 31F
+ 0x5293c08d, 0x5293c0c6, 0x5293c12e, 0x52f00000,
+ 0x52f00161,
+} // Size: 3116 bytes
+
+const specialTagsStr string = "ca-ES-valencia en-US-u-va-posix"
+
+// Total table size 3147 bytes (3KiB); checksum: BE816D44
diff --git a/vendor/golang.org/x/text/internal/language/compact/tags.go b/vendor/golang.org/x/text/internal/language/compact/tags.go
new file mode 100644
index 000000000..ca135d295
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/compact/tags.go
@@ -0,0 +1,91 @@
+// 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 compact
+
+var (
+ und = Tag{}
+
+ Und Tag = Tag{}
+
+ Afrikaans Tag = Tag{language: afIndex, locale: afIndex}
+ Amharic Tag = Tag{language: amIndex, locale: amIndex}
+ Arabic Tag = Tag{language: arIndex, locale: arIndex}
+ ModernStandardArabic Tag = Tag{language: ar001Index, locale: ar001Index}
+ Azerbaijani Tag = Tag{language: azIndex, locale: azIndex}
+ Bulgarian Tag = Tag{language: bgIndex, locale: bgIndex}
+ Bengali Tag = Tag{language: bnIndex, locale: bnIndex}
+ Catalan Tag = Tag{language: caIndex, locale: caIndex}
+ Czech Tag = Tag{language: csIndex, locale: csIndex}
+ Danish Tag = Tag{language: daIndex, locale: daIndex}
+ German Tag = Tag{language: deIndex, locale: deIndex}
+ Greek Tag = Tag{language: elIndex, locale: elIndex}
+ English Tag = Tag{language: enIndex, locale: enIndex}
+ AmericanEnglish Tag = Tag{language: enUSIndex, locale: enUSIndex}
+ BritishEnglish Tag = Tag{language: enGBIndex, locale: enGBIndex}
+ Spanish Tag = Tag{language: esIndex, locale: esIndex}
+ EuropeanSpanish Tag = Tag{language: esESIndex, locale: esESIndex}
+ LatinAmericanSpanish Tag = Tag{language: es419Index, locale: es419Index}
+ Estonian Tag = Tag{language: etIndex, locale: etIndex}
+ Persian Tag = Tag{language: faIndex, locale: faIndex}
+ Finnish Tag = Tag{language: fiIndex, locale: fiIndex}
+ Filipino Tag = Tag{language: filIndex, locale: filIndex}
+ French Tag = Tag{language: frIndex, locale: frIndex}
+ CanadianFrench Tag = Tag{language: frCAIndex, locale: frCAIndex}
+ Gujarati Tag = Tag{language: guIndex, locale: guIndex}
+ Hebrew Tag = Tag{language: heIndex, locale: heIndex}
+ Hindi Tag = Tag{language: hiIndex, locale: hiIndex}
+ Croatian Tag = Tag{language: hrIndex, locale: hrIndex}
+ Hungarian Tag = Tag{language: huIndex, locale: huIndex}
+ Armenian Tag = Tag{language: hyIndex, locale: hyIndex}
+ Indonesian Tag = Tag{language: idIndex, locale: idIndex}
+ Icelandic Tag = Tag{language: isIndex, locale: isIndex}
+ Italian Tag = Tag{language: itIndex, locale: itIndex}
+ Japanese Tag = Tag{language: jaIndex, locale: jaIndex}
+ Georgian Tag = Tag{language: kaIndex, locale: kaIndex}
+ Kazakh Tag = Tag{language: kkIndex, locale: kkIndex}
+ Khmer Tag = Tag{language: kmIndex, locale: kmIndex}
+ Kannada Tag = Tag{language: knIndex, locale: knIndex}
+ Korean Tag = Tag{language: koIndex, locale: koIndex}
+ Kirghiz Tag = Tag{language: kyIndex, locale: kyIndex}
+ Lao Tag = Tag{language: loIndex, locale: loIndex}
+ Lithuanian Tag = Tag{language: ltIndex, locale: ltIndex}
+ Latvian Tag = Tag{language: lvIndex, locale: lvIndex}
+ Macedonian Tag = Tag{language: mkIndex, locale: mkIndex}
+ Malayalam Tag = Tag{language: mlIndex, locale: mlIndex}
+ Mongolian Tag = Tag{language: mnIndex, locale: mnIndex}
+ Marathi Tag = Tag{language: mrIndex, locale: mrIndex}
+ Malay Tag = Tag{language: msIndex, locale: msIndex}
+ Burmese Tag = Tag{language: myIndex, locale: myIndex}
+ Nepali Tag = Tag{language: neIndex, locale: neIndex}
+ Dutch Tag = Tag{language: nlIndex, locale: nlIndex}
+ Norwegian Tag = Tag{language: noIndex, locale: noIndex}
+ Punjabi Tag = Tag{language: paIndex, locale: paIndex}
+ Polish Tag = Tag{language: plIndex, locale: plIndex}
+ Portuguese Tag = Tag{language: ptIndex, locale: ptIndex}
+ BrazilianPortuguese Tag = Tag{language: ptBRIndex, locale: ptBRIndex}
+ EuropeanPortuguese Tag = Tag{language: ptPTIndex, locale: ptPTIndex}
+ Romanian Tag = Tag{language: roIndex, locale: roIndex}
+ Russian Tag = Tag{language: ruIndex, locale: ruIndex}
+ Sinhala Tag = Tag{language: siIndex, locale: siIndex}
+ Slovak Tag = Tag{language: skIndex, locale: skIndex}
+ Slovenian Tag = Tag{language: slIndex, locale: slIndex}
+ Albanian Tag = Tag{language: sqIndex, locale: sqIndex}
+ Serbian Tag = Tag{language: srIndex, locale: srIndex}
+ SerbianLatin Tag = Tag{language: srLatnIndex, locale: srLatnIndex}
+ Swedish Tag = Tag{language: svIndex, locale: svIndex}
+ Swahili Tag = Tag{language: swIndex, locale: swIndex}
+ Tamil Tag = Tag{language: taIndex, locale: taIndex}
+ Telugu Tag = Tag{language: teIndex, locale: teIndex}
+ Thai Tag = Tag{language: thIndex, locale: thIndex}
+ Turkish Tag = Tag{language: trIndex, locale: trIndex}
+ Ukrainian Tag = Tag{language: ukIndex, locale: ukIndex}
+ Urdu Tag = Tag{language: urIndex, locale: urIndex}
+ Uzbek Tag = Tag{language: uzIndex, locale: uzIndex}
+ Vietnamese Tag = Tag{language: viIndex, locale: viIndex}
+ Chinese Tag = Tag{language: zhIndex, locale: zhIndex}
+ SimplifiedChinese Tag = Tag{language: zhHansIndex, locale: zhHansIndex}
+ TraditionalChinese Tag = Tag{language: zhHantIndex, locale: zhHantIndex}
+ Zulu Tag = Tag{language: zuIndex, locale: zuIndex}
+)
diff --git a/vendor/golang.org/x/text/internal/language/compose.go b/vendor/golang.org/x/text/internal/language/compose.go
new file mode 100644
index 000000000..4ae78e0fa
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/compose.go
@@ -0,0 +1,167 @@
+// Copyright 2018 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 language
+
+import (
+ "sort"
+ "strings"
+)
+
+// A Builder allows constructing a Tag from individual components.
+// Its main user is Compose in the top-level language package.
+type Builder struct {
+ Tag Tag
+
+ private string // the x extension
+ variants []string
+ extensions []string
+}
+
+// Make returns a new Tag from the current settings.
+func (b *Builder) Make() Tag {
+ t := b.Tag
+
+ if len(b.extensions) > 0 || len(b.variants) > 0 {
+ sort.Sort(sortVariants(b.variants))
+ sort.Strings(b.extensions)
+
+ if b.private != "" {
+ b.extensions = append(b.extensions, b.private)
+ }
+ n := maxCoreSize + tokenLen(b.variants...) + tokenLen(b.extensions...)
+ buf := make([]byte, n)
+ p := t.genCoreBytes(buf)
+ t.pVariant = byte(p)
+ p += appendTokens(buf[p:], b.variants...)
+ t.pExt = uint16(p)
+ p += appendTokens(buf[p:], b.extensions...)
+ t.str = string(buf[:p])
+ // We may not always need to remake the string, but when or when not
+ // to do so is rather tricky.
+ scan := makeScanner(buf[:p])
+ t, _ = parse(&scan, "")
+ return t
+
+ } else if b.private != "" {
+ t.str = b.private
+ t.RemakeString()
+ }
+ return t
+}
+
+// SetTag copies all the settings from a given Tag. Any previously set values
+// are discarded.
+func (b *Builder) SetTag(t Tag) {
+ b.Tag.LangID = t.LangID
+ b.Tag.RegionID = t.RegionID
+ b.Tag.ScriptID = t.ScriptID
+ // TODO: optimize
+ b.variants = b.variants[:0]
+ if variants := t.Variants(); variants != "" {
+ for _, vr := range strings.Split(variants[1:], "-") {
+ b.variants = append(b.variants, vr)
+ }
+ }
+ b.extensions, b.private = b.extensions[:0], ""
+ for _, e := range t.Extensions() {
+ b.AddExt(e)
+ }
+}
+
+// AddExt adds extension e to the tag. e must be a valid extension as returned
+// by Tag.Extension. If the extension already exists, it will be discarded,
+// except for a -u extension, where non-existing key-type pairs will added.
+func (b *Builder) AddExt(e string) {
+ if e[0] == 'x' {
+ if b.private == "" {
+ b.private = e
+ }
+ return
+ }
+ for i, s := range b.extensions {
+ if s[0] == e[0] {
+ if e[0] == 'u' {
+ b.extensions[i] += e[1:]
+ }
+ return
+ }
+ }
+ b.extensions = append(b.extensions, e)
+}
+
+// SetExt sets the extension e to the tag. e must be a valid extension as
+// returned by Tag.Extension. If the extension already exists, it will be
+// overwritten, except for a -u extension, where the individual key-type pairs
+// will be set.
+func (b *Builder) SetExt(e string) {
+ if e[0] == 'x' {
+ b.private = e
+ return
+ }
+ for i, s := range b.extensions {
+ if s[0] == e[0] {
+ if e[0] == 'u' {
+ b.extensions[i] = e + s[1:]
+ } else {
+ b.extensions[i] = e
+ }
+ return
+ }
+ }
+ b.extensions = append(b.extensions, e)
+}
+
+// AddVariant adds any number of variants.
+func (b *Builder) AddVariant(v ...string) {
+ for _, v := range v {
+ if v != "" {
+ b.variants = append(b.variants, v)
+ }
+ }
+}
+
+// ClearVariants removes any variants previously added, including those
+// copied from a Tag in SetTag.
+func (b *Builder) ClearVariants() {
+ b.variants = b.variants[:0]
+}
+
+// ClearExtensions removes any extensions previously added, including those
+// copied from a Tag in SetTag.
+func (b *Builder) ClearExtensions() {
+ b.private = ""
+ b.extensions = b.extensions[:0]
+}
+
+func tokenLen(token ...string) (n int) {
+ for _, t := range token {
+ n += len(t) + 1
+ }
+ return
+}
+
+func appendTokens(b []byte, token ...string) int {
+ p := 0
+ for _, t := range token {
+ b[p] = '-'
+ copy(b[p+1:], t)
+ p += 1 + len(t)
+ }
+ return p
+}
+
+type sortVariants []string
+
+func (s sortVariants) Len() int {
+ return len(s)
+}
+
+func (s sortVariants) Swap(i, j int) {
+ s[j], s[i] = s[i], s[j]
+}
+
+func (s sortVariants) Less(i, j int) bool {
+ return variantIndex[s[i]] < variantIndex[s[j]]
+}
diff --git a/vendor/golang.org/x/text/internal/language/coverage.go b/vendor/golang.org/x/text/internal/language/coverage.go
new file mode 100644
index 000000000..9b20b88fe
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/coverage.go
@@ -0,0 +1,28 @@
+// 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 language
+
+// BaseLanguages returns the list of all supported base languages. It generates
+// the list by traversing the internal structures.
+func BaseLanguages() []Language {
+ base := make([]Language, 0, NumLanguages)
+ for i := 0; i < langNoIndexOffset; i++ {
+ // We included "und" already for the value 0.
+ if i != nonCanonicalUnd {
+ base = append(base, Language(i))
+ }
+ }
+ i := langNoIndexOffset
+ for _, v := range langNoIndex {
+ for k := 0; k < 8; k++ {
+ if v&1 == 1 {
+ base = append(base, Language(i))
+ }
+ v >>= 1
+ i++
+ }
+ }
+ return base
+}
diff --git a/vendor/golang.org/x/text/internal/language/language.go b/vendor/golang.org/x/text/internal/language/language.go
new file mode 100644
index 000000000..6105bc7fa
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/language.go
@@ -0,0 +1,627 @@
+// 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 gen.go gen_common.go -output tables.go
+
+package language // import "golang.org/x/text/internal/language"
+
+// TODO: Remove above NOTE after:
+// - verifying that tables are dropped correctly (most notably matcher tables).
+
+import (
+ "errors"
+ "fmt"
+ "strings"
+)
+
+const (
+ // maxCoreSize is the maximum size of a BCP 47 tag without variants and
+ // extensions. Equals max lang (3) + script (4) + max reg (3) + 2 dashes.
+ maxCoreSize = 12
+
+ // max99thPercentileSize is a somewhat arbitrary buffer size that presumably
+ // is large enough to hold at least 99% of the BCP 47 tags.
+ max99thPercentileSize = 32
+
+ // maxSimpleUExtensionSize is the maximum size of a -u extension with one
+ // key-type pair. Equals len("-u-") + key (2) + dash + max value (8).
+ maxSimpleUExtensionSize = 14
+)
+
+// Tag represents a BCP 47 language tag. It is used to specify an instance of a
+// specific language or locale. All language tag values are guaranteed to be
+// well-formed. The zero value of Tag is Und.
+type Tag struct {
+ // TODO: the following fields have the form TagTypeID. This name is chosen
+ // to allow refactoring the public package without conflicting with its
+ // Base, Script, and Region methods. Once the transition is fully completed
+ // the ID can be stripped from the name.
+
+ LangID Language
+ RegionID Region
+ // TODO: we will soon run out of positions for ScriptID. Idea: instead of
+ // storing lang, region, and ScriptID codes, store only the compact index and
+ // have a lookup table from this code to its expansion. This greatly speeds
+ // up table lookup, speed up common variant cases.
+ // This will also immediately free up 3 extra bytes. Also, the pVariant
+ // field can now be moved to the lookup table, as the compact index uniquely
+ // determines the offset of a possible variant.
+ ScriptID Script
+ pVariant byte // offset in str, includes preceding '-'
+ pExt uint16 // offset of first extension, includes preceding '-'
+
+ // str is the string representation of the Tag. It will only be used if the
+ // tag has variants or extensions.
+ str string
+}
+
+// Make is a convenience wrapper for Parse that omits the error.
+// In case of an error, a sensible default is returned.
+func Make(s string) Tag {
+ t, _ := Parse(s)
+ return t
+}
+
+// Raw returns the raw base language, script and region, without making an
+// attempt to infer their values.
+// TODO: consider removing
+func (t Tag) Raw() (b Language, s Script, r Region) {
+ return t.LangID, t.ScriptID, t.RegionID
+}
+
+// equalTags compares language, script and region subtags only.
+func (t Tag) equalTags(a Tag) bool {
+ return t.LangID == a.LangID && t.ScriptID == a.ScriptID && t.RegionID == a.RegionID
+}
+
+// IsRoot returns true if t is equal to language "und".
+func (t Tag) IsRoot() bool {
+ if int(t.pVariant) < len(t.str) {
+ return false
+ }
+ return t.equalTags(Und)
+}
+
+// IsPrivateUse reports whether the Tag consists solely of an IsPrivateUse use
+// tag.
+func (t Tag) IsPrivateUse() bool {
+ return t.str != "" && t.pVariant == 0
+}
+
+// RemakeString is used to update t.str in case lang, script or region changed.
+// It is assumed that pExt and pVariant still point to the start of the
+// respective parts.
+func (t *Tag) RemakeString() {
+ if t.str == "" {
+ return
+ }
+ extra := t.str[t.pVariant:]
+ if t.pVariant > 0 {
+ extra = extra[1:]
+ }
+ if t.equalTags(Und) && strings.HasPrefix(extra, "x-") {
+ t.str = extra
+ t.pVariant = 0
+ t.pExt = 0
+ return
+ }
+ var buf [max99thPercentileSize]byte // avoid extra memory allocation in most cases.
+ b := buf[:t.genCoreBytes(buf[:])]
+ if extra != "" {
+ diff := len(b) - int(t.pVariant)
+ b = append(b, '-')
+ b = append(b, extra...)
+ t.pVariant = uint8(int(t.pVariant) + diff)
+ t.pExt = uint16(int(t.pExt) + diff)
+ } else {
+ t.pVariant = uint8(len(b))
+ t.pExt = uint16(len(b))
+ }
+ t.str = string(b)
+}
+
+// genCoreBytes writes a string for the base languages, script and region tags
+// to the given buffer and returns the number of bytes written. It will never
+// write more than maxCoreSize bytes.
+func (t *Tag) genCoreBytes(buf []byte) int {
+ n := t.LangID.StringToBuf(buf[:])
+ if t.ScriptID != 0 {
+ n += copy(buf[n:], "-")
+ n += copy(buf[n:], t.ScriptID.String())
+ }
+ if t.RegionID != 0 {
+ n += copy(buf[n:], "-")
+ n += copy(buf[n:], t.RegionID.String())
+ }
+ return n
+}
+
+// String returns the canonical string representation of the language tag.
+func (t Tag) String() string {
+ if t.str != "" {
+ return t.str
+ }
+ if t.ScriptID == 0 && t.RegionID == 0 {
+ return t.LangID.String()
+ }
+ buf := [maxCoreSize]byte{}
+ return string(buf[:t.genCoreBytes(buf[:])])
+}
+
+// MarshalText implements encoding.TextMarshaler.
+func (t Tag) MarshalText() (text []byte, err error) {
+ if t.str != "" {
+ text = append(text, t.str...)
+ } else if t.ScriptID == 0 && t.RegionID == 0 {
+ text = append(text, t.LangID.String()...)
+ } else {
+ buf := [maxCoreSize]byte{}
+ text = buf[:t.genCoreBytes(buf[:])]
+ }
+ return text, nil
+}
+
+// UnmarshalText implements encoding.TextUnmarshaler.
+func (t *Tag) UnmarshalText(text []byte) error {
+ tag, err := Parse(string(text))
+ *t = tag
+ return err
+}
+
+// Variants returns the part of the tag holding all variants or the empty string
+// if there are no variants defined.
+func (t Tag) Variants() string {
+ if t.pVariant == 0 {
+ return ""
+ }
+ return t.str[t.pVariant:t.pExt]
+}
+
+// VariantOrPrivateUseTags returns variants or private use tags.
+func (t Tag) VariantOrPrivateUseTags() string {
+ if t.pExt > 0 {
+ return t.str[t.pVariant:t.pExt]
+ }
+ return t.str[t.pVariant:]
+}
+
+// HasString reports whether this tag defines more than just the raw
+// components.
+func (t Tag) HasString() bool {
+ return t.str != ""
+}
+
+// Parent returns the CLDR parent of t. In CLDR, missing fields in data for a
+// specific language are substituted with fields from the parent language.
+// The parent for a language may change for newer versions of CLDR.
+func (t Tag) Parent() Tag {
+ if t.str != "" {
+ // Strip the variants and extensions.
+ b, s, r := t.Raw()
+ t = Tag{LangID: b, ScriptID: s, RegionID: r}
+ if t.RegionID == 0 && t.ScriptID != 0 && t.LangID != 0 {
+ base, _ := addTags(Tag{LangID: t.LangID})
+ if base.ScriptID == t.ScriptID {
+ return Tag{LangID: t.LangID}
+ }
+ }
+ return t
+ }
+ if t.LangID != 0 {
+ if t.RegionID != 0 {
+ maxScript := t.ScriptID
+ if maxScript == 0 {
+ max, _ := addTags(t)
+ maxScript = max.ScriptID
+ }
+
+ for i := range parents {
+ if Language(parents[i].lang) == t.LangID && Script(parents[i].maxScript) == maxScript {
+ for _, r := range parents[i].fromRegion {
+ if Region(r) == t.RegionID {
+ return Tag{
+ LangID: t.LangID,
+ ScriptID: Script(parents[i].script),
+ RegionID: Region(parents[i].toRegion),
+ }
+ }
+ }
+ }
+ }
+
+ // Strip the script if it is the default one.
+ base, _ := addTags(Tag{LangID: t.LangID})
+ if base.ScriptID != maxScript {
+ return Tag{LangID: t.LangID, ScriptID: maxScript}
+ }
+ return Tag{LangID: t.LangID}
+ } else if t.ScriptID != 0 {
+ // The parent for an base-script pair with a non-default script is
+ // "und" instead of the base language.
+ base, _ := addTags(Tag{LangID: t.LangID})
+ if base.ScriptID != t.ScriptID {
+ return Und
+ }
+ return Tag{LangID: t.LangID}
+ }
+ }
+ return Und
+}
+
+// ParseExtension parses s as an extension and returns it on success.
+func ParseExtension(s string) (ext string, err error) {
+ defer func() {
+ if recover() != nil {
+ ext = ""
+ err = ErrSyntax
+ }
+ }()
+
+ scan := makeScannerString(s)
+ var end int
+ if n := len(scan.token); n != 1 {
+ return "", ErrSyntax
+ }
+ scan.toLower(0, len(scan.b))
+ end = parseExtension(&scan)
+ if end != len(s) {
+ return "", ErrSyntax
+ }
+ return string(scan.b), nil
+}
+
+// HasVariants reports whether t has variants.
+func (t Tag) HasVariants() bool {
+ return uint16(t.pVariant) < t.pExt
+}
+
+// HasExtensions reports whether t has extensions.
+func (t Tag) HasExtensions() bool {
+ return int(t.pExt) < len(t.str)
+}
+
+// Extension returns the extension of type x for tag t. It will return
+// false for ok if t does not have the requested extension. The returned
+// extension will be invalid in this case.
+func (t Tag) Extension(x byte) (ext string, ok bool) {
+ for i := int(t.pExt); i < len(t.str)-1; {
+ var ext string
+ i, ext = getExtension(t.str, i)
+ if ext[0] == x {
+ return ext, true
+ }
+ }
+ return "", false
+}
+
+// Extensions returns all extensions of t.
+func (t Tag) Extensions() []string {
+ e := []string{}
+ for i := int(t.pExt); i < len(t.str)-1; {
+ var ext string
+ i, ext = getExtension(t.str, i)
+ e = append(e, ext)
+ }
+ return e
+}
+
+// TypeForKey returns the type associated with the given key, where key and type
+// are of the allowed values defined for the Unicode locale extension ('u') in
+// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
+// TypeForKey will traverse the inheritance chain to get the correct value.
+//
+// If there are multiple types associated with a key, only the first will be
+// returned. If there is no type associated with a key, it returns the empty
+// string.
+func (t Tag) TypeForKey(key string) string {
+ if _, start, end, _ := t.findTypeForKey(key); end != start {
+ s := t.str[start:end]
+ if p := strings.IndexByte(s, '-'); p >= 0 {
+ s = s[:p]
+ }
+ return s
+ }
+ return ""
+}
+
+var (
+ errPrivateUse = errors.New("cannot set a key on a private use tag")
+ errInvalidArguments = errors.New("invalid key or type")
+)
+
+// SetTypeForKey returns a new Tag with the key set to type, where key and type
+// are of the allowed values defined for the Unicode locale extension ('u') in
+// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
+// An empty value removes an existing pair with the same key.
+func (t Tag) SetTypeForKey(key, value string) (Tag, error) {
+ if t.IsPrivateUse() {
+ return t, errPrivateUse
+ }
+ if len(key) != 2 {
+ return t, errInvalidArguments
+ }
+
+ // Remove the setting if value is "".
+ if value == "" {
+ start, sep, end, _ := t.findTypeForKey(key)
+ if start != sep {
+ // Remove a possible empty extension.
+ switch {
+ case t.str[start-2] != '-': // has previous elements.
+ case end == len(t.str), // end of string
+ end+2 < len(t.str) && t.str[end+2] == '-': // end of extension
+ start -= 2
+ }
+ if start == int(t.pVariant) && end == len(t.str) {
+ t.str = ""
+ t.pVariant, t.pExt = 0, 0
+ } else {
+ t.str = fmt.Sprintf("%s%s", t.str[:start], t.str[end:])
+ }
+ }
+ return t, nil
+ }
+
+ if len(value) < 3 || len(value) > 8 {
+ return t, errInvalidArguments
+ }
+
+ var (
+ buf [maxCoreSize + maxSimpleUExtensionSize]byte
+ uStart int // start of the -u extension.
+ )
+
+ // Generate the tag string if needed.
+ if t.str == "" {
+ uStart = t.genCoreBytes(buf[:])
+ buf[uStart] = '-'
+ uStart++
+ }
+
+ // Create new key-type pair and parse it to verify.
+ b := buf[uStart:]
+ copy(b, "u-")
+ copy(b[2:], key)
+ b[4] = '-'
+ b = b[:5+copy(b[5:], value)]
+ scan := makeScanner(b)
+ if parseExtensions(&scan); scan.err != nil {
+ return t, scan.err
+ }
+
+ // Assemble the replacement string.
+ if t.str == "" {
+ t.pVariant, t.pExt = byte(uStart-1), uint16(uStart-1)
+ t.str = string(buf[:uStart+len(b)])
+ } else {
+ s := t.str
+ start, sep, end, hasExt := t.findTypeForKey(key)
+ if start == sep {
+ if hasExt {
+ b = b[2:]
+ }
+ t.str = fmt.Sprintf("%s-%s%s", s[:sep], b, s[end:])
+ } else {
+ t.str = fmt.Sprintf("%s-%s%s", s[:start+3], value, s[end:])
+ }
+ }
+ return t, nil
+}
+
+// findKeyAndType returns the start and end position for the type corresponding
+// to key or the point at which to insert the key-value pair if the type
+// wasn't found. The hasExt return value reports whether an -u extension was present.
+// Note: the extensions are typically very small and are likely to contain
+// only one key-type pair.
+func (t Tag) findTypeForKey(key string) (start, sep, end int, hasExt bool) {
+ p := int(t.pExt)
+ if len(key) != 2 || p == len(t.str) || p == 0 {
+ return p, p, p, false
+ }
+ s := t.str
+
+ // Find the correct extension.
+ for p++; s[p] != 'u'; p++ {
+ if s[p] > 'u' {
+ p--
+ return p, p, p, false
+ }
+ if p = nextExtension(s, p); p == len(s) {
+ return len(s), len(s), len(s), false
+ }
+ }
+ // Proceed to the hyphen following the extension name.
+ p++
+
+ // curKey is the key currently being processed.
+ curKey := ""
+
+ // Iterate over keys until we get the end of a section.
+ for {
+ end = p
+ for p++; p < len(s) && s[p] != '-'; p++ {
+ }
+ n := p - end - 1
+ if n <= 2 && curKey == key {
+ if sep < end {
+ sep++
+ }
+ return start, sep, end, true
+ }
+ switch n {
+ case 0, // invalid string
+ 1: // next extension
+ return end, end, end, true
+ case 2:
+ // next key
+ curKey = s[end+1 : p]
+ if curKey > key {
+ return end, end, end, true
+ }
+ start = end
+ sep = p
+ }
+ }
+}
+
+// ParseBase parses a 2- or 3-letter ISO 639 code.
+// It returns a ValueError if s is a well-formed but unknown language identifier
+// or another error if another error occurred.
+func ParseBase(s string) (l Language, err error) {
+ defer func() {
+ if recover() != nil {
+ l = 0
+ err = ErrSyntax
+ }
+ }()
+
+ if n := len(s); n < 2 || 3 < n {
+ return 0, ErrSyntax
+ }
+ var buf [3]byte
+ return getLangID(buf[:copy(buf[:], s)])
+}
+
+// ParseScript parses a 4-letter ISO 15924 code.
+// It returns a ValueError if s is a well-formed but unknown script identifier
+// or another error if another error occurred.
+func ParseScript(s string) (scr Script, err error) {
+ defer func() {
+ if recover() != nil {
+ scr = 0
+ err = ErrSyntax
+ }
+ }()
+
+ if len(s) != 4 {
+ return 0, ErrSyntax
+ }
+ var buf [4]byte
+ return getScriptID(script, buf[:copy(buf[:], s)])
+}
+
+// EncodeM49 returns the Region for the given UN M.49 code.
+// It returns an error if r is not a valid code.
+func EncodeM49(r int) (Region, error) {
+ return getRegionM49(r)
+}
+
+// ParseRegion parses a 2- or 3-letter ISO 3166-1 or a UN M.49 code.
+// It returns a ValueError if s is a well-formed but unknown region identifier
+// or another error if another error occurred.
+func ParseRegion(s string) (r Region, err error) {
+ defer func() {
+ if recover() != nil {
+ r = 0
+ err = ErrSyntax
+ }
+ }()
+
+ if n := len(s); n < 2 || 3 < n {
+ return 0, ErrSyntax
+ }
+ var buf [3]byte
+ return getRegionID(buf[:copy(buf[:], s)])
+}
+
+// IsCountry returns whether this region is a country or autonomous area. This
+// includes non-standard definitions from CLDR.
+func (r Region) IsCountry() bool {
+ if r == 0 || r.IsGroup() || r.IsPrivateUse() && r != _XK {
+ return false
+ }
+ return true
+}
+
+// IsGroup returns whether this region defines a collection of regions. This
+// includes non-standard definitions from CLDR.
+func (r Region) IsGroup() bool {
+ if r == 0 {
+ return false
+ }
+ return int(regionInclusion[r]) < len(regionContainment)
+}
+
+// Contains returns whether Region c is contained by Region r. It returns true
+// if c == r.
+func (r Region) Contains(c Region) bool {
+ if r == c {
+ return true
+ }
+ g := regionInclusion[r]
+ if g >= nRegionGroups {
+ return false
+ }
+ m := regionContainment[g]
+
+ d := regionInclusion[c]
+ b := regionInclusionBits[d]
+
+ // A contained country may belong to multiple disjoint groups. Matching any
+ // of these indicates containment. If the contained region is a group, it
+ // must strictly be a subset.
+ if d >= nRegionGroups {
+ return b&m != 0
+ }
+ return b&^m == 0
+}
+
+var errNoTLD = errors.New("language: region is not a valid ccTLD")
+
+// TLD returns the country code top-level domain (ccTLD). UK is returned for GB.
+// In all other cases it returns either the region itself or an error.
+//
+// This method may return an error for a region for which there exists a
+// canonical form with a ccTLD. To get that ccTLD canonicalize r first. The
+// region will already be canonicalized it was obtained from a Tag that was
+// obtained using any of the default methods.
+func (r Region) TLD() (Region, error) {
+ // See http://en.wikipedia.org/wiki/Country_code_top-level_domain for the
+ // difference between ISO 3166-1 and IANA ccTLD.
+ if r == _GB {
+ r = _UK
+ }
+ if (r.typ() & ccTLD) == 0 {
+ return 0, errNoTLD
+ }
+ return r, nil
+}
+
+// Canonicalize returns the region or a possible replacement if the region is
+// deprecated. It will not return a replacement for deprecated regions that
+// are split into multiple regions.
+func (r Region) Canonicalize() Region {
+ if cr := normRegion(r); cr != 0 {
+ return cr
+ }
+ return r
+}
+
+// Variant represents a registered variant of a language as defined by BCP 47.
+type Variant struct {
+ ID uint8
+ str string
+}
+
+// ParseVariant parses and returns a Variant. An error is returned if s is not
+// a valid variant.
+func ParseVariant(s string) (v Variant, err error) {
+ defer func() {
+ if recover() != nil {
+ v = Variant{}
+ err = ErrSyntax
+ }
+ }()
+
+ s = strings.ToLower(s)
+ if id, ok := variantIndex[s]; ok {
+ return Variant{id, s}, nil
+ }
+ return Variant{}, NewValueError([]byte(s))
+}
+
+// String returns the string representation of the variant.
+func (v Variant) String() string {
+ return v.str
+}
diff --git a/vendor/golang.org/x/text/internal/language/lookup.go b/vendor/golang.org/x/text/internal/language/lookup.go
new file mode 100644
index 000000000..6294b8152
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/lookup.go
@@ -0,0 +1,412 @@
+// 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 language
+
+import (
+ "bytes"
+ "fmt"
+ "sort"
+ "strconv"
+
+ "golang.org/x/text/internal/tag"
+)
+
+// findIndex tries to find the given tag in idx and returns a standardized error
+// if it could not be found.
+func findIndex(idx tag.Index, key []byte, form string) (index int, err error) {
+ if !tag.FixCase(form, key) {
+ return 0, ErrSyntax
+ }
+ i := idx.Index(key)
+ if i == -1 {
+ return 0, NewValueError(key)
+ }
+ return i, nil
+}
+
+func searchUint(imap []uint16, key uint16) int {
+ return sort.Search(len(imap), func(i int) bool {
+ return imap[i] >= key
+ })
+}
+
+type Language uint16
+
+// getLangID returns the langID of s if s is a canonical subtag
+// or langUnknown if s is not a canonical subtag.
+func getLangID(s []byte) (Language, error) {
+ if len(s) == 2 {
+ return getLangISO2(s)
+ }
+ return getLangISO3(s)
+}
+
+// TODO language normalization as well as the AliasMaps could be moved to the
+// higher level package, but it is a bit tricky to separate the generation.
+
+func (id Language) Canonicalize() (Language, AliasType) {
+ return normLang(id)
+}
+
+// mapLang returns the mapped langID of id according to mapping m.
+func normLang(id Language) (Language, AliasType) {
+ k := sort.Search(len(AliasMap), func(i int) bool {
+ return AliasMap[i].From >= uint16(id)
+ })
+ if k < len(AliasMap) && AliasMap[k].From == uint16(id) {
+ return Language(AliasMap[k].To), AliasTypes[k]
+ }
+ return id, AliasTypeUnknown
+}
+
+// getLangISO2 returns the langID for the given 2-letter ISO language code
+// or unknownLang if this does not exist.
+func getLangISO2(s []byte) (Language, error) {
+ if !tag.FixCase("zz", s) {
+ return 0, ErrSyntax
+ }
+ if i := lang.Index(s); i != -1 && lang.Elem(i)[3] != 0 {
+ return Language(i), nil
+ }
+ return 0, NewValueError(s)
+}
+
+const base = 'z' - 'a' + 1
+
+func strToInt(s []byte) 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
+ }
+}
+
+// getLangISO3 returns the langID for the given 3-letter ISO language code
+// or unknownLang if this does not exist.
+func getLangISO3(s []byte) (Language, error) {
+ if tag.FixCase("und", s) {
+ // first try to match canonical 3-letter entries
+ for i := lang.Index(s[:2]); i != -1; i = lang.Next(s[:2], i) {
+ if e := lang.Elem(i); e[3] == 0 && e[2] == s[2] {
+ // We treat "und" as special and always translate it to "unspecified".
+ // Note that ZZ and Zzzz are private use and are not treated as
+ // unspecified by default.
+ id := Language(i)
+ if id == nonCanonicalUnd {
+ return 0, nil
+ }
+ return id, nil
+ }
+ }
+ if i := altLangISO3.Index(s); i != -1 {
+ return Language(altLangIndex[altLangISO3.Elem(i)[3]]), nil
+ }
+ n := strToInt(s)
+ if langNoIndex[n/8]&(1<<(n%8)) != 0 {
+ return Language(n) + langNoIndexOffset, nil
+ }
+ // Check for non-canonical uses of ISO3.
+ for i := lang.Index(s[:1]); i != -1; i = lang.Next(s[:1], i) {
+ if e := lang.Elem(i); e[2] == s[1] && e[3] == s[2] {
+ return Language(i), nil
+ }
+ }
+ return 0, NewValueError(s)
+ }
+ return 0, ErrSyntax
+}
+
+// StringToBuf writes the string to b and returns the number of bytes
+// written. cap(b) must be >= 3.
+func (id Language) StringToBuf(b []byte) int {
+ if id >= langNoIndexOffset {
+ intToStr(uint(id)-langNoIndexOffset, b[:3])
+ return 3
+ } else if id == 0 {
+ return copy(b, "und")
+ }
+ l := lang[id<<2:]
+ if l[3] == 0 {
+ return copy(b, l[:3])
+ }
+ return copy(b, l[:2])
+}
+
+// String returns the BCP 47 representation of the langID.
+// Use b as variable name, instead of id, to ensure the variable
+// used is consistent with that of Base in which this type is embedded.
+func (b Language) String() string {
+ if b == 0 {
+ return "und"
+ } else if b >= langNoIndexOffset {
+ b -= langNoIndexOffset
+ buf := [3]byte{}
+ intToStr(uint(b), buf[:])
+ return string(buf[:])
+ }
+ l := lang.Elem(int(b))
+ if l[3] == 0 {
+ return l[:3]
+ }
+ return l[:2]
+}
+
+// ISO3 returns the ISO 639-3 language code.
+func (b Language) ISO3() string {
+ if b == 0 || b >= langNoIndexOffset {
+ return b.String()
+ }
+ l := lang.Elem(int(b))
+ if l[3] == 0 {
+ return l[:3]
+ } else if l[2] == 0 {
+ return altLangISO3.Elem(int(l[3]))[:3]
+ }
+ // This allocation will only happen for 3-letter ISO codes
+ // that are non-canonical BCP 47 language identifiers.
+ return l[0:1] + l[2:4]
+}
+
+// IsPrivateUse reports whether this language code is reserved for private use.
+func (b Language) IsPrivateUse() bool {
+ return langPrivateStart <= b && b <= langPrivateEnd
+}
+
+// SuppressScript returns the script marked as SuppressScript in the IANA
+// language tag repository, or 0 if there is no such script.
+func (b Language) SuppressScript() Script {
+ if b < langNoIndexOffset {
+ return Script(suppressScript[b])
+ }
+ return 0
+}
+
+type Region uint16
+
+// getRegionID returns the region id for s if s is a valid 2-letter region code
+// or unknownRegion.
+func getRegionID(s []byte) (Region, error) {
+ if len(s) == 3 {
+ if isAlpha(s[0]) {
+ return getRegionISO3(s)
+ }
+ if i, err := strconv.ParseUint(string(s), 10, 10); err == nil {
+ return getRegionM49(int(i))
+ }
+ }
+ return getRegionISO2(s)
+}
+
+// getRegionISO2 returns the regionID for the given 2-letter ISO country code
+// or unknownRegion if this does not exist.
+func getRegionISO2(s []byte) (Region, error) {
+ i, err := findIndex(regionISO, s, "ZZ")
+ if err != nil {
+ return 0, err
+ }
+ return Region(i) + isoRegionOffset, nil
+}
+
+// getRegionISO3 returns the regionID for the given 3-letter ISO country code
+// or unknownRegion if this does not exist.
+func getRegionISO3(s []byte) (Region, error) {
+ if tag.FixCase("ZZZ", s) {
+ for i := regionISO.Index(s[:1]); i != -1; i = regionISO.Next(s[:1], i) {
+ if e := regionISO.Elem(i); e[2] == s[1] && e[3] == s[2] {
+ return Region(i) + isoRegionOffset, nil
+ }
+ }
+ for i := 0; i < len(altRegionISO3); i += 3 {
+ if tag.Compare(altRegionISO3[i:i+3], s) == 0 {
+ return Region(altRegionIDs[i/3]), nil
+ }
+ }
+ return 0, NewValueError(s)
+ }
+ return 0, ErrSyntax
+}
+
+func getRegionM49(n int) (Region, error) {
+ if 0 < n && n <= 999 {
+ const (
+ searchBits = 7
+ regionBits = 9
+ regionMask = 1<> searchBits
+ buf := fromM49[m49Index[idx]:m49Index[idx+1]]
+ val := uint16(n) << regionBits // we rely on bits shifting out
+ i := sort.Search(len(buf), func(i int) bool {
+ return buf[i] >= val
+ })
+ if r := fromM49[int(m49Index[idx])+i]; r&^regionMask == val {
+ return Region(r & regionMask), nil
+ }
+ }
+ var e ValueError
+ fmt.Fprint(bytes.NewBuffer([]byte(e.v[:])), n)
+ return 0, e
+}
+
+// normRegion returns a region if r is deprecated or 0 otherwise.
+// TODO: consider supporting BYS (-> BLR), CSK (-> 200 or CZ), PHI (-> PHL) and AFI (-> DJ).
+// TODO: consider mapping split up regions to new most populous one (like CLDR).
+func normRegion(r Region) Region {
+ m := regionOldMap
+ k := sort.Search(len(m), func(i int) bool {
+ return m[i].From >= uint16(r)
+ })
+ if k < len(m) && m[k].From == uint16(r) {
+ return Region(m[k].To)
+ }
+ return 0
+}
+
+const (
+ iso3166UserAssigned = 1 << iota
+ ccTLD
+ bcp47Region
+)
+
+func (r Region) typ() byte {
+ return regionTypes[r]
+}
+
+// String returns the BCP 47 representation for the region.
+// It returns "ZZ" for an unspecified region.
+func (r Region) String() string {
+ if r < isoRegionOffset {
+ if r == 0 {
+ return "ZZ"
+ }
+ return fmt.Sprintf("%03d", r.M49())
+ }
+ r -= isoRegionOffset
+ return regionISO.Elem(int(r))[:2]
+}
+
+// ISO3 returns the 3-letter ISO code of r.
+// Note that not all regions have a 3-letter ISO code.
+// In such cases this method returns "ZZZ".
+func (r Region) ISO3() string {
+ if r < isoRegionOffset {
+ return "ZZZ"
+ }
+ r -= isoRegionOffset
+ reg := regionISO.Elem(int(r))
+ switch reg[2] {
+ case 0:
+ return altRegionISO3[reg[3]:][:3]
+ case ' ':
+ return "ZZZ"
+ }
+ return reg[0:1] + reg[2:4]
+}
+
+// M49 returns the UN M.49 encoding of r, or 0 if this encoding
+// is not defined for r.
+func (r Region) M49() int {
+ return int(m49[r])
+}
+
+// IsPrivateUse reports whether r has the ISO 3166 User-assigned status. This
+// may include private-use tags that are assigned by CLDR and used in this
+// implementation. So IsPrivateUse and IsCountry can be simultaneously true.
+func (r Region) IsPrivateUse() bool {
+ return r.typ()&iso3166UserAssigned != 0
+}
+
+type Script uint8
+
+// getScriptID returns the script id for string s. It assumes that s
+// is of the format [A-Z][a-z]{3}.
+func getScriptID(idx tag.Index, s []byte) (Script, error) {
+ i, err := findIndex(idx, s, "Zzzz")
+ return Script(i), err
+}
+
+// String returns the script code in title case.
+// It returns "Zzzz" for an unspecified script.
+func (s Script) String() string {
+ if s == 0 {
+ return "Zzzz"
+ }
+ return script.Elem(int(s))
+}
+
+// IsPrivateUse reports whether this script code is reserved for private use.
+func (s Script) IsPrivateUse() bool {
+ return _Qaaa <= s && s <= _Qabx
+}
+
+const (
+ maxAltTaglen = len("en-US-POSIX")
+ maxLen = maxAltTaglen
+)
+
+var (
+ // grandfatheredMap holds a mapping from legacy and grandfathered tags to
+ // their base language or index to more elaborate tag.
+ grandfatheredMap = map[[maxLen]byte]int16{
+ [maxLen]byte{'a', 'r', 't', '-', 'l', 'o', 'j', 'b', 'a', 'n'}: _jbo, // art-lojban
+ [maxLen]byte{'i', '-', 'a', 'm', 'i'}: _ami, // i-ami
+ [maxLen]byte{'i', '-', 'b', 'n', 'n'}: _bnn, // i-bnn
+ [maxLen]byte{'i', '-', 'h', 'a', 'k'}: _hak, // i-hak
+ [maxLen]byte{'i', '-', 'k', 'l', 'i', 'n', 'g', 'o', 'n'}: _tlh, // i-klingon
+ [maxLen]byte{'i', '-', 'l', 'u', 'x'}: _lb, // i-lux
+ [maxLen]byte{'i', '-', 'n', 'a', 'v', 'a', 'j', 'o'}: _nv, // i-navajo
+ [maxLen]byte{'i', '-', 'p', 'w', 'n'}: _pwn, // i-pwn
+ [maxLen]byte{'i', '-', 't', 'a', 'o'}: _tao, // i-tao
+ [maxLen]byte{'i', '-', 't', 'a', 'y'}: _tay, // i-tay
+ [maxLen]byte{'i', '-', 't', 's', 'u'}: _tsu, // i-tsu
+ [maxLen]byte{'n', 'o', '-', 'b', 'o', 'k'}: _nb, // no-bok
+ [maxLen]byte{'n', 'o', '-', 'n', 'y', 'n'}: _nn, // no-nyn
+ [maxLen]byte{'s', 'g', 'n', '-', 'b', 'e', '-', 'f', 'r'}: _sfb, // sgn-BE-FR
+ [maxLen]byte{'s', 'g', 'n', '-', 'b', 'e', '-', 'n', 'l'}: _vgt, // sgn-BE-NL
+ [maxLen]byte{'s', 'g', 'n', '-', 'c', 'h', '-', 'd', 'e'}: _sgg, // sgn-CH-DE
+ [maxLen]byte{'z', 'h', '-', 'g', 'u', 'o', 'y', 'u'}: _cmn, // zh-guoyu
+ [maxLen]byte{'z', 'h', '-', 'h', 'a', 'k', 'k', 'a'}: _hak, // zh-hakka
+ [maxLen]byte{'z', 'h', '-', 'm', 'i', 'n', '-', 'n', 'a', 'n'}: _nan, // zh-min-nan
+ [maxLen]byte{'z', 'h', '-', 'x', 'i', 'a', 'n', 'g'}: _hsn, // zh-xiang
+
+ // Grandfathered tags with no modern replacement will be converted as
+ // follows:
+ [maxLen]byte{'c', 'e', 'l', '-', 'g', 'a', 'u', 'l', 'i', 's', 'h'}: -1, // cel-gaulish
+ [maxLen]byte{'e', 'n', '-', 'g', 'b', '-', 'o', 'e', 'd'}: -2, // en-GB-oed
+ [maxLen]byte{'i', '-', 'd', 'e', 'f', 'a', 'u', 'l', 't'}: -3, // i-default
+ [maxLen]byte{'i', '-', 'e', 'n', 'o', 'c', 'h', 'i', 'a', 'n'}: -4, // i-enochian
+ [maxLen]byte{'i', '-', 'm', 'i', 'n', 'g', 'o'}: -5, // i-mingo
+ [maxLen]byte{'z', 'h', '-', 'm', 'i', 'n'}: -6, // zh-min
+
+ // CLDR-specific tag.
+ [maxLen]byte{'r', 'o', 'o', 't'}: 0, // root
+ [maxLen]byte{'e', 'n', '-', 'u', 's', '-', 'p', 'o', 's', 'i', 'x'}: -7, // en_US_POSIX"
+ }
+
+ altTagIndex = [...]uint8{0, 17, 31, 45, 61, 74, 86, 102}
+
+ altTags = "xtg-x-cel-gaulishen-GB-oxendicten-x-i-defaultund-x-i-enochiansee-x-i-mingonan-x-zh-minen-US-u-va-posix"
+)
+
+func grandfathered(s [maxAltTaglen]byte) (t Tag, ok bool) {
+ if v, ok := grandfatheredMap[s]; ok {
+ if v < 0 {
+ return Make(altTags[altTagIndex[-v-1]:altTagIndex[-v]]), true
+ }
+ t.LangID = Language(v)
+ return t, true
+ }
+ return t, false
+}
diff --git a/vendor/golang.org/x/text/internal/language/match.go b/vendor/golang.org/x/text/internal/language/match.go
new file mode 100644
index 000000000..75a2dbca7
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/match.go
@@ -0,0 +1,226 @@
+// 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 language
+
+import "errors"
+
+type scriptRegionFlags uint8
+
+const (
+ isList = 1 << iota
+ scriptInFrom
+ regionInFrom
+)
+
+func (t *Tag) setUndefinedLang(id Language) {
+ if t.LangID == 0 {
+ t.LangID = id
+ }
+}
+
+func (t *Tag) setUndefinedScript(id Script) {
+ if t.ScriptID == 0 {
+ t.ScriptID = id
+ }
+}
+
+func (t *Tag) setUndefinedRegion(id Region) {
+ if t.RegionID == 0 || t.RegionID.Contains(id) {
+ t.RegionID = id
+ }
+}
+
+// ErrMissingLikelyTagsData indicates no information was available
+// to compute likely values of missing tags.
+var ErrMissingLikelyTagsData = errors.New("missing likely tags data")
+
+// addLikelySubtags sets subtags to their most likely value, given the locale.
+// In most cases this means setting fields for unknown values, but in some
+// cases it may alter a value. It returns an ErrMissingLikelyTagsData error
+// if the given locale cannot be expanded.
+func (t Tag) addLikelySubtags() (Tag, error) {
+ id, err := addTags(t)
+ if err != nil {
+ return t, err
+ } else if id.equalTags(t) {
+ return t, nil
+ }
+ id.RemakeString()
+ return id, nil
+}
+
+// specializeRegion attempts to specialize a group region.
+func specializeRegion(t *Tag) bool {
+ if i := regionInclusion[t.RegionID]; i < nRegionGroups {
+ x := likelyRegionGroup[i]
+ if Language(x.lang) == t.LangID && Script(x.script) == t.ScriptID {
+ t.RegionID = Region(x.region)
+ }
+ return true
+ }
+ return false
+}
+
+// Maximize returns a new tag with missing tags filled in.
+func (t Tag) Maximize() (Tag, error) {
+ return addTags(t)
+}
+
+func addTags(t Tag) (Tag, error) {
+ // We leave private use identifiers alone.
+ if t.IsPrivateUse() {
+ return t, nil
+ }
+ if t.ScriptID != 0 && t.RegionID != 0 {
+ if t.LangID != 0 {
+ // already fully specified
+ specializeRegion(&t)
+ return t, nil
+ }
+ // Search matches for und-script-region. Note that for these cases
+ // region will never be a group so there is no need to check for this.
+ list := likelyRegion[t.RegionID : t.RegionID+1]
+ if x := list[0]; x.flags&isList != 0 {
+ list = likelyRegionList[x.lang : x.lang+uint16(x.script)]
+ }
+ for _, x := range list {
+ // Deviating from the spec. See match_test.go for details.
+ if Script(x.script) == t.ScriptID {
+ t.setUndefinedLang(Language(x.lang))
+ return t, nil
+ }
+ }
+ }
+ if t.LangID != 0 {
+ // Search matches for lang-script and lang-region, where lang != und.
+ if t.LangID < langNoIndexOffset {
+ x := likelyLang[t.LangID]
+ if x.flags&isList != 0 {
+ list := likelyLangList[x.region : x.region+uint16(x.script)]
+ if t.ScriptID != 0 {
+ for _, x := range list {
+ if Script(x.script) == t.ScriptID && x.flags&scriptInFrom != 0 {
+ t.setUndefinedRegion(Region(x.region))
+ return t, nil
+ }
+ }
+ } else if t.RegionID != 0 {
+ count := 0
+ goodScript := true
+ tt := t
+ for _, x := range list {
+ // We visit all entries for which the script was not
+ // defined, including the ones where the region was not
+ // defined. This allows for proper disambiguation within
+ // regions.
+ if x.flags&scriptInFrom == 0 && t.RegionID.Contains(Region(x.region)) {
+ tt.RegionID = Region(x.region)
+ tt.setUndefinedScript(Script(x.script))
+ goodScript = goodScript && tt.ScriptID == Script(x.script)
+ count++
+ }
+ }
+ if count == 1 {
+ return tt, nil
+ }
+ // Even if we fail to find a unique Region, we might have
+ // an unambiguous script.
+ if goodScript {
+ t.ScriptID = tt.ScriptID
+ }
+ }
+ }
+ }
+ } else {
+ // Search matches for und-script.
+ if t.ScriptID != 0 {
+ x := likelyScript[t.ScriptID]
+ if x.region != 0 {
+ t.setUndefinedRegion(Region(x.region))
+ t.setUndefinedLang(Language(x.lang))
+ return t, nil
+ }
+ }
+ // Search matches for und-region. If und-script-region exists, it would
+ // have been found earlier.
+ if t.RegionID != 0 {
+ if i := regionInclusion[t.RegionID]; i < nRegionGroups {
+ x := likelyRegionGroup[i]
+ if x.region != 0 {
+ t.setUndefinedLang(Language(x.lang))
+ t.setUndefinedScript(Script(x.script))
+ t.RegionID = Region(x.region)
+ }
+ } else {
+ x := likelyRegion[t.RegionID]
+ if x.flags&isList != 0 {
+ x = likelyRegionList[x.lang]
+ }
+ if x.script != 0 && x.flags != scriptInFrom {
+ t.setUndefinedLang(Language(x.lang))
+ t.setUndefinedScript(Script(x.script))
+ return t, nil
+ }
+ }
+ }
+ }
+
+ // Search matches for lang.
+ if t.LangID < langNoIndexOffset {
+ x := likelyLang[t.LangID]
+ if x.flags&isList != 0 {
+ x = likelyLangList[x.region]
+ }
+ if x.region != 0 {
+ t.setUndefinedScript(Script(x.script))
+ t.setUndefinedRegion(Region(x.region))
+ }
+ specializeRegion(&t)
+ if t.LangID == 0 {
+ t.LangID = _en // default language
+ }
+ return t, nil
+ }
+ return t, ErrMissingLikelyTagsData
+}
+
+func (t *Tag) setTagsFrom(id Tag) {
+ t.LangID = id.LangID
+ t.ScriptID = id.ScriptID
+ t.RegionID = id.RegionID
+}
+
+// minimize removes the region or script subtags from t such that
+// t.addLikelySubtags() == t.minimize().addLikelySubtags().
+func (t Tag) minimize() (Tag, error) {
+ t, err := minimizeTags(t)
+ if err != nil {
+ return t, err
+ }
+ t.RemakeString()
+ return t, nil
+}
+
+// minimizeTags mimics the behavior of the ICU 51 C implementation.
+func minimizeTags(t Tag) (Tag, error) {
+ if t.equalTags(Und) {
+ return t, nil
+ }
+ max, err := addTags(t)
+ if err != nil {
+ return t, err
+ }
+ for _, id := range [...]Tag{
+ {LangID: t.LangID},
+ {LangID: t.LangID, RegionID: t.RegionID},
+ {LangID: t.LangID, ScriptID: t.ScriptID},
+ } {
+ if x, err := addTags(id); err == nil && max.equalTags(x) {
+ t.setTagsFrom(id)
+ break
+ }
+ }
+ return t, nil
+}
diff --git a/vendor/golang.org/x/text/internal/language/parse.go b/vendor/golang.org/x/text/internal/language/parse.go
new file mode 100644
index 000000000..47ee0fed1
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/parse.go
@@ -0,0 +1,604 @@
+// 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 language
+
+import (
+ "bytes"
+ "errors"
+ "fmt"
+ "sort"
+
+ "golang.org/x/text/internal/tag"
+)
+
+// isAlpha returns true if the byte is not a digit.
+// b must be an ASCII letter or digit.
+func isAlpha(b byte) bool {
+ return b > '9'
+}
+
+// isAlphaNum returns true if the string contains only ASCII letters or digits.
+func isAlphaNum(s []byte) bool {
+ for _, c := range s {
+ if !('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9') {
+ return false
+ }
+ }
+ return true
+}
+
+// ErrSyntax is returned by any of the parsing functions when the
+// input is not well-formed, according to BCP 47.
+// TODO: return the position at which the syntax error occurred?
+var ErrSyntax = errors.New("language: tag is not well-formed")
+
+// ErrDuplicateKey is returned when a tag contains the same key twice with
+// different values in the -u section.
+var ErrDuplicateKey = errors.New("language: different values for same key in -u extension")
+
+// ValueError is returned by any of the parsing functions when the
+// input is well-formed but the respective subtag is not recognized
+// as a valid value.
+type ValueError struct {
+ v [8]byte
+}
+
+// NewValueError creates a new ValueError.
+func NewValueError(tag []byte) ValueError {
+ var e ValueError
+ copy(e.v[:], tag)
+ return e
+}
+
+func (e ValueError) tag() []byte {
+ n := bytes.IndexByte(e.v[:], 0)
+ if n == -1 {
+ n = 8
+ }
+ return e.v[:n]
+}
+
+// Error implements the error interface.
+func (e ValueError) Error() string {
+ return fmt.Sprintf("language: subtag %q is well-formed but unknown", e.tag())
+}
+
+// Subtag returns the subtag for which the error occurred.
+func (e ValueError) Subtag() string {
+ return string(e.tag())
+}
+
+// scanner is used to scan BCP 47 tokens, which are separated by _ or -.
+type scanner struct {
+ b []byte
+ bytes [max99thPercentileSize]byte
+ token []byte
+ start int // start position of the current token
+ end int // end position of the current token
+ next int // next point for scan
+ err error
+ done bool
+}
+
+func makeScannerString(s string) scanner {
+ scan := scanner{}
+ if len(s) <= len(scan.bytes) {
+ scan.b = scan.bytes[:copy(scan.bytes[:], s)]
+ } else {
+ scan.b = []byte(s)
+ }
+ scan.init()
+ return scan
+}
+
+// makeScanner returns a scanner using b as the input buffer.
+// b is not copied and may be modified by the scanner routines.
+func makeScanner(b []byte) scanner {
+ scan := scanner{b: b}
+ scan.init()
+ return scan
+}
+
+func (s *scanner) init() {
+ for i, c := range s.b {
+ if c == '_' {
+ s.b[i] = '-'
+ }
+ }
+ s.scan()
+}
+
+// restToLower converts the string between start and end to lower case.
+func (s *scanner) toLower(start, end int) {
+ for i := start; i < end; i++ {
+ c := s.b[i]
+ if 'A' <= c && c <= 'Z' {
+ s.b[i] += 'a' - 'A'
+ }
+ }
+}
+
+func (s *scanner) setError(e error) {
+ if s.err == nil || (e == ErrSyntax && s.err != ErrSyntax) {
+ s.err = e
+ }
+}
+
+// resizeRange shrinks or grows the array at position oldStart such that
+// a new string of size newSize can fit between oldStart and oldEnd.
+// Sets the scan point to after the resized range.
+func (s *scanner) resizeRange(oldStart, oldEnd, newSize int) {
+ s.start = oldStart
+ if end := oldStart + newSize; end != oldEnd {
+ diff := end - oldEnd
+ var b []byte
+ if n := len(s.b) + diff; n > cap(s.b) {
+ b = make([]byte, n)
+ copy(b, s.b[:oldStart])
+ } else {
+ b = s.b[:n]
+ }
+ copy(b[end:], s.b[oldEnd:])
+ s.b = b
+ s.next = end + (s.next - s.end)
+ s.end = end
+ }
+}
+
+// replace replaces the current token with repl.
+func (s *scanner) replace(repl string) {
+ s.resizeRange(s.start, s.end, len(repl))
+ copy(s.b[s.start:], repl)
+}
+
+// gobble removes the current token from the input.
+// Caller must call scan after calling gobble.
+func (s *scanner) gobble(e error) {
+ s.setError(e)
+ if s.start == 0 {
+ s.b = s.b[:+copy(s.b, s.b[s.next:])]
+ s.end = 0
+ } else {
+ s.b = s.b[:s.start-1+copy(s.b[s.start-1:], s.b[s.end:])]
+ s.end = s.start - 1
+ }
+ s.next = s.start
+}
+
+// deleteRange removes the given range from s.b before the current token.
+func (s *scanner) deleteRange(start, end int) {
+ s.b = s.b[:start+copy(s.b[start:], s.b[end:])]
+ diff := end - start
+ s.next -= diff
+ s.start -= diff
+ s.end -= diff
+}
+
+// scan parses the next token of a BCP 47 string. Tokens that are larger
+// than 8 characters or include non-alphanumeric characters result in an error
+// and are gobbled and removed from the output.
+// It returns the end position of the last token consumed.
+func (s *scanner) scan() (end int) {
+ end = s.end
+ s.token = nil
+ for s.start = s.next; s.next < len(s.b); {
+ i := bytes.IndexByte(s.b[s.next:], '-')
+ if i == -1 {
+ s.end = len(s.b)
+ s.next = len(s.b)
+ i = s.end - s.start
+ } else {
+ s.end = s.next + i
+ s.next = s.end + 1
+ }
+ token := s.b[s.start:s.end]
+ if i < 1 || i > 8 || !isAlphaNum(token) {
+ s.gobble(ErrSyntax)
+ continue
+ }
+ s.token = token
+ return end
+ }
+ if n := len(s.b); n > 0 && s.b[n-1] == '-' {
+ s.setError(ErrSyntax)
+ s.b = s.b[:len(s.b)-1]
+ }
+ s.done = true
+ return end
+}
+
+// acceptMinSize parses multiple tokens of the given size or greater.
+// It returns the end position of the last token consumed.
+func (s *scanner) acceptMinSize(min int) (end int) {
+ end = s.end
+ s.scan()
+ for ; len(s.token) >= min; s.scan() {
+ end = s.end
+ }
+ return end
+}
+
+// Parse parses the given BCP 47 string and returns a valid Tag. If parsing
+// failed it returns an error and any part of the tag that could be parsed.
+// If parsing succeeded but an unknown value was found, it returns
+// ValueError. The Tag returned in this case is just stripped of the unknown
+// value. All other values are preserved. It accepts tags in the BCP 47 format
+// and extensions to this standard defined in
+// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
+func Parse(s string) (t Tag, err error) {
+ // TODO: consider supporting old-style locale key-value pairs.
+ if s == "" {
+ return Und, ErrSyntax
+ }
+ defer func() {
+ if recover() != nil {
+ t = Und
+ err = ErrSyntax
+ return
+ }
+ }()
+ if len(s) <= maxAltTaglen {
+ b := [maxAltTaglen]byte{}
+ for i, c := range s {
+ // Generating invalid UTF-8 is okay as it won't match.
+ if 'A' <= c && c <= 'Z' {
+ c += 'a' - 'A'
+ } else if c == '_' {
+ c = '-'
+ }
+ b[i] = byte(c)
+ }
+ if t, ok := grandfathered(b); ok {
+ return t, nil
+ }
+ }
+ scan := makeScannerString(s)
+ return parse(&scan, s)
+}
+
+func parse(scan *scanner, s string) (t Tag, err error) {
+ t = Und
+ var end int
+ if n := len(scan.token); n <= 1 {
+ scan.toLower(0, len(scan.b))
+ if n == 0 || scan.token[0] != 'x' {
+ return t, ErrSyntax
+ }
+ end = parseExtensions(scan)
+ } else if n >= 4 {
+ return Und, ErrSyntax
+ } else { // the usual case
+ t, end = parseTag(scan)
+ if n := len(scan.token); n == 1 {
+ t.pExt = uint16(end)
+ end = parseExtensions(scan)
+ } else if end < len(scan.b) {
+ scan.setError(ErrSyntax)
+ scan.b = scan.b[:end]
+ }
+ }
+ if int(t.pVariant) < len(scan.b) {
+ if end < len(s) {
+ s = s[:end]
+ }
+ if len(s) > 0 && tag.Compare(s, scan.b) == 0 {
+ t.str = s
+ } else {
+ t.str = string(scan.b)
+ }
+ } else {
+ t.pVariant, t.pExt = 0, 0
+ }
+ return t, scan.err
+}
+
+// parseTag parses language, script, region and variants.
+// It returns a Tag and the end position in the input that was parsed.
+func parseTag(scan *scanner) (t Tag, end int) {
+ var e error
+ // TODO: set an error if an unknown lang, script or region is encountered.
+ t.LangID, e = getLangID(scan.token)
+ scan.setError(e)
+ scan.replace(t.LangID.String())
+ langStart := scan.start
+ end = scan.scan()
+ for len(scan.token) == 3 && isAlpha(scan.token[0]) {
+ // From http://tools.ietf.org/html/bcp47, - tags are equivalent
+ // to a tag of the form .
+ lang, e := getLangID(scan.token)
+ if lang != 0 {
+ t.LangID = lang
+ copy(scan.b[langStart:], lang.String())
+ scan.b[langStart+3] = '-'
+ scan.start = langStart + 4
+ }
+ scan.gobble(e)
+ end = scan.scan()
+ }
+ if len(scan.token) == 4 && isAlpha(scan.token[0]) {
+ t.ScriptID, e = getScriptID(script, scan.token)
+ if t.ScriptID == 0 {
+ scan.gobble(e)
+ }
+ end = scan.scan()
+ }
+ if n := len(scan.token); n >= 2 && n <= 3 {
+ t.RegionID, e = getRegionID(scan.token)
+ if t.RegionID == 0 {
+ scan.gobble(e)
+ } else {
+ scan.replace(t.RegionID.String())
+ }
+ end = scan.scan()
+ }
+ scan.toLower(scan.start, len(scan.b))
+ t.pVariant = byte(end)
+ end = parseVariants(scan, end, t)
+ t.pExt = uint16(end)
+ return t, end
+}
+
+var separator = []byte{'-'}
+
+// parseVariants scans tokens as long as each token is a valid variant string.
+// Duplicate variants are removed.
+func parseVariants(scan *scanner, end int, t Tag) int {
+ start := scan.start
+ varIDBuf := [4]uint8{}
+ variantBuf := [4][]byte{}
+ varID := varIDBuf[:0]
+ variant := variantBuf[:0]
+ last := -1
+ needSort := false
+ for ; len(scan.token) >= 4; scan.scan() {
+ // TODO: measure the impact of needing this conversion and redesign
+ // the data structure if there is an issue.
+ v, ok := variantIndex[string(scan.token)]
+ if !ok {
+ // unknown variant
+ // TODO: allow user-defined variants?
+ scan.gobble(NewValueError(scan.token))
+ continue
+ }
+ varID = append(varID, v)
+ variant = append(variant, scan.token)
+ if !needSort {
+ if last < int(v) {
+ last = int(v)
+ } else {
+ needSort = true
+ // There is no legal combinations of more than 7 variants
+ // (and this is by no means a useful sequence).
+ const maxVariants = 8
+ if len(varID) > maxVariants {
+ break
+ }
+ }
+ }
+ end = scan.end
+ }
+ if needSort {
+ sort.Sort(variantsSort{varID, variant})
+ k, l := 0, -1
+ for i, v := range varID {
+ w := int(v)
+ if l == w {
+ // Remove duplicates.
+ continue
+ }
+ varID[k] = varID[i]
+ variant[k] = variant[i]
+ k++
+ l = w
+ }
+ if str := bytes.Join(variant[:k], separator); len(str) == 0 {
+ end = start - 1
+ } else {
+ scan.resizeRange(start, end, len(str))
+ copy(scan.b[scan.start:], str)
+ end = scan.end
+ }
+ }
+ return end
+}
+
+type variantsSort struct {
+ i []uint8
+ v [][]byte
+}
+
+func (s variantsSort) Len() int {
+ return len(s.i)
+}
+
+func (s variantsSort) Swap(i, j int) {
+ s.i[i], s.i[j] = s.i[j], s.i[i]
+ s.v[i], s.v[j] = s.v[j], s.v[i]
+}
+
+func (s variantsSort) Less(i, j int) bool {
+ return s.i[i] < s.i[j]
+}
+
+type bytesSort struct {
+ b [][]byte
+ n int // first n bytes to compare
+}
+
+func (b bytesSort) Len() int {
+ return len(b.b)
+}
+
+func (b bytesSort) Swap(i, j int) {
+ b.b[i], b.b[j] = b.b[j], b.b[i]
+}
+
+func (b bytesSort) Less(i, j int) bool {
+ for k := 0; k < b.n; k++ {
+ if b.b[i][k] == b.b[j][k] {
+ continue
+ }
+ return b.b[i][k] < b.b[j][k]
+ }
+ return false
+}
+
+// parseExtensions parses and normalizes the extensions in the buffer.
+// It returns the last position of scan.b that is part of any extension.
+// It also trims scan.b to remove excess parts accordingly.
+func parseExtensions(scan *scanner) int {
+ start := scan.start
+ exts := [][]byte{}
+ private := []byte{}
+ end := scan.end
+ for len(scan.token) == 1 {
+ extStart := scan.start
+ ext := scan.token[0]
+ end = parseExtension(scan)
+ extension := scan.b[extStart:end]
+ if len(extension) < 3 || (ext != 'x' && len(extension) < 4) {
+ scan.setError(ErrSyntax)
+ end = extStart
+ continue
+ } else if start == extStart && (ext == 'x' || scan.start == len(scan.b)) {
+ scan.b = scan.b[:end]
+ return end
+ } else if ext == 'x' {
+ private = extension
+ break
+ }
+ exts = append(exts, extension)
+ }
+ sort.Sort(bytesSort{exts, 1})
+ if len(private) > 0 {
+ exts = append(exts, private)
+ }
+ scan.b = scan.b[:start]
+ if len(exts) > 0 {
+ scan.b = append(scan.b, bytes.Join(exts, separator)...)
+ } else if start > 0 {
+ // Strip trailing '-'.
+ scan.b = scan.b[:start-1]
+ }
+ return end
+}
+
+// parseExtension parses a single extension and returns the position of
+// the extension end.
+func parseExtension(scan *scanner) int {
+ start, end := scan.start, scan.end
+ switch scan.token[0] {
+ case 'u': // https://www.ietf.org/rfc/rfc6067.txt
+ attrStart := end
+ scan.scan()
+ for last := []byte{}; len(scan.token) > 2; scan.scan() {
+ if bytes.Compare(scan.token, last) != -1 {
+ // Attributes are unsorted. Start over from scratch.
+ p := attrStart + 1
+ scan.next = p
+ attrs := [][]byte{}
+ for scan.scan(); len(scan.token) > 2; scan.scan() {
+ attrs = append(attrs, scan.token)
+ end = scan.end
+ }
+ sort.Sort(bytesSort{attrs, 3})
+ copy(scan.b[p:], bytes.Join(attrs, separator))
+ break
+ }
+ last = scan.token
+ end = scan.end
+ }
+ // Scan key-type sequences. A key is of length 2 and may be followed
+ // by 0 or more "type" subtags from 3 to the maximum of 8 letters.
+ var last, key []byte
+ for attrEnd := end; len(scan.token) == 2; last = key {
+ key = scan.token
+ end = scan.end
+ for scan.scan(); end < scan.end && len(scan.token) > 2; scan.scan() {
+ end = scan.end
+ }
+ // TODO: check key value validity
+ if bytes.Compare(key, last) != 1 || scan.err != nil {
+ // We have an invalid key or the keys are not sorted.
+ // Start scanning keys from scratch and reorder.
+ p := attrEnd + 1
+ scan.next = p
+ keys := [][]byte{}
+ for scan.scan(); len(scan.token) == 2; {
+ keyStart := scan.start
+ end = scan.end
+ for scan.scan(); end < scan.end && len(scan.token) > 2; scan.scan() {
+ end = scan.end
+ }
+ keys = append(keys, scan.b[keyStart:end])
+ }
+ sort.Stable(bytesSort{keys, 2})
+ if n := len(keys); n > 0 {
+ k := 0
+ for i := 1; i < n; i++ {
+ if !bytes.Equal(keys[k][:2], keys[i][:2]) {
+ k++
+ keys[k] = keys[i]
+ } else if !bytes.Equal(keys[k], keys[i]) {
+ scan.setError(ErrDuplicateKey)
+ }
+ }
+ keys = keys[:k+1]
+ }
+ reordered := bytes.Join(keys, separator)
+ if e := p + len(reordered); e < end {
+ scan.deleteRange(e, end)
+ end = e
+ }
+ copy(scan.b[p:], reordered)
+ break
+ }
+ }
+ case 't': // https://www.ietf.org/rfc/rfc6497.txt
+ scan.scan()
+ if n := len(scan.token); n >= 2 && n <= 3 && isAlpha(scan.token[1]) {
+ _, end = parseTag(scan)
+ scan.toLower(start, end)
+ }
+ for len(scan.token) == 2 && !isAlpha(scan.token[1]) {
+ end = scan.acceptMinSize(3)
+ }
+ case 'x':
+ end = scan.acceptMinSize(1)
+ default:
+ end = scan.acceptMinSize(2)
+ }
+ return end
+}
+
+// getExtension returns the name, body and end position of the extension.
+func getExtension(s string, p int) (end int, ext string) {
+ if s[p] == '-' {
+ p++
+ }
+ if s[p] == 'x' {
+ return len(s), s[p:]
+ }
+ end = nextExtension(s, p)
+ return end, s[p:end]
+}
+
+// nextExtension finds the next extension within the string, searching
+// for the -- pattern from position p.
+// In the fast majority of cases, language tags will have at most
+// one extension and extensions tend to be small.
+func nextExtension(s string, p int) int {
+ for n := len(s) - 3; p < n; {
+ if s[p] == '-' {
+ if s[p+2] == '-' {
+ return p
+ }
+ p += 3
+ } else {
+ p++
+ }
+ }
+ return len(s)
+}
diff --git a/vendor/golang.org/x/text/internal/language/tables.go b/vendor/golang.org/x/text/internal/language/tables.go
new file mode 100644
index 000000000..a19480c5b
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/tables.go
@@ -0,0 +1,3464 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+package language
+
+import "golang.org/x/text/internal/tag"
+
+// CLDRVersion is the CLDR version from which the tables in this package are derived.
+const CLDRVersion = "32"
+
+const NumLanguages = 8717
+
+const NumScripts = 251
+
+const NumRegions = 357
+
+type FromTo struct {
+ From uint16
+ To uint16
+}
+
+const nonCanonicalUnd = 1201
+const (
+ _af = 22
+ _am = 39
+ _ar = 58
+ _az = 88
+ _bg = 126
+ _bn = 165
+ _ca = 215
+ _cs = 250
+ _da = 257
+ _de = 269
+ _el = 310
+ _en = 313
+ _es = 318
+ _et = 320
+ _fa = 328
+ _fi = 337
+ _fil = 339
+ _fr = 350
+ _gu = 420
+ _he = 444
+ _hi = 446
+ _hr = 465
+ _hu = 469
+ _hy = 471
+ _id = 481
+ _is = 504
+ _it = 505
+ _ja = 512
+ _ka = 528
+ _kk = 578
+ _km = 586
+ _kn = 593
+ _ko = 596
+ _ky = 650
+ _lo = 696
+ _lt = 704
+ _lv = 711
+ _mk = 767
+ _ml = 772
+ _mn = 779
+ _mo = 784
+ _mr = 795
+ _ms = 799
+ _mul = 806
+ _my = 817
+ _nb = 839
+ _ne = 849
+ _nl = 871
+ _no = 879
+ _pa = 925
+ _pl = 947
+ _pt = 960
+ _ro = 988
+ _ru = 994
+ _sh = 1031
+ _si = 1036
+ _sk = 1042
+ _sl = 1046
+ _sq = 1073
+ _sr = 1074
+ _sv = 1092
+ _sw = 1093
+ _ta = 1104
+ _te = 1121
+ _th = 1131
+ _tl = 1146
+ _tn = 1152
+ _tr = 1162
+ _uk = 1198
+ _ur = 1204
+ _uz = 1212
+ _vi = 1219
+ _zh = 1321
+ _zu = 1327
+ _jbo = 515
+ _ami = 1650
+ _bnn = 2357
+ _hak = 438
+ _tlh = 14467
+ _lb = 661
+ _nv = 899
+ _pwn = 12055
+ _tao = 14188
+ _tay = 14198
+ _tsu = 14662
+ _nn = 874
+ _sfb = 13629
+ _vgt = 15701
+ _sgg = 13660
+ _cmn = 3007
+ _nan = 835
+ _hsn = 467
+)
+
+const langPrivateStart = 0x2f72
+
+const langPrivateEnd = 0x3179
+
+// 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.
+const lang tag.Index = "" + // Size: 5324 bytes
+ "---\x00aaaraai\x00aak\x00aau\x00abbkabi\x00abq\x00abr\x00abt\x00aby\x00a" +
+ "cd\x00ace\x00ach\x00ada\x00ade\x00adj\x00ady\x00adz\x00aeveaeb\x00aey" +
+ "\x00affragc\x00agd\x00agg\x00agm\x00ago\x00agq\x00aha\x00ahl\x00aho\x00a" +
+ "jg\x00akkaakk\x00ala\x00ali\x00aln\x00alt\x00ammhamm\x00amn\x00amo\x00am" +
+ "p\x00anrganc\x00ank\x00ann\x00any\x00aoj\x00aom\x00aoz\x00apc\x00apd\x00" +
+ "ape\x00apr\x00aps\x00apz\x00arraarc\x00arh\x00arn\x00aro\x00arq\x00ars" +
+ "\x00ary\x00arz\x00assmasa\x00ase\x00asg\x00aso\x00ast\x00ata\x00atg\x00a" +
+ "tj\x00auy\x00avvaavl\x00avn\x00avt\x00avu\x00awa\x00awb\x00awo\x00awx" +
+ "\x00ayymayb\x00azzebaakbal\x00ban\x00bap\x00bar\x00bas\x00bav\x00bax\x00" +
+ "bba\x00bbb\x00bbc\x00bbd\x00bbj\x00bbp\x00bbr\x00bcf\x00bch\x00bci\x00bc" +
+ "m\x00bcn\x00bco\x00bcq\x00bcu\x00bdd\x00beelbef\x00beh\x00bej\x00bem\x00" +
+ "bet\x00bew\x00bex\x00bez\x00bfd\x00bfq\x00bft\x00bfy\x00bgulbgc\x00bgn" +
+ "\x00bgx\x00bhihbhb\x00bhg\x00bhi\x00bhk\x00bhl\x00bho\x00bhy\x00biisbib" +
+ "\x00big\x00bik\x00bim\x00bin\x00bio\x00biq\x00bjh\x00bji\x00bjj\x00bjn" +
+ "\x00bjo\x00bjr\x00bjt\x00bjz\x00bkc\x00bkm\x00bkq\x00bku\x00bkv\x00blt" +
+ "\x00bmambmh\x00bmk\x00bmq\x00bmu\x00bnenbng\x00bnm\x00bnp\x00boodboj\x00" +
+ "bom\x00bon\x00bpy\x00bqc\x00bqi\x00bqp\x00bqv\x00brrebra\x00brh\x00brx" +
+ "\x00brz\x00bsosbsj\x00bsq\x00bss\x00bst\x00bto\x00btt\x00btv\x00bua\x00b" +
+ "uc\x00bud\x00bug\x00buk\x00bum\x00buo\x00bus\x00buu\x00bvb\x00bwd\x00bwr" +
+ "\x00bxh\x00bye\x00byn\x00byr\x00bys\x00byv\x00byx\x00bza\x00bze\x00bzf" +
+ "\x00bzh\x00bzw\x00caatcan\x00cbj\x00cch\x00ccp\x00ceheceb\x00cfa\x00cgg" +
+ "\x00chhachk\x00chm\x00cho\x00chp\x00chr\x00cja\x00cjm\x00cjv\x00ckb\x00c" +
+ "kl\x00cko\x00cky\x00cla\x00cme\x00cmg\x00cooscop\x00cps\x00crrecrh\x00cr" +
+ "j\x00crk\x00crl\x00crm\x00crs\x00csescsb\x00csw\x00ctd\x00cuhucvhvcyymda" +
+ "andad\x00daf\x00dag\x00dah\x00dak\x00dar\x00dav\x00dbd\x00dbq\x00dcc\x00" +
+ "ddn\x00deeuded\x00den\x00dga\x00dgh\x00dgi\x00dgl\x00dgr\x00dgz\x00dia" +
+ "\x00dje\x00dnj\x00dob\x00doi\x00dop\x00dow\x00dri\x00drs\x00dsb\x00dtm" +
+ "\x00dtp\x00dts\x00dty\x00dua\x00duc\x00dud\x00dug\x00dvivdva\x00dww\x00d" +
+ "yo\x00dyu\x00dzzodzg\x00ebu\x00eeweefi\x00egl\x00egy\x00eka\x00eky\x00el" +
+ "llema\x00emi\x00enngenn\x00enq\x00eopoeri\x00es\x00\x05esu\x00etstetr" +
+ "\x00ett\x00etu\x00etx\x00euusewo\x00ext\x00faasfaa\x00fab\x00fag\x00fai" +
+ "\x00fan\x00ffulffi\x00ffm\x00fiinfia\x00fil\x00fit\x00fjijflr\x00fmp\x00" +
+ "foaofod\x00fon\x00for\x00fpe\x00fqs\x00frrafrc\x00frp\x00frr\x00frs\x00f" +
+ "ub\x00fud\x00fue\x00fuf\x00fuh\x00fuq\x00fur\x00fuv\x00fuy\x00fvr\x00fyr" +
+ "ygalegaa\x00gaf\x00gag\x00gah\x00gaj\x00gam\x00gan\x00gaw\x00gay\x00gba" +
+ "\x00gbf\x00gbm\x00gby\x00gbz\x00gcr\x00gdlagde\x00gdn\x00gdr\x00geb\x00g" +
+ "ej\x00gel\x00gez\x00gfk\x00ggn\x00ghs\x00gil\x00gim\x00gjk\x00gjn\x00gju" +
+ "\x00gkn\x00gkp\x00gllgglk\x00gmm\x00gmv\x00gnrngnd\x00gng\x00god\x00gof" +
+ "\x00goi\x00gom\x00gon\x00gor\x00gos\x00got\x00grb\x00grc\x00grt\x00grw" +
+ "\x00gsw\x00guujgub\x00guc\x00gud\x00gur\x00guw\x00gux\x00guz\x00gvlvgvf" +
+ "\x00gvr\x00gvs\x00gwc\x00gwi\x00gwt\x00gyi\x00haauhag\x00hak\x00ham\x00h" +
+ "aw\x00haz\x00hbb\x00hdy\x00heebhhy\x00hiinhia\x00hif\x00hig\x00hih\x00hi" +
+ "l\x00hla\x00hlu\x00hmd\x00hmt\x00hnd\x00hne\x00hnj\x00hnn\x00hno\x00homo" +
+ "hoc\x00hoj\x00hot\x00hrrvhsb\x00hsn\x00htathuunhui\x00hyyehzerianaian" +
+ "\x00iar\x00iba\x00ibb\x00iby\x00ica\x00ich\x00idndidd\x00idi\x00idu\x00i" +
+ "eleife\x00igboigb\x00ige\x00iiiiijj\x00ikpkikk\x00ikt\x00ikw\x00ikx\x00i" +
+ "lo\x00imo\x00inndinh\x00iodoiou\x00iri\x00isslittaiukuiw\x00\x03iwm\x00i" +
+ "ws\x00izh\x00izi\x00japnjab\x00jam\x00jbo\x00jbu\x00jen\x00jgk\x00jgo" +
+ "\x00ji\x00\x06jib\x00jmc\x00jml\x00jra\x00jut\x00jvavjwavkaatkaa\x00kab" +
+ "\x00kac\x00kad\x00kai\x00kaj\x00kam\x00kao\x00kbd\x00kbm\x00kbp\x00kbq" +
+ "\x00kbx\x00kby\x00kcg\x00kck\x00kcl\x00kct\x00kde\x00kdh\x00kdl\x00kdt" +
+ "\x00kea\x00ken\x00kez\x00kfo\x00kfr\x00kfy\x00kgonkge\x00kgf\x00kgp\x00k" +
+ "ha\x00khb\x00khn\x00khq\x00khs\x00kht\x00khw\x00khz\x00kiikkij\x00kiu" +
+ "\x00kiw\x00kjuakjd\x00kjg\x00kjs\x00kjy\x00kkazkkc\x00kkj\x00klalkln\x00" +
+ "klq\x00klt\x00klx\x00kmhmkmb\x00kmh\x00kmo\x00kms\x00kmu\x00kmw\x00knank" +
+ "nf\x00knp\x00koorkoi\x00kok\x00kol\x00kos\x00koz\x00kpe\x00kpf\x00kpo" +
+ "\x00kpr\x00kpx\x00kqb\x00kqf\x00kqs\x00kqy\x00kraukrc\x00kri\x00krj\x00k" +
+ "rl\x00krs\x00kru\x00ksasksb\x00ksd\x00ksf\x00ksh\x00ksj\x00ksr\x00ktb" +
+ "\x00ktm\x00kto\x00kuurkub\x00kud\x00kue\x00kuj\x00kum\x00kun\x00kup\x00k" +
+ "us\x00kvomkvg\x00kvr\x00kvx\x00kw\x00\x01kwj\x00kwo\x00kxa\x00kxc\x00kxm" +
+ "\x00kxp\x00kxw\x00kxz\x00kyirkye\x00kyx\x00kzr\x00laatlab\x00lad\x00lag" +
+ "\x00lah\x00laj\x00las\x00lbtzlbe\x00lbu\x00lbw\x00lcm\x00lcp\x00ldb\x00l" +
+ "ed\x00lee\x00lem\x00lep\x00leq\x00leu\x00lez\x00lguglgg\x00liimlia\x00li" +
+ "d\x00lif\x00lig\x00lih\x00lij\x00lis\x00ljp\x00lki\x00lkt\x00lle\x00lln" +
+ "\x00lmn\x00lmo\x00lmp\x00lninlns\x00lnu\x00loaoloj\x00lok\x00lol\x00lor" +
+ "\x00los\x00loz\x00lrc\x00ltitltg\x00luublua\x00luo\x00luy\x00luz\x00lvav" +
+ "lwl\x00lzh\x00lzz\x00mad\x00maf\x00mag\x00mai\x00mak\x00man\x00mas\x00ma" +
+ "w\x00maz\x00mbh\x00mbo\x00mbq\x00mbu\x00mbw\x00mci\x00mcp\x00mcq\x00mcr" +
+ "\x00mcu\x00mda\x00mde\x00mdf\x00mdh\x00mdj\x00mdr\x00mdx\x00med\x00mee" +
+ "\x00mek\x00men\x00mer\x00met\x00meu\x00mfa\x00mfe\x00mfn\x00mfo\x00mfq" +
+ "\x00mglgmgh\x00mgl\x00mgo\x00mgp\x00mgy\x00mhahmhi\x00mhl\x00mirimif\x00" +
+ "min\x00mis\x00miw\x00mkkdmki\x00mkl\x00mkp\x00mkw\x00mlalmle\x00mlp\x00m" +
+ "ls\x00mmo\x00mmu\x00mmx\x00mnonmna\x00mnf\x00mni\x00mnw\x00moolmoa\x00mo" +
+ "e\x00moh\x00mos\x00mox\x00mpp\x00mps\x00mpt\x00mpx\x00mql\x00mrarmrd\x00" +
+ "mrj\x00mro\x00mssamtltmtc\x00mtf\x00mti\x00mtr\x00mua\x00mul\x00mur\x00m" +
+ "us\x00mva\x00mvn\x00mvy\x00mwk\x00mwr\x00mwv\x00mxc\x00mxm\x00myyamyk" +
+ "\x00mym\x00myv\x00myw\x00myx\x00myz\x00mzk\x00mzm\x00mzn\x00mzp\x00mzw" +
+ "\x00mzz\x00naaunac\x00naf\x00nah\x00nak\x00nan\x00nap\x00naq\x00nas\x00n" +
+ "bobnca\x00nce\x00ncf\x00nch\x00nco\x00ncu\x00nddendc\x00nds\x00neepneb" +
+ "\x00new\x00nex\x00nfr\x00ngdonga\x00ngb\x00ngl\x00nhb\x00nhe\x00nhw\x00n" +
+ "if\x00nii\x00nij\x00nin\x00niu\x00niy\x00niz\x00njo\x00nkg\x00nko\x00nll" +
+ "dnmg\x00nmz\x00nnnonnf\x00nnh\x00nnk\x00nnm\x00noornod\x00noe\x00non\x00" +
+ "nop\x00nou\x00nqo\x00nrblnrb\x00nsk\x00nsn\x00nso\x00nss\x00ntm\x00ntr" +
+ "\x00nui\x00nup\x00nus\x00nuv\x00nux\x00nvavnwb\x00nxq\x00nxr\x00nyyanym" +
+ "\x00nyn\x00nzi\x00occiogc\x00ojjiokr\x00okv\x00omrmong\x00onn\x00ons\x00" +
+ "opm\x00orrioro\x00oru\x00osssosa\x00ota\x00otk\x00ozm\x00paanpag\x00pal" +
+ "\x00pam\x00pap\x00pau\x00pbi\x00pcd\x00pcm\x00pdc\x00pdt\x00ped\x00peo" +
+ "\x00pex\x00pfl\x00phl\x00phn\x00pilipil\x00pip\x00pka\x00pko\x00plolpla" +
+ "\x00pms\x00png\x00pnn\x00pnt\x00pon\x00ppo\x00pra\x00prd\x00prg\x00psusp" +
+ "ss\x00ptorptp\x00puu\x00pwa\x00quuequc\x00qug\x00rai\x00raj\x00rao\x00rc" +
+ "f\x00rej\x00rel\x00res\x00rgn\x00rhg\x00ria\x00rif\x00rjs\x00rkt\x00rmoh" +
+ "rmf\x00rmo\x00rmt\x00rmu\x00rnunrna\x00rng\x00roonrob\x00rof\x00roo\x00r" +
+ "ro\x00rtm\x00ruusrue\x00rug\x00rw\x00\x04rwk\x00rwo\x00ryu\x00saansaf" +
+ "\x00sah\x00saq\x00sas\x00sat\x00sav\x00saz\x00sba\x00sbe\x00sbp\x00scrds" +
+ "ck\x00scl\x00scn\x00sco\x00scs\x00sdndsdc\x00sdh\x00semesef\x00seh\x00se" +
+ "i\x00ses\x00sgagsga\x00sgs\x00sgw\x00sgz\x00sh\x00\x02shi\x00shk\x00shn" +
+ "\x00shu\x00siinsid\x00sig\x00sil\x00sim\x00sjr\x00sklkskc\x00skr\x00sks" +
+ "\x00sllvsld\x00sli\x00sll\x00sly\x00smmosma\x00smi\x00smj\x00smn\x00smp" +
+ "\x00smq\x00sms\x00snnasnc\x00snk\x00snp\x00snx\x00sny\x00soomsok\x00soq" +
+ "\x00sou\x00soy\x00spd\x00spl\x00sps\x00sqqisrrpsrb\x00srn\x00srr\x00srx" +
+ "\x00ssswssd\x00ssg\x00ssy\x00stotstk\x00stq\x00suunsua\x00sue\x00suk\x00" +
+ "sur\x00sus\x00svweswwaswb\x00swc\x00swg\x00swp\x00swv\x00sxn\x00sxw\x00s" +
+ "yl\x00syr\x00szl\x00taamtaj\x00tal\x00tan\x00taq\x00tbc\x00tbd\x00tbf" +
+ "\x00tbg\x00tbo\x00tbw\x00tbz\x00tci\x00tcy\x00tdd\x00tdg\x00tdh\x00teelt" +
+ "ed\x00tem\x00teo\x00tet\x00tfi\x00tggktgc\x00tgo\x00tgu\x00thhathl\x00th" +
+ "q\x00thr\x00tiirtif\x00tig\x00tik\x00tim\x00tio\x00tiv\x00tkuktkl\x00tkr" +
+ "\x00tkt\x00tlgltlf\x00tlx\x00tly\x00tmh\x00tmy\x00tnsntnh\x00toontof\x00" +
+ "tog\x00toq\x00tpi\x00tpm\x00tpz\x00tqo\x00trurtru\x00trv\x00trw\x00tssot" +
+ "sd\x00tsf\x00tsg\x00tsj\x00tsw\x00ttatttd\x00tte\x00ttj\x00ttr\x00tts" +
+ "\x00ttt\x00tuh\x00tul\x00tum\x00tuq\x00tvd\x00tvl\x00tvu\x00twwitwh\x00t" +
+ "wq\x00txg\x00tyahtya\x00tyv\x00tzm\x00ubu\x00udm\x00ugiguga\x00ukkruli" +
+ "\x00umb\x00und\x00unr\x00unx\x00urrduri\x00urt\x00urw\x00usa\x00utr\x00u" +
+ "vh\x00uvl\x00uzzbvag\x00vai\x00van\x00veenvec\x00vep\x00viievic\x00viv" +
+ "\x00vls\x00vmf\x00vmw\x00voolvot\x00vro\x00vun\x00vut\x00walnwae\x00waj" +
+ "\x00wal\x00wan\x00war\x00wbp\x00wbq\x00wbr\x00wci\x00wer\x00wgi\x00whg" +
+ "\x00wib\x00wiu\x00wiv\x00wja\x00wji\x00wls\x00wmo\x00wnc\x00wni\x00wnu" +
+ "\x00woolwob\x00wos\x00wrs\x00wsk\x00wtm\x00wuu\x00wuv\x00wwa\x00xav\x00x" +
+ "bi\x00xcr\x00xes\x00xhhoxla\x00xlc\x00xld\x00xmf\x00xmn\x00xmr\x00xna" +
+ "\x00xnr\x00xog\x00xon\x00xpr\x00xrb\x00xsa\x00xsi\x00xsm\x00xsr\x00xwe" +
+ "\x00yam\x00yao\x00yap\x00yas\x00yat\x00yav\x00yay\x00yaz\x00yba\x00ybb" +
+ "\x00yby\x00yer\x00ygr\x00ygw\x00yiidyko\x00yle\x00ylg\x00yll\x00yml\x00y" +
+ "ooryon\x00yrb\x00yre\x00yrl\x00yss\x00yua\x00yue\x00yuj\x00yut\x00yuw" +
+ "\x00zahazag\x00zbl\x00zdj\x00zea\x00zgh\x00zhhozhx\x00zia\x00zlm\x00zmi" +
+ "\x00zne\x00zuulzxx\x00zza\x00\xff\xff\xff\xff"
+
+const langNoIndexOffset = 1330
+
+// 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.
+// Size: 2197 bytes, 2197 elements
+var langNoIndex = [2197]uint8{
+ // Entry 0 - 3F
+ 0xff, 0xf8, 0xed, 0xfe, 0xeb, 0xd3, 0x3b, 0xd2,
+ 0xfb, 0xbf, 0x7a, 0xfa, 0x37, 0x1d, 0x3c, 0x57,
+ 0x6e, 0x97, 0x73, 0x38, 0xfb, 0xea, 0xbf, 0x70,
+ 0xad, 0x03, 0xff, 0xff, 0xcf, 0x05, 0x84, 0x62,
+ 0xe9, 0xbf, 0xfd, 0xbf, 0xbf, 0xf7, 0xfd, 0x77,
+ 0x0f, 0xff, 0xef, 0x6f, 0xff, 0xfb, 0xdf, 0xe2,
+ 0xc9, 0xf8, 0x7f, 0x7e, 0x4d, 0xb8, 0x0a, 0x6a,
+ 0x7c, 0xea, 0xe3, 0xfa, 0x7a, 0xbf, 0x67, 0xff,
+ // Entry 40 - 7F
+ 0xff, 0xff, 0xff, 0xdf, 0x2a, 0x54, 0x91, 0xc0,
+ 0x5d, 0xe3, 0x97, 0x14, 0x07, 0x20, 0xdd, 0xed,
+ 0x9f, 0x3f, 0xc9, 0x21, 0xf8, 0x3f, 0x94, 0x35,
+ 0x7c, 0x5f, 0xff, 0x5f, 0x8e, 0x6e, 0xdf, 0xff,
+ 0xff, 0xff, 0x55, 0x7c, 0xd3, 0xfd, 0xbf, 0xb5,
+ 0x7b, 0xdf, 0x7f, 0xf7, 0xca, 0xfe, 0xdb, 0xa3,
+ 0xa8, 0xff, 0x1f, 0x67, 0x7d, 0xeb, 0xef, 0xce,
+ 0xff, 0xff, 0x9f, 0xff, 0xb7, 0xef, 0xfe, 0xcf,
+ // Entry 80 - BF
+ 0xdb, 0xff, 0xf3, 0xcd, 0xfb, 0x2f, 0xff, 0xff,
+ 0xbb, 0xee, 0xf7, 0xbd, 0xdb, 0xff, 0x5f, 0xf7,
+ 0xfd, 0xf2, 0xfd, 0xff, 0x5e, 0x2f, 0x3b, 0xba,
+ 0x7e, 0xff, 0xff, 0xfe, 0xf7, 0xff, 0xdd, 0xff,
+ 0xfd, 0xdf, 0xfb, 0xfe, 0x9d, 0xb4, 0xd3, 0xff,
+ 0xef, 0xff, 0xdf, 0xf7, 0x7f, 0xb7, 0xfd, 0xd5,
+ 0xa5, 0x77, 0x40, 0xff, 0x9c, 0xc1, 0x41, 0x2c,
+ 0x08, 0x21, 0x41, 0x00, 0x50, 0x40, 0x00, 0x80,
+ // Entry C0 - FF
+ 0xfb, 0x4a, 0xf2, 0x9f, 0xb4, 0x42, 0x41, 0x96,
+ 0x1b, 0x14, 0x08, 0xf3, 0x2b, 0xe7, 0x17, 0x56,
+ 0x05, 0x7d, 0x0e, 0x1c, 0x37, 0x7b, 0xf3, 0xef,
+ 0x97, 0xff, 0x5d, 0x38, 0x64, 0x08, 0x00, 0x10,
+ 0xbc, 0x85, 0xaf, 0xdf, 0xff, 0xff, 0x73, 0x35,
+ 0x3e, 0x87, 0xc7, 0xdf, 0xff, 0x01, 0x81, 0x00,
+ 0xb0, 0x05, 0x80, 0x00, 0x00, 0x00, 0x00, 0x03,
+ 0x40, 0x00, 0x40, 0x92, 0x21, 0x50, 0xb1, 0x5d,
+ // Entry 100 - 13F
+ 0xfd, 0xdc, 0xbe, 0x5e, 0x00, 0x00, 0x02, 0x64,
+ 0x0d, 0x19, 0x41, 0xdf, 0x79, 0x22, 0x00, 0x00,
+ 0x00, 0x5e, 0x64, 0xdc, 0x24, 0xe5, 0xd9, 0xe3,
+ 0xfe, 0xff, 0xfd, 0xcb, 0x9f, 0x14, 0x01, 0x0c,
+ 0x86, 0x00, 0xd1, 0x00, 0xf0, 0xc7, 0x67, 0x5f,
+ 0x56, 0x99, 0x5e, 0xb5, 0x6c, 0xaf, 0x03, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0xc0, 0x37, 0xda, 0x56,
+ 0x90, 0x69, 0x01, 0x2c, 0x96, 0x69, 0x20, 0xfb,
+ // Entry 140 - 17F
+ 0xff, 0x3f, 0x00, 0x00, 0x00, 0x01, 0x0c, 0x16,
+ 0x03, 0x00, 0x00, 0xb0, 0x14, 0x03, 0x50, 0x06,
+ 0x0a, 0x00, 0x01, 0x00, 0x00, 0x10, 0x11, 0x09,
+ 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x10,
+ 0x00, 0x00, 0x44, 0x00, 0x00, 0x10, 0x00, 0x04,
+ 0x08, 0x00, 0x00, 0x04, 0x00, 0x80, 0x28, 0x04,
+ 0x00, 0x00, 0x40, 0xd5, 0x2d, 0x00, 0x64, 0x35,
+ 0x24, 0x52, 0xf4, 0xd4, 0xbd, 0x62, 0xc9, 0x03,
+ // Entry 180 - 1BF
+ 0x00, 0x80, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0x13, 0x39, 0x01, 0xdd, 0x57, 0x98,
+ 0x21, 0x18, 0x81, 0x00, 0x00, 0x01, 0x40, 0x82,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x40, 0x00, 0x44, 0x00, 0x00, 0x80, 0xea,
+ 0xa9, 0x39, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+ // Entry 1C0 - 1FF
+ 0x00, 0x03, 0x28, 0x05, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x20, 0x04, 0xa6, 0x00, 0x04, 0x00, 0x00,
+ 0x81, 0x50, 0x00, 0x00, 0x00, 0x11, 0x84, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x55,
+ 0x02, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x40,
+ 0x30, 0x83, 0x01, 0x00, 0x00, 0x00, 0x11, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x1e, 0xcd, 0xbf, 0x7a, 0xbf,
+ // Entry 200 - 23F
+ 0xdf, 0xc3, 0x83, 0x82, 0xc0, 0xfb, 0x57, 0x27,
+ 0xed, 0x55, 0xe7, 0x01, 0x00, 0x20, 0xb2, 0xc5,
+ 0xa4, 0x45, 0x25, 0x9b, 0x02, 0xdf, 0xe0, 0xdf,
+ 0x03, 0x44, 0x08, 0x90, 0x01, 0x04, 0x01, 0xe3,
+ 0x92, 0x54, 0xdb, 0x28, 0xd3, 0x5f, 0xfe, 0x6d,
+ 0x79, 0xed, 0x1c, 0x7d, 0x04, 0x08, 0x00, 0x01,
+ 0x21, 0x12, 0x64, 0x5f, 0xdd, 0x0e, 0x85, 0x4f,
+ 0x40, 0x40, 0x00, 0x04, 0xf1, 0xfd, 0x3d, 0x54,
+ // Entry 240 - 27F
+ 0xe8, 0x03, 0xb4, 0x27, 0x23, 0x0d, 0x00, 0x00,
+ 0x20, 0x7b, 0x78, 0x02, 0x05, 0x84, 0x00, 0xf0,
+ 0xbb, 0x7e, 0x5a, 0x00, 0x18, 0x04, 0x81, 0x00,
+ 0x00, 0x00, 0x80, 0x10, 0x90, 0x1c, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, 0x00, 0x04,
+ 0x08, 0xa0, 0x70, 0xa5, 0x0c, 0x40, 0x00, 0x00,
+ 0x11, 0x24, 0x04, 0x68, 0x00, 0x20, 0x70, 0xff,
+ 0x7b, 0x7f, 0x70, 0x00, 0x05, 0x9b, 0xdd, 0x66,
+ // Entry 280 - 2BF
+ 0x03, 0x00, 0x11, 0x00, 0x00, 0x00, 0x40, 0x05,
+ 0xb5, 0xb6, 0x80, 0x08, 0x04, 0x00, 0x04, 0x51,
+ 0xe2, 0xef, 0xfd, 0x3f, 0x05, 0x09, 0x08, 0x05,
+ 0x40, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x0c, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x60,
+ 0xe7, 0x48, 0x00, 0x81, 0x20, 0xc0, 0x05, 0x80,
+ 0x03, 0x00, 0x00, 0x00, 0x8c, 0x50, 0x40, 0x04,
+ 0x84, 0x47, 0x84, 0x40, 0x20, 0x10, 0x00, 0x20,
+ // Entry 2C0 - 2FF
+ 0x02, 0x50, 0x80, 0x11, 0x00, 0x91, 0x6c, 0xe2,
+ 0x50, 0x27, 0x1d, 0x11, 0x29, 0x06, 0x59, 0xe9,
+ 0x33, 0x08, 0x00, 0x20, 0x04, 0x40, 0x10, 0x00,
+ 0x00, 0x00, 0x50, 0x44, 0x92, 0x49, 0xd6, 0x5d,
+ 0xa7, 0x81, 0x47, 0x97, 0xfb, 0x00, 0x10, 0x00,
+ 0x08, 0x00, 0x80, 0x00, 0x40, 0x04, 0x00, 0x01,
+ 0x02, 0x00, 0x01, 0x40, 0x80, 0x00, 0x00, 0x08,
+ 0xd8, 0xeb, 0xf6, 0x39, 0xc4, 0x89, 0x12, 0x00,
+ // Entry 300 - 33F
+ 0x00, 0x0c, 0x04, 0x01, 0x20, 0x20, 0xdd, 0xa0,
+ 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
+ 0x04, 0x10, 0xd0, 0x9d, 0x95, 0x13, 0x04, 0x80,
+ 0x00, 0x01, 0xd0, 0x12, 0x40, 0x00, 0x10, 0xb0,
+ 0x10, 0x62, 0x4c, 0xd2, 0x02, 0x01, 0x4a, 0x00,
+ 0x46, 0x04, 0x00, 0x08, 0x02, 0x00, 0x20, 0x80,
+ 0x00, 0x80, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0xd8, 0x6f, 0x15, 0x02, 0x08, 0x00,
+ // Entry 340 - 37F
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01,
+ 0x00, 0x10, 0x00, 0x00, 0x00, 0xf0, 0x84, 0xe3,
+ 0xdd, 0xbf, 0xf9, 0xf9, 0x3b, 0x7f, 0x7f, 0xdb,
+ 0xfd, 0xfc, 0xfe, 0xdf, 0xff, 0xfd, 0xff, 0xf6,
+ 0xfb, 0xfc, 0xf7, 0x1f, 0xff, 0xb3, 0x6c, 0xff,
+ 0xd9, 0xad, 0xdf, 0xfe, 0xef, 0xba, 0xdf, 0xff,
+ 0xff, 0xff, 0xb7, 0xdd, 0x7d, 0xbf, 0xab, 0x7f,
+ 0xfd, 0xfd, 0xdf, 0x2f, 0x9c, 0xdf, 0xf3, 0x6f,
+ // Entry 380 - 3BF
+ 0xdf, 0xdd, 0xff, 0xfb, 0xee, 0xd2, 0xab, 0x5f,
+ 0xd5, 0xdf, 0x7f, 0xff, 0xeb, 0xff, 0xe4, 0x4d,
+ 0xf9, 0xff, 0xfe, 0xf7, 0xfd, 0xdf, 0xfb, 0xbf,
+ 0xee, 0xdb, 0x6f, 0xef, 0xff, 0x7f, 0xff, 0xff,
+ 0xf7, 0x5f, 0xd3, 0x3b, 0xfd, 0xd9, 0xdf, 0xeb,
+ 0xbc, 0x08, 0x05, 0x24, 0xff, 0x07, 0x70, 0xfe,
+ 0xe6, 0x5e, 0x00, 0x08, 0x00, 0x83, 0x3d, 0x1b,
+ 0x06, 0xe6, 0x72, 0x60, 0xd1, 0x3c, 0x7f, 0x44,
+ // Entry 3C0 - 3FF
+ 0x02, 0x30, 0x9f, 0x7a, 0x16, 0xbd, 0x7f, 0x57,
+ 0xf2, 0xff, 0x31, 0xff, 0xf2, 0x1e, 0x90, 0xf7,
+ 0xf1, 0xf9, 0x45, 0x80, 0x01, 0x02, 0x00, 0x00,
+ 0x40, 0x54, 0x9f, 0x8a, 0xd9, 0xf9, 0x2e, 0x11,
+ 0x86, 0x51, 0xc0, 0xf3, 0xfb, 0x47, 0x40, 0x01,
+ 0x05, 0xd1, 0x50, 0x5c, 0x00, 0x00, 0x00, 0x10,
+ 0x04, 0x02, 0x00, 0x00, 0x0a, 0x00, 0x17, 0xd2,
+ 0xb9, 0xfd, 0xfc, 0xba, 0xfe, 0xef, 0xc7, 0xbe,
+ // Entry 400 - 43F
+ 0x53, 0x6f, 0xdf, 0xe7, 0xdb, 0x65, 0xbb, 0x7f,
+ 0xfa, 0xff, 0x77, 0xf3, 0xef, 0xbf, 0xfd, 0xf7,
+ 0xdf, 0xdf, 0x9b, 0x7f, 0xff, 0xff, 0x7f, 0x6f,
+ 0xf7, 0xfb, 0xeb, 0xdf, 0xbc, 0xff, 0xbf, 0x6b,
+ 0x7b, 0xfb, 0xff, 0xce, 0x76, 0xbd, 0xf7, 0xf7,
+ 0xdf, 0xdc, 0xf7, 0xf7, 0xff, 0xdf, 0xf3, 0xfe,
+ 0xef, 0xff, 0xff, 0xff, 0xb6, 0x7f, 0x7f, 0xde,
+ 0xf7, 0xb9, 0xeb, 0x77, 0xff, 0xfb, 0xbf, 0xdf,
+ // Entry 440 - 47F
+ 0xfd, 0xfe, 0xfb, 0xff, 0xfe, 0xeb, 0x1f, 0x7d,
+ 0x2f, 0xfd, 0xb6, 0xb5, 0xa5, 0xfc, 0xff, 0xfd,
+ 0x7f, 0x4e, 0xbf, 0x8f, 0xae, 0xff, 0xee, 0xdf,
+ 0x7f, 0xf7, 0x73, 0x02, 0x02, 0x04, 0xfc, 0xf7,
+ 0xff, 0xb7, 0xd7, 0xef, 0xfe, 0xcd, 0xf5, 0xce,
+ 0xe2, 0x8e, 0xe7, 0xbf, 0xb7, 0xff, 0x56, 0xfd,
+ 0xcd, 0xff, 0xfb, 0xff, 0xdf, 0xd7, 0xea, 0xff,
+ 0xe5, 0x5f, 0x6d, 0x0f, 0xa7, 0x51, 0x06, 0xc4,
+ // Entry 480 - 4BF
+ 0x13, 0x50, 0x5d, 0xaf, 0xa6, 0xff, 0x99, 0xfb,
+ 0x63, 0x1d, 0x53, 0xff, 0xef, 0xb7, 0x35, 0x20,
+ 0x14, 0x00, 0x55, 0x51, 0x82, 0x65, 0xf5, 0x41,
+ 0xe2, 0xff, 0xfc, 0xdf, 0x02, 0x05, 0xc5, 0x05,
+ 0x00, 0x22, 0x00, 0x74, 0x69, 0x10, 0x08, 0x04,
+ 0x41, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x51, 0x20, 0x05, 0x04, 0x01, 0x00, 0x00,
+ 0x06, 0x01, 0x20, 0x00, 0x18, 0x01, 0x92, 0xb1,
+ // Entry 4C0 - 4FF
+ 0xfd, 0x47, 0x49, 0x06, 0x95, 0x06, 0x57, 0xed,
+ 0xfb, 0x4c, 0x1c, 0x6b, 0x83, 0x04, 0x62, 0x40,
+ 0x00, 0x11, 0x42, 0x00, 0x00, 0x00, 0x54, 0x83,
+ 0xb8, 0x4f, 0x10, 0x8c, 0x89, 0x46, 0xde, 0xf7,
+ 0x13, 0x31, 0x00, 0x20, 0x00, 0x00, 0x00, 0x90,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x10, 0x00,
+ 0x01, 0x00, 0x00, 0xf0, 0x5b, 0xf4, 0xbe, 0x3d,
+ 0xbe, 0xcf, 0xf7, 0xaf, 0x42, 0x04, 0x84, 0x41,
+ // Entry 500 - 53F
+ 0x30, 0xff, 0x79, 0x72, 0x04, 0x00, 0x00, 0x49,
+ 0x2d, 0x14, 0x27, 0x57, 0xed, 0xf1, 0x3f, 0xe7,
+ 0x3f, 0x00, 0x00, 0x02, 0xc6, 0xa0, 0x1e, 0xf8,
+ 0xbb, 0xff, 0xfd, 0xfb, 0xb7, 0xfd, 0xe7, 0xf7,
+ 0xfd, 0xfc, 0xd5, 0xed, 0x47, 0xf4, 0x7e, 0x10,
+ 0x01, 0x01, 0x84, 0x6d, 0xff, 0xf7, 0xdd, 0xf9,
+ 0x5b, 0x05, 0x86, 0xed, 0xf5, 0x77, 0xbd, 0x3c,
+ 0x00, 0x00, 0x00, 0x42, 0x71, 0x42, 0x00, 0x40,
+ // Entry 540 - 57F
+ 0x00, 0x00, 0x01, 0x43, 0x19, 0x00, 0x08, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ // Entry 580 - 5BF
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xab, 0xbd, 0xe7, 0x57, 0xee, 0x13, 0x5d,
+ 0x09, 0xc1, 0x40, 0x21, 0xfa, 0x17, 0x01, 0x80,
+ 0x00, 0x00, 0x00, 0x00, 0xf0, 0xce, 0xfb, 0xbf,
+ 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x30, 0x15, 0xa3, 0x10, 0x00, 0x00, 0x00,
+ 0x11, 0x04, 0x16, 0x00, 0x00, 0x02, 0x00, 0x81,
+ 0xa3, 0x01, 0x50, 0x00, 0x00, 0x83, 0x11, 0x40,
+ // Entry 5C0 - 5FF
+ 0x00, 0x00, 0x00, 0xf0, 0xdd, 0x7b, 0x3e, 0x02,
+ 0xaa, 0x10, 0x5d, 0x98, 0x52, 0x00, 0x80, 0x20,
+ 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x02,
+ 0x19, 0x00, 0x10, 0x02, 0x10, 0x61, 0x5a, 0x9d,
+ 0x31, 0x00, 0x00, 0x00, 0x01, 0x10, 0x02, 0x20,
+ 0x00, 0x00, 0x01, 0x00, 0x42, 0x00, 0x20, 0x00,
+ 0x00, 0x1f, 0xdf, 0xd2, 0xb9, 0xff, 0xfd, 0x3f,
+ 0x1f, 0x98, 0xcf, 0x9c, 0xff, 0xaf, 0x5f, 0xfe,
+ // Entry 600 - 63F
+ 0x7b, 0x4b, 0x40, 0x10, 0xe1, 0xfd, 0xaf, 0xd9,
+ 0xb7, 0xf6, 0xfb, 0xb3, 0xc7, 0xff, 0x6f, 0xf1,
+ 0x73, 0xb1, 0x7f, 0x9f, 0x7f, 0xbd, 0xfc, 0xb7,
+ 0xee, 0x1c, 0xfa, 0xcb, 0xef, 0xdd, 0xf9, 0xbd,
+ 0x6e, 0xae, 0x55, 0xfd, 0x6e, 0x81, 0x76, 0x1f,
+ 0xd4, 0x77, 0xf5, 0x7d, 0xfb, 0xff, 0xeb, 0xfe,
+ 0xbe, 0x5f, 0x46, 0x1b, 0xe9, 0x5f, 0x50, 0x18,
+ 0x02, 0xfa, 0xf7, 0x9d, 0x15, 0x97, 0x05, 0x0f,
+ // Entry 640 - 67F
+ 0x75, 0xc4, 0x7d, 0x81, 0x92, 0xf5, 0x57, 0x6c,
+ 0xff, 0xe4, 0xef, 0x6f, 0xff, 0xfc, 0xdd, 0xde,
+ 0xfc, 0xfd, 0x76, 0x5f, 0x7a, 0x3f, 0x00, 0x98,
+ 0x02, 0xfb, 0xa3, 0xef, 0xf3, 0xd6, 0xf2, 0xff,
+ 0xb9, 0xda, 0x7d, 0xd0, 0x3e, 0x15, 0x7b, 0xb4,
+ 0xf5, 0x3e, 0xff, 0xff, 0xf1, 0xf7, 0xff, 0xe7,
+ 0x5f, 0xff, 0xff, 0x9e, 0xdb, 0xf6, 0xd7, 0xb9,
+ 0xef, 0x27, 0x80, 0xbb, 0xc5, 0xff, 0xff, 0xe3,
+ // Entry 680 - 6BF
+ 0x97, 0x9d, 0xbf, 0x9f, 0xf7, 0xc7, 0xfd, 0x37,
+ 0xce, 0x7f, 0x04, 0x1d, 0x73, 0x7f, 0xf8, 0xda,
+ 0x5d, 0xce, 0x7d, 0x06, 0xb9, 0xea, 0x69, 0xa0,
+ 0x1a, 0x20, 0x00, 0x30, 0x02, 0x04, 0x24, 0x08,
+ 0x04, 0x00, 0x00, 0x40, 0xd4, 0x02, 0x04, 0x00,
+ 0x00, 0x04, 0x00, 0x04, 0x00, 0x20, 0x01, 0x06,
+ 0x50, 0x00, 0x08, 0x00, 0x00, 0x00, 0x24, 0x00,
+ 0x04, 0x00, 0x10, 0xdc, 0x58, 0xd7, 0x0d, 0x0f,
+ // Entry 6C0 - 6FF
+ 0x14, 0x4d, 0xf1, 0x16, 0x44, 0xd1, 0x42, 0x08,
+ 0x40, 0x00, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0xdc, 0xfb, 0xcb, 0x0e, 0x58, 0x48, 0x41,
+ 0x24, 0x20, 0x04, 0x00, 0x30, 0x12, 0x40, 0x00,
+ 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x80, 0x10, 0x10, 0xab,
+ 0x6d, 0x93, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x80, 0x25, 0x00, 0x00,
+ // Entry 700 - 73F
+ 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
+ 0x80, 0x86, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0xdf, 0x18, 0x00, 0x00, 0x02, 0xf0, 0xfd, 0x79,
+ 0x3b, 0x00, 0x25, 0x00, 0x00, 0x00, 0x02, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
+ 0x03, 0x00, 0x09, 0x20, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // Entry 740 - 77F
+ 0x00, 0x00, 0x00, 0xef, 0xd5, 0xfd, 0xcf, 0x7e,
+ 0xb0, 0x11, 0x00, 0x00, 0x00, 0x92, 0x01, 0x44,
+ 0xcd, 0xf9, 0x5c, 0x00, 0x01, 0x00, 0x30, 0x04,
+ 0x04, 0x55, 0x00, 0x01, 0x04, 0xf4, 0x3f, 0x4a,
+ 0x01, 0x00, 0x00, 0xb0, 0x80, 0x20, 0x55, 0x75,
+ 0x97, 0x7c, 0x9f, 0x31, 0xcc, 0x68, 0xd1, 0x03,
+ 0xd5, 0x57, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x2c, 0xf7, 0xcb, 0x1f, 0x14, 0x60,
+ // Entry 780 - 7BF
+ 0x03, 0x68, 0x01, 0x10, 0x8b, 0x38, 0x8a, 0x01,
+ 0x00, 0x00, 0x20, 0x00, 0x24, 0x44, 0x00, 0x00,
+ 0x10, 0x03, 0x11, 0x02, 0x01, 0x00, 0x00, 0xf0,
+ 0xf5, 0xff, 0xd5, 0x97, 0xbc, 0x70, 0xd6, 0x78,
+ 0x78, 0x15, 0x50, 0x01, 0xa4, 0x84, 0xa9, 0x41,
+ 0x00, 0x00, 0x00, 0x6b, 0x39, 0x52, 0x74, 0x00,
+ 0xe8, 0x30, 0x90, 0x6a, 0x92, 0x00, 0x00, 0x02,
+ 0xff, 0xef, 0xff, 0x4b, 0x85, 0x53, 0xf4, 0xed,
+ // Entry 7C0 - 7FF
+ 0xdd, 0xbf, 0x72, 0x1d, 0xc7, 0x0c, 0xd5, 0x42,
+ 0xfc, 0xff, 0xf7, 0x1f, 0x00, 0x80, 0x40, 0x56,
+ 0xcc, 0x16, 0x9e, 0xea, 0x35, 0x7d, 0xef, 0xff,
+ 0xbd, 0xa4, 0xaf, 0x01, 0x44, 0x18, 0x01, 0x4d,
+ 0x4e, 0x4a, 0x08, 0x50, 0x28, 0x30, 0xe0, 0x80,
+ 0x10, 0x20, 0x24, 0x00, 0xff, 0x2f, 0xd3, 0x60,
+ 0xfe, 0x01, 0x02, 0x88, 0x0a, 0x40, 0x16, 0x01,
+ 0x01, 0x15, 0x2b, 0x3c, 0x01, 0x00, 0x00, 0x10,
+ // Entry 800 - 83F
+ 0x90, 0x49, 0x41, 0x02, 0x02, 0x01, 0xe1, 0xbf,
+ 0xbf, 0x03, 0x00, 0x00, 0x10, 0xd4, 0xa3, 0xd1,
+ 0x40, 0x9c, 0x44, 0xdf, 0xf5, 0x8f, 0x66, 0xb3,
+ 0x55, 0x20, 0xd4, 0xc1, 0xd8, 0x30, 0x3d, 0x80,
+ 0x00, 0x00, 0x00, 0x04, 0xd4, 0x11, 0xc5, 0x84,
+ 0x2e, 0x50, 0x00, 0x22, 0x50, 0x6e, 0xbd, 0x93,
+ 0x07, 0x00, 0x20, 0x10, 0x84, 0xb2, 0x45, 0x10,
+ 0x06, 0x44, 0x00, 0x00, 0x12, 0x02, 0x11, 0x00,
+ // Entry 840 - 87F
+ 0xf0, 0xfb, 0xfd, 0x7f, 0x05, 0x00, 0x12, 0x81,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02,
+ 0x00, 0x00, 0x00, 0x00, 0x03, 0x30, 0x02, 0x28,
+ 0x84, 0x00, 0x21, 0xc0, 0x23, 0x24, 0x00, 0x00,
+ 0x00, 0xcb, 0xe4, 0x3a, 0x42, 0x88, 0x14, 0xf1,
+ 0xef, 0xff, 0x7f, 0x12, 0x01, 0x01, 0x84, 0x50,
+ 0x07, 0xfc, 0xff, 0xff, 0x0f, 0x01, 0x00, 0x40,
+ 0x10, 0x38, 0x01, 0x01, 0x1c, 0x12, 0x40, 0xe1,
+ // Entry 880 - 8BF
+ 0x76, 0x16, 0x08, 0x03, 0x10, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x24,
+ 0x0a, 0x00, 0x80, 0x00, 0x00,
+}
+
+// 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.
+const altLangISO3 tag.Index = "---\x00cor\x00hbs\x01heb\x02kin\x03spa\x04yid\x05\xff\xff\xff\xff"
+
+// altLangIndex is used to convert indexes in altLangISO3 to langIDs.
+// Size: 12 bytes, 6 elements
+var altLangIndex = [6]uint16{
+ 0x0281, 0x0407, 0x01fb, 0x03e5, 0x013e, 0x0208,
+}
+
+// AliasMap maps langIDs to their suggested replacements.
+// Size: 704 bytes, 176 elements
+var AliasMap = [176]FromTo{
+ 0: {From: 0x82, To: 0x88},
+ 1: {From: 0x187, To: 0x1ae},
+ 2: {From: 0x1f3, To: 0x1e1},
+ 3: {From: 0x1fb, To: 0x1bc},
+ 4: {From: 0x208, To: 0x512},
+ 5: {From: 0x20f, To: 0x20e},
+ 6: {From: 0x310, To: 0x3dc},
+ 7: {From: 0x347, To: 0x36f},
+ 8: {From: 0x407, To: 0x432},
+ 9: {From: 0x47a, To: 0x153},
+ 10: {From: 0x490, To: 0x451},
+ 11: {From: 0x4a2, To: 0x21},
+ 12: {From: 0x53e, To: 0x544},
+ 13: {From: 0x58f, To: 0x12d},
+ 14: {From: 0x630, To: 0x1eb1},
+ 15: {From: 0x651, To: 0x431},
+ 16: {From: 0x662, To: 0x431},
+ 17: {From: 0x6ed, To: 0x3a},
+ 18: {From: 0x6f8, To: 0x1d7},
+ 19: {From: 0x709, To: 0x3625},
+ 20: {From: 0x73e, To: 0x21a1},
+ 21: {From: 0x7b3, To: 0x56},
+ 22: {From: 0x7b9, To: 0x299b},
+ 23: {From: 0x7c5, To: 0x58},
+ 24: {From: 0x7e6, To: 0x145},
+ 25: {From: 0x80c, To: 0x5a},
+ 26: {From: 0x815, To: 0x8d},
+ 27: {From: 0x87e, To: 0x810},
+ 28: {From: 0x8c3, To: 0xee3},
+ 29: {From: 0x9ef, To: 0x331},
+ 30: {From: 0xa36, To: 0x2c5},
+ 31: {From: 0xa3d, To: 0xbf},
+ 32: {From: 0xabe, To: 0x3322},
+ 33: {From: 0xb38, To: 0x529},
+ 34: {From: 0xb75, To: 0x265a},
+ 35: {From: 0xb7e, To: 0xbc3},
+ 36: {From: 0xb9b, To: 0x44e},
+ 37: {From: 0xbbc, To: 0x4229},
+ 38: {From: 0xbbf, To: 0x529},
+ 39: {From: 0xbfe, To: 0x2da7},
+ 40: {From: 0xc2e, To: 0x3181},
+ 41: {From: 0xcb9, To: 0xf3},
+ 42: {From: 0xd08, To: 0xfa},
+ 43: {From: 0xdc8, To: 0x11a},
+ 44: {From: 0xdd7, To: 0x32d},
+ 45: {From: 0xdf8, To: 0xdfb},
+ 46: {From: 0xdfe, To: 0x531},
+ 47: {From: 0xe01, To: 0xdf3},
+ 48: {From: 0xedf, To: 0x205a},
+ 49: {From: 0xee9, To: 0x222e},
+ 50: {From: 0xeee, To: 0x2e9a},
+ 51: {From: 0xf39, To: 0x367},
+ 52: {From: 0x10d0, To: 0x140},
+ 53: {From: 0x1104, To: 0x2d0},
+ 54: {From: 0x11a0, To: 0x1ec},
+ 55: {From: 0x1279, To: 0x21},
+ 56: {From: 0x1424, To: 0x15e},
+ 57: {From: 0x1470, To: 0x14e},
+ 58: {From: 0x151f, To: 0xd9b},
+ 59: {From: 0x1523, To: 0x390},
+ 60: {From: 0x1532, To: 0x19f},
+ 61: {From: 0x1580, To: 0x210},
+ 62: {From: 0x1583, To: 0x10d},
+ 63: {From: 0x15a3, To: 0x3caf},
+ 64: {From: 0x1630, To: 0x222e},
+ 65: {From: 0x166a, To: 0x19b},
+ 66: {From: 0x16c8, To: 0x136},
+ 67: {From: 0x1700, To: 0x29f8},
+ 68: {From: 0x1718, To: 0x194},
+ 69: {From: 0x1727, To: 0xf3f},
+ 70: {From: 0x177a, To: 0x178},
+ 71: {From: 0x1809, To: 0x17b6},
+ 72: {From: 0x1816, To: 0x18f3},
+ 73: {From: 0x188a, To: 0x436},
+ 74: {From: 0x1979, To: 0x1d01},
+ 75: {From: 0x1a74, To: 0x2bb0},
+ 76: {From: 0x1a8a, To: 0x1f8},
+ 77: {From: 0x1b5a, To: 0x1fa},
+ 78: {From: 0x1b86, To: 0x1515},
+ 79: {From: 0x1d64, To: 0x2c9b},
+ 80: {From: 0x2038, To: 0x37b1},
+ 81: {From: 0x203d, To: 0x20dd},
+ 82: {From: 0x205a, To: 0x30b},
+ 83: {From: 0x20e3, To: 0x274},
+ 84: {From: 0x20ee, To: 0x263},
+ 85: {From: 0x20f2, To: 0x22d},
+ 86: {From: 0x20f9, To: 0x256},
+ 87: {From: 0x210f, To: 0x21eb},
+ 88: {From: 0x2135, To: 0x27d},
+ 89: {From: 0x2160, To: 0x913},
+ 90: {From: 0x2199, To: 0x121},
+ 91: {From: 0x21ce, To: 0x1561},
+ 92: {From: 0x21e6, To: 0x504},
+ 93: {From: 0x21f4, To: 0x49f},
+ 94: {From: 0x21fb, To: 0x269},
+ 95: {From: 0x222d, To: 0x121},
+ 96: {From: 0x2237, To: 0x121},
+ 97: {From: 0x2262, To: 0x92a},
+ 98: {From: 0x2316, To: 0x3226},
+ 99: {From: 0x236a, To: 0x2835},
+ 100: {From: 0x2382, To: 0x3365},
+ 101: {From: 0x2472, To: 0x2c7},
+ 102: {From: 0x24e4, To: 0x2ff},
+ 103: {From: 0x24f0, To: 0x2fa},
+ 104: {From: 0x24fa, To: 0x31f},
+ 105: {From: 0x2550, To: 0xb5b},
+ 106: {From: 0x25a9, To: 0xe2},
+ 107: {From: 0x263e, To: 0x2d0},
+ 108: {From: 0x26c9, To: 0x26b4},
+ 109: {From: 0x26f9, To: 0x3c8},
+ 110: {From: 0x2727, To: 0x3caf},
+ 111: {From: 0x2755, To: 0x6a4},
+ 112: {From: 0x2765, To: 0x26b4},
+ 113: {From: 0x2789, To: 0x4358},
+ 114: {From: 0x27c9, To: 0x2001},
+ 115: {From: 0x28ea, To: 0x27b1},
+ 116: {From: 0x28ef, To: 0x2837},
+ 117: {From: 0x2914, To: 0x351},
+ 118: {From: 0x2986, To: 0x2da7},
+ 119: {From: 0x29f0, To: 0x96b},
+ 120: {From: 0x2b1a, To: 0x38d},
+ 121: {From: 0x2bfc, To: 0x395},
+ 122: {From: 0x2c3f, To: 0x3caf},
+ 123: {From: 0x2cfc, To: 0x3be},
+ 124: {From: 0x2d13, To: 0x597},
+ 125: {From: 0x2d47, To: 0x148},
+ 126: {From: 0x2d48, To: 0x148},
+ 127: {From: 0x2dff, To: 0x2f1},
+ 128: {From: 0x2e08, To: 0x19cc},
+ 129: {From: 0x2e1a, To: 0x2d95},
+ 130: {From: 0x2e21, To: 0x292},
+ 131: {From: 0x2e54, To: 0x7d},
+ 132: {From: 0x2e65, To: 0x2282},
+ 133: {From: 0x2ea0, To: 0x2e9b},
+ 134: {From: 0x2eef, To: 0x2ed7},
+ 135: {From: 0x3193, To: 0x3c4},
+ 136: {From: 0x3366, To: 0x338e},
+ 137: {From: 0x342a, To: 0x3dc},
+ 138: {From: 0x34ee, To: 0x18d0},
+ 139: {From: 0x35c8, To: 0x2c9b},
+ 140: {From: 0x35e6, To: 0x412},
+ 141: {From: 0x3658, To: 0x246},
+ 142: {From: 0x3676, To: 0x3f4},
+ 143: {From: 0x36fd, To: 0x445},
+ 144: {From: 0x37c0, To: 0x121},
+ 145: {From: 0x3816, To: 0x38f2},
+ 146: {From: 0x382a, To: 0x2b48},
+ 147: {From: 0x382b, To: 0x2c9b},
+ 148: {From: 0x382f, To: 0xa9},
+ 149: {From: 0x3832, To: 0x3228},
+ 150: {From: 0x386c, To: 0x39a6},
+ 151: {From: 0x3892, To: 0x3fc0},
+ 152: {From: 0x38a5, To: 0x39d7},
+ 153: {From: 0x38b4, To: 0x1fa4},
+ 154: {From: 0x38b5, To: 0x2e9a},
+ 155: {From: 0x395c, To: 0x47e},
+ 156: {From: 0x3b4e, To: 0xd91},
+ 157: {From: 0x3b78, To: 0x137},
+ 158: {From: 0x3c99, To: 0x4bc},
+ 159: {From: 0x3fbd, To: 0x100},
+ 160: {From: 0x4208, To: 0xa91},
+ 161: {From: 0x42be, To: 0x573},
+ 162: {From: 0x42f9, To: 0x3f60},
+ 163: {From: 0x4378, To: 0x25a},
+ 164: {From: 0x43b8, To: 0xe6c},
+ 165: {From: 0x43cd, To: 0x10f},
+ 166: {From: 0x44af, To: 0x3322},
+ 167: {From: 0x44e3, To: 0x512},
+ 168: {From: 0x45ca, To: 0x2409},
+ 169: {From: 0x45dd, To: 0x26dc},
+ 170: {From: 0x4610, To: 0x48ae},
+ 171: {From: 0x46ae, To: 0x46a0},
+ 172: {From: 0x473e, To: 0x4745},
+ 173: {From: 0x4817, To: 0x3503},
+ 174: {From: 0x4916, To: 0x31f},
+ 175: {From: 0x49a7, To: 0x523},
+}
+
+// Size: 176 bytes, 176 elements
+var AliasTypes = [176]AliasType{
+ // Entry 0 - 3F
+ 1, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 1, 0, 0, 1, 2,
+ 1, 1, 2, 0, 0, 1, 0, 1, 2, 1, 1, 0, 0, 2, 1, 1,
+ 0, 2, 0, 0, 1, 0, 1, 0, 0, 1, 2, 1, 1, 1, 1, 0,
+ 0, 0, 0, 2, 1, 1, 1, 1, 2, 1, 0, 1, 1, 2, 2, 0,
+ // Entry 40 - 7F
+ 0, 1, 2, 0, 1, 0, 1, 1, 1, 1, 0, 0, 2, 1, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 0, 1, 2, 2, 2, 0, 1, 1, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 2, 1, 1,
+ // Entry 80 - BF
+ 0, 0, 1, 0, 0, 0, 0, 1, 1, 2, 0, 0, 2, 1, 1, 1,
+ 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 2,
+ 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1,
+}
+
+const (
+ _Latn = 90
+ _Hani = 57
+ _Hans = 59
+ _Hant = 60
+ _Qaaa = 143
+ _Qaai = 151
+ _Qabx = 192
+ _Zinh = 245
+ _Zyyy = 250
+ _Zzzz = 251
+)
+
+// 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.
+const script tag.Index = "" + // Size: 1012 bytes
+ "----AdlmAfakAghbAhomArabAranArmiArmnAvstBaliBamuBassBatkBengBhksBlisBopo" +
+ "BrahBraiBugiBuhdCakmCansCariChamCherChrsCirtCoptCpmnCprtCyrlCyrsDevaDiak" +
+ "DogrDsrtDuplEgydEgyhEgypElbaElymEthiGeokGeorGlagGongGonmGothGranGrekGujr" +
+ "GuruHanbHangHaniHanoHansHantHatrHebrHiraHluwHmngHmnpHrktHungIndsItalJamo" +
+ "JavaJpanJurcKaliKanaKharKhmrKhojKitlKitsKndaKoreKpelKthiLanaLaooLatfLatg" +
+ "LatnLekeLepcLimbLinaLinbLisuLomaLyciLydiMahjMakaMandManiMarcMayaMedfMend" +
+ "MercMeroMlymModiMongMoonMrooMteiMultMymrNandNarbNbatNewaNkdbNkgbNkooNshu" +
+ "OgamOlckOrkhOryaOsgeOsmaPalmPaucPermPhagPhliPhlpPhlvPhnxPiqdPlrdPrtiQaaa" +
+ "QaabQaacQaadQaaeQaafQaagQaahQaaiQaajQaakQaalQaamQaanQaaoQaapQaaqQaarQaas" +
+ "QaatQaauQaavQaawQaaxQaayQaazQabaQabbQabcQabdQabeQabfQabgQabhQabiQabjQabk" +
+ "QablQabmQabnQaboQabpQabqQabrQabsQabtQabuQabvQabwQabxRjngRohgRoroRunrSamr" +
+ "SaraSarbSaurSgnwShawShrdShuiSiddSindSinhSogdSogoSoraSoyoSundSyloSyrcSyre" +
+ "SyrjSyrnTagbTakrTaleTaluTamlTangTavtTeluTengTfngTglgThaaThaiTibtTirhToto" +
+ "UgarVaiiVispWaraWchoWoleXpeoXsuxYeziYiiiZanbZinhZmthZsyeZsymZxxxZyyyZzzz" +
+ "\xff\xff\xff\xff"
+
+// 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.
+// Size: 1330 bytes, 1330 elements
+var suppressScript = [1330]uint8{
+ // Entry 0 - 3F
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // Entry 40 - 7F
+ 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
+ // Entry 80 - BF
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // Entry C0 - FF
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // Entry 100 - 13F
+ 0x5a, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xe5, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00,
+ 0x00, 0x5a, 0x00, 0x00, 0x5a, 0x00, 0x5a, 0x00,
+ // Entry 140 - 17F
+ 0x5a, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00,
+ 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x5a, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00,
+ 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00,
+ 0x00, 0x5a, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x5a, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // Entry 180 - 1BF
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5a, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x5a, 0x35, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x22, 0x00,
+ // Entry 1C0 - 1FF
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x5a, 0x5a, 0x00, 0x5a, 0x5a, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00,
+ 0x5a, 0x5a, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00,
+ // Entry 200 - 23F
+ 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // Entry 240 - 27F
+ 0x00, 0x00, 0x20, 0x00, 0x00, 0x5a, 0x00, 0x00,
+ 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x52, 0x00, 0x00, 0x53, 0x00, 0x22, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // Entry 280 - 2BF
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00,
+ 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // Entry 2C0 - 2FF
+ 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+ // Entry 300 - 33F
+ 0x00, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x5a,
+ 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00,
+ // Entry 340 - 37F
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00,
+ 0x5a, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a,
+ 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x5a,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x5a, 0x00,
+ 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // Entry 380 - 3BF
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5a, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00,
+ // Entry 3C0 - 3FF
+ 0x5a, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00,
+ 0x00, 0x5a, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x20, 0x00, 0x00, 0x5a, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // Entry 400 - 43F
+ 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x5a, 0x00,
+ 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a,
+ 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00,
+ // Entry 440 - 47F
+ 0x00, 0x00, 0x00, 0x00, 0x5a, 0x5a, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xde, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe1, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x2c,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a,
+ 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x5a, 0x00,
+ // Entry 480 - 4BF
+ 0x5a, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x5a, 0x00,
+ 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x5a, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // Entry 4C0 - 4FF
+ 0x5a, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // Entry 500 - 53F
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a,
+ 0x00, 0x00,
+}
+
+const (
+ _001 = 1
+ _419 = 31
+ _BR = 65
+ _CA = 73
+ _ES = 110
+ _GB = 123
+ _MD = 188
+ _PT = 238
+ _UK = 306
+ _US = 309
+ _ZZ = 357
+ _XA = 323
+ _XC = 325
+ _XK = 333
+)
+
+// 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.)
+const isoRegionOffset = 32
+
+// regionTypes defines the status of a region for various standards.
+// Size: 358 bytes, 358 elements
+var regionTypes = [358]uint8{
+ // Entry 0 - 3F
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ // Entry 40 - 7F
+ 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x04,
+ 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x04,
+ 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06,
+ 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00,
+ 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ // Entry 80 - BF
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x00, 0x04, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ // Entry C0 - FF
+ 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00,
+ 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x04, 0x06,
+ 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00,
+ 0x06, 0x06, 0x00, 0x06, 0x05, 0x05, 0x05, 0x05,
+ 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+ // Entry 100 - 13F
+ 0x05, 0x05, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x02, 0x06, 0x04, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06,
+ // Entry 140 - 17F
+ 0x06, 0x00, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05,
+ 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+ 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+ 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x06, 0x06,
+ 0x04, 0x06, 0x06, 0x04, 0x06, 0x05,
+}
+
+// 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.
+const regionISO tag.Index = "" + // Size: 1308 bytes
+ "AAAAACSCADNDAEREAFFGAGTGAIIAALLBAMRMANNTAOGOAQTAARRGASSMATUTAUUSAWBWAXLA" +
+ "AZZEBAIHBBRBBDGDBEELBFFABGGRBHHRBIDIBJENBLLMBMMUBNRNBOOLBQESBRRABSHSBTTN" +
+ "BUURBVVTBWWABYLRBZLZCAANCCCKCDODCFAFCGOGCHHECIIVCKOKCLHLCMMRCNHNCOOLCPPT" +
+ "CRRICS\x00\x00CTTECUUBCVPVCWUWCXXRCYYPCZZEDDDRDEEUDGGADJJIDKNKDMMADOOMDY" +
+ "HYDZZAEA ECCUEESTEGGYEHSHERRIESSPETTHEU\x00\x03EZ FIINFJJIFKLKFMSMFORO" +
+ "FQ\x00\x18FRRAFXXXGAABGBBRGDRDGEEOGFUFGGGYGHHAGIIBGLRLGMMBGNINGPLPGQNQGR" +
+ "RCGS\x00\x06GTTMGUUMGWNBGYUYHKKGHMMDHNNDHRRVHTTIHUUNHVVOIC IDDNIERLILSR" +
+ "IMMNINNDIOOTIQRQIRRNISSLITTAJEEYJMAMJOORJPPNJTTNKEENKGGZKHHMKIIRKM\x00" +
+ "\x09KNNAKP\x00\x0cKRORKWWTKY\x00\x0fKZAZLAAOLBBNLCCALIIELKKALRBRLSSOLTTU" +
+ "LUUXLVVALYBYMAARMCCOMDDAMENEMFAFMGDGMHHLMIIDMKKDMLLIMMMRMNNGMOACMPNPMQTQ" +
+ "MRRTMSSRMTLTMUUSMVDVMWWIMXEXMYYSMZOZNAAMNCCLNEERNFFKNGGANHHBNIICNLLDNOOR" +
+ "NPPLNQ\x00\x1eNRRUNTTZNUIUNZZLOMMNPAANPCCIPEERPFYFPGNGPHHLPKAKPLOLPM\x00" +
+ "\x12PNCNPRRIPSSEPTRTPUUSPWLWPYRYPZCZQAATQMMMQNNNQOOOQPPPQQQQQRRRQSSSQTTT" +
+ "QU\x00\x03QVVVQWWWQXXXQYYYQZZZREEURHHOROOURS\x00\x15RUUSRWWASAAUSBLBSCYC" +
+ "SDDNSEWESGGPSHHNSIVNSJJMSKVKSLLESMMRSNENSOOMSRURSSSDSTTPSUUNSVLVSXXMSYYR" +
+ "SZWZTAAATCCATDCDTF\x00\x18TGGOTHHATJJKTKKLTLLSTMKMTNUNTOONTPMPTRURTTTOTV" +
+ "UVTWWNTZZAUAKRUGGAUK UMMIUN USSAUYRYUZZBVAATVCCTVDDRVEENVGGBVIIRVNNMVU" +
+ "UTWFLFWKAKWSSMXAAAXBBBXCCCXDDDXEEEXFFFXGGGXHHHXIIIXJJJXKKKXLLLXMMMXNNNXO" +
+ "OOXPPPXQQQXRRRXSSSXTTTXUUUXVVVXWWWXXXXXYYYXZZZYDMDYEEMYT\x00\x1bYUUGZAAF" +
+ "ZMMBZRARZWWEZZZZ\xff\xff\xff\xff"
+
+// 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.
+const altRegionISO3 string = "SCGQUUSGSCOMPRKCYMSPMSRBATFMYTATN"
+
+// altRegionIDs holds a list of regionIDs the positions of which match those
+// of the 3-letter ISO codes in altRegionISO3.
+// Size: 22 bytes, 11 elements
+var altRegionIDs = [11]uint16{
+ 0x0057, 0x0070, 0x0088, 0x00a8, 0x00aa, 0x00ad, 0x00ea, 0x0105,
+ 0x0121, 0x015f, 0x00dc,
+}
+
+// Size: 80 bytes, 20 elements
+var regionOldMap = [20]FromTo{
+ 0: {From: 0x44, To: 0xc4},
+ 1: {From: 0x58, To: 0xa7},
+ 2: {From: 0x5f, To: 0x60},
+ 3: {From: 0x66, To: 0x3b},
+ 4: {From: 0x79, To: 0x78},
+ 5: {From: 0x93, To: 0x37},
+ 6: {From: 0xa3, To: 0x133},
+ 7: {From: 0xc1, To: 0x133},
+ 8: {From: 0xd7, To: 0x13f},
+ 9: {From: 0xdc, To: 0x2b},
+ 10: {From: 0xef, To: 0x133},
+ 11: {From: 0xf2, To: 0xe2},
+ 12: {From: 0xfc, To: 0x70},
+ 13: {From: 0x103, To: 0x164},
+ 14: {From: 0x12a, To: 0x126},
+ 15: {From: 0x132, To: 0x7b},
+ 16: {From: 0x13a, To: 0x13e},
+ 17: {From: 0x141, To: 0x133},
+ 18: {From: 0x15d, To: 0x15e},
+ 19: {From: 0x163, To: 0x4b},
+}
+
+// m49 maps regionIDs to UN.M49 codes. The first isoRegionOffset entries are
+// codes indicating collections of regions.
+// Size: 716 bytes, 358 elements
+var m49 = [358]int16{
+ // Entry 0 - 3F
+ 0, 1, 2, 3, 5, 9, 11, 13,
+ 14, 15, 17, 18, 19, 21, 29, 30,
+ 34, 35, 39, 53, 54, 57, 61, 142,
+ 143, 145, 150, 151, 154, 155, 202, 419,
+ 958, 0, 20, 784, 4, 28, 660, 8,
+ 51, 530, 24, 10, 32, 16, 40, 36,
+ 533, 248, 31, 70, 52, 50, 56, 854,
+ 100, 48, 108, 204, 652, 60, 96, 68,
+ // Entry 40 - 7F
+ 535, 76, 44, 64, 104, 74, 72, 112,
+ 84, 124, 166, 180, 140, 178, 756, 384,
+ 184, 152, 120, 156, 170, 0, 188, 891,
+ 296, 192, 132, 531, 162, 196, 203, 278,
+ 276, 0, 262, 208, 212, 214, 204, 12,
+ 0, 218, 233, 818, 732, 232, 724, 231,
+ 967, 0, 246, 242, 238, 583, 234, 0,
+ 250, 249, 266, 826, 308, 268, 254, 831,
+ // Entry 80 - BF
+ 288, 292, 304, 270, 324, 312, 226, 300,
+ 239, 320, 316, 624, 328, 344, 334, 340,
+ 191, 332, 348, 854, 0, 360, 372, 376,
+ 833, 356, 86, 368, 364, 352, 380, 832,
+ 388, 400, 392, 581, 404, 417, 116, 296,
+ 174, 659, 408, 410, 414, 136, 398, 418,
+ 422, 662, 438, 144, 430, 426, 440, 442,
+ 428, 434, 504, 492, 498, 499, 663, 450,
+ // Entry C0 - FF
+ 584, 581, 807, 466, 104, 496, 446, 580,
+ 474, 478, 500, 470, 480, 462, 454, 484,
+ 458, 508, 516, 540, 562, 574, 566, 548,
+ 558, 528, 578, 524, 10, 520, 536, 570,
+ 554, 512, 591, 0, 604, 258, 598, 608,
+ 586, 616, 666, 612, 630, 275, 620, 581,
+ 585, 600, 591, 634, 959, 960, 961, 962,
+ 963, 964, 965, 966, 967, 968, 969, 970,
+ // Entry 100 - 13F
+ 971, 972, 638, 716, 642, 688, 643, 646,
+ 682, 90, 690, 729, 752, 702, 654, 705,
+ 744, 703, 694, 674, 686, 706, 740, 728,
+ 678, 810, 222, 534, 760, 748, 0, 796,
+ 148, 260, 768, 764, 762, 772, 626, 795,
+ 788, 776, 626, 792, 780, 798, 158, 834,
+ 804, 800, 826, 581, 0, 840, 858, 860,
+ 336, 670, 704, 862, 92, 850, 704, 548,
+ // Entry 140 - 17F
+ 876, 581, 882, 973, 974, 975, 976, 977,
+ 978, 979, 980, 981, 982, 983, 984, 985,
+ 986, 987, 988, 989, 990, 991, 992, 993,
+ 994, 995, 996, 997, 998, 720, 887, 175,
+ 891, 710, 894, 180, 716, 999,
+}
+
+// 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.
+// Size: 18 bytes, 9 elements
+var m49Index = [9]int16{
+ 0, 59, 108, 143, 181, 220, 259, 291,
+ 333,
+}
+
+// fromM49 contains entries to map UN.M49 codes to regions. See m49Index for details.
+// Size: 666 bytes, 333 elements
+var fromM49 = [333]uint16{
+ // Entry 0 - 3F
+ 0x0201, 0x0402, 0x0603, 0x0824, 0x0a04, 0x1027, 0x1205, 0x142b,
+ 0x1606, 0x1867, 0x1a07, 0x1c08, 0x1e09, 0x202d, 0x220a, 0x240b,
+ 0x260c, 0x2822, 0x2a0d, 0x302a, 0x3825, 0x3a0e, 0x3c0f, 0x3e32,
+ 0x402c, 0x4410, 0x4611, 0x482f, 0x4e12, 0x502e, 0x5842, 0x6039,
+ 0x6435, 0x6628, 0x6834, 0x6a13, 0x6c14, 0x7036, 0x7215, 0x783d,
+ 0x7a16, 0x8043, 0x883f, 0x8c33, 0x9046, 0x9445, 0x9841, 0xa848,
+ 0xac9a, 0xb509, 0xb93c, 0xc03e, 0xc838, 0xd0c4, 0xd83a, 0xe047,
+ 0xe8a6, 0xf052, 0xf849, 0x085a, 0x10ad, 0x184c, 0x1c17, 0x1e18,
+ // Entry 40 - 7F
+ 0x20b3, 0x2219, 0x2920, 0x2c1a, 0x2e1b, 0x3051, 0x341c, 0x361d,
+ 0x3853, 0x3d2e, 0x445c, 0x4c4a, 0x5454, 0x5ca8, 0x5f5f, 0x644d,
+ 0x684b, 0x7050, 0x7856, 0x7e90, 0x8059, 0x885d, 0x941e, 0x965e,
+ 0x983b, 0xa063, 0xa864, 0xac65, 0xb469, 0xbd1a, 0xc486, 0xcc6f,
+ 0xce6f, 0xd06d, 0xd26a, 0xd476, 0xdc74, 0xde88, 0xe473, 0xec72,
+ 0xf031, 0xf279, 0xf478, 0xfc7e, 0x04e5, 0x0921, 0x0c62, 0x147a,
+ 0x187d, 0x1c83, 0x26ed, 0x2860, 0x2c5f, 0x3060, 0x4080, 0x4881,
+ 0x50a7, 0x5887, 0x6082, 0x687c, 0x7085, 0x788a, 0x8089, 0x8884,
+ // Entry 80 - BF
+ 0x908c, 0x9891, 0x9c8e, 0xa138, 0xa88f, 0xb08d, 0xb892, 0xc09d,
+ 0xc899, 0xd095, 0xd89c, 0xe09b, 0xe896, 0xf097, 0xf89e, 0x004f,
+ 0x08a0, 0x10a2, 0x1cae, 0x20a1, 0x28a4, 0x30aa, 0x34ab, 0x3cac,
+ 0x42a5, 0x44af, 0x461f, 0x4cb0, 0x54b5, 0x58b8, 0x5cb4, 0x64b9,
+ 0x6cb2, 0x70b6, 0x74b7, 0x7cc6, 0x84bf, 0x8cce, 0x94d0, 0x9ccd,
+ 0xa4c3, 0xaccb, 0xb4c8, 0xbcc9, 0xc0cc, 0xc8cf, 0xd8bb, 0xe0c5,
+ 0xe4bc, 0xe6bd, 0xe8ca, 0xf0ba, 0xf8d1, 0x00e1, 0x08d2, 0x10dd,
+ 0x18db, 0x20d9, 0x2429, 0x265b, 0x2a30, 0x2d1b, 0x2e40, 0x30de,
+ // Entry C0 - FF
+ 0x38d3, 0x493f, 0x54e0, 0x5cd8, 0x64d4, 0x6cd6, 0x74df, 0x7cd5,
+ 0x84da, 0x88c7, 0x8b33, 0x8e75, 0x90c0, 0x92f0, 0x94e8, 0x9ee2,
+ 0xace6, 0xb0f1, 0xb8e4, 0xc0e7, 0xc8eb, 0xd0e9, 0xd8ee, 0xe08b,
+ 0xe526, 0xecec, 0xf4f3, 0xfd02, 0x0504, 0x0706, 0x0d07, 0x183c,
+ 0x1d0e, 0x26a9, 0x2826, 0x2cb1, 0x2ebe, 0x34ea, 0x3d39, 0x4513,
+ 0x4d18, 0x5508, 0x5d14, 0x6105, 0x650a, 0x6d12, 0x7d0d, 0x7f11,
+ 0x813e, 0x830f, 0x8515, 0x8d61, 0x9964, 0xa15d, 0xa86e, 0xb117,
+ 0xb30b, 0xb86c, 0xc10b, 0xc916, 0xd110, 0xd91d, 0xe10c, 0xe84e,
+ // Entry 100 - 13F
+ 0xf11c, 0xf524, 0xf923, 0x0122, 0x0925, 0x1129, 0x192c, 0x2023,
+ 0x2928, 0x312b, 0x3727, 0x391f, 0x3d2d, 0x4131, 0x4930, 0x4ec2,
+ 0x5519, 0x646b, 0x747b, 0x7e7f, 0x809f, 0x8298, 0x852f, 0x9135,
+ 0xa53d, 0xac37, 0xb536, 0xb937, 0xbd3b, 0xd940, 0xe542, 0xed5e,
+ 0xef5e, 0xf657, 0xfd62, 0x7c20, 0x7ef4, 0x80f5, 0x82f6, 0x84f7,
+ 0x86f8, 0x88f9, 0x8afa, 0x8cfb, 0x8e70, 0x90fd, 0x92fe, 0x94ff,
+ 0x9700, 0x9901, 0x9b43, 0x9d44, 0x9f45, 0xa146, 0xa347, 0xa548,
+ 0xa749, 0xa94a, 0xab4b, 0xad4c, 0xaf4d, 0xb14e, 0xb34f, 0xb550,
+ // Entry 140 - 17F
+ 0xb751, 0xb952, 0xbb53, 0xbd54, 0xbf55, 0xc156, 0xc357, 0xc558,
+ 0xc759, 0xc95a, 0xcb5b, 0xcd5c, 0xcf65,
+}
+
+// Size: 1995 bytes
+var variantIndex = map[string]uint8{
+ "1606nict": 0x0,
+ "1694acad": 0x1,
+ "1901": 0x2,
+ "1959acad": 0x3,
+ "1994": 0x60,
+ "1996": 0x4,
+ "abl1943": 0x5,
+ "akuapem": 0x6,
+ "alalc97": 0x62,
+ "aluku": 0x7,
+ "ao1990": 0x8,
+ "aranes": 0x9,
+ "arevela": 0xa,
+ "arevmda": 0xb,
+ "asante": 0xc,
+ "auvern": 0xd,
+ "baku1926": 0xe,
+ "balanka": 0xf,
+ "barla": 0x10,
+ "basiceng": 0x11,
+ "bauddha": 0x12,
+ "biscayan": 0x13,
+ "biske": 0x5b,
+ "bohoric": 0x14,
+ "boont": 0x15,
+ "bornholm": 0x16,
+ "cisaup": 0x17,
+ "colb1945": 0x18,
+ "cornu": 0x19,
+ "creiss": 0x1a,
+ "dajnko": 0x1b,
+ "ekavsk": 0x1c,
+ "emodeng": 0x1d,
+ "fonipa": 0x63,
+ "fonkirsh": 0x64,
+ "fonnapa": 0x65,
+ "fonupa": 0x66,
+ "fonxsamp": 0x67,
+ "gascon": 0x1e,
+ "grclass": 0x1f,
+ "grital": 0x20,
+ "grmistr": 0x21,
+ "hepburn": 0x22,
+ "heploc": 0x61,
+ "hognorsk": 0x23,
+ "hsistemo": 0x24,
+ "ijekavsk": 0x25,
+ "itihasa": 0x26,
+ "ivanchov": 0x27,
+ "jauer": 0x28,
+ "jyutping": 0x29,
+ "kkcor": 0x2a,
+ "kociewie": 0x2b,
+ "kscor": 0x2c,
+ "laukika": 0x2d,
+ "lemosin": 0x2e,
+ "lengadoc": 0x2f,
+ "lipaw": 0x5c,
+ "luna1918": 0x30,
+ "metelko": 0x31,
+ "monoton": 0x32,
+ "ndyuka": 0x33,
+ "nedis": 0x34,
+ "newfound": 0x35,
+ "nicard": 0x36,
+ "njiva": 0x5d,
+ "nulik": 0x37,
+ "osojs": 0x5e,
+ "oxendict": 0x38,
+ "pahawh2": 0x39,
+ "pahawh3": 0x3a,
+ "pahawh4": 0x3b,
+ "pamaka": 0x3c,
+ "peano": 0x3d,
+ "petr1708": 0x3e,
+ "pinyin": 0x3f,
+ "polyton": 0x40,
+ "provenc": 0x41,
+ "puter": 0x42,
+ "rigik": 0x43,
+ "rozaj": 0x44,
+ "rumgr": 0x45,
+ "scotland": 0x46,
+ "scouse": 0x47,
+ "simple": 0x68,
+ "solba": 0x5f,
+ "sotav": 0x48,
+ "spanglis": 0x49,
+ "surmiran": 0x4a,
+ "sursilv": 0x4b,
+ "sutsilv": 0x4c,
+ "tarask": 0x4d,
+ "tongyong": 0x4e,
+ "tunumiit": 0x4f,
+ "uccor": 0x50,
+ "ucrcor": 0x51,
+ "ulster": 0x52,
+ "unifon": 0x53,
+ "vaidika": 0x54,
+ "valencia": 0x55,
+ "vallader": 0x56,
+ "vecdruka": 0x57,
+ "vivaraup": 0x58,
+ "wadegile": 0x59,
+ "xsistemo": 0x5a,
+}
+
+// variantNumSpecialized is the number of specialized variants in variants.
+const variantNumSpecialized = 98
+
+// nRegionGroups is the number of region groups.
+const nRegionGroups = 33
+
+type likelyLangRegion struct {
+ lang uint16
+ region uint16
+}
+
+// likelyScript is a lookup table, indexed by scriptID, for the most likely
+// languages and regions given a script.
+// Size: 1012 bytes, 253 elements
+var likelyScript = [253]likelyLangRegion{
+ 1: {lang: 0x14e, region: 0x84},
+ 3: {lang: 0x2a2, region: 0x106},
+ 4: {lang: 0x1f, region: 0x99},
+ 5: {lang: 0x3a, region: 0x6b},
+ 7: {lang: 0x3b, region: 0x9c},
+ 8: {lang: 0x1d7, region: 0x28},
+ 9: {lang: 0x13, region: 0x9c},
+ 10: {lang: 0x5b, region: 0x95},
+ 11: {lang: 0x60, region: 0x52},
+ 12: {lang: 0xb9, region: 0xb4},
+ 13: {lang: 0x63, region: 0x95},
+ 14: {lang: 0xa5, region: 0x35},
+ 15: {lang: 0x3e9, region: 0x99},
+ 17: {lang: 0x529, region: 0x12e},
+ 18: {lang: 0x3b1, region: 0x99},
+ 19: {lang: 0x15e, region: 0x78},
+ 20: {lang: 0xc2, region: 0x95},
+ 21: {lang: 0x9d, region: 0xe7},
+ 22: {lang: 0xdb, region: 0x35},
+ 23: {lang: 0xf3, region: 0x49},
+ 24: {lang: 0x4f0, region: 0x12b},
+ 25: {lang: 0xe7, region: 0x13e},
+ 26: {lang: 0xe5, region: 0x135},
+ 29: {lang: 0xf1, region: 0x6b},
+ 31: {lang: 0x1a0, region: 0x5d},
+ 32: {lang: 0x3e2, region: 0x106},
+ 34: {lang: 0x1be, region: 0x99},
+ 38: {lang: 0x15e, region: 0x78},
+ 41: {lang: 0x133, region: 0x6b},
+ 42: {lang: 0x431, region: 0x27},
+ 44: {lang: 0x27, region: 0x6f},
+ 46: {lang: 0x210, region: 0x7d},
+ 47: {lang: 0xfe, region: 0x38},
+ 49: {lang: 0x19b, region: 0x99},
+ 50: {lang: 0x19e, region: 0x130},
+ 51: {lang: 0x3e9, region: 0x99},
+ 52: {lang: 0x136, region: 0x87},
+ 53: {lang: 0x1a4, region: 0x99},
+ 54: {lang: 0x39d, region: 0x99},
+ 55: {lang: 0x529, region: 0x12e},
+ 56: {lang: 0x254, region: 0xab},
+ 57: {lang: 0x529, region: 0x53},
+ 58: {lang: 0x1cb, region: 0xe7},
+ 59: {lang: 0x529, region: 0x53},
+ 60: {lang: 0x529, region: 0x12e},
+ 61: {lang: 0x2fd, region: 0x9b},
+ 62: {lang: 0x1bc, region: 0x97},
+ 63: {lang: 0x200, region: 0xa2},
+ 64: {lang: 0x1c5, region: 0x12b},
+ 65: {lang: 0x1ca, region: 0xaf},
+ 68: {lang: 0x1d5, region: 0x92},
+ 70: {lang: 0x142, region: 0x9e},
+ 71: {lang: 0x254, region: 0xab},
+ 72: {lang: 0x20e, region: 0x95},
+ 73: {lang: 0x200, region: 0xa2},
+ 75: {lang: 0x135, region: 0xc4},
+ 76: {lang: 0x200, region: 0xa2},
+ 77: {lang: 0x3bb, region: 0xe8},
+ 78: {lang: 0x24a, region: 0xa6},
+ 79: {lang: 0x3fa, region: 0x99},
+ 82: {lang: 0x251, region: 0x99},
+ 83: {lang: 0x254, region: 0xab},
+ 85: {lang: 0x88, region: 0x99},
+ 86: {lang: 0x370, region: 0x123},
+ 87: {lang: 0x2b8, region: 0xaf},
+ 92: {lang: 0x29f, region: 0x99},
+ 93: {lang: 0x2a8, region: 0x99},
+ 94: {lang: 0x28f, region: 0x87},
+ 95: {lang: 0x1a0, region: 0x87},
+ 96: {lang: 0x2ac, region: 0x53},
+ 98: {lang: 0x4f4, region: 0x12b},
+ 99: {lang: 0x4f5, region: 0x12b},
+ 100: {lang: 0x1be, region: 0x99},
+ 102: {lang: 0x337, region: 0x9c},
+ 103: {lang: 0x4f7, region: 0x53},
+ 104: {lang: 0xa9, region: 0x53},
+ 107: {lang: 0x2e8, region: 0x112},
+ 108: {lang: 0x4f8, region: 0x10b},
+ 109: {lang: 0x4f8, region: 0x10b},
+ 110: {lang: 0x304, region: 0x99},
+ 111: {lang: 0x31b, region: 0x99},
+ 112: {lang: 0x30b, region: 0x53},
+ 114: {lang: 0x31e, region: 0x35},
+ 115: {lang: 0x30e, region: 0x99},
+ 116: {lang: 0x414, region: 0xe8},
+ 117: {lang: 0x331, region: 0xc4},
+ 119: {lang: 0x4f9, region: 0x108},
+ 120: {lang: 0x3b, region: 0xa1},
+ 121: {lang: 0x353, region: 0xdb},
+ 124: {lang: 0x2d0, region: 0x84},
+ 125: {lang: 0x52a, region: 0x53},
+ 126: {lang: 0x403, region: 0x96},
+ 127: {lang: 0x3ee, region: 0x99},
+ 128: {lang: 0x39b, region: 0xc5},
+ 129: {lang: 0x395, region: 0x99},
+ 130: {lang: 0x399, region: 0x135},
+ 131: {lang: 0x429, region: 0x115},
+ 132: {lang: 0x3b, region: 0x11c},
+ 133: {lang: 0xfd, region: 0xc4},
+ 134: {lang: 0x27d, region: 0x106},
+ 135: {lang: 0x2c9, region: 0x53},
+ 136: {lang: 0x39f, region: 0x9c},
+ 137: {lang: 0x39f, region: 0x53},
+ 139: {lang: 0x3ad, region: 0xb0},
+ 141: {lang: 0x1c6, region: 0x53},
+ 142: {lang: 0x4fd, region: 0x9c},
+ 193: {lang: 0x3cb, region: 0x95},
+ 196: {lang: 0x372, region: 0x10c},
+ 197: {lang: 0x420, region: 0x97},
+ 199: {lang: 0x4ff, region: 0x15e},
+ 200: {lang: 0x3f0, region: 0x99},
+ 201: {lang: 0x45, region: 0x135},
+ 202: {lang: 0x139, region: 0x7b},
+ 203: {lang: 0x3e9, region: 0x99},
+ 205: {lang: 0x3e9, region: 0x99},
+ 206: {lang: 0x3fa, region: 0x99},
+ 207: {lang: 0x40c, region: 0xb3},
+ 210: {lang: 0x433, region: 0x99},
+ 211: {lang: 0xef, region: 0xc5},
+ 212: {lang: 0x43e, region: 0x95},
+ 213: {lang: 0x44d, region: 0x35},
+ 214: {lang: 0x44e, region: 0x9b},
+ 218: {lang: 0x45a, region: 0xe7},
+ 219: {lang: 0x11a, region: 0x99},
+ 220: {lang: 0x45e, region: 0x53},
+ 221: {lang: 0x232, region: 0x53},
+ 222: {lang: 0x450, region: 0x99},
+ 223: {lang: 0x4a5, region: 0x53},
+ 224: {lang: 0x9f, region: 0x13e},
+ 225: {lang: 0x461, region: 0x99},
+ 227: {lang: 0x528, region: 0xba},
+ 228: {lang: 0x153, region: 0xe7},
+ 229: {lang: 0x128, region: 0xcd},
+ 230: {lang: 0x46b, region: 0x123},
+ 231: {lang: 0xa9, region: 0x53},
+ 232: {lang: 0x2ce, region: 0x99},
+ 234: {lang: 0x4ad, region: 0x11c},
+ 235: {lang: 0x4be, region: 0xb4},
+ 237: {lang: 0x1ce, region: 0x99},
+ 240: {lang: 0x3a9, region: 0x9c},
+ 241: {lang: 0x22, region: 0x9b},
+ 243: {lang: 0x1ea, region: 0x53},
+ 244: {lang: 0xef, region: 0xc5},
+}
+
+type likelyScriptRegion struct {
+ region uint16
+ script uint8
+ flags uint8
+}
+
+// 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.
+// Size: 5320 bytes, 1330 elements
+var likelyLang = [1330]likelyScriptRegion{
+ 0: {region: 0x135, script: 0x5a, flags: 0x0},
+ 1: {region: 0x6f, script: 0x5a, flags: 0x0},
+ 2: {region: 0x165, script: 0x5a, flags: 0x0},
+ 3: {region: 0x165, script: 0x5a, flags: 0x0},
+ 4: {region: 0x165, script: 0x5a, flags: 0x0},
+ 5: {region: 0x7d, script: 0x20, flags: 0x0},
+ 6: {region: 0x165, script: 0x5a, flags: 0x0},
+ 7: {region: 0x165, script: 0x20, flags: 0x0},
+ 8: {region: 0x80, script: 0x5a, flags: 0x0},
+ 9: {region: 0x165, script: 0x5a, flags: 0x0},
+ 10: {region: 0x165, script: 0x5a, flags: 0x0},
+ 11: {region: 0x165, script: 0x5a, flags: 0x0},
+ 12: {region: 0x95, script: 0x5a, flags: 0x0},
+ 13: {region: 0x131, script: 0x5a, flags: 0x0},
+ 14: {region: 0x80, script: 0x5a, flags: 0x0},
+ 15: {region: 0x165, script: 0x5a, flags: 0x0},
+ 16: {region: 0x165, script: 0x5a, flags: 0x0},
+ 17: {region: 0x106, script: 0x20, flags: 0x0},
+ 18: {region: 0x165, script: 0x5a, flags: 0x0},
+ 19: {region: 0x9c, script: 0x9, flags: 0x0},
+ 20: {region: 0x128, script: 0x5, flags: 0x0},
+ 21: {region: 0x165, script: 0x5a, flags: 0x0},
+ 22: {region: 0x161, script: 0x5a, flags: 0x0},
+ 23: {region: 0x165, script: 0x5a, flags: 0x0},
+ 24: {region: 0x165, script: 0x5a, flags: 0x0},
+ 25: {region: 0x165, script: 0x5a, flags: 0x0},
+ 26: {region: 0x165, script: 0x5a, flags: 0x0},
+ 27: {region: 0x165, script: 0x5a, flags: 0x0},
+ 28: {region: 0x52, script: 0x5a, flags: 0x0},
+ 29: {region: 0x165, script: 0x5a, flags: 0x0},
+ 30: {region: 0x165, script: 0x5a, flags: 0x0},
+ 31: {region: 0x99, script: 0x4, flags: 0x0},
+ 32: {region: 0x165, script: 0x5a, flags: 0x0},
+ 33: {region: 0x80, script: 0x5a, flags: 0x0},
+ 34: {region: 0x9b, script: 0xf1, flags: 0x0},
+ 35: {region: 0x165, script: 0x5a, flags: 0x0},
+ 36: {region: 0x165, script: 0x5a, flags: 0x0},
+ 37: {region: 0x14d, script: 0x5a, flags: 0x0},
+ 38: {region: 0x106, script: 0x20, flags: 0x0},
+ 39: {region: 0x6f, script: 0x2c, flags: 0x0},
+ 40: {region: 0x165, script: 0x5a, flags: 0x0},
+ 41: {region: 0x165, script: 0x5a, flags: 0x0},
+ 42: {region: 0xd6, script: 0x5a, flags: 0x0},
+ 43: {region: 0x165, script: 0x5a, flags: 0x0},
+ 45: {region: 0x165, script: 0x5a, flags: 0x0},
+ 46: {region: 0x165, script: 0x5a, flags: 0x0},
+ 47: {region: 0x165, script: 0x5a, flags: 0x0},
+ 48: {region: 0x165, script: 0x5a, flags: 0x0},
+ 49: {region: 0x165, script: 0x5a, flags: 0x0},
+ 50: {region: 0x165, script: 0x5a, flags: 0x0},
+ 51: {region: 0x95, script: 0x5a, flags: 0x0},
+ 52: {region: 0x165, script: 0x5, flags: 0x0},
+ 53: {region: 0x122, script: 0x5, flags: 0x0},
+ 54: {region: 0x165, script: 0x5a, flags: 0x0},
+ 55: {region: 0x165, script: 0x5a, flags: 0x0},
+ 56: {region: 0x165, script: 0x5a, flags: 0x0},
+ 57: {region: 0x165, script: 0x5a, flags: 0x0},
+ 58: {region: 0x6b, script: 0x5, flags: 0x0},
+ 59: {region: 0x0, script: 0x3, flags: 0x1},
+ 60: {region: 0x165, script: 0x5a, flags: 0x0},
+ 61: {region: 0x51, script: 0x5a, flags: 0x0},
+ 62: {region: 0x3f, script: 0x5a, flags: 0x0},
+ 63: {region: 0x67, script: 0x5, flags: 0x0},
+ 65: {region: 0xba, script: 0x5, flags: 0x0},
+ 66: {region: 0x6b, script: 0x5, flags: 0x0},
+ 67: {region: 0x99, script: 0xe, flags: 0x0},
+ 68: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 69: {region: 0x135, script: 0xc9, flags: 0x0},
+ 70: {region: 0x165, script: 0x5a, flags: 0x0},
+ 71: {region: 0x165, script: 0x5a, flags: 0x0},
+ 72: {region: 0x6e, script: 0x5a, flags: 0x0},
+ 73: {region: 0x165, script: 0x5a, flags: 0x0},
+ 74: {region: 0x165, script: 0x5a, flags: 0x0},
+ 75: {region: 0x49, script: 0x5a, flags: 0x0},
+ 76: {region: 0x165, script: 0x5a, flags: 0x0},
+ 77: {region: 0x106, script: 0x20, flags: 0x0},
+ 78: {region: 0x165, script: 0x5, flags: 0x0},
+ 79: {region: 0x165, script: 0x5a, flags: 0x0},
+ 80: {region: 0x165, script: 0x5a, flags: 0x0},
+ 81: {region: 0x165, script: 0x5a, flags: 0x0},
+ 82: {region: 0x99, script: 0x22, flags: 0x0},
+ 83: {region: 0x165, script: 0x5a, flags: 0x0},
+ 84: {region: 0x165, script: 0x5a, flags: 0x0},
+ 85: {region: 0x165, script: 0x5a, flags: 0x0},
+ 86: {region: 0x3f, script: 0x5a, flags: 0x0},
+ 87: {region: 0x165, script: 0x5a, flags: 0x0},
+ 88: {region: 0x3, script: 0x5, flags: 0x1},
+ 89: {region: 0x106, script: 0x20, flags: 0x0},
+ 90: {region: 0xe8, script: 0x5, flags: 0x0},
+ 91: {region: 0x95, script: 0x5a, flags: 0x0},
+ 92: {region: 0xdb, script: 0x22, flags: 0x0},
+ 93: {region: 0x2e, script: 0x5a, flags: 0x0},
+ 94: {region: 0x52, script: 0x5a, flags: 0x0},
+ 95: {region: 0x165, script: 0x5a, flags: 0x0},
+ 96: {region: 0x52, script: 0xb, flags: 0x0},
+ 97: {region: 0x165, script: 0x5a, flags: 0x0},
+ 98: {region: 0x165, script: 0x5a, flags: 0x0},
+ 99: {region: 0x95, script: 0x5a, flags: 0x0},
+ 100: {region: 0x165, script: 0x5a, flags: 0x0},
+ 101: {region: 0x52, script: 0x5a, flags: 0x0},
+ 102: {region: 0x165, script: 0x5a, flags: 0x0},
+ 103: {region: 0x165, script: 0x5a, flags: 0x0},
+ 104: {region: 0x165, script: 0x5a, flags: 0x0},
+ 105: {region: 0x165, script: 0x5a, flags: 0x0},
+ 106: {region: 0x4f, script: 0x5a, flags: 0x0},
+ 107: {region: 0x165, script: 0x5a, flags: 0x0},
+ 108: {region: 0x165, script: 0x5a, flags: 0x0},
+ 109: {region: 0x165, script: 0x5a, flags: 0x0},
+ 110: {region: 0x165, script: 0x2c, flags: 0x0},
+ 111: {region: 0x165, script: 0x5a, flags: 0x0},
+ 112: {region: 0x165, script: 0x5a, flags: 0x0},
+ 113: {region: 0x47, script: 0x20, flags: 0x0},
+ 114: {region: 0x165, script: 0x5a, flags: 0x0},
+ 115: {region: 0x165, script: 0x5a, flags: 0x0},
+ 116: {region: 0x10b, script: 0x5, flags: 0x0},
+ 117: {region: 0x162, script: 0x5a, flags: 0x0},
+ 118: {region: 0x165, script: 0x5a, flags: 0x0},
+ 119: {region: 0x95, script: 0x5a, flags: 0x0},
+ 120: {region: 0x165, script: 0x5a, flags: 0x0},
+ 121: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 122: {region: 0x52, script: 0x5a, flags: 0x0},
+ 123: {region: 0x99, script: 0xde, flags: 0x0},
+ 124: {region: 0xe8, script: 0x5, flags: 0x0},
+ 125: {region: 0x99, script: 0x22, flags: 0x0},
+ 126: {region: 0x38, script: 0x20, flags: 0x0},
+ 127: {region: 0x99, script: 0x22, flags: 0x0},
+ 128: {region: 0xe8, script: 0x5, flags: 0x0},
+ 129: {region: 0x12b, script: 0x34, flags: 0x0},
+ 131: {region: 0x99, script: 0x22, flags: 0x0},
+ 132: {region: 0x165, script: 0x5a, flags: 0x0},
+ 133: {region: 0x99, script: 0x22, flags: 0x0},
+ 134: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 135: {region: 0x165, script: 0x5a, flags: 0x0},
+ 136: {region: 0x99, script: 0x22, flags: 0x0},
+ 137: {region: 0x165, script: 0x5a, flags: 0x0},
+ 138: {region: 0x13f, script: 0x5a, flags: 0x0},
+ 139: {region: 0x165, script: 0x5a, flags: 0x0},
+ 140: {region: 0x165, script: 0x5a, flags: 0x0},
+ 141: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 142: {region: 0x165, script: 0x5a, flags: 0x0},
+ 143: {region: 0xd6, script: 0x5a, flags: 0x0},
+ 144: {region: 0x165, script: 0x5a, flags: 0x0},
+ 145: {region: 0x165, script: 0x5a, flags: 0x0},
+ 146: {region: 0x165, script: 0x5a, flags: 0x0},
+ 147: {region: 0x165, script: 0x2c, flags: 0x0},
+ 148: {region: 0x99, script: 0x22, flags: 0x0},
+ 149: {region: 0x95, script: 0x5a, flags: 0x0},
+ 150: {region: 0x165, script: 0x5a, flags: 0x0},
+ 151: {region: 0x165, script: 0x5a, flags: 0x0},
+ 152: {region: 0x114, script: 0x5a, flags: 0x0},
+ 153: {region: 0x165, script: 0x5a, flags: 0x0},
+ 154: {region: 0x165, script: 0x5a, flags: 0x0},
+ 155: {region: 0x52, script: 0x5a, flags: 0x0},
+ 156: {region: 0x165, script: 0x5a, flags: 0x0},
+ 157: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 158: {region: 0x165, script: 0x5a, flags: 0x0},
+ 159: {region: 0x13e, script: 0xe0, flags: 0x0},
+ 160: {region: 0xc3, script: 0x5a, flags: 0x0},
+ 161: {region: 0x165, script: 0x5a, flags: 0x0},
+ 162: {region: 0x165, script: 0x5a, flags: 0x0},
+ 163: {region: 0xc3, script: 0x5a, flags: 0x0},
+ 164: {region: 0x165, script: 0x5a, flags: 0x0},
+ 165: {region: 0x35, script: 0xe, flags: 0x0},
+ 166: {region: 0x165, script: 0x5a, flags: 0x0},
+ 167: {region: 0x165, script: 0x5a, flags: 0x0},
+ 168: {region: 0x165, script: 0x5a, flags: 0x0},
+ 169: {region: 0x53, script: 0xe7, flags: 0x0},
+ 170: {region: 0x165, script: 0x5a, flags: 0x0},
+ 171: {region: 0x165, script: 0x5a, flags: 0x0},
+ 172: {region: 0x165, script: 0x5a, flags: 0x0},
+ 173: {region: 0x99, script: 0xe, flags: 0x0},
+ 174: {region: 0x165, script: 0x5a, flags: 0x0},
+ 175: {region: 0x9c, script: 0x5, flags: 0x0},
+ 176: {region: 0x165, script: 0x5a, flags: 0x0},
+ 177: {region: 0x4f, script: 0x5a, flags: 0x0},
+ 178: {region: 0x78, script: 0x5a, flags: 0x0},
+ 179: {region: 0x99, script: 0x22, flags: 0x0},
+ 180: {region: 0xe8, script: 0x5, flags: 0x0},
+ 181: {region: 0x99, script: 0x22, flags: 0x0},
+ 182: {region: 0x165, script: 0x5a, flags: 0x0},
+ 183: {region: 0x33, script: 0x5a, flags: 0x0},
+ 184: {region: 0x165, script: 0x5a, flags: 0x0},
+ 185: {region: 0xb4, script: 0xc, flags: 0x0},
+ 186: {region: 0x52, script: 0x5a, flags: 0x0},
+ 187: {region: 0x165, script: 0x2c, flags: 0x0},
+ 188: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 189: {region: 0x165, script: 0x5a, flags: 0x0},
+ 190: {region: 0xe8, script: 0x22, flags: 0x0},
+ 191: {region: 0x106, script: 0x20, flags: 0x0},
+ 192: {region: 0x15f, script: 0x5a, flags: 0x0},
+ 193: {region: 0x165, script: 0x5a, flags: 0x0},
+ 194: {region: 0x95, script: 0x5a, flags: 0x0},
+ 195: {region: 0x165, script: 0x5a, flags: 0x0},
+ 196: {region: 0x52, script: 0x5a, flags: 0x0},
+ 197: {region: 0x165, script: 0x5a, flags: 0x0},
+ 198: {region: 0x165, script: 0x5a, flags: 0x0},
+ 199: {region: 0x165, script: 0x5a, flags: 0x0},
+ 200: {region: 0x86, script: 0x5a, flags: 0x0},
+ 201: {region: 0x165, script: 0x5a, flags: 0x0},
+ 202: {region: 0x165, script: 0x5a, flags: 0x0},
+ 203: {region: 0x165, script: 0x5a, flags: 0x0},
+ 204: {region: 0x165, script: 0x5a, flags: 0x0},
+ 205: {region: 0x6d, script: 0x2c, flags: 0x0},
+ 206: {region: 0x165, script: 0x5a, flags: 0x0},
+ 207: {region: 0x165, script: 0x5a, flags: 0x0},
+ 208: {region: 0x52, script: 0x5a, flags: 0x0},
+ 209: {region: 0x165, script: 0x5a, flags: 0x0},
+ 210: {region: 0x165, script: 0x5a, flags: 0x0},
+ 211: {region: 0xc3, script: 0x5a, flags: 0x0},
+ 212: {region: 0x165, script: 0x5a, flags: 0x0},
+ 213: {region: 0x165, script: 0x5a, flags: 0x0},
+ 214: {region: 0x165, script: 0x5a, flags: 0x0},
+ 215: {region: 0x6e, script: 0x5a, flags: 0x0},
+ 216: {region: 0x165, script: 0x5a, flags: 0x0},
+ 217: {region: 0x165, script: 0x5a, flags: 0x0},
+ 218: {region: 0xd6, script: 0x5a, flags: 0x0},
+ 219: {region: 0x35, script: 0x16, flags: 0x0},
+ 220: {region: 0x106, script: 0x20, flags: 0x0},
+ 221: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 222: {region: 0x165, script: 0x5a, flags: 0x0},
+ 223: {region: 0x131, script: 0x5a, flags: 0x0},
+ 224: {region: 0x8a, script: 0x5a, flags: 0x0},
+ 225: {region: 0x75, script: 0x5a, flags: 0x0},
+ 226: {region: 0x106, script: 0x20, flags: 0x0},
+ 227: {region: 0x135, script: 0x5a, flags: 0x0},
+ 228: {region: 0x49, script: 0x5a, flags: 0x0},
+ 229: {region: 0x135, script: 0x1a, flags: 0x0},
+ 230: {region: 0xa6, script: 0x5, flags: 0x0},
+ 231: {region: 0x13e, script: 0x19, flags: 0x0},
+ 232: {region: 0x165, script: 0x5a, flags: 0x0},
+ 233: {region: 0x9b, script: 0x5, flags: 0x0},
+ 234: {region: 0x165, script: 0x5a, flags: 0x0},
+ 235: {region: 0x165, script: 0x5a, flags: 0x0},
+ 236: {region: 0x165, script: 0x5a, flags: 0x0},
+ 237: {region: 0x165, script: 0x5a, flags: 0x0},
+ 238: {region: 0x165, script: 0x5a, flags: 0x0},
+ 239: {region: 0xc5, script: 0xd3, flags: 0x0},
+ 240: {region: 0x78, script: 0x5a, flags: 0x0},
+ 241: {region: 0x6b, script: 0x1d, flags: 0x0},
+ 242: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 243: {region: 0x49, script: 0x17, flags: 0x0},
+ 244: {region: 0x130, script: 0x20, flags: 0x0},
+ 245: {region: 0x49, script: 0x17, flags: 0x0},
+ 246: {region: 0x49, script: 0x17, flags: 0x0},
+ 247: {region: 0x49, script: 0x17, flags: 0x0},
+ 248: {region: 0x49, script: 0x17, flags: 0x0},
+ 249: {region: 0x10a, script: 0x5a, flags: 0x0},
+ 250: {region: 0x5e, script: 0x5a, flags: 0x0},
+ 251: {region: 0xe9, script: 0x5a, flags: 0x0},
+ 252: {region: 0x49, script: 0x17, flags: 0x0},
+ 253: {region: 0xc4, script: 0x85, flags: 0x0},
+ 254: {region: 0x8, script: 0x2, flags: 0x1},
+ 255: {region: 0x106, script: 0x20, flags: 0x0},
+ 256: {region: 0x7b, script: 0x5a, flags: 0x0},
+ 257: {region: 0x63, script: 0x5a, flags: 0x0},
+ 258: {region: 0x165, script: 0x5a, flags: 0x0},
+ 259: {region: 0x165, script: 0x5a, flags: 0x0},
+ 260: {region: 0x165, script: 0x5a, flags: 0x0},
+ 261: {region: 0x165, script: 0x5a, flags: 0x0},
+ 262: {region: 0x135, script: 0x5a, flags: 0x0},
+ 263: {region: 0x106, script: 0x20, flags: 0x0},
+ 264: {region: 0xa4, script: 0x5a, flags: 0x0},
+ 265: {region: 0x165, script: 0x5a, flags: 0x0},
+ 266: {region: 0x165, script: 0x5a, flags: 0x0},
+ 267: {region: 0x99, script: 0x5, flags: 0x0},
+ 268: {region: 0x165, script: 0x5a, flags: 0x0},
+ 269: {region: 0x60, script: 0x5a, flags: 0x0},
+ 270: {region: 0x165, script: 0x5a, flags: 0x0},
+ 271: {region: 0x49, script: 0x5a, flags: 0x0},
+ 272: {region: 0x165, script: 0x5a, flags: 0x0},
+ 273: {region: 0x165, script: 0x5a, flags: 0x0},
+ 274: {region: 0x165, script: 0x5a, flags: 0x0},
+ 275: {region: 0x165, script: 0x5, flags: 0x0},
+ 276: {region: 0x49, script: 0x5a, flags: 0x0},
+ 277: {region: 0x165, script: 0x5a, flags: 0x0},
+ 278: {region: 0x165, script: 0x5a, flags: 0x0},
+ 279: {region: 0xd4, script: 0x5a, flags: 0x0},
+ 280: {region: 0x4f, script: 0x5a, flags: 0x0},
+ 281: {region: 0x165, script: 0x5a, flags: 0x0},
+ 282: {region: 0x99, script: 0x5, flags: 0x0},
+ 283: {region: 0x165, script: 0x5a, flags: 0x0},
+ 284: {region: 0x165, script: 0x5a, flags: 0x0},
+ 285: {region: 0x165, script: 0x5a, flags: 0x0},
+ 286: {region: 0x165, script: 0x2c, flags: 0x0},
+ 287: {region: 0x60, script: 0x5a, flags: 0x0},
+ 288: {region: 0xc3, script: 0x5a, flags: 0x0},
+ 289: {region: 0xd0, script: 0x5a, flags: 0x0},
+ 290: {region: 0x165, script: 0x5a, flags: 0x0},
+ 291: {region: 0xdb, script: 0x22, flags: 0x0},
+ 292: {region: 0x52, script: 0x5a, flags: 0x0},
+ 293: {region: 0x165, script: 0x5a, flags: 0x0},
+ 294: {region: 0x165, script: 0x5a, flags: 0x0},
+ 295: {region: 0x165, script: 0x5a, flags: 0x0},
+ 296: {region: 0xcd, script: 0xe5, flags: 0x0},
+ 297: {region: 0x165, script: 0x5a, flags: 0x0},
+ 298: {region: 0x165, script: 0x5a, flags: 0x0},
+ 299: {region: 0x114, script: 0x5a, flags: 0x0},
+ 300: {region: 0x37, script: 0x5a, flags: 0x0},
+ 301: {region: 0x43, script: 0xe7, flags: 0x0},
+ 302: {region: 0x165, script: 0x5a, flags: 0x0},
+ 303: {region: 0xa4, script: 0x5a, flags: 0x0},
+ 304: {region: 0x80, script: 0x5a, flags: 0x0},
+ 305: {region: 0xd6, script: 0x5a, flags: 0x0},
+ 306: {region: 0x9e, script: 0x5a, flags: 0x0},
+ 307: {region: 0x6b, script: 0x29, flags: 0x0},
+ 308: {region: 0x165, script: 0x5a, flags: 0x0},
+ 309: {region: 0xc4, script: 0x4b, flags: 0x0},
+ 310: {region: 0x87, script: 0x34, flags: 0x0},
+ 311: {region: 0x165, script: 0x5a, flags: 0x0},
+ 312: {region: 0x165, script: 0x5a, flags: 0x0},
+ 313: {region: 0xa, script: 0x2, flags: 0x1},
+ 314: {region: 0x165, script: 0x5a, flags: 0x0},
+ 315: {region: 0x165, script: 0x5a, flags: 0x0},
+ 316: {region: 0x1, script: 0x5a, flags: 0x0},
+ 317: {region: 0x165, script: 0x5a, flags: 0x0},
+ 318: {region: 0x6e, script: 0x5a, flags: 0x0},
+ 319: {region: 0x135, script: 0x5a, flags: 0x0},
+ 320: {region: 0x6a, script: 0x5a, flags: 0x0},
+ 321: {region: 0x165, script: 0x5a, flags: 0x0},
+ 322: {region: 0x9e, script: 0x46, flags: 0x0},
+ 323: {region: 0x165, script: 0x5a, flags: 0x0},
+ 324: {region: 0x165, script: 0x5a, flags: 0x0},
+ 325: {region: 0x6e, script: 0x5a, flags: 0x0},
+ 326: {region: 0x52, script: 0x5a, flags: 0x0},
+ 327: {region: 0x6e, script: 0x5a, flags: 0x0},
+ 328: {region: 0x9c, script: 0x5, flags: 0x0},
+ 329: {region: 0x165, script: 0x5a, flags: 0x0},
+ 330: {region: 0x165, script: 0x5a, flags: 0x0},
+ 331: {region: 0x165, script: 0x5a, flags: 0x0},
+ 332: {region: 0x165, script: 0x5a, flags: 0x0},
+ 333: {region: 0x86, script: 0x5a, flags: 0x0},
+ 334: {region: 0xc, script: 0x2, flags: 0x1},
+ 335: {region: 0x165, script: 0x5a, flags: 0x0},
+ 336: {region: 0xc3, script: 0x5a, flags: 0x0},
+ 337: {region: 0x72, script: 0x5a, flags: 0x0},
+ 338: {region: 0x10b, script: 0x5, flags: 0x0},
+ 339: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 340: {region: 0x10c, script: 0x5a, flags: 0x0},
+ 341: {region: 0x73, script: 0x5a, flags: 0x0},
+ 342: {region: 0x165, script: 0x5a, flags: 0x0},
+ 343: {region: 0x165, script: 0x5a, flags: 0x0},
+ 344: {region: 0x76, script: 0x5a, flags: 0x0},
+ 345: {region: 0x165, script: 0x5a, flags: 0x0},
+ 346: {region: 0x3b, script: 0x5a, flags: 0x0},
+ 347: {region: 0x165, script: 0x5a, flags: 0x0},
+ 348: {region: 0x165, script: 0x5a, flags: 0x0},
+ 349: {region: 0x165, script: 0x5a, flags: 0x0},
+ 350: {region: 0x78, script: 0x5a, flags: 0x0},
+ 351: {region: 0x135, script: 0x5a, flags: 0x0},
+ 352: {region: 0x78, script: 0x5a, flags: 0x0},
+ 353: {region: 0x60, script: 0x5a, flags: 0x0},
+ 354: {region: 0x60, script: 0x5a, flags: 0x0},
+ 355: {region: 0x52, script: 0x5, flags: 0x0},
+ 356: {region: 0x140, script: 0x5a, flags: 0x0},
+ 357: {region: 0x165, script: 0x5a, flags: 0x0},
+ 358: {region: 0x84, script: 0x5a, flags: 0x0},
+ 359: {region: 0x165, script: 0x5a, flags: 0x0},
+ 360: {region: 0xd4, script: 0x5a, flags: 0x0},
+ 361: {region: 0x9e, script: 0x5a, flags: 0x0},
+ 362: {region: 0xd6, script: 0x5a, flags: 0x0},
+ 363: {region: 0x165, script: 0x5a, flags: 0x0},
+ 364: {region: 0x10b, script: 0x5a, flags: 0x0},
+ 365: {region: 0xd9, script: 0x5a, flags: 0x0},
+ 366: {region: 0x96, script: 0x5a, flags: 0x0},
+ 367: {region: 0x80, script: 0x5a, flags: 0x0},
+ 368: {region: 0x165, script: 0x5a, flags: 0x0},
+ 369: {region: 0xbc, script: 0x5a, flags: 0x0},
+ 370: {region: 0x165, script: 0x5a, flags: 0x0},
+ 371: {region: 0x165, script: 0x5a, flags: 0x0},
+ 372: {region: 0x165, script: 0x5a, flags: 0x0},
+ 373: {region: 0x53, script: 0x3b, flags: 0x0},
+ 374: {region: 0x165, script: 0x5a, flags: 0x0},
+ 375: {region: 0x95, script: 0x5a, flags: 0x0},
+ 376: {region: 0x165, script: 0x5a, flags: 0x0},
+ 377: {region: 0x165, script: 0x5a, flags: 0x0},
+ 378: {region: 0x99, script: 0x22, flags: 0x0},
+ 379: {region: 0x165, script: 0x5a, flags: 0x0},
+ 380: {region: 0x9c, script: 0x5, flags: 0x0},
+ 381: {region: 0x7e, script: 0x5a, flags: 0x0},
+ 382: {region: 0x7b, script: 0x5a, flags: 0x0},
+ 383: {region: 0x165, script: 0x5a, flags: 0x0},
+ 384: {region: 0x165, script: 0x5a, flags: 0x0},
+ 385: {region: 0x165, script: 0x5a, flags: 0x0},
+ 386: {region: 0x165, script: 0x5a, flags: 0x0},
+ 387: {region: 0x165, script: 0x5a, flags: 0x0},
+ 388: {region: 0x165, script: 0x5a, flags: 0x0},
+ 389: {region: 0x6f, script: 0x2c, flags: 0x0},
+ 390: {region: 0x165, script: 0x5a, flags: 0x0},
+ 391: {region: 0xdb, script: 0x22, flags: 0x0},
+ 392: {region: 0x165, script: 0x5a, flags: 0x0},
+ 393: {region: 0xa7, script: 0x5a, flags: 0x0},
+ 394: {region: 0x165, script: 0x5a, flags: 0x0},
+ 395: {region: 0xe8, script: 0x5, flags: 0x0},
+ 396: {region: 0x165, script: 0x5a, flags: 0x0},
+ 397: {region: 0xe8, script: 0x5, flags: 0x0},
+ 398: {region: 0x165, script: 0x5a, flags: 0x0},
+ 399: {region: 0x165, script: 0x5a, flags: 0x0},
+ 400: {region: 0x6e, script: 0x5a, flags: 0x0},
+ 401: {region: 0x9c, script: 0x5, flags: 0x0},
+ 402: {region: 0x165, script: 0x5a, flags: 0x0},
+ 403: {region: 0x165, script: 0x2c, flags: 0x0},
+ 404: {region: 0xf1, script: 0x5a, flags: 0x0},
+ 405: {region: 0x165, script: 0x5a, flags: 0x0},
+ 406: {region: 0x165, script: 0x5a, flags: 0x0},
+ 407: {region: 0x165, script: 0x5a, flags: 0x0},
+ 408: {region: 0x165, script: 0x2c, flags: 0x0},
+ 409: {region: 0x165, script: 0x5a, flags: 0x0},
+ 410: {region: 0x99, script: 0x22, flags: 0x0},
+ 411: {region: 0x99, script: 0xe1, flags: 0x0},
+ 412: {region: 0x95, script: 0x5a, flags: 0x0},
+ 413: {region: 0xd9, script: 0x5a, flags: 0x0},
+ 414: {region: 0x130, script: 0x32, flags: 0x0},
+ 415: {region: 0x165, script: 0x5a, flags: 0x0},
+ 416: {region: 0xe, script: 0x2, flags: 0x1},
+ 417: {region: 0x99, script: 0xe, flags: 0x0},
+ 418: {region: 0x165, script: 0x5a, flags: 0x0},
+ 419: {region: 0x4e, script: 0x5a, flags: 0x0},
+ 420: {region: 0x99, script: 0x35, flags: 0x0},
+ 421: {region: 0x41, script: 0x5a, flags: 0x0},
+ 422: {region: 0x54, script: 0x5a, flags: 0x0},
+ 423: {region: 0x165, script: 0x5a, flags: 0x0},
+ 424: {region: 0x80, script: 0x5a, flags: 0x0},
+ 425: {region: 0x165, script: 0x5a, flags: 0x0},
+ 426: {region: 0x165, script: 0x5a, flags: 0x0},
+ 427: {region: 0xa4, script: 0x5a, flags: 0x0},
+ 428: {region: 0x98, script: 0x5a, flags: 0x0},
+ 429: {region: 0x165, script: 0x5a, flags: 0x0},
+ 430: {region: 0xdb, script: 0x22, flags: 0x0},
+ 431: {region: 0x165, script: 0x5a, flags: 0x0},
+ 432: {region: 0x165, script: 0x5, flags: 0x0},
+ 433: {region: 0x49, script: 0x5a, flags: 0x0},
+ 434: {region: 0x165, script: 0x5, flags: 0x0},
+ 435: {region: 0x165, script: 0x5a, flags: 0x0},
+ 436: {region: 0x10, script: 0x3, flags: 0x1},
+ 437: {region: 0x165, script: 0x5a, flags: 0x0},
+ 438: {region: 0x53, script: 0x3b, flags: 0x0},
+ 439: {region: 0x165, script: 0x5a, flags: 0x0},
+ 440: {region: 0x135, script: 0x5a, flags: 0x0},
+ 441: {region: 0x24, script: 0x5, flags: 0x0},
+ 442: {region: 0x165, script: 0x5a, flags: 0x0},
+ 443: {region: 0x165, script: 0x2c, flags: 0x0},
+ 444: {region: 0x97, script: 0x3e, flags: 0x0},
+ 445: {region: 0x165, script: 0x5a, flags: 0x0},
+ 446: {region: 0x99, script: 0x22, flags: 0x0},
+ 447: {region: 0x165, script: 0x5a, flags: 0x0},
+ 448: {region: 0x73, script: 0x5a, flags: 0x0},
+ 449: {region: 0x165, script: 0x5a, flags: 0x0},
+ 450: {region: 0x165, script: 0x5a, flags: 0x0},
+ 451: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 452: {region: 0x165, script: 0x5a, flags: 0x0},
+ 453: {region: 0x12b, script: 0x40, flags: 0x0},
+ 454: {region: 0x53, script: 0x8d, flags: 0x0},
+ 455: {region: 0x165, script: 0x5a, flags: 0x0},
+ 456: {region: 0xe8, script: 0x5, flags: 0x0},
+ 457: {region: 0x99, script: 0x22, flags: 0x0},
+ 458: {region: 0xaf, script: 0x41, flags: 0x0},
+ 459: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 460: {region: 0xe8, script: 0x5, flags: 0x0},
+ 461: {region: 0xe6, script: 0x5a, flags: 0x0},
+ 462: {region: 0x99, script: 0x22, flags: 0x0},
+ 463: {region: 0x99, script: 0x22, flags: 0x0},
+ 464: {region: 0x165, script: 0x5a, flags: 0x0},
+ 465: {region: 0x90, script: 0x5a, flags: 0x0},
+ 466: {region: 0x60, script: 0x5a, flags: 0x0},
+ 467: {region: 0x53, script: 0x3b, flags: 0x0},
+ 468: {region: 0x91, script: 0x5a, flags: 0x0},
+ 469: {region: 0x92, script: 0x5a, flags: 0x0},
+ 470: {region: 0x165, script: 0x5a, flags: 0x0},
+ 471: {region: 0x28, script: 0x8, flags: 0x0},
+ 472: {region: 0xd2, script: 0x5a, flags: 0x0},
+ 473: {region: 0x78, script: 0x5a, flags: 0x0},
+ 474: {region: 0x165, script: 0x5a, flags: 0x0},
+ 475: {region: 0x165, script: 0x5a, flags: 0x0},
+ 476: {region: 0xd0, script: 0x5a, flags: 0x0},
+ 477: {region: 0xd6, script: 0x5a, flags: 0x0},
+ 478: {region: 0x165, script: 0x5a, flags: 0x0},
+ 479: {region: 0x165, script: 0x5a, flags: 0x0},
+ 480: {region: 0x165, script: 0x5a, flags: 0x0},
+ 481: {region: 0x95, script: 0x5a, flags: 0x0},
+ 482: {region: 0x165, script: 0x5a, flags: 0x0},
+ 483: {region: 0x165, script: 0x5a, flags: 0x0},
+ 484: {region: 0x165, script: 0x5a, flags: 0x0},
+ 486: {region: 0x122, script: 0x5a, flags: 0x0},
+ 487: {region: 0xd6, script: 0x5a, flags: 0x0},
+ 488: {region: 0x165, script: 0x5a, flags: 0x0},
+ 489: {region: 0x165, script: 0x5a, flags: 0x0},
+ 490: {region: 0x53, script: 0xf3, flags: 0x0},
+ 491: {region: 0x165, script: 0x5a, flags: 0x0},
+ 492: {region: 0x135, script: 0x5a, flags: 0x0},
+ 493: {region: 0x165, script: 0x5a, flags: 0x0},
+ 494: {region: 0x49, script: 0x5a, flags: 0x0},
+ 495: {region: 0x165, script: 0x5a, flags: 0x0},
+ 496: {region: 0x165, script: 0x5a, flags: 0x0},
+ 497: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 498: {region: 0x165, script: 0x5a, flags: 0x0},
+ 499: {region: 0x95, script: 0x5a, flags: 0x0},
+ 500: {region: 0x106, script: 0x20, flags: 0x0},
+ 501: {region: 0x1, script: 0x5a, flags: 0x0},
+ 502: {region: 0x165, script: 0x5a, flags: 0x0},
+ 503: {region: 0x165, script: 0x5a, flags: 0x0},
+ 504: {region: 0x9d, script: 0x5a, flags: 0x0},
+ 505: {region: 0x9e, script: 0x5a, flags: 0x0},
+ 506: {region: 0x49, script: 0x17, flags: 0x0},
+ 507: {region: 0x97, script: 0x3e, flags: 0x0},
+ 508: {region: 0x165, script: 0x5a, flags: 0x0},
+ 509: {region: 0x165, script: 0x5a, flags: 0x0},
+ 510: {region: 0x106, script: 0x5a, flags: 0x0},
+ 511: {region: 0x165, script: 0x5a, flags: 0x0},
+ 512: {region: 0xa2, script: 0x49, flags: 0x0},
+ 513: {region: 0x165, script: 0x5a, flags: 0x0},
+ 514: {region: 0xa0, script: 0x5a, flags: 0x0},
+ 515: {region: 0x1, script: 0x5a, flags: 0x0},
+ 516: {region: 0x165, script: 0x5a, flags: 0x0},
+ 517: {region: 0x165, script: 0x5a, flags: 0x0},
+ 518: {region: 0x165, script: 0x5a, flags: 0x0},
+ 519: {region: 0x52, script: 0x5a, flags: 0x0},
+ 520: {region: 0x130, script: 0x3e, flags: 0x0},
+ 521: {region: 0x165, script: 0x5a, flags: 0x0},
+ 522: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 523: {region: 0xdb, script: 0x22, flags: 0x0},
+ 524: {region: 0x165, script: 0x5a, flags: 0x0},
+ 525: {region: 0x63, script: 0x5a, flags: 0x0},
+ 526: {region: 0x95, script: 0x5a, flags: 0x0},
+ 527: {region: 0x95, script: 0x5a, flags: 0x0},
+ 528: {region: 0x7d, script: 0x2e, flags: 0x0},
+ 529: {region: 0x137, script: 0x20, flags: 0x0},
+ 530: {region: 0x67, script: 0x5a, flags: 0x0},
+ 531: {region: 0xc4, script: 0x5a, flags: 0x0},
+ 532: {region: 0x165, script: 0x5a, flags: 0x0},
+ 533: {region: 0x165, script: 0x5a, flags: 0x0},
+ 534: {region: 0xd6, script: 0x5a, flags: 0x0},
+ 535: {region: 0xa4, script: 0x5a, flags: 0x0},
+ 536: {region: 0xc3, script: 0x5a, flags: 0x0},
+ 537: {region: 0x106, script: 0x20, flags: 0x0},
+ 538: {region: 0x165, script: 0x5a, flags: 0x0},
+ 539: {region: 0x165, script: 0x5a, flags: 0x0},
+ 540: {region: 0x165, script: 0x5a, flags: 0x0},
+ 541: {region: 0x165, script: 0x5a, flags: 0x0},
+ 542: {region: 0xd4, script: 0x5, flags: 0x0},
+ 543: {region: 0xd6, script: 0x5a, flags: 0x0},
+ 544: {region: 0x164, script: 0x5a, flags: 0x0},
+ 545: {region: 0x165, script: 0x5a, flags: 0x0},
+ 546: {region: 0x165, script: 0x5a, flags: 0x0},
+ 547: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 548: {region: 0x122, script: 0x5, flags: 0x0},
+ 549: {region: 0x165, script: 0x5a, flags: 0x0},
+ 550: {region: 0x123, script: 0xe6, flags: 0x0},
+ 551: {region: 0x5a, script: 0x5a, flags: 0x0},
+ 552: {region: 0x52, script: 0x5a, flags: 0x0},
+ 553: {region: 0x165, script: 0x5a, flags: 0x0},
+ 554: {region: 0x4f, script: 0x5a, flags: 0x0},
+ 555: {region: 0x99, script: 0x22, flags: 0x0},
+ 556: {region: 0x99, script: 0x22, flags: 0x0},
+ 557: {region: 0x4b, script: 0x5a, flags: 0x0},
+ 558: {region: 0x95, script: 0x5a, flags: 0x0},
+ 559: {region: 0x165, script: 0x5a, flags: 0x0},
+ 560: {region: 0x41, script: 0x5a, flags: 0x0},
+ 561: {region: 0x99, script: 0x5a, flags: 0x0},
+ 562: {region: 0x53, script: 0xdd, flags: 0x0},
+ 563: {region: 0x99, script: 0x22, flags: 0x0},
+ 564: {region: 0xc3, script: 0x5a, flags: 0x0},
+ 565: {region: 0x165, script: 0x5a, flags: 0x0},
+ 566: {region: 0x99, script: 0x75, flags: 0x0},
+ 567: {region: 0xe8, script: 0x5, flags: 0x0},
+ 568: {region: 0x165, script: 0x5a, flags: 0x0},
+ 569: {region: 0xa4, script: 0x5a, flags: 0x0},
+ 570: {region: 0x165, script: 0x5a, flags: 0x0},
+ 571: {region: 0x12b, script: 0x5a, flags: 0x0},
+ 572: {region: 0x165, script: 0x5a, flags: 0x0},
+ 573: {region: 0xd2, script: 0x5a, flags: 0x0},
+ 574: {region: 0x165, script: 0x5a, flags: 0x0},
+ 575: {region: 0xaf, script: 0x57, flags: 0x0},
+ 576: {region: 0x165, script: 0x5a, flags: 0x0},
+ 577: {region: 0x165, script: 0x5a, flags: 0x0},
+ 578: {region: 0x13, script: 0x6, flags: 0x1},
+ 579: {region: 0x165, script: 0x5a, flags: 0x0},
+ 580: {region: 0x52, script: 0x5a, flags: 0x0},
+ 581: {region: 0x82, script: 0x5a, flags: 0x0},
+ 582: {region: 0xa4, script: 0x5a, flags: 0x0},
+ 583: {region: 0x165, script: 0x5a, flags: 0x0},
+ 584: {region: 0x165, script: 0x5a, flags: 0x0},
+ 585: {region: 0x165, script: 0x5a, flags: 0x0},
+ 586: {region: 0xa6, script: 0x4e, flags: 0x0},
+ 587: {region: 0x2a, script: 0x5a, flags: 0x0},
+ 588: {region: 0x165, script: 0x5a, flags: 0x0},
+ 589: {region: 0x165, script: 0x5a, flags: 0x0},
+ 590: {region: 0x165, script: 0x5a, flags: 0x0},
+ 591: {region: 0x165, script: 0x5a, flags: 0x0},
+ 592: {region: 0x165, script: 0x5a, flags: 0x0},
+ 593: {region: 0x99, script: 0x52, flags: 0x0},
+ 594: {region: 0x8b, script: 0x5a, flags: 0x0},
+ 595: {region: 0x165, script: 0x5a, flags: 0x0},
+ 596: {region: 0xab, script: 0x53, flags: 0x0},
+ 597: {region: 0x106, script: 0x20, flags: 0x0},
+ 598: {region: 0x99, script: 0x22, flags: 0x0},
+ 599: {region: 0x165, script: 0x5a, flags: 0x0},
+ 600: {region: 0x75, script: 0x5a, flags: 0x0},
+ 601: {region: 0x165, script: 0x5a, flags: 0x0},
+ 602: {region: 0xb4, script: 0x5a, flags: 0x0},
+ 603: {region: 0x165, script: 0x5a, flags: 0x0},
+ 604: {region: 0x165, script: 0x5a, flags: 0x0},
+ 605: {region: 0x165, script: 0x5a, flags: 0x0},
+ 606: {region: 0x165, script: 0x5a, flags: 0x0},
+ 607: {region: 0x165, script: 0x5a, flags: 0x0},
+ 608: {region: 0x165, script: 0x5a, flags: 0x0},
+ 609: {region: 0x165, script: 0x5a, flags: 0x0},
+ 610: {region: 0x165, script: 0x2c, flags: 0x0},
+ 611: {region: 0x165, script: 0x5a, flags: 0x0},
+ 612: {region: 0x106, script: 0x20, flags: 0x0},
+ 613: {region: 0x112, script: 0x5a, flags: 0x0},
+ 614: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 615: {region: 0x106, script: 0x5a, flags: 0x0},
+ 616: {region: 0x165, script: 0x5a, flags: 0x0},
+ 617: {region: 0x99, script: 0x22, flags: 0x0},
+ 618: {region: 0x99, script: 0x5, flags: 0x0},
+ 619: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 620: {region: 0x165, script: 0x5a, flags: 0x0},
+ 621: {region: 0x52, script: 0x5a, flags: 0x0},
+ 622: {region: 0x60, script: 0x5a, flags: 0x0},
+ 623: {region: 0x165, script: 0x5a, flags: 0x0},
+ 624: {region: 0x165, script: 0x5a, flags: 0x0},
+ 625: {region: 0x165, script: 0x2c, flags: 0x0},
+ 626: {region: 0x165, script: 0x5a, flags: 0x0},
+ 627: {region: 0x165, script: 0x5a, flags: 0x0},
+ 628: {region: 0x19, script: 0x3, flags: 0x1},
+ 629: {region: 0x165, script: 0x5a, flags: 0x0},
+ 630: {region: 0x165, script: 0x5a, flags: 0x0},
+ 631: {region: 0x165, script: 0x5a, flags: 0x0},
+ 632: {region: 0x165, script: 0x5a, flags: 0x0},
+ 633: {region: 0x106, script: 0x20, flags: 0x0},
+ 634: {region: 0x165, script: 0x5a, flags: 0x0},
+ 635: {region: 0x165, script: 0x5a, flags: 0x0},
+ 636: {region: 0x165, script: 0x5a, flags: 0x0},
+ 637: {region: 0x106, script: 0x20, flags: 0x0},
+ 638: {region: 0x165, script: 0x5a, flags: 0x0},
+ 639: {region: 0x95, script: 0x5a, flags: 0x0},
+ 640: {region: 0xe8, script: 0x5, flags: 0x0},
+ 641: {region: 0x7b, script: 0x5a, flags: 0x0},
+ 642: {region: 0x165, script: 0x5a, flags: 0x0},
+ 643: {region: 0x165, script: 0x5a, flags: 0x0},
+ 644: {region: 0x165, script: 0x5a, flags: 0x0},
+ 645: {region: 0x165, script: 0x2c, flags: 0x0},
+ 646: {region: 0x123, script: 0xe6, flags: 0x0},
+ 647: {region: 0xe8, script: 0x5, flags: 0x0},
+ 648: {region: 0x165, script: 0x5a, flags: 0x0},
+ 649: {region: 0x165, script: 0x5a, flags: 0x0},
+ 650: {region: 0x1c, script: 0x5, flags: 0x1},
+ 651: {region: 0x165, script: 0x5a, flags: 0x0},
+ 652: {region: 0x165, script: 0x5a, flags: 0x0},
+ 653: {region: 0x165, script: 0x5a, flags: 0x0},
+ 654: {region: 0x138, script: 0x5a, flags: 0x0},
+ 655: {region: 0x87, script: 0x5e, flags: 0x0},
+ 656: {region: 0x97, script: 0x3e, flags: 0x0},
+ 657: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 658: {region: 0xe8, script: 0x5, flags: 0x0},
+ 659: {region: 0x131, script: 0x5a, flags: 0x0},
+ 660: {region: 0x165, script: 0x5a, flags: 0x0},
+ 661: {region: 0xb7, script: 0x5a, flags: 0x0},
+ 662: {region: 0x106, script: 0x20, flags: 0x0},
+ 663: {region: 0x165, script: 0x5a, flags: 0x0},
+ 664: {region: 0x95, script: 0x5a, flags: 0x0},
+ 665: {region: 0x165, script: 0x5a, flags: 0x0},
+ 666: {region: 0x53, script: 0xe6, flags: 0x0},
+ 667: {region: 0x165, script: 0x5a, flags: 0x0},
+ 668: {region: 0x165, script: 0x5a, flags: 0x0},
+ 669: {region: 0x165, script: 0x5a, flags: 0x0},
+ 670: {region: 0x165, script: 0x5a, flags: 0x0},
+ 671: {region: 0x99, script: 0x5c, flags: 0x0},
+ 672: {region: 0x165, script: 0x5a, flags: 0x0},
+ 673: {region: 0x165, script: 0x5a, flags: 0x0},
+ 674: {region: 0x106, script: 0x20, flags: 0x0},
+ 675: {region: 0x131, script: 0x5a, flags: 0x0},
+ 676: {region: 0x165, script: 0x5a, flags: 0x0},
+ 677: {region: 0xd9, script: 0x5a, flags: 0x0},
+ 678: {region: 0x165, script: 0x5a, flags: 0x0},
+ 679: {region: 0x165, script: 0x5a, flags: 0x0},
+ 680: {region: 0x21, script: 0x2, flags: 0x1},
+ 681: {region: 0x165, script: 0x5a, flags: 0x0},
+ 682: {region: 0x165, script: 0x5a, flags: 0x0},
+ 683: {region: 0x9e, script: 0x5a, flags: 0x0},
+ 684: {region: 0x53, script: 0x60, flags: 0x0},
+ 685: {region: 0x95, script: 0x5a, flags: 0x0},
+ 686: {region: 0x9c, script: 0x5, flags: 0x0},
+ 687: {region: 0x135, script: 0x5a, flags: 0x0},
+ 688: {region: 0x165, script: 0x5a, flags: 0x0},
+ 689: {region: 0x165, script: 0x5a, flags: 0x0},
+ 690: {region: 0x99, script: 0xe1, flags: 0x0},
+ 691: {region: 0x9e, script: 0x5a, flags: 0x0},
+ 692: {region: 0x165, script: 0x5a, flags: 0x0},
+ 693: {region: 0x4b, script: 0x5a, flags: 0x0},
+ 694: {region: 0x165, script: 0x5a, flags: 0x0},
+ 695: {region: 0x165, script: 0x5a, flags: 0x0},
+ 696: {region: 0xaf, script: 0x57, flags: 0x0},
+ 697: {region: 0x165, script: 0x5a, flags: 0x0},
+ 698: {region: 0x165, script: 0x5a, flags: 0x0},
+ 699: {region: 0x4b, script: 0x5a, flags: 0x0},
+ 700: {region: 0x165, script: 0x5a, flags: 0x0},
+ 701: {region: 0x165, script: 0x5a, flags: 0x0},
+ 702: {region: 0x162, script: 0x5a, flags: 0x0},
+ 703: {region: 0x9c, script: 0x5, flags: 0x0},
+ 704: {region: 0xb6, script: 0x5a, flags: 0x0},
+ 705: {region: 0xb8, script: 0x5a, flags: 0x0},
+ 706: {region: 0x4b, script: 0x5a, flags: 0x0},
+ 707: {region: 0x4b, script: 0x5a, flags: 0x0},
+ 708: {region: 0xa4, script: 0x5a, flags: 0x0},
+ 709: {region: 0xa4, script: 0x5a, flags: 0x0},
+ 710: {region: 0x9c, script: 0x5, flags: 0x0},
+ 711: {region: 0xb8, script: 0x5a, flags: 0x0},
+ 712: {region: 0x123, script: 0xe6, flags: 0x0},
+ 713: {region: 0x53, script: 0x3b, flags: 0x0},
+ 714: {region: 0x12b, script: 0x5a, flags: 0x0},
+ 715: {region: 0x95, script: 0x5a, flags: 0x0},
+ 716: {region: 0x52, script: 0x5a, flags: 0x0},
+ 717: {region: 0x99, script: 0x22, flags: 0x0},
+ 718: {region: 0x99, script: 0x22, flags: 0x0},
+ 719: {region: 0x95, script: 0x5a, flags: 0x0},
+ 720: {region: 0x23, script: 0x3, flags: 0x1},
+ 721: {region: 0xa4, script: 0x5a, flags: 0x0},
+ 722: {region: 0x165, script: 0x5a, flags: 0x0},
+ 723: {region: 0xcf, script: 0x5a, flags: 0x0},
+ 724: {region: 0x165, script: 0x5a, flags: 0x0},
+ 725: {region: 0x165, script: 0x5a, flags: 0x0},
+ 726: {region: 0x165, script: 0x5a, flags: 0x0},
+ 727: {region: 0x165, script: 0x5a, flags: 0x0},
+ 728: {region: 0x165, script: 0x5a, flags: 0x0},
+ 729: {region: 0x165, script: 0x5a, flags: 0x0},
+ 730: {region: 0x165, script: 0x5a, flags: 0x0},
+ 731: {region: 0x165, script: 0x5a, flags: 0x0},
+ 732: {region: 0x165, script: 0x5a, flags: 0x0},
+ 733: {region: 0x165, script: 0x5a, flags: 0x0},
+ 734: {region: 0x165, script: 0x5a, flags: 0x0},
+ 735: {region: 0x165, script: 0x5, flags: 0x0},
+ 736: {region: 0x106, script: 0x20, flags: 0x0},
+ 737: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 738: {region: 0x165, script: 0x5a, flags: 0x0},
+ 739: {region: 0x95, script: 0x5a, flags: 0x0},
+ 740: {region: 0x165, script: 0x2c, flags: 0x0},
+ 741: {region: 0x165, script: 0x5a, flags: 0x0},
+ 742: {region: 0x165, script: 0x5a, flags: 0x0},
+ 743: {region: 0x165, script: 0x5a, flags: 0x0},
+ 744: {region: 0x112, script: 0x5a, flags: 0x0},
+ 745: {region: 0xa4, script: 0x5a, flags: 0x0},
+ 746: {region: 0x165, script: 0x5a, flags: 0x0},
+ 747: {region: 0x165, script: 0x5a, flags: 0x0},
+ 748: {region: 0x123, script: 0x5, flags: 0x0},
+ 749: {region: 0xcc, script: 0x5a, flags: 0x0},
+ 750: {region: 0x165, script: 0x5a, flags: 0x0},
+ 751: {region: 0x165, script: 0x5a, flags: 0x0},
+ 752: {region: 0x165, script: 0x5a, flags: 0x0},
+ 753: {region: 0xbf, script: 0x5a, flags: 0x0},
+ 754: {region: 0xd1, script: 0x5a, flags: 0x0},
+ 755: {region: 0x165, script: 0x5a, flags: 0x0},
+ 756: {region: 0x52, script: 0x5a, flags: 0x0},
+ 757: {region: 0xdb, script: 0x22, flags: 0x0},
+ 758: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 759: {region: 0xc0, script: 0x5a, flags: 0x0},
+ 760: {region: 0x165, script: 0x5a, flags: 0x0},
+ 761: {region: 0x165, script: 0x5a, flags: 0x0},
+ 762: {region: 0xe0, script: 0x5a, flags: 0x0},
+ 763: {region: 0x165, script: 0x5a, flags: 0x0},
+ 764: {region: 0x95, script: 0x5a, flags: 0x0},
+ 765: {region: 0x9b, script: 0x3d, flags: 0x0},
+ 766: {region: 0x165, script: 0x5a, flags: 0x0},
+ 767: {region: 0xc2, script: 0x20, flags: 0x0},
+ 768: {region: 0x165, script: 0x5, flags: 0x0},
+ 769: {region: 0x165, script: 0x5a, flags: 0x0},
+ 770: {region: 0x165, script: 0x5a, flags: 0x0},
+ 771: {region: 0x165, script: 0x5a, flags: 0x0},
+ 772: {region: 0x99, script: 0x6e, flags: 0x0},
+ 773: {region: 0x165, script: 0x5a, flags: 0x0},
+ 774: {region: 0x165, script: 0x5a, flags: 0x0},
+ 775: {region: 0x10b, script: 0x5a, flags: 0x0},
+ 776: {region: 0x165, script: 0x5a, flags: 0x0},
+ 777: {region: 0x165, script: 0x5a, flags: 0x0},
+ 778: {region: 0x165, script: 0x5a, flags: 0x0},
+ 779: {region: 0x26, script: 0x3, flags: 0x1},
+ 780: {region: 0x165, script: 0x5a, flags: 0x0},
+ 781: {region: 0x165, script: 0x5a, flags: 0x0},
+ 782: {region: 0x99, script: 0xe, flags: 0x0},
+ 783: {region: 0xc4, script: 0x75, flags: 0x0},
+ 785: {region: 0x165, script: 0x5a, flags: 0x0},
+ 786: {region: 0x49, script: 0x5a, flags: 0x0},
+ 787: {region: 0x49, script: 0x5a, flags: 0x0},
+ 788: {region: 0x37, script: 0x5a, flags: 0x0},
+ 789: {region: 0x165, script: 0x5a, flags: 0x0},
+ 790: {region: 0x165, script: 0x5a, flags: 0x0},
+ 791: {region: 0x165, script: 0x5a, flags: 0x0},
+ 792: {region: 0x165, script: 0x5a, flags: 0x0},
+ 793: {region: 0x165, script: 0x5a, flags: 0x0},
+ 794: {region: 0x165, script: 0x5a, flags: 0x0},
+ 795: {region: 0x99, script: 0x22, flags: 0x0},
+ 796: {region: 0xdb, script: 0x22, flags: 0x0},
+ 797: {region: 0x106, script: 0x20, flags: 0x0},
+ 798: {region: 0x35, script: 0x72, flags: 0x0},
+ 799: {region: 0x29, script: 0x3, flags: 0x1},
+ 800: {region: 0xcb, script: 0x5a, flags: 0x0},
+ 801: {region: 0x165, script: 0x5a, flags: 0x0},
+ 802: {region: 0x165, script: 0x5a, flags: 0x0},
+ 803: {region: 0x165, script: 0x5a, flags: 0x0},
+ 804: {region: 0x99, script: 0x22, flags: 0x0},
+ 805: {region: 0x52, script: 0x5a, flags: 0x0},
+ 807: {region: 0x165, script: 0x5a, flags: 0x0},
+ 808: {region: 0x135, script: 0x5a, flags: 0x0},
+ 809: {region: 0x165, script: 0x5a, flags: 0x0},
+ 810: {region: 0x165, script: 0x5a, flags: 0x0},
+ 811: {region: 0xe8, script: 0x5, flags: 0x0},
+ 812: {region: 0xc3, script: 0x5a, flags: 0x0},
+ 813: {region: 0x99, script: 0x22, flags: 0x0},
+ 814: {region: 0x95, script: 0x5a, flags: 0x0},
+ 815: {region: 0x164, script: 0x5a, flags: 0x0},
+ 816: {region: 0x165, script: 0x5a, flags: 0x0},
+ 817: {region: 0xc4, script: 0x75, flags: 0x0},
+ 818: {region: 0x165, script: 0x5a, flags: 0x0},
+ 819: {region: 0x165, script: 0x2c, flags: 0x0},
+ 820: {region: 0x106, script: 0x20, flags: 0x0},
+ 821: {region: 0x165, script: 0x5a, flags: 0x0},
+ 822: {region: 0x131, script: 0x5a, flags: 0x0},
+ 823: {region: 0x9c, script: 0x66, flags: 0x0},
+ 824: {region: 0x165, script: 0x5a, flags: 0x0},
+ 825: {region: 0x165, script: 0x5a, flags: 0x0},
+ 826: {region: 0x9c, script: 0x5, flags: 0x0},
+ 827: {region: 0x165, script: 0x5a, flags: 0x0},
+ 828: {region: 0x165, script: 0x5a, flags: 0x0},
+ 829: {region: 0x165, script: 0x5a, flags: 0x0},
+ 830: {region: 0xdd, script: 0x5a, flags: 0x0},
+ 831: {region: 0x165, script: 0x5a, flags: 0x0},
+ 832: {region: 0x165, script: 0x5a, flags: 0x0},
+ 834: {region: 0x165, script: 0x5a, flags: 0x0},
+ 835: {region: 0x53, script: 0x3b, flags: 0x0},
+ 836: {region: 0x9e, script: 0x5a, flags: 0x0},
+ 837: {region: 0xd2, script: 0x5a, flags: 0x0},
+ 838: {region: 0x165, script: 0x5a, flags: 0x0},
+ 839: {region: 0xda, script: 0x5a, flags: 0x0},
+ 840: {region: 0x165, script: 0x5a, flags: 0x0},
+ 841: {region: 0x165, script: 0x5a, flags: 0x0},
+ 842: {region: 0x165, script: 0x5a, flags: 0x0},
+ 843: {region: 0xcf, script: 0x5a, flags: 0x0},
+ 844: {region: 0x165, script: 0x5a, flags: 0x0},
+ 845: {region: 0x165, script: 0x5a, flags: 0x0},
+ 846: {region: 0x164, script: 0x5a, flags: 0x0},
+ 847: {region: 0xd1, script: 0x5a, flags: 0x0},
+ 848: {region: 0x60, script: 0x5a, flags: 0x0},
+ 849: {region: 0xdb, script: 0x22, flags: 0x0},
+ 850: {region: 0x165, script: 0x5a, flags: 0x0},
+ 851: {region: 0xdb, script: 0x22, flags: 0x0},
+ 852: {region: 0x165, script: 0x5a, flags: 0x0},
+ 853: {region: 0x165, script: 0x5a, flags: 0x0},
+ 854: {region: 0xd2, script: 0x5a, flags: 0x0},
+ 855: {region: 0x165, script: 0x5a, flags: 0x0},
+ 856: {region: 0x165, script: 0x5a, flags: 0x0},
+ 857: {region: 0xd1, script: 0x5a, flags: 0x0},
+ 858: {region: 0x165, script: 0x5a, flags: 0x0},
+ 859: {region: 0xcf, script: 0x5a, flags: 0x0},
+ 860: {region: 0xcf, script: 0x5a, flags: 0x0},
+ 861: {region: 0x165, script: 0x5a, flags: 0x0},
+ 862: {region: 0x165, script: 0x5a, flags: 0x0},
+ 863: {region: 0x95, script: 0x5a, flags: 0x0},
+ 864: {region: 0x165, script: 0x5a, flags: 0x0},
+ 865: {region: 0xdf, script: 0x5a, flags: 0x0},
+ 866: {region: 0x165, script: 0x5a, flags: 0x0},
+ 867: {region: 0x165, script: 0x5a, flags: 0x0},
+ 868: {region: 0x99, script: 0x5a, flags: 0x0},
+ 869: {region: 0x165, script: 0x5a, flags: 0x0},
+ 870: {region: 0x165, script: 0x5a, flags: 0x0},
+ 871: {region: 0xd9, script: 0x5a, flags: 0x0},
+ 872: {region: 0x52, script: 0x5a, flags: 0x0},
+ 873: {region: 0x165, script: 0x5a, flags: 0x0},
+ 874: {region: 0xda, script: 0x5a, flags: 0x0},
+ 875: {region: 0x165, script: 0x5a, flags: 0x0},
+ 876: {region: 0x52, script: 0x5a, flags: 0x0},
+ 877: {region: 0x165, script: 0x5a, flags: 0x0},
+ 878: {region: 0x165, script: 0x5a, flags: 0x0},
+ 879: {region: 0xda, script: 0x5a, flags: 0x0},
+ 880: {region: 0x123, script: 0x56, flags: 0x0},
+ 881: {region: 0x99, script: 0x22, flags: 0x0},
+ 882: {region: 0x10c, script: 0xc4, flags: 0x0},
+ 883: {region: 0x165, script: 0x5a, flags: 0x0},
+ 884: {region: 0x165, script: 0x5a, flags: 0x0},
+ 885: {region: 0x84, script: 0x7c, flags: 0x0},
+ 886: {region: 0x161, script: 0x5a, flags: 0x0},
+ 887: {region: 0x165, script: 0x5a, flags: 0x0},
+ 888: {region: 0x49, script: 0x17, flags: 0x0},
+ 889: {region: 0x165, script: 0x5a, flags: 0x0},
+ 890: {region: 0x161, script: 0x5a, flags: 0x0},
+ 891: {region: 0x165, script: 0x5a, flags: 0x0},
+ 892: {region: 0x165, script: 0x5a, flags: 0x0},
+ 893: {region: 0x165, script: 0x5a, flags: 0x0},
+ 894: {region: 0x165, script: 0x5a, flags: 0x0},
+ 895: {region: 0x165, script: 0x5a, flags: 0x0},
+ 896: {region: 0x117, script: 0x5a, flags: 0x0},
+ 897: {region: 0x165, script: 0x5a, flags: 0x0},
+ 898: {region: 0x165, script: 0x5a, flags: 0x0},
+ 899: {region: 0x135, script: 0x5a, flags: 0x0},
+ 900: {region: 0x165, script: 0x5a, flags: 0x0},
+ 901: {region: 0x53, script: 0x5a, flags: 0x0},
+ 902: {region: 0x165, script: 0x5a, flags: 0x0},
+ 903: {region: 0xce, script: 0x5a, flags: 0x0},
+ 904: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 905: {region: 0x131, script: 0x5a, flags: 0x0},
+ 906: {region: 0x80, script: 0x5a, flags: 0x0},
+ 907: {region: 0x78, script: 0x5a, flags: 0x0},
+ 908: {region: 0x165, script: 0x5a, flags: 0x0},
+ 910: {region: 0x165, script: 0x5a, flags: 0x0},
+ 911: {region: 0x165, script: 0x5a, flags: 0x0},
+ 912: {region: 0x6f, script: 0x5a, flags: 0x0},
+ 913: {region: 0x165, script: 0x5a, flags: 0x0},
+ 914: {region: 0x165, script: 0x5a, flags: 0x0},
+ 915: {region: 0x165, script: 0x5a, flags: 0x0},
+ 916: {region: 0x165, script: 0x5a, flags: 0x0},
+ 917: {region: 0x99, script: 0x81, flags: 0x0},
+ 918: {region: 0x165, script: 0x5a, flags: 0x0},
+ 919: {region: 0x165, script: 0x5, flags: 0x0},
+ 920: {region: 0x7d, script: 0x20, flags: 0x0},
+ 921: {region: 0x135, script: 0x82, flags: 0x0},
+ 922: {region: 0x165, script: 0x5, flags: 0x0},
+ 923: {region: 0xc5, script: 0x80, flags: 0x0},
+ 924: {region: 0x165, script: 0x5a, flags: 0x0},
+ 925: {region: 0x2c, script: 0x3, flags: 0x1},
+ 926: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 927: {region: 0x2f, script: 0x2, flags: 0x1},
+ 928: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 929: {region: 0x30, script: 0x5a, flags: 0x0},
+ 930: {region: 0xf0, script: 0x5a, flags: 0x0},
+ 931: {region: 0x165, script: 0x5a, flags: 0x0},
+ 932: {region: 0x78, script: 0x5a, flags: 0x0},
+ 933: {region: 0xd6, script: 0x5a, flags: 0x0},
+ 934: {region: 0x135, script: 0x5a, flags: 0x0},
+ 935: {region: 0x49, script: 0x5a, flags: 0x0},
+ 936: {region: 0x165, script: 0x5a, flags: 0x0},
+ 937: {region: 0x9c, script: 0xf0, flags: 0x0},
+ 938: {region: 0x165, script: 0x5a, flags: 0x0},
+ 939: {region: 0x60, script: 0x5a, flags: 0x0},
+ 940: {region: 0x165, script: 0x5, flags: 0x0},
+ 941: {region: 0xb0, script: 0x8b, flags: 0x0},
+ 943: {region: 0x165, script: 0x5a, flags: 0x0},
+ 944: {region: 0x165, script: 0x5a, flags: 0x0},
+ 945: {region: 0x99, script: 0x12, flags: 0x0},
+ 946: {region: 0xa4, script: 0x5a, flags: 0x0},
+ 947: {region: 0xe9, script: 0x5a, flags: 0x0},
+ 948: {region: 0x165, script: 0x5a, flags: 0x0},
+ 949: {region: 0x9e, script: 0x5a, flags: 0x0},
+ 950: {region: 0x165, script: 0x5a, flags: 0x0},
+ 951: {region: 0x165, script: 0x5a, flags: 0x0},
+ 952: {region: 0x87, script: 0x34, flags: 0x0},
+ 953: {region: 0x75, script: 0x5a, flags: 0x0},
+ 954: {region: 0x165, script: 0x5a, flags: 0x0},
+ 955: {region: 0xe8, script: 0x4d, flags: 0x0},
+ 956: {region: 0x9c, script: 0x5, flags: 0x0},
+ 957: {region: 0x1, script: 0x5a, flags: 0x0},
+ 958: {region: 0x24, script: 0x5, flags: 0x0},
+ 959: {region: 0x165, script: 0x5a, flags: 0x0},
+ 960: {region: 0x41, script: 0x5a, flags: 0x0},
+ 961: {region: 0x165, script: 0x5a, flags: 0x0},
+ 962: {region: 0x7a, script: 0x5a, flags: 0x0},
+ 963: {region: 0x165, script: 0x5a, flags: 0x0},
+ 964: {region: 0xe4, script: 0x5a, flags: 0x0},
+ 965: {region: 0x89, script: 0x5a, flags: 0x0},
+ 966: {region: 0x69, script: 0x5a, flags: 0x0},
+ 967: {region: 0x165, script: 0x5a, flags: 0x0},
+ 968: {region: 0x99, script: 0x22, flags: 0x0},
+ 969: {region: 0x165, script: 0x5a, flags: 0x0},
+ 970: {region: 0x102, script: 0x5a, flags: 0x0},
+ 971: {region: 0x95, script: 0x5a, flags: 0x0},
+ 972: {region: 0x165, script: 0x5a, flags: 0x0},
+ 973: {region: 0x165, script: 0x5a, flags: 0x0},
+ 974: {region: 0x9e, script: 0x5a, flags: 0x0},
+ 975: {region: 0x165, script: 0x5, flags: 0x0},
+ 976: {region: 0x99, script: 0x5a, flags: 0x0},
+ 977: {region: 0x31, script: 0x2, flags: 0x1},
+ 978: {region: 0xdb, script: 0x22, flags: 0x0},
+ 979: {region: 0x35, script: 0xe, flags: 0x0},
+ 980: {region: 0x4e, script: 0x5a, flags: 0x0},
+ 981: {region: 0x72, script: 0x5a, flags: 0x0},
+ 982: {region: 0x4e, script: 0x5a, flags: 0x0},
+ 983: {region: 0x9c, script: 0x5, flags: 0x0},
+ 984: {region: 0x10c, script: 0x5a, flags: 0x0},
+ 985: {region: 0x3a, script: 0x5a, flags: 0x0},
+ 986: {region: 0x165, script: 0x5a, flags: 0x0},
+ 987: {region: 0xd1, script: 0x5a, flags: 0x0},
+ 988: {region: 0x104, script: 0x5a, flags: 0x0},
+ 989: {region: 0x95, script: 0x5a, flags: 0x0},
+ 990: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 991: {region: 0x165, script: 0x5a, flags: 0x0},
+ 992: {region: 0x165, script: 0x5a, flags: 0x0},
+ 993: {region: 0x73, script: 0x5a, flags: 0x0},
+ 994: {region: 0x106, script: 0x20, flags: 0x0},
+ 995: {region: 0x130, script: 0x20, flags: 0x0},
+ 996: {region: 0x109, script: 0x5a, flags: 0x0},
+ 997: {region: 0x107, script: 0x5a, flags: 0x0},
+ 998: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 999: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1000: {region: 0xa2, script: 0x4c, flags: 0x0},
+ 1001: {region: 0x99, script: 0x22, flags: 0x0},
+ 1002: {region: 0x80, script: 0x5a, flags: 0x0},
+ 1003: {region: 0x106, script: 0x20, flags: 0x0},
+ 1004: {region: 0xa4, script: 0x5a, flags: 0x0},
+ 1005: {region: 0x95, script: 0x5a, flags: 0x0},
+ 1006: {region: 0x99, script: 0x5a, flags: 0x0},
+ 1007: {region: 0x114, script: 0x5a, flags: 0x0},
+ 1008: {region: 0x99, script: 0xc8, flags: 0x0},
+ 1009: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1010: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1011: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 1012: {region: 0x9e, script: 0x5a, flags: 0x0},
+ 1013: {region: 0x99, script: 0x22, flags: 0x0},
+ 1014: {region: 0x165, script: 0x5, flags: 0x0},
+ 1015: {region: 0x9e, script: 0x5a, flags: 0x0},
+ 1016: {region: 0x7b, script: 0x5a, flags: 0x0},
+ 1017: {region: 0x49, script: 0x5a, flags: 0x0},
+ 1018: {region: 0x33, script: 0x4, flags: 0x1},
+ 1019: {region: 0x9e, script: 0x5a, flags: 0x0},
+ 1020: {region: 0x9c, script: 0x5, flags: 0x0},
+ 1021: {region: 0xda, script: 0x5a, flags: 0x0},
+ 1022: {region: 0x4f, script: 0x5a, flags: 0x0},
+ 1023: {region: 0xd1, script: 0x5a, flags: 0x0},
+ 1024: {region: 0xcf, script: 0x5a, flags: 0x0},
+ 1025: {region: 0xc3, script: 0x5a, flags: 0x0},
+ 1026: {region: 0x4c, script: 0x5a, flags: 0x0},
+ 1027: {region: 0x96, script: 0x7e, flags: 0x0},
+ 1028: {region: 0xb6, script: 0x5a, flags: 0x0},
+ 1029: {region: 0x165, script: 0x2c, flags: 0x0},
+ 1030: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1032: {region: 0xba, script: 0xe3, flags: 0x0},
+ 1033: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1034: {region: 0xc4, script: 0x75, flags: 0x0},
+ 1035: {region: 0x165, script: 0x5, flags: 0x0},
+ 1036: {region: 0xb3, script: 0xcf, flags: 0x0},
+ 1037: {region: 0x6f, script: 0x5a, flags: 0x0},
+ 1038: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1039: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1040: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1041: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1042: {region: 0x111, script: 0x5a, flags: 0x0},
+ 1043: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1044: {region: 0xe8, script: 0x5, flags: 0x0},
+ 1045: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1046: {region: 0x10f, script: 0x5a, flags: 0x0},
+ 1047: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1048: {region: 0xe9, script: 0x5a, flags: 0x0},
+ 1049: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1050: {region: 0x95, script: 0x5a, flags: 0x0},
+ 1051: {region: 0x142, script: 0x5a, flags: 0x0},
+ 1052: {region: 0x10c, script: 0x5a, flags: 0x0},
+ 1054: {region: 0x10c, script: 0x5a, flags: 0x0},
+ 1055: {region: 0x72, script: 0x5a, flags: 0x0},
+ 1056: {region: 0x97, script: 0xc5, flags: 0x0},
+ 1057: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1058: {region: 0x72, script: 0x5a, flags: 0x0},
+ 1059: {region: 0x164, script: 0x5a, flags: 0x0},
+ 1060: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1061: {region: 0xc3, script: 0x5a, flags: 0x0},
+ 1062: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1063: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1064: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1065: {region: 0x115, script: 0x5a, flags: 0x0},
+ 1066: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1067: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1068: {region: 0x123, script: 0xe6, flags: 0x0},
+ 1069: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1070: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1071: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1072: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1073: {region: 0x27, script: 0x5a, flags: 0x0},
+ 1074: {region: 0x37, script: 0x5, flags: 0x1},
+ 1075: {region: 0x99, script: 0xd2, flags: 0x0},
+ 1076: {region: 0x116, script: 0x5a, flags: 0x0},
+ 1077: {region: 0x114, script: 0x5a, flags: 0x0},
+ 1078: {region: 0x99, script: 0x22, flags: 0x0},
+ 1079: {region: 0x161, script: 0x5a, flags: 0x0},
+ 1080: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1081: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1082: {region: 0x6d, script: 0x5a, flags: 0x0},
+ 1083: {region: 0x161, script: 0x5a, flags: 0x0},
+ 1084: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1085: {region: 0x60, script: 0x5a, flags: 0x0},
+ 1086: {region: 0x95, script: 0x5a, flags: 0x0},
+ 1087: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1088: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1089: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 1090: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1091: {region: 0x84, script: 0x5a, flags: 0x0},
+ 1092: {region: 0x10c, script: 0x5a, flags: 0x0},
+ 1093: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 1094: {region: 0x15f, script: 0x5, flags: 0x0},
+ 1095: {region: 0x4b, script: 0x5a, flags: 0x0},
+ 1096: {region: 0x60, script: 0x5a, flags: 0x0},
+ 1097: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1098: {region: 0x99, script: 0x22, flags: 0x0},
+ 1099: {region: 0x95, script: 0x5a, flags: 0x0},
+ 1100: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1101: {region: 0x35, script: 0xe, flags: 0x0},
+ 1102: {region: 0x9b, script: 0xd6, flags: 0x0},
+ 1103: {region: 0xe9, script: 0x5a, flags: 0x0},
+ 1104: {region: 0x99, script: 0xde, flags: 0x0},
+ 1105: {region: 0xdb, script: 0x22, flags: 0x0},
+ 1106: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1107: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1108: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1109: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1110: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1111: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1112: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1113: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1114: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 1115: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1116: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1117: {region: 0x99, script: 0x52, flags: 0x0},
+ 1118: {region: 0x53, script: 0xdc, flags: 0x0},
+ 1119: {region: 0xdb, script: 0x22, flags: 0x0},
+ 1120: {region: 0xdb, script: 0x22, flags: 0x0},
+ 1121: {region: 0x99, script: 0xe1, flags: 0x0},
+ 1122: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1123: {region: 0x112, script: 0x5a, flags: 0x0},
+ 1124: {region: 0x131, script: 0x5a, flags: 0x0},
+ 1125: {region: 0x126, script: 0x5a, flags: 0x0},
+ 1126: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1127: {region: 0x3c, script: 0x3, flags: 0x1},
+ 1128: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1129: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1130: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1131: {region: 0x123, script: 0xe6, flags: 0x0},
+ 1132: {region: 0xdb, script: 0x22, flags: 0x0},
+ 1133: {region: 0xdb, script: 0x22, flags: 0x0},
+ 1134: {region: 0xdb, script: 0x22, flags: 0x0},
+ 1135: {region: 0x6f, script: 0x2c, flags: 0x0},
+ 1136: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1137: {region: 0x6d, script: 0x2c, flags: 0x0},
+ 1138: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1139: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1140: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1141: {region: 0xd6, script: 0x5a, flags: 0x0},
+ 1142: {region: 0x127, script: 0x5a, flags: 0x0},
+ 1143: {region: 0x125, script: 0x5a, flags: 0x0},
+ 1144: {region: 0x32, script: 0x5a, flags: 0x0},
+ 1145: {region: 0xdb, script: 0x22, flags: 0x0},
+ 1146: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 1147: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1148: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1149: {region: 0x32, script: 0x5a, flags: 0x0},
+ 1150: {region: 0xd4, script: 0x5a, flags: 0x0},
+ 1151: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1152: {region: 0x161, script: 0x5a, flags: 0x0},
+ 1153: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1154: {region: 0x129, script: 0x5a, flags: 0x0},
+ 1155: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1156: {region: 0xce, script: 0x5a, flags: 0x0},
+ 1157: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1158: {region: 0xe6, script: 0x5a, flags: 0x0},
+ 1159: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1160: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1161: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1162: {region: 0x12b, script: 0x5a, flags: 0x0},
+ 1163: {region: 0x12b, script: 0x5a, flags: 0x0},
+ 1164: {region: 0x12e, script: 0x5a, flags: 0x0},
+ 1165: {region: 0x165, script: 0x5, flags: 0x0},
+ 1166: {region: 0x161, script: 0x5a, flags: 0x0},
+ 1167: {region: 0x87, script: 0x34, flags: 0x0},
+ 1168: {region: 0xdb, script: 0x22, flags: 0x0},
+ 1169: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 1170: {region: 0x43, script: 0xe7, flags: 0x0},
+ 1171: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1172: {region: 0x106, script: 0x20, flags: 0x0},
+ 1173: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1174: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1175: {region: 0x131, script: 0x5a, flags: 0x0},
+ 1176: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1177: {region: 0x123, script: 0xe6, flags: 0x0},
+ 1178: {region: 0x32, script: 0x5a, flags: 0x0},
+ 1179: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1180: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1181: {region: 0xce, script: 0x5a, flags: 0x0},
+ 1182: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1183: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1184: {region: 0x12d, script: 0x5a, flags: 0x0},
+ 1185: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1187: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1188: {region: 0xd4, script: 0x5a, flags: 0x0},
+ 1189: {region: 0x53, script: 0xdf, flags: 0x0},
+ 1190: {region: 0xe5, script: 0x5a, flags: 0x0},
+ 1191: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1192: {region: 0x106, script: 0x20, flags: 0x0},
+ 1193: {region: 0xba, script: 0x5a, flags: 0x0},
+ 1194: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1195: {region: 0x106, script: 0x20, flags: 0x0},
+ 1196: {region: 0x3f, script: 0x4, flags: 0x1},
+ 1197: {region: 0x11c, script: 0xea, flags: 0x0},
+ 1198: {region: 0x130, script: 0x20, flags: 0x0},
+ 1199: {region: 0x75, script: 0x5a, flags: 0x0},
+ 1200: {region: 0x2a, script: 0x5a, flags: 0x0},
+ 1202: {region: 0x43, script: 0x3, flags: 0x1},
+ 1203: {region: 0x99, script: 0xe, flags: 0x0},
+ 1204: {region: 0xe8, script: 0x5, flags: 0x0},
+ 1205: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1206: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1207: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1208: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1209: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1210: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1211: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1212: {region: 0x46, script: 0x4, flags: 0x1},
+ 1213: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1214: {region: 0xb4, script: 0xeb, flags: 0x0},
+ 1215: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1216: {region: 0x161, script: 0x5a, flags: 0x0},
+ 1217: {region: 0x9e, script: 0x5a, flags: 0x0},
+ 1218: {region: 0x106, script: 0x5a, flags: 0x0},
+ 1219: {region: 0x13e, script: 0x5a, flags: 0x0},
+ 1220: {region: 0x11b, script: 0x5a, flags: 0x0},
+ 1221: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1222: {region: 0x36, script: 0x5a, flags: 0x0},
+ 1223: {region: 0x60, script: 0x5a, flags: 0x0},
+ 1224: {region: 0xd1, script: 0x5a, flags: 0x0},
+ 1225: {region: 0x1, script: 0x5a, flags: 0x0},
+ 1226: {region: 0x106, script: 0x5a, flags: 0x0},
+ 1227: {region: 0x6a, script: 0x5a, flags: 0x0},
+ 1228: {region: 0x12f, script: 0x5a, flags: 0x0},
+ 1229: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1230: {region: 0x36, script: 0x5a, flags: 0x0},
+ 1231: {region: 0x4e, script: 0x5a, flags: 0x0},
+ 1232: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1233: {region: 0x6f, script: 0x2c, flags: 0x0},
+ 1234: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1235: {region: 0xe7, script: 0x5a, flags: 0x0},
+ 1236: {region: 0x2f, script: 0x5a, flags: 0x0},
+ 1237: {region: 0x99, script: 0xe1, flags: 0x0},
+ 1238: {region: 0x99, script: 0x22, flags: 0x0},
+ 1239: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1240: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1241: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1242: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1243: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1244: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1245: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1246: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1247: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1248: {region: 0x140, script: 0x5a, flags: 0x0},
+ 1249: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1250: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1251: {region: 0xa8, script: 0x5, flags: 0x0},
+ 1252: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1253: {region: 0x114, script: 0x5a, flags: 0x0},
+ 1254: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1255: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1256: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1257: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1258: {region: 0x99, script: 0x22, flags: 0x0},
+ 1259: {region: 0x53, script: 0x3b, flags: 0x0},
+ 1260: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1261: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1262: {region: 0x41, script: 0x5a, flags: 0x0},
+ 1263: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1264: {region: 0x12b, script: 0x18, flags: 0x0},
+ 1265: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1266: {region: 0x161, script: 0x5a, flags: 0x0},
+ 1267: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1268: {region: 0x12b, script: 0x62, flags: 0x0},
+ 1269: {region: 0x12b, script: 0x63, flags: 0x0},
+ 1270: {region: 0x7d, script: 0x2e, flags: 0x0},
+ 1271: {region: 0x53, script: 0x67, flags: 0x0},
+ 1272: {region: 0x10b, script: 0x6c, flags: 0x0},
+ 1273: {region: 0x108, script: 0x77, flags: 0x0},
+ 1274: {region: 0x99, script: 0x22, flags: 0x0},
+ 1275: {region: 0x131, script: 0x5a, flags: 0x0},
+ 1276: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1277: {region: 0x9c, script: 0x8e, flags: 0x0},
+ 1278: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1279: {region: 0x15e, script: 0xc7, flags: 0x0},
+ 1280: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1281: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1282: {region: 0xdb, script: 0x22, flags: 0x0},
+ 1283: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1284: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1285: {region: 0xd1, script: 0x5a, flags: 0x0},
+ 1286: {region: 0x75, script: 0x5a, flags: 0x0},
+ 1287: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1288: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1289: {region: 0x52, script: 0x5a, flags: 0x0},
+ 1290: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1291: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1292: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1293: {region: 0x52, script: 0x5a, flags: 0x0},
+ 1294: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1295: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1296: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1297: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1298: {region: 0x1, script: 0x3e, flags: 0x0},
+ 1299: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1300: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1301: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1302: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1303: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1304: {region: 0xd6, script: 0x5a, flags: 0x0},
+ 1305: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1306: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1307: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1308: {region: 0x41, script: 0x5a, flags: 0x0},
+ 1309: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1310: {region: 0xcf, script: 0x5a, flags: 0x0},
+ 1311: {region: 0x4a, script: 0x3, flags: 0x1},
+ 1312: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1313: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1314: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1315: {region: 0x53, script: 0x5a, flags: 0x0},
+ 1316: {region: 0x10b, script: 0x5a, flags: 0x0},
+ 1318: {region: 0xa8, script: 0x5, flags: 0x0},
+ 1319: {region: 0xd9, script: 0x5a, flags: 0x0},
+ 1320: {region: 0xba, script: 0xe3, flags: 0x0},
+ 1321: {region: 0x4d, script: 0x14, flags: 0x1},
+ 1322: {region: 0x53, script: 0x7d, flags: 0x0},
+ 1323: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1324: {region: 0x122, script: 0x5a, flags: 0x0},
+ 1325: {region: 0xd0, script: 0x5a, flags: 0x0},
+ 1326: {region: 0x165, script: 0x5a, flags: 0x0},
+ 1327: {region: 0x161, script: 0x5a, flags: 0x0},
+ 1329: {region: 0x12b, script: 0x5a, flags: 0x0},
+}
+
+// likelyLangList holds lists info associated with likelyLang.
+// Size: 388 bytes, 97 elements
+var likelyLangList = [97]likelyScriptRegion{
+ 0: {region: 0x9c, script: 0x7, flags: 0x0},
+ 1: {region: 0xa1, script: 0x78, flags: 0x2},
+ 2: {region: 0x11c, script: 0x84, flags: 0x2},
+ 3: {region: 0x32, script: 0x5a, flags: 0x0},
+ 4: {region: 0x9b, script: 0x5, flags: 0x4},
+ 5: {region: 0x9c, script: 0x5, flags: 0x4},
+ 6: {region: 0x106, script: 0x20, flags: 0x4},
+ 7: {region: 0x9c, script: 0x5, flags: 0x2},
+ 8: {region: 0x106, script: 0x20, flags: 0x0},
+ 9: {region: 0x38, script: 0x2f, flags: 0x2},
+ 10: {region: 0x135, script: 0x5a, flags: 0x0},
+ 11: {region: 0x7b, script: 0xca, flags: 0x2},
+ 12: {region: 0x114, script: 0x5a, flags: 0x0},
+ 13: {region: 0x84, script: 0x1, flags: 0x2},
+ 14: {region: 0x5d, script: 0x1f, flags: 0x0},
+ 15: {region: 0x87, script: 0x5f, flags: 0x2},
+ 16: {region: 0xd6, script: 0x5a, flags: 0x0},
+ 17: {region: 0x52, script: 0x5, flags: 0x4},
+ 18: {region: 0x10b, script: 0x5, flags: 0x4},
+ 19: {region: 0xae, script: 0x20, flags: 0x0},
+ 20: {region: 0x24, script: 0x5, flags: 0x4},
+ 21: {region: 0x53, script: 0x5, flags: 0x4},
+ 22: {region: 0x9c, script: 0x5, flags: 0x4},
+ 23: {region: 0xc5, script: 0x5, flags: 0x4},
+ 24: {region: 0x53, script: 0x5, flags: 0x2},
+ 25: {region: 0x12b, script: 0x5a, flags: 0x0},
+ 26: {region: 0xb0, script: 0x5, flags: 0x4},
+ 27: {region: 0x9b, script: 0x5, flags: 0x2},
+ 28: {region: 0xa5, script: 0x20, flags: 0x0},
+ 29: {region: 0x53, script: 0x5, flags: 0x4},
+ 30: {region: 0x12b, script: 0x5a, flags: 0x4},
+ 31: {region: 0x53, script: 0x5, flags: 0x2},
+ 32: {region: 0x12b, script: 0x5a, flags: 0x2},
+ 33: {region: 0xdb, script: 0x22, flags: 0x0},
+ 34: {region: 0x99, script: 0x5d, flags: 0x2},
+ 35: {region: 0x83, script: 0x5a, flags: 0x0},
+ 36: {region: 0x84, script: 0x7c, flags: 0x4},
+ 37: {region: 0x84, script: 0x7c, flags: 0x2},
+ 38: {region: 0xc5, script: 0x20, flags: 0x0},
+ 39: {region: 0x53, script: 0x70, flags: 0x4},
+ 40: {region: 0x53, script: 0x70, flags: 0x2},
+ 41: {region: 0xd0, script: 0x5a, flags: 0x0},
+ 42: {region: 0x4a, script: 0x5, flags: 0x4},
+ 43: {region: 0x95, script: 0x5, flags: 0x4},
+ 44: {region: 0x99, script: 0x36, flags: 0x0},
+ 45: {region: 0xe8, script: 0x5, flags: 0x4},
+ 46: {region: 0xe8, script: 0x5, flags: 0x2},
+ 47: {region: 0x9c, script: 0x88, flags: 0x0},
+ 48: {region: 0x53, script: 0x89, flags: 0x2},
+ 49: {region: 0xba, script: 0xe3, flags: 0x0},
+ 50: {region: 0xd9, script: 0x5a, flags: 0x4},
+ 51: {region: 0xe8, script: 0x5, flags: 0x0},
+ 52: {region: 0x99, script: 0x22, flags: 0x2},
+ 53: {region: 0x99, script: 0x4f, flags: 0x2},
+ 54: {region: 0x99, script: 0xce, flags: 0x2},
+ 55: {region: 0x105, script: 0x20, flags: 0x0},
+ 56: {region: 0xbd, script: 0x5a, flags: 0x4},
+ 57: {region: 0x104, script: 0x5a, flags: 0x4},
+ 58: {region: 0x106, script: 0x5a, flags: 0x4},
+ 59: {region: 0x12b, script: 0x5a, flags: 0x4},
+ 60: {region: 0x124, script: 0x20, flags: 0x0},
+ 61: {region: 0xe8, script: 0x5, flags: 0x4},
+ 62: {region: 0xe8, script: 0x5, flags: 0x2},
+ 63: {region: 0x53, script: 0x5, flags: 0x0},
+ 64: {region: 0xae, script: 0x20, flags: 0x4},
+ 65: {region: 0xc5, script: 0x20, flags: 0x4},
+ 66: {region: 0xae, script: 0x20, flags: 0x2},
+ 67: {region: 0x99, script: 0xe, flags: 0x0},
+ 68: {region: 0xdb, script: 0x22, flags: 0x4},
+ 69: {region: 0xdb, script: 0x22, flags: 0x2},
+ 70: {region: 0x137, script: 0x5a, flags: 0x0},
+ 71: {region: 0x24, script: 0x5, flags: 0x4},
+ 72: {region: 0x53, script: 0x20, flags: 0x4},
+ 73: {region: 0x24, script: 0x5, flags: 0x2},
+ 74: {region: 0x8d, script: 0x3c, flags: 0x0},
+ 75: {region: 0x53, script: 0x3b, flags: 0x4},
+ 76: {region: 0x53, script: 0x3b, flags: 0x2},
+ 77: {region: 0x53, script: 0x3b, flags: 0x0},
+ 78: {region: 0x2f, script: 0x3c, flags: 0x4},
+ 79: {region: 0x3e, script: 0x3c, flags: 0x4},
+ 80: {region: 0x7b, script: 0x3c, flags: 0x4},
+ 81: {region: 0x7e, script: 0x3c, flags: 0x4},
+ 82: {region: 0x8d, script: 0x3c, flags: 0x4},
+ 83: {region: 0x95, script: 0x3c, flags: 0x4},
+ 84: {region: 0xc6, script: 0x3c, flags: 0x4},
+ 85: {region: 0xd0, script: 0x3c, flags: 0x4},
+ 86: {region: 0xe2, script: 0x3c, flags: 0x4},
+ 87: {region: 0xe5, script: 0x3c, flags: 0x4},
+ 88: {region: 0xe7, script: 0x3c, flags: 0x4},
+ 89: {region: 0x116, script: 0x3c, flags: 0x4},
+ 90: {region: 0x123, script: 0x3c, flags: 0x4},
+ 91: {region: 0x12e, script: 0x3c, flags: 0x4},
+ 92: {region: 0x135, script: 0x3c, flags: 0x4},
+ 93: {region: 0x13e, script: 0x3c, flags: 0x4},
+ 94: {region: 0x12e, script: 0x11, flags: 0x2},
+ 95: {region: 0x12e, script: 0x37, flags: 0x2},
+ 96: {region: 0x12e, script: 0x3c, flags: 0x2},
+}
+
+type likelyLangScript struct {
+ lang uint16
+ script uint8
+ flags uint8
+}
+
+// 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.
+// Size: 1432 bytes, 358 elements
+var likelyRegion = [358]likelyLangScript{
+ 34: {lang: 0xd7, script: 0x5a, flags: 0x0},
+ 35: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 36: {lang: 0x0, script: 0x2, flags: 0x1},
+ 39: {lang: 0x2, script: 0x2, flags: 0x1},
+ 40: {lang: 0x4, script: 0x2, flags: 0x1},
+ 42: {lang: 0x3c0, script: 0x5a, flags: 0x0},
+ 43: {lang: 0x0, script: 0x5a, flags: 0x0},
+ 44: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 45: {lang: 0x41b, script: 0x5a, flags: 0x0},
+ 46: {lang: 0x10d, script: 0x5a, flags: 0x0},
+ 48: {lang: 0x367, script: 0x5a, flags: 0x0},
+ 49: {lang: 0x444, script: 0x5a, flags: 0x0},
+ 50: {lang: 0x58, script: 0x5a, flags: 0x0},
+ 51: {lang: 0x6, script: 0x2, flags: 0x1},
+ 53: {lang: 0xa5, script: 0xe, flags: 0x0},
+ 54: {lang: 0x367, script: 0x5a, flags: 0x0},
+ 55: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 56: {lang: 0x7e, script: 0x20, flags: 0x0},
+ 57: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 58: {lang: 0x3d9, script: 0x5a, flags: 0x0},
+ 59: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 60: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 62: {lang: 0x31f, script: 0x5a, flags: 0x0},
+ 63: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 64: {lang: 0x3a1, script: 0x5a, flags: 0x0},
+ 65: {lang: 0x3c0, script: 0x5a, flags: 0x0},
+ 67: {lang: 0x8, script: 0x2, flags: 0x1},
+ 69: {lang: 0x0, script: 0x5a, flags: 0x0},
+ 71: {lang: 0x71, script: 0x20, flags: 0x0},
+ 73: {lang: 0x512, script: 0x3e, flags: 0x2},
+ 74: {lang: 0x31f, script: 0x5, flags: 0x2},
+ 75: {lang: 0x445, script: 0x5a, flags: 0x0},
+ 76: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 77: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 78: {lang: 0x10d, script: 0x5a, flags: 0x0},
+ 79: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 81: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 82: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 83: {lang: 0xa, script: 0x4, flags: 0x1},
+ 84: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 85: {lang: 0x0, script: 0x5a, flags: 0x0},
+ 86: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 89: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 90: {lang: 0x3c0, script: 0x5a, flags: 0x0},
+ 91: {lang: 0x3a1, script: 0x5a, flags: 0x0},
+ 93: {lang: 0xe, script: 0x2, flags: 0x1},
+ 94: {lang: 0xfa, script: 0x5a, flags: 0x0},
+ 96: {lang: 0x10d, script: 0x5a, flags: 0x0},
+ 98: {lang: 0x1, script: 0x5a, flags: 0x0},
+ 99: {lang: 0x101, script: 0x5a, flags: 0x0},
+ 101: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 103: {lang: 0x10, script: 0x2, flags: 0x1},
+ 104: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 105: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 106: {lang: 0x140, script: 0x5a, flags: 0x0},
+ 107: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 108: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 109: {lang: 0x46f, script: 0x2c, flags: 0x0},
+ 110: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 111: {lang: 0x12, script: 0x2, flags: 0x1},
+ 113: {lang: 0x10d, script: 0x5a, flags: 0x0},
+ 114: {lang: 0x151, script: 0x5a, flags: 0x0},
+ 115: {lang: 0x1c0, script: 0x22, flags: 0x2},
+ 118: {lang: 0x158, script: 0x5a, flags: 0x0},
+ 120: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 122: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 123: {lang: 0x14, script: 0x2, flags: 0x1},
+ 125: {lang: 0x16, script: 0x3, flags: 0x1},
+ 126: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 128: {lang: 0x21, script: 0x5a, flags: 0x0},
+ 130: {lang: 0x245, script: 0x5a, flags: 0x0},
+ 132: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 133: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 134: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 135: {lang: 0x19, script: 0x2, flags: 0x1},
+ 136: {lang: 0x0, script: 0x5a, flags: 0x0},
+ 137: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 139: {lang: 0x3c0, script: 0x5a, flags: 0x0},
+ 141: {lang: 0x529, script: 0x3c, flags: 0x0},
+ 142: {lang: 0x0, script: 0x5a, flags: 0x0},
+ 143: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 144: {lang: 0x1d1, script: 0x5a, flags: 0x0},
+ 145: {lang: 0x1d4, script: 0x5a, flags: 0x0},
+ 146: {lang: 0x1d5, script: 0x5a, flags: 0x0},
+ 148: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 149: {lang: 0x1b, script: 0x2, flags: 0x1},
+ 151: {lang: 0x1bc, script: 0x3e, flags: 0x0},
+ 153: {lang: 0x1d, script: 0x3, flags: 0x1},
+ 155: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 156: {lang: 0x20, script: 0x2, flags: 0x1},
+ 157: {lang: 0x1f8, script: 0x5a, flags: 0x0},
+ 158: {lang: 0x1f9, script: 0x5a, flags: 0x0},
+ 161: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 162: {lang: 0x200, script: 0x49, flags: 0x0},
+ 164: {lang: 0x445, script: 0x5a, flags: 0x0},
+ 165: {lang: 0x28a, script: 0x20, flags: 0x0},
+ 166: {lang: 0x22, script: 0x3, flags: 0x1},
+ 168: {lang: 0x25, script: 0x2, flags: 0x1},
+ 170: {lang: 0x254, script: 0x53, flags: 0x0},
+ 171: {lang: 0x254, script: 0x53, flags: 0x0},
+ 172: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 174: {lang: 0x3e2, script: 0x20, flags: 0x0},
+ 175: {lang: 0x27, script: 0x2, flags: 0x1},
+ 176: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 178: {lang: 0x10d, script: 0x5a, flags: 0x0},
+ 179: {lang: 0x40c, script: 0xcf, flags: 0x0},
+ 181: {lang: 0x43b, script: 0x5a, flags: 0x0},
+ 182: {lang: 0x2c0, script: 0x5a, flags: 0x0},
+ 183: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 184: {lang: 0x2c7, script: 0x5a, flags: 0x0},
+ 185: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 186: {lang: 0x29, script: 0x2, flags: 0x1},
+ 187: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 188: {lang: 0x2b, script: 0x2, flags: 0x1},
+ 189: {lang: 0x432, script: 0x5a, flags: 0x0},
+ 190: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 191: {lang: 0x2f1, script: 0x5a, flags: 0x0},
+ 194: {lang: 0x2d, script: 0x2, flags: 0x1},
+ 195: {lang: 0xa0, script: 0x5a, flags: 0x0},
+ 196: {lang: 0x2f, script: 0x2, flags: 0x1},
+ 197: {lang: 0x31, script: 0x2, flags: 0x1},
+ 198: {lang: 0x33, script: 0x2, flags: 0x1},
+ 200: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 201: {lang: 0x35, script: 0x2, flags: 0x1},
+ 203: {lang: 0x320, script: 0x5a, flags: 0x0},
+ 204: {lang: 0x37, script: 0x3, flags: 0x1},
+ 205: {lang: 0x128, script: 0xe5, flags: 0x0},
+ 207: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 208: {lang: 0x31f, script: 0x5a, flags: 0x0},
+ 209: {lang: 0x3c0, script: 0x5a, flags: 0x0},
+ 210: {lang: 0x16, script: 0x5a, flags: 0x0},
+ 211: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 212: {lang: 0x1b4, script: 0x5a, flags: 0x0},
+ 214: {lang: 0x1b4, script: 0x5, flags: 0x2},
+ 216: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 217: {lang: 0x367, script: 0x5a, flags: 0x0},
+ 218: {lang: 0x347, script: 0x5a, flags: 0x0},
+ 219: {lang: 0x351, script: 0x22, flags: 0x0},
+ 225: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 226: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 228: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 229: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 230: {lang: 0x486, script: 0x5a, flags: 0x0},
+ 231: {lang: 0x153, script: 0x5a, flags: 0x0},
+ 232: {lang: 0x3a, script: 0x3, flags: 0x1},
+ 233: {lang: 0x3b3, script: 0x5a, flags: 0x0},
+ 234: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 236: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 237: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 238: {lang: 0x3c0, script: 0x5a, flags: 0x0},
+ 240: {lang: 0x3a2, script: 0x5a, flags: 0x0},
+ 241: {lang: 0x194, script: 0x5a, flags: 0x0},
+ 243: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 258: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 260: {lang: 0x3d, script: 0x2, flags: 0x1},
+ 261: {lang: 0x432, script: 0x20, flags: 0x0},
+ 262: {lang: 0x3f, script: 0x2, flags: 0x1},
+ 263: {lang: 0x3e5, script: 0x5a, flags: 0x0},
+ 264: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 266: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 267: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 268: {lang: 0x41, script: 0x2, flags: 0x1},
+ 271: {lang: 0x416, script: 0x5a, flags: 0x0},
+ 272: {lang: 0x347, script: 0x5a, flags: 0x0},
+ 273: {lang: 0x43, script: 0x2, flags: 0x1},
+ 275: {lang: 0x1f9, script: 0x5a, flags: 0x0},
+ 276: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 277: {lang: 0x429, script: 0x5a, flags: 0x0},
+ 278: {lang: 0x367, script: 0x5a, flags: 0x0},
+ 280: {lang: 0x3c0, script: 0x5a, flags: 0x0},
+ 282: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 284: {lang: 0x45, script: 0x2, flags: 0x1},
+ 288: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 289: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 290: {lang: 0x47, script: 0x2, flags: 0x1},
+ 291: {lang: 0x49, script: 0x3, flags: 0x1},
+ 292: {lang: 0x4c, script: 0x2, flags: 0x1},
+ 293: {lang: 0x477, script: 0x5a, flags: 0x0},
+ 294: {lang: 0x3c0, script: 0x5a, flags: 0x0},
+ 295: {lang: 0x476, script: 0x5a, flags: 0x0},
+ 296: {lang: 0x4e, script: 0x2, flags: 0x1},
+ 297: {lang: 0x482, script: 0x5a, flags: 0x0},
+ 299: {lang: 0x50, script: 0x4, flags: 0x1},
+ 301: {lang: 0x4a0, script: 0x5a, flags: 0x0},
+ 302: {lang: 0x54, script: 0x2, flags: 0x1},
+ 303: {lang: 0x445, script: 0x5a, flags: 0x0},
+ 304: {lang: 0x56, script: 0x3, flags: 0x1},
+ 305: {lang: 0x445, script: 0x5a, flags: 0x0},
+ 309: {lang: 0x512, script: 0x3e, flags: 0x2},
+ 310: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 311: {lang: 0x4bc, script: 0x5a, flags: 0x0},
+ 312: {lang: 0x1f9, script: 0x5a, flags: 0x0},
+ 315: {lang: 0x13e, script: 0x5a, flags: 0x0},
+ 318: {lang: 0x4c3, script: 0x5a, flags: 0x0},
+ 319: {lang: 0x8a, script: 0x5a, flags: 0x0},
+ 320: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 322: {lang: 0x41b, script: 0x5a, flags: 0x0},
+ 333: {lang: 0x59, script: 0x2, flags: 0x1},
+ 350: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 351: {lang: 0x5b, script: 0x2, flags: 0x1},
+ 356: {lang: 0x423, script: 0x5a, flags: 0x0},
+}
+
+// likelyRegionList holds lists info associated with likelyRegion.
+// Size: 372 bytes, 93 elements
+var likelyRegionList = [93]likelyLangScript{
+ 0: {lang: 0x148, script: 0x5, flags: 0x0},
+ 1: {lang: 0x476, script: 0x5a, flags: 0x0},
+ 2: {lang: 0x431, script: 0x5a, flags: 0x0},
+ 3: {lang: 0x2ff, script: 0x20, flags: 0x0},
+ 4: {lang: 0x1d7, script: 0x8, flags: 0x0},
+ 5: {lang: 0x274, script: 0x5a, flags: 0x0},
+ 6: {lang: 0xb7, script: 0x5a, flags: 0x0},
+ 7: {lang: 0x432, script: 0x20, flags: 0x0},
+ 8: {lang: 0x12d, script: 0xe7, flags: 0x0},
+ 9: {lang: 0x351, script: 0x22, flags: 0x0},
+ 10: {lang: 0x529, script: 0x3b, flags: 0x0},
+ 11: {lang: 0x4ac, script: 0x5, flags: 0x0},
+ 12: {lang: 0x523, script: 0x5a, flags: 0x0},
+ 13: {lang: 0x29a, script: 0xe6, flags: 0x0},
+ 14: {lang: 0x136, script: 0x34, flags: 0x0},
+ 15: {lang: 0x48a, script: 0x5a, flags: 0x0},
+ 16: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 17: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 18: {lang: 0x27, script: 0x2c, flags: 0x0},
+ 19: {lang: 0x139, script: 0x5a, flags: 0x0},
+ 20: {lang: 0x26a, script: 0x5, flags: 0x2},
+ 21: {lang: 0x512, script: 0x3e, flags: 0x2},
+ 22: {lang: 0x210, script: 0x2e, flags: 0x0},
+ 23: {lang: 0x5, script: 0x20, flags: 0x0},
+ 24: {lang: 0x274, script: 0x5a, flags: 0x0},
+ 25: {lang: 0x136, script: 0x34, flags: 0x0},
+ 26: {lang: 0x2ff, script: 0x20, flags: 0x0},
+ 27: {lang: 0x1e1, script: 0x5a, flags: 0x0},
+ 28: {lang: 0x31f, script: 0x5, flags: 0x0},
+ 29: {lang: 0x1be, script: 0x22, flags: 0x0},
+ 30: {lang: 0x4b4, script: 0x5, flags: 0x0},
+ 31: {lang: 0x236, script: 0x75, flags: 0x0},
+ 32: {lang: 0x148, script: 0x5, flags: 0x0},
+ 33: {lang: 0x476, script: 0x5a, flags: 0x0},
+ 34: {lang: 0x24a, script: 0x4e, flags: 0x0},
+ 35: {lang: 0xe6, script: 0x5, flags: 0x0},
+ 36: {lang: 0x226, script: 0xe6, flags: 0x0},
+ 37: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 38: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 39: {lang: 0x2b8, script: 0x57, flags: 0x0},
+ 40: {lang: 0x226, script: 0xe6, flags: 0x0},
+ 41: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 42: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 43: {lang: 0x3dc, script: 0x5a, flags: 0x0},
+ 44: {lang: 0x4ae, script: 0x20, flags: 0x0},
+ 45: {lang: 0x2ff, script: 0x20, flags: 0x0},
+ 46: {lang: 0x431, script: 0x5a, flags: 0x0},
+ 47: {lang: 0x331, script: 0x75, flags: 0x0},
+ 48: {lang: 0x213, script: 0x5a, flags: 0x0},
+ 49: {lang: 0x30b, script: 0x20, flags: 0x0},
+ 50: {lang: 0x242, script: 0x5, flags: 0x0},
+ 51: {lang: 0x529, script: 0x3c, flags: 0x0},
+ 52: {lang: 0x3c0, script: 0x5a, flags: 0x0},
+ 53: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 54: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 55: {lang: 0x2ed, script: 0x5a, flags: 0x0},
+ 56: {lang: 0x4b4, script: 0x5, flags: 0x0},
+ 57: {lang: 0x88, script: 0x22, flags: 0x0},
+ 58: {lang: 0x4b4, script: 0x5, flags: 0x0},
+ 59: {lang: 0x4b4, script: 0x5, flags: 0x0},
+ 60: {lang: 0xbe, script: 0x22, flags: 0x0},
+ 61: {lang: 0x3dc, script: 0x5a, flags: 0x0},
+ 62: {lang: 0x7e, script: 0x20, flags: 0x0},
+ 63: {lang: 0x3e2, script: 0x20, flags: 0x0},
+ 64: {lang: 0x267, script: 0x5a, flags: 0x0},
+ 65: {lang: 0x444, script: 0x5a, flags: 0x0},
+ 66: {lang: 0x512, script: 0x3e, flags: 0x0},
+ 67: {lang: 0x412, script: 0x5a, flags: 0x0},
+ 68: {lang: 0x4ae, script: 0x20, flags: 0x0},
+ 69: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 70: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 71: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 72: {lang: 0x35, script: 0x5, flags: 0x0},
+ 73: {lang: 0x46b, script: 0xe6, flags: 0x0},
+ 74: {lang: 0x2ec, script: 0x5, flags: 0x0},
+ 75: {lang: 0x30f, script: 0x75, flags: 0x0},
+ 76: {lang: 0x467, script: 0x20, flags: 0x0},
+ 77: {lang: 0x148, script: 0x5, flags: 0x0},
+ 78: {lang: 0x3a, script: 0x5, flags: 0x0},
+ 79: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 80: {lang: 0x48a, script: 0x5a, flags: 0x0},
+ 81: {lang: 0x58, script: 0x5, flags: 0x0},
+ 82: {lang: 0x219, script: 0x20, flags: 0x0},
+ 83: {lang: 0x81, script: 0x34, flags: 0x0},
+ 84: {lang: 0x529, script: 0x3c, flags: 0x0},
+ 85: {lang: 0x48c, script: 0x5a, flags: 0x0},
+ 86: {lang: 0x4ae, script: 0x20, flags: 0x0},
+ 87: {lang: 0x512, script: 0x3e, flags: 0x0},
+ 88: {lang: 0x3b3, script: 0x5a, flags: 0x0},
+ 89: {lang: 0x431, script: 0x5a, flags: 0x0},
+ 90: {lang: 0x432, script: 0x20, flags: 0x0},
+ 91: {lang: 0x15e, script: 0x5a, flags: 0x0},
+ 92: {lang: 0x446, script: 0x5, flags: 0x0},
+}
+
+type likelyTag struct {
+ lang uint16
+ region uint16
+ script uint8
+}
+
+// Size: 198 bytes, 33 elements
+var likelyRegionGroup = [33]likelyTag{
+ 1: {lang: 0x139, region: 0xd6, script: 0x5a},
+ 2: {lang: 0x139, region: 0x135, script: 0x5a},
+ 3: {lang: 0x3c0, region: 0x41, script: 0x5a},
+ 4: {lang: 0x139, region: 0x2f, script: 0x5a},
+ 5: {lang: 0x139, region: 0xd6, script: 0x5a},
+ 6: {lang: 0x13e, region: 0xcf, script: 0x5a},
+ 7: {lang: 0x445, region: 0x12f, script: 0x5a},
+ 8: {lang: 0x3a, region: 0x6b, script: 0x5},
+ 9: {lang: 0x445, region: 0x4b, script: 0x5a},
+ 10: {lang: 0x139, region: 0x161, script: 0x5a},
+ 11: {lang: 0x139, region: 0x135, script: 0x5a},
+ 12: {lang: 0x139, region: 0x135, script: 0x5a},
+ 13: {lang: 0x13e, region: 0x59, script: 0x5a},
+ 14: {lang: 0x529, region: 0x53, script: 0x3b},
+ 15: {lang: 0x1be, region: 0x99, script: 0x22},
+ 16: {lang: 0x1e1, region: 0x95, script: 0x5a},
+ 17: {lang: 0x1f9, region: 0x9e, script: 0x5a},
+ 18: {lang: 0x139, region: 0x2f, script: 0x5a},
+ 19: {lang: 0x139, region: 0xe6, script: 0x5a},
+ 20: {lang: 0x139, region: 0x8a, script: 0x5a},
+ 21: {lang: 0x41b, region: 0x142, script: 0x5a},
+ 22: {lang: 0x529, region: 0x53, script: 0x3b},
+ 23: {lang: 0x4bc, region: 0x137, script: 0x5a},
+ 24: {lang: 0x3a, region: 0x108, script: 0x5},
+ 25: {lang: 0x3e2, region: 0x106, script: 0x20},
+ 26: {lang: 0x3e2, region: 0x106, script: 0x20},
+ 27: {lang: 0x139, region: 0x7b, script: 0x5a},
+ 28: {lang: 0x10d, region: 0x60, script: 0x5a},
+ 29: {lang: 0x139, region: 0xd6, script: 0x5a},
+ 30: {lang: 0x13e, region: 0x1f, script: 0x5a},
+ 31: {lang: 0x139, region: 0x9a, script: 0x5a},
+ 32: {lang: 0x139, region: 0x7b, script: 0x5a},
+}
+
+// Size: 264 bytes, 33 elements
+var regionContainment = [33]uint64{
+ // Entry 0 - 1F
+ 0x00000001ffffffff, 0x00000000200007a2, 0x0000000000003044, 0x0000000000000008,
+ 0x00000000803c0010, 0x0000000000000020, 0x0000000000000040, 0x0000000000000080,
+ 0x0000000000000100, 0x0000000000000200, 0x0000000000000400, 0x000000004000384c,
+ 0x0000000000001000, 0x0000000000002000, 0x0000000000004000, 0x0000000000008000,
+ 0x0000000000010000, 0x0000000000020000, 0x0000000000040000, 0x0000000000080000,
+ 0x0000000000100000, 0x0000000000200000, 0x0000000001c1c000, 0x0000000000800000,
+ 0x0000000001000000, 0x000000001e020000, 0x0000000004000000, 0x0000000008000000,
+ 0x0000000010000000, 0x00000000200006a0, 0x0000000040002048, 0x0000000080000000,
+ // Entry 20 - 3F
+ 0x0000000100000000,
+}
+
+// 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.
+// Size: 358 bytes, 358 elements
+var regionInclusion = [358]uint8{
+ // Entry 0 - 3F
+ 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
+ 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
+ 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
+ 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
+ 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x26, 0x23,
+ 0x24, 0x26, 0x27, 0x22, 0x28, 0x29, 0x2a, 0x2b,
+ 0x26, 0x2c, 0x24, 0x23, 0x26, 0x25, 0x2a, 0x2d,
+ 0x2e, 0x24, 0x2f, 0x2d, 0x26, 0x30, 0x31, 0x28,
+ // Entry 40 - 7F
+ 0x26, 0x28, 0x26, 0x25, 0x31, 0x22, 0x32, 0x33,
+ 0x34, 0x30, 0x22, 0x27, 0x27, 0x27, 0x35, 0x2d,
+ 0x29, 0x28, 0x27, 0x36, 0x28, 0x22, 0x34, 0x23,
+ 0x21, 0x26, 0x2d, 0x26, 0x22, 0x37, 0x2e, 0x35,
+ 0x2a, 0x22, 0x2f, 0x38, 0x26, 0x26, 0x21, 0x39,
+ 0x39, 0x28, 0x38, 0x39, 0x39, 0x2f, 0x3a, 0x2f,
+ 0x20, 0x21, 0x38, 0x3b, 0x28, 0x3c, 0x2c, 0x21,
+ 0x2a, 0x35, 0x27, 0x38, 0x26, 0x24, 0x28, 0x2c,
+ // Entry 80 - BF
+ 0x2d, 0x23, 0x30, 0x2d, 0x2d, 0x26, 0x27, 0x3a,
+ 0x22, 0x34, 0x3c, 0x2d, 0x28, 0x36, 0x22, 0x34,
+ 0x3a, 0x26, 0x2e, 0x21, 0x39, 0x31, 0x38, 0x24,
+ 0x2c, 0x25, 0x22, 0x24, 0x25, 0x2c, 0x3a, 0x2c,
+ 0x26, 0x24, 0x36, 0x21, 0x2f, 0x3d, 0x31, 0x3c,
+ 0x2f, 0x26, 0x36, 0x36, 0x24, 0x26, 0x3d, 0x31,
+ 0x24, 0x26, 0x35, 0x25, 0x2d, 0x32, 0x38, 0x2a,
+ 0x38, 0x39, 0x39, 0x35, 0x33, 0x23, 0x26, 0x2f,
+ // Entry C0 - FF
+ 0x3c, 0x21, 0x23, 0x2d, 0x31, 0x36, 0x36, 0x3c,
+ 0x26, 0x2d, 0x26, 0x3a, 0x2f, 0x25, 0x2f, 0x34,
+ 0x31, 0x2f, 0x32, 0x3b, 0x2d, 0x2b, 0x2d, 0x21,
+ 0x34, 0x2a, 0x2c, 0x25, 0x21, 0x3c, 0x24, 0x29,
+ 0x2b, 0x24, 0x34, 0x21, 0x28, 0x29, 0x3b, 0x31,
+ 0x25, 0x2e, 0x30, 0x29, 0x26, 0x24, 0x3a, 0x21,
+ 0x3c, 0x28, 0x21, 0x24, 0x21, 0x21, 0x1f, 0x21,
+ 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21,
+ // Entry 100 - 13F
+ 0x21, 0x21, 0x2f, 0x21, 0x2e, 0x23, 0x33, 0x2f,
+ 0x24, 0x3b, 0x2f, 0x39, 0x38, 0x31, 0x2d, 0x3a,
+ 0x2c, 0x2e, 0x2d, 0x23, 0x2d, 0x2f, 0x28, 0x2f,
+ 0x27, 0x33, 0x34, 0x26, 0x24, 0x32, 0x22, 0x26,
+ 0x27, 0x22, 0x2d, 0x31, 0x3d, 0x29, 0x31, 0x3d,
+ 0x39, 0x29, 0x31, 0x24, 0x26, 0x29, 0x36, 0x2f,
+ 0x33, 0x2f, 0x21, 0x22, 0x21, 0x30, 0x28, 0x3d,
+ 0x23, 0x26, 0x21, 0x28, 0x26, 0x26, 0x31, 0x3b,
+ // Entry 140 - 17F
+ 0x29, 0x21, 0x29, 0x21, 0x21, 0x21, 0x21, 0x21,
+ 0x21, 0x21, 0x21, 0x21, 0x21, 0x23, 0x21, 0x21,
+ 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21,
+ 0x21, 0x21, 0x21, 0x21, 0x21, 0x24, 0x24, 0x2f,
+ 0x23, 0x32, 0x2f, 0x27, 0x2f, 0x21,
+}
+
+// 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.
+// Size: 584 bytes, 73 elements
+var regionInclusionBits = [73]uint64{
+ // Entry 0 - 1F
+ 0x0000000102400813, 0x00000000200007a3, 0x0000000000003844, 0x0000000040000808,
+ 0x00000000803c0011, 0x0000000020000022, 0x0000000040000844, 0x0000000020000082,
+ 0x0000000000000102, 0x0000000020000202, 0x0000000020000402, 0x000000004000384d,
+ 0x0000000000001804, 0x0000000040002804, 0x0000000000404000, 0x0000000000408000,
+ 0x0000000000410000, 0x0000000002020000, 0x0000000000040010, 0x0000000000080010,
+ 0x0000000000100010, 0x0000000000200010, 0x0000000001c1c001, 0x0000000000c00000,
+ 0x0000000001400000, 0x000000001e020001, 0x0000000006000000, 0x000000000a000000,
+ 0x0000000012000000, 0x00000000200006a2, 0x0000000040002848, 0x0000000080000010,
+ // Entry 20 - 3F
+ 0x0000000100000001, 0x0000000000000001, 0x0000000080000000, 0x0000000000020000,
+ 0x0000000001000000, 0x0000000000008000, 0x0000000000002000, 0x0000000000000200,
+ 0x0000000000000008, 0x0000000000200000, 0x0000000110000000, 0x0000000000040000,
+ 0x0000000008000000, 0x0000000000000020, 0x0000000104000000, 0x0000000000000080,
+ 0x0000000000001000, 0x0000000000010000, 0x0000000000000400, 0x0000000004000000,
+ 0x0000000000000040, 0x0000000010000000, 0x0000000000004000, 0x0000000101000000,
+ 0x0000000108000000, 0x0000000000000100, 0x0000000100020000, 0x0000000000080000,
+ 0x0000000000100000, 0x0000000000800000, 0x00000001ffffffff, 0x0000000122400fb3,
+ // Entry 40 - 5F
+ 0x00000001827c0813, 0x000000014240385f, 0x0000000103c1c813, 0x000000011e420813,
+ 0x0000000112000001, 0x0000000106000001, 0x0000000101400001, 0x000000010a000001,
+ 0x0000000102020001,
+}
+
+// regionInclusionNext marks, for each entry in regionInclusionBits, the set of
+// all groups that are reachable from the groups set in the respective entry.
+// Size: 73 bytes, 73 elements
+var regionInclusionNext = [73]uint8{
+ // Entry 0 - 3F
+ 0x3e, 0x3f, 0x0b, 0x0b, 0x40, 0x01, 0x0b, 0x01,
+ 0x01, 0x01, 0x01, 0x41, 0x0b, 0x0b, 0x16, 0x16,
+ 0x16, 0x19, 0x04, 0x04, 0x04, 0x04, 0x42, 0x16,
+ 0x16, 0x43, 0x19, 0x19, 0x19, 0x01, 0x0b, 0x04,
+ 0x00, 0x00, 0x1f, 0x11, 0x18, 0x0f, 0x0d, 0x09,
+ 0x03, 0x15, 0x44, 0x12, 0x1b, 0x05, 0x45, 0x07,
+ 0x0c, 0x10, 0x0a, 0x1a, 0x06, 0x1c, 0x0e, 0x46,
+ 0x47, 0x08, 0x48, 0x13, 0x14, 0x17, 0x3e, 0x3e,
+ // Entry 40 - 7F
+ 0x3e, 0x3e, 0x3e, 0x3e, 0x43, 0x43, 0x42, 0x43,
+ 0x43,
+}
+
+type parentRel struct {
+ lang uint16
+ script uint8
+ maxScript uint8
+ toRegion uint16
+ fromRegion []uint16
+}
+
+// Size: 414 bytes, 5 elements
+var parents = [5]parentRel{
+ 0: {lang: 0x139, script: 0x0, maxScript: 0x5a, toRegion: 0x1, fromRegion: []uint16{0x1a, 0x25, 0x26, 0x2f, 0x34, 0x36, 0x3d, 0x42, 0x46, 0x48, 0x49, 0x4a, 0x50, 0x52, 0x5c, 0x5d, 0x61, 0x64, 0x6d, 0x73, 0x74, 0x75, 0x7b, 0x7c, 0x7f, 0x80, 0x81, 0x83, 0x8c, 0x8d, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9f, 0xa0, 0xa4, 0xa7, 0xa9, 0xad, 0xb1, 0xb4, 0xb5, 0xbf, 0xc6, 0xca, 0xcb, 0xcc, 0xce, 0xd0, 0xd2, 0xd5, 0xd6, 0xdd, 0xdf, 0xe0, 0xe6, 0xe7, 0xe8, 0xeb, 0xf0, 0x107, 0x109, 0x10a, 0x10b, 0x10d, 0x10e, 0x112, 0x117, 0x11b, 0x11d, 0x11f, 0x125, 0x129, 0x12c, 0x12d, 0x12f, 0x131, 0x139, 0x13c, 0x13f, 0x142, 0x161, 0x162, 0x164}},
+ 1: {lang: 0x139, script: 0x0, maxScript: 0x5a, toRegion: 0x1a, fromRegion: []uint16{0x2e, 0x4e, 0x60, 0x63, 0x72, 0xd9, 0x10c, 0x10f}},
+ 2: {lang: 0x13e, script: 0x0, maxScript: 0x5a, toRegion: 0x1f, fromRegion: []uint16{0x2c, 0x3f, 0x41, 0x48, 0x51, 0x54, 0x56, 0x59, 0x65, 0x69, 0x89, 0x8f, 0xcf, 0xd8, 0xe2, 0xe4, 0xec, 0xf1, 0x11a, 0x135, 0x136, 0x13b}},
+ 3: {lang: 0x3c0, script: 0x0, maxScript: 0x5a, toRegion: 0xee, fromRegion: []uint16{0x2a, 0x4e, 0x5a, 0x86, 0x8b, 0xb7, 0xc6, 0xd1, 0x118, 0x126}},
+ 4: {lang: 0x529, script: 0x3c, maxScript: 0x3c, toRegion: 0x8d, fromRegion: []uint16{0xc6}},
+}
+
+// Total table size 26398 bytes (25KiB); checksum: 1C859EA7
diff --git a/vendor/golang.org/x/text/internal/language/tags.go b/vendor/golang.org/x/text/internal/language/tags.go
new file mode 100644
index 000000000..e7afd3188
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/language/tags.go
@@ -0,0 +1,48 @@
+// 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 language
+
+// MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed.
+// It simplifies safe initialization of Tag values.
+func MustParse(s string) Tag {
+ t, err := Parse(s)
+ if err != nil {
+ panic(err)
+ }
+ return t
+}
+
+// MustParseBase is like ParseBase, but panics if the given base cannot be parsed.
+// It simplifies safe initialization of Base values.
+func MustParseBase(s string) Language {
+ b, err := ParseBase(s)
+ if err != nil {
+ panic(err)
+ }
+ return b
+}
+
+// MustParseScript is like ParseScript, but panics if the given script cannot be
+// parsed. It simplifies safe initialization of Script values.
+func MustParseScript(s string) Script {
+ scr, err := ParseScript(s)
+ if err != nil {
+ panic(err)
+ }
+ return scr
+}
+
+// MustParseRegion is like ParseRegion, but panics if the given region cannot be
+// parsed. It simplifies safe initialization of Region values.
+func MustParseRegion(s string) Region {
+ r, err := ParseRegion(s)
+ if err != nil {
+ panic(err)
+ }
+ return r
+}
+
+// Und is the root language.
+var Und Tag
diff --git a/vendor/golang.org/x/text/internal/tag/tag.go b/vendor/golang.org/x/text/internal/tag/tag.go
new file mode 100644
index 000000000..b5d348891
--- /dev/null
+++ b/vendor/golang.org/x/text/internal/tag/tag.go
@@ -0,0 +1,100 @@
+// 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 tag contains functionality handling tags and related data.
+package tag // import "golang.org/x/text/internal/tag"
+
+import "sort"
+
+// An Index converts tags to a compact numeric value.
+//
+// All elements are of size 4. Tags may be up to 4 bytes long. Excess bytes can
+// be used to store additional information about the tag.
+type Index string
+
+// Elem returns the element data at the given index.
+func (s Index) Elem(x int) string {
+ return string(s[x*4 : x*4+4])
+}
+
+// Index reports the index of the given key or -1 if it could not be found.
+// Only the first len(key) bytes from the start of the 4-byte entries will be
+// considered for the search and the first match in Index will be returned.
+func (s Index) Index(key []byte) int {
+ n := len(key)
+ // search the index of the first entry with an equal or higher value than
+ // key in s.
+ index := sort.Search(len(s)/4, func(i int) bool {
+ return cmp(s[i*4:i*4+n], key) != -1
+ })
+ i := index * 4
+ if cmp(s[i:i+len(key)], key) != 0 {
+ return -1
+ }
+ return index
+}
+
+// Next finds the next occurrence of key after index x, which must have been
+// obtained from a call to Index using the same key. It returns x+1 or -1.
+func (s Index) Next(key []byte, x int) int {
+ if x++; x*4 < len(s) && cmp(s[x*4:x*4+len(key)], key) == 0 {
+ return x
+ }
+ return -1
+}
+
+// cmp returns an integer comparing a and b lexicographically.
+func cmp(a Index, b []byte) int {
+ n := len(a)
+ if len(b) < n {
+ n = len(b)
+ }
+ for i, c := range b[:n] {
+ switch {
+ case a[i] > c:
+ return 1
+ case a[i] < c:
+ return -1
+ }
+ }
+ switch {
+ case len(a) < len(b):
+ return -1
+ case len(a) > len(b):
+ return 1
+ }
+ return 0
+}
+
+// Compare returns an integer comparing a and b lexicographically.
+func Compare(a string, b []byte) int {
+ return cmp(Index(a), b)
+}
+
+// FixCase reformats b to the same pattern of cases as form.
+// If returns false if string b is malformed.
+func FixCase(form string, b []byte) bool {
+ if len(form) != len(b) {
+ return false
+ }
+ for i, c := range b {
+ if form[i] <= 'Z' {
+ if c >= 'a' {
+ c -= 'z' - 'Z'
+ }
+ if c < 'A' || 'Z' < c {
+ return false
+ }
+ } else {
+ if c <= 'Z' {
+ c += 'z' - 'Z'
+ }
+ if c < 'a' || 'z' < c {
+ return false
+ }
+ }
+ b[i] = c
+ }
+ return true
+}
diff --git a/vendor/golang.org/x/text/language/coverage.go b/vendor/golang.org/x/text/language/coverage.go
new file mode 100644
index 000000000..a24fd1a4d
--- /dev/null
+++ b/vendor/golang.org/x/text/language/coverage.go
@@ -0,0 +1,187 @@
+// 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 language
+
+import (
+ "fmt"
+ "sort"
+
+ "golang.org/x/text/internal/language"
+)
+
+// The Coverage interface is used to define the level of coverage of an
+// internationalization service. Note that not all types are supported by all
+// services. As lists may be generated on the fly, it is recommended that users
+// of a Coverage cache the results.
+type Coverage interface {
+ // Tags returns the list of supported tags.
+ Tags() []Tag
+
+ // BaseLanguages returns the list of supported base languages.
+ BaseLanguages() []Base
+
+ // Scripts returns the list of supported scripts.
+ Scripts() []Script
+
+ // Regions returns the list of supported regions.
+ Regions() []Region
+}
+
+var (
+ // Supported defines a Coverage that lists all supported subtags. Tags
+ // always returns nil.
+ Supported Coverage = allSubtags{}
+)
+
+// TODO:
+// - Support Variants, numbering systems.
+// - CLDR coverage levels.
+// - Set of common tags defined in this package.
+
+type allSubtags struct{}
+
+// Regions returns the list of supported regions. As all regions are in a
+// consecutive range, it simply returns a slice of numbers in increasing order.
+// The "undefined" region is not returned.
+func (s allSubtags) Regions() []Region {
+ reg := make([]Region, language.NumRegions)
+ for i := range reg {
+ reg[i] = Region{language.Region(i + 1)}
+ }
+ return reg
+}
+
+// Scripts returns the list of supported scripts. As all scripts are in a
+// consecutive range, it simply returns a slice of numbers in increasing order.
+// The "undefined" script is not returned.
+func (s allSubtags) Scripts() []Script {
+ scr := make([]Script, language.NumScripts)
+ for i := range scr {
+ scr[i] = Script{language.Script(i + 1)}
+ }
+ return scr
+}
+
+// BaseLanguages returns the list of all supported base languages. It generates
+// the list by traversing the internal structures.
+func (s allSubtags) BaseLanguages() []Base {
+ bs := language.BaseLanguages()
+ base := make([]Base, len(bs))
+ for i, b := range bs {
+ base[i] = Base{b}
+ }
+ return base
+}
+
+// Tags always returns nil.
+func (s allSubtags) Tags() []Tag {
+ return nil
+}
+
+// coverage is used by NewCoverage which is used as a convenient way for
+// creating Coverage implementations for partially defined data. Very often a
+// package will only need to define a subset of slices. coverage provides a
+// convenient way to do this. Moreover, packages using NewCoverage, instead of
+// their own implementation, will not break if later new slice types are added.
+type coverage struct {
+ tags func() []Tag
+ bases func() []Base
+ scripts func() []Script
+ regions func() []Region
+}
+
+func (s *coverage) Tags() []Tag {
+ if s.tags == nil {
+ return nil
+ }
+ return s.tags()
+}
+
+// bases implements sort.Interface and is used to sort base languages.
+type bases []Base
+
+func (b bases) Len() int {
+ return len(b)
+}
+
+func (b bases) Swap(i, j int) {
+ b[i], b[j] = b[j], b[i]
+}
+
+func (b bases) Less(i, j int) bool {
+ return b[i].langID < b[j].langID
+}
+
+// BaseLanguages returns the result from calling s.bases if it is specified or
+// otherwise derives the set of supported base languages from tags.
+func (s *coverage) BaseLanguages() []Base {
+ if s.bases == nil {
+ tags := s.Tags()
+ if len(tags) == 0 {
+ return nil
+ }
+ a := make([]Base, len(tags))
+ for i, t := range tags {
+ a[i] = Base{language.Language(t.lang())}
+ }
+ sort.Sort(bases(a))
+ k := 0
+ for i := 1; i < len(a); i++ {
+ if a[k] != a[i] {
+ k++
+ a[k] = a[i]
+ }
+ }
+ return a[:k+1]
+ }
+ return s.bases()
+}
+
+func (s *coverage) Scripts() []Script {
+ if s.scripts == nil {
+ return nil
+ }
+ return s.scripts()
+}
+
+func (s *coverage) Regions() []Region {
+ if s.regions == nil {
+ return nil
+ }
+ return s.regions()
+}
+
+// NewCoverage returns a Coverage for the given lists. It is typically used by
+// packages providing internationalization services to define their level of
+// coverage. A list may be of type []T or func() []T, where T is either Tag,
+// Base, Script or Region. The returned Coverage derives the value for Bases
+// from Tags if no func or slice for []Base is specified. For other unspecified
+// types the returned Coverage will return nil for the respective methods.
+func NewCoverage(list ...interface{}) Coverage {
+ s := &coverage{}
+ for _, x := range list {
+ switch v := x.(type) {
+ case func() []Base:
+ s.bases = v
+ case func() []Script:
+ s.scripts = v
+ case func() []Region:
+ s.regions = v
+ case func() []Tag:
+ s.tags = v
+ case []Base:
+ s.bases = func() []Base { return v }
+ case []Script:
+ s.scripts = func() []Script { return v }
+ case []Region:
+ s.regions = func() []Region { return v }
+ case []Tag:
+ s.tags = func() []Tag { return v }
+ default:
+ panic(fmt.Sprintf("language: unsupported set type %T", v))
+ }
+ }
+ return s
+}
diff --git a/vendor/golang.org/x/text/language/doc.go b/vendor/golang.org/x/text/language/doc.go
new file mode 100644
index 000000000..8afecd50e
--- /dev/null
+++ b/vendor/golang.org/x/text/language/doc.go
@@ -0,0 +1,102 @@
+// Copyright 2017 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 language implements BCP 47 language tags and related functionality.
+//
+// The most important function of package language is to match a list of
+// user-preferred languages to a list of supported languages.
+// It alleviates the developer of dealing with the complexity of this process
+// and provides the user with the best experience
+// (see https://blog.golang.org/matchlang).
+//
+//
+// Matching preferred against supported languages
+//
+// A Matcher for an application that supports English, Australian English,
+// Danish, and standard Mandarin can be created as follows:
+//
+// var matcher = language.NewMatcher([]language.Tag{
+// language.English, // The first language is used as fallback.
+// language.MustParse("en-AU"),
+// language.Danish,
+// language.Chinese,
+// })
+//
+// This list of supported languages is typically implied by the languages for
+// which there exists translations of the user interface.
+//
+// User-preferred languages usually come as a comma-separated list of BCP 47
+// language tags.
+// The MatchString finds best matches for such strings:
+//
+// handler(w http.ResponseWriter, r *http.Request) {
+// lang, _ := r.Cookie("lang")
+// accept := r.Header.Get("Accept-Language")
+// tag, _ := language.MatchStrings(matcher, lang.String(), accept)
+//
+// // tag should now be used for the initialization of any
+// // locale-specific service.
+// }
+//
+// The Matcher's Match method can be used to match Tags directly.
+//
+// Matchers are aware of the intricacies of equivalence between languages, such
+// as deprecated subtags, legacy tags, macro languages, mutual
+// intelligibility between scripts and languages, and transparently passing
+// BCP 47 user configuration.
+// For instance, it will know that a reader of Bokmål Danish can read Norwegian
+// and will know that Cantonese ("yue") is a good match for "zh-HK".
+//
+//
+// Using match results
+//
+// To guarantee a consistent user experience to the user it is important to
+// use the same language tag for the selection of any locale-specific services.
+// For example, it is utterly confusing to substitute spelled-out numbers
+// or dates in one language in text of another language.
+// More subtly confusing is using the wrong sorting order or casing
+// algorithm for a certain language.
+//
+// All the packages in x/text that provide locale-specific services
+// (e.g. collate, cases) should be initialized with the tag that was
+// obtained at the start of an interaction with the user.
+//
+// Note that Tag that is returned by Match and MatchString may differ from any
+// of the supported languages, as it may contain carried over settings from
+// the user tags.
+// This may be inconvenient when your application has some additional
+// locale-specific data for your supported languages.
+// Match and MatchString both return the index of the matched supported tag
+// to simplify associating such data with the matched tag.
+//
+//
+// Canonicalization
+//
+// If one uses the Matcher to compare languages one does not need to
+// worry about canonicalization.
+//
+// The meaning of a Tag varies per application. The language package
+// therefore delays canonicalization and preserves information as much
+// as possible. The Matcher, however, will always take into account that
+// two different tags may represent the same language.
+//
+// By default, only legacy and deprecated tags are converted into their
+// canonical equivalent. All other information is preserved. This approach makes
+// the confidence scores more accurate and allows matchers to distinguish
+// between variants that are otherwise lost.
+//
+// As a consequence, two tags that should be treated as identical according to
+// BCP 47 or CLDR, like "en-Latn" and "en", will be represented differently. The
+// Matcher handles such distinctions, though, and is aware of the
+// equivalence relations. The CanonType type can be used to alter the
+// canonicalization form.
+//
+// References
+//
+// BCP 47 - Tags for Identifying Languages http://tools.ietf.org/html/bcp47
+//
+package language // import "golang.org/x/text/language"
+
+// TODO: explanation on how to match languages for your own locale-specific
+// service.
diff --git a/vendor/golang.org/x/text/language/go1_1.go b/vendor/golang.org/x/text/language/go1_1.go
new file mode 100644
index 000000000..c7435583b
--- /dev/null
+++ b/vendor/golang.org/x/text/language/go1_1.go
@@ -0,0 +1,39 @@
+// 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:build !go1.2
+// +build !go1.2
+
+package language
+
+import "sort"
+
+func sortStable(s sort.Interface) {
+ ss := stableSort{
+ s: s,
+ pos: make([]int, s.Len()),
+ }
+ for i := range ss.pos {
+ ss.pos[i] = i
+ }
+ sort.Sort(&ss)
+}
+
+type stableSort struct {
+ s sort.Interface
+ pos []int
+}
+
+func (s *stableSort) Len() int {
+ return len(s.pos)
+}
+
+func (s *stableSort) Less(i, j int) bool {
+ return s.s.Less(i, j) || !s.s.Less(j, i) && s.pos[i] < s.pos[j]
+}
+
+func (s *stableSort) Swap(i, j int) {
+ s.s.Swap(i, j)
+ s.pos[i], s.pos[j] = s.pos[j], s.pos[i]
+}
diff --git a/vendor/golang.org/x/text/language/go1_2.go b/vendor/golang.org/x/text/language/go1_2.go
new file mode 100644
index 000000000..77aaaa299
--- /dev/null
+++ b/vendor/golang.org/x/text/language/go1_2.go
@@ -0,0 +1,12 @@
+// 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:build go1.2
+// +build go1.2
+
+package language
+
+import "sort"
+
+var sortStable = sort.Stable
diff --git a/vendor/golang.org/x/text/language/language.go b/vendor/golang.org/x/text/language/language.go
new file mode 100644
index 000000000..289b3a36d
--- /dev/null
+++ b/vendor/golang.org/x/text/language/language.go
@@ -0,0 +1,605 @@
+// 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 gen.go -output tables.go
+
+package language
+
+// TODO: Remove above NOTE after:
+// - verifying that tables are dropped correctly (most notably matcher tables).
+
+import (
+ "strings"
+
+ "golang.org/x/text/internal/language"
+ "golang.org/x/text/internal/language/compact"
+)
+
+// Tag represents a BCP 47 language tag. It is used to specify an instance of a
+// specific language or locale. All language tag values are guaranteed to be
+// well-formed.
+type Tag compact.Tag
+
+func makeTag(t language.Tag) (tag Tag) {
+ return Tag(compact.Make(t))
+}
+
+func (t *Tag) tag() language.Tag {
+ return (*compact.Tag)(t).Tag()
+}
+
+func (t *Tag) isCompact() bool {
+ return (*compact.Tag)(t).IsCompact()
+}
+
+// TODO: improve performance.
+func (t *Tag) lang() language.Language { return t.tag().LangID }
+func (t *Tag) region() language.Region { return t.tag().RegionID }
+func (t *Tag) script() language.Script { return t.tag().ScriptID }
+
+// Make is a convenience wrapper for Parse that omits the error.
+// In case of an error, a sensible default is returned.
+func Make(s string) Tag {
+ return Default.Make(s)
+}
+
+// Make is a convenience wrapper for c.Parse that omits the error.
+// In case of an error, a sensible default is returned.
+func (c CanonType) Make(s string) Tag {
+ t, _ := c.Parse(s)
+ return t
+}
+
+// Raw returns the raw base language, script and region, without making an
+// attempt to infer their values.
+func (t Tag) Raw() (b Base, s Script, r Region) {
+ tt := t.tag()
+ return Base{tt.LangID}, Script{tt.ScriptID}, Region{tt.RegionID}
+}
+
+// IsRoot returns true if t is equal to language "und".
+func (t Tag) IsRoot() bool {
+ return compact.Tag(t).IsRoot()
+}
+
+// CanonType can be used to enable or disable various types of canonicalization.
+type CanonType int
+
+const (
+ // Replace deprecated base languages with their preferred replacements.
+ DeprecatedBase CanonType = 1 << iota
+ // Replace deprecated scripts with their preferred replacements.
+ DeprecatedScript
+ // Replace deprecated regions with their preferred replacements.
+ DeprecatedRegion
+ // Remove redundant scripts.
+ SuppressScript
+ // Normalize legacy encodings. This includes legacy languages defined in
+ // CLDR as well as bibliographic codes defined in ISO-639.
+ Legacy
+ // Map the dominant language of a macro language group to the macro language
+ // subtag. For example cmn -> zh.
+ Macro
+ // The CLDR flag should be used if full compatibility with CLDR is required.
+ // There are a few cases where language.Tag may differ from CLDR. To follow all
+ // of CLDR's suggestions, use All|CLDR.
+ CLDR
+
+ // Raw can be used to Compose or Parse without Canonicalization.
+ Raw CanonType = 0
+
+ // Replace all deprecated tags with their preferred replacements.
+ Deprecated = DeprecatedBase | DeprecatedScript | DeprecatedRegion
+
+ // All canonicalizations recommended by BCP 47.
+ BCP47 = Deprecated | SuppressScript
+
+ // All canonicalizations.
+ All = BCP47 | Legacy | Macro
+
+ // Default is the canonicalization used by Parse, Make and Compose. To
+ // preserve as much information as possible, canonicalizations that remove
+ // potentially valuable information are not included. The Matcher is
+ // designed to recognize similar tags that would be the same if
+ // they were canonicalized using All.
+ Default = Deprecated | Legacy
+
+ canonLang = DeprecatedBase | Legacy | Macro
+
+ // TODO: LikelyScript, LikelyRegion: suppress similar to ICU.
+)
+
+// canonicalize returns the canonicalized equivalent of the tag and
+// whether there was any change.
+func canonicalize(c CanonType, t language.Tag) (language.Tag, bool) {
+ if c == Raw {
+ return t, false
+ }
+ changed := false
+ if c&SuppressScript != 0 {
+ if t.LangID.SuppressScript() == t.ScriptID {
+ t.ScriptID = 0
+ changed = true
+ }
+ }
+ if c&canonLang != 0 {
+ for {
+ if l, aliasType := t.LangID.Canonicalize(); l != t.LangID {
+ switch aliasType {
+ case language.Legacy:
+ if c&Legacy != 0 {
+ if t.LangID == _sh && t.ScriptID == 0 {
+ t.ScriptID = _Latn
+ }
+ t.LangID = l
+ changed = true
+ }
+ case language.Macro:
+ if c&Macro != 0 {
+ // We deviate here from CLDR. The mapping "nb" -> "no"
+ // qualifies as a typical Macro language mapping. However,
+ // for legacy reasons, CLDR maps "no", the macro language
+ // code for Norwegian, to the dominant variant "nb". This
+ // change is currently under consideration for CLDR as well.
+ // See https://unicode.org/cldr/trac/ticket/2698 and also
+ // https://unicode.org/cldr/trac/ticket/1790 for some of the
+ // practical implications. TODO: this check could be removed
+ // if CLDR adopts this change.
+ if c&CLDR == 0 || t.LangID != _nb {
+ changed = true
+ t.LangID = l
+ }
+ }
+ case language.Deprecated:
+ if c&DeprecatedBase != 0 {
+ if t.LangID == _mo && t.RegionID == 0 {
+ t.RegionID = _MD
+ }
+ t.LangID = l
+ changed = true
+ // Other canonicalization types may still apply.
+ continue
+ }
+ }
+ } else if c&Legacy != 0 && t.LangID == _no && c&CLDR != 0 {
+ t.LangID = _nb
+ changed = true
+ }
+ break
+ }
+ }
+ if c&DeprecatedScript != 0 {
+ if t.ScriptID == _Qaai {
+ changed = true
+ t.ScriptID = _Zinh
+ }
+ }
+ if c&DeprecatedRegion != 0 {
+ if r := t.RegionID.Canonicalize(); r != t.RegionID {
+ changed = true
+ t.RegionID = r
+ }
+ }
+ return t, changed
+}
+
+// Canonicalize returns the canonicalized equivalent of the tag.
+func (c CanonType) Canonicalize(t Tag) (Tag, error) {
+ // First try fast path.
+ if t.isCompact() {
+ if _, changed := canonicalize(c, compact.Tag(t).Tag()); !changed {
+ return t, nil
+ }
+ }
+ // It is unlikely that one will canonicalize a tag after matching. So do
+ // a slow but simple approach here.
+ if tag, changed := canonicalize(c, t.tag()); changed {
+ tag.RemakeString()
+ return makeTag(tag), nil
+ }
+ return t, nil
+
+}
+
+// Confidence indicates the level of certainty for a given return value.
+// For example, Serbian may be written in Cyrillic or Latin script.
+// The confidence level indicates whether a value was explicitly specified,
+// whether it is typically the only possible value, or whether there is
+// an ambiguity.
+type Confidence int
+
+const (
+ No Confidence = iota // full confidence that there was no match
+ Low // most likely value picked out of a set of alternatives
+ High // value is generally assumed to be the correct match
+ Exact // exact match or explicitly specified value
+)
+
+var confName = []string{"No", "Low", "High", "Exact"}
+
+func (c Confidence) String() string {
+ return confName[c]
+}
+
+// String returns the canonical string representation of the language tag.
+func (t Tag) String() string {
+ return t.tag().String()
+}
+
+// MarshalText implements encoding.TextMarshaler.
+func (t Tag) MarshalText() (text []byte, err error) {
+ return t.tag().MarshalText()
+}
+
+// UnmarshalText implements encoding.TextUnmarshaler.
+func (t *Tag) UnmarshalText(text []byte) error {
+ var tag language.Tag
+ err := tag.UnmarshalText(text)
+ *t = makeTag(tag)
+ return err
+}
+
+// Base returns the base language of the language tag. If the base language is
+// unspecified, an attempt will be made to infer it from the context.
+// It uses a variant of CLDR's Add Likely Subtags algorithm. This is subject to change.
+func (t Tag) Base() (Base, Confidence) {
+ if b := t.lang(); b != 0 {
+ return Base{b}, Exact
+ }
+ tt := t.tag()
+ c := High
+ if tt.ScriptID == 0 && !tt.RegionID.IsCountry() {
+ c = Low
+ }
+ if tag, err := tt.Maximize(); err == nil && tag.LangID != 0 {
+ return Base{tag.LangID}, c
+ }
+ return Base{0}, No
+}
+
+// Script infers the script for the language tag. If it was not explicitly given, it will infer
+// a most likely candidate.
+// If more than one script is commonly used for a language, the most likely one
+// is returned with a low confidence indication. For example, it returns (Cyrl, Low)
+// for Serbian.
+// If a script cannot be inferred (Zzzz, No) is returned. We do not use Zyyy (undetermined)
+// as one would suspect from the IANA registry for BCP 47. In a Unicode context Zyyy marks
+// common characters (like 1, 2, 3, '.', etc.) and is therefore more like multiple scripts.
+// See https://www.unicode.org/reports/tr24/#Values for more details. Zzzz is also used for
+// unknown value in CLDR. (Zzzz, Exact) is returned if Zzzz was explicitly specified.
+// Note that an inferred script is never guaranteed to be the correct one. Latin is
+// almost exclusively used for Afrikaans, but Arabic has been used for some texts
+// in the past. Also, the script that is commonly used may change over time.
+// It uses a variant of CLDR's Add Likely Subtags algorithm. This is subject to change.
+func (t Tag) Script() (Script, Confidence) {
+ if scr := t.script(); scr != 0 {
+ return Script{scr}, Exact
+ }
+ tt := t.tag()
+ sc, c := language.Script(_Zzzz), No
+ if scr := tt.LangID.SuppressScript(); scr != 0 {
+ // Note: it is not always the case that a language with a suppress
+ // script value is only written in one script (e.g. kk, ms, pa).
+ if tt.RegionID == 0 {
+ return Script{scr}, High
+ }
+ sc, c = scr, High
+ }
+ if tag, err := tt.Maximize(); err == nil {
+ if tag.ScriptID != sc {
+ sc, c = tag.ScriptID, Low
+ }
+ } else {
+ tt, _ = canonicalize(Deprecated|Macro, tt)
+ if tag, err := tt.Maximize(); err == nil && tag.ScriptID != sc {
+ sc, c = tag.ScriptID, Low
+ }
+ }
+ return Script{sc}, c
+}
+
+// Region returns the region for the language tag. If it was not explicitly given, it will
+// infer a most likely candidate from the context.
+// It uses a variant of CLDR's Add Likely Subtags algorithm. This is subject to change.
+func (t Tag) Region() (Region, Confidence) {
+ if r := t.region(); r != 0 {
+ return Region{r}, Exact
+ }
+ tt := t.tag()
+ if tt, err := tt.Maximize(); err == nil {
+ return Region{tt.RegionID}, Low // TODO: differentiate between high and low.
+ }
+ tt, _ = canonicalize(Deprecated|Macro, tt)
+ if tag, err := tt.Maximize(); err == nil {
+ return Region{tag.RegionID}, Low
+ }
+ return Region{_ZZ}, No // TODO: return world instead of undetermined?
+}
+
+// Variants returns the variants specified explicitly for this language tag.
+// or nil if no variant was specified.
+func (t Tag) Variants() []Variant {
+ if !compact.Tag(t).MayHaveVariants() {
+ return nil
+ }
+ v := []Variant{}
+ x, str := "", t.tag().Variants()
+ for str != "" {
+ x, str = nextToken(str)
+ v = append(v, Variant{x})
+ }
+ return v
+}
+
+// Parent returns the CLDR parent of t. In CLDR, missing fields in data for a
+// specific language are substituted with fields from the parent language.
+// The parent for a language may change for newer versions of CLDR.
+//
+// Parent returns a tag for a less specific language that is mutually
+// intelligible or Und if there is no such language. This may not be the same as
+// simply stripping the last BCP 47 subtag. For instance, the parent of "zh-TW"
+// is "zh-Hant", and the parent of "zh-Hant" is "und".
+func (t Tag) Parent() Tag {
+ return Tag(compact.Tag(t).Parent())
+}
+
+// returns token t and the rest of the string.
+func nextToken(s string) (t, tail string) {
+ p := strings.Index(s[1:], "-")
+ if p == -1 {
+ return s[1:], ""
+ }
+ p++
+ return s[1:p], s[p:]
+}
+
+// Extension is a single BCP 47 extension.
+type Extension struct {
+ s string
+}
+
+// String returns the string representation of the extension, including the
+// type tag.
+func (e Extension) String() string {
+ return e.s
+}
+
+// ParseExtension parses s as an extension and returns it on success.
+func ParseExtension(s string) (e Extension, err error) {
+ ext, err := language.ParseExtension(s)
+ return Extension{ext}, err
+}
+
+// Type returns the one-byte extension type of e. It returns 0 for the zero
+// exception.
+func (e Extension) Type() byte {
+ if e.s == "" {
+ return 0
+ }
+ return e.s[0]
+}
+
+// Tokens returns the list of tokens of e.
+func (e Extension) Tokens() []string {
+ return strings.Split(e.s, "-")
+}
+
+// Extension returns the extension of type x for tag t. It will return
+// false for ok if t does not have the requested extension. The returned
+// extension will be invalid in this case.
+func (t Tag) Extension(x byte) (ext Extension, ok bool) {
+ if !compact.Tag(t).MayHaveExtensions() {
+ return Extension{}, false
+ }
+ e, ok := t.tag().Extension(x)
+ return Extension{e}, ok
+}
+
+// Extensions returns all extensions of t.
+func (t Tag) Extensions() []Extension {
+ if !compact.Tag(t).MayHaveExtensions() {
+ return nil
+ }
+ e := []Extension{}
+ for _, ext := range t.tag().Extensions() {
+ e = append(e, Extension{ext})
+ }
+ return e
+}
+
+// TypeForKey returns the type associated with the given key, where key and type
+// are of the allowed values defined for the Unicode locale extension ('u') in
+// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
+// TypeForKey will traverse the inheritance chain to get the correct value.
+//
+// If there are multiple types associated with a key, only the first will be
+// returned. If there is no type associated with a key, it returns the empty
+// string.
+func (t Tag) TypeForKey(key string) string {
+ if !compact.Tag(t).MayHaveExtensions() {
+ if key != "rg" && key != "va" {
+ return ""
+ }
+ }
+ return t.tag().TypeForKey(key)
+}
+
+// SetTypeForKey returns a new Tag with the key set to type, where key and type
+// are of the allowed values defined for the Unicode locale extension ('u') in
+// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
+// An empty value removes an existing pair with the same key.
+func (t Tag) SetTypeForKey(key, value string) (Tag, error) {
+ tt, err := t.tag().SetTypeForKey(key, value)
+ return makeTag(tt), err
+}
+
+// NumCompactTags is the number of compact tags. The maximum tag is
+// NumCompactTags-1.
+const NumCompactTags = compact.NumCompactTags
+
+// CompactIndex returns an index, where 0 <= index < NumCompactTags, for tags
+// for which data exists in the text repository.The index will change over time
+// and should not be stored in persistent storage. If t does not match a compact
+// index, exact will be false and the compact index will be returned for the
+// first match after repeatedly taking the Parent of t.
+func CompactIndex(t Tag) (index int, exact bool) {
+ id, exact := compact.LanguageID(compact.Tag(t))
+ return int(id), exact
+}
+
+var root = language.Tag{}
+
+// Base is an ISO 639 language code, used for encoding the base language
+// of a language tag.
+type Base struct {
+ langID language.Language
+}
+
+// ParseBase parses a 2- or 3-letter ISO 639 code.
+// It returns a ValueError if s is a well-formed but unknown language identifier
+// or another error if another error occurred.
+func ParseBase(s string) (Base, error) {
+ l, err := language.ParseBase(s)
+ return Base{l}, err
+}
+
+// String returns the BCP 47 representation of the base language.
+func (b Base) String() string {
+ return b.langID.String()
+}
+
+// ISO3 returns the ISO 639-3 language code.
+func (b Base) ISO3() string {
+ return b.langID.ISO3()
+}
+
+// IsPrivateUse reports whether this language code is reserved for private use.
+func (b Base) IsPrivateUse() bool {
+ return b.langID.IsPrivateUse()
+}
+
+// Script is a 4-letter ISO 15924 code for representing scripts.
+// It is idiomatically represented in title case.
+type Script struct {
+ scriptID language.Script
+}
+
+// ParseScript parses a 4-letter ISO 15924 code.
+// It returns a ValueError if s is a well-formed but unknown script identifier
+// or another error if another error occurred.
+func ParseScript(s string) (Script, error) {
+ sc, err := language.ParseScript(s)
+ return Script{sc}, err
+}
+
+// String returns the script code in title case.
+// It returns "Zzzz" for an unspecified script.
+func (s Script) String() string {
+ return s.scriptID.String()
+}
+
+// IsPrivateUse reports whether this script code is reserved for private use.
+func (s Script) IsPrivateUse() bool {
+ return s.scriptID.IsPrivateUse()
+}
+
+// Region is an ISO 3166-1 or UN M.49 code for representing countries and regions.
+type Region struct {
+ regionID language.Region
+}
+
+// EncodeM49 returns the Region for the given UN M.49 code.
+// It returns an error if r is not a valid code.
+func EncodeM49(r int) (Region, error) {
+ rid, err := language.EncodeM49(r)
+ return Region{rid}, err
+}
+
+// ParseRegion parses a 2- or 3-letter ISO 3166-1 or a UN M.49 code.
+// It returns a ValueError if s is a well-formed but unknown region identifier
+// or another error if another error occurred.
+func ParseRegion(s string) (Region, error) {
+ r, err := language.ParseRegion(s)
+ return Region{r}, err
+}
+
+// String returns the BCP 47 representation for the region.
+// It returns "ZZ" for an unspecified region.
+func (r Region) String() string {
+ return r.regionID.String()
+}
+
+// ISO3 returns the 3-letter ISO code of r.
+// Note that not all regions have a 3-letter ISO code.
+// In such cases this method returns "ZZZ".
+func (r Region) ISO3() string {
+ return r.regionID.ISO3()
+}
+
+// M49 returns the UN M.49 encoding of r, or 0 if this encoding
+// is not defined for r.
+func (r Region) M49() int {
+ return r.regionID.M49()
+}
+
+// IsPrivateUse reports whether r has the ISO 3166 User-assigned status. This
+// may include private-use tags that are assigned by CLDR and used in this
+// implementation. So IsPrivateUse and IsCountry can be simultaneously true.
+func (r Region) IsPrivateUse() bool {
+ return r.regionID.IsPrivateUse()
+}
+
+// IsCountry returns whether this region is a country or autonomous area. This
+// includes non-standard definitions from CLDR.
+func (r Region) IsCountry() bool {
+ return r.regionID.IsCountry()
+}
+
+// IsGroup returns whether this region defines a collection of regions. This
+// includes non-standard definitions from CLDR.
+func (r Region) IsGroup() bool {
+ return r.regionID.IsGroup()
+}
+
+// Contains returns whether Region c is contained by Region r. It returns true
+// if c == r.
+func (r Region) Contains(c Region) bool {
+ return r.regionID.Contains(c.regionID)
+}
+
+// TLD returns the country code top-level domain (ccTLD). UK is returned for GB.
+// In all other cases it returns either the region itself or an error.
+//
+// This method may return an error for a region for which there exists a
+// canonical form with a ccTLD. To get that ccTLD canonicalize r first. The
+// region will already be canonicalized it was obtained from a Tag that was
+// obtained using any of the default methods.
+func (r Region) TLD() (Region, error) {
+ tld, err := r.regionID.TLD()
+ return Region{tld}, err
+}
+
+// Canonicalize returns the region or a possible replacement if the region is
+// deprecated. It will not return a replacement for deprecated regions that
+// are split into multiple regions.
+func (r Region) Canonicalize() Region {
+ return Region{r.regionID.Canonicalize()}
+}
+
+// Variant represents a registered variant of a language as defined by BCP 47.
+type Variant struct {
+ variant string
+}
+
+// ParseVariant parses and returns a Variant. An error is returned if s is not
+// a valid variant.
+func ParseVariant(s string) (Variant, error) {
+ v, err := language.ParseVariant(s)
+ return Variant{v.String()}, err
+}
+
+// String returns the string representation of the variant.
+func (v Variant) String() string {
+ return v.variant
+}
diff --git a/vendor/golang.org/x/text/language/match.go b/vendor/golang.org/x/text/language/match.go
new file mode 100644
index 000000000..f73492134
--- /dev/null
+++ b/vendor/golang.org/x/text/language/match.go
@@ -0,0 +1,735 @@
+// 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 language
+
+import (
+ "errors"
+ "strings"
+
+ "golang.org/x/text/internal/language"
+)
+
+// A MatchOption configures a Matcher.
+type MatchOption func(*matcher)
+
+// PreferSameScript will, in the absence of a match, result in the first
+// preferred tag with the same script as a supported tag to match this supported
+// tag. The default is currently true, but this may change in the future.
+func PreferSameScript(preferSame bool) MatchOption {
+ return func(m *matcher) { m.preferSameScript = preferSame }
+}
+
+// TODO(v1.0.0): consider making Matcher a concrete type, instead of interface.
+// There doesn't seem to be too much need for multiple types.
+// Making it a concrete type allows MatchStrings to be a method, which will
+// improve its discoverability.
+
+// MatchStrings parses and matches the given strings until one of them matches
+// the language in the Matcher. A string may be an Accept-Language header as
+// handled by ParseAcceptLanguage. The default language is returned if no
+// other language matched.
+func MatchStrings(m Matcher, lang ...string) (tag Tag, index int) {
+ for _, accept := range lang {
+ desired, _, err := ParseAcceptLanguage(accept)
+ if err != nil {
+ continue
+ }
+ if tag, index, conf := m.Match(desired...); conf != No {
+ return tag, index
+ }
+ }
+ tag, index, _ = m.Match()
+ return
+}
+
+// Matcher is the interface that wraps the Match method.
+//
+// Match returns the best match for any of the given tags, along with
+// a unique index associated with the returned tag and a confidence
+// score.
+type Matcher interface {
+ Match(t ...Tag) (tag Tag, index int, c Confidence)
+}
+
+// Comprehends reports the confidence score for a speaker of a given language
+// to being able to comprehend the written form of an alternative language.
+func Comprehends(speaker, alternative Tag) Confidence {
+ _, _, c := NewMatcher([]Tag{alternative}).Match(speaker)
+ return c
+}
+
+// NewMatcher returns a Matcher that matches an ordered list of preferred tags
+// against a list of supported tags based on written intelligibility, closeness
+// of dialect, equivalence of subtags and various other rules. It is initialized
+// with the list of supported tags. The first element is used as the default
+// value in case no match is found.
+//
+// Its Match method matches the first of the given Tags to reach a certain
+// confidence threshold. The tags passed to Match should therefore be specified
+// in order of preference. Extensions are ignored for matching.
+//
+// The index returned by the Match method corresponds to the index of the
+// matched tag in t, but is augmented with the Unicode extension ('u')of the
+// corresponding preferred tag. This allows user locale options to be passed
+// transparently.
+func NewMatcher(t []Tag, options ...MatchOption) Matcher {
+ return newMatcher(t, options)
+}
+
+func (m *matcher) Match(want ...Tag) (t Tag, index int, c Confidence) {
+ var tt language.Tag
+ match, w, c := m.getBest(want...)
+ if match != nil {
+ tt, index = match.tag, match.index
+ } else {
+ // TODO: this should be an option
+ tt = m.default_.tag
+ if m.preferSameScript {
+ outer:
+ for _, w := range want {
+ script, _ := w.Script()
+ if script.scriptID == 0 {
+ // Don't do anything if there is no script, such as with
+ // private subtags.
+ continue
+ }
+ for i, h := range m.supported {
+ if script.scriptID == h.maxScript {
+ tt, index = h.tag, i
+ break outer
+ }
+ }
+ }
+ }
+ // TODO: select first language tag based on script.
+ }
+ if w.RegionID != tt.RegionID && w.RegionID != 0 {
+ if w.RegionID != 0 && tt.RegionID != 0 && tt.RegionID.Contains(w.RegionID) {
+ tt.RegionID = w.RegionID
+ tt.RemakeString()
+ } else if r := w.RegionID.String(); len(r) == 2 {
+ // TODO: also filter macro and deprecated.
+ tt, _ = tt.SetTypeForKey("rg", strings.ToLower(r)+"zzzz")
+ }
+ }
+ // Copy options from the user-provided tag into the result tag. This is hard
+ // to do after the fact, so we do it here.
+ // TODO: add in alternative variants to -u-va-.
+ // TODO: add preferred region to -u-rg-.
+ if e := w.Extensions(); len(e) > 0 {
+ b := language.Builder{}
+ b.SetTag(tt)
+ for _, e := range e {
+ b.AddExt(e)
+ }
+ tt = b.Make()
+ }
+ return makeTag(tt), index, c
+}
+
+// ErrMissingLikelyTagsData indicates no information was available
+// to compute likely values of missing tags.
+var ErrMissingLikelyTagsData = errors.New("missing likely tags data")
+
+// func (t *Tag) setTagsFrom(id Tag) {
+// t.LangID = id.LangID
+// t.ScriptID = id.ScriptID
+// t.RegionID = id.RegionID
+// }
+
+// Tag Matching
+// CLDR defines an algorithm for finding the best match between two sets of language
+// tags. The basic algorithm defines how to score a possible match and then find
+// the match with the best score
+// (see https://www.unicode.org/reports/tr35/#LanguageMatching).
+// Using scoring has several disadvantages. The scoring obfuscates the importance of
+// the various factors considered, making the algorithm harder to understand. Using
+// scoring also requires the full score to be computed for each pair of tags.
+//
+// We will use a different algorithm which aims to have the following properties:
+// - clarity on the precedence of the various selection factors, and
+// - improved performance by allowing early termination of a comparison.
+//
+// Matching algorithm (overview)
+// Input:
+// - supported: a set of supported tags
+// - default: the default tag to return in case there is no match
+// - desired: list of desired tags, ordered by preference, starting with
+// the most-preferred.
+//
+// Algorithm:
+// 1) Set the best match to the lowest confidence level
+// 2) For each tag in "desired":
+// a) For each tag in "supported":
+// 1) compute the match between the two tags.
+// 2) if the match is better than the previous best match, replace it
+// with the new match. (see next section)
+// b) if the current best match is Exact and pin is true the result will be
+// frozen to the language found thusfar, although better matches may
+// still be found for the same language.
+// 3) If the best match so far is below a certain threshold, return "default".
+//
+// Ranking:
+// We use two phases to determine whether one pair of tags are a better match
+// than another pair of tags. First, we determine a rough confidence level. If the
+// levels are different, the one with the highest confidence wins.
+// Second, if the rough confidence levels are identical, we use a set of tie-breaker
+// rules.
+//
+// The confidence level of matching a pair of tags is determined by finding the
+// lowest confidence level of any matches of the corresponding subtags (the
+// result is deemed as good as its weakest link).
+// We define the following levels:
+// Exact - An exact match of a subtag, before adding likely subtags.
+// MaxExact - An exact match of a subtag, after adding likely subtags.
+// [See Note 2].
+// High - High level of mutual intelligibility between different subtag
+// variants.
+// Low - Low level of mutual intelligibility between different subtag
+// variants.
+// No - No mutual intelligibility.
+//
+// The following levels can occur for each type of subtag:
+// Base: Exact, MaxExact, High, Low, No
+// Script: Exact, MaxExact [see Note 3], Low, No
+// Region: Exact, MaxExact, High
+// Variant: Exact, High
+// Private: Exact, No
+//
+// Any result with a confidence level of Low or higher is deemed a possible match.
+// Once a desired tag matches any of the supported tags with a level of MaxExact
+// or higher, the next desired tag is not considered (see Step 2.b).
+// Note that CLDR provides languageMatching data that defines close equivalence
+// classes for base languages, scripts and regions.
+//
+// Tie-breaking
+// If we get the same confidence level for two matches, we apply a sequence of
+// tie-breaking rules. The first that succeeds defines the result. The rules are
+// applied in the following order.
+// 1) Original language was defined and was identical.
+// 2) Original region was defined and was identical.
+// 3) Distance between two maximized regions was the smallest.
+// 4) Original script was defined and was identical.
+// 5) Distance from want tag to have tag using the parent relation [see Note 5.]
+// If there is still no winner after these rules are applied, the first match
+// found wins.
+//
+// Notes:
+// [2] In practice, as matching of Exact is done in a separate phase from
+// matching the other levels, we reuse the Exact level to mean MaxExact in
+// the second phase. As a consequence, we only need the levels defined by
+// the Confidence type. The MaxExact confidence level is mapped to High in
+// the public API.
+// [3] We do not differentiate between maximized script values that were derived
+// from suppressScript versus most likely tag data. We determined that in
+// ranking the two, one ranks just after the other. Moreover, the two cannot
+// occur concurrently. As a consequence, they are identical for practical
+// purposes.
+// [4] In case of deprecated, macro-equivalents and legacy mappings, we assign
+// the MaxExact level to allow iw vs he to still be a closer match than
+// en-AU vs en-US, for example.
+// [5] In CLDR a locale inherits fields that are unspecified for this locale
+// from its parent. Therefore, if a locale is a parent of another locale,
+// it is a strong measure for closeness, especially when no other tie
+// breaker rule applies. One could also argue it is inconsistent, for
+// example, when pt-AO matches pt (which CLDR equates with pt-BR), even
+// though its parent is pt-PT according to the inheritance rules.
+//
+// Implementation Details:
+// There are several performance considerations worth pointing out. Most notably,
+// we preprocess as much as possible (within reason) at the time of creation of a
+// matcher. This includes:
+// - creating a per-language map, which includes data for the raw base language
+// and its canonicalized variant (if applicable),
+// - expanding entries for the equivalence classes defined in CLDR's
+// languageMatch data.
+// The per-language map ensures that typically only a very small number of tags
+// need to be considered. The pre-expansion of canonicalized subtags and
+// equivalence classes reduces the amount of map lookups that need to be done at
+// runtime.
+
+// matcher keeps a set of supported language tags, indexed by language.
+type matcher struct {
+ default_ *haveTag
+ supported []*haveTag
+ index map[language.Language]*matchHeader
+ passSettings bool
+ preferSameScript bool
+}
+
+// matchHeader has the lists of tags for exact matches and matches based on
+// maximized and canonicalized tags for a given language.
+type matchHeader struct {
+ haveTags []*haveTag
+ original bool
+}
+
+// haveTag holds a supported Tag and its maximized script and region. The maximized
+// or canonicalized language is not stored as it is not needed during matching.
+type haveTag struct {
+ tag language.Tag
+
+ // index of this tag in the original list of supported tags.
+ index int
+
+ // conf is the maximum confidence that can result from matching this haveTag.
+ // When conf < Exact this means it was inserted after applying a CLDR equivalence rule.
+ conf Confidence
+
+ // Maximized region and script.
+ maxRegion language.Region
+ maxScript language.Script
+
+ // altScript may be checked as an alternative match to maxScript. If altScript
+ // matches, the confidence level for this match is Low. Theoretically there
+ // could be multiple alternative scripts. This does not occur in practice.
+ altScript language.Script
+
+ // nextMax is the index of the next haveTag with the same maximized tags.
+ nextMax uint16
+}
+
+func makeHaveTag(tag language.Tag, index int) (haveTag, language.Language) {
+ max := tag
+ if tag.LangID != 0 || tag.RegionID != 0 || tag.ScriptID != 0 {
+ max, _ = canonicalize(All, max)
+ max, _ = max.Maximize()
+ max.RemakeString()
+ }
+ return haveTag{tag, index, Exact, max.RegionID, max.ScriptID, altScript(max.LangID, max.ScriptID), 0}, max.LangID
+}
+
+// altScript returns an alternative script that may match the given script with
+// a low confidence. At the moment, the langMatch data allows for at most one
+// script to map to another and we rely on this to keep the code simple.
+func altScript(l language.Language, s language.Script) language.Script {
+ for _, alt := range matchScript {
+ // TODO: also match cases where language is not the same.
+ if (language.Language(alt.wantLang) == l || language.Language(alt.haveLang) == l) &&
+ language.Script(alt.haveScript) == s {
+ return language.Script(alt.wantScript)
+ }
+ }
+ return 0
+}
+
+// addIfNew adds a haveTag to the list of tags only if it is a unique tag.
+// Tags that have the same maximized values are linked by index.
+func (h *matchHeader) addIfNew(n haveTag, exact bool) {
+ h.original = h.original || exact
+ // Don't add new exact matches.
+ for _, v := range h.haveTags {
+ if equalsRest(v.tag, n.tag) {
+ return
+ }
+ }
+ // Allow duplicate maximized tags, but create a linked list to allow quickly
+ // comparing the equivalents and bail out.
+ for i, v := range h.haveTags {
+ if v.maxScript == n.maxScript &&
+ v.maxRegion == n.maxRegion &&
+ v.tag.VariantOrPrivateUseTags() == n.tag.VariantOrPrivateUseTags() {
+ for h.haveTags[i].nextMax != 0 {
+ i = int(h.haveTags[i].nextMax)
+ }
+ h.haveTags[i].nextMax = uint16(len(h.haveTags))
+ break
+ }
+ }
+ h.haveTags = append(h.haveTags, &n)
+}
+
+// header returns the matchHeader for the given language. It creates one if
+// it doesn't already exist.
+func (m *matcher) header(l language.Language) *matchHeader {
+ if h := m.index[l]; h != nil {
+ return h
+ }
+ h := &matchHeader{}
+ m.index[l] = h
+ return h
+}
+
+func toConf(d uint8) Confidence {
+ if d <= 10 {
+ return High
+ }
+ if d < 30 {
+ return Low
+ }
+ return No
+}
+
+// newMatcher builds an index for the given supported tags and returns it as
+// a matcher. It also expands the index by considering various equivalence classes
+// for a given tag.
+func newMatcher(supported []Tag, options []MatchOption) *matcher {
+ m := &matcher{
+ index: make(map[language.Language]*matchHeader),
+ preferSameScript: true,
+ }
+ for _, o := range options {
+ o(m)
+ }
+ if len(supported) == 0 {
+ m.default_ = &haveTag{}
+ return m
+ }
+ // Add supported languages to the index. Add exact matches first to give
+ // them precedence.
+ for i, tag := range supported {
+ tt := tag.tag()
+ pair, _ := makeHaveTag(tt, i)
+ m.header(tt.LangID).addIfNew(pair, true)
+ m.supported = append(m.supported, &pair)
+ }
+ m.default_ = m.header(supported[0].lang()).haveTags[0]
+ // Keep these in two different loops to support the case that two equivalent
+ // languages are distinguished, such as iw and he.
+ for i, tag := range supported {
+ tt := tag.tag()
+ pair, max := makeHaveTag(tt, i)
+ if max != tt.LangID {
+ m.header(max).addIfNew(pair, true)
+ }
+ }
+
+ // update is used to add indexes in the map for equivalent languages.
+ // update will only add entries to original indexes, thus not computing any
+ // transitive relations.
+ update := func(want, have uint16, conf Confidence) {
+ if hh := m.index[language.Language(have)]; hh != nil {
+ if !hh.original {
+ return
+ }
+ hw := m.header(language.Language(want))
+ for _, ht := range hh.haveTags {
+ v := *ht
+ if conf < v.conf {
+ v.conf = conf
+ }
+ v.nextMax = 0 // this value needs to be recomputed
+ if v.altScript != 0 {
+ v.altScript = altScript(language.Language(want), v.maxScript)
+ }
+ hw.addIfNew(v, conf == Exact && hh.original)
+ }
+ }
+ }
+
+ // Add entries for languages with mutual intelligibility as defined by CLDR's
+ // languageMatch data.
+ for _, ml := range matchLang {
+ update(ml.want, ml.have, toConf(ml.distance))
+ if !ml.oneway {
+ update(ml.have, ml.want, toConf(ml.distance))
+ }
+ }
+
+ // Add entries for possible canonicalizations. This is an optimization to
+ // ensure that only one map lookup needs to be done at runtime per desired tag.
+ // First we match deprecated equivalents. If they are perfect equivalents
+ // (their canonicalization simply substitutes a different language code, but
+ // nothing else), the match confidence is Exact, otherwise it is High.
+ for i, lm := range language.AliasMap {
+ // If deprecated codes match and there is no fiddling with the script or
+ // or region, we consider it an exact match.
+ conf := Exact
+ if language.AliasTypes[i] != language.Macro {
+ if !isExactEquivalent(language.Language(lm.From)) {
+ conf = High
+ }
+ update(lm.To, lm.From, conf)
+ }
+ update(lm.From, lm.To, conf)
+ }
+ return m
+}
+
+// getBest gets the best matching tag in m for any of the given tags, taking into
+// account the order of preference of the given tags.
+func (m *matcher) getBest(want ...Tag) (got *haveTag, orig language.Tag, c Confidence) {
+ best := bestMatch{}
+ for i, ww := range want {
+ w := ww.tag()
+ var max language.Tag
+ // Check for exact match first.
+ h := m.index[w.LangID]
+ if w.LangID != 0 {
+ if h == nil {
+ continue
+ }
+ // Base language is defined.
+ max, _ = canonicalize(Legacy|Deprecated|Macro, w)
+ // A region that is added through canonicalization is stronger than
+ // a maximized region: set it in the original (e.g. mo -> ro-MD).
+ if w.RegionID != max.RegionID {
+ w.RegionID = max.RegionID
+ }
+ // TODO: should we do the same for scripts?
+ // See test case: en, sr, nl ; sh ; sr
+ max, _ = max.Maximize()
+ } else {
+ // Base language is not defined.
+ if h != nil {
+ for i := range h.haveTags {
+ have := h.haveTags[i]
+ if equalsRest(have.tag, w) {
+ return have, w, Exact
+ }
+ }
+ }
+ if w.ScriptID == 0 && w.RegionID == 0 {
+ // We skip all tags matching und for approximate matching, including
+ // private tags.
+ continue
+ }
+ max, _ = w.Maximize()
+ if h = m.index[max.LangID]; h == nil {
+ continue
+ }
+ }
+ pin := true
+ for _, t := range want[i+1:] {
+ if w.LangID == t.lang() {
+ pin = false
+ break
+ }
+ }
+ // Check for match based on maximized tag.
+ for i := range h.haveTags {
+ have := h.haveTags[i]
+ best.update(have, w, max.ScriptID, max.RegionID, pin)
+ if best.conf == Exact {
+ for have.nextMax != 0 {
+ have = h.haveTags[have.nextMax]
+ best.update(have, w, max.ScriptID, max.RegionID, pin)
+ }
+ return best.have, best.want, best.conf
+ }
+ }
+ }
+ if best.conf <= No {
+ if len(want) != 0 {
+ return nil, want[0].tag(), No
+ }
+ return nil, language.Tag{}, No
+ }
+ return best.have, best.want, best.conf
+}
+
+// bestMatch accumulates the best match so far.
+type bestMatch struct {
+ have *haveTag
+ want language.Tag
+ conf Confidence
+ pinnedRegion language.Region
+ pinLanguage bool
+ sameRegionGroup bool
+ // Cached results from applying tie-breaking rules.
+ origLang bool
+ origReg bool
+ paradigmReg bool
+ regGroupDist uint8
+ origScript bool
+}
+
+// update updates the existing best match if the new pair is considered to be a
+// better match. To determine if the given pair is a better match, it first
+// computes the rough confidence level. If this surpasses the current match, it
+// will replace it and update the tie-breaker rule cache. If there is a tie, it
+// proceeds with applying a series of tie-breaker rules. If there is no
+// conclusive winner after applying the tie-breaker rules, it leaves the current
+// match as the preferred match.
+//
+// If pin is true and have and tag are a strong match, it will henceforth only
+// consider matches for this language. This corresponds to the nothing that most
+// users have a strong preference for the first defined language. A user can
+// still prefer a second language over a dialect of the preferred language by
+// explicitly specifying dialects, e.g. "en, nl, en-GB". In this case pin should
+// be false.
+func (m *bestMatch) update(have *haveTag, tag language.Tag, maxScript language.Script, maxRegion language.Region, pin bool) {
+ // Bail if the maximum attainable confidence is below that of the current best match.
+ c := have.conf
+ if c < m.conf {
+ return
+ }
+ // Don't change the language once we already have found an exact match.
+ if m.pinLanguage && tag.LangID != m.want.LangID {
+ return
+ }
+ // Pin the region group if we are comparing tags for the same language.
+ if tag.LangID == m.want.LangID && m.sameRegionGroup {
+ _, sameGroup := regionGroupDist(m.pinnedRegion, have.maxRegion, have.maxScript, m.want.LangID)
+ if !sameGroup {
+ return
+ }
+ }
+ if c == Exact && have.maxScript == maxScript {
+ // If there is another language and then another entry of this language,
+ // don't pin anything, otherwise pin the language.
+ m.pinLanguage = pin
+ }
+ if equalsRest(have.tag, tag) {
+ } else if have.maxScript != maxScript {
+ // There is usually very little comprehension between different scripts.
+ // In a few cases there may still be Low comprehension. This possibility
+ // is pre-computed and stored in have.altScript.
+ if Low < m.conf || have.altScript != maxScript {
+ return
+ }
+ c = Low
+ } else if have.maxRegion != maxRegion {
+ if High < c {
+ // There is usually a small difference between languages across regions.
+ c = High
+ }
+ }
+
+ // We store the results of the computations of the tie-breaker rules along
+ // with the best match. There is no need to do the checks once we determine
+ // we have a winner, but we do still need to do the tie-breaker computations.
+ // We use "beaten" to keep track if we still need to do the checks.
+ beaten := false // true if the new pair defeats the current one.
+ if c != m.conf {
+ if c < m.conf {
+ return
+ }
+ beaten = true
+ }
+
+ // Tie-breaker rules:
+ // We prefer if the pre-maximized language was specified and identical.
+ origLang := have.tag.LangID == tag.LangID && tag.LangID != 0
+ if !beaten && m.origLang != origLang {
+ if m.origLang {
+ return
+ }
+ beaten = true
+ }
+
+ // We prefer if the pre-maximized region was specified and identical.
+ origReg := have.tag.RegionID == tag.RegionID && tag.RegionID != 0
+ if !beaten && m.origReg != origReg {
+ if m.origReg {
+ return
+ }
+ beaten = true
+ }
+
+ regGroupDist, sameGroup := regionGroupDist(have.maxRegion, maxRegion, maxScript, tag.LangID)
+ if !beaten && m.regGroupDist != regGroupDist {
+ if regGroupDist > m.regGroupDist {
+ return
+ }
+ beaten = true
+ }
+
+ paradigmReg := isParadigmLocale(tag.LangID, have.maxRegion)
+ if !beaten && m.paradigmReg != paradigmReg {
+ if !paradigmReg {
+ return
+ }
+ beaten = true
+ }
+
+ // Next we prefer if the pre-maximized script was specified and identical.
+ origScript := have.tag.ScriptID == tag.ScriptID && tag.ScriptID != 0
+ if !beaten && m.origScript != origScript {
+ if m.origScript {
+ return
+ }
+ beaten = true
+ }
+
+ // Update m to the newly found best match.
+ if beaten {
+ m.have = have
+ m.want = tag
+ m.conf = c
+ m.pinnedRegion = maxRegion
+ m.sameRegionGroup = sameGroup
+ m.origLang = origLang
+ m.origReg = origReg
+ m.paradigmReg = paradigmReg
+ m.origScript = origScript
+ m.regGroupDist = regGroupDist
+ }
+}
+
+func isParadigmLocale(lang language.Language, r language.Region) bool {
+ for _, e := range paradigmLocales {
+ if language.Language(e[0]) == lang && (r == language.Region(e[1]) || r == language.Region(e[2])) {
+ return true
+ }
+ }
+ return false
+}
+
+// regionGroupDist computes the distance between two regions based on their
+// CLDR grouping.
+func regionGroupDist(a, b language.Region, script language.Script, lang language.Language) (dist uint8, same bool) {
+ const defaultDistance = 4
+
+ aGroup := uint(regionToGroups[a]) << 1
+ bGroup := uint(regionToGroups[b]) << 1
+ for _, ri := range matchRegion {
+ if language.Language(ri.lang) == lang && (ri.script == 0 || language.Script(ri.script) == script) {
+ group := uint(1 << (ri.group &^ 0x80))
+ if 0x80&ri.group == 0 {
+ if aGroup&bGroup&group != 0 { // Both regions are in the group.
+ return ri.distance, ri.distance == defaultDistance
+ }
+ } else {
+ if (aGroup|bGroup)&group == 0 { // Both regions are not in the group.
+ return ri.distance, ri.distance == defaultDistance
+ }
+ }
+ }
+ }
+ return defaultDistance, true
+}
+
+// equalsRest compares everything except the language.
+func equalsRest(a, b language.Tag) bool {
+ // TODO: don't include extensions in this comparison. To do this efficiently,
+ // though, we should handle private tags separately.
+ return a.ScriptID == b.ScriptID && a.RegionID == b.RegionID && a.VariantOrPrivateUseTags() == b.VariantOrPrivateUseTags()
+}
+
+// isExactEquivalent returns true if canonicalizing the language will not alter
+// the script or region of a tag.
+func isExactEquivalent(l language.Language) bool {
+ for _, o := range notEquivalent {
+ if o == l {
+ return false
+ }
+ }
+ return true
+}
+
+var notEquivalent []language.Language
+
+func init() {
+ // Create a list of all languages for which canonicalization may alter the
+ // script or region.
+ for _, lm := range language.AliasMap {
+ tag := language.Tag{LangID: language.Language(lm.From)}
+ if tag, _ = canonicalize(All, tag); tag.ScriptID != 0 || tag.RegionID != 0 {
+ notEquivalent = append(notEquivalent, language.Language(lm.From))
+ }
+ }
+ // Maximize undefined regions of paradigm locales.
+ for i, v := range paradigmLocales {
+ t := language.Tag{LangID: language.Language(v[0])}
+ max, _ := t.Maximize()
+ if v[1] == 0 {
+ paradigmLocales[i][1] = uint16(max.RegionID)
+ }
+ if v[2] == 0 {
+ paradigmLocales[i][2] = uint16(max.RegionID)
+ }
+ }
+}
diff --git a/vendor/golang.org/x/text/language/parse.go b/vendor/golang.org/x/text/language/parse.go
new file mode 100644
index 000000000..59b041008
--- /dev/null
+++ b/vendor/golang.org/x/text/language/parse.go
@@ -0,0 +1,250 @@
+// 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 language
+
+import (
+ "errors"
+ "strconv"
+ "strings"
+
+ "golang.org/x/text/internal/language"
+)
+
+// ValueError is returned by any of the parsing functions when the
+// input is well-formed but the respective subtag is not recognized
+// as a valid value.
+type ValueError interface {
+ error
+
+ // Subtag returns the subtag for which the error occurred.
+ Subtag() string
+}
+
+// Parse parses the given BCP 47 string and returns a valid Tag. If parsing
+// failed it returns an error and any part of the tag that could be parsed.
+// If parsing succeeded but an unknown value was found, it returns
+// ValueError. The Tag returned in this case is just stripped of the unknown
+// value. All other values are preserved. It accepts tags in the BCP 47 format
+// and extensions to this standard defined in
+// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
+// The resulting tag is canonicalized using the default canonicalization type.
+func Parse(s string) (t Tag, err error) {
+ return Default.Parse(s)
+}
+
+// Parse parses the given BCP 47 string and returns a valid Tag. If parsing
+// failed it returns an error and any part of the tag that could be parsed.
+// If parsing succeeded but an unknown value was found, it returns
+// ValueError. The Tag returned in this case is just stripped of the unknown
+// value. All other values are preserved. It accepts tags in the BCP 47 format
+// and extensions to this standard defined in
+// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
+// The resulting tag is canonicalized using the canonicalization type c.
+func (c CanonType) Parse(s string) (t Tag, err error) {
+ defer func() {
+ if recover() != nil {
+ t = Tag{}
+ err = language.ErrSyntax
+ }
+ }()
+
+ tt, err := language.Parse(s)
+ if err != nil {
+ return makeTag(tt), err
+ }
+ tt, changed := canonicalize(c, tt)
+ if changed {
+ tt.RemakeString()
+ }
+ return makeTag(tt), err
+}
+
+// Compose creates a Tag from individual parts, which may be of type Tag, Base,
+// Script, Region, Variant, []Variant, Extension, []Extension or error. If a
+// Base, Script or Region or slice of type Variant or Extension is passed more
+// than once, the latter will overwrite the former. Variants and Extensions are
+// accumulated, but if two extensions of the same type are passed, the latter
+// will replace the former. For -u extensions, though, the key-type pairs are
+// added, where later values overwrite older ones. A Tag overwrites all former
+// values and typically only makes sense as the first argument. The resulting
+// tag is returned after canonicalizing using the Default CanonType. If one or
+// more errors are encountered, one of the errors is returned.
+func Compose(part ...interface{}) (t Tag, err error) {
+ return Default.Compose(part...)
+}
+
+// Compose creates a Tag from individual parts, which may be of type Tag, Base,
+// Script, Region, Variant, []Variant, Extension, []Extension or error. If a
+// Base, Script or Region or slice of type Variant or Extension is passed more
+// than once, the latter will overwrite the former. Variants and Extensions are
+// accumulated, but if two extensions of the same type are passed, the latter
+// will replace the former. For -u extensions, though, the key-type pairs are
+// added, where later values overwrite older ones. A Tag overwrites all former
+// values and typically only makes sense as the first argument. The resulting
+// tag is returned after canonicalizing using CanonType c. If one or more errors
+// are encountered, one of the errors is returned.
+func (c CanonType) Compose(part ...interface{}) (t Tag, err error) {
+ defer func() {
+ if recover() != nil {
+ t = Tag{}
+ err = language.ErrSyntax
+ }
+ }()
+
+ var b language.Builder
+ if err = update(&b, part...); err != nil {
+ return und, err
+ }
+ b.Tag, _ = canonicalize(c, b.Tag)
+ return makeTag(b.Make()), err
+}
+
+var errInvalidArgument = errors.New("invalid Extension or Variant")
+
+func update(b *language.Builder, part ...interface{}) (err error) {
+ for _, x := range part {
+ switch v := x.(type) {
+ case Tag:
+ b.SetTag(v.tag())
+ case Base:
+ b.Tag.LangID = v.langID
+ case Script:
+ b.Tag.ScriptID = v.scriptID
+ case Region:
+ b.Tag.RegionID = v.regionID
+ case Variant:
+ if v.variant == "" {
+ err = errInvalidArgument
+ break
+ }
+ b.AddVariant(v.variant)
+ case Extension:
+ if v.s == "" {
+ err = errInvalidArgument
+ break
+ }
+ b.SetExt(v.s)
+ case []Variant:
+ b.ClearVariants()
+ for _, v := range v {
+ b.AddVariant(v.variant)
+ }
+ case []Extension:
+ b.ClearExtensions()
+ for _, e := range v {
+ b.SetExt(e.s)
+ }
+ // TODO: support parsing of raw strings based on morphology or just extensions?
+ case error:
+ if v != nil {
+ err = v
+ }
+ }
+ }
+ return
+}
+
+var errInvalidWeight = errors.New("ParseAcceptLanguage: invalid weight")
+
+// ParseAcceptLanguage parses the contents of an Accept-Language header as
+// defined in http://www.ietf.org/rfc/rfc2616.txt and returns a list of Tags and
+// a list of corresponding quality weights. It is more permissive than RFC 2616
+// and may return non-nil slices even if the input is not valid.
+// The Tags will be sorted by highest weight first and then by first occurrence.
+// Tags with a weight of zero will be dropped. An error will be returned if the
+// input could not be parsed.
+func ParseAcceptLanguage(s string) (tag []Tag, q []float32, err error) {
+ defer func() {
+ if recover() != nil {
+ tag = nil
+ q = nil
+ err = language.ErrSyntax
+ }
+ }()
+
+ var entry string
+ for s != "" {
+ if entry, s = split(s, ','); entry == "" {
+ continue
+ }
+
+ entry, weight := split(entry, ';')
+
+ // Scan the language.
+ t, err := Parse(entry)
+ if err != nil {
+ id, ok := acceptFallback[entry]
+ if !ok {
+ return nil, nil, err
+ }
+ t = makeTag(language.Tag{LangID: id})
+ }
+
+ // Scan the optional weight.
+ w := 1.0
+ if weight != "" {
+ weight = consume(weight, 'q')
+ weight = consume(weight, '=')
+ // consume returns the empty string when a token could not be
+ // consumed, resulting in an error for ParseFloat.
+ if w, err = strconv.ParseFloat(weight, 32); err != nil {
+ return nil, nil, errInvalidWeight
+ }
+ // Drop tags with a quality weight of 0.
+ if w <= 0 {
+ continue
+ }
+ }
+
+ tag = append(tag, t)
+ q = append(q, float32(w))
+ }
+ sortStable(&tagSort{tag, q})
+ return tag, q, nil
+}
+
+// consume removes a leading token c from s and returns the result or the empty
+// string if there is no such token.
+func consume(s string, c byte) string {
+ if s == "" || s[0] != c {
+ return ""
+ }
+ return strings.TrimSpace(s[1:])
+}
+
+func split(s string, c byte) (head, tail string) {
+ if i := strings.IndexByte(s, c); i >= 0 {
+ return strings.TrimSpace(s[:i]), strings.TrimSpace(s[i+1:])
+ }
+ return strings.TrimSpace(s), ""
+}
+
+// Add hack mapping to deal with a small number of cases that occur
+// in Accept-Language (with reasonable frequency).
+var acceptFallback = map[string]language.Language{
+ "english": _en,
+ "deutsch": _de,
+ "italian": _it,
+ "french": _fr,
+ "*": _mul, // defined in the spec to match all languages.
+}
+
+type tagSort struct {
+ tag []Tag
+ q []float32
+}
+
+func (s *tagSort) Len() int {
+ return len(s.q)
+}
+
+func (s *tagSort) Less(i, j int) bool {
+ return s.q[i] > s.q[j]
+}
+
+func (s *tagSort) Swap(i, j int) {
+ s.tag[i], s.tag[j] = s.tag[j], s.tag[i]
+ s.q[i], s.q[j] = s.q[j], s.q[i]
+}
diff --git a/vendor/golang.org/x/text/language/tables.go b/vendor/golang.org/x/text/language/tables.go
new file mode 100644
index 000000000..96b57f610
--- /dev/null
+++ b/vendor/golang.org/x/text/language/tables.go
@@ -0,0 +1,298 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+package language
+
+// CLDRVersion is the CLDR version from which the tables in this package are derived.
+const CLDRVersion = "32"
+
+const (
+ _de = 269
+ _en = 313
+ _fr = 350
+ _it = 505
+ _mo = 784
+ _no = 879
+ _nb = 839
+ _pt = 960
+ _sh = 1031
+ _mul = 806
+ _und = 0
+)
+const (
+ _001 = 1
+ _419 = 31
+ _BR = 65
+ _CA = 73
+ _ES = 110
+ _GB = 123
+ _MD = 188
+ _PT = 238
+ _UK = 306
+ _US = 309
+ _ZZ = 357
+ _XA = 323
+ _XC = 325
+ _XK = 333
+)
+const (
+ _Latn = 90
+ _Hani = 57
+ _Hans = 59
+ _Hant = 60
+ _Qaaa = 143
+ _Qaai = 151
+ _Qabx = 192
+ _Zinh = 245
+ _Zyyy = 250
+ _Zzzz = 251
+)
+
+var regionToGroups = []uint8{ // 358 elements
+ // Entry 0 - 3F
+ 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00,
+ 0x00, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x04,
+ // Entry 40 - 7F
+ 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00,
+ 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x08,
+ 0x00, 0x04, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00,
+ // Entry 80 - BF
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00,
+ 0x00, 0x04, 0x01, 0x00, 0x04, 0x02, 0x00, 0x04,
+ 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
+ 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00,
+ // Entry C0 - FF
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01,
+ 0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x00, 0x05, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // Entry 100 - 13F
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
+ 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x04, 0x00,
+ 0x00, 0x04, 0x00, 0x04, 0x04, 0x05, 0x00, 0x00,
+ // Entry 140 - 17F
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+} // Size: 382 bytes
+
+var paradigmLocales = [][3]uint16{ // 3 elements
+ 0: [3]uint16{0x139, 0x0, 0x7b},
+ 1: [3]uint16{0x13e, 0x0, 0x1f},
+ 2: [3]uint16{0x3c0, 0x41, 0xee},
+} // Size: 42 bytes
+
+type mutualIntelligibility struct {
+ want uint16
+ have uint16
+ distance uint8
+ oneway bool
+}
+type scriptIntelligibility struct {
+ wantLang uint16
+ haveLang uint16
+ wantScript uint8
+ haveScript uint8
+ distance uint8
+}
+type regionIntelligibility struct {
+ lang uint16
+ script uint8
+ group uint8
+ distance uint8
+}
+
+// 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.
+var matchLang = []mutualIntelligibility{ // 113 elements
+ 0: {want: 0x1d1, have: 0xb7, distance: 0x4, oneway: false},
+ 1: {want: 0x407, have: 0xb7, distance: 0x4, oneway: false},
+ 2: {want: 0x407, have: 0x1d1, distance: 0x4, oneway: false},
+ 3: {want: 0x407, have: 0x432, distance: 0x4, oneway: false},
+ 4: {want: 0x43a, have: 0x1, distance: 0x4, oneway: false},
+ 5: {want: 0x1a3, have: 0x10d, distance: 0x4, oneway: true},
+ 6: {want: 0x295, have: 0x10d, distance: 0x4, oneway: true},
+ 7: {want: 0x101, have: 0x36f, distance: 0x8, oneway: false},
+ 8: {want: 0x101, have: 0x347, distance: 0x8, oneway: false},
+ 9: {want: 0x5, have: 0x3e2, distance: 0xa, oneway: true},
+ 10: {want: 0xd, have: 0x139, distance: 0xa, oneway: true},
+ 11: {want: 0x16, have: 0x367, distance: 0xa, oneway: true},
+ 12: {want: 0x21, have: 0x139, distance: 0xa, oneway: true},
+ 13: {want: 0x56, have: 0x13e, distance: 0xa, oneway: true},
+ 14: {want: 0x58, have: 0x3e2, distance: 0xa, oneway: true},
+ 15: {want: 0x71, have: 0x3e2, distance: 0xa, oneway: true},
+ 16: {want: 0x75, have: 0x139, distance: 0xa, oneway: true},
+ 17: {want: 0x82, have: 0x1be, distance: 0xa, oneway: true},
+ 18: {want: 0xa5, have: 0x139, distance: 0xa, oneway: true},
+ 19: {want: 0xb2, have: 0x15e, distance: 0xa, oneway: true},
+ 20: {want: 0xdd, have: 0x153, distance: 0xa, oneway: true},
+ 21: {want: 0xe5, have: 0x139, distance: 0xa, oneway: true},
+ 22: {want: 0xe9, have: 0x3a, distance: 0xa, oneway: true},
+ 23: {want: 0xf0, have: 0x15e, distance: 0xa, oneway: true},
+ 24: {want: 0xf9, have: 0x15e, distance: 0xa, oneway: true},
+ 25: {want: 0x100, have: 0x139, distance: 0xa, oneway: true},
+ 26: {want: 0x130, have: 0x139, distance: 0xa, oneway: true},
+ 27: {want: 0x13c, have: 0x139, distance: 0xa, oneway: true},
+ 28: {want: 0x140, have: 0x151, distance: 0xa, oneway: true},
+ 29: {want: 0x145, have: 0x13e, distance: 0xa, oneway: true},
+ 30: {want: 0x158, have: 0x101, distance: 0xa, oneway: true},
+ 31: {want: 0x16d, have: 0x367, distance: 0xa, oneway: true},
+ 32: {want: 0x16e, have: 0x139, distance: 0xa, oneway: true},
+ 33: {want: 0x16f, have: 0x139, distance: 0xa, oneway: true},
+ 34: {want: 0x17e, have: 0x139, distance: 0xa, oneway: true},
+ 35: {want: 0x190, have: 0x13e, distance: 0xa, oneway: true},
+ 36: {want: 0x194, have: 0x13e, distance: 0xa, oneway: true},
+ 37: {want: 0x1a4, have: 0x1be, distance: 0xa, oneway: true},
+ 38: {want: 0x1b4, have: 0x139, distance: 0xa, oneway: true},
+ 39: {want: 0x1b8, have: 0x139, distance: 0xa, oneway: true},
+ 40: {want: 0x1d4, have: 0x15e, distance: 0xa, oneway: true},
+ 41: {want: 0x1d7, have: 0x3e2, distance: 0xa, oneway: true},
+ 42: {want: 0x1d9, have: 0x139, distance: 0xa, oneway: true},
+ 43: {want: 0x1e7, have: 0x139, distance: 0xa, oneway: true},
+ 44: {want: 0x1f8, have: 0x139, distance: 0xa, oneway: true},
+ 45: {want: 0x20e, have: 0x1e1, distance: 0xa, oneway: true},
+ 46: {want: 0x210, have: 0x139, distance: 0xa, oneway: true},
+ 47: {want: 0x22d, have: 0x15e, distance: 0xa, oneway: true},
+ 48: {want: 0x242, have: 0x3e2, distance: 0xa, oneway: true},
+ 49: {want: 0x24a, have: 0x139, distance: 0xa, oneway: true},
+ 50: {want: 0x251, have: 0x139, distance: 0xa, oneway: true},
+ 51: {want: 0x265, have: 0x139, distance: 0xa, oneway: true},
+ 52: {want: 0x274, have: 0x48a, distance: 0xa, oneway: true},
+ 53: {want: 0x28a, have: 0x3e2, distance: 0xa, oneway: true},
+ 54: {want: 0x28e, have: 0x1f9, distance: 0xa, oneway: true},
+ 55: {want: 0x2a3, have: 0x139, distance: 0xa, oneway: true},
+ 56: {want: 0x2b5, have: 0x15e, distance: 0xa, oneway: true},
+ 57: {want: 0x2b8, have: 0x139, distance: 0xa, oneway: true},
+ 58: {want: 0x2be, have: 0x139, distance: 0xa, oneway: true},
+ 59: {want: 0x2c3, have: 0x15e, distance: 0xa, oneway: true},
+ 60: {want: 0x2ed, have: 0x139, distance: 0xa, oneway: true},
+ 61: {want: 0x2f1, have: 0x15e, distance: 0xa, oneway: true},
+ 62: {want: 0x2fa, have: 0x139, distance: 0xa, oneway: true},
+ 63: {want: 0x2ff, have: 0x7e, distance: 0xa, oneway: true},
+ 64: {want: 0x304, have: 0x139, distance: 0xa, oneway: true},
+ 65: {want: 0x30b, have: 0x3e2, distance: 0xa, oneway: true},
+ 66: {want: 0x31b, have: 0x1be, distance: 0xa, oneway: true},
+ 67: {want: 0x31f, have: 0x1e1, distance: 0xa, oneway: true},
+ 68: {want: 0x320, have: 0x139, distance: 0xa, oneway: true},
+ 69: {want: 0x331, have: 0x139, distance: 0xa, oneway: true},
+ 70: {want: 0x351, have: 0x139, distance: 0xa, oneway: true},
+ 71: {want: 0x36a, have: 0x347, distance: 0xa, oneway: false},
+ 72: {want: 0x36a, have: 0x36f, distance: 0xa, oneway: true},
+ 73: {want: 0x37a, have: 0x139, distance: 0xa, oneway: true},
+ 74: {want: 0x387, have: 0x139, distance: 0xa, oneway: true},
+ 75: {want: 0x389, have: 0x139, distance: 0xa, oneway: true},
+ 76: {want: 0x38b, have: 0x15e, distance: 0xa, oneway: true},
+ 77: {want: 0x390, have: 0x139, distance: 0xa, oneway: true},
+ 78: {want: 0x395, have: 0x139, distance: 0xa, oneway: true},
+ 79: {want: 0x39d, have: 0x139, distance: 0xa, oneway: true},
+ 80: {want: 0x3a5, have: 0x139, distance: 0xa, oneway: true},
+ 81: {want: 0x3be, have: 0x139, distance: 0xa, oneway: true},
+ 82: {want: 0x3c4, have: 0x13e, distance: 0xa, oneway: true},
+ 83: {want: 0x3d4, have: 0x10d, distance: 0xa, oneway: true},
+ 84: {want: 0x3d9, have: 0x139, distance: 0xa, oneway: true},
+ 85: {want: 0x3e5, have: 0x15e, distance: 0xa, oneway: true},
+ 86: {want: 0x3e9, have: 0x1be, distance: 0xa, oneway: true},
+ 87: {want: 0x3fa, have: 0x139, distance: 0xa, oneway: true},
+ 88: {want: 0x40c, have: 0x139, distance: 0xa, oneway: true},
+ 89: {want: 0x423, have: 0x139, distance: 0xa, oneway: true},
+ 90: {want: 0x429, have: 0x139, distance: 0xa, oneway: true},
+ 91: {want: 0x431, have: 0x139, distance: 0xa, oneway: true},
+ 92: {want: 0x43b, have: 0x139, distance: 0xa, oneway: true},
+ 93: {want: 0x43e, have: 0x1e1, distance: 0xa, oneway: true},
+ 94: {want: 0x445, have: 0x139, distance: 0xa, oneway: true},
+ 95: {want: 0x450, have: 0x139, distance: 0xa, oneway: true},
+ 96: {want: 0x461, have: 0x139, distance: 0xa, oneway: true},
+ 97: {want: 0x467, have: 0x3e2, distance: 0xa, oneway: true},
+ 98: {want: 0x46f, have: 0x139, distance: 0xa, oneway: true},
+ 99: {want: 0x476, have: 0x3e2, distance: 0xa, oneway: true},
+ 100: {want: 0x3883, have: 0x139, distance: 0xa, oneway: true},
+ 101: {want: 0x480, have: 0x139, distance: 0xa, oneway: true},
+ 102: {want: 0x482, have: 0x139, distance: 0xa, oneway: true},
+ 103: {want: 0x494, have: 0x3e2, distance: 0xa, oneway: true},
+ 104: {want: 0x49d, have: 0x139, distance: 0xa, oneway: true},
+ 105: {want: 0x4ac, have: 0x529, distance: 0xa, oneway: true},
+ 106: {want: 0x4b4, have: 0x139, distance: 0xa, oneway: true},
+ 107: {want: 0x4bc, have: 0x3e2, distance: 0xa, oneway: true},
+ 108: {want: 0x4e5, have: 0x15e, distance: 0xa, oneway: true},
+ 109: {want: 0x4f2, have: 0x139, distance: 0xa, oneway: true},
+ 110: {want: 0x512, have: 0x139, distance: 0xa, oneway: true},
+ 111: {want: 0x518, have: 0x139, distance: 0xa, oneway: true},
+ 112: {want: 0x52f, have: 0x139, distance: 0xa, oneway: true},
+} // Size: 702 bytes
+
+// matchScript holds pairs of scriptIDs where readers of one script
+// can typically also read the other. Each is associated with a confidence.
+var matchScript = []scriptIntelligibility{ // 26 elements
+ 0: {wantLang: 0x432, haveLang: 0x432, wantScript: 0x5a, haveScript: 0x20, distance: 0x5},
+ 1: {wantLang: 0x432, haveLang: 0x432, wantScript: 0x20, haveScript: 0x5a, distance: 0x5},
+ 2: {wantLang: 0x58, haveLang: 0x3e2, wantScript: 0x5a, haveScript: 0x20, distance: 0xa},
+ 3: {wantLang: 0xa5, haveLang: 0x139, wantScript: 0xe, haveScript: 0x5a, distance: 0xa},
+ 4: {wantLang: 0x1d7, haveLang: 0x3e2, wantScript: 0x8, haveScript: 0x20, distance: 0xa},
+ 5: {wantLang: 0x210, haveLang: 0x139, wantScript: 0x2e, haveScript: 0x5a, distance: 0xa},
+ 6: {wantLang: 0x24a, haveLang: 0x139, wantScript: 0x4e, haveScript: 0x5a, distance: 0xa},
+ 7: {wantLang: 0x251, haveLang: 0x139, wantScript: 0x52, haveScript: 0x5a, distance: 0xa},
+ 8: {wantLang: 0x2b8, haveLang: 0x139, wantScript: 0x57, haveScript: 0x5a, distance: 0xa},
+ 9: {wantLang: 0x304, haveLang: 0x139, wantScript: 0x6e, haveScript: 0x5a, distance: 0xa},
+ 10: {wantLang: 0x331, haveLang: 0x139, wantScript: 0x75, haveScript: 0x5a, distance: 0xa},
+ 11: {wantLang: 0x351, haveLang: 0x139, wantScript: 0x22, haveScript: 0x5a, distance: 0xa},
+ 12: {wantLang: 0x395, haveLang: 0x139, wantScript: 0x81, haveScript: 0x5a, distance: 0xa},
+ 13: {wantLang: 0x39d, haveLang: 0x139, wantScript: 0x36, haveScript: 0x5a, distance: 0xa},
+ 14: {wantLang: 0x3be, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5a, distance: 0xa},
+ 15: {wantLang: 0x3fa, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5a, distance: 0xa},
+ 16: {wantLang: 0x40c, haveLang: 0x139, wantScript: 0xcf, haveScript: 0x5a, distance: 0xa},
+ 17: {wantLang: 0x450, haveLang: 0x139, wantScript: 0xde, haveScript: 0x5a, distance: 0xa},
+ 18: {wantLang: 0x461, haveLang: 0x139, wantScript: 0xe1, haveScript: 0x5a, distance: 0xa},
+ 19: {wantLang: 0x46f, haveLang: 0x139, wantScript: 0x2c, haveScript: 0x5a, distance: 0xa},
+ 20: {wantLang: 0x476, haveLang: 0x3e2, wantScript: 0x5a, haveScript: 0x20, distance: 0xa},
+ 21: {wantLang: 0x4b4, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5a, distance: 0xa},
+ 22: {wantLang: 0x4bc, haveLang: 0x3e2, wantScript: 0x5a, haveScript: 0x20, distance: 0xa},
+ 23: {wantLang: 0x512, haveLang: 0x139, wantScript: 0x3e, haveScript: 0x5a, distance: 0xa},
+ 24: {wantLang: 0x529, haveLang: 0x529, wantScript: 0x3b, haveScript: 0x3c, distance: 0xf},
+ 25: {wantLang: 0x529, haveLang: 0x529, wantScript: 0x3c, haveScript: 0x3b, distance: 0x13},
+} // Size: 232 bytes
+
+var matchRegion = []regionIntelligibility{ // 15 elements
+ 0: {lang: 0x3a, script: 0x0, group: 0x4, distance: 0x4},
+ 1: {lang: 0x3a, script: 0x0, group: 0x84, distance: 0x4},
+ 2: {lang: 0x139, script: 0x0, group: 0x1, distance: 0x4},
+ 3: {lang: 0x139, script: 0x0, group: 0x81, distance: 0x4},
+ 4: {lang: 0x13e, script: 0x0, group: 0x3, distance: 0x4},
+ 5: {lang: 0x13e, script: 0x0, group: 0x83, distance: 0x4},
+ 6: {lang: 0x3c0, script: 0x0, group: 0x3, distance: 0x4},
+ 7: {lang: 0x3c0, script: 0x0, group: 0x83, distance: 0x4},
+ 8: {lang: 0x529, script: 0x3c, group: 0x2, distance: 0x4},
+ 9: {lang: 0x529, script: 0x3c, group: 0x82, distance: 0x4},
+ 10: {lang: 0x3a, script: 0x0, group: 0x80, distance: 0x5},
+ 11: {lang: 0x139, script: 0x0, group: 0x80, distance: 0x5},
+ 12: {lang: 0x13e, script: 0x0, group: 0x80, distance: 0x5},
+ 13: {lang: 0x3c0, script: 0x0, group: 0x80, distance: 0x5},
+ 14: {lang: 0x529, script: 0x3c, group: 0x80, distance: 0x5},
+} // Size: 114 bytes
+
+// Total table size 1472 bytes (1KiB); checksum: F86C669
diff --git a/vendor/golang.org/x/text/language/tags.go b/vendor/golang.org/x/text/language/tags.go
new file mode 100644
index 000000000..42ea79266
--- /dev/null
+++ b/vendor/golang.org/x/text/language/tags.go
@@ -0,0 +1,145 @@
+// 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 language
+
+import "golang.org/x/text/internal/language/compact"
+
+// TODO: Various sets of commonly use tags and regions.
+
+// MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed.
+// It simplifies safe initialization of Tag values.
+func MustParse(s string) Tag {
+ t, err := Parse(s)
+ if err != nil {
+ panic(err)
+ }
+ return t
+}
+
+// MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed.
+// It simplifies safe initialization of Tag values.
+func (c CanonType) MustParse(s string) Tag {
+ t, err := c.Parse(s)
+ if err != nil {
+ panic(err)
+ }
+ return t
+}
+
+// MustParseBase is like ParseBase, but panics if the given base cannot be parsed.
+// It simplifies safe initialization of Base values.
+func MustParseBase(s string) Base {
+ b, err := ParseBase(s)
+ if err != nil {
+ panic(err)
+ }
+ return b
+}
+
+// MustParseScript is like ParseScript, but panics if the given script cannot be
+// parsed. It simplifies safe initialization of Script values.
+func MustParseScript(s string) Script {
+ scr, err := ParseScript(s)
+ if err != nil {
+ panic(err)
+ }
+ return scr
+}
+
+// MustParseRegion is like ParseRegion, but panics if the given region cannot be
+// parsed. It simplifies safe initialization of Region values.
+func MustParseRegion(s string) Region {
+ r, err := ParseRegion(s)
+ if err != nil {
+ panic(err)
+ }
+ return r
+}
+
+var (
+ und = Tag{}
+
+ Und Tag = Tag{}
+
+ Afrikaans Tag = Tag(compact.Afrikaans)
+ Amharic Tag = Tag(compact.Amharic)
+ Arabic Tag = Tag(compact.Arabic)
+ ModernStandardArabic Tag = Tag(compact.ModernStandardArabic)
+ Azerbaijani Tag = Tag(compact.Azerbaijani)
+ Bulgarian Tag = Tag(compact.Bulgarian)
+ Bengali Tag = Tag(compact.Bengali)
+ Catalan Tag = Tag(compact.Catalan)
+ Czech Tag = Tag(compact.Czech)
+ Danish Tag = Tag(compact.Danish)
+ German Tag = Tag(compact.German)
+ Greek Tag = Tag(compact.Greek)
+ English Tag = Tag(compact.English)
+ AmericanEnglish Tag = Tag(compact.AmericanEnglish)
+ BritishEnglish Tag = Tag(compact.BritishEnglish)
+ Spanish Tag = Tag(compact.Spanish)
+ EuropeanSpanish Tag = Tag(compact.EuropeanSpanish)
+ LatinAmericanSpanish Tag = Tag(compact.LatinAmericanSpanish)
+ Estonian Tag = Tag(compact.Estonian)
+ Persian Tag = Tag(compact.Persian)
+ Finnish Tag = Tag(compact.Finnish)
+ Filipino Tag = Tag(compact.Filipino)
+ French Tag = Tag(compact.French)
+ CanadianFrench Tag = Tag(compact.CanadianFrench)
+ Gujarati Tag = Tag(compact.Gujarati)
+ Hebrew Tag = Tag(compact.Hebrew)
+ Hindi Tag = Tag(compact.Hindi)
+ Croatian Tag = Tag(compact.Croatian)
+ Hungarian Tag = Tag(compact.Hungarian)
+ Armenian Tag = Tag(compact.Armenian)
+ Indonesian Tag = Tag(compact.Indonesian)
+ Icelandic Tag = Tag(compact.Icelandic)
+ Italian Tag = Tag(compact.Italian)
+ Japanese Tag = Tag(compact.Japanese)
+ Georgian Tag = Tag(compact.Georgian)
+ Kazakh Tag = Tag(compact.Kazakh)
+ Khmer Tag = Tag(compact.Khmer)
+ Kannada Tag = Tag(compact.Kannada)
+ Korean Tag = Tag(compact.Korean)
+ Kirghiz Tag = Tag(compact.Kirghiz)
+ Lao Tag = Tag(compact.Lao)
+ Lithuanian Tag = Tag(compact.Lithuanian)
+ Latvian Tag = Tag(compact.Latvian)
+ Macedonian Tag = Tag(compact.Macedonian)
+ Malayalam Tag = Tag(compact.Malayalam)
+ Mongolian Tag = Tag(compact.Mongolian)
+ Marathi Tag = Tag(compact.Marathi)
+ Malay Tag = Tag(compact.Malay)
+ Burmese Tag = Tag(compact.Burmese)
+ Nepali Tag = Tag(compact.Nepali)
+ Dutch Tag = Tag(compact.Dutch)
+ Norwegian Tag = Tag(compact.Norwegian)
+ Punjabi Tag = Tag(compact.Punjabi)
+ Polish Tag = Tag(compact.Polish)
+ Portuguese Tag = Tag(compact.Portuguese)
+ BrazilianPortuguese Tag = Tag(compact.BrazilianPortuguese)
+ EuropeanPortuguese Tag = Tag(compact.EuropeanPortuguese)
+ Romanian Tag = Tag(compact.Romanian)
+ Russian Tag = Tag(compact.Russian)
+ Sinhala Tag = Tag(compact.Sinhala)
+ Slovak Tag = Tag(compact.Slovak)
+ Slovenian Tag = Tag(compact.Slovenian)
+ Albanian Tag = Tag(compact.Albanian)
+ Serbian Tag = Tag(compact.Serbian)
+ SerbianLatin Tag = Tag(compact.SerbianLatin)
+ Swedish Tag = Tag(compact.Swedish)
+ Swahili Tag = Tag(compact.Swahili)
+ Tamil Tag = Tag(compact.Tamil)
+ Telugu Tag = Tag(compact.Telugu)
+ Thai Tag = Tag(compact.Thai)
+ Turkish Tag = Tag(compact.Turkish)
+ Ukrainian Tag = Tag(compact.Ukrainian)
+ Urdu Tag = Tag(compact.Urdu)
+ Uzbek Tag = Tag(compact.Uzbek)
+ Vietnamese Tag = Tag(compact.Vietnamese)
+ Chinese Tag = Tag(compact.Chinese)
+ SimplifiedChinese Tag = Tag(compact.SimplifiedChinese)
+ TraditionalChinese Tag = Tag(compact.TraditionalChinese)
+ Zulu Tag = Tag(compact.Zulu)
+)
diff --git a/vendor/gopkg.in/yaml.v2/.travis.yml b/vendor/gopkg.in/yaml.v2/.travis.yml
index 055480b9e..7348c50c0 100644
--- a/vendor/gopkg.in/yaml.v2/.travis.yml
+++ b/vendor/gopkg.in/yaml.v2/.travis.yml
@@ -11,6 +11,7 @@ go:
- "1.11.x"
- "1.12.x"
- "1.13.x"
+ - "1.14.x"
- "tip"
go_import_path: gopkg.in/yaml.v2
diff --git a/vendor/gopkg.in/yaml.v2/apic.go b/vendor/gopkg.in/yaml.v2/apic.go
index d2c2308f1..acf71402c 100644
--- a/vendor/gopkg.in/yaml.v2/apic.go
+++ b/vendor/gopkg.in/yaml.v2/apic.go
@@ -79,6 +79,8 @@ func yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encoding_t) {
parser.encoding = encoding
}
+var disableLineWrapping = false
+
// Create a new emitter object.
func yaml_emitter_initialize(emitter *yaml_emitter_t) {
*emitter = yaml_emitter_t{
@@ -86,7 +88,9 @@ func yaml_emitter_initialize(emitter *yaml_emitter_t) {
raw_buffer: make([]byte, 0, output_raw_buffer_size),
states: make([]yaml_emitter_state_t, 0, initial_stack_size),
events: make([]yaml_event_t, 0, initial_queue_size),
- best_width: -1,
+ }
+ if disableLineWrapping {
+ emitter.best_width = -1
}
}
diff --git a/vendor/gopkg.in/yaml.v2/go.mod b/vendor/gopkg.in/yaml.v2/go.mod
index 1934e8769..2cbb85aea 100644
--- a/vendor/gopkg.in/yaml.v2/go.mod
+++ b/vendor/gopkg.in/yaml.v2/go.mod
@@ -1,5 +1,5 @@
-module "gopkg.in/yaml.v2"
+module gopkg.in/yaml.v2
-require (
- "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405
-)
+go 1.15
+
+require gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
diff --git a/vendor/gopkg.in/yaml.v2/yaml.go b/vendor/gopkg.in/yaml.v2/yaml.go
index 89650e293..30813884c 100644
--- a/vendor/gopkg.in/yaml.v2/yaml.go
+++ b/vendor/gopkg.in/yaml.v2/yaml.go
@@ -175,7 +175,7 @@ func unmarshal(in []byte, out interface{}, strict bool) (err error) {
// Zero valued structs will be omitted if all their public
// fields are zero, unless they implement an IsZero
// method (see the IsZeroer interface type), in which
-// case the field will be included if that method returns true.
+// case the field will be excluded if IsZero returns true.
//
// flow Marshal using a flow style (useful for structs,
// sequences and maps).
@@ -464,3 +464,15 @@ func isZero(v reflect.Value) bool {
}
return false
}
+
+// FutureLineWrap globally disables line wrapping when encoding long strings.
+// This is a temporary and thus deprecated method introduced to faciliate
+// migration towards v3, which offers more control of line lengths on
+// individual encodings, and has a default matching the behavior introduced
+// by this function.
+//
+// The default formatting of v2 was erroneously changed in v2.3.0 and reverted
+// in v2.4.0, at which point this function was introduced to help migration.
+func FutureLineWrap() {
+ disableLineWrapping = true
+}
diff --git a/vendor/gopkg.in/yaml.v3/.travis.yml b/vendor/gopkg.in/yaml.v3/.travis.yml
deleted file mode 100644
index 04d4dae09..000000000
--- a/vendor/gopkg.in/yaml.v3/.travis.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-language: go
-
-go:
- - "1.4.x"
- - "1.5.x"
- - "1.6.x"
- - "1.7.x"
- - "1.8.x"
- - "1.9.x"
- - "1.10.x"
- - "1.11.x"
- - "1.12.x"
- - "1.13.x"
- - "tip"
-
-go_import_path: gopkg.in/yaml.v3
diff --git a/vendor/gopkg.in/yaml.v3/decode.go b/vendor/gopkg.in/yaml.v3/decode.go
index d50c61aae..df36e3a30 100644
--- a/vendor/gopkg.in/yaml.v3/decode.go
+++ b/vendor/gopkg.in/yaml.v3/decode.go
@@ -35,6 +35,7 @@ type parser struct {
doc *Node
anchors map[string]*Node
doneInit bool
+ textless bool
}
func newParser(b []byte) *parser {
@@ -173,17 +174,20 @@ func (p *parser) node(kind Kind, defaultTag, tag, value string) *Node {
} else if kind == ScalarNode {
tag, _ = resolve("", value)
}
- return &Node{
- Kind: kind,
- Tag: tag,
- Value: value,
- Style: style,
- Line: p.event.start_mark.line + 1,
- Column: p.event.start_mark.column + 1,
- HeadComment: string(p.event.head_comment),
- LineComment: string(p.event.line_comment),
- FootComment: string(p.event.foot_comment),
+ n := &Node{
+ Kind: kind,
+ Tag: tag,
+ Value: value,
+ Style: style,
}
+ if !p.textless {
+ n.Line = p.event.start_mark.line + 1
+ n.Column = p.event.start_mark.column + 1
+ n.HeadComment = string(p.event.head_comment)
+ n.LineComment = string(p.event.line_comment)
+ n.FootComment = string(p.event.foot_comment)
+ }
+ return n
}
func (p *parser) parseChild(parent *Node) *Node {
@@ -501,8 +505,13 @@ func (d *decoder) unmarshal(n *Node, out reflect.Value) (good bool) {
good = d.mapping(n, out)
case SequenceNode:
good = d.sequence(n, out)
+ case 0:
+ if n.IsZero() {
+ return d.null(out)
+ }
+ fallthrough
default:
- panic("internal error: unknown node kind: " + strconv.Itoa(int(n.Kind)))
+ failf("cannot decode node with unknown kind %d", n.Kind)
}
return good
}
@@ -537,6 +546,17 @@ func resetMap(out reflect.Value) {
}
}
+func (d *decoder) null(out reflect.Value) bool {
+ if out.CanAddr() {
+ switch out.Kind() {
+ case reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice:
+ out.Set(reflect.Zero(out.Type()))
+ return true
+ }
+ }
+ return false
+}
+
func (d *decoder) scalar(n *Node, out reflect.Value) bool {
var tag string
var resolved interface{}
@@ -554,14 +574,7 @@ func (d *decoder) scalar(n *Node, out reflect.Value) bool {
}
}
if resolved == nil {
- if out.CanAddr() {
- switch out.Kind() {
- case reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice:
- out.Set(reflect.Zero(out.Type()))
- return true
- }
- }
- return false
+ return d.null(out)
}
if resolvedv := reflect.ValueOf(resolved); out.Type() == resolvedv.Type() {
// We've resolved to exactly the type we want, so use that.
@@ -795,8 +808,10 @@ func (d *decoder) mapping(n *Node, out reflect.Value) (good bool) {
}
}
+ mapIsNew := false
if out.IsNil() {
out.Set(reflect.MakeMap(outt))
+ mapIsNew = true
}
for i := 0; i < l; i += 2 {
if isMerge(n.Content[i]) {
@@ -813,7 +828,7 @@ func (d *decoder) mapping(n *Node, out reflect.Value) (good bool) {
failf("invalid map key: %#v", k.Interface())
}
e := reflect.New(et).Elem()
- if d.unmarshal(n.Content[i+1], e) {
+ if d.unmarshal(n.Content[i+1], e) || n.Content[i+1].ShortTag() == nullTag && (mapIsNew || !out.MapIndex(k).IsValid()) {
out.SetMapIndex(k, e)
}
}
diff --git a/vendor/gopkg.in/yaml.v3/emitterc.go b/vendor/gopkg.in/yaml.v3/emitterc.go
index c7bd5d2a3..0f47c9ca8 100644
--- a/vendor/gopkg.in/yaml.v3/emitterc.go
+++ b/vendor/gopkg.in/yaml.v3/emitterc.go
@@ -235,10 +235,13 @@ func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool
emitter.indent = 0
}
} else if !indentless {
- emitter.indent += emitter.best_indent
- // [Go] If inside a block sequence item, discount the space taken by the indicator.
- if emitter.best_indent > 2 && emitter.states[len(emitter.states)-1] == yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE {
- emitter.indent -= 2
+ // [Go] This was changed so that indentations are more regular.
+ if emitter.states[len(emitter.states)-1] == yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE {
+ // The first indent inside a sequence will just skip the "- " indicator.
+ emitter.indent += 2
+ } else {
+ // Everything else aligns to the chosen indentation.
+ emitter.indent = emitter.best_indent*((emitter.indent+emitter.best_indent)/emitter.best_indent)
}
}
return true
@@ -725,16 +728,9 @@ func yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t, event *yaml_e
// Expect a block item node.
func yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {
if first {
- // [Go] The original logic here would not indent the sequence when
- // inside a mapping. In Go we always indent it.
- indentless := false
- original := emitter.indent
- if !yaml_emitter_increase_indent(emitter, false, indentless) {
+ if !yaml_emitter_increase_indent(emitter, false, false) {
return false
}
- if emitter.indent > original+2 {
- emitter.indent -= 2
- }
}
if event.typ == yaml_SEQUENCE_END_EVENT {
emitter.indent = emitter.indents[len(emitter.indents)-1]
@@ -785,6 +781,13 @@ func yaml_emitter_emit_block_mapping_key(emitter *yaml_emitter_t, event *yaml_ev
if !yaml_emitter_write_indent(emitter) {
return false
}
+ if len(emitter.line_comment) > 0 {
+ // [Go] A line comment was provided for the key. That's unusual as the
+ // scanner associates line comments with the value. Either way,
+ // save the line comment and render it appropriately later.
+ emitter.key_line_comment = emitter.line_comment
+ emitter.line_comment = nil
+ }
if yaml_emitter_check_simple_key(emitter) {
emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE)
return yaml_emitter_emit_node(emitter, event, false, false, true, true)
@@ -810,6 +813,27 @@ func yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t, event *yaml_
return false
}
}
+ if len(emitter.key_line_comment) > 0 {
+ // [Go] Line comments are generally associated with the value, but when there's
+ // no value on the same line as a mapping key they end up attached to the
+ // key itself.
+ if event.typ == yaml_SCALAR_EVENT {
+ if len(emitter.line_comment) == 0 {
+ // A scalar is coming and it has no line comments by itself yet,
+ // so just let it handle the line comment as usual. If it has a
+ // line comment, we can't have both so the one from the key is lost.
+ emitter.line_comment = emitter.key_line_comment
+ emitter.key_line_comment = nil
+ }
+ } else if event.sequence_style() != yaml_FLOW_SEQUENCE_STYLE && (event.typ == yaml_MAPPING_START_EVENT || event.typ == yaml_SEQUENCE_START_EVENT) {
+ // An indented block follows, so write the comment right now.
+ emitter.line_comment, emitter.key_line_comment = emitter.key_line_comment, emitter.line_comment
+ if !yaml_emitter_process_line_comment(emitter) {
+ return false
+ }
+ emitter.line_comment, emitter.key_line_comment = emitter.key_line_comment, emitter.line_comment
+ }
+ }
emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_KEY_STATE)
if !yaml_emitter_emit_node(emitter, event, false, false, true, false) {
return false
@@ -823,6 +847,10 @@ func yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t, event *yaml_
return true
}
+func yaml_emitter_silent_nil_event(emitter *yaml_emitter_t, event *yaml_event_t) bool {
+ return event.typ == yaml_SCALAR_EVENT && event.implicit && !emitter.canonical && len(emitter.scalar_data.value) == 0
+}
+
// Expect a node.
func yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t,
root bool, sequence bool, mapping bool, simple_key bool) bool {
@@ -1866,7 +1894,7 @@ func yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []byte) bo
if !yaml_emitter_write_block_scalar_hints(emitter, value) {
return false
}
- if !put_break(emitter) {
+ if !yaml_emitter_process_line_comment(emitter) {
return false
}
//emitter.indention = true
@@ -1903,10 +1931,10 @@ func yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []byte) boo
if !yaml_emitter_write_block_scalar_hints(emitter, value) {
return false
}
-
- if !put_break(emitter) {
+ if !yaml_emitter_process_line_comment(emitter) {
return false
}
+
//emitter.indention = true
emitter.whitespace = true
diff --git a/vendor/gopkg.in/yaml.v3/encode.go b/vendor/gopkg.in/yaml.v3/encode.go
index e998db941..de9e72a3e 100644
--- a/vendor/gopkg.in/yaml.v3/encode.go
+++ b/vendor/gopkg.in/yaml.v3/encode.go
@@ -120,6 +120,11 @@ func (e *encoder) marshal(tag string, in reflect.Value) {
e.nodev(in)
return
case Node:
+ if !in.CanAddr() {
+ var n = reflect.New(in.Type()).Elem()
+ n.Set(in)
+ in = n
+ }
e.nodev(in.Addr())
return
case time.Time:
@@ -425,18 +430,23 @@ func (e *encoder) nodev(in reflect.Value) {
}
func (e *encoder) node(node *Node, tail string) {
+ // Zero nodes behave as nil.
+ if node.Kind == 0 && node.IsZero() {
+ e.nilv()
+ return
+ }
+
// If the tag was not explicitly requested, and dropping it won't change the
// implicit tag of the value, don't include it in the presentation.
var tag = node.Tag
var stag = shortTag(tag)
- var rtag string
var forceQuoting bool
if tag != "" && node.Style&TaggedStyle == 0 {
if node.Kind == ScalarNode {
if stag == strTag && node.Style&(SingleQuotedStyle|DoubleQuotedStyle|LiteralStyle|FoldedStyle) != 0 {
tag = ""
} else {
- rtag, _ = resolve("", node.Value)
+ rtag, _ := resolve("", node.Value)
if rtag == stag {
tag = ""
} else if stag == strTag {
@@ -445,6 +455,7 @@ func (e *encoder) node(node *Node, tail string) {
}
}
} else {
+ var rtag string
switch node.Kind {
case MappingNode:
rtag = mapTag
@@ -474,7 +485,7 @@ func (e *encoder) node(node *Node, tail string) {
if node.Style&FlowStyle != 0 {
style = yaml_FLOW_SEQUENCE_STYLE
}
- e.must(yaml_sequence_start_event_initialize(&e.event, []byte(node.Anchor), []byte(tag), tag == "", style))
+ e.must(yaml_sequence_start_event_initialize(&e.event, []byte(node.Anchor), []byte(longTag(tag)), tag == "", style))
e.event.head_comment = []byte(node.HeadComment)
e.emit()
for _, node := range node.Content {
@@ -490,7 +501,7 @@ func (e *encoder) node(node *Node, tail string) {
if node.Style&FlowStyle != 0 {
style = yaml_FLOW_MAPPING_STYLE
}
- yaml_mapping_start_event_initialize(&e.event, []byte(node.Anchor), []byte(tag), tag == "", style)
+ yaml_mapping_start_event_initialize(&e.event, []byte(node.Anchor), []byte(longTag(tag)), tag == "", style)
e.event.tail_comment = []byte(tail)
e.event.head_comment = []byte(node.HeadComment)
e.emit()
@@ -531,11 +542,11 @@ func (e *encoder) node(node *Node, tail string) {
case ScalarNode:
value := node.Value
if !utf8.ValidString(value) {
- if tag == binaryTag {
+ if stag == binaryTag {
failf("explicitly tagged !!binary data must be base64-encoded")
}
- if tag != "" {
- failf("cannot marshal invalid UTF-8 data as %s", shortTag(tag))
+ if stag != "" {
+ failf("cannot marshal invalid UTF-8 data as %s", stag)
}
// It can't be encoded directly as YAML so use a binary tag
// and encode it as base64.
@@ -560,5 +571,7 @@ func (e *encoder) node(node *Node, tail string) {
}
e.emitScalar(value, node.Anchor, tag, style, []byte(node.HeadComment), []byte(node.LineComment), []byte(node.FootComment), []byte(tail))
+ default:
+ failf("cannot encode node with unknown kind %d", node.Kind)
}
}
diff --git a/vendor/gopkg.in/yaml.v3/parserc.go b/vendor/gopkg.in/yaml.v3/parserc.go
index aea9050b8..ac66fccc0 100644
--- a/vendor/gopkg.in/yaml.v3/parserc.go
+++ b/vendor/gopkg.in/yaml.v3/parserc.go
@@ -648,6 +648,10 @@ func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, i
implicit: implicit,
style: yaml_style_t(yaml_BLOCK_MAPPING_STYLE),
}
+ if parser.stem_comment != nil {
+ event.head_comment = parser.stem_comment
+ parser.stem_comment = nil
+ }
return true
}
if len(anchor) > 0 || len(tag) > 0 {
@@ -694,25 +698,13 @@ func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_e
if token.typ == yaml_BLOCK_ENTRY_TOKEN {
mark := token.end_mark
- prior_head := len(parser.head_comment)
+ prior_head_len := len(parser.head_comment)
skip_token(parser)
+ yaml_parser_split_stem_comment(parser, prior_head_len)
token = peek_token(parser)
if token == nil {
return false
}
- if prior_head > 0 && token.typ == yaml_BLOCK_SEQUENCE_START_TOKEN {
- // [Go] It's a sequence under a sequence entry, so the former head comment
- // is for the list itself, not the first list item under it.
- parser.stem_comment = parser.head_comment[:prior_head]
- if len(parser.head_comment) == prior_head {
- parser.head_comment = nil
- } else {
- // Copy suffix to prevent very strange bugs if someone ever appends
- // further bytes to the prefix in the stem_comment slice above.
- parser.head_comment = append([]byte(nil), parser.head_comment[prior_head+1:]...)
- }
-
- }
if token.typ != yaml_BLOCK_ENTRY_TOKEN && token.typ != yaml_BLOCK_END_TOKEN {
parser.states = append(parser.states, yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE)
return yaml_parser_parse_node(parser, event, true, false)
@@ -754,7 +746,9 @@ func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *y
if token.typ == yaml_BLOCK_ENTRY_TOKEN {
mark := token.end_mark
+ prior_head_len := len(parser.head_comment)
skip_token(parser)
+ yaml_parser_split_stem_comment(parser, prior_head_len)
token = peek_token(parser)
if token == nil {
return false
@@ -780,6 +774,32 @@ func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *y
return true
}
+// Split stem comment from head comment.
+//
+// When a sequence or map is found under a sequence entry, the former head comment
+// is assigned to the underlying sequence or map as a whole, not the individual
+// sequence or map entry as would be expected otherwise. To handle this case the
+// previous head comment is moved aside as the stem comment.
+func yaml_parser_split_stem_comment(parser *yaml_parser_t, stem_len int) {
+ if stem_len == 0 {
+ return
+ }
+
+ token := peek_token(parser)
+ if token.typ != yaml_BLOCK_SEQUENCE_START_TOKEN && token.typ != yaml_BLOCK_MAPPING_START_TOKEN {
+ return
+ }
+
+ parser.stem_comment = parser.head_comment[:stem_len]
+ if len(parser.head_comment) == stem_len {
+ parser.head_comment = nil
+ } else {
+ // Copy suffix to prevent very strange bugs if someone ever appends
+ // further bytes to the prefix in the stem_comment slice above.
+ parser.head_comment = append([]byte(nil), parser.head_comment[stem_len+1:]...)
+ }
+}
+
// Parse the productions:
// block_mapping ::= BLOCK-MAPPING_START
// *******************
diff --git a/vendor/gopkg.in/yaml.v3/scannerc.go b/vendor/gopkg.in/yaml.v3/scannerc.go
index 579ceb1bd..ca0070108 100644
--- a/vendor/gopkg.in/yaml.v3/scannerc.go
+++ b/vendor/gopkg.in/yaml.v3/scannerc.go
@@ -749,6 +749,11 @@ func yaml_parser_fetch_next_token(parser *yaml_parser_t) (ok bool) {
if !ok {
return
}
+ if len(parser.tokens) > 0 && parser.tokens[len(parser.tokens)-1].typ == yaml_BLOCK_ENTRY_TOKEN {
+ // Sequence indicators alone have no line comments. It becomes
+ // a head comment for whatever follows.
+ return
+ }
if !yaml_parser_scan_line_comment(parser, comment_mark) {
ok = false
return
@@ -2255,10 +2260,9 @@ func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, l
}
}
if parser.buffer[parser.buffer_pos] == '#' {
- // TODO Test this and then re-enable it.
- //if !yaml_parser_scan_line_comment(parser, start_mark) {
- // return false
- //}
+ if !yaml_parser_scan_line_comment(parser, start_mark) {
+ return false
+ }
for !is_breakz(parser.buffer, parser.buffer_pos) {
skip(parser)
if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
@@ -2856,13 +2860,12 @@ func yaml_parser_scan_line_comment(parser *yaml_parser_t, token_mark yaml_mark_t
return false
}
skip_line(parser)
- } else {
- if parser.mark.index >= seen {
- if len(text) == 0 {
- start_mark = parser.mark
- }
- text = append(text, parser.buffer[parser.buffer_pos])
+ } else if parser.mark.index >= seen {
+ if len(text) == 0 {
+ start_mark = parser.mark
}
+ text = read(parser, text)
+ } else {
skip(parser)
}
}
@@ -2888,6 +2891,10 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo
var token_mark = token.start_mark
var start_mark yaml_mark_t
+ var next_indent = parser.indent
+ if next_indent < 0 {
+ next_indent = 0
+ }
var recent_empty = false
var first_empty = parser.newlines <= 1
@@ -2919,15 +2926,18 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo
continue
}
c := parser.buffer[parser.buffer_pos+peek]
- if is_breakz(parser.buffer, parser.buffer_pos+peek) || parser.flow_level > 0 && (c == ']' || c == '}') {
+ var close_flow = parser.flow_level > 0 && (c == ']' || c == '}')
+ if close_flow || is_breakz(parser.buffer, parser.buffer_pos+peek) {
// Got line break or terminator.
- if !recent_empty {
- if first_empty && (start_mark.line == foot_line || start_mark.column-1 < parser.indent) {
+ if close_flow || !recent_empty {
+ if close_flow || first_empty && (start_mark.line == foot_line && token.typ != yaml_VALUE_TOKEN || start_mark.column-1 < next_indent) {
// This is the first empty line and there were no empty lines before,
// so this initial part of the comment is a foot of the prior token
// instead of being a head for the following one. Split it up.
+ // Alternatively, this might also be the last comment inside a flow
+ // scope, so it must be a footer.
if len(text) > 0 {
- if start_mark.column-1 < parser.indent {
+ if start_mark.column-1 < next_indent {
// If dedented it's unrelated to the prior token.
token_mark = start_mark
}
@@ -2958,7 +2968,7 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo
continue
}
- if len(text) > 0 && column < parser.indent+1 && column != start_mark.column {
+ if len(text) > 0 && (close_flow || column-1 < next_indent && column != start_mark.column) {
// The comment at the different indentation is a foot of the
// preceding data rather than a head of the upcoming one.
parser.comments = append(parser.comments, yaml_comment_t{
@@ -3009,6 +3019,10 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo
peek = 0
column = 0
line = parser.mark.line
+ next_indent = parser.indent
+ if next_indent < 0 {
+ next_indent = 0
+ }
}
if len(text) > 0 {
diff --git a/vendor/gopkg.in/yaml.v3/yaml.go b/vendor/gopkg.in/yaml.v3/yaml.go
index b5d35a50d..8cec6da48 100644
--- a/vendor/gopkg.in/yaml.v3/yaml.go
+++ b/vendor/gopkg.in/yaml.v3/yaml.go
@@ -89,7 +89,7 @@ func Unmarshal(in []byte, out interface{}) (err error) {
return unmarshal(in, out, false)
}
-// A Decorder reads and decodes YAML values from an input stream.
+// A Decoder reads and decodes YAML values from an input stream.
type Decoder struct {
parser *parser
knownFields bool
@@ -194,7 +194,7 @@ func unmarshal(in []byte, out interface{}, strict bool) (err error) {
// Zero valued structs will be omitted if all their public
// fields are zero, unless they implement an IsZero
// method (see the IsZeroer interface type), in which
-// case the field will be included if that method returns true.
+// case the field will be excluded if IsZero returns true.
//
// flow Marshal using a flow style (useful for structs,
// sequences and maps).
@@ -252,6 +252,24 @@ func (e *Encoder) Encode(v interface{}) (err error) {
return nil
}
+// Encode encodes value v and stores its representation in n.
+//
+// See the documentation for Marshal for details about the
+// conversion of Go values into YAML.
+func (n *Node) Encode(v interface{}) (err error) {
+ defer handleErr(&err)
+ e := newEncoder()
+ defer e.destroy()
+ e.marshalDoc("", reflect.ValueOf(v))
+ e.finish()
+ p := newParser(e.out)
+ p.textless = true
+ defer p.destroy()
+ doc := p.parse()
+ *n = *doc.Content[0]
+ return nil
+}
+
// SetIndent changes the used indentation used when encoding.
func (e *Encoder) SetIndent(spaces int) {
if spaces < 0 {
@@ -328,6 +346,12 @@ const (
// and maps, Node is an intermediate representation that allows detailed
// control over the content being decoded or encoded.
//
+// It's worth noting that although Node offers access into details such as
+// line numbers, colums, and comments, the content when re-encoded will not
+// have its original textual representation preserved. An effort is made to
+// render the data plesantly, and to preserve comments near the data they
+// describe, though.
+//
// Values that make use of the Node type interact with the yaml package in the
// same way any other type would do, by encoding and decoding yaml data
// directly or indirectly into them.
@@ -391,6 +415,13 @@ type Node struct {
Column int
}
+// IsZero returns whether the node has all of its fields unset.
+func (n *Node) IsZero() bool {
+ return n.Kind == 0 && n.Style == 0 && n.Tag == "" && n.Value == "" && n.Anchor == "" && n.Alias == nil && n.Content == nil &&
+ n.HeadComment == "" && n.LineComment == "" && n.FootComment == "" && n.Line == 0 && n.Column == 0
+}
+
+
// LongTag returns the long form of the tag that indicates the data type for
// the node. If the Tag field isn't explicitly defined, one will be computed
// based on the node properties.
@@ -418,6 +449,11 @@ func (n *Node) ShortTag() string {
case ScalarNode:
tag, _ := resolve("", n.Value)
return tag
+ case 0:
+ // Special case to make the zero value convenient.
+ if n.IsZero() {
+ return nullTag
+ }
}
return ""
}
diff --git a/vendor/gopkg.in/yaml.v3/yamlh.go b/vendor/gopkg.in/yaml.v3/yamlh.go
index 2719cfbb0..7c6d00770 100644
--- a/vendor/gopkg.in/yaml.v3/yamlh.go
+++ b/vendor/gopkg.in/yaml.v3/yamlh.go
@@ -787,6 +787,8 @@ type yaml_emitter_t struct {
foot_comment []byte
tail_comment []byte
+ key_line_comment []byte
+
// Dumper stuff
opened bool // If the stream was already opened?
diff --git a/vendor/modules.txt b/vendor/modules.txt
index d58715bf4..8a19b6b0d 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -100,21 +100,22 @@ github.com/gin-contrib/sse
# github.com/gin-gonic/contrib v0.0.0-20191209060500-d6e26eeaa607
## explicit
github.com/gin-gonic/contrib/ginrus
-# github.com/gin-gonic/gin v1.6.3
+# github.com/gin-gonic/gin v1.7.4
## explicit
github.com/gin-gonic/gin
github.com/gin-gonic/gin/binding
github.com/gin-gonic/gin/internal/bytesconv
github.com/gin-gonic/gin/internal/json
github.com/gin-gonic/gin/render
-# github.com/go-playground/locales v0.13.0
+# github.com/go-playground/locales v0.14.0
github.com/go-playground/locales
github.com/go-playground/locales/currency
-# github.com/go-playground/universal-translator v0.17.0
+# github.com/go-playground/universal-translator v0.18.0
github.com/go-playground/universal-translator
-# github.com/go-playground/validator/v10 v10.2.0
+# github.com/go-playground/validator/v10 v10.9.0
+## explicit
github.com/go-playground/validator/v10
-# github.com/go-sql-driver/mysql v1.5.0
+# github.com/go-sql-driver/mysql v1.6.0
## explicit
github.com/go-sql-driver/mysql
# github.com/gogits/go-gogs-client v0.0.0-20160212212711-d584b1e0fb4d
@@ -152,24 +153,23 @@ github.com/jackspirou/syscerts
## explicit
github.com/joho/godotenv
github.com/joho/godotenv/autoload
-# github.com/json-iterator/go v1.1.9
+# github.com/json-iterator/go v1.1.12
+## explicit
github.com/json-iterator/go
-# github.com/konsorten/go-windows-terminal-sequences v1.0.3
-github.com/konsorten/go-windows-terminal-sequences
-# github.com/kr/pretty v0.2.1
+# github.com/kr/pretty v0.3.0
## explicit
github.com/kr/pretty
# github.com/kr/text v0.2.0
-## explicit
github.com/kr/text
-# github.com/leodido/go-urn v1.2.0
+# github.com/leodido/go-urn v1.2.1
github.com/leodido/go-urn
# github.com/lib/pq v1.5.2
## explicit
github.com/lib/pq
github.com/lib/pq/oid
github.com/lib/pq/scram
-# github.com/mattn/go-isatty v0.0.12
+# github.com/mattn/go-isatty v0.0.14
+## explicit
github.com/mattn/go-isatty
# github.com/mattn/go-sqlite3 v2.0.3+incompatible
## explicit
@@ -178,7 +178,7 @@ github.com/mattn/go-sqlite3
github.com/matttproud/golang_protobuf_extensions/pbutil
# github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
github.com/modern-go/concurrent
-# github.com/modern-go/reflect2 v1.0.1
+# github.com/modern-go/reflect2 v1.0.2
github.com/modern-go/reflect2
# github.com/morikuni/aec v1.0.0
## explicit
@@ -186,8 +186,6 @@ github.com/morikuni/aec
# github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450
## explicit
github.com/mrjones/oauth
-# github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e
-## explicit
# github.com/opencontainers/go-digest v1.0.0
## explicit
github.com/opencontainers/go-digest
@@ -196,7 +194,6 @@ github.com/opencontainers/go-digest
github.com/opencontainers/image-spec/specs-go
github.com/opencontainers/image-spec/specs-go/v1
# github.com/pkg/errors v0.9.1
-## explicit
github.com/pkg/errors
# github.com/pmezard/go-difflib v1.0.0
github.com/pmezard/go-difflib/difflib
@@ -217,7 +214,9 @@ github.com/prometheus/common/model
github.com/prometheus/procfs
github.com/prometheus/procfs/internal/fs
github.com/prometheus/procfs/internal/util
-# github.com/rs/zerolog v1.18.0
+# github.com/rogpeppe/go-internal v1.8.0
+github.com/rogpeppe/go-internal/fmtsort
+# github.com/rs/zerolog v1.25.0
## explicit
github.com/rs/zerolog
github.com/rs/zerolog/internal/cbor
@@ -225,25 +224,27 @@ github.com/rs/zerolog/internal/json
github.com/rs/zerolog/log
# github.com/russross/blackfriday/v2 v2.0.1
github.com/russross/blackfriday/v2
-# github.com/russross/meddler v1.0.0
+# github.com/russross/meddler v1.0.1
## explicit
github.com/russross/meddler
# github.com/shurcooL/sanitized_anchor_name v1.0.0
github.com/shurcooL/sanitized_anchor_name
-# github.com/sirupsen/logrus v1.6.0
+# github.com/sirupsen/logrus v1.8.1
## explicit
github.com/sirupsen/logrus
-# github.com/stretchr/objx v0.2.0
+# github.com/stretchr/objx v0.3.0
## explicit
github.com/stretchr/objx
-# github.com/stretchr/testify v1.5.1
+# github.com/stretchr/testify v1.7.0
## explicit
github.com/stretchr/testify/assert
github.com/stretchr/testify/mock
# github.com/tevino/abool v0.0.0-20170917061928-9b9efcf221b5
## explicit
github.com/tevino/abool
-# github.com/ugorji/go/codec v1.1.7
+# github.com/ugorji/go v1.2.6
+## explicit
+# github.com/ugorji/go/codec v1.2.6
github.com/ugorji/go/codec
# github.com/urfave/cli v1.22.4
## explicit
@@ -255,10 +256,11 @@ github.com/woodpecker-ci/expr/parse
# github.com/woodpecker-ci/togo v0.0.0-20180401185031-50a0e4726e74
## explicit
github.com/woodpecker-ci/togo
-# golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
+# golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
## explicit
golang.org/x/crypto/acme
golang.org/x/crypto/acme/autocert
+golang.org/x/crypto/sha3
# golang.org/x/net v0.0.0-20210825183410-e898025ed96a
## explicit
golang.org/x/net/context
@@ -278,14 +280,21 @@ golang.org/x/net/trace
golang.org/x/oauth2
golang.org/x/oauth2/bitbucket
golang.org/x/oauth2/internal
-# golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
+# golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
## explicit
golang.org/x/sync/errgroup
-# golang.org/x/sys v0.0.0-20210423082822-04245dca01da
+# golang.org/x/sys v0.0.0-20210923061019-b8560ed6a9b7
+## explicit
+golang.org/x/sys/cpu
golang.org/x/sys/internal/unsafeheader
golang.org/x/sys/unix
golang.org/x/sys/windows
-# golang.org/x/text v0.3.6
+# golang.org/x/text v0.3.7
+## explicit
+golang.org/x/text/internal/language
+golang.org/x/text/internal/language/compact
+golang.org/x/text/internal/tag
+golang.org/x/text/language
golang.org/x/text/secure/bidirule
golang.org/x/text/transform
golang.org/x/text/unicode/bidi
@@ -375,12 +384,10 @@ google.golang.org/protobuf/types/descriptorpb
google.golang.org/protobuf/types/known/anypb
google.golang.org/protobuf/types/known/durationpb
google.golang.org/protobuf/types/known/timestamppb
-# gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f
-## explicit
-# gopkg.in/yaml.v2 v2.3.0
+# gopkg.in/yaml.v2 v2.4.0
## explicit
gopkg.in/yaml.v2
-# gopkg.in/yaml.v3 v3.0.0-20200506231410-2ff61e1afc86
+# gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
## explicit
gopkg.in/yaml.v3
# gotest.tools v2.2.0+incompatible