int("")==0
; adding trim()
, trim_left()
and trim_right()
; new …
#786
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: go-checks | |
on: | |
workflow_call: | |
push: | |
branches: [ main ] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: [ main ] | |
jobs: | |
check: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4 | |
- name: Setup Go environment | |
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # pin@v5 | |
with: | |
go-version: '1.23' | |
check-latest: true | |
- name: Run Vulncheck | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
go install golang.org/x/vuln/cmd/govulncheck@latest | |
govulncheck ./... | |
- name: Download linter config | |
if: matrix.os == 'ubuntu-latest' | |
run: curl -fsS -o .golangci.yml https://raw.githubusercontent.com/fortio/workflows/main/golangci.yml | |
- name: Run golangci-lint | |
if: matrix.os == 'ubuntu-latest' | |
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # pin@v6 | |
with: | |
version: v1.62.0 | |
- name: Install Git Bash | |
run: | | |
choco install git | |
echo "Git Bash installed" | |
shell: pwsh | |
if: runner.os == 'Windows' | |
- name: Run tests | |
run: | | |
go version | |
go run . buildinfo || true # to also confirm go toolchain version used | |
if make -n test &>/dev/null; then | |
echo "Running tests with make test" | |
make test | |
else | |
echo "No Makefile test target, running tests with race detection as default behavior" | |
go test -race ./... | |
fi | |
shell: bash # to use bash on Windows |