Skip to content

Commit

Permalink
Use uuid-utils-go library for UUID generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
iulianp26 committed May 12, 2017
1 parent 6e79e96 commit b22ab14
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 59 deletions.
57 changes: 0 additions & 57 deletions UUID.go

This file was deleted.

4 changes: 3 additions & 1 deletion mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"encoding/json"
"fmt"
uuidUtils "github.com/Financial-Times/uuid-utils-go"
)

const (
Expand All @@ -28,7 +29,8 @@ func (m *relatedContentMapper) mapRelatedContent() ([]byte, string, error) {
return nil, "", err
}

collectionContainerUUID := NewNameUUIDFromBytes([]byte(videoUUID)).String()
uuid := uuidUtils.NewV5UUIDFrom(videoUUID)
collectionContainerUUID := uuid.String()

var cc ContentCollection
if !m.isDeleteEvent() {
Expand Down
5 changes: 4 additions & 1 deletion mapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"encoding/json"
uuidUtils "github.com/Financial-Times/uuid-utils-go"
"github.com/stretchr/testify/assert"
"io/ioutil"
"testing"
Expand Down Expand Up @@ -237,7 +238,9 @@ func newRelatedItem(id interface{}) map[string]interface{} {
}

func newStringMappedContent(t *testing.T, itemUUID string, tid string, msgDate string) string {
ccUUID := NewNameUUIDFromBytes([]byte(testVideoUUID)).String()
uuid := uuidUtils.NewV5UUIDFrom(testVideoUUID)
ccUUID := uuid.String()

var cc ContentCollection
if itemUUID != "" {
items := []Item{{itemUUID}}
Expand Down
14 changes: 14 additions & 0 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@
"version": "0.1.0",
"versionExact": "0.1.0"
},
{
"checksumSHA1": "CphoWOjfAWc2hFo1e9SBuLaAnMU=",
"path": "github.com/Financial-Times/uuid-utils-go",
"revision": "6a93dec4ed9646eb79596fcac3fda379974d9d2f",
"revisionTime": "2017-05-12T09:08:27Z",
"version": "1.0.0",
"versionExact": "1.0.0"
},
{
"checksumSHA1": "NSJhlFlJwKJ90vd+jpwiXY/VYh0=",
"path": "github.com/Sirupsen/logrus",
Expand Down Expand Up @@ -106,6 +114,12 @@
"revision": "4d4bfba8f1d1027c4fdbe371823030df51419987",
"revisionTime": "2017-01-30T11:31:45Z"
},
{
"checksumSHA1": "hRpSBofTFAM50mVLe4sID2rP2v8=",
"path": "github.com/willf/bitset",
"revision": "988f4f24992fc745de53c42df0da6581e42a6686",
"revisionTime": "2017-05-05T19:16:46Z"
},
{
"checksumSHA1": "ArDa4bMPKzhiS1I7iioemBwZ6tE=",
"path": "golang.org/x/sys/unix",
Expand Down

0 comments on commit b22ab14

Please sign in to comment.