chore: update to Go 1.21

This commit is contained in:
Peter 2023-08-15 22:10:30 +02:00
parent 3a2207290f
commit d53a1531e6
Signed by: prskr
GPG key ID: C1DB5D2E8DB512F9
13 changed files with 13 additions and 22 deletions

3
api.go
View file

@ -3,10 +3,9 @@ package sdk
import ( import (
"context" "context"
"io" "io"
"log/slog"
"time" "time"
"golang.org/x/exp/slog"
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
) )

View file

@ -3,9 +3,8 @@ package sdk
import ( import (
"context" "context"
"io" "io"
"log/slog"
"os" "os"
"golang.org/x/exp/slog"
) )
var _ ExecutionContext = (*wasiExecutionContext)(nil) var _ ExecutionContext = (*wasiExecutionContext)(nil)

View file

@ -75,7 +75,7 @@ func HelpFor(pecPtr, specSize uint32) uint64 {
} }
modHelp := helper.Help() modHelp := helper.Help()
var helpResponse = &rpcv1.HelpResponse{ helpResponse := &rpcv1.HelpResponse{
Name: modHelp.Name, Name: modHelp.Name,
Description: modHelp.Description, Description: modHelp.Description,
Examples: make([]*rpcv1.TaskExample, 0, len(modHelp.Examples)), Examples: make([]*rpcv1.TaskExample, 0, len(modHelp.Examples)),

View file

@ -5,11 +5,11 @@ package integration_test
import ( import (
"context" "context"
_ "embed" _ "embed"
"log/slog"
"os" "os"
"testing" "testing"
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
"golang.org/x/exp/slog"
"code.icb4dc0.de/buildr/buildr/modules" "code.icb4dc0.de/buildr/buildr/modules"
mm "hello_world/mocks/modules" mm "hello_world/mocks/modules"

View file

@ -2,11 +2,11 @@ package module
import ( import (
"fmt" "fmt"
"log/slog"
"os" "os"
"code.icb4dc0.de/buildr/wasi-module-sdk-go/exec" "code.icb4dc0.de/buildr/wasi-module-sdk-go/exec"
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
"golang.org/x/exp/slog"
sdk "code.icb4dc0.de/buildr/wasi-module-sdk-go" sdk "code.icb4dc0.de/buildr/wasi-module-sdk-go"
) )

View file

@ -1,10 +1,11 @@
package exec package exec
import ( import (
"code.icb4dc0.de/buildr/wasi-module-sdk-go/mem"
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
"errors" "errors"
"fmt" "fmt"
"code.icb4dc0.de/buildr/wasi-module-sdk-go/mem"
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
) )
func LookPath(file string) (string, error) { func LookPath(file string) (string, error) {

View file

@ -2,8 +2,7 @@ package sdk
import ( import (
"context" "context"
"log/slog"
"golang.org/x/exp/slog"
) )
func NewExecutor(repoRoot, outDir, binDir string) Executor { func NewExecutor(repoRoot, outDir, binDir string) Executor {

3
go.mod
View file

@ -1,10 +1,9 @@
module code.icb4dc0.de/buildr/wasi-module-sdk-go module code.icb4dc0.de/buildr/wasi-module-sdk-go
go 1.20 go 1.21
require ( require (
github.com/tetratelabs/tinymem v0.1.0 github.com/tetratelabs/tinymem v0.1.0
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819
google.golang.org/protobuf v1.31.0 google.golang.org/protobuf v1.31.0
) )

2
go.sum
View file

@ -4,8 +4,6 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/tetratelabs/tinymem v0.1.0 h1:Qza1JAg9lquPPJ/CIei5qQYx7t18KLie83O2WR6CM58= github.com/tetratelabs/tinymem v0.1.0 h1:Qza1JAg9lquPPJ/CIei5qQYx7t18KLie83O2WR6CM58=
github.com/tetratelabs/tinymem v0.1.0/go.mod h1:WFFTZFhLod6lTL+UetFAopVbGaB+KFsVcIY+RUv7NeY= github.com/tetratelabs/tinymem v0.1.0/go.mod h1:WFFTZFhLod6lTL+UetFAopVbGaB+KFsVcIY+RUv7NeY=
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 h1:EDuYyU/MkFXllv9QF9819VlI9a4tzGuCbhG0ExK9o1U=
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=

View file

@ -5,10 +5,10 @@ import "C"
import ( import (
"context" "context"
"log/slog"
"code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem"
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
"golang.org/x/exp/slog"
) )
var _ slog.Handler = (*WASIHandler)(nil) var _ slog.Handler = (*WASIHandler)(nil)

View file

@ -9,9 +9,7 @@ import (
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
) )
var ( var ErrUnmatchingType = errors.New("field type does not match wire value")
ErrUnmatchingType = errors.New("field type does not match wire value")
)
func Unmarshal(input *rpcv1.ModuleSpec, into any) error { func Unmarshal(input *rpcv1.ModuleSpec, into any) error {
cfg := unmarshalConfig{ cfg := unmarshalConfig{

View file

@ -34,7 +34,6 @@ func (r *TypeRegistry) List() (refs []Reference) {
refs = make([]Reference, 0, len(r.registrations)) refs = make([]Reference, 0, len(r.registrations))
for k := range r.registrations { for k := range r.registrations {
refs = append(refs, k) refs = append(refs, k)
} }

View file

@ -8,8 +8,7 @@ import (
"code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem"
) )
type StateProxy struct { type StateProxy struct{}
}
func (s StateProxy) Set(key, state []byte) error { func (s StateProxy) Set(key, state []byte) error {
setCmd := &rpcv1.SetState{ setCmd := &rpcv1.SetState{