Skip to content

Commit

Permalink
chore: minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 committed Feb 4, 2024
1 parent 02fb109 commit 3181440
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions lang/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,8 @@ func (l baseLang) generateTestCasesContent(q *leetcode.QuestionData) string {
// Assume all questions output are single.
var tc TestCases
for i := 0; i < len(cases) && i/argsNum < len(outputs); i += argsNum {
tc.Cases = append(
tc.Cases, TestCase{
No: i/argsNum + 1,
tc.AddCase(
TestCase{
Input: cases[i : i+argsNum],
Output: outputs[i/argsNum],
},
Expand Down
3 changes: 2 additions & 1 deletion lang/judge.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import (
"github.com/goccy/go-json"
strip "github.com/grokify/html-strip-tags-go"

"github.com/j178/leetgo/leetcode"
goutils "github.com/j178/leetgo/testutils/go"

Check failure on line 13 in lang/judge.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/j178/leetgo) --custom-order (gci)

"github.com/j178/leetgo/leetcode"
)

type JudgeResult interface {
Expand Down
5 changes: 3 additions & 2 deletions lang/testcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import (
"strconv"
"strings"

"github.com/j178/leetgo/leetcode"
goutils "github.com/j178/leetgo/testutils/go"

Check failure on line 11 in lang/testcase.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/j178/leetgo) --custom-order (gci)

"github.com/j178/leetgo/leetcode"

Check failure on line 13 in lang/testcase.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/j178/leetgo) --custom-order (gci)
"github.com/j178/leetgo/utils"
)

Expand Down Expand Up @@ -170,7 +171,7 @@ func ParseTestCases(q *leetcode.QuestionData, f *FileOutput) (TestCases, error)
)
lines := utils.SplitLines(content)
for _, line := range lines {
line := strings.TrimSpace(line)
line = strings.TrimSpace(line)
switch {
case line == "":
continue
Expand Down

0 comments on commit 3181440

Please sign in to comment.