Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(linter): golangci-lint v1.61.0 compatibility #334

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

villevsv-upcloud
Copy link
Contributor

No description provided.

@villevsv-upcloud villevsv-upcloud requested a review from a team as a code owner September 20, 2024 10:40
@@ -106,7 +106,7 @@ func (s *ListLayout) appendSection(title, note string, sectionBody []string) {
if s.style.NoteSeparator {
s.appendLine()
}
s.l.AppendItem(DefaultNoteColours.Sprintf(note))
s.l.AppendItem(DefaultNoteColours.Sprintf("%s", note))
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there Sprint method available? If yes, the extra string as string format could be omitted 🤔

Suggested change
s.l.AppendItem(DefaultNoteColours.Sprintf("%s", note))
s.l.AppendItem(DefaultNoteColours.Sprint(note))

"testing"
)

func TestConcatStringsSingleString(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looping through input, expected tuples and doing assert in a sub-test would also work, as all tests have the same check, but no big difference.

func TestConcatStringsSingleString(t *testing.T) {
result := ConcatStrings("hello")
expected := "hello"
if result != expected {
Copy link
Contributor

Choose a reason for hiding this comment

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

assert.Equal helper could be used in the validations.

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.

2 participants