Skip to content

Commit e988503

Browse files
authored
Merge pull request #355 from milas/lint-fmt
2 parents 75dcb29 + 497296f commit e988503

File tree

8 files changed

+13
-10
lines changed

8 files changed

+13
-10
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# required for golangci-lint on Windows
2+
*.go text eol=lf

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
cache: true
3636
- uses: golangci/golangci-lint-action@v3
3737
with:
38-
version: v1.51.1
38+
version: v1.51.2
3939
args: --timeout 5m
4040
- name: Test
4141
run: go test ./...
File renamed without changes.

ci/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ FROM golang:1.20
1616

1717
WORKDIR /go/src
1818

19-
ARG GOLANGCILINT_VERSION=v1.51.1
19+
ARG GOLANGCILINT_VERSION=v1.51.2
2020
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCILINT_VERSION}
2121
RUN go install github.com/kunalkushwaha/ltag@latest && rm -rf /go/src/github.com/kunalkushwaha
2222

loader/loader_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func TestLoadFromFile(t *testing.T) {
279279
}
280280
tmpdir := t.TempDir()
281281
tmpPath := filepath.Join(tmpdir, "Docker-compose.yaml")
282-
if err := os.WriteFile(tmpPath, []byte(sampleYAML), 0444); err != nil {
282+
if err := os.WriteFile(tmpPath, []byte(sampleYAML), 0o444); err != nil {
283283
t.Fatalf("failed to write temporary file: %s", err)
284284
}
285285
actual, err := Load(types.ConfigDetails{

loader/windows_path.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func isAbs(path string) (b bool) {
4444

4545
// volumeNameLen returns length of the leading volume name on Windows.
4646
// It returns 0 elsewhere.
47-
//nolint: gocyclo
47+
// nolint: gocyclo
4848
func volumeNameLen(path string) int {
4949
if len(path) < 2 {
5050
return 0

schema/schema.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ func init() {
5252
}
5353

5454
// Schema is the compose-spec JSON schema
55+
//
5556
//go:embed compose-spec.json
5657
var Schema string
5758

types/types.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ type ServiceConfig struct {
107107
// Command for the service containers.
108108
// If set, overrides COMMAND from the image.
109109
//
110-
// Set to `[]` or `''` to clear the command from the image.
110+
// Set to `[]` or an empty string to clear the command from the image.
111111
Command ShellCommand `yaml:",omitempty" json:"command"` // NOTE: we can NOT omitempty for JSON! see ShellCommand type for details.
112112

113113
Configs []ServiceConfigObjConfig `yaml:",omitempty" json:"configs,omitempty"`
@@ -126,7 +126,7 @@ type ServiceConfig struct {
126126
// Entrypoint for the service containers.
127127
// If set, overrides ENTRYPOINT from the image.
128128
//
129-
// Set to `[]` or `''` to clear the entrypoint from the image.
129+
// Set to `[]` or an empty string to clear the entrypoint from the image.
130130
Entrypoint ShellCommand `yaml:"entrypoint,omitempty" json:"entrypoint"` // NOTE: we can NOT omitempty for JSON! see ShellCommand type for details.
131131

132132
Environment MappingWithEquals `yaml:",omitempty" json:"environment,omitempty"`
@@ -333,13 +333,13 @@ type ThrottleDevice struct {
333333
// ShellCommand is a string or list of string args.
334334
//
335335
// When marshaled to YAML, nil command fields will be omitted if `omitempty`
336-
// is specified as a struct tag. Explicitly empty commands (i.e. `[]` or `''`)
337-
// will serialize to an empty array (`[]`).
336+
// is specified as a struct tag. Explicitly empty commands (i.e. `[]` or
337+
// empty string will serialize to an empty array (`[]`).
338338
//
339339
// When marshaled to JSON, the `omitempty` struct must NOT be specified.
340340
// If the command field is nil, it will be serialized as `null`.
341-
// Explicitly empty commands (i.e. `[]` or `''`) will serialize to an empty
342-
// array (`[]`).
341+
// Explicitly empty commands (i.e. `[]` or empty string) will serialize to
342+
// an empty array (`[]`).
343343
//
344344
// The distinction between nil and explicitly empty is important to distinguish
345345
// between an unset value and a provided, but empty, value, which should be

0 commit comments

Comments
 (0)