Skip to content

Commit dc00812

Browse files
authored
Merge pull request #1510 from saschagrunert/godot
Fix `godot` linter
2 parents 8332eef + 5675009 commit dc00812

30 files changed

+95
-95
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ linters:
2020
- gocheckcompilerdirectives
2121
- gochecksumtype
2222
- gocritic
23+
- godot
2324
- gofmt
2425
- goimports
2526
- gosmopolitan
@@ -80,7 +81,6 @@ linters:
8081
# - gocognit
8182
# - goconst
8283
# - gocyclo
83-
# - godot
8484
# - godox
8585
# - gofumpt
8686
# - goheader

cmd/crictl/attach.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var runtimeAttachCommand = &cli.Command{
8282
},
8383
}
8484

85-
// Attach sends an AttachRequest to server, and parses the returned AttachResponse
85+
// Attach sends an AttachRequest to server, and parses the returned AttachResponse.
8686
func Attach(ctx context.Context, client internalapi.RuntimeService, opts attachOptions) error {
8787
if opts.id == "" {
8888
return errors.New("ID cannot be empty")

cmd/crictl/container.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ var checkpointContainerCommand = &cli.Command{
741741
},
742742
}
743743

744-
// RunContainer starts a container in the provided sandbox
744+
// RunContainer starts a container in the provided sandbox.
745745
func RunContainer(
746746
iClient internalapi.ImageManagerService,
747747
rClient internalapi.RuntimeService,
@@ -935,7 +935,7 @@ func StopContainer(client internalapi.RuntimeService, id string, timeout int64)
935935
return nil
936936
}
937937

938-
// CheckpointContainer sends a CheckpointContainerRequest to the server
938+
// CheckpointContainer sends a CheckpointContainerRequest to the server.
939939
func CheckpointContainer(
940940
rClient internalapi.RuntimeService,
941941
id string,

cmd/crictl/exec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func ExecSync(client internalapi.RuntimeService, opts execOptions) (int, error)
147147
return 0, nil
148148
}
149149

150-
// Exec sends an ExecRequest to server, and parses the returned ExecResponse
150+
// Exec sends an ExecRequest to server, and parses the returned ExecResponse.
151151
func Exec(ctx context.Context, client internalapi.RuntimeService, opts execOptions) error {
152152
request := &pb.ExecRequest{
153153
ContainerId: opts.id,

cmd/crictl/image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ func ListImages(client internalapi.ImageManagerService, image string) (*pb.ListI
706706
return resp, nil
707707
}
708708

709-
// filterImagesList filter images based on --filter flag
709+
// filterImagesList filter images based on --filter flag.
710710
func filterImagesList(imageList []*pb.Image, filters []string) ([]*pb.Image, error) {
711711
filtered := []*pb.Image{}
712712
filtered = append(filtered, imageList...)

cmd/crictl/main.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ const defaultTimeout = 2 * time.Second
4646
const defaultTimeoutWindows = 200 * time.Second
4747

4848
var (
49-
// RuntimeEndpoint is CRI server runtime endpoint
49+
// RuntimeEndpoint is CRI server runtime endpoint.
5050
RuntimeEndpoint string
51-
// RuntimeEndpointIsSet is true when RuntimeEndpoint is configured
51+
// RuntimeEndpointIsSet is true when RuntimeEndpoint is configured.
5252
RuntimeEndpointIsSet bool
53-
// ImageEndpoint is CRI server image endpoint, default same as runtime endpoint
53+
// ImageEndpoint is CRI server image endpoint, default same as runtime endpoint.
5454
ImageEndpoint string
55-
// ImageEndpointIsSet is true when ImageEndpoint is configured
55+
// ImageEndpointIsSet is true when ImageEndpoint is configured.
5656
ImageEndpointIsSet bool
57-
// Timeout of connecting to server (default: 2s on Linux, 200s on Windows)
57+
// Timeout of connecting to server (default: 2s on Linux, 200s on Windows).
5858
Timeout time.Duration
59-
// Debug enable debug output
59+
// Debug enable debug output.
6060
Debug bool
61-
// PullImageOnCreate enables pulling image on create requests
61+
// PullImageOnCreate enables pulling image on create requests.
6262
PullImageOnCreate bool
63-
// DisablePullOnRun disable pulling image on run requests
63+
// DisablePullOnRun disable pulling image on run requests.
6464
DisablePullOnRun bool
6565
// tracerProvider is the global OpenTelemetry tracing instance.
6666
tracerProvider *sdktrace.TracerProvider

cmd/crictl/portforward.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ var runtimePortForwardCommand = &cli.Command{
6868
},
6969
}
7070

71-
// PortForward sends an PortForwardRequest to server, and parses the returned PortForwardResponse
71+
// PortForward sends an PortForwardRequest to server, and parses the returned PortForwardResponse.
7272
func PortForward(client internalapi.RuntimeService, opts portforwardOptions) error {
7373
if opts.id == "" {
7474
return errors.New("ID cannot be empty")

cmd/crictl/runtime_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var runtimeConfigCommand = &cli.Command{
4343
},
4444
}
4545

46-
// Attach sends an AttachRequest to server, and parses the returned AttachResponse
46+
// Attach sends an AttachRequest to server, and parses the returned AttachResponse.
4747
func runtimeConfig(client internalapi.RuntimeService) error {
4848
resp, err := InterruptableRPC(nil, func(ctx context.Context) (*pb.RuntimeConfigResponse, error) {
4949
return client.RuntimeConfig(ctx)

cmd/crictl/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ import (
4242
)
4343

4444
const (
45-
// truncatedImageIDLen is the truncated length of imageID
45+
// truncatedImageIDLen is the truncated length of imageID.
4646
truncatedIDLen = 13
4747
)
4848

4949
var (
5050
// The global stopCh for monitoring Interrupt signal.
5151
// DO NOT use it directly. Use SetupInterruptSignalHandler() to get it.
5252
signalIntStopCh chan struct{}
53-
// only setup stopCh once
53+
// only setup stopCh once.
5454
signalIntSetupOnce = &sync.Once{}
5555
)
5656

cmd/critest/cri_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func init() {
5757
}
5858

5959
// Load server configuration from file and use each config settings if that
60-
// option is not set in the CLI
60+
// option is not set in the CLI.
6161
func getConfigFromFile() {
6262
var configFromFile *common.ServerConfiguration
6363

pkg/benchmark/image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535
const (
3636
defaultImageBenchmarkTimeoutSeconds = 10
3737

38-
// defaultImageListingPrefix is for avoiding Docker Hub's rate limit
38+
// defaultImageListingPrefix is for avoiding Docker Hub's rate limit.
3939
defaultImageListingPrefix = "public.ecr.aws/docker/library/"
4040
)
4141

pkg/benchmark/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
// LifecycleBenchmarkDatapoint encodes a single benchmark for a lifecycle operation.
3030
// Contains a slice of int64s which represent the duration in nanoseconds of the
3131
// operations which comprise a lifecycle being benchmarked.
32-
// (e.g. the individual CRUD operations which are cycled through during the benchmark)
32+
// (e.g. the individual CRUD operations which are cycled through during the benchmark).
3333
type LifecycleBenchmarkDatapoint struct {
3434
// int64 index of the sample.
3535
SampleIndex int `json:"sampleIndex"`

pkg/common/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"time"
2525
)
2626

27-
// ServerConfiguration is the config for connecting to and using a CRI server
27+
// ServerConfiguration is the config for connecting to and using a CRI server.
2828
type ServerConfiguration struct {
2929
// RuntimeEndpoint is CRI server runtime endpoint
3030
RuntimeEndpoint string
@@ -40,7 +40,7 @@ type ServerConfiguration struct {
4040
DisablePullOnRun bool
4141
}
4242

43-
// GetServerConfigFromFile returns the CRI server configuration from file
43+
// GetServerConfigFromFile returns the CRI server configuration from file.
4444
func GetServerConfigFromFile(configFileName, currentDir string) (*ServerConfiguration, error) {
4545
serverConfig := ServerConfiguration{}
4646
if _, err := os.Stat(configFileName); err != nil {

pkg/common/file.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
)
2727

2828
// Config is the internal representation of the yaml that defines
29-
// server configuration
29+
// server configuration.
3030
type Config struct {
3131
RuntimeEndpoint string
3232
ImageEndpoint string
@@ -77,7 +77,7 @@ func WriteConfig(c *Config, filepath string) error {
7777
return os.WriteFile(filepath, data, 0o644)
7878
}
7979

80-
// Extracts config options from the yaml data which is loaded from file
80+
// Extracts config options from the yaml data which is loaded from file.
8181
func getConfigOptions(yamlData yaml.Node) (*Config, error) {
8282
config := Config{}
8383
config.yamlData = &yamlData
@@ -131,7 +131,7 @@ func getConfigOptions(yamlData yaml.Node) (*Config, error) {
131131
return &config, nil
132132
}
133133

134-
// Set config options on yaml data for persistece to file
134+
// Set config options on yaml data for persistece to file.
135135
func setConfigOptions(config *Config) {
136136
setConfigOption("runtime-endpoint", config.RuntimeEndpoint, config.yamlData)
137137
setConfigOption("image-endpoint", config.ImageEndpoint, config.yamlData)
@@ -141,7 +141,7 @@ func setConfigOptions(config *Config) {
141141
setConfigOption("disable-pull-on-run", strconv.FormatBool(config.DisablePullOnRun), config.yamlData)
142142
}
143143

144-
// Set config option on yaml
144+
// Set config option on yaml.
145145
func setConfigOption(configName, configValue string, yamlData *yaml.Node) {
146146
if yamlData.Content == nil || len(yamlData.Content) == 0 {
147147
yamlData.Kind = yaml.DocumentNode

pkg/framework/framework.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func NewCRIFramework(client *InternalAPIClient) *Framework {
5353
return f
5454
}
5555

56-
// BeforeEach gets a client
56+
// BeforeEach gets a client.
5757
func (f *Framework) BeforeEach() {
5858
if f.CRIClient == nil {
5959
c, err := LoadCRIClient()
@@ -62,7 +62,7 @@ func (f *Framework) BeforeEach() {
6262
}
6363
}
6464

65-
// AfterEach clean resources
65+
// AfterEach clean resources.
6666
func (f *Framework) AfterEach() {
6767
f.CRIClient = nil
6868
}

pkg/framework/util.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,63 +37,63 @@ import (
3737
)
3838

3939
var (
40-
// the callbacks to run during BeforeSuite
40+
// the callbacks to run during BeforeSuite.
4141
beforeSuiteCallbacks []func()
4242

43-
// DefaultPodLabels are labels used by default in pods
43+
// DefaultPodLabels are labels used by default in pods.
4444
DefaultPodLabels map[string]string
4545

46-
// DefaultContainerCommand is the default command used for containers
46+
// DefaultContainerCommand is the default command used for containers.
4747
DefaultContainerCommand []string
4848

49-
// DefaultPauseCommand is the default command used for containers
49+
// DefaultPauseCommand is the default command used for containers.
5050
DefaultPauseCommand []string
5151

52-
// DefaultLinuxPodLabels default pod labels for Linux
52+
// DefaultLinuxPodLabels default pod labels for Linux.
5353
DefaultLinuxPodLabels = map[string]string{}
5454

55-
// DefaultLinuxContainerCommand default container command for Linux
55+
// DefaultLinuxContainerCommand default container command for Linux.
5656
DefaultLinuxContainerCommand = []string{"top"}
5757

58-
// DefaultLinuxPauseCommand default container command for Linux pause
58+
// DefaultLinuxPauseCommand default container command for Linux pause.
5959
DefaultLinuxPauseCommand = []string{"sh", "-c", "top"}
6060

61-
// DefaultLcowPodLabels default pod labels for Linux containers on Windows
61+
// DefaultLcowPodLabels default pod labels for Linux containers on Windows.
6262
DefaultLcowPodLabels = map[string]string{
6363
"sandbox-platform": "linux/amd64",
6464
}
6565

66-
// DefaultWindowsPodLabels default pod labels for Windows
66+
// DefaultWindowsPodLabels default pod labels for Windows.
6767
DefaultWindowsPodLabels = map[string]string{}
6868

69-
// DefaultWindowsContainerCommand default container command for Windows
69+
// DefaultWindowsContainerCommand default container command for Windows.
7070
DefaultWindowsContainerCommand = []string{"cmd", "/c", "ping -t localhost"}
7171

72-
// DefaultWindowsPauseCommand default container pause command for Windows
72+
// DefaultWindowsPauseCommand default container pause command for Windows.
7373
DefaultWindowsPauseCommand = []string{"powershell", "-c", "ping -t localhost"}
7474
)
7575

7676
const (
77-
// DefaultUIDPrefix is a default UID prefix of PodSandbox
77+
// DefaultUIDPrefix is a default UID prefix of PodSandbox.
7878
DefaultUIDPrefix string = "cri-test-uid"
7979

80-
// DefaultNamespacePrefix is a default namespace prefix of PodSandbox
80+
// DefaultNamespacePrefix is a default namespace prefix of PodSandbox.
8181
DefaultNamespacePrefix string = "cri-test-namespace"
8282

83-
// DefaultAttempt is a default attempt prefix of PodSandbox or container
83+
// DefaultAttempt is a default attempt prefix of PodSandbox or container.
8484
DefaultAttempt uint32 = 2
8585

86-
// DefaultStopContainerTimeout is the default timeout for stopping container
86+
// DefaultStopContainerTimeout is the default timeout for stopping container.
8787
DefaultStopContainerTimeout int64 = 60
8888

89-
// DefaultLinuxContainerImage default container image for Linux
89+
// DefaultLinuxContainerImage default container image for Linux.
9090
DefaultLinuxContainerImage string = DefaultRegistryE2ETestImagesPrefix + "busybox:1.29-2"
9191

92-
// DefaultWindowsContainerImage default container image for Windows
92+
// DefaultWindowsContainerImage default container image for Windows.
9393
DefaultWindowsContainerImage string = DefaultLinuxContainerImage
9494
)
9595

96-
// Set the constants based on operating system and flags
96+
// Set the constants based on operating system and flags.
9797
var _ = BeforeSuite(func() {
9898
if runtime.GOOS != "windows" || TestContext.IsLcow {
9999
DefaultPodLabels = DefaultLinuxPodLabels
@@ -122,7 +122,7 @@ var _ = BeforeSuite(func() {
122122
}
123123
})
124124

125-
// AddBeforeSuiteCallback adds a callback to run during BeforeSuite
125+
// AddBeforeSuiteCallback adds a callback to run during BeforeSuite.
126126
func AddBeforeSuiteCallback(callback func()) bool {
127127
beforeSuiteCallbacks = append(beforeSuiteCallbacks, callback)
128128
return true
@@ -258,7 +258,7 @@ func CreateDefaultContainer(rc internalapi.RuntimeService, ic internalapi.ImageM
258258
return CreateDefaultContainerWithLabels(rc, ic, podID, podConfig, prefix, nil)
259259
}
260260

261-
// CreateDefaultContainerWithLabels creates a default container with default options
261+
// CreateDefaultContainerWithLabels creates a default container with default options.
262262
func CreateDefaultContainerWithLabels(rc internalapi.RuntimeService, ic internalapi.ImageManagerService, podID string, podConfig *runtimeapi.PodSandboxConfig, prefix string, labels map[string]string) string {
263263
containerName := prefix + NewUUID()
264264
containerConfig := &runtimeapi.ContainerConfig{
@@ -285,7 +285,7 @@ func CreatePauseContainer(rc internalapi.RuntimeService, ic internalapi.ImageMan
285285
return CreateContainer(rc, ic, containerConfig, podID, podConfig)
286286
}
287287

288-
// CreateContainerWithError creates a container but leave error check to caller
288+
// CreateContainerWithError creates a container but leave error check to caller.
289289
func CreateContainerWithError(rc internalapi.RuntimeService, ic internalapi.ImageManagerService, config *runtimeapi.ContainerConfig, podID string, podConfig *runtimeapi.PodSandboxConfig) (string, error) {
290290
// Pull the image if it does not exist.
291291
imageName := config.Image.Image

0 commit comments

Comments
 (0)