mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +03:00
modules: Use value type for module.Time
Which is in line with how we do it elsewhere.
This commit is contained in:
parent
6cd2110ab2
commit
3a6dc6d3f4
2 changed files with 7 additions and 6 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue