fix gofmt and golint

This commit is contained in:
andyzhangx 2019-01-07 06:14:38 +00:00
parent 3432e89c1e
commit 0c6e8b6cc8
5 changed files with 10 additions and 15 deletions

View File

@ -44,7 +44,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
if len(name) == 0 {
return nil, status.Error(codes.InvalidArgument, "CreateVolume Name must be provided")
}
if volumeCapabilities == nil || len(volumeCapabilities) == 0 {
if len(volumeCapabilities) == 0 {
return nil, status.Error(codes.InvalidArgument, "CreateVolume Volume capabilities must be provided")
}
@ -92,11 +92,13 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
}
volumeID := fmt.Sprintf(volumeIDTemplate, resourceGroup, retAccount, fileShareName)
/* todo: snapshot support
if req.GetVolumeContentSource() != nil {
contentSource := req.GetVolumeContentSource()
if contentSource.GetSnapshot() != nil {
}
}
*/
glog.V(2).Infof("create file share %s on storage account %s successfully", fileShareName, retAccount)
return &csi.CreateVolumeResponse{

View File

@ -63,7 +63,7 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu
glog.Errorf("azureFile - Unmount directory %s failed with %v", targetPath, err)
return nil, err
}
notMnt = true
// notMnt = true
}
fsType := req.GetVolumeCapability().GetMount().GetFsType()
@ -111,7 +111,7 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu
}
}
mountOptions := []string{}
var mountOptions []string
source := ""
osSeparator := string(os.PathSeparator)
source = fmt.Sprintf("%s%s%s.file.%s%s%s", osSeparator, osSeparator, accountName, d.cloud.Environment.StorageEndpointSuffix, osSeparator, fileShareName)

View File

@ -25,7 +25,7 @@ import (
)
func init() {
flag.Set("logtostderr", "true")
_ = flag.Set("logtostderr", "true")
}
var (

View File

@ -83,18 +83,15 @@ func (d *CSIDriver) AddControllerServiceCapabilities(cl []csi.ControllerServiceC
}
d.Cap = csc
return
}
func (d *CSIDriver) AddNodeServiceCapabilities(nl []csi.NodeServiceCapability_RPC_Type) error {
func (d *CSIDriver) AddNodeServiceCapabilities(nl []csi.NodeServiceCapability_RPC_Type) {
var nsc []*csi.NodeServiceCapability
for _, n := range nl {
glog.V(2).Infof("Enabling node service capability: %v", n.String())
nsc = append(nsc, NewNodeServiceCapability(n))
}
d.NSCap = nsc
return nil
}
func (d *CSIDriver) AddVolumeCapabilityAccessModes(vc []csi.VolumeCapability_AccessMode_Mode) []*csi.VolumeCapability_AccessMode {

View File

@ -50,12 +50,8 @@ type nonBlockingGRPCServer struct {
}
func (s *nonBlockingGRPCServer) Start(endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer) {
s.wg.Add(1)
go s.serve(endpoint, ids, cs, ns)
return
}
func (s *nonBlockingGRPCServer) Wait() {
@ -106,7 +102,7 @@ func (s *nonBlockingGRPCServer) serve(endpoint string, ids csi.IdentityServer, c
}
glog.Infof("Listening for connections on address: %#v", listener.Addr())
server.Serve(listener)
if err := server.Serve(listener); err != nil {
glog.Errorf("Listening for connections on address: %#v, error: %v", listener.Addr(), err)
}
}