ci: adds Go 1.19.0-rc.2 into matrix (#714)

This adds the 1.19.0-rc2. in the testing matrix.

This also formats the Godocs across the codebase, as
Go 1.19 has started auto-formatting Godoc. https://github.com/tetratelabs/wazero/issues/426

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
Takeshi Yoneda
2022-07-25 11:14:00 +09:00
committed by GitHub
parent 1689fc1bbf
commit ed068597cd
58 changed files with 626 additions and 489 deletions

View File

@@ -12,6 +12,7 @@ import (
)
// greetWasm was compiled using `cargo build --release --target wasm32-unknown-unknown`
//
//go:embed testdata/greet.wasm
var greetWasm []byte

View File

@@ -13,6 +13,7 @@ import (
)
// greetWasm was compiled using `tinygo build -o greet.wasm -scheduler=none --no-debug -target=wasi greet.go`
//
//go:embed testdata/greet.wasm
var greetWasm []byte

View File

@@ -24,6 +24,7 @@ func log(message string) {
// byteCount) to the console.
//
// Note: In TinyGo "//export" on a func is actually an import!
//
//go:wasm-module env
//export log
func _log(ptr uint32, size uint32)
@@ -35,6 +36,7 @@ func greeting(name string) string {
// _greet is a WebAssembly export that accepts a string pointer (linear memory
// offset) and calls greet.
//
//export greet
func _greet(ptr, size uint32) {
name := ptrToString(ptr, size)
@@ -46,6 +48,7 @@ func _greet(ptr, size uint32) {
//
// Note: This uses a uint64 instead of two result values for compatibility with
// WebAssembly 1.0.
//
//export greeting
func _greeting(ptr, size uint32) (ptrSize uint64) {
name := ptrToString(ptr, size)

View File

@@ -13,6 +13,7 @@ import (
)
// asWasm compiled using `npm install && npm run build`
//
//go:embed testdata/assemblyscript.wasm
var asWasm []byte

View File

@@ -13,7 +13,9 @@ import (
)
// addWasm was generated by the following:
//
// cd testdata; wat2wasm --debug-names add.wat
//
//go:embed testdata/add.wasm
var addWasm []byte

View File

@@ -13,7 +13,9 @@ import (
)
// ageCalculatorWasm was generated by the following:
//
// cd testdata; wat2wasm --debug-names age_calculator.wat
//
//go:embed testdata/age_calculator.wasm
var ageCalculatorWasm []byte

View File

@@ -17,15 +17,17 @@ import (
// The portable approach uses parameters to return additional results. The
// parameter value is a memory offset to write the next value. This is the same
// approach used by WASI.
// * resultOffsetWasmFunctions
// * resultOffsetHostFunctions
// - resultOffsetWasmFunctions
// - resultOffsetHostFunctions
//
// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md
//
// Another approach is to enable the "multiple-results" feature. While
// "multiple-results" is not yet a W3C recommendation, most WebAssembly
// runtimes support it by default, and it is include in the draft of 2.0.
// * multiValueWasmFunctions
// * multiValueHostFunctions
// - multiValueWasmFunctions
// - multiValueHostFunctions
//
// See https://github.com/WebAssembly/spec/blob/main/proposals/multi-value/Overview.md
func main() {
// Choose the context to use for function calls.
@@ -112,7 +114,9 @@ func resultOffsetHostFunctions(ctx context.Context, r wazero.Runtime) (api.Modul
}
// resultOffsetWasm was generated by the following:
//
// cd testdata; wat2wasm --debug-names result_offset.wat
//
//go:embed testdata/result_offset.wasm
var resultOffsetWasm []byte
@@ -140,7 +144,9 @@ func multiValueHostFunctions(ctx context.Context, r wazero.Runtime) (api.Module,
}
// multiValueWasm was generated by the following:
//
// cd testdata; wat2wasm --debug-names multi_value.wat
//
//go:embed testdata/multi_value.wasm
var multiValueWasm []byte

View File

@@ -11,7 +11,9 @@ import (
)
// counterWasm was generated by the following:
//
// cd testdata; wat2wasm --debug-names counter.wat
//
//go:embed testdata/counter.wasm
var counterWasm []byte

View File

@@ -15,18 +15,22 @@ import (
)
// catFS is an embedded filesystem limited to test.txt
//
//go:embed testdata/test.txt
var catFS embed.FS
// catWasmCargoWasi was compiled from testdata/cargo-wasi/cat.rs
//
//go:embed testdata/cargo-wasi/cat.wasm
var catWasmCargoWasi []byte
// catWasmTinyGo was compiled from testdata/tinygo/cat.go
//
//go:embed testdata/tinygo/cat.wasm
var catWasmTinyGo []byte
// catWasmZigCc was compiled from testdata/zig-cc/cat.c
//
//go:embed testdata/zig-cc/cat.wasm
var catWasmZigCc []byte