good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 04b7d0de authored by Anmol Sethi's avatar Anmol Sethi
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
FROM golang:1.12
LABEL "com.github.actions.name"="fmt"
LABEL "com.github.actions.description"="Ensure formatted files"
LABEL "com.github.actions.icon"="code"
LABEL "com.github.actions.color"="purple"
COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
#!/usr/bin/env bash
source .github/lib.sh
if [[ $(gofmt -l -s .) != "" ]]; then
echo "files are not formatted correctly"
echo "please run:"
echo "gofmt -w -s ."
exit 1
fi
out=$(go run golang.org/x/tools/cmd/goimports -l -local=nhooyr.io/ws .)
if [[ $out != "" ]]; then
echo "imports are not formatted correctly"
echo "please run:"
echo "goimports -w -local=nhooyr.io/ws ."
exit 1
fi
out=$(go run mvdan.cc/sh/cmd/shfmt -l -s -sr .)
if [[ $out != "" ]]; then
echo "shell scripts are not formatted correctly"
echo "please run:"
echo "shfmt -w -s -sr ."
exit 1
fi
#!/usr/bin/env bash
set -euxo pipefail
export GO111MODULE=on
export GOFLAGS=-mod=readonly
workflow "main" {
on = "push"
resolves = ["fmt", "test"]
}
action "fmt" {
uses = "./.github/fmt"
}
action "test" {
uses = "./.github/test"
secrets = ["CODECOV_TOKEN"]
}
FROM golang:1.12
LABEL "com.github.actions.name"="test"
LABEL "com.github.actions.description"="Run go test"
LABEL "com.github.actions.icon"="code"
LABEL "com.github.actions.color"="purple"
RUN apt update && apt install -y shellcheck
COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
#!/usr/bin/env bash
source .github/lib.sh
function gomod_help() {
echo
echo "you may need to update go.mod/go.sum via:"
echo "go list all > /dev/null"
echo "go mod tidy"
echo
echo "or git add files to staging"
exit 1
}
go list ./... > /dev/null || gomod_help
go mod tidy
# Until https://github.com/golang/go/issues/27005 the previous command can actually modify go.sum so we need to ensure its not changed.
if [[ $(git diff --name-only) != "" ]]; then
git diff
gomod_help
fi
mapfile -t scripts <<< "$(find . -type f -name "*.sh")"
shellcheck "${scripts[@]}"
go vet -composites=false ./...
go test -race -v -coverprofile=coverage.out -vet=off ./...
if [[ -z ${GITHUB_ACTION-} ]]; then
go tool cover -html=coverage.out
else
bash <(curl -s https://codecov.io/bash)
fi
rm coverage.out
MIT License
Copyright (c) 2018 Anmol Sethi
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.
# ws
[![GoDoc](https://godoc.org/nhooyr.io/ws?status.svg)](https://godoc.org/nhooyr.io/ws)
[![Codecov](https://img.shields.io/codecov/c/github/nhooyr/ws.svg)](https://codecov.io/gh/nhooyr/ws)
[![GitHub release](https://img.shields.io/github/release/nhooyr/ws.svg)](https://github.com/nhooyr/ws/releases)
ws is a clean and idiomatic WebSocket library for Go.
This library is in heavy development.
## Install
```bash
go get nhooyr.io/ws
```
go.mod 0 → 100644
module nhooyr.io/ws
go 1.12
require (
github.com/kr/pretty v0.1.0 // indirect
golang.org/x/tools v0.0.0-20190315191501-e6df0c1bb376
mvdan.cc/sh v2.6.4+incompatible
)
#!/usr/bin/env bash
# This is for local testing. See .github for CI.
source ./.github/lib.sh
./.github/fmt/entrypoint.sh
./.github/test/entrypoint.sh
// +build tools
package tools
// See https://github.com/go-modules-by-example/index/blob/master/010_tools/README.md
import (
_ "golang.org/x/tools/cmd/goimports"
_ "mvdan.cc/sh/cmd/shfmt"
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment