mirror of
https://github.com/minio/minio.git
synced 2025-02-28 05:49:16 -05:00
Merge pull request #138 from harshavardhana/pr_out_ignore_eof_in_readconfig_
This commit is contained in:
commit
eba86c07e9
@ -2,6 +2,7 @@ package config
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
"sync"
|
||||
@ -107,7 +108,13 @@ func (c *Config) ReadConfig() error {
|
||||
users := make(map[string]User)
|
||||
decoder := json.NewDecoder(file)
|
||||
err = decoder.Decode(&users)
|
||||
if err != nil {
|
||||
switch err {
|
||||
case io.EOF:
|
||||
return nil
|
||||
case nil:
|
||||
c.Users = users
|
||||
return nil
|
||||
default:
|
||||
return err
|
||||
}
|
||||
c.Users = users
|
||||
|
Loading…
x
Reference in New Issue
Block a user