diff --git a/weed/filer/filer_conf.go b/weed/filer/filer_conf.go index 0a86192ec..b75fb5084 100644 --- a/weed/filer/filer_conf.go +++ b/weed/filer/filer_conf.go @@ -10,9 +10,8 @@ import ( "github.com/viant/ptrie" ) - const ( - DirectoryEtc = "/etc" + DirectoryEtc = "/etc" FilerConfName = "filer.conf" ) @@ -27,7 +26,7 @@ func NewFilerConf() (fc *FilerConf) { return fc } -func (fc *FilerConf) loadFromFiler(filer *Filer) (err error){ +func (fc *FilerConf) loadFromFiler(filer *Filer) (err error) { filerConfPath := util.NewFullPath(DirectoryEtc, FilerConfName) entry, err := filer.FindEntry(context.Background(), filerConfPath) if err != nil { @@ -79,7 +78,7 @@ var ( EmptyFilerConfPathConf = &filer_pb.FilerConf_PathConf{} ) -func (fc *FilerConf) MatchStorageRule(path string) (pathConf *filer_pb.FilerConf_PathConf){ +func (fc *FilerConf) MatchStorageRule(path string) (pathConf *filer_pb.FilerConf_PathConf) { fc.rules.MatchPrefix([]byte(path), func(key []byte, value interface{}) bool { pathConf = value.(*filer_pb.FilerConf_PathConf) return true diff --git a/weed/filesys/file.go b/weed/filesys/file.go index 9e1342370..3bffa156e 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -294,7 +294,7 @@ func (file *File) addChunks(chunks []*filer_pb.FileChunk) { // find the earliest incoming chunk newChunks := chunks earliestChunk := newChunks[0] - for i:=1;i