mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-24 19:19:11 +08:00
go fmt
This commit is contained in:
parent
7f0d87b206
commit
dd5b582d05
@ -185,4 +185,3 @@ func VolumeId(fileId string) string {
|
||||
}
|
||||
return fileId
|
||||
}
|
||||
|
||||
|
@ -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}
|
||||
})
|
||||
|
||||
}
|
||||
|
@ -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())
|
||||
|
||||
}
|
||||
|
@ -431,7 +431,9 @@ type VolumeEcShardInformationMessage struct {
|
||||
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 (*VolumeEcShardInformationMessage) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor0, []int{4}
|
||||
}
|
||||
|
||||
func (m *VolumeEcShardInformationMessage) GetId() uint32 {
|
||||
if m != nil {
|
||||
@ -1425,7 +1427,9 @@ type GetMasterConfigurationResponse struct {
|
||||
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 (*GetMasterConfigurationResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor0, []int{32}
|
||||
}
|
||||
|
||||
func (m *GetMasterConfigurationResponse) GetMetricsAddress() string {
|
||||
if m != nil {
|
||||
|
@ -1054,7 +1054,9 @@ 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 (*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"`
|
||||
@ -1430,7 +1432,9 @@ 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 (*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,7 +2101,9 @@ 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 (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}
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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:], "/")
|
||||
|
Loading…
Reference in New Issue
Block a user