From 046931a737c0c0cf42670e643e97f0547deacfd6 Mon Sep 17 00:00:00 2001
From: Jonathan Giannuzzi <jonathan@giannuzzi.me>
Date: Sun, 10 Nov 2024 14:29:53 -0700
Subject: [PATCH 1/3] Upgrade golangci-lint to 1.61.0

The previous version crashed under recent versions of Go.
---
 Makefile               | 2 +-
 scheduler/test/util.go | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 21abfe7..33d7b04 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 gofumpt       := mvdan.cc/gofumpt@v0.5.0
 gosimports    := github.com/rinchsan/gosimports/cmd/gosimports@v0.3.8
-golangci_lint := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
+golangci_lint := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
 
 examples/advanced/main.wasm: examples/advanced/main.go
 	@(cd $(@D); tinygo build -o main.wasm -gc=custom -tags=custommalloc -scheduler=none --no-debug -target=wasi .)
diff --git a/scheduler/test/util.go b/scheduler/test/util.go
index 357641c..c79ae64 100644
--- a/scheduler/test/util.go
+++ b/scheduler/test/util.go
@@ -3,7 +3,6 @@ package test
 import (
 	"context"
 	"errors"
-	"fmt"
 
 	v1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/runtime"
@@ -23,9 +22,9 @@ type FakeRecorder struct {
 func (f *FakeRecorder) Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) {
 	obj, ok := regarding.(*v1.ObjectReference)
 	if !ok || obj.Name == "" {
-		f.EventMsg = fmt.Sprintf(eventtype + " " + reason + " " + action + " " + note)
+		f.EventMsg = eventtype + " " + reason + " " + action + " " + note
 	} else {
-		f.EventMsg = fmt.Sprintf(obj.Name + " " + eventtype + " " + reason + " " + action + " " + note)
+		f.EventMsg = obj.Name + " " + eventtype + " " + reason + " " + action + " " + note
 	}
 }
 

From a633b50f0eec90f1d323b8616928102072c02b18 Mon Sep 17 00:00:00 2001
From: Jonathan Giannuzzi <jonathan@giannuzzi.me>
Date: Sun, 10 Nov 2024 14:55:25 -0700
Subject: [PATCH 2/3] Use Go 1.23 and TinyGo 0.34.0 in CI workflows

---
 .github/workflows/commit.yaml   | 8 ++++----
 .github/workflows/testdata.yaml | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml
index 32f7e54..edee4d6 100644
--- a/.github/workflows/commit.yaml
+++ b/.github/workflows/commit.yaml
@@ -25,7 +25,7 @@ jobs:
     strategy:
       matrix:
         go-version:  # Note: Go only supports 2 versions: https://go.dev/doc/devel/release#policy
-          - "1.20"
+          - "1.23"
 
     steps:
       - uses: actions/checkout@v3
@@ -51,7 +51,7 @@ jobs:
     strategy:
       matrix:
         go-version:  # Note: Go only supports 2 versions: https://go.dev/doc/devel/release#policy
-          - "1.20"
+          - "1.23"
 
     steps:
       - uses: actions/checkout@v3
@@ -67,9 +67,9 @@ jobs:
     strategy:
       matrix:
         go-version:  # Note: Go only supports 2 versions: https://go.dev/doc/devel/release#policy
-          - "1.20"
+          - "1.23"
         tinygo-version:  # Note: TinyGo only supports latest: https://github.com/tinygo-org/tinygo/releases
-          - "0.28.1"  # Latest
+          - "0.34.0"  # Latest
 
     steps:
       - uses: actions/checkout@v3
diff --git a/.github/workflows/testdata.yaml b/.github/workflows/testdata.yaml
index bca67d1..8c67a37 100644
--- a/.github/workflows/testdata.yaml
+++ b/.github/workflows/testdata.yaml
@@ -27,9 +27,9 @@ jobs:
     strategy:
       matrix:
         go-version:  # Note: Go only supports 2 versions: https://go.dev/doc/devel/release#policy
-          - "1.20"
+          - "1.23"
         tinygo-version:  # Note: TinyGo only supports latest: https://github.com/tinygo-org/tinygo/releases
-          - "0.28.1"  # Latest
+          - "0.34.0"  # Latest
 
     steps:
       - uses: actions/checkout@v3

From 4626cc6f56f3f46230dfbc43efb5262d99363eae Mon Sep 17 00:00:00 2001
From: Jonathan Giannuzzi <jonathan@giannuzzi.me>
Date: Sun, 10 Nov 2024 15:43:24 -0700
Subject: [PATCH 3/3] Use a more robust way to create
 `guest/.tinygo-target.json`

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 33d7b04..638c354 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ bench-guest: guest/.tinygo-target.json
 # This makes a wasi target that uses the same wazero version as the scheduler.
 wazero_version := $(shell (cd scheduler; go list -f '{{ .Module.Version }}' github.com/tetratelabs/wazero))
 guest/.tinygo-target.json: scheduler/go.mod
-	@sed 's~"wasmtime.*"~"go run github.com/tetratelabs/wazero/cmd/wazero@$(wazero_version) run {}"~' $(shell tinygo env TINYGOROOT)/targets/wasi.json > $@
+	@jq '."emulator" = "go run github.com/tetratelabs/wazero/cmd/wazero@$(wazero_version) run {}"' $(shell tinygo env TINYGOROOT)/targets/wasi.json > $@
 
 .PHONY: build-wat
 build-wat: $(wildcard scheduler/test/testdata/*/*.wat)