Skip to content

Conversation

wandering-salesman
Copy link

Resolves #4493, in parts.

  • enabled redundant-test-main-exit & enforce-switch-style in golangci file.
  • updated code to resolve warnings
    • added errors if relevant
    • moved returns to default
    • blank default case otherwise.

@@ -55,15 +47,11 @@ func TestMain(m *testing.M) {
for _, file := range diff {
fmt.Fprintln(os.Stderr, file)
}

exitCode = 1
Copy link
Member

@AkihiroSuda AkihiroSuda Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is irrelevant to redundant-test-main-exit

}
}

if err := highk.FindGoRoutines(); err != nil {
fmt.Fprintln(os.Stderr, "Leaking go routines")
fmt.Fprintln(os.Stderr, os.Stderr, err.Error())

exitCode = 1
Copy link
Member

@AkihiroSuda AkihiroSuda Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is irrelevant to redundant-test-main-exit

@@ -55,15 +47,11 @@ func TestMain(m *testing.M) {
for _, file := range diff {
fmt.Fprintln(os.Stderr, file)
}

exitCode = 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is irrelevant to redundant-test-main-exit

}
}

if err := highk.FindGoRoutines(); err != nil {
fmt.Fprintln(os.Stderr, "Leaking go routines")
fmt.Fprintln(os.Stderr, err.Error())

exitCode = 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is irrelevant to redundant-test-main-exit

@@ -96,7 +96,6 @@ linters:
- "fmt.Fprintln"
- "fmt.Fprintf"
- name: redundant-test-main-exit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be removed

@@ -185,9 +185,6 @@ linters:
# 2605 occurrences. Kind of useful in itself, but unacceptable amount of effort to fix
disabled: true
- name: enforce-switch-style
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be removed

@@ -28,6 +28,7 @@ func TestComposePauseAndUnpause(t *testing.T) {
switch base.Info().CgroupDriver {
case "none", "":
t.Skip("requires cgroup (for pausing)")
default:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add // NOP to clarify that this empty default is not a typo

default:
  // NOP

Same for other occurrences too

@@ -97,7 +97,6 @@ linters:
- "fmt.Fprintf"
- name: redundant-test-main-exit
- name: enforce-switch-style
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor code to enable some lint checks
2 participants