diff --git a/.circleci/config.yml b/.circleci/config.yml index ec061964339261324f163cd9c2b28a5622b033a6..6fee0320b7273464e850c33cdf38db7deb2c0cd6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,15 +7,15 @@ jobs: - checkout - restore_cache: keys: - - go-v3-{{ checksum "go.sum" }} + - go-v4-{{ checksum "mod/go.sum" }} # Fallback to using the latest cache if no exact match is found. - - go-v3- - - run: ./ci/fmt.sh + - go-v4- + - run: ./mod/ci/fmt.sh - save_cache: paths: - /root/gopath - /root/.cache/go-build - key: go-v3-{{ checksum "go.sum" }} + key: go-v4-{{ checksum "mod/go.sum" }} lint: docker: @@ -24,15 +24,15 @@ jobs: - checkout - restore_cache: keys: - - go-v3-{{ checksum "go.sum" }} + - go-v4-{{ checksum "mod/go.sum" }} # Fallback to using the latest cache if no exact match is found. - - go-v3- - - run: ./ci/lint.sh + - go-v4- + - run: ./mod/ci/lint.sh - save_cache: paths: - /root/gopath - /root/.cache/go-build - key: go-v3-{{ checksum "go.sum" }} + key: go-v4-{{ checksum "mod/go.sum" }} test: docker: @@ -41,20 +41,20 @@ jobs: - checkout - restore_cache: keys: - - go-v3-{{ checksum "go.sum" }} + - go-v4-{{ checksum "mod/go.sum" }} # Fallback to using the latest cache if no exact match is found. - - go-v3- - - run: ./ci/test.sh + - go-v4- + - run: ./mod/ci/test.sh - store_artifacts: - path: ci/out + path: mod/ci/out destination: out - save_cache: paths: - /root/gopath - /root/.cache/go-build - key: go-v3-{{ checksum "go.sum" }} + key: go-v4-{{ checksum "mod/go.sum" }} - store_test_results: - path: ci/out + path: mod/ci/out workflows: version: 2 diff --git a/README.md b/README.md index 244315efb14ec3b64903209c9d1a649bb8b508a2..b3313aa68185be227c78f7df8d7cb69331754045 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ go get nhooyr.io/websocket ## Examples -For a production quality example that shows off the full API, see the [echo example on the godoc](https://godoc.org/nhooyr.io/websocket#example-package--Echo). On github, the example is at [example_echo_test.go](./example_echo_test.go). +For a production quality example that shows off the full API, see the [echo example on the godoc](https://godoc.org/nhooyr.io/websocket#example-package--Echo). On github, the example is at [./mod/example_echo_test.go](./mod/example_echo_test.go). Please use the [errors.As](https://golang.org/pkg/errors/#As) function [new in Go 1.13](https://golang.org/doc/go1.13#error_wrapping) to check for [websocket.CloseError](https://godoc.org/nhooyr.io/websocket#CloseError). See the [CloseError godoc example](https://godoc.org/nhooyr.io/websocket#example-CloseError). @@ -62,7 +62,7 @@ http.HandlerFunc(func (w http.ResponseWriter, r *http.Request) { ### Client -The client side of this library requires at minimum Go 1.12 as it uses a [new feature +The client side of this library requires at least Go 1.12 as it uses a [new feature in net/http](https://github.com/golang/go/issues/26937#issuecomment-415855861) to perform WebSocket handshakes. ```go diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 74a25540ec45885ec5baa3aadf69af98c293072c..846c96f95e018cb4fbb1f1e87909c314cfa936c5 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -23,6 +23,9 @@ Be sure to [correctly link](https://help.github.com/en/articles/closing-issues-u to an existing issue if one exists. In general, create an issue before a PR to get some discussion going and to make sure you do not spend time on a PR that may be rejected. +The Go module where development occurs is in the [./mod](./mod) subpath so that the README.md +is immediately visible on the main page. + CI must pass on your changes for them to be merged. ### CI @@ -32,21 +35,21 @@ It will collect coverage and report it to [codecov](https://codecov.io/gh/nhooyr and also upload a `out/coverage.html` artifact that you can click on to interactively browse coverage. -You can run CI locally. The various steps are located in `ci/*.sh`. +You can run CI locally. The various steps are located in `mod/ci/*.sh`. -1. `ci/fmt.sh` which requires node (specifically prettier). -1. `ci/lint.sh` which requires [shellcheck](https://github.com/koalaman/shellcheck#installing). -1. `ci/test.sh` -1. `ci/run.sh` which runs the above scripts in order. +1. `mod/ci/fmt.sh` which requires node (specifically prettier). +1. `mod/ci/lint.sh` which requires [shellcheck](https://github.com/koalaman/shellcheck#installing). +1. `mod/ci/test.sh` +1. `mod/ci/run.sh` which runs the above scripts in order. -For coverage details locally, please see `ci/out/coverage.html` after running `ci/test.sh`. +For coverage details locally, please see `mod/ci/out/coverage.html` after running `mod/ci/test.sh`. -See [ci/image/Dockerfile](ci/image/Dockerfile) for the installation of the CI dependencies on Ubuntu. +See [mod/ci/image/Dockerfile](mod/ci/image/Dockerfile) for the installation of the CI dependencies on Ubuntu. -You can also run tests normally with `go test`. `ci/test.sh` just passes a default set of flags to +You can also run tests normally with `go test`. `mod/ci/test.sh` just passes a default set of flags to `go test` to collect coverage, enable the race detector and also prettifies the output. -You can pass flags to `ci/test.sh` if you want to run a specific test or otherwise +You can pass flags to `mod/ci/test.sh` if you want to run a specific test or otherwise control the behaviour of `go test`. Coverage percentage from codecov and the CI scripts will be different because they are calculated differently. diff --git a/go.mod b/go.mod deleted file mode 100644 index b59397c1ece37f41d008c5ac3b777e22f130fa7e..0000000000000000000000000000000000000000 --- a/go.mod +++ /dev/null @@ -1,28 +0,0 @@ -module nhooyr.io/websocket - -go 1.13 - -require ( - github.com/fatih/color v1.7.0 // indirect - github.com/golang/protobuf v1.3.2 - github.com/google/go-cmp v0.3.1 - github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect - github.com/kr/pretty v0.1.0 // indirect - github.com/mattn/go-colorable v0.1.2 // indirect - github.com/mattn/go-isatty v0.0.9 // indirect - github.com/pkg/errors v0.8.1 // indirect - github.com/sirupsen/logrus v1.4.2 // indirect - github.com/spf13/pflag v1.0.3 // indirect - github.com/stretchr/testify v1.4.0 // indirect - go.coder.com/go-tools v0.0.0-20190317003359-0c6a35b74a16 - go.uber.org/atomic v1.4.0 // indirect - go.uber.org/multierr v1.1.0 - golang.org/x/lint v0.0.0-20190409202823-959b441ac422 - golang.org/x/sys v0.0.0-20190830142957-1e83adbbebd0 // indirect - golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 - golang.org/x/tools v0.0.0-20190830223141-573d9926052a - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect - gotest.tools v2.2.0+incompatible // indirect - gotest.tools/gotestsum v0.3.6-0.20190825182939-fc6cb5870c52 - mvdan.cc/sh v2.6.4+incompatible -) diff --git a/accept.go b/mod/accept.go similarity index 100% rename from accept.go rename to mod/accept.go diff --git a/accept_test.go b/mod/accept_test.go similarity index 100% rename from accept_test.go rename to mod/accept_test.go diff --git a/ci/.codecov.yml b/mod/ci/.codecov.yml similarity index 100% rename from ci/.codecov.yml rename to mod/ci/.codecov.yml diff --git a/ci/.gitignore b/mod/ci/.gitignore similarity index 100% rename from ci/.gitignore rename to mod/ci/.gitignore diff --git a/ci/fmt.sh b/mod/ci/fmt.sh similarity index 77% rename from ci/fmt.sh rename to mod/ci/fmt.sh index a4e7ff0292d1d156a6d288140488e526ee38fabe..52a194e9508cd6af9a037cb7bd4f1e2eba4041d2 100755 --- a/ci/fmt.sh +++ b/mod/ci/fmt.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -set -euo pipefail +set -euox pipefail cd "$(dirname "${0}")" -cd "$(git rev-parse --show-toplevel)" +cd "$(git rev-parse --show-toplevel)/mod" gen() { # Unfortunately, this is the only way to ensure go.mod and go.sum are correct. @@ -16,7 +16,7 @@ gen() { fmt() { gofmt -w -s . go run go.coder.com/go-tools/cmd/goimports -w "-local=$(go list -m)" . - go run mvdan.cc/sh/cmd/shfmt -i 2 -w -s -sr . + go run mvdan.cc/sh/cmd/shfmt -i 2 -w -s -sr .. # shellcheck disable=SC2046 npx prettier \ --write \ @@ -24,11 +24,11 @@ fmt() { --no-semi \ --trailing-comma all \ --loglevel silent \ - $(git ls-files "*.yaml" "*.yml" "*.md") + $(git ls-files "../*.yaml" "../*.yml" "../*.md") } unstaged_files() { - git ls-files --other --modified --exclude-standard + git ls-files --other --modified --exclude-standard .. } check() { diff --git a/ci/image/Dockerfile b/mod/ci/image/Dockerfile similarity index 100% rename from ci/image/Dockerfile rename to mod/ci/image/Dockerfile diff --git a/ci/image/push.sh b/mod/ci/image/push.sh similarity index 100% rename from ci/image/push.sh rename to mod/ci/image/push.sh diff --git a/ci/lint.sh b/mod/ci/lint.sh similarity index 65% rename from ci/lint.sh rename to mod/ci/lint.sh index b7268c55da1345552aa3970a117902e1bd61ea34..744783ffdad23e07d23f328384c350eeb9709d55 100755 --- a/ci/lint.sh +++ b/mod/ci/lint.sh @@ -2,9 +2,9 @@ set -euo pipefail cd "$(dirname "${0}")" -cd "$(git rev-parse --show-toplevel)" +cd "$(git rev-parse --show-toplevel)/mod" # shellcheck disable=SC2046 -shellcheck -x $(git ls-files "*.sh") +shellcheck -x $(git ls-files "../*.sh") go vet ./... go run golang.org/x/lint/golint -set_exit_status ./... diff --git a/ci/run.sh b/mod/ci/run.sh similarity index 79% rename from ci/run.sh rename to mod/ci/run.sh index 56da2d9372905c9b626ccd52f102af78d50e362f..f2eec485f7c764251789d1a91b4a11ce086ea639 100755 --- a/ci/run.sh +++ b/mod/ci/run.sh @@ -4,7 +4,7 @@ set -euo pipefail cd "$(dirname "${0}")" -cd "$(git rev-parse --show-toplevel)" +cd "$(git rev-parse --show-toplevel)/mod" ./ci/fmt.sh ./ci/lint.sh diff --git a/ci/test.sh b/mod/ci/test.sh similarity index 95% rename from ci/test.sh rename to mod/ci/test.sh index 7b61192163bf202e67f0d98563426587d3c6ca87..55b06810df0fa1997bc0988bf05951d7fa191e81 100755 --- a/ci/test.sh +++ b/mod/ci/test.sh @@ -2,7 +2,7 @@ set -euo pipefail cd "$(dirname "${0}")" -cd "$(git rev-parse --show-toplevel)" +cd "$(git rev-parse --show-toplevel)/mod" argv=( go run gotest.tools/gotestsum diff --git a/cmp_test.go b/mod/cmp_test.go similarity index 100% rename from cmp_test.go rename to mod/cmp_test.go diff --git a/dial.go b/mod/dial.go similarity index 100% rename from dial.go rename to mod/dial.go diff --git a/dial_test.go b/mod/dial_test.go similarity index 100% rename from dial_test.go rename to mod/dial_test.go diff --git a/doc.go b/mod/doc.go similarity index 100% rename from doc.go rename to mod/doc.go diff --git a/example_echo_test.go b/mod/example_echo_test.go similarity index 100% rename from example_echo_test.go rename to mod/example_echo_test.go diff --git a/example_test.go b/mod/example_test.go similarity index 100% rename from example_test.go rename to mod/example_test.go diff --git a/export_test.go b/mod/export_test.go similarity index 100% rename from export_test.go rename to mod/export_test.go diff --git a/mod/go.mod b/mod/go.mod new file mode 100644 index 0000000000000000000000000000000000000000..7d0c2e2488b64abe8f2670a4521c3c158c109fbc --- /dev/null +++ b/mod/go.mod @@ -0,0 +1,20 @@ +module nhooyr.io/websocket + +go 1.13 + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/golang/protobuf v1.3.2 + github.com/google/go-cmp v0.3.1 + github.com/kr/pretty v0.1.0 // indirect + github.com/stretchr/testify v1.4.0 // indirect + go.coder.com/go-tools v0.0.0-20190317003359-0c6a35b74a16 + go.uber.org/atomic v1.4.0 // indirect + go.uber.org/multierr v1.1.0 + golang.org/x/lint v0.0.0-20190409202823-959b441ac422 + golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 + golang.org/x/tools v0.0.0-20190903163617-be0da057c5e3 + gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect + gotest.tools/gotestsum v0.3.5 + mvdan.cc/sh v2.6.4+incompatible +) diff --git a/go.sum b/mod/go.sum similarity index 72% rename from go.sum rename to mod/go.sum index 18b3dd70751a82d53d34685dde090197e2663d98..00db27ea941596b668a2a81df1aefbbd6e793e06 100644 --- a/go.sum +++ b/mod/go.sum @@ -4,14 +4,11 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.6.0 h1:66qjqZk8kalYAvDRtM1AdAJQI0tj4Wrue3Eq3B3pmFU= github.com/fatih/color v1.6.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -19,9 +16,6 @@ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -29,13 +23,8 @@ 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/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9 h1:d5US/mDsogSGW37IV293h//ZFaeajb69h+EHFsv2xGg= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -43,22 +32,13 @@ github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sirupsen/logrus v1.0.5 h1:8c8b5uO0zS4X6RPl/sd1ENwSkIc0/H2PaHxE3udaE8I= github.com/sirupsen/logrus v1.0.5/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -75,8 +55,8 @@ golang.org/x/lint v0.0.0-20190409202823-959b441ac422 h1:QzoH/1pFpZguR8NrRHLcO6jK golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181102091132-c10e9556a7bc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= @@ -84,19 +64,13 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190830142957-1e83adbbebd0 h1:7z820YPX9pxWR59qM7BE5+fglp4D/mKqAwCvGt11b+8= -golang.org/x/sys v0.0.0-20190830142957-1e83adbbebd0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190830223141-573d9926052a h1:XAHT1kdPpnU8Hk+FPi42KZFhtNFEk4vBg1U4OmIeHTU= -golang.org/x/tools v0.0.0-20190830223141-573d9926052a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= +golang.org/x/tools v0.0.0-20190903163617-be0da057c5e3 h1:1cLrGl9PL64Mzl9NATDCqFE57dVYwWOkoPXvppEnjO4= +golang.org/x/tools v0.0.0-20190903163617-be0da057c5e3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= @@ -110,15 +84,12 @@ gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 h1:OAj3g0cR6Dx/R07QgQe8wkA9RNj gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.1.0+incompatible h1:5USw7CrJBYKqjg9R7QlA6jzqZKEAtvW82aNmsxxGPxw= gotest.tools v2.1.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/gotestsum v0.3.6-0.20190825182939-fc6cb5870c52 h1:Qr31uPFyjpOhAgRfKV4ATUnknnLT2X7HFjqwkstdbbE= -gotest.tools/gotestsum v0.3.6-0.20190825182939-fc6cb5870c52/go.mod h1:Mnf3e5FUzXbkCfynWBGOwLssY7gTQgCHObK9tMpAriY= +gotest.tools/gotestsum v0.3.5 h1:VePOWRsuWFYpfp/G8mbmOZKxO5T3501SEGQRUdvq7h0= +gotest.tools/gotestsum v0.3.5/go.mod h1:Mnf3e5FUzXbkCfynWBGOwLssY7gTQgCHObK9tMpAriY= mvdan.cc/sh v2.6.4+incompatible h1:eD6tDeh0pw+/TOTI1BBEryZ02rD2nMcFsgcvde7jffM= mvdan.cc/sh v2.6.4+incompatible/go.mod h1:IeeQbZq+x2SUGBensq/jge5lLQbS3XT2ktyp3wrt4x8= diff --git a/header.go b/mod/header.go similarity index 100% rename from header.go rename to mod/header.go diff --git a/header_test.go b/mod/header_test.go similarity index 100% rename from header_test.go rename to mod/header_test.go diff --git a/internal/bpool/bpool.go b/mod/internal/bpool/bpool.go similarity index 100% rename from internal/bpool/bpool.go rename to mod/internal/bpool/bpool.go diff --git a/internal/bpool/bpool_test.go b/mod/internal/bpool/bpool_test.go similarity index 100% rename from internal/bpool/bpool_test.go rename to mod/internal/bpool/bpool_test.go diff --git a/messagetype.go b/mod/messagetype.go similarity index 100% rename from messagetype.go rename to mod/messagetype.go diff --git a/messagetype_string.go b/mod/messagetype_string.go similarity index 100% rename from messagetype_string.go rename to mod/messagetype_string.go diff --git a/netconn.go b/mod/netconn.go similarity index 100% rename from netconn.go rename to mod/netconn.go diff --git a/opcode.go b/mod/opcode.go similarity index 100% rename from opcode.go rename to mod/opcode.go diff --git a/opcode_string.go b/mod/opcode_string.go similarity index 100% rename from opcode_string.go rename to mod/opcode_string.go diff --git a/statuscode.go b/mod/statuscode.go similarity index 100% rename from statuscode.go rename to mod/statuscode.go diff --git a/statuscode_string.go b/mod/statuscode_string.go similarity index 100% rename from statuscode_string.go rename to mod/statuscode_string.go diff --git a/statuscode_test.go b/mod/statuscode_test.go similarity index 100% rename from statuscode_test.go rename to mod/statuscode_test.go diff --git a/tools.go b/mod/tools.go similarity index 93% rename from tools.go rename to mod/tools.go index a6f0268e1cf49ee8266ea93d7cb0fc19b92eb198..0ba3f40ce6a5ac1276c27c3b4e893a2ff720d215 100644 --- a/tools.go +++ b/mod/tools.go @@ -1,6 +1,6 @@ // +build tools -package tools +package websocket // See https://github.com/go-modules-by-example/index/blob/master/010_tools/README.md import ( diff --git a/websocket.go b/mod/websocket.go similarity index 100% rename from websocket.go rename to mod/websocket.go diff --git a/websocket_autobahn_python_test.go b/mod/websocket_autobahn_python_test.go similarity index 100% rename from websocket_autobahn_python_test.go rename to mod/websocket_autobahn_python_test.go diff --git a/websocket_bench_test.go b/mod/websocket_bench_test.go similarity index 100% rename from websocket_bench_test.go rename to mod/websocket_bench_test.go diff --git a/websocket_test.go b/mod/websocket_test.go similarity index 100% rename from websocket_test.go rename to mod/websocket_test.go diff --git a/wsjson/wsjson.go b/mod/wsjson/wsjson.go similarity index 100% rename from wsjson/wsjson.go rename to mod/wsjson/wsjson.go diff --git a/wspb/wspb.go b/mod/wspb/wspb.go similarity index 100% rename from wspb/wspb.go rename to mod/wspb/wspb.go diff --git a/xor.go b/mod/xor.go similarity index 100% rename from xor.go rename to mod/xor.go diff --git a/xor_test.go b/mod/xor_test.go similarity index 100% rename from xor_test.go rename to mod/xor_test.go