-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates TinyGo to use Go 1.20 features (#26)
TinyGo 0.27 doesn't fully support Go 1.20, but it supports what we need. Particularly, `unsafe.SliceData` and `unsafe.StringData` were added to TinyGo 0.27 ahead of the more complete Go 1.20 version: 0.28 (not yet out). Using the approach elaborated in wazero [1.2.0](https://github.com/tetratelabs/wazero/releases/tag/v1.2.0) TinyGo examples resulted in significant performance benefits, benefits far more than just the part around the runtime. Signed-off-by: Adrian Cole <[email protected]>
- Loading branch information
1 parent
d3dc43a
commit ae25bc5
Showing
32 changed files
with
111 additions
and
88 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This is built using - https://golangci-lint.run/usage/configuration/ | ||
run: | ||
go: '1.19' | ||
go: '1.20' | ||
modules-download-mode: readonly | ||
tests: false | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
gosimports := github.com/rinchsan/gosimports/cmd/[email protected] | ||
golangci_lint := github.com/golangci/golangci-lint/cmd/[email protected] | ||
gofumpt := mvdan.cc/[email protected] | ||
gosimports := github.com/rinchsan/gosimports/cmd/[email protected] | ||
golangci_lint := github.com/golangci/golangci-lint/cmd/[email protected] | ||
|
||
.PHONY: testdata | ||
testdata: | ||
|
@@ -43,12 +44,8 @@ lint: $(golangci_lint_path) | |
|
||
.PHONY: format | ||
format: | ||
@find . -type f -name '*.go' | xargs gofmt -s -w | ||
@for f in `find . -name '*.go'`; do \ | ||
awk '/^import \($$/,/^\)$$/{if($$0=="")next}{print}' $$f > /tmp/fmt; \ | ||
mv /tmp/fmt $$f; \ | ||
done | ||
@go run $(gosimports) -local github.com/http-wasm/http-wasm-guest-tinygo -w $(shell find . -name '*.go' -type f) | ||
@go run $(gofumpt) -l -w . | ||
@go run $(gosimports) -local github.com/http-wasm/ -w $(shell find . -name '*.go' -type f) | ||
|
||
.PHONY: check | ||
check: | ||
|
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
module github.com/http-wasm/http-wasm-guest-tinygo | ||
|
||
go 1.19 | ||
// TinyGo 0.27 doesn't fully support Go 1.20, but it supports what we need. | ||
// Particularly, unsafe.SliceData, unsafe.StringData were added to TinyGo 0.27. | ||
// See https://github.com/tinygo-org/tinygo/commit/c43958972c3ffcd51e65414a346e53779edb9f97 | ||
go 1.20 |
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
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
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
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
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
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
Oops, something went wrong.