Skip to content

beginning go port

beginning go port #42

Workflow file for this run

name: PR
on:
pull_request:
branches: [ master ]
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or
# v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3,
# `latest`, or the hash of a commit.
version: v1.54
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go 1.22
uses: actions/setup-go@v4
with:
go-version: 1.22.x
cache-dependency-path: go.sum
- name: Install dependencies
run: go get .
- name: Vet
run: go vet -v ./...
- name: Lint
id: lint
run: |
# binary will be $(go env GOPATH)/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.43.0
golangci-lint --version
golangci-lint run
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
- name: Format
id: fmt
run: |
go install github.com/segmentio/[email protected]
output="$(golines -m 79 --shorten-comments --dry-run .)"
if [ -n "$output" ]; then
echo "$output"
exit 1
fi