Skip to content

Commit

Permalink
Fix linting issues by removing unnecessary code or fixing reported is…
Browse files Browse the repository at this point in the history
…sues
  • Loading branch information
mostafa committed Aug 8, 2022
1 parent 0d9184b commit 0bab0ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions schema_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (k *Kafka) schemaRegistryClientClass(call goja.ConstructorCall) *goja.Objec
}

var metadata *Container
if params, ok := call.Argument(0).Export().(interface{}); ok {
if params, ok := call.Argument(0).Export().(map[string]interface{}); ok {
if b, err := json.Marshal(params); err != nil {
common.Throw(runtime, err)
} else {
Expand All @@ -217,7 +217,7 @@ func (k *Kafka) schemaRegistryClientClass(call goja.ConstructorCall) *goja.Objec
}

var metadata *Container
if params, ok := call.Argument(0).Export().(interface{}); ok {
if params, ok := call.Argument(0).Export().(map[string]interface{}); ok {
if b, err := json.Marshal(params); err != nil {
common.Throw(runtime, err)
} else {
Expand Down
2 changes: 1 addition & 1 deletion serdes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func TestSerdes(t *testing.T) {
})
assert.Equal(t, 1, len(messages))

if value, ok := messages[0]["value"].(interface{}); ok {
if value, ok := messages[0]["value"].(map[string]interface{}); ok {
// Deserialize the key or value (removes the magic bytes).
deserialized := test.module.Kafka.deserialize(&Container{
Data: value,
Expand Down
5 changes: 0 additions & 5 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package kafka
import (
"encoding/base64"
"encoding/json"
"unicode/utf8"

"github.com/dop251/goja"
)
Expand Down Expand Up @@ -61,7 +60,3 @@ func isJSON(data []byte) bool {
}
return false
}

func isValidUTF8String(data []byte) bool {
return utf8.Valid(data)
}

0 comments on commit 0bab0ba

Please sign in to comment.