Skip to content

Use unsafe.Slice instead of reflect.SliceHeader to build byte slice #108

Use unsafe.Slice instead of reflect.SliceHeader to build byte slice

Use unsafe.Slice instead of reflect.SliceHeader to build byte slice #108

Workflow file for this run

name: Test
on:
push:
branches:
- main
paths-ignore:
- '*.md'
- 'imgs/**'
- 'LICENSE'
pull_request:
env:
GO_VERSION: "1.20"
PROTOC_VERSION: "21.12"
jobs:
test:
name: Test (TinyGo ${{ matrix.tinygo-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tinygo-version:
- "0.31.1"
- "0.30.0"
- "0.29.0"
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: go mod tidy
run: |
go mod tidy
if [ -n "$(git status --porcelain)" ]; then
echo "Run 'go mod tidy' and push it"
exit 1
fi
- name: Install protoc
run: |
wget $PB_REL/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip
unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local/bin/
env:
PB_REL: https://github.com/protocolbuffers/protobuf/releases
- name: Install TinyGo
run: |
wget https://github.com/tinygo-org/tinygo/releases/download/v${{ matrix.tinygo-version }}/tinygo_${{ matrix.tinygo-version }}_amd64.deb
sudo dpkg -i tinygo_${{ matrix.tinygo-version }}_amd64.deb
- name: Run unit tests
run: make test