Skip to content

Commit 0a14044

Browse files
committed
chore: fix lint errors
Signed-off-by: Matt Leon <mattleon@google.com>
1 parent efea0d3 commit 0a14044

File tree

4 files changed

+2
-13
lines changed

4 files changed

+2
-13
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
goimports := golang.org/x/tools/cmd/goimports@v0.21.0
2-
golangci_lint := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.0
2+
golangci_lint := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
33

44

55
.PHONY: build.example

examples/helloworld/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ type helloWorld struct {
5050

5151
// OnPluginStart implements types.PluginContext.
5252
func (ctx *helloWorld) OnPluginStart(pluginConfigurationSize int) types.OnPluginStartStatus {
53-
rand.Seed(time.Now().UnixNano())
54-
5553
proxywasm.LogInfo("OnPluginStart from Go!")
5654
if err := proxywasm.SetTickPeriodMilliSeconds(tickMilliseconds); err != nil {
5755
proxywasm.LogCriticalf("failed to set tick period: %v", err)

proxywasm/internal/abi_callback_l4.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ func proxyOnNewConnection(contextID uint32) types.Action {
3333
return ctx.OnNewConnection()
3434
}
3535

36-
func proxyOnDownstreamData_exp(contextID uint32, dataSize int32, endOfStream int32) types.Action {
37-
return proxyOnDownstreamData(contextID, dataSize, endOfStream != 0)
38-
}
39-
4036
//go:wasmexport proxy_on_downstream_data
4137
func proxyOnDownstreamData(contextID uint32, dataSize int32, endOfStream bool) types.Action {
4238
if recordTiming {

proxywasm/proxytest/wasmwrapper.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"context"
1919
"io"
2020
"os"
21-
"reflect"
2221
"unsafe"
2322

2423
"github.com/tetratelabs/wazero"
@@ -288,11 +287,7 @@ func copyBytesToWasm(ctx context.Context, mod api.Module, hostPtr *byte, size in
288287
if size == 0 {
289288
return
290289
}
291-
var hostSlice []byte
292-
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&hostSlice))
293-
hdr.Data = uintptr(unsafe.Pointer(hostPtr))
294-
hdr.Cap = int(size)
295-
hdr.Len = int(size)
290+
hostSlice := unsafe.Slice(hostPtr, size)
296291

297292
alloc := mod.ExportedFunction("proxy_on_memory_allocate")
298293
res, err := alloc.Call(ctx, uint64(size))

0 commit comments

Comments
 (0)