From 07f375bb0e40659c388809f1afacf7a5141c4df6 Mon Sep 17 00:00:00 2001 From: Mark Dascher Date: Thu, 11 Nov 2021 16:08:37 -0500 Subject: [PATCH 1/3] Use module-aware mode instead of GOPATH mode --- Makefile | 8 +- README.md | 23 +- config_test.go | 2 +- examples/remote_syslog.ebextensions.config | 2 +- go.mod | 36 + go.sum | 59 ++ .../github.com/fsnotify/fsnotify/.gitignore | 6 + .../github.com/fsnotify/fsnotify/.travis.yml | 29 + vendor/github.com/hashicorp/hcl/.gitignore | 9 + vendor/github.com/hashicorp/hcl/.travis.yml | 3 + vendor/github.com/howbazaar/loggo/.gitignore | 1 + .../howbazaar/loggo/example/first.go | 27 - .../howbazaar/loggo/example/main.go | 39 - .../howbazaar/loggo/example/second.go | 27 - .../magiconair/properties/.gitignore | 6 + .../magiconair/properties/.travis.yml | 6 + .../mitchellh/mapstructure/.travis.yml | 7 + .../github.com/nightlyone/lockfile/.gitignore | 27 + .../nightlyone/lockfile/.gitmodules | 3 + .../nightlyone/lockfile/.travis.yml | 2 + .../pelletier/go-buffruneio/.gitignore | 1 + .../pelletier/go-buffruneio/.travis.yml | 7 + .../github.com/pelletier/go-toml/.gitignore | 1 + .../github.com/pelletier/go-toml/.travis.yml | 18 + vendor/github.com/pelletier/go-toml/clean.sh | 0 vendor/github.com/pelletier/go-toml/test.sh | 0 vendor/github.com/pkg/errors/.gitignore | 24 + vendor/github.com/pkg/errors/.travis.yml | 10 + vendor/github.com/pkg/sftp/.gitignore | 8 + vendor/github.com/pkg/sftp/.travis.yml | 25 + vendor/github.com/spf13/afero/.travis.yml | 21 + vendor/github.com/spf13/cast/.gitignore | 23 + .../spf13/jwalterweatherman/.gitignore | 22 + vendor/github.com/spf13/pflag/.travis.yml | 21 + vendor/github.com/spf13/viper/.gitignore | 23 + vendor/github.com/spf13/viper/.travis.yml | 27 + vendor/golang.org/x/crypto/AUTHORS | 3 + vendor/golang.org/x/crypto/CONTRIBUTORS | 3 + vendor/golang.org/x/sys/AUTHORS | 3 + vendor/golang.org/x/sys/CONTRIBUTORS | 3 + vendor/golang.org/x/sys/unix/.gitignore | 1 + vendor/golang.org/x/sys/unix/mkall.sh | 0 vendor/golang.org/x/sys/unix/mkerrors.sh | 0 vendor/golang.org/x/sys/unix/mksyscall.pl | 0 .../x/sys/unix/mksyscall_solaris.pl | 0 .../golang.org/x/sys/unix/mksysctl_openbsd.pl | 0 .../golang.org/x/sys/unix/mksysnum_darwin.pl | 0 .../x/sys/unix/mksysnum_dragonfly.pl | 0 .../golang.org/x/sys/unix/mksysnum_freebsd.pl | 0 .../golang.org/x/sys/unix/mksysnum_linux.pl | 0 .../golang.org/x/sys/unix/mksysnum_netbsd.pl | 0 .../golang.org/x/sys/unix/mksysnum_openbsd.pl | 0 vendor/golang.org/x/sys/unix/types_darwin.go | 250 ----- .../golang.org/x/sys/unix/types_dragonfly.go | 242 ----- vendor/golang.org/x/sys/unix/types_freebsd.go | 353 ------- vendor/golang.org/x/sys/unix/types_linux.go | 417 -------- vendor/golang.org/x/sys/unix/types_netbsd.go | 232 ----- vendor/golang.org/x/sys/unix/types_openbsd.go | 244 ----- vendor/golang.org/x/sys/unix/types_solaris.go | 260 ----- vendor/golang.org/x/text/AUTHORS | 3 + vendor/golang.org/x/text/CONTRIBUTORS | 3 + .../x/text/unicode/norm/maketables.go | 978 ------------------ .../golang.org/x/text/unicode/norm/triegen.go | 117 --- vendor/gopkg.in/yaml.v2/.travis.yml | 9 + vendor/modules.txt | 93 ++ vendor/vendor.json | 244 ----- 66 files changed, 560 insertions(+), 3451 deletions(-) create mode 100644 go.mod create mode 100644 go.sum create mode 100644 vendor/github.com/fsnotify/fsnotify/.gitignore create mode 100644 vendor/github.com/fsnotify/fsnotify/.travis.yml create mode 100644 vendor/github.com/hashicorp/hcl/.gitignore create mode 100644 vendor/github.com/hashicorp/hcl/.travis.yml create mode 100644 vendor/github.com/howbazaar/loggo/.gitignore delete mode 100644 vendor/github.com/howbazaar/loggo/example/first.go delete mode 100644 vendor/github.com/howbazaar/loggo/example/main.go delete mode 100644 vendor/github.com/howbazaar/loggo/example/second.go create mode 100644 vendor/github.com/magiconair/properties/.gitignore create mode 100644 vendor/github.com/magiconair/properties/.travis.yml create mode 100644 vendor/github.com/mitchellh/mapstructure/.travis.yml create mode 100644 vendor/github.com/nightlyone/lockfile/.gitignore create mode 100644 vendor/github.com/nightlyone/lockfile/.gitmodules create mode 100644 vendor/github.com/nightlyone/lockfile/.travis.yml create mode 100644 vendor/github.com/pelletier/go-buffruneio/.gitignore create mode 100644 vendor/github.com/pelletier/go-buffruneio/.travis.yml create mode 100644 vendor/github.com/pelletier/go-toml/.gitignore create mode 100644 vendor/github.com/pelletier/go-toml/.travis.yml mode change 100755 => 100644 vendor/github.com/pelletier/go-toml/clean.sh mode change 100755 => 100644 vendor/github.com/pelletier/go-toml/test.sh create mode 100644 vendor/github.com/pkg/errors/.gitignore create mode 100644 vendor/github.com/pkg/errors/.travis.yml create mode 100644 vendor/github.com/pkg/sftp/.gitignore create mode 100644 vendor/github.com/pkg/sftp/.travis.yml create mode 100644 vendor/github.com/spf13/afero/.travis.yml create mode 100644 vendor/github.com/spf13/cast/.gitignore create mode 100644 vendor/github.com/spf13/jwalterweatherman/.gitignore create mode 100644 vendor/github.com/spf13/pflag/.travis.yml create mode 100644 vendor/github.com/spf13/viper/.gitignore create mode 100644 vendor/github.com/spf13/viper/.travis.yml create mode 100644 vendor/golang.org/x/crypto/AUTHORS create mode 100644 vendor/golang.org/x/crypto/CONTRIBUTORS create mode 100644 vendor/golang.org/x/sys/AUTHORS create mode 100644 vendor/golang.org/x/sys/CONTRIBUTORS create mode 100644 vendor/golang.org/x/sys/unix/.gitignore mode change 100755 => 100644 vendor/golang.org/x/sys/unix/mkall.sh mode change 100755 => 100644 vendor/golang.org/x/sys/unix/mkerrors.sh mode change 100755 => 100644 vendor/golang.org/x/sys/unix/mksyscall.pl mode change 100755 => 100644 vendor/golang.org/x/sys/unix/mksyscall_solaris.pl mode change 100755 => 100644 vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl mode change 100755 => 100644 vendor/golang.org/x/sys/unix/mksysnum_darwin.pl mode change 100755 => 100644 vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl mode change 100755 => 100644 vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl mode change 100755 => 100644 vendor/golang.org/x/sys/unix/mksysnum_linux.pl mode change 100755 => 100644 vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl mode change 100755 => 100644 vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl delete mode 100644 vendor/golang.org/x/sys/unix/types_darwin.go delete mode 100644 vendor/golang.org/x/sys/unix/types_dragonfly.go delete mode 100644 vendor/golang.org/x/sys/unix/types_freebsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_linux.go delete mode 100644 vendor/golang.org/x/sys/unix/types_netbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_openbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_solaris.go create mode 100644 vendor/golang.org/x/text/AUTHORS create mode 100644 vendor/golang.org/x/text/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/text/unicode/norm/maketables.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/triegen.go create mode 100644 vendor/gopkg.in/yaml.v2/.travis.yml create mode 100644 vendor/modules.txt delete mode 100644 vendor/vendor.json diff --git a/Makefile b/Makefile index 55d3dcb..3494b1a 100644 --- a/Makefile +++ b/Makefile @@ -70,15 +70,9 @@ endif exit 1; \ } - type govendor >/dev/null 2>&1|| { \ - echo "\033[1;33mgovendor is not installed. See https://github.com/kardianos/govendor\033[m"; \ - echo "$$ go get -u github.com/kardianos/govendor"; \ - exit 1; \ - } - type gox >/dev/null 2>&1 || { \ echo "\033[1;33mGox is not installed. See https://github.com/mitchellh/gox\033[m"; \ - echo "$$ go get github.com/mitchellh/gox"; \ + echo "$$ go install github.com/mitchellh/gox@latest"; \ exit 1; \ } diff --git a/README.md b/README.md index e0010e8..e2d1fe5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # remote_syslog2 -[![Download remote_syslog2](http://papertrail.github.io/remote_syslog2/images/download.png)][releases] +[![Download remote_syslog2](https://papertrail.github.io/remote_syslog2/images/download.png)][releases] remote_syslog tails one or more log files and sends syslog messages to a remote central syslog server. It generates packets itself, ignoring the system @@ -190,7 +190,7 @@ the config file. External log rotation scripts often move or remove an existing log file and replace it with a new one (at a new inode). The Linux standard script -[logrotate](http://iain.cx/src/logrotate/) supports a `copytruncate` config +[logrotate](https://iain.cx/src/logrotate/) supports a `copytruncate` config option. With that option, `logrotate` will copy files, operate on the copies, and truncate the original so that the inode remains the same. @@ -207,7 +207,7 @@ Some logging programs such as Java's gclog (`-XX:+PrintGC` or `-verbose:gc`) do not log in append mode, so if another program such as `logrotate` (set to `copytruncate`) truncates the file, on the next write of the Java logger, the OS will fill the file with NUL bytes upto the current offset of the file descriptor. -More info on that [here](http://stackoverflow.com/questions/8353401/garbage-collector-log-loggc-file-rotation-with-logrotate-does-not-work-properl). +More info on that [here](https://stackoverflow.com/questions/8353401/garbage-collector-log-loggc-file-rotation-with-logrotate-does-not-work-properl). `remote_syslog` will detect those leading NUL bytes, discard them, and log the discard count. @@ -244,7 +244,7 @@ additional instance(s). For example: --pid-file=/var/run/remote_syslog_2.pid Note: Daemonized programs use PID files to identify whether the program is already -running ([more](http://unix.stackexchange.com/questions/12815/what-are-pid-and-lock-files-for/12818#12818)). Like other daemons, remote_syslog will refuse to run as a +running ([more](https://unix.stackexchange.com/questions/12815/what-are-pid-and-lock-files-for/12818#12818)). Like other daemons, remote_syslog will refuse to run as a daemon (the default mode) when a PID file is present. If a .pid file is present but the daemon is not actually running, remove the PID file. @@ -290,7 +290,7 @@ To send messages longer than 1024 characters, use TCP (either TLS or cleartext TCP) instead of UDP. See "[Sending messages securely](#sending-messages-securely)" to use TCP with TLS for messages of any length. -[Here's why](http://help.papertrailapp.com/kb/configuration/troubleshooting-remote-syslog-reachability/#message-length) longer UDP messages are impossible to send over +[Here's why](https://help.papertrailapp.com/kb/configuration/troubleshooting-remote-syslog-reachability/#message-length) longer UDP messages are impossible to send over the Internet. ### inotify @@ -337,7 +337,7 @@ Once again, confirm that remote_syslog starts and then apply this value permanen * [Paul Morton](https://twitter.com/mortonpe) * [Papertrail](https://papertrailapp.com/) staff -* [Paul Hammond](http://paulhammond.org/) +* [Paul Hammond](https://paulhammond.org/) ## Reporting bugs @@ -351,9 +351,8 @@ remote_syslog2 is written in go, and uses [govendor] to manage dependencies. To get everything set up, [install go][goinstall] then run: - go get github.com/kardianos/govendor - go get github.com/mitchellh/gox - go get github.com/papertrail/remote_syslog2 + go install github.com/mitchellh/gox@latest + git clone git@github.com:papertrail/remote_syslog2.git To run tests: @@ -386,12 +385,12 @@ Once you've made your great commits: 6. That's it! -[Papertrail]: http://papertrailapp.com/ +[Papertrail]: https://papertrailapp.com/ [remote_syslog]: https://github.com/papertrail/remote_syslog [releases]: https://github.com/papertrail/remote_syslog2/releases [govendor]: https://github.com/kardianos/govendor -[goinstall]: http://golang.org/doc/install +[goinstall]: https://golang.org/doc/install -[fk]: http://help.github.com/forking/ +[fk]: https://help.github.com/forking/ [is]: https://github.com/papertrail/remote_syslog/issues/ diff --git a/config_test.go b/config_test.go index 08da498..79d6fee 100644 --- a/config_test.go +++ b/config_test.go @@ -66,7 +66,7 @@ func TestRawConfig(t *testing.T) { assert.Equal(c.Facility, fac) assert.NotEqual(c.Hostname, "") assert.Equal(c.Poll, false) - assert.Equal(c.RootCAs, papertrail.RootCA()) + assert.Equal(c.RootCAs.Subjects(), papertrail.RootCA().Subjects()) } func TestNoConfigFile(t *testing.T) { diff --git a/examples/remote_syslog.ebextensions.config b/examples/remote_syslog.ebextensions.config index dac1257..77421ea 100644 --- a/examples/remote_syslog.ebextensions.config +++ b/examples/remote_syslog.ebextensions.config @@ -1,4 +1,4 @@ -# See http://help.papertrailapp.com/kb/hosting-services/aws-elastic-beanstalk/ +# See https://help.papertrailapp.com/kb/hosting-services/aws-elastic-beanstalk/ # # Usage: # - in "sources", replace with the version tag of remote_syslog2 to use (from https://github.com/papertrail/remote_syslog2/releases). For example, replace "" with "v0.18" diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..3f2e1df --- /dev/null +++ b/go.mod @@ -0,0 +1,36 @@ +module github.com/papertrail/remote_syslog2 + +go 1.17 + +require ( + github.com/VividCortex/godaemon v0.0.0-20131002161106-2fdf3f9fa715 + github.com/howbazaar/loggo v0.0.0-20131030201820-384be4108823 + github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee + github.com/nightlyone/lockfile v0.0.0-20160306143149-b30dcbfa86e3 + github.com/papertrail/go-tail v0.0.0-20170801201234-1b77c8dfcc6b + github.com/spf13/pflag v0.0.0-20160906134334-6fd2ff4ff8df + github.com/spf13/viper v0.0.0-20160830143246-16990631d4aa + github.com/stretchr/testify v1.1.4-0.20160615092844-d77da356e56a +) + +require ( + github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2 // indirect + github.com/fsnotify/fsnotify v1.3.2-0.20160816051541-f12c6236fe7b // indirect + github.com/hashicorp/hcl v0.0.0-20160902165219-99df0eb941dd // indirect + github.com/kr/fs v0.0.0-20131111012553-2788f0dbd169 // indirect + github.com/magiconair/properties v1.7.1-0.20160908093658-0723e352fa35 // indirect + github.com/pelletier/go-buffruneio v0.1.0 // indirect + github.com/pelletier/go-toml v0.3.6-0.20160906202557-31055c2ff0bb // indirect + github.com/pkg/errors v0.7.1 // indirect + github.com/pkg/sftp v0.0.0-20160908100035-8197a2e58073 // indirect + github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0 // indirect + github.com/spf13/afero v0.0.0-20160821083612-20500e2abd0d // indirect + github.com/spf13/cast v0.0.0-20160730092037-e31f36ffc91a // indirect + github.com/spf13/jwalterweatherman v0.0.0-20160311093646-33c24e77fb80 // indirect + golang.org/x/crypto v0.0.0-20160909120217-05d11b2ca141 // indirect + golang.org/x/sys v0.0.0-20160429193239-b776ec39b3e5 // indirect + golang.org/x/text v0.0.0-20160908145610-1e65e9bf72c3 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/yaml.v2 v2.0.0-20160715033755-e4d366fc3c79 // indirect + launchpad.net/gocheck v0.0.0-20140225173054-000000000087 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..d34bc8a --- /dev/null +++ b/go.sum @@ -0,0 +1,59 @@ +github.com/VividCortex/godaemon v0.0.0-20131002161106-2fdf3f9fa715 h1:0yPC4AyN7nFlSPjS1gKFFlOQRrhfbKlCEyVWK9CDY1E= +github.com/VividCortex/godaemon v0.0.0-20131002161106-2fdf3f9fa715/go.mod h1:Y8CJ3IwPIAkMhv/rRUWIlczaeqd9ty9yrl+nc2AbaL4= +github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2 h1:5zdDAMuB3gvbHB1m2BZT9+t9w+xaBmK3ehb7skDXcwM= +github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.3.2-0.20160816051541-f12c6236fe7b h1:clQtr7BsnoijdumdhlbbOGglPb1lIAJ3yTPjYOHlKdQ= +github.com/fsnotify/fsnotify v1.3.2-0.20160816051541-f12c6236fe7b/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/hashicorp/hcl v0.0.0-20160902165219-99df0eb941dd h1:84QdurP28/GTPuAXatiouvNyhN9dflZY9KtMbatmupI= +github.com/hashicorp/hcl v0.0.0-20160902165219-99df0eb941dd/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= +github.com/howbazaar/loggo v0.0.0-20131030201820-384be4108823 h1:RHchVj0Y4ojcJuXS6laqCtJtYq1HtFaRNyIGrPW3H3s= +github.com/howbazaar/loggo v0.0.0-20131030201820-384be4108823/go.mod h1:qirP12TGqAYntqwePTIuFWWd1fHAeL8uMTel5GXqYDo= +github.com/kr/fs v0.0.0-20131111012553-2788f0dbd169 h1:YUrU1/jxRqnt0PSrKj1Uj/wEjk/fjnE80QFfi2Zlj7Q= +github.com/kr/fs v0.0.0-20131111012553-2788f0dbd169/go.mod h1:glhvuHOU9Hy7/8PwwdtnarXqLagOX0b/TbZx2zLMqEg= +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/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/magiconair/properties v1.7.1-0.20160908093658-0723e352fa35 h1:WtkHGe1cgg+lvDj9p5CvjXrfopsIss0vIAz+/zeYZyQ= +github.com/magiconair/properties v1.7.1-0.20160908093658-0723e352fa35/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee h1:kK7VuFVykgt0LfMSloWYjDOt4TnOcL0AxF0/rDq2VkM= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/nightlyone/lockfile v0.0.0-20160306143149-b30dcbfa86e3 h1:0n5k3UgMD17uNYeNw3njqRyfeCFemdDXbqkZzLTlNlw= +github.com/nightlyone/lockfile v0.0.0-20160306143149-b30dcbfa86e3/go.mod h1:JbxfV1Iifij2yhRjXai0oFrbpxszXHRx1E5RuM26o4Y= +github.com/papertrail/go-tail v0.0.0-20170801201234-1b77c8dfcc6b h1:I2e5p5inncWf3fsAlg6XseytuVfLyYHvygLi16JXh5s= +github.com/papertrail/go-tail v0.0.0-20170801201234-1b77c8dfcc6b/go.mod h1:dMID0RaS2a5rhpOjC4RsAKitU6WGgkFBZnPVffL69b8= +github.com/pelletier/go-buffruneio v0.1.0 h1:ig6N9Cg71k/P+UUbhwdOFtJWz+qa8/3by7AzMprMWBM= +github.com/pelletier/go-buffruneio v0.1.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= +github.com/pelletier/go-toml v0.3.6-0.20160906202557-31055c2ff0bb h1:itpNy1S158xYBrFLYeyGyGjlds546+4bSNENlR5kcU4= +github.com/pelletier/go-toml v0.3.6-0.20160906202557-31055c2ff0bb/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.7.1 h1:0XSZhzhcAUrs2vsv1y5jaxWejlCCgvxI/kBpbRFMZ+o= +github.com/pkg/errors v0.7.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v0.0.0-20160908100035-8197a2e58073 h1:9PqYQCzKEbilrPJl3LDO16HdbA25Yqc3I25aUfgFaCs= +github.com/pkg/sftp v0.0.0-20160908100035-8197a2e58073/go.mod h1:NxmoDg/QLVWluQDUYG7XBZTLUpKeFa8e3aMf1BfjyHk= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0 h1:GD+A8+e+wFkqje55/2fOVnZPkoDIu1VooBWfNrnY8Uo= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spf13/afero v0.0.0-20160821083612-20500e2abd0d h1:sd1qRX4NJPdIHizg+E7cK0kFaJRjwfJFQyUJUguwIak= +github.com/spf13/afero v0.0.0-20160821083612-20500e2abd0d/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v0.0.0-20160730092037-e31f36ffc91a h1:tPI5RnYZJhcXj0LhJ9pi7PS7gqOhuFR+4HEKyDz3BnQ= +github.com/spf13/cast v0.0.0-20160730092037-e31f36ffc91a/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= +github.com/spf13/jwalterweatherman v0.0.0-20160311093646-33c24e77fb80 h1:evyGXhHMrxKBDkdlSPv9HMWV2o53o+Ibhm28BGc0450= +github.com/spf13/jwalterweatherman v0.0.0-20160311093646-33c24e77fb80/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v0.0.0-20160906134334-6fd2ff4ff8df h1:i6BcnijncbnhvDqNliGST7mq6VUAw/npzYAnDWaAB+M= +github.com/spf13/pflag v0.0.0-20160906134334-6fd2ff4ff8df/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v0.0.0-20160830143246-16990631d4aa h1:+yZESdfzohzq0Jtw+Cqbc8DzjoodNv3CB+BOww04drs= +github.com/spf13/viper v0.0.0-20160830143246-16990631d4aa/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= +github.com/stretchr/testify v1.1.4-0.20160615092844-d77da356e56a h1:UWu0XgfW9PCuyeZYNe2eGGkDZjooQKjVQqY/+d/jYmc= +github.com/stretchr/testify v1.1.4-0.20160615092844-d77da356e56a/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +golang.org/x/crypto v0.0.0-20160909120217-05d11b2ca141 h1:7qMu/IWpY+cfuLMEenVOnMwny1+DNavuX7qeKfImV0c= +golang.org/x/crypto v0.0.0-20160909120217-05d11b2ca141/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/sys v0.0.0-20160429193239-b776ec39b3e5 h1:L+w9B2AS0iNfWhpTtG2zRCYDSSdWo4VJZGbSgvMIxo0= +golang.org/x/sys v0.0.0-20160429193239-b776ec39b3e5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.0.0-20160908145610-1e65e9bf72c3 h1:zvaOCkN7IYkuMpwoiyZaMcIT+kVKgA6KGUdl0quo6QQ= +golang.org/x/text v0.0.0-20160908145610-1e65e9bf72c3/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +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/yaml.v2 v2.0.0-20160715033755-e4d366fc3c79 h1:mENkfeXGmLV7lIyBeNdwYWdONek7pH9yHaHMgZyvIWE= +gopkg.in/yaml.v2 v2.0.0-20160715033755-e4d366fc3c79/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54= +launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= diff --git a/vendor/github.com/fsnotify/fsnotify/.gitignore b/vendor/github.com/fsnotify/fsnotify/.gitignore new file mode 100644 index 0000000..4cd0cba --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/.gitignore @@ -0,0 +1,6 @@ +# Setup a Global .gitignore for OS and editor generated files: +# https://help.github.com/articles/ignoring-files +# git config --global core.excludesfile ~/.gitignore_global + +.vagrant +*.sublime-project diff --git a/vendor/github.com/fsnotify/fsnotify/.travis.yml b/vendor/github.com/fsnotify/fsnotify/.travis.yml new file mode 100644 index 0000000..e6def9a --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/.travis.yml @@ -0,0 +1,29 @@ +sudo: false +language: go + +go: + - 1.5.4 + - 1.6.3 + - tip + +matrix: + allow_failures: + - go: tip + +before_script: + - go get -u github.com/golang/lint/golint + +script: + - go test -v --race ./... + +after_script: + - test -z "$(gofmt -s -l -w . | tee /dev/stderr)" + - test -z "$(golint ./... | tee /dev/stderr)" + - go vet ./... + +os: + - linux + - osx + +notifications: + email: false diff --git a/vendor/github.com/hashicorp/hcl/.gitignore b/vendor/github.com/hashicorp/hcl/.gitignore new file mode 100644 index 0000000..15586a2 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/.gitignore @@ -0,0 +1,9 @@ +y.output + +# ignore intellij files +.idea +*.iml +*.ipr +*.iws + +*.test diff --git a/vendor/github.com/hashicorp/hcl/.travis.yml b/vendor/github.com/hashicorp/hcl/.travis.yml new file mode 100644 index 0000000..83dc540 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/.travis.yml @@ -0,0 +1,3 @@ +sudo: false +language: go +go: 1.5 diff --git a/vendor/github.com/howbazaar/loggo/.gitignore b/vendor/github.com/howbazaar/loggo/.gitignore new file mode 100644 index 0000000..528cd5b --- /dev/null +++ b/vendor/github.com/howbazaar/loggo/.gitignore @@ -0,0 +1 @@ +example/example diff --git a/vendor/github.com/howbazaar/loggo/example/first.go b/vendor/github.com/howbazaar/loggo/example/first.go deleted file mode 100644 index 4ad95d9..0000000 --- a/vendor/github.com/howbazaar/loggo/example/first.go +++ /dev/null @@ -1,27 +0,0 @@ -package main - -import ( - "github.com/howbazaar/loggo" -) - -var first = loggo.GetLogger("first") - -func FirstCritical(message string) { - first.Criticalf(message) -} - -func FirstError(message string) { - first.Errorf(message) -} - -func FirstWarning(message string) { - first.Warningf(message) -} - -func FirstInfo(message string) { - first.Infof(message) -} - -func FirstTrace(message string) { - first.Tracef(message) -} diff --git a/vendor/github.com/howbazaar/loggo/example/main.go b/vendor/github.com/howbazaar/loggo/example/main.go deleted file mode 100644 index ebee10f..0000000 --- a/vendor/github.com/howbazaar/loggo/example/main.go +++ /dev/null @@ -1,39 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "github.com/howbazaar/loggo" -) - -var logger = loggo.GetLogger("main") -var rootLogger = loggo.GetLogger("") - -func main() { - args := os.Args - if len(args) > 1 { - loggo.ConfigureLoggers(args[1]) - } else { - fmt.Println("Add a parameter to configure the logging:") - fmt.Println("E.g. \"=INFO;first=TRACE\"") - } - fmt.Println("\nCurrent logging levels:") - fmt.Println(loggo.LoggerInfo()) - fmt.Println("") - - rootLogger.Infof("Start of test.") - - FirstCritical("first critical") - FirstError("first error") - FirstWarning("first warning") - FirstInfo("first info") - FirstTrace("first trace") - - SecondCritical("first critical") - SecondError("first error") - SecondWarning("first warning") - SecondInfo("first info") - SecondTrace("first trace") - -} diff --git a/vendor/github.com/howbazaar/loggo/example/second.go b/vendor/github.com/howbazaar/loggo/example/second.go deleted file mode 100644 index 66ecfe1..0000000 --- a/vendor/github.com/howbazaar/loggo/example/second.go +++ /dev/null @@ -1,27 +0,0 @@ -package main - -import ( - "github.com/howbazaar/loggo" -) - -var second = loggo.GetLogger("second") - -func SecondCritical(message string) { - second.Criticalf(message) -} - -func SecondError(message string) { - second.Errorf(message) -} - -func SecondWarning(message string) { - second.Warningf(message) -} - -func SecondInfo(message string) { - second.Infof(message) -} - -func SecondTrace(message string) { - second.Tracef(message) -} diff --git a/vendor/github.com/magiconair/properties/.gitignore b/vendor/github.com/magiconair/properties/.gitignore new file mode 100644 index 0000000..e7081ff --- /dev/null +++ b/vendor/github.com/magiconair/properties/.gitignore @@ -0,0 +1,6 @@ +*.sublime-project +*.sublime-workspace +*.un~ +*.swp +.idea/ +*.iml diff --git a/vendor/github.com/magiconair/properties/.travis.yml b/vendor/github.com/magiconair/properties/.travis.yml new file mode 100644 index 0000000..8807fe9 --- /dev/null +++ b/vendor/github.com/magiconair/properties/.travis.yml @@ -0,0 +1,6 @@ +language: go +go: + - 1.4.3 + - 1.5.3 + - 1.6.3 + - 1.7.1 diff --git a/vendor/github.com/mitchellh/mapstructure/.travis.yml b/vendor/github.com/mitchellh/mapstructure/.travis.yml new file mode 100644 index 0000000..7f3fe9a --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/.travis.yml @@ -0,0 +1,7 @@ +language: go + +go: + - 1.4 + +script: + - go test diff --git a/vendor/github.com/nightlyone/lockfile/.gitignore b/vendor/github.com/nightlyone/lockfile/.gitignore new file mode 100644 index 0000000..5a05665 --- /dev/null +++ b/vendor/github.com/nightlyone/lockfile/.gitignore @@ -0,0 +1,27 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# popular temporaries +.err +.out +.diff + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe diff --git a/vendor/github.com/nightlyone/lockfile/.gitmodules b/vendor/github.com/nightlyone/lockfile/.gitmodules new file mode 100644 index 0000000..6faa9e3 --- /dev/null +++ b/vendor/github.com/nightlyone/lockfile/.gitmodules @@ -0,0 +1,3 @@ +[submodule "git-hooks"] + path = git-hooks + url = https://github.com/nightlyone/git-hooks diff --git a/vendor/github.com/nightlyone/lockfile/.travis.yml b/vendor/github.com/nightlyone/lockfile/.travis.yml new file mode 100644 index 0000000..f1309c9 --- /dev/null +++ b/vendor/github.com/nightlyone/lockfile/.travis.yml @@ -0,0 +1,2 @@ +language: go + diff --git a/vendor/github.com/pelletier/go-buffruneio/.gitignore b/vendor/github.com/pelletier/go-buffruneio/.gitignore new file mode 100644 index 0000000..c56069f --- /dev/null +++ b/vendor/github.com/pelletier/go-buffruneio/.gitignore @@ -0,0 +1 @@ +*.test \ No newline at end of file diff --git a/vendor/github.com/pelletier/go-buffruneio/.travis.yml b/vendor/github.com/pelletier/go-buffruneio/.travis.yml new file mode 100644 index 0000000..9720442 --- /dev/null +++ b/vendor/github.com/pelletier/go-buffruneio/.travis.yml @@ -0,0 +1,7 @@ +language: go +sudo: false +go: + - 1.3.3 + - 1.4.3 + - 1.5.3 + - tip diff --git a/vendor/github.com/pelletier/go-toml/.gitignore b/vendor/github.com/pelletier/go-toml/.gitignore new file mode 100644 index 0000000..f1b6190 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/.gitignore @@ -0,0 +1 @@ +test_program/test_program_bin diff --git a/vendor/github.com/pelletier/go-toml/.travis.yml b/vendor/github.com/pelletier/go-toml/.travis.yml new file mode 100644 index 0000000..5307ea8 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/.travis.yml @@ -0,0 +1,18 @@ +language: go +go: + - 1.5.4 + - 1.6.3 + - 1.7 + - tip +matrix: + allow_failures: + - go: tip + fast_finish: true +script: + - ./test.sh +before_install: + - go get github.com/axw/gocov/gocov + - go get github.com/mattn/goveralls + - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi +after_success: + - $HOME/gopath/bin/goveralls -service=travis-ci diff --git a/vendor/github.com/pelletier/go-toml/clean.sh b/vendor/github.com/pelletier/go-toml/clean.sh old mode 100755 new mode 100644 diff --git a/vendor/github.com/pelletier/go-toml/test.sh b/vendor/github.com/pelletier/go-toml/test.sh old mode 100755 new mode 100644 diff --git a/vendor/github.com/pkg/errors/.gitignore b/vendor/github.com/pkg/errors/.gitignore new file mode 100644 index 0000000..daf913b --- /dev/null +++ b/vendor/github.com/pkg/errors/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/vendor/github.com/pkg/errors/.travis.yml b/vendor/github.com/pkg/errors/.travis.yml new file mode 100644 index 0000000..024e284 --- /dev/null +++ b/vendor/github.com/pkg/errors/.travis.yml @@ -0,0 +1,10 @@ +language: go +go_import_path: github.com/pkg/errors +go: + - 1.4.3 + - 1.5.4 + - 1.6.2 + - tip + +script: + - go test -v ./... diff --git a/vendor/github.com/pkg/sftp/.gitignore b/vendor/github.com/pkg/sftp/.gitignore new file mode 100644 index 0000000..9fc1e3d --- /dev/null +++ b/vendor/github.com/pkg/sftp/.gitignore @@ -0,0 +1,8 @@ +.*.swo +.*.swp + +server_standalone/server_standalone + +examples/sftp-server/id_rsa +examples/sftp-server/id_rsa.pub +examples/sftp-server/sftp-server diff --git a/vendor/github.com/pkg/sftp/.travis.yml b/vendor/github.com/pkg/sftp/.travis.yml new file mode 100644 index 0000000..3a3ba38 --- /dev/null +++ b/vendor/github.com/pkg/sftp/.travis.yml @@ -0,0 +1,25 @@ +language: go +go_import_path: github.com/pkg/sftp +go: + - 1.4.3 + - 1.5.2 + - 1.6.2 + - tip + +sudo: false + +addons: + ssh_known_hosts: + - bitbucket.org + +install: + - go get -t -v ./... + - ssh-keygen -t rsa -q -P "" -f /home/travis/.ssh/id_rsa + +script: + - go test -integration -v ./... + - go test -testserver -v ./... + - go test -integration -testserver -v ./... + - go test -race -integration -v ./... + - go test -race -testserver -v ./... + - go test -race -integration -testserver -v ./... diff --git a/vendor/github.com/spf13/afero/.travis.yml b/vendor/github.com/spf13/afero/.travis.yml new file mode 100644 index 0000000..c24eebf --- /dev/null +++ b/vendor/github.com/spf13/afero/.travis.yml @@ -0,0 +1,21 @@ +sudo: false +language: go + +go: + - 1.5.4 + - 1.6.3 + - 1.7 + - tip + +os: + - linux + - osx + +matrix: + allow_failures: + - go: tip + fast_finish: true + +script: + - go test -v ./... + - go build diff --git a/vendor/github.com/spf13/cast/.gitignore b/vendor/github.com/spf13/cast/.gitignore new file mode 100644 index 0000000..8365624 --- /dev/null +++ b/vendor/github.com/spf13/cast/.gitignore @@ -0,0 +1,23 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test diff --git a/vendor/github.com/spf13/jwalterweatherman/.gitignore b/vendor/github.com/spf13/jwalterweatherman/.gitignore new file mode 100644 index 0000000..0026861 --- /dev/null +++ b/vendor/github.com/spf13/jwalterweatherman/.gitignore @@ -0,0 +1,22 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe diff --git a/vendor/github.com/spf13/pflag/.travis.yml b/vendor/github.com/spf13/pflag/.travis.yml new file mode 100644 index 0000000..0a7c136 --- /dev/null +++ b/vendor/github.com/spf13/pflag/.travis.yml @@ -0,0 +1,21 @@ +sudo: false + +language: go + +go: + - 1.5.4 + - 1.6.3 + - 1.7 + - tip + +matrix: + allow_failures: + - go: tip +install: + - go get github.com/golang/lint/golint + - export PATH=$GOPATH/bin:$PATH + - go install ./... + +script: + - verify/all.sh -v + - go test ./... diff --git a/vendor/github.com/spf13/viper/.gitignore b/vendor/github.com/spf13/viper/.gitignore new file mode 100644 index 0000000..8365624 --- /dev/null +++ b/vendor/github.com/spf13/viper/.gitignore @@ -0,0 +1,23 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test diff --git a/vendor/github.com/spf13/viper/.travis.yml b/vendor/github.com/spf13/viper/.travis.yml new file mode 100644 index 0000000..e793edb --- /dev/null +++ b/vendor/github.com/spf13/viper/.travis.yml @@ -0,0 +1,27 @@ +go_import_path: github.com/spf13/viper + +language: go +go: + - 1.5.4 + - 1.6.3 + - 1.7 + - tip + +os: + - linux + - osx + +matrix: + allow_failures: + - go: tip + fast_finish: true + +script: + - go install ./... + - go test -v ./... + +after_success: + - go get -u -d github.com/spf13/hugo + - cd $GOPATH/src/github.com/spf13/hugo && make && ./hugo -s docs && cd - + +sudo: false diff --git a/vendor/golang.org/x/crypto/AUTHORS b/vendor/golang.org/x/crypto/AUTHORS new file mode 100644 index 0000000..15167cd --- /dev/null +++ b/vendor/golang.org/x/crypto/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/crypto/CONTRIBUTORS b/vendor/golang.org/x/crypto/CONTRIBUTORS new file mode 100644 index 0000000..1c4577e --- /dev/null +++ b/vendor/golang.org/x/crypto/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/sys/AUTHORS b/vendor/golang.org/x/sys/AUTHORS new file mode 100644 index 0000000..15167cd --- /dev/null +++ b/vendor/golang.org/x/sys/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/sys/CONTRIBUTORS b/vendor/golang.org/x/sys/CONTRIBUTORS new file mode 100644 index 0000000..1c4577e --- /dev/null +++ b/vendor/golang.org/x/sys/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/sys/unix/.gitignore b/vendor/golang.org/x/sys/unix/.gitignore new file mode 100644 index 0000000..e482715 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/.gitignore @@ -0,0 +1 @@ +_obj/ diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh old mode 100755 new mode 100644 diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh old mode 100755 new mode 100644 diff --git a/vendor/golang.org/x/sys/unix/mksyscall.pl b/vendor/golang.org/x/sys/unix/mksyscall.pl old mode 100755 new mode 100644 diff --git a/vendor/golang.org/x/sys/unix/mksyscall_solaris.pl b/vendor/golang.org/x/sys/unix/mksyscall_solaris.pl old mode 100755 new mode 100644 diff --git a/vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl b/vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl old mode 100755 new mode 100644 diff --git a/vendor/golang.org/x/sys/unix/mksysnum_darwin.pl b/vendor/golang.org/x/sys/unix/mksysnum_darwin.pl old mode 100755 new mode 100644 diff --git a/vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl b/vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl old mode 100755 new mode 100644 diff --git a/vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl b/vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl old mode 100755 new mode 100644 diff --git a/vendor/golang.org/x/sys/unix/mksysnum_linux.pl b/vendor/golang.org/x/sys/unix/mksysnum_linux.pl old mode 100755 new mode 100644 diff --git a/vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl b/vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl old mode 100755 new mode 100644 diff --git a/vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl b/vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl old mode 100755 new mode 100644 diff --git a/vendor/golang.org/x/sys/unix/types_darwin.go b/vendor/golang.org/x/sys/unix/types_darwin.go deleted file mode 100644 index 1153261..0000000 --- a/vendor/golang.org/x/sys/unix/types_darwin.go +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See also mkerrors.sh and mkall.sh -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define __DARWIN_UNIX03 0 -#define KERNEL -#define _DARWIN_USE_64_BIT_INODE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -type Timeval32 C.struct_timeval32 - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat64 - -type Statfs_t C.struct_statfs64 - -type Flock_t C.struct_flock - -type Fstore_t C.struct_fstore - -type Radvisory_t C.struct_radvisory - -type Fbootstraptransfer_t C.struct_fbootstraptransfer - -type Log2phys_t C.struct_log2phys - -type Fsid C.struct_fsid - -type Dirent C.struct_dirent - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet4Pktinfo C.struct_in_pktinfo - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfmaMsghdr2 = C.sizeof_struct_ifma_msghdr2 - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfmaMsghdr2 C.struct_ifma_msghdr2 - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) diff --git a/vendor/golang.org/x/sys/unix/types_dragonfly.go b/vendor/golang.org/x/sys/unix/types_dragonfly.go deleted file mode 100644 index f3c971d..0000000 --- a/vendor/golang.org/x/sys/unix/types_dragonfly.go +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See also mkerrors.sh and mkall.sh -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( // Directory mode bits - S_IFMT = C.S_IFMT - S_IFIFO = C.S_IFIFO - S_IFCHR = C.S_IFCHR - S_IFDIR = C.S_IFDIR - S_IFBLK = C.S_IFBLK - S_IFREG = C.S_IFREG - S_IFLNK = C.S_IFLNK - S_IFSOCK = C.S_IFSOCK - S_ISUID = C.S_ISUID - S_ISGID = C.S_ISGID - S_ISVTX = C.S_ISVTX - S_IRUSR = C.S_IRUSR - S_IWUSR = C.S_IWUSR - S_IXUSR = C.S_IXUSR -) - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.struct_fsid - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios diff --git a/vendor/golang.org/x/sys/unix/types_freebsd.go b/vendor/golang.org/x/sys/unix/types_freebsd.go deleted file mode 100644 index ae24557..0000000 --- a/vendor/golang.org/x/sys/unix/types_freebsd.go +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See also mkerrors.sh and mkall.sh -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -// This structure is a duplicate of stat on FreeBSD 8-STABLE. -// See /usr/include/sys/stat.h. -struct stat8 { -#undef st_atimespec st_atim -#undef st_mtimespec st_mtim -#undef st_ctimespec st_ctim -#undef st_birthtimespec st_birthtim - __dev_t st_dev; - ino_t st_ino; - mode_t st_mode; - nlink_t st_nlink; - uid_t st_uid; - gid_t st_gid; - __dev_t st_rdev; -#if __BSD_VISIBLE - struct timespec st_atimespec; - struct timespec st_mtimespec; - struct timespec st_ctimespec; -#else - time_t st_atime; - long __st_atimensec; - time_t st_mtime; - long __st_mtimensec; - time_t st_ctime; - long __st_ctimensec; -#endif - off_t st_size; - blkcnt_t st_blocks; - blksize_t st_blksize; - fflags_t st_flags; - __uint32_t st_gen; - __int32_t st_lspare; -#if __BSD_VISIBLE - struct timespec st_birthtimespec; - unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); - unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); -#else - time_t st_birthtime; - long st_birthtimensec; - unsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec)); - unsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec)); -#endif -}; - -// This structure is a duplicate of if_data on FreeBSD 8-STABLE. -// See /usr/include/net/if.h. -struct if_data8 { - u_char ifi_type; - u_char ifi_physical; - u_char ifi_addrlen; - u_char ifi_hdrlen; - u_char ifi_link_state; - u_char ifi_spare_char1; - u_char ifi_spare_char2; - u_char ifi_datalen; - u_long ifi_mtu; - u_long ifi_metric; - u_long ifi_baudrate; - u_long ifi_ipackets; - u_long ifi_ierrors; - u_long ifi_opackets; - u_long ifi_oerrors; - u_long ifi_collisions; - u_long ifi_ibytes; - u_long ifi_obytes; - u_long ifi_imcasts; - u_long ifi_omcasts; - u_long ifi_iqdrops; - u_long ifi_noproto; - u_long ifi_hwassist; - time_t ifi_epoch; - struct timeval ifi_lastchange; -}; - -// This structure is a duplicate of if_msghdr on FreeBSD 8-STABLE. -// See /usr/include/net/if.h. -struct if_msghdr8 { - u_short ifm_msglen; - u_char ifm_version; - u_char ifm_type; - int ifm_addrs; - int ifm_flags; - u_short ifm_index; - struct if_data8 ifm_data; -}; -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( // Directory mode bits - S_IFMT = C.S_IFMT - S_IFIFO = C.S_IFIFO - S_IFCHR = C.S_IFCHR - S_IFDIR = C.S_IFDIR - S_IFBLK = C.S_IFBLK - S_IFREG = C.S_IFREG - S_IFLNK = C.S_IFLNK - S_IFSOCK = C.S_IFSOCK - S_ISUID = C.S_ISUID - S_ISGID = C.S_ISGID - S_ISVTX = C.S_ISVTX - S_IRUSR = C.S_IRUSR - S_IWUSR = C.S_IWUSR - S_IXUSR = C.S_IXUSR -) - -type Stat_t C.struct_stat8 - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.struct_fsid - -// Advice to Fadvise - -const ( - FADV_NORMAL = C.POSIX_FADV_NORMAL - FADV_RANDOM = C.POSIX_FADV_RANDOM - FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL - FADV_WILLNEED = C.POSIX_FADV_WILLNEED - FADV_DONTNEED = C.POSIX_FADV_DONTNEED - FADV_NOREUSE = C.POSIX_FADV_NOREUSE -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPMreqn C.struct_ip_mreqn - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPMreqn = C.sizeof_struct_ip_mreqn - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - sizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfMsghdr = C.sizeof_struct_if_msghdr8 - sizeofIfData = C.sizeof_struct_if_data - SizeofIfData = C.sizeof_struct_if_data8 - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type ifMsghdr C.struct_if_msghdr - -type IfMsghdr C.struct_if_msghdr8 - -type ifData C.struct_if_data - -type IfData C.struct_if_data8 - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfZbuf = C.sizeof_struct_bpf_zbuf - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr - SizeofBpfZbufHeader = C.sizeof_struct_bpf_zbuf_header -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfZbuf C.struct_bpf_zbuf - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfZbufHeader C.struct_bpf_zbuf_header - -// Terminal handling - -type Termios C.struct_termios diff --git a/vendor/golang.org/x/sys/unix/types_linux.go b/vendor/golang.org/x/sys/unix/types_linux.go deleted file mode 100644 index 143e767..0000000 --- a/vendor/golang.org/x/sys/unix/types_linux.go +++ /dev/null @@ -1,417 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See also mkerrors.sh and mkall.sh -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE -#define _FILE_OFFSET_BITS 64 -#define _GNU_SOURCE - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef TCSETS2 -// On systems that have "struct termios2" use this as type Termios. -typedef struct termios2 termios_t; -#else -typedef struct termios termios_t; -#endif - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_ll s5; - struct sockaddr_nl s6; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -// copied from /usr/include/linux/un.h -struct my_sockaddr_un { - sa_family_t sun_family; -#if defined(__ARM_EABI__) || defined(__powerpc64__) - // on ARM char is by default unsigned - signed char sun_path[108]; -#else - char sun_path[108]; -#endif -}; - -#ifdef __ARM_EABI__ -typedef struct user_regs PtraceRegs; -#elif defined(__aarch64__) -typedef struct user_pt_regs PtraceRegs; -#elif defined(__powerpc64__) -typedef struct pt_regs PtraceRegs; -#elif defined(__mips__) -typedef struct user PtraceRegs; -#else -typedef struct user_regs_struct PtraceRegs; -#endif - -// The real epoll_event is a union, and godefs doesn't handle it well. -struct my_epoll_event { - uint32_t events; -#if defined(__ARM_EABI__) || defined(__aarch64__) - // padding is not specified in linux/eventpoll.h but added to conform to the - // alignment requirements of EABI - int32_t padFd; -#endif -#ifdef __powerpc64__ - int32_t _padFd; -#endif - int32_t fd; - int32_t pad; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong - PathMax = C.PATH_MAX -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -type Timex C.struct_timex - -type Time_t C.time_t - -type Tms C.struct_tms - -type Utimbuf C.struct_utimbuf - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Dirent C.struct_dirent - -type Fsid C.fsid_t - -type Flock_t C.struct_flock - -// Advice to Fadvise - -const ( - FADV_NORMAL = C.POSIX_FADV_NORMAL - FADV_RANDOM = C.POSIX_FADV_RANDOM - FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL - FADV_WILLNEED = C.POSIX_FADV_WILLNEED - FADV_DONTNEED = C.POSIX_FADV_DONTNEED - FADV_NOREUSE = C.POSIX_FADV_NOREUSE -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_my_sockaddr_un - -type RawSockaddrLinklayer C.struct_sockaddr_ll - -type RawSockaddrNetlink C.struct_sockaddr_nl - -type RawSockaddrHCI C.struct_sockaddr_hci - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPMreqn C.struct_ip_mreqn - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet4Pktinfo C.struct_in_pktinfo - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -type Ucred C.struct_ucred - -type TCPInfo C.struct_tcp_info - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrLinklayer = C.sizeof_struct_sockaddr_ll - SizeofSockaddrNetlink = C.sizeof_struct_sockaddr_nl - SizeofSockaddrHCI = C.sizeof_struct_sockaddr_hci - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPMreqn = C.sizeof_struct_ip_mreqn - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter - SizeofUcred = C.sizeof_struct_ucred - SizeofTCPInfo = C.sizeof_struct_tcp_info -) - -// Netlink routing and interface messages - -const ( - IFA_UNSPEC = C.IFA_UNSPEC - IFA_ADDRESS = C.IFA_ADDRESS - IFA_LOCAL = C.IFA_LOCAL - IFA_LABEL = C.IFA_LABEL - IFA_BROADCAST = C.IFA_BROADCAST - IFA_ANYCAST = C.IFA_ANYCAST - IFA_CACHEINFO = C.IFA_CACHEINFO - IFA_MULTICAST = C.IFA_MULTICAST - IFLA_UNSPEC = C.IFLA_UNSPEC - IFLA_ADDRESS = C.IFLA_ADDRESS - IFLA_BROADCAST = C.IFLA_BROADCAST - IFLA_IFNAME = C.IFLA_IFNAME - IFLA_MTU = C.IFLA_MTU - IFLA_LINK = C.IFLA_LINK - IFLA_QDISC = C.IFLA_QDISC - IFLA_STATS = C.IFLA_STATS - IFLA_COST = C.IFLA_COST - IFLA_PRIORITY = C.IFLA_PRIORITY - IFLA_MASTER = C.IFLA_MASTER - IFLA_WIRELESS = C.IFLA_WIRELESS - IFLA_PROTINFO = C.IFLA_PROTINFO - IFLA_TXQLEN = C.IFLA_TXQLEN - IFLA_MAP = C.IFLA_MAP - IFLA_WEIGHT = C.IFLA_WEIGHT - IFLA_OPERSTATE = C.IFLA_OPERSTATE - IFLA_LINKMODE = C.IFLA_LINKMODE - IFLA_LINKINFO = C.IFLA_LINKINFO - IFLA_NET_NS_PID = C.IFLA_NET_NS_PID - IFLA_IFALIAS = C.IFLA_IFALIAS - IFLA_MAX = C.IFLA_MAX - RT_SCOPE_UNIVERSE = C.RT_SCOPE_UNIVERSE - RT_SCOPE_SITE = C.RT_SCOPE_SITE - RT_SCOPE_LINK = C.RT_SCOPE_LINK - RT_SCOPE_HOST = C.RT_SCOPE_HOST - RT_SCOPE_NOWHERE = C.RT_SCOPE_NOWHERE - RT_TABLE_UNSPEC = C.RT_TABLE_UNSPEC - RT_TABLE_COMPAT = C.RT_TABLE_COMPAT - RT_TABLE_DEFAULT = C.RT_TABLE_DEFAULT - RT_TABLE_MAIN = C.RT_TABLE_MAIN - RT_TABLE_LOCAL = C.RT_TABLE_LOCAL - RT_TABLE_MAX = C.RT_TABLE_MAX - RTA_UNSPEC = C.RTA_UNSPEC - RTA_DST = C.RTA_DST - RTA_SRC = C.RTA_SRC - RTA_IIF = C.RTA_IIF - RTA_OIF = C.RTA_OIF - RTA_GATEWAY = C.RTA_GATEWAY - RTA_PRIORITY = C.RTA_PRIORITY - RTA_PREFSRC = C.RTA_PREFSRC - RTA_METRICS = C.RTA_METRICS - RTA_MULTIPATH = C.RTA_MULTIPATH - RTA_FLOW = C.RTA_FLOW - RTA_CACHEINFO = C.RTA_CACHEINFO - RTA_TABLE = C.RTA_TABLE - RTN_UNSPEC = C.RTN_UNSPEC - RTN_UNICAST = C.RTN_UNICAST - RTN_LOCAL = C.RTN_LOCAL - RTN_BROADCAST = C.RTN_BROADCAST - RTN_ANYCAST = C.RTN_ANYCAST - RTN_MULTICAST = C.RTN_MULTICAST - RTN_BLACKHOLE = C.RTN_BLACKHOLE - RTN_UNREACHABLE = C.RTN_UNREACHABLE - RTN_PROHIBIT = C.RTN_PROHIBIT - RTN_THROW = C.RTN_THROW - RTN_NAT = C.RTN_NAT - RTN_XRESOLVE = C.RTN_XRESOLVE - RTNLGRP_NONE = C.RTNLGRP_NONE - RTNLGRP_LINK = C.RTNLGRP_LINK - RTNLGRP_NOTIFY = C.RTNLGRP_NOTIFY - RTNLGRP_NEIGH = C.RTNLGRP_NEIGH - RTNLGRP_TC = C.RTNLGRP_TC - RTNLGRP_IPV4_IFADDR = C.RTNLGRP_IPV4_IFADDR - RTNLGRP_IPV4_MROUTE = C.RTNLGRP_IPV4_MROUTE - RTNLGRP_IPV4_ROUTE = C.RTNLGRP_IPV4_ROUTE - RTNLGRP_IPV4_RULE = C.RTNLGRP_IPV4_RULE - RTNLGRP_IPV6_IFADDR = C.RTNLGRP_IPV6_IFADDR - RTNLGRP_IPV6_MROUTE = C.RTNLGRP_IPV6_MROUTE - RTNLGRP_IPV6_ROUTE = C.RTNLGRP_IPV6_ROUTE - RTNLGRP_IPV6_IFINFO = C.RTNLGRP_IPV6_IFINFO - RTNLGRP_IPV6_PREFIX = C.RTNLGRP_IPV6_PREFIX - RTNLGRP_IPV6_RULE = C.RTNLGRP_IPV6_RULE - RTNLGRP_ND_USEROPT = C.RTNLGRP_ND_USEROPT - SizeofNlMsghdr = C.sizeof_struct_nlmsghdr - SizeofNlMsgerr = C.sizeof_struct_nlmsgerr - SizeofRtGenmsg = C.sizeof_struct_rtgenmsg - SizeofNlAttr = C.sizeof_struct_nlattr - SizeofRtAttr = C.sizeof_struct_rtattr - SizeofIfInfomsg = C.sizeof_struct_ifinfomsg - SizeofIfAddrmsg = C.sizeof_struct_ifaddrmsg - SizeofRtMsg = C.sizeof_struct_rtmsg - SizeofRtNexthop = C.sizeof_struct_rtnexthop -) - -type NlMsghdr C.struct_nlmsghdr - -type NlMsgerr C.struct_nlmsgerr - -type RtGenmsg C.struct_rtgenmsg - -type NlAttr C.struct_nlattr - -type RtAttr C.struct_rtattr - -type IfInfomsg C.struct_ifinfomsg - -type IfAddrmsg C.struct_ifaddrmsg - -type RtMsg C.struct_rtmsg - -type RtNexthop C.struct_rtnexthop - -// Linux socket filter - -const ( - SizeofSockFilter = C.sizeof_struct_sock_filter - SizeofSockFprog = C.sizeof_struct_sock_fprog -) - -type SockFilter C.struct_sock_filter - -type SockFprog C.struct_sock_fprog - -// Inotify - -type InotifyEvent C.struct_inotify_event - -const SizeofInotifyEvent = C.sizeof_struct_inotify_event - -// Ptrace - -// Register structures -type PtraceRegs C.PtraceRegs - -// Misc - -type FdSet C.fd_set - -type Sysinfo_t C.struct_sysinfo - -type Utsname C.struct_utsname - -type Ustat_t C.struct_ustat - -type EpollEvent C.struct_my_epoll_event - -const ( - AT_FDCWD = C.AT_FDCWD - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// Terminal handling - -type Termios C.termios_t diff --git a/vendor/golang.org/x/sys/unix/types_netbsd.go b/vendor/golang.org/x/sys/unix/types_netbsd.go deleted file mode 100644 index d15f93d..0000000 --- a/vendor/golang.org/x/sys/unix/types_netbsd.go +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See also mkerrors.sh and mkall.sh -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.fsid_t - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -type Mclpool C.struct_mclpool - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfTimeval C.struct_bpf_timeval - -// Terminal handling - -type Termios C.struct_termios - -// Sysctl - -type Sysctlnode C.struct_sysctlnode diff --git a/vendor/golang.org/x/sys/unix/types_openbsd.go b/vendor/golang.org/x/sys/unix/types_openbsd.go deleted file mode 100644 index b66fe25..0000000 --- a/vendor/golang.org/x/sys/unix/types_openbsd.go +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See also mkerrors.sh and mkall.sh -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( // Directory mode bits - S_IFMT = C.S_IFMT - S_IFIFO = C.S_IFIFO - S_IFCHR = C.S_IFCHR - S_IFDIR = C.S_IFDIR - S_IFBLK = C.S_IFBLK - S_IFREG = C.S_IFREG - S_IFLNK = C.S_IFLNK - S_IFSOCK = C.S_IFSOCK - S_ISUID = C.S_ISUID - S_ISGID = C.S_ISGID - S_ISVTX = C.S_ISVTX - S_IRUSR = C.S_IRUSR - S_IWUSR = C.S_IWUSR - S_IXUSR = C.S_IXUSR -) - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.fsid_t - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -type Mclpool C.struct_mclpool - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfTimeval C.struct_bpf_timeval - -// Terminal handling - -type Termios C.struct_termios diff --git a/vendor/golang.org/x/sys/unix/types_solaris.go b/vendor/golang.org/x/sys/unix/types_solaris.go deleted file mode 100644 index 6ad50ea..0000000 --- a/vendor/golang.org/x/sys/unix/types_solaris.go +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See also mkerrors.sh and mkall.sh -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -// These defines ensure that builds done on newer versions of Solaris are -// backwards-compatible with older versions of Solaris and -// OpenSolaris-based derivatives. -#define __USE_SUNOS_SOCKETS__ // msghdr -#define __USE_LEGACY_PROTOTYPES__ // iovec -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong - PathMax = C.PATH_MAX -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -type Timeval32 C.struct_timeval32 - -type Tms C.struct_tms - -type Utimbuf C.struct_utimbuf - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( // Directory mode bits - S_IFMT = C.S_IFMT - S_IFIFO = C.S_IFIFO - S_IFCHR = C.S_IFCHR - S_IFDIR = C.S_IFDIR - S_IFBLK = C.S_IFBLK - S_IFREG = C.S_IFREG - S_IFLNK = C.S_IFLNK - S_IFSOCK = C.S_IFSOCK - S_ISUID = C.S_ISUID - S_ISGID = C.S_ISGID - S_ISVTX = C.S_ISVTX - S_IRUSR = C.S_IRUSR - S_IWUSR = C.S_IWUSR - S_IXUSR = C.S_IXUSR -) - -type Stat_t C.struct_stat - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Select - -type FdSet C.fd_set - -// Misc - -type Utsname C.struct_utsname - -type Ustat_t C.struct_ustat - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_EACCESS = C.AT_EACCESS -) - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfTimeval C.struct_bpf_timeval - -type BpfHdr C.struct_bpf_hdr - -// sysconf information - -const _SC_PAGESIZE = C._SC_PAGESIZE - -// Terminal handling - -type Termios C.struct_termios - -type Termio C.struct_termio - -type Winsize C.struct_winsize diff --git a/vendor/golang.org/x/text/AUTHORS b/vendor/golang.org/x/text/AUTHORS new file mode 100644 index 0000000..15167cd --- /dev/null +++ b/vendor/golang.org/x/text/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/text/CONTRIBUTORS b/vendor/golang.org/x/text/CONTRIBUTORS new file mode 100644 index 0000000..1c4577e --- /dev/null +++ b/vendor/golang.org/x/text/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/text/unicode/norm/maketables.go b/vendor/golang.org/x/text/unicode/norm/maketables.go deleted file mode 100644 index 07bdff6..0000000 --- a/vendor/golang.org/x/text/unicode/norm/maketables.go +++ /dev/null @@ -1,978 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Normalization table generator. -// Data read from the web. -// See forminfo.go for a description of the trie values associated with each rune. - -package main - -import ( - "bytes" - "flag" - "fmt" - "io" - "log" - "sort" - "strconv" - "strings" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/triegen" - "golang.org/x/text/internal/ucd" -) - -func main() { - gen.Init() - loadUnicodeData() - compactCCC() - loadCompositionExclusions() - completeCharFields(FCanonical) - completeCharFields(FCompatibility) - computeNonStarterCounts() - verifyComputed() - printChars() - if *test { - testDerived() - printTestdata() - } else { - makeTables() - } -} - -var ( - tablelist = flag.String("tables", - "all", - "comma-separated list of which tables to generate; "+ - "can be 'decomp', 'recomp', 'info' and 'all'") - test = flag.Bool("test", - false, - "test existing tables against DerivedNormalizationProps and generate test data for regression testing") - verbose = flag.Bool("verbose", - false, - "write data to stdout as it is parsed") -) - -const MaxChar = 0x10FFFF // anything above this shouldn't exist - -// Quick Check properties of runes allow us to quickly -// determine whether a rune may occur in a normal form. -// For a given normal form, a rune may be guaranteed to occur -// verbatim (QC=Yes), may or may not combine with another -// rune (QC=Maybe), or may not occur (QC=No). -type QCResult int - -const ( - QCUnknown QCResult = iota - QCYes - QCNo - QCMaybe -) - -func (r QCResult) String() string { - switch r { - case QCYes: - return "Yes" - case QCNo: - return "No" - case QCMaybe: - return "Maybe" - } - return "***UNKNOWN***" -} - -const ( - FCanonical = iota // NFC or NFD - FCompatibility // NFKC or NFKD - FNumberOfFormTypes -) - -const ( - MComposed = iota // NFC or NFKC - MDecomposed // NFD or NFKD - MNumberOfModes -) - -// This contains only the properties we're interested in. -type Char struct { - name string - codePoint rune // if zero, this index is not a valid code point. - ccc uint8 // canonical combining class - origCCC uint8 - excludeInComp bool // from CompositionExclusions.txt - compatDecomp bool // it has a compatibility expansion - - nTrailingNonStarters uint8 - nLeadingNonStarters uint8 // must be equal to trailing if non-zero - - forms [FNumberOfFormTypes]FormInfo // For FCanonical and FCompatibility - - state State -} - -var chars = make([]Char, MaxChar+1) -var cccMap = make(map[uint8]uint8) - -func (c Char) String() string { - buf := new(bytes.Buffer) - - fmt.Fprintf(buf, "%U [%s]:\n", c.codePoint, c.name) - fmt.Fprintf(buf, " ccc: %v\n", c.ccc) - fmt.Fprintf(buf, " excludeInComp: %v\n", c.excludeInComp) - fmt.Fprintf(buf, " compatDecomp: %v\n", c.compatDecomp) - fmt.Fprintf(buf, " state: %v\n", c.state) - fmt.Fprintf(buf, " NFC:\n") - fmt.Fprint(buf, c.forms[FCanonical]) - fmt.Fprintf(buf, " NFKC:\n") - fmt.Fprint(buf, c.forms[FCompatibility]) - - return buf.String() -} - -// In UnicodeData.txt, some ranges are marked like this: -// 3400;;Lo;0;L;;;;;N;;;;; -// 4DB5;;Lo;0;L;;;;;N;;;;; -// parseCharacter keeps a state variable indicating the weirdness. -type State int - -const ( - SNormal State = iota // known to be zero for the type - SFirst - SLast - SMissing -) - -var lastChar = rune('\u0000') - -func (c Char) isValid() bool { - return c.codePoint != 0 && c.state != SMissing -} - -type FormInfo struct { - quickCheck [MNumberOfModes]QCResult // index: MComposed or MDecomposed - verified [MNumberOfModes]bool // index: MComposed or MDecomposed - - combinesForward bool // May combine with rune on the right - combinesBackward bool // May combine with rune on the left - isOneWay bool // Never appears in result - inDecomp bool // Some decompositions result in this char. - decomp Decomposition - expandedDecomp Decomposition -} - -func (f FormInfo) String() string { - buf := bytes.NewBuffer(make([]byte, 0)) - - fmt.Fprintf(buf, " quickCheck[C]: %v\n", f.quickCheck[MComposed]) - fmt.Fprintf(buf, " quickCheck[D]: %v\n", f.quickCheck[MDecomposed]) - fmt.Fprintf(buf, " cmbForward: %v\n", f.combinesForward) - fmt.Fprintf(buf, " cmbBackward: %v\n", f.combinesBackward) - fmt.Fprintf(buf, " isOneWay: %v\n", f.isOneWay) - fmt.Fprintf(buf, " inDecomp: %v\n", f.inDecomp) - fmt.Fprintf(buf, " decomposition: %X\n", f.decomp) - fmt.Fprintf(buf, " expandedDecomp: %X\n", f.expandedDecomp) - - return buf.String() -} - -type Decomposition []rune - -func parseDecomposition(s string, skipfirst bool) (a []rune, err error) { - decomp := strings.Split(s, " ") - if len(decomp) > 0 && skipfirst { - decomp = decomp[1:] - } - for _, d := range decomp { - point, err := strconv.ParseUint(d, 16, 64) - if err != nil { - return a, err - } - a = append(a, rune(point)) - } - return a, nil -} - -func loadUnicodeData() { - f := gen.OpenUCDFile("UnicodeData.txt") - defer f.Close() - p := ucd.New(f) - for p.Next() { - r := p.Rune(ucd.CodePoint) - char := &chars[r] - - char.ccc = uint8(p.Uint(ucd.CanonicalCombiningClass)) - decmap := p.String(ucd.DecompMapping) - - exp, err := parseDecomposition(decmap, false) - isCompat := false - if err != nil { - if len(decmap) > 0 { - exp, err = parseDecomposition(decmap, true) - if err != nil { - log.Fatalf(`%U: bad decomp |%v|: "%s"`, r, decmap, err) - } - isCompat = true - } - } - - char.name = p.String(ucd.Name) - char.codePoint = r - char.forms[FCompatibility].decomp = exp - if !isCompat { - char.forms[FCanonical].decomp = exp - } else { - char.compatDecomp = true - } - if len(decmap) > 0 { - char.forms[FCompatibility].decomp = exp - } - } - if err := p.Err(); err != nil { - log.Fatal(err) - } -} - -// compactCCC converts the sparse set of CCC values to a continguous one, -// reducing the number of bits needed from 8 to 6. -func compactCCC() { - m := make(map[uint8]uint8) - for i := range chars { - c := &chars[i] - m[c.ccc] = 0 - } - cccs := []int{} - for v, _ := range m { - cccs = append(cccs, int(v)) - } - sort.Ints(cccs) - for i, c := range cccs { - cccMap[uint8(i)] = uint8(c) - m[uint8(c)] = uint8(i) - } - for i := range chars { - c := &chars[i] - c.origCCC = c.ccc - c.ccc = m[c.ccc] - } - if len(m) >= 1<<6 { - log.Fatalf("too many difference CCC values: %d >= 64", len(m)) - } -} - -// CompositionExclusions.txt has form: -// 0958 # ... -// See http://unicode.org/reports/tr44/ for full explanation -func loadCompositionExclusions() { - f := gen.OpenUCDFile("CompositionExclusions.txt") - defer f.Close() - p := ucd.New(f) - for p.Next() { - c := &chars[p.Rune(0)] - if c.excludeInComp { - log.Fatalf("%U: Duplicate entry in exclusions.", c.codePoint) - } - c.excludeInComp = true - } - if e := p.Err(); e != nil { - log.Fatal(e) - } -} - -// hasCompatDecomp returns true if any of the recursive -// decompositions contains a compatibility expansion. -// In this case, the character may not occur in NFK*. -func hasCompatDecomp(r rune) bool { - c := &chars[r] - if c.compatDecomp { - return true - } - for _, d := range c.forms[FCompatibility].decomp { - if hasCompatDecomp(d) { - return true - } - } - return false -} - -// Hangul related constants. -const ( - HangulBase = 0xAC00 - HangulEnd = 0xD7A4 // hangulBase + Jamo combinations (19 * 21 * 28) - - JamoLBase = 0x1100 - JamoLEnd = 0x1113 - JamoVBase = 0x1161 - JamoVEnd = 0x1176 - JamoTBase = 0x11A8 - JamoTEnd = 0x11C3 - - JamoLVTCount = 19 * 21 * 28 - JamoTCount = 28 -) - -func isHangul(r rune) bool { - return HangulBase <= r && r < HangulEnd -} - -func isHangulWithoutJamoT(r rune) bool { - if !isHangul(r) { - return false - } - r -= HangulBase - return r < JamoLVTCount && r%JamoTCount == 0 -} - -func ccc(r rune) uint8 { - return chars[r].ccc -} - -// Insert a rune in a buffer, ordered by Canonical Combining Class. -func insertOrdered(b Decomposition, r rune) Decomposition { - n := len(b) - b = append(b, 0) - cc := ccc(r) - if cc > 0 { - // Use bubble sort. - for ; n > 0; n-- { - if ccc(b[n-1]) <= cc { - break - } - b[n] = b[n-1] - } - } - b[n] = r - return b -} - -// Recursively decompose. -func decomposeRecursive(form int, r rune, d Decomposition) Decomposition { - dcomp := chars[r].forms[form].decomp - if len(dcomp) == 0 { - return insertOrdered(d, r) - } - for _, c := range dcomp { - d = decomposeRecursive(form, c, d) - } - return d -} - -func completeCharFields(form int) { - // Phase 0: pre-expand decomposition. - for i := range chars { - f := &chars[i].forms[form] - if len(f.decomp) == 0 { - continue - } - exp := make(Decomposition, 0) - for _, c := range f.decomp { - exp = decomposeRecursive(form, c, exp) - } - f.expandedDecomp = exp - } - - // Phase 1: composition exclusion, mark decomposition. - for i := range chars { - c := &chars[i] - f := &c.forms[form] - - // Marks script-specific exclusions and version restricted. - f.isOneWay = c.excludeInComp - - // Singletons - f.isOneWay = f.isOneWay || len(f.decomp) == 1 - - // Non-starter decompositions - if len(f.decomp) > 1 { - chk := c.ccc != 0 || chars[f.decomp[0]].ccc != 0 - f.isOneWay = f.isOneWay || chk - } - - // Runes that decompose into more than two runes. - f.isOneWay = f.isOneWay || len(f.decomp) > 2 - - if form == FCompatibility { - f.isOneWay = f.isOneWay || hasCompatDecomp(c.codePoint) - } - - for _, r := range f.decomp { - chars[r].forms[form].inDecomp = true - } - } - - // Phase 2: forward and backward combining. - for i := range chars { - c := &chars[i] - f := &c.forms[form] - - if !f.isOneWay && len(f.decomp) == 2 { - f0 := &chars[f.decomp[0]].forms[form] - f1 := &chars[f.decomp[1]].forms[form] - if !f0.isOneWay { - f0.combinesForward = true - } - if !f1.isOneWay { - f1.combinesBackward = true - } - } - if isHangulWithoutJamoT(rune(i)) { - f.combinesForward = true - } - } - - // Phase 3: quick check values. - for i := range chars { - c := &chars[i] - f := &c.forms[form] - - switch { - case len(f.decomp) > 0: - f.quickCheck[MDecomposed] = QCNo - case isHangul(rune(i)): - f.quickCheck[MDecomposed] = QCNo - default: - f.quickCheck[MDecomposed] = QCYes - } - switch { - case f.isOneWay: - f.quickCheck[MComposed] = QCNo - case (i & 0xffff00) == JamoLBase: - f.quickCheck[MComposed] = QCYes - if JamoLBase <= i && i < JamoLEnd { - f.combinesForward = true - } - if JamoVBase <= i && i < JamoVEnd { - f.quickCheck[MComposed] = QCMaybe - f.combinesBackward = true - f.combinesForward = true - } - if JamoTBase <= i && i < JamoTEnd { - f.quickCheck[MComposed] = QCMaybe - f.combinesBackward = true - } - case !f.combinesBackward: - f.quickCheck[MComposed] = QCYes - default: - f.quickCheck[MComposed] = QCMaybe - } - } -} - -func computeNonStarterCounts() { - // Phase 4: leading and trailing non-starter count - for i := range chars { - c := &chars[i] - - runes := []rune{rune(i)} - // We always use FCompatibility so that the CGJ insertion points do not - // change for repeated normalizations with different forms. - if exp := c.forms[FCompatibility].expandedDecomp; len(exp) > 0 { - runes = exp - } - // We consider runes that combine backwards to be non-starters for the - // purpose of Stream-Safe Text Processing. - for _, r := range runes { - if cr := &chars[r]; cr.ccc == 0 && !cr.forms[FCompatibility].combinesBackward { - break - } - c.nLeadingNonStarters++ - } - for i := len(runes) - 1; i >= 0; i-- { - if cr := &chars[runes[i]]; cr.ccc == 0 && !cr.forms[FCompatibility].combinesBackward { - break - } - c.nTrailingNonStarters++ - } - if c.nTrailingNonStarters > 3 { - log.Fatalf("%U: Decomposition with more than 3 (%d) trailing modifiers (%U)", i, c.nTrailingNonStarters, runes) - } - - if isHangul(rune(i)) { - c.nTrailingNonStarters = 2 - if isHangulWithoutJamoT(rune(i)) { - c.nTrailingNonStarters = 1 - } - } - - if l, t := c.nLeadingNonStarters, c.nTrailingNonStarters; l > 0 && l != t { - log.Fatalf("%U: number of leading and trailing non-starters should be equal (%d vs %d)", i, l, t) - } - if t := c.nTrailingNonStarters; t > 3 { - log.Fatalf("%U: number of trailing non-starters is %d > 3", t) - } - } -} - -func printBytes(w io.Writer, b []byte, name string) { - fmt.Fprintf(w, "// %s: %d bytes\n", name, len(b)) - fmt.Fprintf(w, "var %s = [...]byte {", name) - for i, c := range b { - switch { - case i%64 == 0: - fmt.Fprintf(w, "\n// Bytes %x - %x\n", i, i+63) - case i%8 == 0: - fmt.Fprintf(w, "\n") - } - fmt.Fprintf(w, "0x%.2X, ", c) - } - fmt.Fprint(w, "\n}\n\n") -} - -// See forminfo.go for format. -func makeEntry(f *FormInfo, c *Char) uint16 { - e := uint16(0) - if r := c.codePoint; HangulBase <= r && r < HangulEnd { - e |= 0x40 - } - if f.combinesForward { - e |= 0x20 - } - if f.quickCheck[MDecomposed] == QCNo { - e |= 0x4 - } - switch f.quickCheck[MComposed] { - case QCYes: - case QCNo: - e |= 0x10 - case QCMaybe: - e |= 0x18 - default: - log.Fatalf("Illegal quickcheck value %v.", f.quickCheck[MComposed]) - } - e |= uint16(c.nTrailingNonStarters) - return e -} - -// decompSet keeps track of unique decompositions, grouped by whether -// the decomposition is followed by a trailing and/or leading CCC. -type decompSet [7]map[string]bool - -const ( - normalDecomp = iota - firstMulti - firstCCC - endMulti - firstLeadingCCC - firstCCCZeroExcept - firstStarterWithNLead - lastDecomp -) - -var cname = []string{"firstMulti", "firstCCC", "endMulti", "firstLeadingCCC", "firstCCCZeroExcept", "firstStarterWithNLead", "lastDecomp"} - -func makeDecompSet() decompSet { - m := decompSet{} - for i := range m { - m[i] = make(map[string]bool) - } - return m -} -func (m *decompSet) insert(key int, s string) { - m[key][s] = true -} - -func printCharInfoTables(w io.Writer) int { - mkstr := func(r rune, f *FormInfo) (int, string) { - d := f.expandedDecomp - s := string([]rune(d)) - if max := 1 << 6; len(s) >= max { - const msg = "%U: too many bytes in decomposition: %d >= %d" - log.Fatalf(msg, r, len(s), max) - } - head := uint8(len(s)) - if f.quickCheck[MComposed] != QCYes { - head |= 0x40 - } - if f.combinesForward { - head |= 0x80 - } - s = string([]byte{head}) + s - - lccc := ccc(d[0]) - tccc := ccc(d[len(d)-1]) - cc := ccc(r) - if cc != 0 && lccc == 0 && tccc == 0 { - log.Fatalf("%U: trailing and leading ccc are 0 for non-zero ccc %d", r, cc) - } - if tccc < lccc && lccc != 0 { - const msg = "%U: lccc (%d) must be <= tcc (%d)" - log.Fatalf(msg, r, lccc, tccc) - } - index := normalDecomp - nTrail := chars[r].nTrailingNonStarters - if tccc > 0 || lccc > 0 || nTrail > 0 { - tccc <<= 2 - tccc |= nTrail - s += string([]byte{tccc}) - index = endMulti - for _, r := range d[1:] { - if ccc(r) == 0 { - index = firstCCC - } - } - if lccc > 0 { - s += string([]byte{lccc}) - if index == firstCCC { - log.Fatalf("%U: multi-segment decomposition not supported for decompositions with leading CCC != 0", r) - } - index = firstLeadingCCC - } - if cc != lccc { - if cc != 0 { - log.Fatalf("%U: for lccc != ccc, expected ccc to be 0; was %d", r, cc) - } - index = firstCCCZeroExcept - } - } else if len(d) > 1 { - index = firstMulti - } - return index, s - } - - decompSet := makeDecompSet() - const nLeadStr = "\x00\x01" // 0-byte length and tccc with nTrail. - decompSet.insert(firstStarterWithNLead, nLeadStr) - - // Store the uniqued decompositions in a byte buffer, - // preceded by their byte length. - for _, c := range chars { - for _, f := range c.forms { - if len(f.expandedDecomp) == 0 { - continue - } - if f.combinesBackward { - log.Fatalf("%U: combinesBackward and decompose", c.codePoint) - } - index, s := mkstr(c.codePoint, &f) - decompSet.insert(index, s) - } - } - - decompositions := bytes.NewBuffer(make([]byte, 0, 10000)) - size := 0 - positionMap := make(map[string]uint16) - decompositions.WriteString("\000") - fmt.Fprintln(w, "const (") - for i, m := range decompSet { - sa := []string{} - for s := range m { - sa = append(sa, s) - } - sort.Strings(sa) - for _, s := range sa { - p := decompositions.Len() - decompositions.WriteString(s) - positionMap[s] = uint16(p) - } - if cname[i] != "" { - fmt.Fprintf(w, "%s = 0x%X\n", cname[i], decompositions.Len()) - } - } - fmt.Fprintln(w, "maxDecomp = 0x8000") - fmt.Fprintln(w, ")") - b := decompositions.Bytes() - printBytes(w, b, "decomps") - size += len(b) - - varnames := []string{"nfc", "nfkc"} - for i := 0; i < FNumberOfFormTypes; i++ { - trie := triegen.NewTrie(varnames[i]) - - for r, c := range chars { - f := c.forms[i] - d := f.expandedDecomp - if len(d) != 0 { - _, key := mkstr(c.codePoint, &f) - trie.Insert(rune(r), uint64(positionMap[key])) - if c.ccc != ccc(d[0]) { - // We assume the lead ccc of a decomposition !=0 in this case. - if ccc(d[0]) == 0 { - log.Fatalf("Expected leading CCC to be non-zero; ccc is %d", c.ccc) - } - } - } else if c.nLeadingNonStarters > 0 && len(f.expandedDecomp) == 0 && c.ccc == 0 && !f.combinesBackward { - // Handle cases where it can't be detected that the nLead should be equal - // to nTrail. - trie.Insert(c.codePoint, uint64(positionMap[nLeadStr])) - } else if v := makeEntry(&f, &c)<<8 | uint16(c.ccc); v != 0 { - trie.Insert(c.codePoint, uint64(0x8000|v)) - } - } - sz, err := trie.Gen(w, triegen.Compact(&normCompacter{name: varnames[i]})) - if err != nil { - log.Fatal(err) - } - size += sz - } - return size -} - -func contains(sa []string, s string) bool { - for _, a := range sa { - if a == s { - return true - } - } - return false -} - -func makeTables() { - w := &bytes.Buffer{} - - size := 0 - if *tablelist == "" { - return - } - list := strings.Split(*tablelist, ",") - if *tablelist == "all" { - list = []string{"recomp", "info"} - } - - // Compute maximum decomposition size. - max := 0 - for _, c := range chars { - if n := len(string(c.forms[FCompatibility].expandedDecomp)); n > max { - max = n - } - } - - fmt.Fprintln(w, "const (") - fmt.Fprintln(w, "\t// Version is the Unicode edition from which the tables are derived.") - fmt.Fprintf(w, "\tVersion = %q\n", gen.UnicodeVersion()) - fmt.Fprintln(w) - fmt.Fprintln(w, "\t// MaxTransformChunkSize indicates the maximum number of bytes that Transform") - fmt.Fprintln(w, "\t// may need to write atomically for any Form. Making a destination buffer at") - fmt.Fprintln(w, "\t// least this size ensures that Transform can always make progress and that") - fmt.Fprintln(w, "\t// the user does not need to grow the buffer on an ErrShortDst.") - fmt.Fprintf(w, "\tMaxTransformChunkSize = %d+maxNonStarters*4\n", len(string(0x034F))+max) - fmt.Fprintln(w, ")\n") - - // Print the CCC remap table. - size += len(cccMap) - fmt.Fprintf(w, "var ccc = [%d]uint8{", len(cccMap)) - for i := 0; i < len(cccMap); i++ { - if i%8 == 0 { - fmt.Fprintln(w) - } - fmt.Fprintf(w, "%3d, ", cccMap[uint8(i)]) - } - fmt.Fprintln(w, "\n}\n") - - if contains(list, "info") { - size += printCharInfoTables(w) - } - - if contains(list, "recomp") { - // Note that we use 32 bit keys, instead of 64 bit. - // This clips the bits of three entries, but we know - // this won't cause a collision. The compiler will catch - // any changes made to UnicodeData.txt that introduces - // a collision. - // Note that the recomposition map for NFC and NFKC - // are identical. - - // Recomposition map - nrentries := 0 - for _, c := range chars { - f := c.forms[FCanonical] - if !f.isOneWay && len(f.decomp) > 0 { - nrentries++ - } - } - sz := nrentries * 8 - size += sz - fmt.Fprintf(w, "// recompMap: %d bytes (entries only)\n", sz) - fmt.Fprintln(w, "var recompMap = map[uint32]rune{") - for i, c := range chars { - f := c.forms[FCanonical] - d := f.decomp - if !f.isOneWay && len(d) > 0 { - key := uint32(uint16(d[0]))<<16 + uint32(uint16(d[1])) - fmt.Fprintf(w, "0x%.8X: 0x%.4X,\n", key, i) - } - } - fmt.Fprintf(w, "}\n\n") - } - - fmt.Fprintf(w, "// Total size of tables: %dKB (%d bytes)\n", (size+512)/1024, size) - gen.WriteGoFile("tables.go", "norm", w.Bytes()) -} - -func printChars() { - if *verbose { - for _, c := range chars { - if !c.isValid() || c.state == SMissing { - continue - } - fmt.Println(c) - } - } -} - -// verifyComputed does various consistency tests. -func verifyComputed() { - for i, c := range chars { - for _, f := range c.forms { - isNo := (f.quickCheck[MDecomposed] == QCNo) - if (len(f.decomp) > 0) != isNo && !isHangul(rune(i)) { - log.Fatalf("%U: NF*D QC must be No if rune decomposes", i) - } - - isMaybe := f.quickCheck[MComposed] == QCMaybe - if f.combinesBackward != isMaybe { - log.Fatalf("%U: NF*C QC must be Maybe if combinesBackward", i) - } - if len(f.decomp) > 0 && f.combinesForward && isMaybe { - log.Fatalf("%U: NF*C QC must be Yes or No if combinesForward and decomposes", i) - } - - if len(f.expandedDecomp) != 0 { - continue - } - if a, b := c.nLeadingNonStarters > 0, (c.ccc > 0 || f.combinesBackward); a != b { - // We accept these runes to be treated differently (it only affects - // segment breaking in iteration, most likely on improper use), but - // reconsider if more characters are added. - // U+FF9E HALFWIDTH KATAKANA VOICED SOUND MARK;Lm;0;L; 3099;;;;N;;;;; - // U+FF9F HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK;Lm;0;L; 309A;;;;N;;;;; - // U+3133 HANGUL LETTER KIYEOK-SIOS;Lo;0;L; 11AA;;;;N;HANGUL LETTER GIYEOG SIOS;;;; - // U+318E HANGUL LETTER ARAEAE;Lo;0;L; 11A1;;;;N;HANGUL LETTER ALAE AE;;;; - // U+FFA3 HALFWIDTH HANGUL LETTER KIYEOK-SIOS;Lo;0;L; 3133;;;;N;HALFWIDTH HANGUL LETTER GIYEOG SIOS;;;; - // U+FFDC HALFWIDTH HANGUL LETTER I;Lo;0;L; 3163;;;;N;;;;; - if i != 0xFF9E && i != 0xFF9F && !(0x3133 <= i && i <= 0x318E) && !(0xFFA3 <= i && i <= 0xFFDC) { - log.Fatalf("%U: nLead was %v; want %v", i, a, b) - } - } - } - nfc := c.forms[FCanonical] - nfkc := c.forms[FCompatibility] - if nfc.combinesBackward != nfkc.combinesBackward { - log.Fatalf("%U: Cannot combine combinesBackward\n", c.codePoint) - } - } -} - -// Use values in DerivedNormalizationProps.txt to compare against the -// values we computed. -// DerivedNormalizationProps.txt has form: -// 00C0..00C5 ; NFD_QC; N # ... -// 0374 ; NFD_QC; N # ... -// See http://unicode.org/reports/tr44/ for full explanation -func testDerived() { - f := gen.OpenUCDFile("DerivedNormalizationProps.txt") - defer f.Close() - p := ucd.New(f) - for p.Next() { - r := p.Rune(0) - c := &chars[r] - - var ftype, mode int - qt := p.String(1) - switch qt { - case "NFC_QC": - ftype, mode = FCanonical, MComposed - case "NFD_QC": - ftype, mode = FCanonical, MDecomposed - case "NFKC_QC": - ftype, mode = FCompatibility, MComposed - case "NFKD_QC": - ftype, mode = FCompatibility, MDecomposed - default: - continue - } - var qr QCResult - switch p.String(2) { - case "Y": - qr = QCYes - case "N": - qr = QCNo - case "M": - qr = QCMaybe - default: - log.Fatalf(`Unexpected quick check value "%s"`, p.String(2)) - } - if got := c.forms[ftype].quickCheck[mode]; got != qr { - log.Printf("%U: FAILED %s (was %v need %v)\n", r, qt, got, qr) - } - c.forms[ftype].verified[mode] = true - } - if err := p.Err(); err != nil { - log.Fatal(err) - } - // Any unspecified value must be QCYes. Verify this. - for i, c := range chars { - for j, fd := range c.forms { - for k, qr := range fd.quickCheck { - if !fd.verified[k] && qr != QCYes { - m := "%U: FAIL F:%d M:%d (was %v need Yes) %s\n" - log.Printf(m, i, j, k, qr, c.name) - } - } - } - } -} - -var testHeader = `const ( - Yes = iota - No - Maybe -) - -type formData struct { - qc uint8 - combinesForward bool - decomposition string -} - -type runeData struct { - r rune - ccc uint8 - nLead uint8 - nTrail uint8 - f [2]formData // 0: canonical; 1: compatibility -} - -func f(qc uint8, cf bool, dec string) [2]formData { - return [2]formData{{qc, cf, dec}, {qc, cf, dec}} -} - -func g(qc, qck uint8, cf, cfk bool, d, dk string) [2]formData { - return [2]formData{{qc, cf, d}, {qck, cfk, dk}} -} - -var testData = []runeData{ -` - -func printTestdata() { - type lastInfo struct { - ccc uint8 - nLead uint8 - nTrail uint8 - f string - } - - last := lastInfo{} - w := &bytes.Buffer{} - fmt.Fprintf(w, testHeader) - for r, c := range chars { - f := c.forms[FCanonical] - qc, cf, d := f.quickCheck[MComposed], f.combinesForward, string(f.expandedDecomp) - f = c.forms[FCompatibility] - qck, cfk, dk := f.quickCheck[MComposed], f.combinesForward, string(f.expandedDecomp) - s := "" - if d == dk && qc == qck && cf == cfk { - s = fmt.Sprintf("f(%s, %v, %q)", qc, cf, d) - } else { - s = fmt.Sprintf("g(%s, %s, %v, %v, %q, %q)", qc, qck, cf, cfk, d, dk) - } - current := lastInfo{c.ccc, c.nLeadingNonStarters, c.nTrailingNonStarters, s} - if last != current { - fmt.Fprintf(w, "\t{0x%x, %d, %d, %d, %s},\n", r, c.origCCC, c.nLeadingNonStarters, c.nTrailingNonStarters, s) - last = current - } - } - fmt.Fprintln(w, "}") - gen.WriteGoFile("data_test.go", "norm", w.Bytes()) -} diff --git a/vendor/golang.org/x/text/unicode/norm/triegen.go b/vendor/golang.org/x/text/unicode/norm/triegen.go deleted file mode 100644 index 45d7119..0000000 --- a/vendor/golang.org/x/text/unicode/norm/triegen.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Trie table generator. -// Used by make*tables tools to generate a go file with trie data structures -// for mapping UTF-8 to a 16-bit value. All but the last byte in a UTF-8 byte -// sequence are used to lookup offsets in the index table to be used for the -// next byte. The last byte is used to index into a table with 16-bit values. - -package main - -import ( - "fmt" - "io" -) - -const maxSparseEntries = 16 - -type normCompacter struct { - sparseBlocks [][]uint64 - sparseOffset []uint16 - sparseCount int - name string -} - -func mostFrequentStride(a []uint64) int { - counts := make(map[int]int) - var v int - for _, x := range a { - if stride := int(x) - v; v != 0 && stride >= 0 { - counts[stride]++ - } - v = int(x) - } - var maxs, maxc int - for stride, cnt := range counts { - if cnt > maxc || (cnt == maxc && stride < maxs) { - maxs, maxc = stride, cnt - } - } - return maxs -} - -func countSparseEntries(a []uint64) int { - stride := mostFrequentStride(a) - var v, count int - for _, tv := range a { - if int(tv)-v != stride { - if tv != 0 { - count++ - } - } - v = int(tv) - } - return count -} - -func (c *normCompacter) Size(v []uint64) (sz int, ok bool) { - if n := countSparseEntries(v); n <= maxSparseEntries { - return (n+1)*4 + 2, true - } - return 0, false -} - -func (c *normCompacter) Store(v []uint64) uint32 { - h := uint32(len(c.sparseOffset)) - c.sparseBlocks = append(c.sparseBlocks, v) - c.sparseOffset = append(c.sparseOffset, uint16(c.sparseCount)) - c.sparseCount += countSparseEntries(v) + 1 - return h -} - -func (c *normCompacter) Handler() string { - return c.name + "Sparse.lookup" -} - -func (c *normCompacter) Print(w io.Writer) (retErr error) { - p := func(f string, x ...interface{}) { - if _, err := fmt.Fprintf(w, f, x...); retErr == nil && err != nil { - retErr = err - } - } - - ls := len(c.sparseBlocks) - p("// %sSparseOffset: %d entries, %d bytes\n", c.name, ls, ls*2) - p("var %sSparseOffset = %#v\n\n", c.name, c.sparseOffset) - - ns := c.sparseCount - p("// %sSparseValues: %d entries, %d bytes\n", c.name, ns, ns*4) - p("var %sSparseValues = [%d]valueRange {", c.name, ns) - for i, b := range c.sparseBlocks { - p("\n// Block %#x, offset %#x", i, c.sparseOffset[i]) - var v int - stride := mostFrequentStride(b) - n := countSparseEntries(b) - p("\n{value:%#04x,lo:%#02x},", stride, uint8(n)) - for i, nv := range b { - if int(nv)-v != stride { - if v != 0 { - p(",hi:%#02x},", 0x80+i-1) - } - if nv != 0 { - p("\n{value:%#04x,lo:%#02x", nv, 0x80+i) - } - } - v = int(nv) - } - if v != 0 { - p(",hi:%#02x},", 0x80+len(b)-1) - } - } - p("\n}\n\n") - return -} diff --git a/vendor/gopkg.in/yaml.v2/.travis.yml b/vendor/gopkg.in/yaml.v2/.travis.yml new file mode 100644 index 0000000..004172a --- /dev/null +++ b/vendor/gopkg.in/yaml.v2/.travis.yml @@ -0,0 +1,9 @@ +language: go + +go: + - 1.4 + - 1.5 + - 1.6 + - tip + +go_import_path: gopkg.in/yaml.v2 diff --git a/vendor/modules.txt b/vendor/modules.txt new file mode 100644 index 0000000..e4be647 --- /dev/null +++ b/vendor/modules.txt @@ -0,0 +1,93 @@ +# github.com/VividCortex/godaemon v0.0.0-20131002161106-2fdf3f9fa715 +## explicit +github.com/VividCortex/godaemon +# github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2 +## explicit +github.com/davecgh/go-spew/spew +# github.com/fsnotify/fsnotify v1.3.2-0.20160816051541-f12c6236fe7b +## explicit +github.com/fsnotify/fsnotify +# github.com/hashicorp/hcl v0.0.0-20160902165219-99df0eb941dd +## explicit +github.com/hashicorp/hcl +github.com/hashicorp/hcl/hcl/ast +github.com/hashicorp/hcl/hcl/parser +github.com/hashicorp/hcl/hcl/scanner +github.com/hashicorp/hcl/hcl/strconv +github.com/hashicorp/hcl/hcl/token +github.com/hashicorp/hcl/json/parser +github.com/hashicorp/hcl/json/scanner +github.com/hashicorp/hcl/json/token +# github.com/howbazaar/loggo v0.0.0-20131030201820-384be4108823 +## explicit +github.com/howbazaar/loggo +# github.com/kr/fs v0.0.0-20131111012553-2788f0dbd169 +## explicit +github.com/kr/fs +# github.com/magiconair/properties v1.7.1-0.20160908093658-0723e352fa35 +## explicit +github.com/magiconair/properties +# github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee +## explicit +github.com/mitchellh/mapstructure +# github.com/nightlyone/lockfile v0.0.0-20160306143149-b30dcbfa86e3 +## explicit +github.com/nightlyone/lockfile +# github.com/papertrail/go-tail v0.0.0-20170801201234-1b77c8dfcc6b +## explicit +github.com/papertrail/go-tail/follower +# github.com/pelletier/go-buffruneio v0.1.0 +## explicit +github.com/pelletier/go-buffruneio +# github.com/pelletier/go-toml v0.3.6-0.20160906202557-31055c2ff0bb +## explicit +github.com/pelletier/go-toml +# github.com/pkg/errors v0.7.1 +## explicit +github.com/pkg/errors +# github.com/pkg/sftp v0.0.0-20160908100035-8197a2e58073 +## explicit +github.com/pkg/sftp +# github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0 +## explicit +github.com/pmezard/go-difflib/difflib +# github.com/spf13/afero v0.0.0-20160821083612-20500e2abd0d +## explicit +github.com/spf13/afero +github.com/spf13/afero/mem +github.com/spf13/afero/sftp +# github.com/spf13/cast v0.0.0-20160730092037-e31f36ffc91a +## explicit +github.com/spf13/cast +# github.com/spf13/jwalterweatherman v0.0.0-20160311093646-33c24e77fb80 +## explicit +github.com/spf13/jwalterweatherman +# github.com/spf13/pflag v0.0.0-20160906134334-6fd2ff4ff8df +## explicit +github.com/spf13/pflag +# github.com/spf13/viper v0.0.0-20160830143246-16990631d4aa +## explicit +github.com/spf13/viper +# github.com/stretchr/testify v1.1.4-0.20160615092844-d77da356e56a +## explicit +github.com/stretchr/testify/assert +# golang.org/x/crypto v0.0.0-20160909120217-05d11b2ca141 +## explicit +golang.org/x/crypto/curve25519 +golang.org/x/crypto/ed25519 +golang.org/x/crypto/ed25519/internal/edwards25519 +golang.org/x/crypto/ssh +# golang.org/x/sys v0.0.0-20160429193239-b776ec39b3e5 +## explicit +golang.org/x/sys/unix +# golang.org/x/text v0.0.0-20160908145610-1e65e9bf72c3 +## explicit +golang.org/x/text/transform +golang.org/x/text/unicode/norm +# gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c +## explicit; go 1.11 +# gopkg.in/yaml.v2 v2.0.0-20160715033755-e4d366fc3c79 +## explicit +gopkg.in/yaml.v2 +# launchpad.net/gocheck v0.0.0-20140225173054-000000000087 +## explicit diff --git a/vendor/vendor.json b/vendor/vendor.json deleted file mode 100644 index 546dd57..0000000 --- a/vendor/vendor.json +++ /dev/null @@ -1,244 +0,0 @@ -{ - "comment": "", - "ignore": "test", - "package": [ - { - "checksumSHA1": "eZTp4vwxqwMmVW6cPrW0SjXizl8=", - "path": "github.com/VividCortex/godaemon", - "revision": "2fdf3f9fa715a998e834f09e07a8070d9046bcfd" - }, - { - "checksumSHA1": "5rPfda8jFccr3A6heL+JAmi9K9g=", - "origin": "github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew", - "path": "github.com/davecgh/go-spew/spew", - "revision": "d77da356e56a7428ad25149ca77381849a6a5232", - "revisionTime": "2016-06-15T09:26:46Z" - }, - { - "checksumSHA1": "xgjI2W3RGiQwNlxsOW2V9fJ9kaM=", - "path": "github.com/fsnotify/fsnotify", - "revision": "f12c6236fe7b5cf6bcf30e5935d08cb079d78334", - "revisionTime": "2016-08-16T05:15:41Z" - }, - { - "checksumSHA1": "fa9G5tEr4oJJc3vtgn/B0NWZXfA=", - "path": "github.com/hashicorp/hcl", - "revision": "99df0eb941dd8ddbc83d3f3605a34f6a686ac85e", - "revisionTime": "2016-09-02T16:52:19Z" - }, - { - "checksumSHA1": "67DfevLBglV52Y2eAuhFc/xQni0=", - "path": "github.com/hashicorp/hcl/hcl/ast", - "revision": "99df0eb941dd8ddbc83d3f3605a34f6a686ac85e", - "revisionTime": "2016-09-02T16:52:19Z" - }, - { - "checksumSHA1": "l2oQxBsZRwn6eZjf+whXr8c9+8c=", - "path": "github.com/hashicorp/hcl/hcl/parser", - "revision": "99df0eb941dd8ddbc83d3f3605a34f6a686ac85e", - "revisionTime": "2016-09-02T16:52:19Z" - }, - { - "checksumSHA1": "lgR7PSAZ0RtvAc9OCtCnNsF/x8g=", - "path": "github.com/hashicorp/hcl/hcl/scanner", - "revision": "99df0eb941dd8ddbc83d3f3605a34f6a686ac85e", - "revisionTime": "2016-09-02T16:52:19Z" - }, - { - "checksumSHA1": "JlZmnzqdmFFyb1+2afLyR3BOE/8=", - "path": "github.com/hashicorp/hcl/hcl/strconv", - "revision": "99df0eb941dd8ddbc83d3f3605a34f6a686ac85e", - "revisionTime": "2016-09-02T16:52:19Z" - }, - { - "checksumSHA1": "c6yprzj06ASwCo18TtbbNNBHljA=", - "path": "github.com/hashicorp/hcl/hcl/token", - "revision": "99df0eb941dd8ddbc83d3f3605a34f6a686ac85e", - "revisionTime": "2016-09-02T16:52:19Z" - }, - { - "checksumSHA1": "jQ45CCc1ed/nlV7bbSnx6z72q1M=", - "path": "github.com/hashicorp/hcl/json/parser", - "revision": "99df0eb941dd8ddbc83d3f3605a34f6a686ac85e", - "revisionTime": "2016-09-02T16:52:19Z" - }, - { - "checksumSHA1": "YdvFsNOMSWMLnY6fcliWQa0O5Fw=", - "path": "github.com/hashicorp/hcl/json/scanner", - "revision": "99df0eb941dd8ddbc83d3f3605a34f6a686ac85e", - "revisionTime": "2016-09-02T16:52:19Z" - }, - { - "checksumSHA1": "fNlXQCQEnb+B3k5UDL/r15xtSJY=", - "path": "github.com/hashicorp/hcl/json/token", - "revision": "99df0eb941dd8ddbc83d3f3605a34f6a686ac85e", - "revisionTime": "2016-09-02T16:52:19Z" - }, - { - "checksumSHA1": "gowwzqNquz7l1XQtQt9rdcRiYNs=", - "path": "github.com/howbazaar/loggo", - "revision": "384be41088235af6d26ba66786fd23c45b2d5311" - }, - { - "checksumSHA1": "lBSuhMhBepn0ViDDaqHmLIKMPL0=", - "path": "github.com/howbazaar/loggo/example", - "revision": "384be41088235af6d26ba66786fd23c45b2d5311" - }, - { - "checksumSHA1": "KQhA4EQp4Ldwj9nJZnEURlE6aQw=", - "path": "github.com/kr/fs", - "revision": "2788f0dbd16903de03cb8186e5c7d97b69ad387b", - "revisionTime": "2013-11-06T22:25:44Z" - }, - { - "checksumSHA1": "S6PDDQMYaKwLDIP/NsRYb4FRAqQ=", - "path": "github.com/magiconair/properties", - "revision": "0723e352fa358f9322c938cc2dadda874e9151a9", - "revisionTime": "2016-09-08T09:36:58Z" - }, - { - "checksumSHA1": "LUrnGREfnifW4WDMaavmc9MlLI0=", - "path": "github.com/mitchellh/mapstructure", - "revision": "ca63d7c062ee3c9f34db231e352b60012b4fd0c1", - "revisionTime": "2016-08-08T18:12:53Z" - }, - { - "checksumSHA1": "JKQ8SPnOodRAk6+QJycVAeYSiSs=", - "path": "github.com/nightlyone/lockfile", - "revision": "b30dcbfa86e3a1eaa4e6622de2ce57be2c138c10" - }, - { - "checksumSHA1": "yVIJdaWkoUJbEhvujesED4rqAnE=", - "path": "github.com/papertrail/go-tail/follower", - "revision": "1b77c8dfcc6baca12dedfab119135396782b68a1", - "revisionTime": "2017-08-01T20:12:34Z" - }, - { - "checksumSHA1": "8Y05Pz7onrQPcVWW6JStSsYRh6E=", - "path": "github.com/pelletier/go-buffruneio", - "revision": "df1e16fde7fc330a0ca68167c23bf7ed6ac31d6d", - "revisionTime": "2016-01-24T19:35:03Z" - }, - { - "checksumSHA1": "8p2QlEz7wJdeT4RQINh1mQgB0YQ=", - "path": "github.com/pelletier/go-toml", - "revision": "31055c2ff0bb0c7f9095aec0d220aed21108121e", - "revisionTime": "2016-09-06T20:25:57Z" - }, - { - "checksumSHA1": "Hky3u+8Rqum+wB5BHMj0A8ZmT4g=", - "path": "github.com/pkg/errors", - "revision": "17b591df37844cde689f4d5813e5cea0927d8dd2", - "revisionTime": "2016-08-22T09:00:10Z" - }, - { - "checksumSHA1": "v6/DDmWObvEsdMvLe+KfuBVSNtg=", - "path": "github.com/pkg/sftp", - "revision": "8197a2e580736b78d704be0fc47b2324c0591a32", - "revisionTime": "2016-09-08T10:00:35Z" - }, - { - "checksumSHA1": "zKKp5SZ3d3ycKe4EKMNT0BqAWBw=", - "origin": "github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib", - "path": "github.com/pmezard/go-difflib/difflib", - "revision": "d77da356e56a7428ad25149ca77381849a6a5232", - "revisionTime": "2016-06-15T09:26:46Z" - }, - { - "checksumSHA1": "59wTbS4fE2282Q88NrBYImbFGbo=", - "path": "github.com/spf13/afero", - "revision": "20500e2abd0d1f4564a499e83d11d6c73cd58c27", - "revisionTime": "2016-08-21T08:36:12Z" - }, - { - "checksumSHA1": "S29tnboEqKV8/ghlvDzaqtJJD7E=", - "path": "github.com/spf13/afero/mem", - "revision": "20500e2abd0d1f4564a499e83d11d6c73cd58c27", - "revisionTime": "2016-08-21T08:36:12Z" - }, - { - "checksumSHA1": "sLyAUiIT7V0DNVp6yBhW4Ms5BEs=", - "path": "github.com/spf13/afero/sftp", - "revision": "20500e2abd0d1f4564a499e83d11d6c73cd58c27", - "revisionTime": "2016-08-21T08:36:12Z" - }, - { - "checksumSHA1": "F5PKdeFzODdoAChY/aEiEDaNWtQ=", - "path": "github.com/spf13/cast", - "revision": "e31f36ffc91a2ba9ddb72a4b6a607ff9b3d3cb63", - "revisionTime": "2016-07-30T09:20:37Z" - }, - { - "checksumSHA1": "dkruahfhuLXXuyeCuRpsWlcRK+8=", - "path": "github.com/spf13/jwalterweatherman", - "revision": "33c24e77fb80341fe7130ee7c594256ff08ccc46", - "revisionTime": "2016-03-01T12:00:06Z" - }, - { - "checksumSHA1": "Sp+FJO5FwU3ps3jSHTMDTnRe9ws=", - "path": "github.com/spf13/pflag", - "revision": "6fd2ff4ff8dfcdf5556fbdc0ac0284408274b1a7", - "revisionTime": "2016-09-06T13:43:34Z" - }, - { - "checksumSHA1": "AEhbo+ngM14A/E4LwHOspRTrpJk=", - "path": "github.com/spf13/viper", - "revision": "16990631d4aa7e38f73dbbbf37fa13e67c648531", - "revisionTime": "2016-08-30T14:32:46Z" - }, - { - "checksumSHA1": "iydUphwYqZRq3WhstEdGsbvBAKs=", - "path": "github.com/stretchr/testify/assert", - "revision": "d77da356e56a7428ad25149ca77381849a6a5232", - "revisionTime": "2016-06-15T09:26:46Z" - }, - { - "checksumSHA1": "h+pFYiRHBogczS8/F1NoN3Ata44=", - "path": "golang.org/x/crypto/curve25519", - "revision": "05d11b2ca14108dfc7f74f4f66b28c7fe92e1fd0", - "revisionTime": "2016-09-03T07:54:54Z" - }, - { - "checksumSHA1": "wGb//LjBPNxYHqk+dcLo7BjPXK8=", - "path": "golang.org/x/crypto/ed25519", - "revision": "05d11b2ca14108dfc7f74f4f66b28c7fe92e1fd0", - "revisionTime": "2016-09-03T07:54:54Z" - }, - { - "checksumSHA1": "LXFcVx8I587SnWmKycSDEq9yvK8=", - "path": "golang.org/x/crypto/ed25519/internal/edwards25519", - "revision": "05d11b2ca14108dfc7f74f4f66b28c7fe92e1fd0", - "revisionTime": "2016-09-03T07:54:54Z" - }, - { - "checksumSHA1": "pXOcpeiBjX3zbVKeg0pvYnEmtqU=", - "path": "golang.org/x/crypto/ssh", - "revision": "05d11b2ca14108dfc7f74f4f66b28c7fe92e1fd0", - "revisionTime": "2016-09-03T07:54:54Z" - }, - { - "checksumSHA1": "CoRxz7vk573Zu/UcMS4PzpAsv3w=", - "path": "golang.org/x/sys/unix", - "revision": "b776ec39b3e54652e09028aaaaac9757f4f8211a" - }, - { - "checksumSHA1": "TZDHZj3zWDc5LKqpoLamOKt6Nmo=", - "path": "golang.org/x/text/transform", - "revision": "1e65e9bf72c307081cea196f47ef37aed17eb316", - "revisionTime": "2016-08-30T12:50:59Z" - }, - { - "checksumSHA1": "pDDMc5yLVQ2xeR9CajcgIJODPcw=", - "path": "golang.org/x/text/unicode/norm", - "revision": "1e65e9bf72c307081cea196f47ef37aed17eb316", - "revisionTime": "2016-08-30T12:50:59Z" - }, - { - "checksumSHA1": "yV+2de12Q/t09hBGYGKEOFr1/zc=", - "path": "gopkg.in/yaml.v2", - "revision": "e4d366fc3c7938e2958e662b4258c7a89e1f0e3e", - "revisionTime": "2016-07-15T03:37:55Z" - } - ], - "rootPath": "github.com/papertrail/remote_syslog2" -} From cb74f9fc86bd6f43735918a93bef43010acccfc7 Mon Sep 17 00:00:00 2001 From: Mark Dascher Date: Fri, 12 Nov 2021 16:43:05 -0500 Subject: [PATCH 2/3] pin gox version --- Makefile | 2 +- README.md | 2 +- go.mod | 3 + go.sum | 6 + tools.go | 5 + .../hashicorp/go-version/.travis.yml | 13 + .../github.com/hashicorp/go-version/LICENSE | 354 +++++++++++++++++ .../github.com/hashicorp/go-version/README.md | 65 +++ .../hashicorp/go-version/constraint.go | 204 ++++++++++ .../hashicorp/go-version/version.go | 347 ++++++++++++++++ .../go-version/version_collection.go | 17 + .../github.com/mitchellh/gox/.gitattributes | 1 + vendor/github.com/mitchellh/gox/.gitignore | 1 + vendor/github.com/mitchellh/gox/.travis.yml | 15 + vendor/github.com/mitchellh/gox/Gopkg.lock | 15 + vendor/github.com/mitchellh/gox/Gopkg.toml | 26 ++ vendor/github.com/mitchellh/gox/LICENSE | 374 ++++++++++++++++++ vendor/github.com/mitchellh/gox/README.md | 95 +++++ vendor/github.com/mitchellh/gox/appveyor.yml | 19 + .../github.com/mitchellh/gox/env_override.go | 17 + vendor/github.com/mitchellh/gox/go.go | 233 +++++++++++ vendor/github.com/mitchellh/gox/main.go | 262 ++++++++++++ .../github.com/mitchellh/gox/main_osarch.go | 19 + vendor/github.com/mitchellh/gox/platform.go | 149 +++++++ .../github.com/mitchellh/gox/platform_flag.go | 272 +++++++++++++ vendor/github.com/mitchellh/gox/toolchain.go | 148 +++++++ vendor/github.com/mitchellh/iochan/LICENSE.md | 21 + vendor/github.com/mitchellh/iochan/README.md | 13 + vendor/github.com/mitchellh/iochan/iochan.go | 41 ++ vendor/modules.txt | 9 + 30 files changed, 2746 insertions(+), 2 deletions(-) create mode 100644 tools.go create mode 100644 vendor/github.com/hashicorp/go-version/.travis.yml create mode 100644 vendor/github.com/hashicorp/go-version/LICENSE create mode 100644 vendor/github.com/hashicorp/go-version/README.md create mode 100644 vendor/github.com/hashicorp/go-version/constraint.go create mode 100644 vendor/github.com/hashicorp/go-version/version.go create mode 100644 vendor/github.com/hashicorp/go-version/version_collection.go create mode 100644 vendor/github.com/mitchellh/gox/.gitattributes create mode 100644 vendor/github.com/mitchellh/gox/.gitignore create mode 100644 vendor/github.com/mitchellh/gox/.travis.yml create mode 100644 vendor/github.com/mitchellh/gox/Gopkg.lock create mode 100644 vendor/github.com/mitchellh/gox/Gopkg.toml create mode 100644 vendor/github.com/mitchellh/gox/LICENSE create mode 100644 vendor/github.com/mitchellh/gox/README.md create mode 100644 vendor/github.com/mitchellh/gox/appveyor.yml create mode 100644 vendor/github.com/mitchellh/gox/env_override.go create mode 100644 vendor/github.com/mitchellh/gox/go.go create mode 100644 vendor/github.com/mitchellh/gox/main.go create mode 100644 vendor/github.com/mitchellh/gox/main_osarch.go create mode 100644 vendor/github.com/mitchellh/gox/platform.go create mode 100644 vendor/github.com/mitchellh/gox/platform_flag.go create mode 100644 vendor/github.com/mitchellh/gox/toolchain.go create mode 100644 vendor/github.com/mitchellh/iochan/LICENSE.md create mode 100644 vendor/github.com/mitchellh/iochan/README.md create mode 100644 vendor/github.com/mitchellh/iochan/iochan.go diff --git a/Makefile b/Makefile index 3494b1a..bb4e15c 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ endif type gox >/dev/null 2>&1 || { \ echo "\033[1;33mGox is not installed. See https://github.com/mitchellh/gox\033[m"; \ - echo "$$ go install github.com/mitchellh/gox@latest"; \ + echo "$$ go install github.com/mitchellh/gox"; \ exit 1; \ } diff --git a/README.md b/README.md index e2d1fe5..0afe0ab 100644 --- a/README.md +++ b/README.md @@ -351,7 +351,7 @@ remote_syslog2 is written in go, and uses [govendor] to manage dependencies. To get everything set up, [install go][goinstall] then run: - go install github.com/mitchellh/gox@latest + go install github.com/mitchellh/gox git clone git@github.com:papertrail/remote_syslog2.git To run tests: diff --git a/go.mod b/go.mod index 3f2e1df..440e6a5 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.17 require ( github.com/VividCortex/godaemon v0.0.0-20131002161106-2fdf3f9fa715 github.com/howbazaar/loggo v0.0.0-20131030201820-384be4108823 + github.com/mitchellh/gox v1.0.1 github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee github.com/nightlyone/lockfile v0.0.0-20160306143149-b30dcbfa86e3 github.com/papertrail/go-tail v0.0.0-20170801201234-1b77c8dfcc6b @@ -16,9 +17,11 @@ require ( require ( github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2 // indirect github.com/fsnotify/fsnotify v1.3.2-0.20160816051541-f12c6236fe7b // indirect + github.com/hashicorp/go-version v1.0.0 // indirect github.com/hashicorp/hcl v0.0.0-20160902165219-99df0eb941dd // indirect github.com/kr/fs v0.0.0-20131111012553-2788f0dbd169 // indirect github.com/magiconair/properties v1.7.1-0.20160908093658-0723e352fa35 // indirect + github.com/mitchellh/iochan v1.0.0 // indirect github.com/pelletier/go-buffruneio v0.1.0 // indirect github.com/pelletier/go-toml v0.3.6-0.20160906202557-31055c2ff0bb // indirect github.com/pkg/errors v0.7.1 // indirect diff --git a/go.sum b/go.sum index d34bc8a..e1368e9 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,8 @@ github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2 h1:5zdDAMuB3gvbHB1 github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fsnotify/fsnotify v1.3.2-0.20160816051541-f12c6236fe7b h1:clQtr7BsnoijdumdhlbbOGglPb1lIAJ3yTPjYOHlKdQ= github.com/fsnotify/fsnotify v1.3.2-0.20160816051541-f12c6236fe7b/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/hashicorp/go-version v1.0.0 h1:21MVWPKDphxa7ineQQTrCU5brh7OuVVAzGOCnnCPtE8= +github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hcl v0.0.0-20160902165219-99df0eb941dd h1:84QdurP28/GTPuAXatiouvNyhN9dflZY9KtMbatmupI= github.com/hashicorp/hcl v0.0.0-20160902165219-99df0eb941dd/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/howbazaar/loggo v0.0.0-20131030201820-384be4108823 h1:RHchVj0Y4ojcJuXS6laqCtJtYq1HtFaRNyIGrPW3H3s= @@ -17,6 +19,10 @@ 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/magiconair/properties v1.7.1-0.20160908093658-0723e352fa35 h1:WtkHGe1cgg+lvDj9p5CvjXrfopsIss0vIAz+/zeYZyQ= github.com/magiconair/properties v1.7.1-0.20160908093658-0723e352fa35/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI= +github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= +github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee h1:kK7VuFVykgt0LfMSloWYjDOt4TnOcL0AxF0/rDq2VkM= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/nightlyone/lockfile v0.0.0-20160306143149-b30dcbfa86e3 h1:0n5k3UgMD17uNYeNw3njqRyfeCFemdDXbqkZzLTlNlw= diff --git a/tools.go b/tools.go new file mode 100644 index 0000000..c496d6a --- /dev/null +++ b/tools.go @@ -0,0 +1,5 @@ +//go:build tools + +package tools + +import _ "github.com/mitchellh/gox" diff --git a/vendor/github.com/hashicorp/go-version/.travis.yml b/vendor/github.com/hashicorp/go-version/.travis.yml new file mode 100644 index 0000000..542ca8b --- /dev/null +++ b/vendor/github.com/hashicorp/go-version/.travis.yml @@ -0,0 +1,13 @@ +language: go + +go: + - 1.0 + - 1.1 + - 1.2 + - 1.3 + - 1.4 + - 1.9 + - "1.10" + +script: + - go test diff --git a/vendor/github.com/hashicorp/go-version/LICENSE b/vendor/github.com/hashicorp/go-version/LICENSE new file mode 100644 index 0000000..c33dcc7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-version/LICENSE @@ -0,0 +1,354 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. “Contributor” + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. “Contributor Version” + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + + means Covered Software of a particular Contributor. + +1.4. “Covered Software” + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. “Incompatible With Secondary Licenses” + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version + 1.1 or earlier of the License, but not also under the terms of a + Secondary License. + +1.6. “Executable Form” + + means any form of the work other than Source Code Form. + +1.7. “Larger Work” + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + +1.8. “License” + + means this document. + +1.9. “Licensable” + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed by + this License. + +1.10. “Modifications” + + means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + + means any patent claim(s), including without limitation, method, process, + and apparatus claims, in any patent Licensable by such Contributor that + would be infringed, but for the grant of the License, by the making, + using, selling, offering for sale, having made, import, or transfer of + either its Contributions or its Contributor Version. + +1.12. “Secondary License” + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + + means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + + means an individual or a legal entity exercising rights under this + License. For legal entities, “You” includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, “control” means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or as + part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its Contributions + or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding Section + 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the + notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this License + (see Section 10.2) or under the terms of a Secondary License (if permitted + under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions + are its original creation(s) or it has sufficient rights to grant the + rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form + of the Covered Software is governed by the terms of this License, and how + they can obtain a copy of this License. You may not attempt to alter or + restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, + or sublicense it under different terms, provided that the license for + the Executable Form does not attempt to limit or alter the recipients’ + rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software + with a work governed by one or more Secondary Licenses, and the Covered + Software is not Incompatible With Secondary Licenses, this License permits + You to additionally distribute such Covered Software under the terms of + such Secondary License(s), so that the recipient of the Larger Work may, at + their option, further distribute the Covered Software under the terms of + either this License or such Secondary License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations + of liability) contained within the Source Code Form of the Covered + Software, except that You may alter any license notices to the extent + required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on behalf + of any Contributor. You must make it absolutely clear that any such + warranty, support, indemnity, or liability obligation is offered by You + alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, judicial + order, or regulation then You must: (a) comply with the terms of this License + to the maximum extent possible; and (b) describe the limitations and the code + they affect. Such description must be placed in a text file included with all + distributions of the Covered Software under this License. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing basis, + if such Contributor fails to notify You of the non-compliance by some + reasonable means prior to 60 days after You have come back into compliance. + Moreover, Your grants from a particular Contributor are reinstated on an + ongoing basis if such Contributor notifies You of the non-compliance by + some reasonable means, this is the first time You have received notice of + non-compliance with this License from such Contributor, and You become + compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, + and cross-claims) alleging that a Contributor Version directly or + indirectly infringes any patent, then the rights granted to You by any and + all Contributors for the Covered Software under Section 2.1 of this License + shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without + warranty of any kind, either expressed, implied, or statutory, including, + without limitation, warranties that the Covered Software is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the Covered Software is with You. + Should any Covered Software prove defective in any respect, You (not any + Contributor) assume the cost of any necessary servicing, repair, or + correction. This disclaimer of warranty constitutes an essential part of this + License. No use of any Covered Software is authorized under this License + except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from such + party’s negligence to the extent applicable law prohibits such limitation. + Some jurisdictions do not allow the exclusion or limitation of incidental or + consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts of + a jurisdiction where the defendant maintains its principal place of business + and such litigation shall be governed by laws of that jurisdiction, without + reference to its conflict-of-law provisions. Nothing in this Section shall + prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject matter + hereof. If any provision of this License is held to be unenforceable, such + provision shall be reformed only to the extent necessary to make it + enforceable. Any law or regulation which provides that the language of a + contract shall be construed against the drafter shall not be used to construe + this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of + the License under which You originally received the Covered Software, or + under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a modified + version of this License if you rename the license and remove any + references to the name of the license steward (except to note that such + modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the + notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + 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/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible + With Secondary Licenses”, as defined by + the Mozilla Public License, v. 2.0. + diff --git a/vendor/github.com/hashicorp/go-version/README.md b/vendor/github.com/hashicorp/go-version/README.md new file mode 100644 index 0000000..6f3a15c --- /dev/null +++ b/vendor/github.com/hashicorp/go-version/README.md @@ -0,0 +1,65 @@ +# Versioning Library for Go +[![Build Status](https://travis-ci.org/hashicorp/go-version.svg?branch=master)](https://travis-ci.org/hashicorp/go-version) + +go-version is a library for parsing versions and version constraints, +and verifying versions against a set of constraints. go-version +can sort a collection of versions properly, handles prerelease/beta +versions, can increment versions, etc. + +Versions used with go-version must follow [SemVer](http://semver.org/). + +## Installation and Usage + +Package documentation can be found on +[GoDoc](http://godoc.org/github.com/hashicorp/go-version). + +Installation can be done with a normal `go get`: + +``` +$ go get github.com/hashicorp/go-version +``` + +#### Version Parsing and Comparison + +```go +v1, err := version.NewVersion("1.2") +v2, err := version.NewVersion("1.5+metadata") + +// Comparison example. There is also GreaterThan, Equal, and just +// a simple Compare that returns an int allowing easy >=, <=, etc. +if v1.LessThan(v2) { + fmt.Printf("%s is less than %s", v1, v2) +} +``` + +#### Version Constraints + +```go +v1, err := version.NewVersion("1.2") + +// Constraints example. +constraints, err := version.NewConstraint(">= 1.0, < 1.4") +if constraints.Check(v1) { + fmt.Printf("%s satisfies constraints %s", v1, constraints) +} +``` + +#### Version Sorting + +```go +versionsRaw := []string{"1.1", "0.7.1", "1.4-beta", "1.4", "2"} +versions := make([]*version.Version, len(versionsRaw)) +for i, raw := range versionsRaw { + v, _ := version.NewVersion(raw) + versions[i] = v +} + +// After this, the versions are properly sorted +sort.Sort(version.Collection(versions)) +``` + +## Issues and Contributing + +If you find an issue with this library, please report an issue. If you'd +like, we welcome any contributions. Fork this library and submit a pull +request. diff --git a/vendor/github.com/hashicorp/go-version/constraint.go b/vendor/github.com/hashicorp/go-version/constraint.go new file mode 100644 index 0000000..d055759 --- /dev/null +++ b/vendor/github.com/hashicorp/go-version/constraint.go @@ -0,0 +1,204 @@ +package version + +import ( + "fmt" + "reflect" + "regexp" + "strings" +) + +// Constraint represents a single constraint for a version, such as +// ">= 1.0". +type Constraint struct { + f constraintFunc + check *Version + original string +} + +// Constraints is a slice of constraints. We make a custom type so that +// we can add methods to it. +type Constraints []*Constraint + +type constraintFunc func(v, c *Version) bool + +var constraintOperators map[string]constraintFunc + +var constraintRegexp *regexp.Regexp + +func init() { + constraintOperators = map[string]constraintFunc{ + "": constraintEqual, + "=": constraintEqual, + "!=": constraintNotEqual, + ">": constraintGreaterThan, + "<": constraintLessThan, + ">=": constraintGreaterThanEqual, + "<=": constraintLessThanEqual, + "~>": constraintPessimistic, + } + + ops := make([]string, 0, len(constraintOperators)) + for k := range constraintOperators { + ops = append(ops, regexp.QuoteMeta(k)) + } + + constraintRegexp = regexp.MustCompile(fmt.Sprintf( + `^\s*(%s)\s*(%s)\s*$`, + strings.Join(ops, "|"), + VersionRegexpRaw)) +} + +// NewConstraint will parse one or more constraints from the given +// constraint string. The string must be a comma-separated list of +// constraints. +func NewConstraint(v string) (Constraints, error) { + vs := strings.Split(v, ",") + result := make([]*Constraint, len(vs)) + for i, single := range vs { + c, err := parseSingle(single) + if err != nil { + return nil, err + } + + result[i] = c + } + + return Constraints(result), nil +} + +// Check tests if a version satisfies all the constraints. +func (cs Constraints) Check(v *Version) bool { + for _, c := range cs { + if !c.Check(v) { + return false + } + } + + return true +} + +// Returns the string format of the constraints +func (cs Constraints) String() string { + csStr := make([]string, len(cs)) + for i, c := range cs { + csStr[i] = c.String() + } + + return strings.Join(csStr, ",") +} + +// Check tests if a constraint is validated by the given version. +func (c *Constraint) Check(v *Version) bool { + return c.f(v, c.check) +} + +func (c *Constraint) String() string { + return c.original +} + +func parseSingle(v string) (*Constraint, error) { + matches := constraintRegexp.FindStringSubmatch(v) + if matches == nil { + return nil, fmt.Errorf("Malformed constraint: %s", v) + } + + check, err := NewVersion(matches[2]) + if err != nil { + return nil, err + } + + return &Constraint{ + f: constraintOperators[matches[1]], + check: check, + original: v, + }, nil +} + +func prereleaseCheck(v, c *Version) bool { + switch vPre, cPre := v.Prerelease() != "", c.Prerelease() != ""; { + case cPre && vPre: + // A constraint with a pre-release can only match a pre-release version + // with the same base segments. + return reflect.DeepEqual(c.Segments64(), v.Segments64()) + + case !cPre && vPre: + // A constraint without a pre-release can only match a version without a + // pre-release. + return false + + case cPre && !vPre: + // OK, except with the pessimistic operator + case !cPre && !vPre: + // OK + } + return true +} + +//------------------------------------------------------------------- +// Constraint functions +//------------------------------------------------------------------- + +func constraintEqual(v, c *Version) bool { + return v.Equal(c) +} + +func constraintNotEqual(v, c *Version) bool { + return !v.Equal(c) +} + +func constraintGreaterThan(v, c *Version) bool { + return prereleaseCheck(v, c) && v.Compare(c) == 1 +} + +func constraintLessThan(v, c *Version) bool { + return prereleaseCheck(v, c) && v.Compare(c) == -1 +} + +func constraintGreaterThanEqual(v, c *Version) bool { + return prereleaseCheck(v, c) && v.Compare(c) >= 0 +} + +func constraintLessThanEqual(v, c *Version) bool { + return prereleaseCheck(v, c) && v.Compare(c) <= 0 +} + +func constraintPessimistic(v, c *Version) bool { + // Using a pessimistic constraint with a pre-release, restricts versions to pre-releases + if !prereleaseCheck(v, c) || (c.Prerelease() != "" && v.Prerelease() == "") { + return false + } + + // If the version being checked is naturally less than the constraint, then there + // is no way for the version to be valid against the constraint + if v.LessThan(c) { + return false + } + // We'll use this more than once, so grab the length now so it's a little cleaner + // to write the later checks + cs := len(c.segments) + + // If the version being checked has less specificity than the constraint, then there + // is no way for the version to be valid against the constraint + if cs > len(v.segments) { + return false + } + + // Check the segments in the constraint against those in the version. If the version + // being checked, at any point, does not have the same values in each index of the + // constraints segments, then it cannot be valid against the constraint. + for i := 0; i < c.si-1; i++ { + if v.segments[i] != c.segments[i] { + return false + } + } + + // Check the last part of the segment in the constraint. If the version segment at + // this index is less than the constraints segment at this index, then it cannot + // be valid against the constraint + if c.segments[cs-1] > v.segments[cs-1] { + return false + } + + // If nothing has rejected the version by now, it's valid + return true +} diff --git a/vendor/github.com/hashicorp/go-version/version.go b/vendor/github.com/hashicorp/go-version/version.go new file mode 100644 index 0000000..4d1e6e2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-version/version.go @@ -0,0 +1,347 @@ +package version + +import ( + "bytes" + "fmt" + "reflect" + "regexp" + "strconv" + "strings" +) + +// The compiled regular expression used to test the validity of a version. +var versionRegexp *regexp.Regexp + +// The raw regular expression string used for testing the validity +// of a version. +const VersionRegexpRaw string = `v?([0-9]+(\.[0-9]+)*?)` + + `(-([0-9]+[0-9A-Za-z\-~]*(\.[0-9A-Za-z\-~]+)*)|(-?([A-Za-z\-~]+[0-9A-Za-z\-~]*(\.[0-9A-Za-z\-~]+)*)))?` + + `(\+([0-9A-Za-z\-~]+(\.[0-9A-Za-z\-~]+)*))?` + + `?` + +// Version represents a single version. +type Version struct { + metadata string + pre string + segments []int64 + si int + original string +} + +func init() { + versionRegexp = regexp.MustCompile("^" + VersionRegexpRaw + "$") +} + +// NewVersion parses the given version and returns a new +// Version. +func NewVersion(v string) (*Version, error) { + matches := versionRegexp.FindStringSubmatch(v) + if matches == nil { + return nil, fmt.Errorf("Malformed version: %s", v) + } + segmentsStr := strings.Split(matches[1], ".") + segments := make([]int64, len(segmentsStr)) + si := 0 + for i, str := range segmentsStr { + val, err := strconv.ParseInt(str, 10, 64) + if err != nil { + return nil, fmt.Errorf( + "Error parsing version: %s", err) + } + + segments[i] = int64(val) + si++ + } + + // Even though we could support more than three segments, if we + // got less than three, pad it with 0s. This is to cover the basic + // default usecase of semver, which is MAJOR.MINOR.PATCH at the minimum + for i := len(segments); i < 3; i++ { + segments = append(segments, 0) + } + + pre := matches[7] + if pre == "" { + pre = matches[4] + } + + return &Version{ + metadata: matches[10], + pre: pre, + segments: segments, + si: si, + original: v, + }, nil +} + +// Must is a helper that wraps a call to a function returning (*Version, error) +// and panics if error is non-nil. +func Must(v *Version, err error) *Version { + if err != nil { + panic(err) + } + + return v +} + +// Compare compares this version to another version. This +// returns -1, 0, or 1 if this version is smaller, equal, +// or larger than the other version, respectively. +// +// If you want boolean results, use the LessThan, Equal, +// or GreaterThan methods. +func (v *Version) Compare(other *Version) int { + // A quick, efficient equality check + if v.String() == other.String() { + return 0 + } + + segmentsSelf := v.Segments64() + segmentsOther := other.Segments64() + + // If the segments are the same, we must compare on prerelease info + if reflect.DeepEqual(segmentsSelf, segmentsOther) { + preSelf := v.Prerelease() + preOther := other.Prerelease() + if preSelf == "" && preOther == "" { + return 0 + } + if preSelf == "" { + return 1 + } + if preOther == "" { + return -1 + } + + return comparePrereleases(preSelf, preOther) + } + + // Get the highest specificity (hS), or if they're equal, just use segmentSelf length + lenSelf := len(segmentsSelf) + lenOther := len(segmentsOther) + hS := lenSelf + if lenSelf < lenOther { + hS = lenOther + } + // Compare the segments + // Because a constraint could have more/less specificity than the version it's + // checking, we need to account for a lopsided or jagged comparison + for i := 0; i < hS; i++ { + if i > lenSelf-1 { + // This means Self had the lower specificity + // Check to see if the remaining segments in Other are all zeros + if !allZero(segmentsOther[i:]) { + // if not, it means that Other has to be greater than Self + return -1 + } + break + } else if i > lenOther-1 { + // this means Other had the lower specificity + // Check to see if the remaining segments in Self are all zeros - + if !allZero(segmentsSelf[i:]) { + //if not, it means that Self has to be greater than Other + return 1 + } + break + } + lhs := segmentsSelf[i] + rhs := segmentsOther[i] + if lhs == rhs { + continue + } else if lhs < rhs { + return -1 + } + // Otherwis, rhs was > lhs, they're not equal + return 1 + } + + // if we got this far, they're equal + return 0 +} + +func allZero(segs []int64) bool { + for _, s := range segs { + if s != 0 { + return false + } + } + return true +} + +func comparePart(preSelf string, preOther string) int { + if preSelf == preOther { + return 0 + } + + var selfInt int64 + selfNumeric := true + selfInt, err := strconv.ParseInt(preSelf, 10, 64) + if err != nil { + selfNumeric = false + } + + var otherInt int64 + otherNumeric := true + otherInt, err = strconv.ParseInt(preOther, 10, 64) + if err != nil { + otherNumeric = false + } + + // if a part is empty, we use the other to decide + if preSelf == "" { + if otherNumeric { + return -1 + } + return 1 + } + + if preOther == "" { + if selfNumeric { + return 1 + } + return -1 + } + + if selfNumeric && !otherNumeric { + return -1 + } else if !selfNumeric && otherNumeric { + return 1 + } else if !selfNumeric && !otherNumeric && preSelf > preOther { + return 1 + } else if selfInt > otherInt { + return 1 + } + + return -1 +} + +func comparePrereleases(v string, other string) int { + // the same pre release! + if v == other { + return 0 + } + + // split both pre releases for analyse their parts + selfPreReleaseMeta := strings.Split(v, ".") + otherPreReleaseMeta := strings.Split(other, ".") + + selfPreReleaseLen := len(selfPreReleaseMeta) + otherPreReleaseLen := len(otherPreReleaseMeta) + + biggestLen := otherPreReleaseLen + if selfPreReleaseLen > otherPreReleaseLen { + biggestLen = selfPreReleaseLen + } + + // loop for parts to find the first difference + for i := 0; i < biggestLen; i = i + 1 { + partSelfPre := "" + if i < selfPreReleaseLen { + partSelfPre = selfPreReleaseMeta[i] + } + + partOtherPre := "" + if i < otherPreReleaseLen { + partOtherPre = otherPreReleaseMeta[i] + } + + compare := comparePart(partSelfPre, partOtherPre) + // if parts are equals, continue the loop + if compare != 0 { + return compare + } + } + + return 0 +} + +// Equal tests if two versions are equal. +func (v *Version) Equal(o *Version) bool { + return v.Compare(o) == 0 +} + +// GreaterThan tests if this version is greater than another version. +func (v *Version) GreaterThan(o *Version) bool { + return v.Compare(o) > 0 +} + +// LessThan tests if this version is less than another version. +func (v *Version) LessThan(o *Version) bool { + return v.Compare(o) < 0 +} + +// Metadata returns any metadata that was part of the version +// string. +// +// Metadata is anything that comes after the "+" in the version. +// For example, with "1.2.3+beta", the metadata is "beta". +func (v *Version) Metadata() string { + return v.metadata +} + +// Prerelease returns any prerelease data that is part of the version, +// or blank if there is no prerelease data. +// +// Prerelease information is anything that comes after the "-" in the +// version (but before any metadata). For example, with "1.2.3-beta", +// the prerelease information is "beta". +func (v *Version) Prerelease() string { + return v.pre +} + +// Segments returns the numeric segments of the version as a slice of ints. +// +// This excludes any metadata or pre-release information. For example, +// for a version "1.2.3-beta", segments will return a slice of +// 1, 2, 3. +func (v *Version) Segments() []int { + segmentSlice := make([]int, len(v.segments)) + for i, v := range v.segments { + segmentSlice[i] = int(v) + } + return segmentSlice +} + +// Segments64 returns the numeric segments of the version as a slice of int64s. +// +// This excludes any metadata or pre-release information. For example, +// for a version "1.2.3-beta", segments will return a slice of +// 1, 2, 3. +func (v *Version) Segments64() []int64 { + result := make([]int64, len(v.segments)) + copy(result, v.segments) + return result +} + +// String returns the full version string included pre-release +// and metadata information. +// +// This value is rebuilt according to the parsed segments and other +// information. Therefore, ambiguities in the version string such as +// prefixed zeroes (1.04.0 => 1.4.0), `v` prefix (v1.0.0 => 1.0.0), and +// missing parts (1.0 => 1.0.0) will be made into a canonicalized form +// as shown in the parenthesized examples. +func (v *Version) String() string { + var buf bytes.Buffer + fmtParts := make([]string, len(v.segments)) + for i, s := range v.segments { + // We can ignore err here since we've pre-parsed the values in segments + str := strconv.FormatInt(s, 10) + fmtParts[i] = str + } + fmt.Fprintf(&buf, strings.Join(fmtParts, ".")) + if v.pre != "" { + fmt.Fprintf(&buf, "-%s", v.pre) + } + if v.metadata != "" { + fmt.Fprintf(&buf, "+%s", v.metadata) + } + + return buf.String() +} + +// Original returns the original parsed version as-is, including any +// potential whitespace, `v` prefix, etc. +func (v *Version) Original() string { + return v.original +} diff --git a/vendor/github.com/hashicorp/go-version/version_collection.go b/vendor/github.com/hashicorp/go-version/version_collection.go new file mode 100644 index 0000000..cc888d4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-version/version_collection.go @@ -0,0 +1,17 @@ +package version + +// Collection is a type that implements the sort.Interface interface +// so that versions can be sorted. +type Collection []*Version + +func (v Collection) Len() int { + return len(v) +} + +func (v Collection) Less(i, j int) bool { + return v[i].LessThan(v[j]) +} + +func (v Collection) Swap(i, j int) { + v[i], v[j] = v[j], v[i] +} diff --git a/vendor/github.com/mitchellh/gox/.gitattributes b/vendor/github.com/mitchellh/gox/.gitattributes new file mode 100644 index 0000000..9acf740 --- /dev/null +++ b/vendor/github.com/mitchellh/gox/.gitattributes @@ -0,0 +1 @@ +* text diff --git a/vendor/github.com/mitchellh/gox/.gitignore b/vendor/github.com/mitchellh/gox/.gitignore new file mode 100644 index 0000000..68c6339 --- /dev/null +++ b/vendor/github.com/mitchellh/gox/.gitignore @@ -0,0 +1 @@ +gox diff --git a/vendor/github.com/mitchellh/gox/.travis.yml b/vendor/github.com/mitchellh/gox/.travis.yml new file mode 100644 index 0000000..e525380 --- /dev/null +++ b/vendor/github.com/mitchellh/gox/.travis.yml @@ -0,0 +1,15 @@ +language: go + +go: + - 1.6.x + - 1.7.x + - 1.8.x + - 1.9.x + - 1.10.x + - 1.11.x + - tip + +script: + - go test ./... + +go_import_path: github.com/mitchellh/gox diff --git a/vendor/github.com/mitchellh/gox/Gopkg.lock b/vendor/github.com/mitchellh/gox/Gopkg.lock new file mode 100644 index 0000000..ee67d68 --- /dev/null +++ b/vendor/github.com/mitchellh/gox/Gopkg.lock @@ -0,0 +1,15 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + branch = "master" + name = "github.com/mitchellh/iochan" + packages = ["."] + revision = "87b45ffd0e9581375c491fef3d32130bb15c5bd7" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "d7653d046a1e4d3471559a7d216e5a479923b8a706d83a6464e582a851ef2b98" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/vendor/github.com/mitchellh/gox/Gopkg.toml b/vendor/github.com/mitchellh/gox/Gopkg.toml new file mode 100644 index 0000000..3ba01f1 --- /dev/null +++ b/vendor/github.com/mitchellh/gox/Gopkg.toml @@ -0,0 +1,26 @@ + +# Gopkg.toml example +# +# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" + + +[[constraint]] + branch = "master" + name = "github.com/mitchellh/iochan" diff --git a/vendor/github.com/mitchellh/gox/LICENSE b/vendor/github.com/mitchellh/gox/LICENSE new file mode 100644 index 0000000..2f8ed18 --- /dev/null +++ b/vendor/github.com/mitchellh/gox/LICENSE @@ -0,0 +1,374 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + 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/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. + diff --git a/vendor/github.com/mitchellh/gox/README.md b/vendor/github.com/mitchellh/gox/README.md new file mode 100644 index 0000000..cb3f27d --- /dev/null +++ b/vendor/github.com/mitchellh/gox/README.md @@ -0,0 +1,95 @@ +# Gox - Simple Go Cross Compilation + +Gox is a simple, no-frills tool for Go cross compilation that behaves a +lot like standard `go build`. Gox will parallelize builds for multiple +platforms. Gox will also build the cross-compilation toolchain for you. + +## Installation + +To install Gox, please use `go get`. We tag versions so feel free to +checkout that tag and compile. + +``` +$ go get github.com/mitchellh/gox +... +$ gox -h +... +``` + +## Usage + +If you know how to use `go build`, then you know how to use Gox. For +example, to build the current package, specify no parameters and just +call `gox`. Gox will parallelize based on the number of CPUs you have +by default and build for every platform by default: + +``` +$ gox +Number of parallel builds: 4 + +--> darwin/386: github.com/mitchellh/gox +--> darwin/amd64: github.com/mitchellh/gox +--> linux/386: github.com/mitchellh/gox +--> linux/amd64: github.com/mitchellh/gox +--> linux/arm: github.com/mitchellh/gox +--> freebsd/386: github.com/mitchellh/gox +--> freebsd/amd64: github.com/mitchellh/gox +--> openbsd/386: github.com/mitchellh/gox +--> openbsd/amd64: github.com/mitchellh/gox +--> windows/386: github.com/mitchellh/gox +--> windows/amd64: github.com/mitchellh/gox +--> freebsd/arm: github.com/mitchellh/gox +--> netbsd/386: github.com/mitchellh/gox +--> netbsd/amd64: github.com/mitchellh/gox +--> netbsd/arm: github.com/mitchellh/gox +--> plan9/386: github.com/mitchellh/gox +``` + +Or, if you want to build a package and sub-packages: + +``` +$ gox ./... +... +``` + +Or, if you want to build multiple distinct packages: + +``` +$ gox github.com/mitchellh/gox github.com/hashicorp/serf +... +``` + +Or if you want to just build for linux: + +``` +$ gox -os="linux" +... +``` + +Or maybe you just want to build for 64-bit linux: + +``` +$ gox -osarch="linux/amd64" +... +``` + +And more! Just run `gox -h` for help and additional information. + +## Versus Other Cross-Compile Tools + +A big thanks to these other options for existing. They each paved the +way in many aspects to make Go cross-compilation approachable. + +* [Dave Cheney's golang-crosscompile](https://github.com/davecheney/golang-crosscompile) - + Gox compiles for multiple platforms and can therefore easily run on + any platform Go supports, whereas Dave's scripts require a shell. Gox + will also parallelize builds. Dave's scripts build sequentially. Gox has + much easier to use OS/Arch filtering built in. + +* [goxc](https://github.com/laher/goxc) - + A very richly featured tool that can even do things such as build system + packages, upload binaries, generate download webpages, etc. Gox is a + super slim alternative that only cross-compiles binaries. Gox builds packages in parallel, whereas + goxc doesn't. Gox doesn't enforce a specific output structure for built + binaries. + diff --git a/vendor/github.com/mitchellh/gox/appveyor.yml b/vendor/github.com/mitchellh/gox/appveyor.yml new file mode 100644 index 0000000..934bcc9 --- /dev/null +++ b/vendor/github.com/mitchellh/gox/appveyor.yml @@ -0,0 +1,19 @@ + +version: build-{build}.{branch} + +clone_folder: C:\gopath\src\github.com\mitchellh\gox +shallow_clone: true + +environment: + GOPATH: C:\gopath + +platform: + - x64 + +test_script: + - go get ./... + - go test -v ./... + +build: off + +deploy: off diff --git a/vendor/github.com/mitchellh/gox/env_override.go b/vendor/github.com/mitchellh/gox/env_override.go new file mode 100644 index 0000000..8878505 --- /dev/null +++ b/vendor/github.com/mitchellh/gox/env_override.go @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "os" + "strings" +) + +// envOverride overrides the given target based on if there is a +// env var in the format of GOX_{OS}_{ARCH}_{KEY}. +func envOverride(target *string, platform Platform, key string) { + key = strings.ToUpper(fmt.Sprintf( + "GOX_%s_%s_%s", platform.OS, platform.Arch, key)) + if v := os.Getenv(key); v != "" { + *target = v + } +} diff --git a/vendor/github.com/mitchellh/gox/go.go b/vendor/github.com/mitchellh/gox/go.go new file mode 100644 index 0000000..2d25837 --- /dev/null +++ b/vendor/github.com/mitchellh/gox/go.go @@ -0,0 +1,233 @@ +package main + +import ( + "bytes" + "fmt" + "io/ioutil" + "log" + "os" + "os/exec" + "path/filepath" + "regexp" + "runtime" + "strings" + "text/template" +) + +type OutputTemplateData struct { + Dir string + OS string + Arch string +} + +type CompileOpts struct { + PackagePath string + Platform Platform + OutputTpl string + Ldflags string + Gcflags string + Asmflags string + Tags string + ModMode string + Cgo bool + Rebuild bool + GoCmd string +} + +// GoCrossCompile +func GoCrossCompile(opts *CompileOpts) error { + env := append(os.Environ(), + "GOOS="+opts.Platform.OS, + "GOARCH="+opts.Platform.Arch) + + // If we're building for our own platform, then enable cgo always. We + // respect the CGO_ENABLED flag if that is explicitly set on the platform. + if !opts.Cgo && os.Getenv("CGO_ENABLED") != "0" { + opts.Cgo = runtime.GOOS == opts.Platform.OS && + runtime.GOARCH == opts.Platform.Arch + } + + // If cgo is enabled then set that env var + if opts.Cgo { + env = append(env, "CGO_ENABLED=1") + } else { + env = append(env, "CGO_ENABLED=0") + } + + var outputPath bytes.Buffer + tpl, err := template.New("output").Parse(opts.OutputTpl) + if err != nil { + return err + } + tplData := OutputTemplateData{ + Dir: filepath.Base(opts.PackagePath), + OS: opts.Platform.OS, + Arch: opts.Platform.Arch, + } + if err := tpl.Execute(&outputPath, &tplData); err != nil { + return err + } + + if opts.Platform.OS == "windows" { + outputPath.WriteString(".exe") + } + + // Determine the full path to the output so that we can change our + // working directory when executing go build. + outputPathReal := outputPath.String() + outputPathReal, err = filepath.Abs(outputPathReal) + if err != nil { + return err + } + + // Go prefixes the import directory with '_' when it is outside + // the GOPATH.For this, we just drop it since we move to that + // directory to build. + chdir := "" + if opts.PackagePath[0] == '_' { + if runtime.GOOS == "windows" { + // We have to replace weird paths like this: + // + // _/c_/Users + // + // With: + // + // c:\Users + // + re := regexp.MustCompile("^/([a-zA-Z])_/") + chdir = re.ReplaceAllString(opts.PackagePath[1:], "$1:\\") + chdir = strings.Replace(chdir, "/", "\\", -1) + } else { + chdir = opts.PackagePath[1:] + } + + opts.PackagePath = "" + } + + args := []string{"build"} + if opts.Rebuild { + args = append(args, "-a") + } + if opts.ModMode != "" { + args = append(args, "-mod", opts.ModMode) + } + args = append(args, + "-gcflags", opts.Gcflags, + "-ldflags", opts.Ldflags, + "-asmflags", opts.Asmflags, + "-tags", opts.Tags, + "-o", outputPathReal, + opts.PackagePath) + + _, err = execGo(opts.GoCmd, env, chdir, args...) + return err +} + +// GoMainDirs returns the file paths to the packages that are "main" +// packages, from the list of packages given. The list of packages can +// include relative paths, the special "..." Go keyword, etc. +func GoMainDirs(packages []string, GoCmd string) ([]string, error) { + args := make([]string, 0, len(packages)+3) + args = append(args, "list", "-f", "{{.Name}}|{{.ImportPath}}") + args = append(args, packages...) + + output, err := execGo(GoCmd, nil, "", args...) + if err != nil { + return nil, err + } + + results := make([]string, 0, len(output)) + for _, line := range strings.Split(output, "\n") { + if line == "" { + continue + } + + parts := strings.SplitN(line, "|", 2) + if len(parts) != 2 { + log.Printf("Bad line reading packages: %s", line) + continue + } + + if parts[0] == "main" { + results = append(results, parts[1]) + } + } + + return results, nil +} + +// GoRoot returns the GOROOT value for the compiled `go` binary. +func GoRoot() (string, error) { + output, err := execGo("go", nil, "", "env", "GOROOT") + if err != nil { + return "", err + } + + return strings.TrimSpace(output), nil +} + +// GoVersion reads the version of `go` that is on the PATH. This is done +// instead of `runtime.Version()` because it is possible to run gox against +// another Go version. +func GoVersion() (string, error) { + // NOTE: We use `go run` instead of `go version` because the output + // of `go version` might change whereas the source is guaranteed to run + // for some time thanks to Go's compatibility guarantee. + + td, err := ioutil.TempDir("", "gox") + if err != nil { + return "", err + } + defer os.RemoveAll(td) + + // Write the source code for the program that will generate the version + sourcePath := filepath.Join(td, "version.go") + if err := ioutil.WriteFile(sourcePath, []byte(versionSource), 0644); err != nil { + return "", err + } + + // Execute and read the version, which will be the only thing on stdout. + return execGo("go", nil, "", "run", sourcePath) +} + +// GoVersionParts parses the version numbers from the version itself +// into major and minor: 1.5, 1.4, etc. +func GoVersionParts() (result [2]int, err error) { + version, err := GoVersion() + if err != nil { + return + } + + _, err = fmt.Sscanf(version, "go%d.%d", &result[0], &result[1]) + return +} + +func execGo(GoCmd string, env []string, dir string, args ...string) (string, error) { + var stderr, stdout bytes.Buffer + cmd := exec.Command(GoCmd, args...) + cmd.Stdout = &stdout + cmd.Stderr = &stderr + if env != nil { + cmd.Env = env + } + if dir != "" { + cmd.Dir = dir + } + if err := cmd.Run(); err != nil { + err = fmt.Errorf("%s\nStderr: %s", err, stderr.String()) + return "", err + } + + return stdout.String(), nil +} + +const versionSource = `package main + +import ( + "fmt" + "runtime" +) + +func main() { + fmt.Print(runtime.Version()) +}` diff --git a/vendor/github.com/mitchellh/gox/main.go b/vendor/github.com/mitchellh/gox/main.go new file mode 100644 index 0000000..9eca6a4 --- /dev/null +++ b/vendor/github.com/mitchellh/gox/main.go @@ -0,0 +1,262 @@ +package main + +import ( + "flag" + "fmt" + "os" + "os/exec" + "runtime" + "strings" + "sync" + + version "github.com/hashicorp/go-version" +) + +func main() { + // Call realMain so that defers work properly, since os.Exit won't + // call defers. + os.Exit(realMain()) +} + +func realMain() int { + var buildToolchain bool + var ldflags string + var outputTpl string + var parallel int + var platformFlag PlatformFlag + var tags string + var verbose bool + var flagGcflags, flagAsmflags string + var flagCgo, flagRebuild, flagListOSArch bool + var flagGoCmd string + var modMode string + flags := flag.NewFlagSet("gox", flag.ExitOnError) + flags.Usage = func() { printUsage() } + flags.Var(platformFlag.ArchFlagValue(), "arch", "arch to build for or skip") + flags.Var(platformFlag.OSArchFlagValue(), "osarch", "os/arch pairs to build for or skip") + flags.Var(platformFlag.OSFlagValue(), "os", "os to build for or skip") + flags.StringVar(&ldflags, "ldflags", "", "linker flags") + flags.StringVar(&tags, "tags", "", "go build tags") + flags.StringVar(&outputTpl, "output", "{{.Dir}}_{{.OS}}_{{.Arch}}", "output path") + flags.IntVar(¶llel, "parallel", -1, "parallelization factor") + flags.BoolVar(&buildToolchain, "build-toolchain", false, "build toolchain") + flags.BoolVar(&verbose, "verbose", false, "verbose") + flags.BoolVar(&flagCgo, "cgo", false, "") + flags.BoolVar(&flagRebuild, "rebuild", false, "") + flags.BoolVar(&flagListOSArch, "osarch-list", false, "") + flags.StringVar(&flagGcflags, "gcflags", "", "") + flags.StringVar(&flagAsmflags, "asmflags", "", "") + flags.StringVar(&flagGoCmd, "gocmd", "go", "") + flags.StringVar(&modMode, "mod", "", "") + if err := flags.Parse(os.Args[1:]); err != nil { + flags.Usage() + return 1 + } + + // Determine what amount of parallelism we want Default to the current + // number of CPUs-1 is <= 0 is specified. + if parallel <= 0 { + cpus := runtime.NumCPU() + if cpus < 2 { + parallel = 1 + } else { + parallel = cpus - 1 + } + + // Joyent containers report 48 cores via runtime.NumCPU(), and a + // default of 47 parallel builds causes a panic. Default to 3 on + // Solaris-derived operating systems unless overridden with the + // -parallel flag. + if runtime.GOOS == "solaris" { + parallel = 3 + } + } + + if buildToolchain { + return mainBuildToolchain(parallel, platformFlag, verbose) + } + + if _, err := exec.LookPath(flagGoCmd); err != nil { + fmt.Fprintf(os.Stderr, "%s executable must be on the PATH\n", + flagGoCmd) + return 1 + } + + versionStr, err := GoVersion() + if err != nil { + fmt.Fprintf(os.Stderr, "error reading Go version: %s", err) + return 1 + } + + if flagListOSArch { + return mainListOSArch(versionStr) + } + + // Determine the packages that we want to compile. Default to the + // current directory if none are specified. + packages := flags.Args() + if len(packages) == 0 { + packages = []string{"."} + } + + // Get the packages that are in the given paths + mainDirs, err := GoMainDirs(packages, flagGoCmd) + if err != nil { + fmt.Fprintf(os.Stderr, "Error reading packages: %s", err) + return 1 + } + + // Determine the platforms we're building for + platforms := platformFlag.Platforms(SupportedPlatforms(versionStr)) + if len(platforms) == 0 { + fmt.Println("No valid platforms to build for. If you specified a value") + fmt.Println("for the 'os', 'arch', or 'osarch' flags, make sure you're") + fmt.Println("using a valid value.") + return 1 + } + + // Assume -mod is supported when no version prefix is found + if modMode != "" && strings.HasPrefix(versionStr, "go") { + // go-version only cares about version numbers + current, err := version.NewVersion(versionStr[2:]) + if err != nil { + fmt.Fprintf(os.Stderr, "Unable to parse current go version: %s\n%s", versionStr, err.Error()) + return 1 + } + + constraint, err := version.NewConstraint(">= 1.11") + if err != nil { + panic(err) + } + + if !constraint.Check(current) { + fmt.Printf("Go compiler version %s does not support the -mod flag\n", versionStr) + modMode = "" + } + } + + // Build in parallel! + fmt.Printf("Number of parallel builds: %d\n\n", parallel) + var errorLock sync.Mutex + var wg sync.WaitGroup + errors := make([]string, 0) + semaphore := make(chan int, parallel) + for _, platform := range platforms { + for _, path := range mainDirs { + // Start the goroutine that will do the actual build + wg.Add(1) + go func(path string, platform Platform) { + defer wg.Done() + semaphore <- 1 + fmt.Printf("--> %15s: %s\n", platform.String(), path) + + opts := &CompileOpts{ + PackagePath: path, + Platform: platform, + OutputTpl: outputTpl, + Ldflags: ldflags, + Gcflags: flagGcflags, + Asmflags: flagAsmflags, + Tags: tags, + ModMode: modMode, + Cgo: flagCgo, + Rebuild: flagRebuild, + GoCmd: flagGoCmd, + } + + // Determine if we have specific CFLAGS or LDFLAGS for this + // GOOS/GOARCH combo and override the defaults if so. + envOverride(&opts.Ldflags, platform, "LDFLAGS") + envOverride(&opts.Gcflags, platform, "GCFLAGS") + envOverride(&opts.Asmflags, platform, "ASMFLAGS") + + if err := GoCrossCompile(opts); err != nil { + errorLock.Lock() + defer errorLock.Unlock() + errors = append(errors, + fmt.Sprintf("%s error: %s", platform.String(), err)) + } + <-semaphore + }(path, platform) + } + } + wg.Wait() + + if len(errors) > 0 { + fmt.Fprintf(os.Stderr, "\n%d errors occurred:\n", len(errors)) + for _, err := range errors { + fmt.Fprintf(os.Stderr, "--> %s\n", err) + } + return 1 + } + + return 0 +} + +func printUsage() { + fmt.Fprintf(os.Stderr, helpText) +} + +const helpText = `Usage: gox [options] [packages] + + Gox cross-compiles Go applications in parallel. + + If no specific operating systems or architectures are specified, Gox + will build for all pairs supported by your version of Go. + +Options: + + -arch="" Space-separated list of architectures to build for + -build-toolchain Build cross-compilation toolchain + -cgo Sets CGO_ENABLED=1, requires proper C toolchain (advanced) + -gcflags="" Additional '-gcflags' value to pass to go build + -ldflags="" Additional '-ldflags' value to pass to go build + -asmflags="" Additional '-asmflags' value to pass to go build + -tags="" Additional '-tags' value to pass to go build + -mod="" Additional '-mod' value to pass to go build + -os="" Space-separated list of operating systems to build for + -osarch="" Space-separated list of os/arch pairs to build for + -osarch-list List supported os/arch pairs for your Go version + -output="foo" Output path template. See below for more info + -parallel=-1 Amount of parallelism, defaults to number of CPUs + -gocmd="go" Build command, defaults to Go + -rebuild Force rebuilding of package that were up to date + -verbose Verbose mode + +Output path template: + + The output path for the compiled binaries is specified with the + "-output" flag. The value is a string that is a Go text template. + The default value is "{{.Dir}}_{{.OS}}_{{.Arch}}". The variables and + their values should be self-explanatory. + +Platforms (OS/Arch): + + The operating systems and architectures to cross-compile for may be + specified with the "-arch" and "-os" flags. These are space separated lists + of valid GOOS/GOARCH values to build for, respectively. You may prefix an + OS or Arch with "!" to negate and not build for that platform. If the list + is made up of only negations, then the negations will come from the default + list. + + Additionally, the "-osarch" flag may be used to specify complete os/arch + pairs that should be built or ignored. The syntax for this is what you would + expect: "darwin/amd64" would be a valid osarch value. Multiple can be space + separated. An os/arch pair can begin with "!" to not build for that platform. + + The "-osarch" flag has the highest precedent when determing whether to + build for a platform. If it is included in the "-osarch" list, it will be + built even if the specific os and arch is negated in "-os" and "-arch", + respectively. + +Platform Overrides: + + The "-gcflags", "-ldflags" and "-asmflags" options can be overridden per-platform + by using environment variables. Gox will look for environment variables + in the following format and use those to override values if they exist: + + GOX_[OS]_[ARCH]_GCFLAGS + GOX_[OS]_[ARCH]_LDFLAGS + GOX_[OS]_[ARCH]_ASMFLAGS + +` diff --git a/vendor/github.com/mitchellh/gox/main_osarch.go b/vendor/github.com/mitchellh/gox/main_osarch.go new file mode 100644 index 0000000..05c7ff5 --- /dev/null +++ b/vendor/github.com/mitchellh/gox/main_osarch.go @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" +) + +func mainListOSArch(version string) int { + fmt.Printf( + "Supported OS/Arch combinations for %s are shown below. The \"default\"\n"+ + "boolean means that if you don't specify an OS/Arch, it will be\n"+ + "included by default. If it isn't a default OS/Arch, you must explicitly\n"+ + "specify that OS/Arch combo for Gox to use it.\n\n", + version) + for _, p := range SupportedPlatforms(version) { + fmt.Printf("%s\t(default: %v)\n", p.String(), p.Default) + } + + return 0 +} diff --git a/vendor/github.com/mitchellh/gox/platform.go b/vendor/github.com/mitchellh/gox/platform.go new file mode 100644 index 0000000..88428bc --- /dev/null +++ b/vendor/github.com/mitchellh/gox/platform.go @@ -0,0 +1,149 @@ +package main + +import ( + "fmt" + "log" + "strings" + + version "github.com/hashicorp/go-version" +) + +// Platform is a combination of OS/arch that can be built against. +type Platform struct { + OS string + Arch string + + // Default, if true, will be included as a default build target + // if no OS/arch is specified. We try to only set as a default popular + // targets or targets that are generally useful. For example, Android + // is not a default because it is quite rare that you're cross-compiling + // something to Android AND something like Linux. + Default bool +} + +func (p *Platform) String() string { + return fmt.Sprintf("%s/%s", p.OS, p.Arch) +} + +var ( + Platforms_1_0 = []Platform{ + {"darwin", "386", true}, + {"darwin", "amd64", true}, + {"linux", "386", true}, + {"linux", "amd64", true}, + {"linux", "arm", true}, + {"freebsd", "386", true}, + {"freebsd", "amd64", true}, + {"openbsd", "386", true}, + {"openbsd", "amd64", true}, + {"windows", "386", true}, + {"windows", "amd64", true}, + } + + Platforms_1_1 = append(Platforms_1_0, []Platform{ + {"freebsd", "arm", true}, + {"netbsd", "386", true}, + {"netbsd", "amd64", true}, + {"netbsd", "arm", true}, + {"plan9", "386", false}, + }...) + + Platforms_1_3 = append(Platforms_1_1, []Platform{ + {"dragonfly", "386", false}, + {"dragonfly", "amd64", false}, + {"nacl", "amd64", false}, + {"nacl", "amd64p32", false}, + {"nacl", "arm", false}, + {"solaris", "amd64", false}, + }...) + + Platforms_1_4 = append(Platforms_1_3, []Platform{ + {"android", "arm", false}, + {"plan9", "amd64", false}, + }...) + + Platforms_1_5 = append(Platforms_1_4, []Platform{ + {"darwin", "arm", false}, + {"darwin", "arm64", false}, + {"linux", "arm64", false}, + {"linux", "ppc64", false}, + {"linux", "ppc64le", false}, + }...) + + Platforms_1_6 = append(Platforms_1_5, []Platform{ + {"android", "386", false}, + {"linux", "mips64", false}, + {"linux", "mips64le", false}, + }...) + + Platforms_1_7 = append(Platforms_1_5, []Platform{ + // While not fully supported s390x is generally useful + {"linux", "s390x", true}, + {"plan9", "arm", false}, + // Add the 1.6 Platforms, but reflect full support for mips64 and mips64le + {"android", "386", false}, + {"linux", "mips64", true}, + {"linux", "mips64le", true}, + }...) + + Platforms_1_8 = append(Platforms_1_7, []Platform{ + {"linux", "mips", true}, + {"linux", "mipsle", true}, + }...) + + // no new platforms in 1.9 + Platforms_1_9 = Platforms_1_8 + + // no new platforms in 1.10 + Platforms_1_10 = Platforms_1_9 + + PlatformsLatest = Platforms_1_10 +) + +// SupportedPlatforms returns the full list of supported platforms for +// the version of Go that is +func SupportedPlatforms(v string) []Platform { + // Use latest if we get an unexpected version string + if !strings.HasPrefix(v, "go") { + return PlatformsLatest + } + // go-version only cares about version numbers + v = v[2:] + + current, err := version.NewVersion(v) + if err != nil { + log.Printf("Unable to parse current go version: %s\n%s", v, err.Error()) + + // Default to latest + return PlatformsLatest + } + + var platforms = []struct { + constraint string + plat []Platform + }{ + {"<= 1.0", Platforms_1_0}, + {">= 1.1, < 1.3", Platforms_1_1}, + {">= 1.3, < 1.4", Platforms_1_3}, + {">= 1.4, < 1.5", Platforms_1_4}, + {">= 1.5, < 1.6", Platforms_1_5}, + {">= 1.6, < 1.7", Platforms_1_6}, + {">= 1.7, < 1.8", Platforms_1_7}, + {">= 1.8, < 1.9", Platforms_1_8}, + {">= 1.9, < 1.10", Platforms_1_9}, + {">=1.10, < 1.11", Platforms_1_10}, + } + + for _, p := range platforms { + constraints, err := version.NewConstraint(p.constraint) + if err != nil { + panic(err) + } + if constraints.Check(current) { + return p.plat + } + } + + // Assume latest + return Platforms_1_9 +} diff --git a/vendor/github.com/mitchellh/gox/platform_flag.go b/vendor/github.com/mitchellh/gox/platform_flag.go new file mode 100644 index 0000000..d69d922 --- /dev/null +++ b/vendor/github.com/mitchellh/gox/platform_flag.go @@ -0,0 +1,272 @@ +package main + +import ( + "flag" + "fmt" + "strings" +) + +// PlatformFlag is a flag.Value (and flag.Getter) implementation that +// is used to track the os/arch flags on the command-line. +type PlatformFlag struct { + OS []string + Arch []string + OSArch []Platform +} + +// Platforms returns the list of platforms that were set by this flag. +// The default set of platforms must be passed in. +func (p *PlatformFlag) Platforms(supported []Platform) []Platform { + // NOTE: Reading this method alone is a bit hard to understand. It + // is much easier to understand this method if you pair this with the + // table of test cases it has. + + // Build a list of OS and archs NOT to build + ignoreArch := make(map[string]struct{}) + includeArch := make(map[string]struct{}) + ignoreOS := make(map[string]struct{}) + includeOS := make(map[string]struct{}) + ignoreOSArch := make(map[string]Platform) + includeOSArch := make(map[string]Platform) + for _, v := range p.Arch { + if v[0] == '!' { + ignoreArch[v[1:]] = struct{}{} + } else { + includeArch[v] = struct{}{} + } + } + for _, v := range p.OS { + if v[0] == '!' { + ignoreOS[v[1:]] = struct{}{} + } else { + includeOS[v] = struct{}{} + } + } + for _, v := range p.OSArch { + if v.OS[0] == '!' { + v = Platform{ + OS: v.OS[1:], + Arch: v.Arch, + } + + ignoreOSArch[v.String()] = v + } else { + includeOSArch[v.String()] = v + } + } + + // We're building a list of new platforms, so build the list + // based only on the configured OS/arch pairs. + var prefilter []Platform = nil + if len(includeOSArch) > 0 { + prefilter = make([]Platform, 0, len(p.Arch)*len(p.OS)+len(includeOSArch)) + for _, v := range includeOSArch { + prefilter = append(prefilter, v) + } + } + + if len(includeOS) > 0 && len(includeArch) > 0 { + // Build up the list of prefiltered by what is specified + if prefilter == nil { + prefilter = make([]Platform, 0, len(p.Arch)*len(p.OS)) + } + + for _, os := range p.OS { + if _, ok := includeOS[os]; !ok { + continue + } + + for _, arch := range p.Arch { + if _, ok := includeArch[arch]; !ok { + continue + } + + prefilter = append(prefilter, Platform{ + OS: os, + Arch: arch, + }) + } + } + } else if len(includeOS) > 0 { + // Build up the list of prefiltered by what is specified + if prefilter == nil { + prefilter = make([]Platform, 0, len(p.Arch)*len(p.OS)) + } + + for _, os := range p.OS { + for _, platform := range supported { + if platform.OS == os { + prefilter = append(prefilter, platform) + } + } + } + } + + if prefilter != nil { + // Remove any that aren't supported + result := make([]Platform, 0, len(prefilter)) + for _, pending := range prefilter { + found := false + for _, platform := range supported { + if pending.String() == platform.String() { + found = true + break + } + } + + if found { + add := pending + add.Default = false + result = append(result, add) + } + } + + prefilter = result + } + + if prefilter == nil { + prefilter = make([]Platform, 0, len(supported)) + for _, v := range supported { + if v.Default { + add := v + add.Default = false + prefilter = append(prefilter, add) + } + } + } + + // Go through each default platform and filter out the bad ones + result := make([]Platform, 0, len(prefilter)) + for _, platform := range prefilter { + if len(ignoreOSArch) > 0 { + if _, ok := ignoreOSArch[platform.String()]; ok { + continue + } + } + + // We only want to check the components (OS and Arch) if we didn't + // specifically ask to include it via the osarch. + checkComponents := true + if len(includeOSArch) > 0 { + if _, ok := includeOSArch[platform.String()]; ok { + checkComponents = false + } + } + + if checkComponents { + if len(ignoreArch) > 0 { + if _, ok := ignoreArch[platform.Arch]; ok { + continue + } + } + if len(ignoreOS) > 0 { + if _, ok := ignoreOS[platform.OS]; ok { + continue + } + } + if len(includeArch) > 0 { + if _, ok := includeArch[platform.Arch]; !ok { + continue + } + } + if len(includeOS) > 0 { + if _, ok := includeOS[platform.OS]; !ok { + continue + } + } + } + + result = append(result, platform) + } + + return result +} + +// ArchFlagValue returns a flag.Value that can be used with the flag +// package to collect the arches for the flag. +func (p *PlatformFlag) ArchFlagValue() flag.Value { + return (*appendStringValue)(&p.Arch) +} + +// OSFlagValue returns a flag.Value that can be used with the flag +// package to collect the operating systems for the flag. +func (p *PlatformFlag) OSFlagValue() flag.Value { + return (*appendStringValue)(&p.OS) +} + +// OSArchFlagValue returns a flag.Value that can be used with the flag +// package to collect complete os and arch pairs for the flag. +func (p *PlatformFlag) OSArchFlagValue() flag.Value { + return (*appendPlatformValue)(&p.OSArch) +} + +// appendPlatformValue is a flag.Value that appends a full platform (os/arch) +// to a list where the values from space-separated lines. This is used to +// satisfy the -osarch flag. +type appendPlatformValue []Platform + +func (s *appendPlatformValue) String() string { + return "" +} + +func (s *appendPlatformValue) Set(value string) error { + if value == "" { + return nil + } + + for _, v := range strings.Split(value, " ") { + parts := strings.Split(v, "/") + if len(parts) != 2 { + return fmt.Errorf( + "Invalid platform syntax: %s should be os/arch", v) + } + + platform := Platform{ + OS: strings.ToLower(parts[0]), + Arch: strings.ToLower(parts[1]), + } + + s.appendIfMissing(&platform) + } + + return nil +} + +func (s *appendPlatformValue) appendIfMissing(value *Platform) { + for _, existing := range *s { + if existing == *value { + return + } + } + + *s = append(*s, *value) +} + +// appendStringValue is a flag.Value that appends values to the list, +// where the values come from space-separated lines. This is used to +// satisfy the -os="windows linux" flag to become []string{"windows", "linux"} +type appendStringValue []string + +func (s *appendStringValue) String() string { + return strings.Join(*s, " ") +} + +func (s *appendStringValue) Set(value string) error { + for _, v := range strings.Split(value, " ") { + if v != "" { + s.appendIfMissing(strings.ToLower(v)) + } + } + + return nil +} + +func (s *appendStringValue) appendIfMissing(value string) { + for _, existing := range *s { + if existing == value { + return + } + } + + *s = append(*s, value) +} diff --git a/vendor/github.com/mitchellh/gox/toolchain.go b/vendor/github.com/mitchellh/gox/toolchain.go new file mode 100644 index 0000000..bfce05e --- /dev/null +++ b/vendor/github.com/mitchellh/gox/toolchain.go @@ -0,0 +1,148 @@ +package main + +import ( + "bytes" + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "runtime" + "sync" + + "github.com/mitchellh/iochan" +) + +// The "main" method for when the toolchain build is requested. +func mainBuildToolchain(parallel int, platformFlag PlatformFlag, verbose bool) int { + if _, err := exec.LookPath("go"); err != nil { + fmt.Fprintf(os.Stderr, "You must have Go already built for your native platform\n") + fmt.Fprintf(os.Stderr, "and the `go` binary on the PATH to build toolchains.\n") + return 1 + } + + // If we're version 1.5 or greater, then we don't need to do this anymore! + versionParts, err := GoVersionParts() + if err != nil { + fmt.Fprintf(os.Stderr, "error reading Go version: %s", err) + return 1 + } + if versionParts[0] >= 1 && versionParts[1] >= 5 { + fmt.Fprintf( + os.Stderr, + "-build-toolchain is no longer required for Go 1.5 or later.\n"+ + "You can start using Gox immediately!\n") + return 1 + } + + version, err := GoVersion() + if err != nil { + fmt.Fprintf(os.Stderr, "error reading Go version: %s", err) + return 1 + } + + root, err := GoRoot() + if err != nil { + fmt.Fprintf(os.Stderr, "error finding GOROOT: %s\n", err) + return 1 + } + + if verbose { + fmt.Println("Verbose mode enabled. Output from building each toolchain will be") + fmt.Println("outputted to stdout as they are built.\n ") + } + + // Determine the platforms we're building the toolchain for. + platforms := platformFlag.Platforms(SupportedPlatforms(version)) + + // The toolchain build can't be parallelized. + if parallel > 1 { + fmt.Println("The toolchain build can't be parallelized because compiling a single") + fmt.Println("Go source directory can only be done for one platform at a time. Therefore,") + fmt.Println("the toolchain for each platform will be built one at a time.\n ") + } + parallel = 1 + + var errorLock sync.Mutex + var wg sync.WaitGroup + errs := make([]error, 0) + semaphore := make(chan int, parallel) + for _, platform := range platforms { + wg.Add(1) + go func(platform Platform) { + err := buildToolchain(&wg, semaphore, root, platform, verbose) + if err != nil { + errorLock.Lock() + defer errorLock.Unlock() + errs = append(errs, fmt.Errorf("%s: %s", platform.String(), err)) + } + }(platform) + } + wg.Wait() + + if len(errs) > 0 { + fmt.Fprintf(os.Stderr, "\n%d errors occurred:\n", len(errs)) + for _, err := range errs { + fmt.Fprintf(os.Stderr, "%s\n", err) + } + return 1 + } + + return 0 +} + +func buildToolchain(wg *sync.WaitGroup, semaphore chan int, root string, platform Platform, verbose bool) error { + defer wg.Done() + semaphore <- 1 + defer func() { <-semaphore }() + fmt.Printf("--> Toolchain: %s\n", platform.String()) + + scriptName := "make.bash" + if runtime.GOOS == "windows" { + scriptName = "make.bat" + } + + var stderr bytes.Buffer + var stdout bytes.Buffer + scriptDir := filepath.Join(root, "src") + scriptPath := filepath.Join(scriptDir, scriptName) + cmd := exec.Command(scriptPath, "--no-clean") + cmd.Dir = scriptDir + cmd.Env = append(os.Environ(), + "GOARCH="+platform.Arch, + "GOOS="+platform.OS) + cmd.Stderr = &stderr + cmd.Stdout = &stdout + + if verbose { + // In verbose mode, we output all stdout to the console. + r, w := io.Pipe() + cmd.Stdout = w + cmd.Stderr = io.MultiWriter(cmd.Stderr, w) + + // Send all the output to stdout, and also make a done channel + // so that this compilation isn't done until we receive all output + doneCh := make(chan struct{}) + go func() { + defer close(doneCh) + for line := range iochan.DelimReader(r, '\n') { + fmt.Printf("%s: %s", platform.String(), line) + } + }() + defer func() { + w.Close() + <-doneCh + }() + } + + if err := cmd.Start(); err != nil { + return fmt.Errorf("Error building '%s': %s", platform.String(), err) + } + + if err := cmd.Wait(); err != nil { + return fmt.Errorf("Error building '%s'.\n\nStdout: %s\n\nStderr: %s\n", + platform.String(), stdout.String(), stderr.String()) + } + + return nil +} diff --git a/vendor/github.com/mitchellh/iochan/LICENSE.md b/vendor/github.com/mitchellh/iochan/LICENSE.md new file mode 100644 index 0000000..762008c --- /dev/null +++ b/vendor/github.com/mitchellh/iochan/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Mitchell Hashimoto + +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/mitchellh/iochan/README.md b/vendor/github.com/mitchellh/iochan/README.md new file mode 100644 index 0000000..23771b1 --- /dev/null +++ b/vendor/github.com/mitchellh/iochan/README.md @@ -0,0 +1,13 @@ +# iochan + +iochan is a Go library for treating `io` readers and writers like channels. +This is useful when sometimes you wish to use `io.Reader` and such in `select` +statements. + +## Installation + +Standard `go get`: + +``` +$ go get github.com/mitchellh/iochan +``` diff --git a/vendor/github.com/mitchellh/iochan/iochan.go b/vendor/github.com/mitchellh/iochan/iochan.go new file mode 100644 index 0000000..c10cef0 --- /dev/null +++ b/vendor/github.com/mitchellh/iochan/iochan.go @@ -0,0 +1,41 @@ +package iochan + +import ( + "bufio" + "io" +) + +// DelimReader takes an io.Reader and produces the contents of the reader +// on the returned channel. The contents on the channel will be returned +// on boundaries specified by the delim parameter, and will include this +// delimiter. +// +// If an error occurs while reading from the reader, the reading will end. +// +// In the case of an EOF or error, the channel will be closed. +// +// This must only be called once for any individual reader. The behavior is +// unknown and will be unexpected if this is called multiple times with the +// same reader. +func DelimReader(r io.Reader, delim byte) <-chan string { + ch := make(chan string) + + go func() { + buf := bufio.NewReader(r) + + for { + line, err := buf.ReadString(delim) + if line != "" { + ch <- line + } + + if err != nil { + break + } + } + + close(ch) + }() + + return ch +} diff --git a/vendor/modules.txt b/vendor/modules.txt index e4be647..cc7e5e1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -7,6 +7,9 @@ github.com/davecgh/go-spew/spew # github.com/fsnotify/fsnotify v1.3.2-0.20160816051541-f12c6236fe7b ## explicit github.com/fsnotify/fsnotify +# github.com/hashicorp/go-version v1.0.0 +## explicit +github.com/hashicorp/go-version # github.com/hashicorp/hcl v0.0.0-20160902165219-99df0eb941dd ## explicit github.com/hashicorp/hcl @@ -27,6 +30,12 @@ github.com/kr/fs # github.com/magiconair/properties v1.7.1-0.20160908093658-0723e352fa35 ## explicit github.com/magiconair/properties +# github.com/mitchellh/gox v1.0.1 +## explicit +github.com/mitchellh/gox +# github.com/mitchellh/iochan v1.0.0 +## explicit +github.com/mitchellh/iochan # github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee ## explicit github.com/mitchellh/mapstructure From 785334e8528c77bfe0489adccec3a3023429fc42 Mon Sep 17 00:00:00 2001 From: Mark Dascher Date: Mon, 15 Nov 2021 08:18:59 -0500 Subject: [PATCH 3/3] GO15VENDOREXPERIMENT is obsolete --- .travis.yml | 1 - Makefile | 2 -- 2 files changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index fdc18b4..95d33e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ go: install: - export PATH=$HOME/gopath/bin:$PATH - - export GO15VENDOREXPERIMENT=1 script: - make test diff --git a/Makefile b/Makefile index bb4e15c..194194b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ -export GO15VENDOREXPERIMENT=1 - include packaging/Makefile.packaging .PHONY: depend clean test build tarball