1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-22 08:35:57 +01:00

Fix typo in GetConfiguration.

This commit is contained in:
Juliusz Chroboczek 2021-10-31 22:39:35 +01:00
parent b91d48d4ea
commit 3e52ac1253

View file

@ -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
}