ci: bump to go 1.19 (#330)

* Bump CI to Go 1.19
* Update golang/go edwards25519 test
* Apply formatting to printer stubs output (to get correct comment formatting)
* Bump gofumpt version
This commit is contained in:
Michael McLoughlin
2022-09-05 22:15:01 -07:00
committed by GitHub
parent e788b7675f
commit 429cf3cdbf
15 changed files with 43307 additions and 37038 deletions

View File

@@ -22,7 +22,7 @@ jobs:
test: test:
strategy: strategy:
matrix: matrix:
go-version: [1.17.x, 1.18.x] go-version: [1.18.x, 1.19.x]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Install Go - name: Install Go
@@ -66,7 +66,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Configure Go Environment - name: Configure Go Environment
run: | run: |

View File

@@ -11,7 +11,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8 # v2.1.3 uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8 # v2.1.3
with: with:
go-version: 1.18.x go-version: 1.19.x
- name: Checkout code - name: Checkout code
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
with: with:

View File

@@ -11,7 +11,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8 # v2.1.3 uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8 # v2.1.3
with: with:
go-version: 1.18.x go-version: 1.19.x
- name: Checkout code - name: Checkout code
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
with: with:

View File

@@ -15,7 +15,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -52,7 +52,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -98,7 +98,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -145,7 +145,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -180,7 +180,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -217,7 +217,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -252,7 +252,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -290,7 +290,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -325,7 +325,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -360,7 +360,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -410,7 +410,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -461,7 +461,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -514,7 +514,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -567,7 +567,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -612,7 +612,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -647,7 +647,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -684,7 +684,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -721,7 +721,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -756,7 +756,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -791,7 +791,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -826,7 +826,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -861,7 +861,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -901,7 +901,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -936,7 +936,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -947,20 +947,20 @@ jobs:
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
with: with:
repository: golang/go repository: golang/go
ref: go1.17.3 ref: go1.19
path: go path: go
persist-credentials: false persist-credentials: false
- name: Compile Go Toolchain - name: Compile Go Toolchain
working-directory: go/src working-directory: go/src
run: ./make.bash run: ./make.bash
- name: Avo Module Replacement - name: Avo Module Replacement
working-directory: go/src/crypto/ed25519/internal/edwards25519/field/_asm working-directory: go/src/crypto/internal/edwards25519/field/_asm
run: | run: |
go mod edit -modfile=go.mod -require=github.com/mmcloughlin/avo@v0.0.0-00010101000000-000000000000 go mod edit -modfile=go.mod -require=github.com/mmcloughlin/avo@v0.0.0-00010101000000-000000000000
go mod edit -modfile=go.mod -replace=github.com/mmcloughlin/avo=${{ github.workspace }}/avo go mod edit -modfile=go.mod -replace=github.com/mmcloughlin/avo=${{ github.workspace }}/avo
go mod tidy -modfile=go.mod go mod tidy -modfile=go.mod
- name: Generate - name: Generate
working-directory: go/src/crypto/ed25519/internal/edwards25519/field/_asm working-directory: go/src/crypto/internal/edwards25519/field/_asm
run: go generate -v -x run: go generate -v -x
- name: Diff - name: Diff
working-directory: go working-directory: go
@@ -974,7 +974,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -1009,7 +1009,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
@@ -1044,7 +1044,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout avo - name: Checkout avo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4

View File

@@ -3,7 +3,7 @@ permissions:
contents: read contents: read
on: on:
schedule: schedule:
- cron: '33 3 * * 6' - cron: "33 3 * * 6"
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -13,7 +13,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Configure Go Environment - name: Configure Go Environment
run: | run: |

View File

@@ -17,7 +17,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0 uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0
with: with:
go-version: 1.18.x go-version: 1.19.x
check-latest: true check-latest: true
- name: Checkout code - name: Checkout code
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4

File diff suppressed because it is too large Load Diff

View File

@@ -28,6 +28,7 @@ Note the directive is applied in the generated stub file:
[embedmd]:# (stub.go go /\/\/ Add/ /func/) [embedmd]:# (stub.go go /\/\/ Add/ /func/)
```go ```go
// Add adds the values at x and y and writes the result to z. // Add adds the values at x and y and writes the result to z.
//
//go:noescape //go:noescape
func func
``` ```

View File

@@ -3,5 +3,6 @@
package pragma package pragma
// Add adds the values at x and y and writes the result to z. // Add adds the values at x and y and writes the result to z.
//
//go:noescape //go:noescape
func Add(z *uint64, x *uint64, y *uint64) func Add(z *uint64, x *uint64, y *uint64)

View File

@@ -1,6 +1,8 @@
package printer package printer
import ( import (
"go/format"
"github.com/mmcloughlin/avo/buildtags" "github.com/mmcloughlin/avo/buildtags"
"github.com/mmcloughlin/avo/internal/prnt" "github.com/mmcloughlin/avo/internal/prnt"
"github.com/mmcloughlin/avo/ir" "github.com/mmcloughlin/avo/ir"
@@ -38,7 +40,16 @@ func (s *stubs) Print(f *ir.File) ([]byte, error) {
} }
s.Printf("%s\n", fn.Stub()) s.Printf("%s\n", fn.Stub())
} }
return s.Result()
// Apply formatting to the result. This is the simplest way to ensure
// comment formatting rules introduced in Go 1.19 are applied. See
// https://go.dev/doc/comment.
src, err := s.Result()
if err != nil {
return nil, err
}
return format.Source(src)
} }
func (s *stubs) pragma(p ir.Pragma) { func (s *stubs) pragma(p ir.Pragma) {

View File

@@ -21,7 +21,7 @@ go install github.com/klauspost/asmfmt/cmd/asmfmt@v1.3.2
go install golang.org/x/tools/cmd/goimports@v0.1.10 go install golang.org/x/tools/cmd/goimports@v0.1.10
# gofumpt for stricter formatting. # gofumpt for stricter formatting.
go install mvdan.cc/gofumpt@v0.2.1 go install mvdan.cc/gofumpt@v0.3.1
# yamlfmt for yaml formatting. # yamlfmt for yaml formatting.
go install github.com/gechr/yamlfmt@v0.0.0-20220216093356-e9288cd48d12 go install github.com/gechr/yamlfmt@v0.0.0-20220216093356-e9288cd48d12

View File

@@ -43,8 +43,9 @@ func encodeBlockAsm12BAvx(dst []byte, src []byte) int
// emitLiteral writes a literal chunk and returns the number of bytes written. // emitLiteral writes a literal chunk and returns the number of bytes written.
// //
// It assumes that: // It assumes that:
// dst is long enough to hold the encoded bytes //
// 0 <= len(lit) && len(lit) <= math.MaxUint32 // dst is long enough to hold the encoded bytes
// 0 <= len(lit) && len(lit) <= math.MaxUint32
// //
//go:noescape //go:noescape
func emitLiteral(dst []byte, lit []byte) int func emitLiteral(dst []byte, lit []byte) int
@@ -52,8 +53,9 @@ func emitLiteral(dst []byte, lit []byte) int
// emitLiteralAvx writes a literal chunk and returns the number of bytes written. // emitLiteralAvx writes a literal chunk and returns the number of bytes written.
// //
// It assumes that: // It assumes that:
// dst is long enough to hold the encoded bytes //
// 0 <= len(lit) && len(lit) <= math.MaxUint32 // dst is long enough to hold the encoded bytes
// 0 <= len(lit) && len(lit) <= math.MaxUint32
// //
//go:noescape //go:noescape
func emitLiteralAvx(dst []byte, lit []byte) int func emitLiteralAvx(dst []byte, lit []byte) int
@@ -67,9 +69,10 @@ func emitRepeat(dst []byte, offset int, length int) int
// emitCopy writes a copy chunk and returns the number of bytes written. // emitCopy writes a copy chunk and returns the number of bytes written.
// //
// It assumes that: // It assumes that:
// dst is long enough to hold the encoded bytes //
// 1 <= offset && offset <= math.MaxUint32 // dst is long enough to hold the encoded bytes
// 4 <= length && length <= 1 << 24 // 1 <= offset && offset <= math.MaxUint32
// 4 <= length && length <= 1 << 24
// //
//go:noescape //go:noescape
func emitCopy(dst []byte, offset int, length int) int func emitCopy(dst []byte, offset int, length int) int
@@ -77,7 +80,8 @@ func emitCopy(dst []byte, offset int, length int) int
// matchLen returns how many bytes match in a and b // matchLen returns how many bytes match in a and b
// //
// It assumes that: // It assumes that:
// len(a) <= len(b) //
// len(a) <= len(b)
// //
//go:noescape //go:noescape
func matchLen(a []byte, b []byte) int func matchLen(a []byte, b []byte) int

View File

@@ -102,7 +102,7 @@ func GenerateWorkflow(s *thirdparty.Suite) ([]byte, error) {
g.Linef("- name: Install Go") g.Linef("- name: Install Go")
g.Linef(" uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0") g.Linef(" uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3.0.0")
g.Linef(" with:") g.Linef(" with:")
g.Linef(" go-version: 1.18.x") g.Linef(" go-version: 1.19.x")
g.Linef(" check-latest: true") g.Linef(" check-latest: true")
// Checkout avo. // Checkout avo.

View File

@@ -749,10 +749,10 @@
"stars": 103424 "stars": 103424
}, },
"default_branch": "master", "default_branch": "master",
"version": "go1.17.3", "version": "go1.19",
"packages": [ "packages": [
{ {
"module": "src/crypto/ed25519/internal/edwards25519/field/_asm/go.mod", "module": "src/crypto/internal/edwards25519/field/_asm/go.mod",
"setup": [ "setup": [
{ {
"name": "Compile Go Toolchain", "name": "Compile Go Toolchain",
@@ -764,7 +764,7 @@
], ],
"generate": [ "generate": [
{ {
"dir": "src/crypto/ed25519/internal/edwards25519/field/_asm", "dir": "src/crypto/internal/edwards25519/field/_asm",
"commands": [ "commands": [
"go generate -v -x" "go generate -v -x"
] ]

File diff suppressed because it is too large Load Diff