Browse Source

go fmt

pull/1560/head
Chris Lu 4 years ago
parent
commit
da36abf033
  1. 2
      weed/command/master.go
  2. 2
      weed/filesys/dirty_page.go
  3. 2
      weed/filesys/dirty_page_interval.go
  4. 2
      weed/filesys/filehandle.go
  5. 2
      weed/s3api/s3api_bucket_handlers.go

2
weed/command/master.go

@ -90,7 +90,7 @@ func runMaster(cmd *Command, args []string) bool {
grace.SetupProfiling(*masterCpuProfile, *masterMemProfile)
parent, _ := util.FullPath(*m.metaFolder).DirAndName()
if util.FileExists(string(parent)) && !util.FileExists(*m.metaFolder){
if util.FileExists(string(parent)) && !util.FileExists(*m.metaFolder) {
os.MkdirAll(*m.metaFolder, 0755)
}
if err := util.TestFolderWritable(util.ResolvePath(*m.metaFolder)); err != nil {

2
weed/filesys/dirty_page.go

@ -14,7 +14,7 @@ import (
var (
concurrentWriterLimit = runtime.NumCPU()
concurrentWriters = util.NewLimitedConcurrentExecutor(4 * concurrentWriterLimit)
concurrentWriters = util.NewLimitedConcurrentExecutor(4 * concurrentWriterLimit)
)
type ContinuousDirtyPages struct {

2
weed/filesys/dirty_page_interval.go

@ -95,7 +95,7 @@ func (c *ContinuousIntervals) AddInterval(data []byte, offset int64) {
// append to the tail and return
if len(c.lists) == 1 {
lastSpan := c.lists[0]
if lastSpan.Tail.Offset + lastSpan.Tail.Size == offset {
if lastSpan.Tail.Offset+lastSpan.Tail.Size == offset {
lastSpan.addNodeToTail(interval)
return
}

2
weed/filesys/filehandle.go

@ -126,7 +126,7 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) {
totalRead, err := fh.f.reader.ReadAt(buff, offset)
if err != nil && err != io.EOF{
if err != nil && err != io.EOF {
glog.Errorf("file handle read %s: %v", fh.f.fullpath(), err)
}

2
weed/s3api/s3api_bucket_handlers.go

@ -67,7 +67,7 @@ func (s3a *S3ApiServer) PutBucketHandler(w http.ResponseWriter, r *http.Request)
}); err != nil {
glog.Errorf("list collection: %v", err)
return fmt.Errorf("list collections: %v", err)
}else {
} else {
for _, c := range resp.Collections {
if bucket == c.Name {
errCode = s3err.ErrBucketAlreadyExists

Loading…
Cancel
Save