Skip to content

Commit

Permalink
resolved Golang Lint Check Warnings meshery#575
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivanshuGupta07 committed Aug 25, 2024
1 parent 9c6bfaf commit b344285
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions config/provider/inmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package provider

import (
"sync"

"encoding/json"
"github.com/layer5io/meshkit/config"
"github.com/layer5io/meshkit/utils"
)
Expand Down Expand Up @@ -54,7 +54,8 @@ func (l *InMem) GetKey(key string) string {
func (l *InMem) GetObject(key string, result interface{}) error {
l.mutex.Lock()
defer l.mutex.Unlock()
return utils.Unmarshal(l.store[key], result)
// return utils.Unmarshal(l.store[key], result)
return json.Unmarshal([]byte(l.store[key]), result)
}

// SetObject sets an object value for the key
Expand Down
5 changes: 3 additions & 2 deletions utils/kubernetes/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package kubernetes

import (
"context"
"encoding/json"

"github.com/layer5io/meshkit/utils"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/rest"
)
Expand Down Expand Up @@ -35,7 +35,8 @@ func GetAllCustomResourcesInCluster(ctx context.Context, client rest.Interface)
}
var xcrd CRD
gvks := []*schema.GroupVersionResource{}
err = utils.Unmarshal(string(crdresult), &xcrd)
//err = utils.Unmarshal(string(crdresult), &xcrd)
err = json.Unmarshal(crdresult, &xcrd)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit b344285

Please sign in to comment.