Skip to content

Commit

Permalink
Fix linting after master rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Nov 9, 2024
1 parent ba70fd8 commit e83652c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 8 additions & 4 deletions internal/command/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ func Split(command string) (words []string, err error) {

// WARNING: buffer must be cleared before calling this function.
func splitWord(input string, startIndex int, buffer *bytes.Buffer) (
word string, newStartIndex int, err error) {
word string, newStartIndex int, err error,
) {
cursor := startIndex
for cursor < len(input) {
character, runeLength := utf8.DecodeRuneInString(input[cursor:])
Expand Down Expand Up @@ -94,7 +95,8 @@ func splitWord(input string, startIndex int, buffer *bytes.Buffer) (
}

func handleDoubleQuoted(input string, startIndex int, buffer *bytes.Buffer) (
word string, newStartIndex int, err error) {
word string, newStartIndex int, err error,
) {
cursor := startIndex
for cursor < len(input) {
nextCharacter, nextRuneLength := utf8.DecodeRuneInString(input[cursor:])
Expand All @@ -121,7 +123,8 @@ func handleDoubleQuoted(input string, startIndex int, buffer *bytes.Buffer) (
}

func handleSingleQuoted(input string, startIndex int, buffer *bytes.Buffer) (
word string, newStartIndex int, err error) {
word string, newStartIndex int, err error,
) {
closingQuoteIndex := strings.IndexRune(input[startIndex:], '\'')
if closingQuoteIndex == -1 {
return "", 0, fmt.Errorf("%w", ErrSingleQuoteUnterminated)
Expand All @@ -133,7 +136,8 @@ func handleSingleQuoted(input string, startIndex int, buffer *bytes.Buffer) (
}

func handleEscaped(input string, startIndex int, buffer *bytes.Buffer) (
word string, newStartIndex int, err error) {
word string, newStartIndex int, err error,
) {
if input[startIndex:] == "" {
return "", 0, fmt.Errorf("%w", ErrEscapeUnterminated)
}
Expand Down
1 change: 0 additions & 1 deletion internal/command/split_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func Test_Split(t *testing.T) {
}

for name, testCase := range testCases {
testCase := testCase
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit e83652c

Please sign in to comment.