Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Toader, Sebastian authored and waynz0r committed Aug 1, 2023
1 parent 0a8805f commit 3f02f5f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/proxywasm/testdata/filters/multichunk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
package main

import (
//nolint:gosec
"crypto/md5"

"errors"

"github.com/tetratelabs/proxy-wasm-go-sdk/proxywasm"
"github.com/tetratelabs/proxy-wasm-go-sdk/proxywasm/types"
"github.com/tidwall/gjson"
Expand Down Expand Up @@ -49,7 +53,7 @@ type pluginContext struct {

func (ctx *pluginContext) OnPluginStart(pluginConfigurationSize int) types.OnPluginStartStatus {
pluginConfig, err := proxywasm.GetPluginConfiguration()
if err != nil && err != types.ErrorStatusNotFound {
if err != nil && !errors.Is(err, types.ErrorStatusNotFound) {
proxywasm.LogCriticalf("error reading plugin configuration: %v", err)
return types.OnPluginStartStatusFailed
}
Expand Down Expand Up @@ -97,13 +101,14 @@ func (ctx *networkContext) OnDownstreamData(dataSize int, endOfStream bool) type
}

data, err := proxywasm.GetDownstreamData(0, int(ctx.reqDataSize))
if err != nil && err != types.ErrorStatusNotFound {
if err != nil && !errors.Is(err, types.ErrorStatusNotFound) {
proxywasm.LogCriticalf("failed to get downstream data: %v", err)
return types.ActionContinue
}

proxywasm.LogInfof(">>>>>> downstream data received >>>>>>\n%s", string(data))

//nolint:gosec
checkSum := md5.Sum(data)
var b []byte
b = append(b, byte(ctx.counter))
Expand Down

0 comments on commit 3f02f5f

Please sign in to comment.