From fb0c7bb6a66f3568f8ee22ec2dd16f93c0ec463c Mon Sep 17 00:00:00 2001 From: admiralobvious Date: Mon, 19 Nov 2018 15:02:31 -0500 Subject: [PATCH] fix creating new url mapping --- model/url.go | 1 + 1 file changed, 1 insertion(+) diff --git a/model/url.go b/model/url.go index 824c31a..03ef78b 100644 --- a/model/url.go +++ b/model/url.go @@ -24,6 +24,7 @@ type UrlMapping struct { func NewUrlMapping(url string) *UrlMapping { now := time.Now().UTC() return &UrlMapping{ + Id: bson.NewObjectId(), CreatedAt: &now, ShortUrl: token.New().Encode(), Url: url,