Skip to content

Commit

Permalink
Removing gjson to fix the Dependabot alert (cloudspannerecosystem#58)
Browse files Browse the repository at this point in the history
* Removing the dependency to gjson.

* Cleaning up the go.mod and go.sum after removing gjson.
  • Loading branch information
bgood authored Nov 18, 2021
1 parent 89860fb commit 88d673b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ require (
github.com/stretchr/testify v1.7.0
github.com/swaggo/gin-swagger v1.3.1
github.com/swaggo/swag v1.7.1
github.com/tidwall/gjson v1.9.0
github.com/valyala/fasthttp v1.15.1 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
go.uber.org/zap v1.19.1
Expand Down Expand Up @@ -65,8 +64,6 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sergi/go-diff v1.0.0 // indirect
github.com/tidwall/match v1.0.3 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/ugorji/go/codec v1.2.6 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
Expand Down
7 changes: 0 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,6 @@ github.com/swaggo/gin-swagger v1.3.1/go.mod h1:Z6NtRBK2PRig0EUmy1Xu75CnCEs6vGYu9
github.com/swaggo/swag v1.5.1/go.mod h1:1Bl9F/ZBpVWh22nY0zmYyASPO1lI/zIwRDrpZU+tv8Y=
github.com/swaggo/swag v1.7.1 h1:gY9ZakXlNWg/i/v5bQBic7VMZ4teq4m89lpiao74p/s=
github.com/swaggo/swag v1.7.1/go.mod h1:gAiHxNTb9cIpNmA/VEGUP+CyZMCP/EW7mdtc8Bny+p8=
github.com/tidwall/gjson v1.9.0 h1:+Od7AE26jAaMgVC31cQV/Ope5iKXulNMflrlB7k+F9E=
github.com/tidwall/gjson v1.9.0/go.mod h1:5/xDoumyyDNerp2U36lyolv46b3uF/9Bu6OfyQ9GImk=
github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE=
github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.1.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc=
github.com/ugorji/go v1.2.6 h1:tGiWC9HENWE2tqYycIqFTNorMmFRVhNwCpDOpWqnk8E=
Expand Down
6 changes: 2 additions & 4 deletions storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/cloudspannerecosystem/dynamodb-adapter/models"
"github.com/cloudspannerecosystem/dynamodb-adapter/pkg/logger"
"github.com/cloudspannerecosystem/dynamodb-adapter/utils"
"github.com/tidwall/gjson"
)

// Storage object for intracting with storage package
Expand All @@ -38,7 +37,7 @@ type Storage struct {
// storage - global instance of storage
var storage *Storage

func initSpannerDriver(instance string, m map[string]*gjson.Result) *spanner.Client {
func initSpannerDriver(instance string) *spanner.Client {
conf := spanner.ClientConfig{}

str := "projects/" + config.ConfigurationMap.GoogleProjectID + "/instances/" + instance + "/databases/" + config.ConfigurationMap.SpannerDb
Expand All @@ -54,10 +53,9 @@ func InitializeDriver() {

storage = new(Storage)
storage.spannerClient = make(map[string]*spanner.Client)
config := map[string]*gjson.Result{}
for _, v := range models.SpannerTableMap {
if _, ok := storage.spannerClient[v]; !ok {
storage.spannerClient[v] = initSpannerDriver(v, config)
storage.spannerClient[v] = initSpannerDriver(v)
}
}
}
Expand Down

0 comments on commit 88d673b

Please sign in to comment.