diff --git a/weed/command/webdav.go b/weed/command/webdav.go index a7062d8cd..bf4609d63 100644 --- a/weed/command/webdav.go +++ b/weed/command/webdav.go @@ -103,16 +103,16 @@ func (wo *WebDavOption) startWebDav() bool { } ws, webdavServer_err := weed_server.NewWebDavServer(&weed_server.WebDavOption{ - Filer: filerAddress, - GrpcDialOption: grpcDialOption, - Collection: *wo.collection, - Replication: *wo.replication, - DiskType: *wo.disk, - Uid: uid, - Gid: gid, - Cipher: cipher, - CacheDir: util.ResolvePath(*wo.cacheDir), - CacheSizeMB: *wo.cacheSizeMB, + Filer: filerAddress, + GrpcDialOption: grpcDialOption, + Collection: *wo.collection, + Replication: *wo.replication, + DiskType: *wo.disk, + Uid: uid, + Gid: gid, + Cipher: cipher, + CacheDir: util.ResolvePath(*wo.cacheDir), + CacheSizeMB: *wo.cacheSizeMB, }) if webdavServer_err != nil { glog.Fatalf("WebDav Server startup error: %v", webdavServer_err) diff --git a/weed/ftpd/ftp_server.go b/weed/ftpd/ftp_server.go index 4daded00a..253ff3edd 100644 --- a/weed/ftpd/ftp_server.go +++ b/weed/ftpd/ftp_server.go @@ -3,8 +3,8 @@ package ftpd import ( "crypto/tls" "errors" - "net" "github.com/chrislusf/seaweedfs/weed/util" + "net" ftpserver "github.com/fclairamb/ftpserverlib" "google.golang.org/grpc" diff --git a/weed/iamapi/iamapi_server.go b/weed/iamapi/iamapi_server.go index c8ff1042e..9fea30780 100644 --- a/weed/iamapi/iamapi_server.go +++ b/weed/iamapi/iamapi_server.go @@ -33,10 +33,10 @@ type IamS3ApiConfigure struct { } type IamServerOption struct { - Masters []pb.ServerAddress - Filer pb.ServerAddress - Port int - GrpcDialOption grpc.DialOption + Masters []pb.ServerAddress + Filer pb.ServerAddress + Port int + GrpcDialOption grpc.DialOption } type IamApiServer struct { @@ -49,7 +49,7 @@ var s3ApiConfigure IamS3ApiConfig func NewIamApiServer(router *mux.Router, option *IamServerOption) (iamApiServer *IamApiServer, err error) { s3ApiConfigure = IamS3ApiConfigure{ option: option, - masterClient: wdclient.NewMasterClient(option.GrpcDialOption, pb.AdminShellClient, "", "",option.Masters), + masterClient: wdclient.NewMasterClient(option.GrpcDialOption, pb.AdminShellClient, "", "", option.Masters), } s3Option := s3api.S3ApiServerOption{Filer: option.Filer} iamApiServer = &IamApiServer{ diff --git a/weed/operation/lookup.go b/weed/operation/lookup.go index daf8cd152..c222dff92 100644 --- a/weed/operation/lookup.go +++ b/weed/operation/lookup.go @@ -96,7 +96,7 @@ func LookupVolumeIds(masterFn GetMasterFn, grpcDialOption grpc.DialOption, vids locations = append(locations, Location{ Url: loc.Url, PublicUrl: loc.PublicUrl, - GrpcPort: int(loc.GrpcPort), + GrpcPort: int(loc.GrpcPort), }) } if vidLocations.Error != "" { diff --git a/weed/pb/grpc_client_server.go b/weed/pb/grpc_client_server.go index 0bd7b691e..08fb7fac7 100644 --- a/weed/pb/grpc_client_server.go +++ b/weed/pb/grpc_client_server.go @@ -244,4 +244,4 @@ func WithOneOfGrpcFilerClients(filerAddresses []ServerAddress, grpcDialOption gr } return err -} \ No newline at end of file +} diff --git a/weed/remote_storage/s3/s3_storage_client.go b/weed/remote_storage/s3/s3_storage_client.go index fc00bcfe5..b8701cb52 100644 --- a/weed/remote_storage/s3/s3_storage_client.go +++ b/weed/remote_storage/s3/s3_storage_client.go @@ -269,7 +269,7 @@ func (s *s3RemoteStorageClient) CreateBucket(name string) (err error) { func (s *s3RemoteStorageClient) DeleteBucket(name string) (err error) { _, err = s.conn.DeleteBucket(&s3.DeleteBucketInput{ - Bucket: aws.String(name), + Bucket: aws.String(name), }) if err != nil { return fmt.Errorf("delete bucket %s: %v", name, err) diff --git a/weed/server/filer_grpc_server_remote.go b/weed/server/filer_grpc_server_remote.go index 9f986e6aa..3c7fef90a 100644 --- a/weed/server/filer_grpc_server_remote.go +++ b/weed/server/filer_grpc_server_remote.go @@ -116,7 +116,7 @@ func (fs *FilerServer) DownloadToLocal(ctx context.Context, req *filer_pb.Downlo replicas = append(replicas, &volume_server_pb.FetchAndWriteNeedleRequest_Replica{ Url: r.Url, PublicUrl: r.PublicUrl, - GrpcPort: int32(r.GrpcPort), + GrpcPort: int32(r.GrpcPort), }) } diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go index 3e0d32189..57f2e5300 100644 --- a/weed/server/filer_server_handlers_read.go +++ b/weed/server/filer_server_handlers_read.go @@ -64,7 +64,7 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) // set etag etag := filer.ETagEntry(entry) - if ifm := r.Header.Get("If-Match"); ifm != "" && (ifm != "\""+etag+"\"" && ifm != etag){ + if ifm := r.Header.Get("If-Match"); ifm != "" && (ifm != "\""+etag+"\"" && ifm != etag) { w.WriteHeader(http.StatusPreconditionFailed) return } diff --git a/weed/server/master_grpc_server.go b/weed/server/master_grpc_server.go index 194520f49..c669adaa6 100644 --- a/weed/server/master_grpc_server.go +++ b/weed/server/master_grpc_server.go @@ -24,7 +24,7 @@ func (ms *MasterServer) SendHeartbeat(stream master_pb.Seaweed_SendHeartbeatServ defer func() { if dn != nil { dn.Counter-- - if dn.Counter > 0 { + if dn.Counter > 0 { glog.V(0).Infof("disconnect phantom volume server %s:%d remaining %d", dn.Ip, dn.Port, dn.Counter) return } diff --git a/weed/server/master_grpc_server_volume.go b/weed/server/master_grpc_server_volume.go index 49ac455fe..4048225f3 100644 --- a/weed/server/master_grpc_server_volume.go +++ b/weed/server/master_grpc_server_volume.go @@ -155,19 +155,19 @@ func (ms *MasterServer) Assign(ctx context.Context, req *master_pb.AssignRequest replicas = append(replicas, &master_pb.Location{ Url: r.Url(), PublicUrl: r.PublicUrl, - GrpcPort: uint32(r.GrpcPort), + GrpcPort: uint32(r.GrpcPort), }) } return &master_pb.AssignResponse{ - Fid: fid, + Fid: fid, Location: &master_pb.Location{ Url: dn.Url(), PublicUrl: dn.PublicUrl, GrpcPort: uint32(dn.GrpcPort), }, - Count: count, - Auth: string(security.GenJwt(ms.guard.SigningKey, ms.guard.ExpiresAfterSec, fid)), - Replicas: replicas, + Count: count, + Auth: string(security.GenJwt(ms.guard.SigningKey, ms.guard.ExpiresAfterSec, fid)), + Replicas: replicas, }, nil } //glog.V(4).Infoln("waiting for volume growing...") diff --git a/weed/server/volume_grpc_remote.go b/weed/server/volume_grpc_remote.go index aff57e52b..9114db329 100644 --- a/weed/server/volume_grpc_remote.go +++ b/weed/server/volume_grpc_remote.go @@ -53,7 +53,7 @@ func (vs *VolumeServer) FetchAndWriteNeedle(ctx context.Context, req *volume_ser } } }() - if len(req.Replicas)>0{ + if len(req.Replicas) > 0 { fileId := needle.NewFileId(v.Id, req.NeedleId, req.Cookie) for _, replica := range req.Replicas { wg.Add(1) diff --git a/weed/server/webdav_server.go b/weed/server/webdav_server.go index 239de69f8..6c1de3154 100644 --- a/weed/server/webdav_server.go +++ b/weed/server/webdav_server.go @@ -27,18 +27,18 @@ import ( ) type WebDavOption struct { - Filer pb.ServerAddress - DomainName string - BucketsPath string - GrpcDialOption grpc.DialOption - Collection string - Replication string - DiskType string - Uid uint32 - Gid uint32 - Cipher bool - CacheDir string - CacheSizeMB int64 + Filer pb.ServerAddress + DomainName string + BucketsPath string + GrpcDialOption grpc.DialOption + Collection string + Replication string + DiskType string + Uid uint32 + Gid uint32 + Cipher bool + CacheDir string + CacheSizeMB int64 } type WebDavServer struct { diff --git a/weed/shell/command_remote_cache.go b/weed/shell/command_remote_cache.go index 58b6d7b5e..2ae20d143 100644 --- a/weed/shell/command_remote_cache.go +++ b/weed/shell/command_remote_cache.go @@ -79,7 +79,7 @@ func (c *commandRemoteCache) Do(args []string, commandEnv *CommandEnv, writer io return nil } -func (c *commandRemoteCache) doCacheOneDirectory(commandEnv *CommandEnv, writer io.Writer, dir string, fileFiler *FileFilter, concurrency int) (error) { +func (c *commandRemoteCache) doCacheOneDirectory(commandEnv *CommandEnv, writer io.Writer, dir string, fileFiler *FileFilter, concurrency int) error { mappings, localMountedDir, remoteStorageMountedLocation, remoteStorageConf, detectErr := detectMountInfo(commandEnv, writer, dir) if detectErr != nil { jsonPrintln(writer, mappings) diff --git a/weed/shell/command_remote_unmount.go b/weed/shell/command_remote_unmount.go index 04fd5e388..d030143a3 100644 --- a/weed/shell/command_remote_unmount.go +++ b/weed/shell/command_remote_unmount.go @@ -118,4 +118,3 @@ func (c *commandRemoteUnmount) purgeMountedData(commandEnv *CommandEnv, dir stri return nil } - diff --git a/weed/topology/topology_test.go b/weed/topology/topology_test.go index bfe7faff7..2ece48a95 100644 --- a/weed/topology/topology_test.go +++ b/weed/topology/topology_test.go @@ -31,7 +31,7 @@ func TestHandlingVolumeServerHeartbeat(t *testing.T) { maxVolumeCounts := make(map[string]uint32) maxVolumeCounts[""] = 25 maxVolumeCounts["ssd"] = 12 - dn := rack.GetOrCreateDataNode("127.0.0.1", 34534, 0,"127.0.0.1", maxVolumeCounts) + dn := rack.GetOrCreateDataNode("127.0.0.1", 34534, 0, "127.0.0.1", maxVolumeCounts) { volumeCount := 7 @@ -177,7 +177,7 @@ func TestAddRemoveVolume(t *testing.T) { maxVolumeCounts := make(map[string]uint32) maxVolumeCounts[""] = 25 maxVolumeCounts["ssd"] = 12 - dn := rack.GetOrCreateDataNode("127.0.0.1", 34534, 0,"127.0.0.1", maxVolumeCounts) + dn := rack.GetOrCreateDataNode("127.0.0.1", 34534, 0, "127.0.0.1", maxVolumeCounts) v := storage.VolumeInfo{ Id: needle.VolumeId(1), diff --git a/weed/util/network.go b/weed/util/network.go index 43b4a794d..687b6ec22 100644 --- a/weed/util/network.go +++ b/weed/util/network.go @@ -15,11 +15,11 @@ func DetectedHostAddress() string { return "" } - if v4Address := selectIpV4(netInterfaces, true); v4Address != ""{ + if v4Address := selectIpV4(netInterfaces, true); v4Address != "" { return v4Address } - if v6Address := selectIpV4(netInterfaces, false); v6Address != ""{ + if v6Address := selectIpV4(netInterfaces, false); v6Address != "" { return v6Address } @@ -59,4 +59,4 @@ func JoinHostPort(host string, port int) string { return host + ":" + portStr } return net.JoinHostPort(host, portStr) -} \ No newline at end of file +}