aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-03-26 00:09:01 -0700
committerChris Lu <chris.lu@gmail.com>2020-03-26 00:09:01 -0700
commitdd5b582d05a4d4f058a647370dc87030f14a976d (patch)
tree4912cf1b257d5663665ad9709fac6155f3d01765
parent7f0d87b2065ffb5e7be1bd0591416b9649839c9e (diff)
downloadseaweedfs-dd5b582d05a4d4f058a647370dc87030f14a976d.tar.xz
seaweedfs-dd5b582d05a4d4f058a647370dc87030f14a976d.zip
go fmt
-rw-r--r--weed/filer2/stream.go1
-rw-r--r--weed/filesys/dir.go2
-rw-r--r--weed/filesys/dir_test.go24
-rw-r--r--weed/pb/master_pb/master.pb.go20
-rw-r--r--weed/pb/volume_server_pb/volume_server.pb.go26
-rw-r--r--weed/s3api/s3api_handlers.go1
-rw-r--r--weed/shell/commands.go1
-rw-r--r--weed/util/fullpath.go2
8 files changed, 42 insertions, 35 deletions
diff --git a/weed/filer2/stream.go b/weed/filer2/stream.go
index bb24312fd..2a2ef5e48 100644
--- a/weed/filer2/stream.go
+++ b/weed/filer2/stream.go
@@ -185,4 +185,3 @@ func VolumeId(fileId string) string {
}
return fileId
}
-
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go
index 0b330fd4f..ee3af39c5 100644
--- a/weed/filesys/dir.go
+++ b/weed/filesys/dir.go
@@ -102,7 +102,7 @@ func (dir *Dir) newFile(name string, entry *filer_pb.Entry) fs.Node {
func (dir *Dir) newDirectory(fullpath util.FullPath, entry *filer_pb.Entry) fs.Node {
return dir.wfs.fsNodeCache.EnsureFsNode(fullpath, func() fs.Node {
- return &Dir{name: entry.Name, wfs: dir.wfs, entry: entry, parent: dir,}
+ return &Dir{name: entry.Name, wfs: dir.wfs, entry: entry, parent: dir}
})
}
diff --git a/weed/filesys/dir_test.go b/weed/filesys/dir_test.go
index 7c439756f..49c76eb5e 100644
--- a/weed/filesys/dir_test.go
+++ b/weed/filesys/dir_test.go
@@ -8,27 +8,27 @@ import (
func TestDirPath(t *testing.T) {
- p := &Dir{name:"/some"}
- p = &Dir{name:"path", parent: p}
- p = &Dir{name:"to", parent: p}
- p = &Dir{name:"a", parent: p}
- p = &Dir{name:"file", parent: p}
+ p := &Dir{name: "/some"}
+ p = &Dir{name: "path", parent: p}
+ p = &Dir{name: "to", parent: p}
+ p = &Dir{name: "a", parent: p}
+ p = &Dir{name: "file", parent: p}
assert.Equal(t, "/some/path/to/a/file", p.FullPath())
- p = &Dir{name:"/some"}
+ p = &Dir{name: "/some"}
assert.Equal(t, "/some", p.FullPath())
- p = &Dir{name:"/"}
+ p = &Dir{name: "/"}
assert.Equal(t, "/", p.FullPath())
- p = &Dir{name:"/"}
- p = &Dir{name:"path", parent: p}
+ p = &Dir{name: "/"}
+ p = &Dir{name: "path", parent: p}
assert.Equal(t, "/path", p.FullPath())
- p = &Dir{name:"/"}
- p = &Dir{name:"path", parent: p}
- p = &Dir{name:"to", parent: p}
+ p = &Dir{name: "/"}
+ p = &Dir{name: "path", parent: p}
+ p = &Dir{name: "to", parent: p}
assert.Equal(t, "/path/to", p.FullPath())
}
diff --git a/weed/pb/master_pb/master.pb.go b/weed/pb/master_pb/master.pb.go
index c33e2b768..95c9533a1 100644
--- a/weed/pb/master_pb/master.pb.go
+++ b/weed/pb/master_pb/master.pb.go
@@ -428,10 +428,12 @@ type VolumeEcShardInformationMessage struct {
EcIndexBits uint32 `protobuf:"varint,3,opt,name=ec_index_bits,json=ecIndexBits" json:"ec_index_bits,omitempty"`
}
-func (m *VolumeEcShardInformationMessage) Reset() { *m = VolumeEcShardInformationMessage{} }
-func (m *VolumeEcShardInformationMessage) String() string { return proto.CompactTextString(m) }
-func (*VolumeEcShardInformationMessage) ProtoMessage() {}
-func (*VolumeEcShardInformationMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
+func (m *VolumeEcShardInformationMessage) Reset() { *m = VolumeEcShardInformationMessage{} }
+func (m *VolumeEcShardInformationMessage) String() string { return proto.CompactTextString(m) }
+func (*VolumeEcShardInformationMessage) ProtoMessage() {}
+func (*VolumeEcShardInformationMessage) Descriptor() ([]byte, []int) {
+ return fileDescriptor0, []int{4}
+}
func (m *VolumeEcShardInformationMessage) GetId() uint32 {
if m != nil {
@@ -1422,10 +1424,12 @@ type GetMasterConfigurationResponse struct {
MetricsIntervalSeconds uint32 `protobuf:"varint,2,opt,name=metrics_interval_seconds,json=metricsIntervalSeconds" json:"metrics_interval_seconds,omitempty"`
}
-func (m *GetMasterConfigurationResponse) Reset() { *m = GetMasterConfigurationResponse{} }
-func (m *GetMasterConfigurationResponse) String() string { return proto.CompactTextString(m) }
-func (*GetMasterConfigurationResponse) ProtoMessage() {}
-func (*GetMasterConfigurationResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} }
+func (m *GetMasterConfigurationResponse) Reset() { *m = GetMasterConfigurationResponse{} }
+func (m *GetMasterConfigurationResponse) String() string { return proto.CompactTextString(m) }
+func (*GetMasterConfigurationResponse) ProtoMessage() {}
+func (*GetMasterConfigurationResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor0, []int{32}
+}
func (m *GetMasterConfigurationResponse) GetMetricsAddress() string {
if m != nil {
diff --git a/weed/pb/volume_server_pb/volume_server.pb.go b/weed/pb/volume_server_pb/volume_server.pb.go
index ca96b8d20..8b02d2bba 100644
--- a/weed/pb/volume_server_pb/volume_server.pb.go
+++ b/weed/pb/volume_server_pb/volume_server.pb.go
@@ -1051,10 +1051,12 @@ func (m *VolumeEcShardsGenerateRequest) GetCollection() string {
type VolumeEcShardsGenerateResponse struct {
}
-func (m *VolumeEcShardsGenerateResponse) Reset() { *m = VolumeEcShardsGenerateResponse{} }
-func (m *VolumeEcShardsGenerateResponse) String() string { return proto.CompactTextString(m) }
-func (*VolumeEcShardsGenerateResponse) ProtoMessage() {}
-func (*VolumeEcShardsGenerateResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{41} }
+func (m *VolumeEcShardsGenerateResponse) Reset() { *m = VolumeEcShardsGenerateResponse{} }
+func (m *VolumeEcShardsGenerateResponse) String() string { return proto.CompactTextString(m) }
+func (*VolumeEcShardsGenerateResponse) ProtoMessage() {}
+func (*VolumeEcShardsGenerateResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor0, []int{41}
+}
type VolumeEcShardsRebuildRequest struct {
VolumeId uint32 `protobuf:"varint,1,opt,name=volume_id,json=volumeId" json:"volume_id,omitempty"`
@@ -1427,10 +1429,12 @@ func (m *VolumeEcShardsToVolumeRequest) GetCollection() string {
type VolumeEcShardsToVolumeResponse struct {
}
-func (m *VolumeEcShardsToVolumeResponse) Reset() { *m = VolumeEcShardsToVolumeResponse{} }
-func (m *VolumeEcShardsToVolumeResponse) String() string { return proto.CompactTextString(m) }
-func (*VolumeEcShardsToVolumeResponse) ProtoMessage() {}
-func (*VolumeEcShardsToVolumeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{57} }
+func (m *VolumeEcShardsToVolumeResponse) Reset() { *m = VolumeEcShardsToVolumeResponse{} }
+func (m *VolumeEcShardsToVolumeResponse) String() string { return proto.CompactTextString(m) }
+func (*VolumeEcShardsToVolumeResponse) ProtoMessage() {}
+func (*VolumeEcShardsToVolumeResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor0, []int{57}
+}
type ReadVolumeFileStatusRequest struct {
VolumeId uint32 `protobuf:"varint,1,opt,name=volume_id,json=volumeId" json:"volume_id,omitempty"`
@@ -2097,8 +2101,10 @@ type QueryRequest_InputSerialization_JSONInput struct {
func (m *QueryRequest_InputSerialization_JSONInput) Reset() {
*m = QueryRequest_InputSerialization_JSONInput{}
}
-func (m *QueryRequest_InputSerialization_JSONInput) String() string { return proto.CompactTextString(m) }
-func (*QueryRequest_InputSerialization_JSONInput) ProtoMessage() {}
+func (m *QueryRequest_InputSerialization_JSONInput) String() string {
+ return proto.CompactTextString(m)
+}
+func (*QueryRequest_InputSerialization_JSONInput) ProtoMessage() {}
func (*QueryRequest_InputSerialization_JSONInput) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{70, 1, 1}
}
diff --git a/weed/s3api/s3api_handlers.go b/weed/s3api/s3api_handlers.go
index 05dd4b823..b6f3d4334 100644
--- a/weed/s3api/s3api_handlers.go
+++ b/weed/s3api/s3api_handlers.go
@@ -50,7 +50,6 @@ func (s3a *S3ApiServer) AdjustedUrl(hostAndPort string) string {
return hostAndPort
}
-
// If none of the http routes match respond with MethodNotAllowed
func notFoundHandler(w http.ResponseWriter, r *http.Request) {
glog.V(0).Infof("unsupported %s %s", r.Method, r.RequestURI)
diff --git a/weed/shell/commands.go b/weed/shell/commands.go
index 31136951e..06b46b774 100644
--- a/weed/shell/commands.go
+++ b/weed/shell/commands.go
@@ -91,7 +91,6 @@ func (ce *CommandEnv) AdjustedUrl(hostAndPort string) string {
return hostAndPort
}
-
func parseFilerUrl(entryPath string) (filerServer string, filerPort int64, path string, err error) {
if strings.HasPrefix(entryPath, "http") {
var u *url.URL
diff --git a/weed/util/fullpath.go b/weed/util/fullpath.go
index a0f907d3d..7f7a77734 100644
--- a/weed/util/fullpath.go
+++ b/weed/util/fullpath.go
@@ -41,7 +41,7 @@ func (fp FullPath) AsInode() uint64 {
// split, but skipping the root
func (fp FullPath) Split() []string {
- if fp == "" || fp == "/"{
+ if fp == "" || fp == "/" {
return []string{}
}
return strings.Split(string(fp)[1:], "/")