aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2021-06-27 18:06:52 +0200
committerBjørn Erik Pedersen <[email protected]>2021-06-27 18:06:52 +0200
commit3a6dc6d3f423c4acb79ef21b5a76e616fa2c9477 (patch)
tree901059ee05e93c2991f0389dce0c26ca7b0e6ce2 /modules
parent6cd2110ab295f598907a18da91e34d31407c1d9d (diff)
downloadhugo-3a6dc6d3f423c4acb79ef21b5a76e616fa2c9477.tar.gz
hugo-3a6dc6d3f423c4acb79ef21b5a76e616fa2c9477.zip
modules: Use value type for module.Time
Which is in line with how we do it elsewhere.
Diffstat (limited to 'modules')
-rw-r--r--modules/module.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/module.go b/modules/module.go
index a6feaab73..0d094fe87 100644
--- a/modules/module.go
+++ b/modules/module.go
@@ -68,7 +68,7 @@ type Module interface {
Version() string
// Time version was created.
- Time() *time.Time
+ Time() time.Time
// Whether this module's dir is a watch candidate.
Watch() bool
@@ -159,12 +159,13 @@ func (m *moduleAdapter) Version() string {
return m.gomod.Version
}
-func (m *moduleAdapter) Time() *time.Time {
+func (m *moduleAdapter) Time() time.Time {
if !m.IsGoMod() || m.gomod.Time == nil {
- return nil
+ return time.Time{}
}
- return m.gomod.Time
+ return *m.gomod.Time
+
}
func (m *moduleAdapter) Watch() bool {