Skip to content

Commit

Permalink
update commons dependecy
Browse files Browse the repository at this point in the history
  • Loading branch information
sanzmauro committed Oct 4, 2024
1 parent 8cc7e7a commit 4cfa941
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/gin-gonic/gin v1.10.0
github.com/google/uuid v1.3.0
github.com/splitio/gincache v1.0.1
github.com/splitio/go-split-commons/v6 v6.0.2-0.20241003203711-098c0ea804b3
github.com/splitio/go-split-commons/v6 v6.0.2-0.20241004152517-7bdd98db88c9
github.com/splitio/go-toolkit/v5 v5.4.0
github.com/stretchr/testify v1.9.0
go.etcd.io/bbolt v1.3.6
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ github.com/splitio/go-split-commons/v6 v6.0.2-0.20241003202846-c19d3164beda h1:t
github.com/splitio/go-split-commons/v6 v6.0.2-0.20241003202846-c19d3164beda/go.mod h1:TsvIh3XP7yjc7ly4vpj06AkoBND36SodPs5qfhb8rHc=
github.com/splitio/go-split-commons/v6 v6.0.2-0.20241003203711-098c0ea804b3 h1:S3h7x9d11SRMW8S9OtL9EPOEcrT6dD2jLoozq6kWes4=
github.com/splitio/go-split-commons/v6 v6.0.2-0.20241003203711-098c0ea804b3/go.mod h1:TsvIh3XP7yjc7ly4vpj06AkoBND36SodPs5qfhb8rHc=
github.com/splitio/go-split-commons/v6 v6.0.2-0.20241004152517-7bdd98db88c9 h1:ohS89uGBqOu7Yk0+mbYMbilHCEgAXDrPOatzKouibIA=
github.com/splitio/go-split-commons/v6 v6.0.2-0.20241004152517-7bdd98db88c9/go.mod h1:TsvIh3XP7yjc7ly4vpj06AkoBND36SodPs5qfhb8rHc=
github.com/splitio/go-toolkit/v5 v5.4.0 h1:g5WFpRhQomnXCmvfsNOWV4s5AuUrWIZ+amM68G8NBKM=
github.com/splitio/go-toolkit/v5 v5.4.0/go.mod h1:xYhUvV1gga9/1029Wbp5pjnR6Cy8nvBpjw99wAbsMko=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
15 changes: 7 additions & 8 deletions splitio/proxy/controllers/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,17 @@ func (c *SdkServerController) Memberships(ctx *gin.Context) {
ctx.JSON(http.StatusInternalServerError, gin.H{})
}

mySegments := make([]dtos.MemItem, 0, len(segmentList))
mySegments := make([]dtos.Segment, 0, len(segmentList))
for _, segmentName := range segmentList {
mySegments = append(mySegments, dtos.MemItem{Name: segmentName})
mySegments = append(mySegments, dtos.Segment{Name: segmentName})
}

payoad := dtos.MembershipsDTO{
MySegments: dtos.Member{
Keys: mySegments,
payoad := dtos.MembershipsResponseDTO{
MySegments: dtos.Memberships{
Segments: mySegments,
},
LargeSegments: dtos.Member{
Keys: []dtos.MemItem{},
ChangeNumber: 0,
MyLargeSegments: dtos.Memberships{
Segments: []dtos.Segment{},
},
}

Expand Down
8 changes: 4 additions & 4 deletions splitio/proxy/controllers/sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,13 +575,13 @@ func TestMemberships(t *testing.T) {
body, err := io.ReadAll(resp.Body)
assert.Nil(t, err)

var memberships dtos.MembershipsDTO
var memberships dtos.MembershipsResponseDTO
err = json.Unmarshal(body, &memberships)
assert.Nil(t, err)

assert.Equal(t, dtos.MembershipsDTO{
MySegments: dtos.Member{Keys: []dtos.MemItem{{Name: "segment1"}, {Name: "segment2"}, {Name: "segmentTest"}}},
LargeSegments: dtos.Member{Keys: []dtos.MemItem{}},
assert.Equal(t, dtos.MembershipsResponseDTO{
MySegments: dtos.Memberships{Segments: []dtos.Segment{{Name: "segment1"}, {Name: "segment2"}, {Name: "segmentTest"}}},
MyLargeSegments: dtos.Memberships{Segments: []dtos.Segment{}},
}, memberships)

splitStorage.AssertExpectations(t)
Expand Down

0 comments on commit 4cfa941

Please sign in to comment.