mirror of
https://github.com/jech/galene.git
synced 2024-11-09 02:05:59 +01:00
Fix typo in GetConfiguration.
This commit is contained in:
parent
b91d48d4ea
commit
3e52ac1253
1 changed files with 7 additions and 4 deletions
|
@ -819,6 +819,11 @@ type Configuration struct {
|
|||
Admin []ClientPattern `json:"admin"`
|
||||
}
|
||||
|
||||
func (conf Configuration) Zero() bool {
|
||||
return conf.modTime.Equal(time.Time{}) &&
|
||||
conf.fileSize == 0
|
||||
}
|
||||
|
||||
var configuration struct {
|
||||
mu sync.Mutex
|
||||
configuration *Configuration
|
||||
|
@ -836,12 +841,10 @@ func GetConfiguration() (*Configuration, error) {
|
|||
fi, err := os.Stat(filename)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
if !configuration.configuration.modTime.Equal(
|
||||
time.Time{},
|
||||
) {
|
||||
if !configuration.configuration.Zero() {
|
||||
configuration.configuration = &Configuration{}
|
||||
return configuration.configuration, nil
|
||||
}
|
||||
return configuration.configuration, nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue