Skip to content

Commit 0d4d262

Browse files
authored
Reformat code with go 1.19 (#98)
Formatting rules were updated in go 1.19. Reformat the code so it's valid both in go 1.18 and 1.19.
1 parent afd7d8b commit 0d4d262

16 files changed

+26
-26
lines changed

cmd/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package main ...
17+
// Package main ...
1818
package main
1919

2020
import (

pkg/ibmcsidriver/constants.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (

pkg/ibmcsidriver/controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (

pkg/ibmcsidriver/controller_helper.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (
@@ -109,7 +109,7 @@ func areVolumeCapabilitiesSupported(volCaps []*csi.VolumeCapability, driverVolum
109109
return allSupported
110110
}
111111

112-
//getVolumeParameters this function get the parameters from storage class, this also validate
112+
// getVolumeParameters this function get the parameters from storage class, this also validate
113113
// all parameters passed in storage class or not which are mandatory.
114114
func getVolumeParameters(logger *zap.Logger, req *csi.CreateVolumeRequest, config *config.Config) (*provider.Volume, error) {
115115
var encrypt = "undef"

pkg/ibmcsidriver/controller_helper_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (

pkg/ibmcsidriver/controller_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (

pkg/ibmcsidriver/ibm_csi_driver.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (

pkg/ibmcsidriver/ibm_csi_driver_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (

pkg/ibmcsidriver/identity.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (

pkg/ibmcsidriver/identity_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (

pkg/ibmcsidriver/node.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (
@@ -73,7 +73,7 @@ type VolumeStatUtils struct {
7373
type VolumeMountUtils struct {
7474
}
7575

76-
//FSInfo ...
76+
// FSInfo ...
7777
func (su *VolumeStatUtils) FSInfo(path string) (int64, int64, int64, int64, int64, int64, error) {
7878
return fs.Info(path)
7979
}

pkg/ibmcsidriver/node_helper.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (
@@ -93,8 +93,8 @@ func (csiNS *CSINodeServer) processMount(ctxLogger *zap.Logger, requestID, stagi
9393
return &csi.NodePublishVolumeResponse{}, nil
9494
}
9595

96-
//This will handle raw block volume mounts
97-
//Incase of RAW volume mount, the Target will be devicefilepath and NOT a mount directory.
96+
// This will handle raw block volume mounts
97+
// Incase of RAW volume mount, the Target will be devicefilepath and NOT a mount directory.
9898
// The mountType is "bind" mount and will not specify any FORMAT(e.g ext4, ext3..)
9999
// e.g SOURCE (volume provider attached device on Host): /dev/xvde
100100
// e.g TARGET (SoftLink to User defined POD device /dev/sda) : "/var/data/kubelet/plugins/kubernetes.io/csi/volumeDevices/publish/pvc-9b82dced-fcd6-4181-968e-ae269e0f2311"

pkg/ibmcsidriver/node_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (

pkg/ibmcsidriver/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (

pkg/ibmcsidriver/server_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//Package ibmcsidriver ...
17+
// Package ibmcsidriver ...
1818
package ibmcsidriver
1919

2020
import (

tests/sanity/sanity_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -474,14 +474,14 @@ func (c *fakeProviderSession) AttachVolume(attachRequest provider.VolumeAttachme
474474
return attachmentDetails, nil
475475
}
476476

477-
//Detach detaches the volume/ fileset from the server
478-
//Its non bloking call and does not wait to complete the detachment
477+
// Detach detaches the volume/ fileset from the server
478+
// Its non bloking call and does not wait to complete the detachment
479479
func (c *fakeProviderSession) DetachVolume(detachRequest provider.VolumeAttachmentRequest) (*http.Response, error) {
480480
return nil, nil
481481
}
482482

483-
//WaitForAttachVolume waits for the volume to be attached to the host
484-
//Return error if wait is timed out OR there is other error
483+
// WaitForAttachVolume waits for the volume to be attached to the host
484+
// Return error if wait is timed out OR there is other error
485485
func (c *fakeProviderSession) WaitForAttachVolume(attachRequest provider.VolumeAttachmentRequest) (*provider.VolumeAttachmentResponse, error) {
486486
if len(attachRequest.InstanceID) == 0 {
487487
return nil, errors.New("no instance ID passed")
@@ -496,13 +496,13 @@ func (c *fakeProviderSession) WaitForAttachVolume(attachRequest provider.VolumeA
496496
}, nil
497497
}
498498

499-
//WaitForDetachVolume waits for the volume to be detached from the host
500-
//Return error if wait is timed out OR there is other error
499+
// WaitForDetachVolume waits for the volume to be detached from the host
500+
// Return error if wait is timed out OR there is other error
501501
func (c *fakeProviderSession) WaitForDetachVolume(detachRequest provider.VolumeAttachmentRequest) error {
502502
return nil
503503
}
504504

505-
//GetAttachAttachment retirves the current status of given volume attach request
505+
// GetAttachAttachment retirves the current status of given volume attach request
506506
func (c *fakeProviderSession) GetVolumeAttachment(attachRequest provider.VolumeAttachmentRequest) (*provider.VolumeAttachmentResponse, error) {
507507
return nil, nil
508508
}

0 commit comments

Comments
 (0)