Browse Source

go fmt

pull/855/head
Chris Lu 6 years ago
parent
commit
7103c1ab7e
  1. 2
      weed/operation/submit.go
  2. 2
      weed/server/raft_server.go
  3. 2
      weed/topology/topology.go

2
weed/operation/submit.go

@ -198,7 +198,7 @@ func (fi FilePart) Upload(maxMB int, master string, jwt security.EncodedJwt) (re
} }
func upload_one_chunk(filename string, reader io.Reader, master, func upload_one_chunk(filename string, reader io.Reader, master,
fileUrl string, jwt security.EncodedJwt,
fileUrl string, jwt security.EncodedJwt,
) (size uint32, e error) { ) (size uint32, e error) {
glog.V(4).Info("Uploading part ", filename, " to ", fileUrl, "...") glog.V(4).Info("Uploading part ", filename, " to ", fileUrl, "...")
uploadResult, uploadError := Upload(fileUrl, filename, reader, false, uploadResult, uploadError := Upload(fileUrl, filename, reader, false,

2
weed/server/raft_server.go

@ -131,7 +131,7 @@ func isPeersChanged(dir string, self string, peers []string) (oldPeers []string,
func isTheFirstOne(self string, peers []string) bool { func isTheFirstOne(self string, peers []string) bool {
sort.Strings(peers) sort.Strings(peers)
if len(peers)<=0{
if len(peers) <= 0 {
return true return true
} }
return self == peers[0] return self == peers[0]

2
weed/topology/topology.go

@ -50,7 +50,7 @@ func NewTopology(id string, seq sequence.Sequencer, volumeSizeLimit uint64, puls
} }
func (t *Topology) IsLeader() bool { func (t *Topology) IsLeader() bool {
if t.RaftServer!=nil {
if t.RaftServer != nil {
return t.RaftServer.State() == raft.Leader return t.RaftServer.State() == raft.Leader
} }
if leader, e := t.Leader(); e == nil { if leader, e := t.Leader(); e == nil {

Loading…
Cancel
Save