From dc7fa0ba792b05fc3b0ce3ec4f914bd776c64983 Mon Sep 17 00:00:00 2001 From: Nam Huynh Date: Mon, 9 Aug 2021 11:44:33 +0700 Subject: [PATCH] update constant --- action_create.go | 2 +- time.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/action_create.go b/action_create.go index b63d3e6..a4e35a5 100644 --- a/action_create.go +++ b/action_create.go @@ -38,7 +38,7 @@ func (s Service) Create(payload CreatePayload) { ID: payload.Author.ID, Name: payload.Author.Name, }, - CreatedAt: Now(), + CreatedAt: now(), } // Insert to db diff --git a/time.go b/time.go index 9781914..afcd4b3 100644 --- a/time.go +++ b/time.go @@ -10,13 +10,13 @@ import "time" const timezoneHCM = "Asia/Ho_Chi_Minh" -// GetHCMLocation ... -func GetHCMLocation() *time.Location { +// getHCMLocation ... +func getHCMLocation() *time.Location { l, _ := time.LoadLocation(timezoneHCM) return l } -// Now ... -func Now() time.Time { - return time.Now().In(GetHCMLocation()) +// now ... +func now() time.Time { + return time.Now().In(getHCMLocation()) }