Skip to content

Commit

Permalink
fixing Linting errors from CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Amrit Singh committed Jan 28, 2025
1 parent 571471b commit 1853330
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions tools/tool_test.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
package tools

import (
"context"
"testing"
)

type SomeTool struct {
}

func (st *SomeTool) Name() string {
return "An awesome tool"
}
func (st *SomeTool) Description() string {
return "This tool is awesome"
}
func (st *SomeTool) Call(ctx context.Context, input string) (string, error) {
// The 'input' parameter in the Call method is unused, so we will rename it to '_'
// to indicate that it is intentionally ignored.
func (st *SomeTool) Call(ctx context.Context, _ string) (string, error) {
if ctx.Err() != nil {
return "", ctx.Err()
}
return "test", nil
}

// Additionally, we will modify the TestTool function to run tests in parallel
func TestTool(t *testing.T) {
t.Parallel() // Call to method parallel

t.Run("Tool Exists in Kit", func(t *testing.T) {
t.Parallel() // Call to method parallel in the test run
kit := Kit{
&SomeTool{},
}
Expand All @@ -30,7 +22,9 @@ func TestTool(t *testing.T) {
t.Errorf("Error using tool: %v", err)
}
})

t.Run("Tool Does Not Exist in Kit", func(t *testing.T) {
t.Parallel() // Call to method parallel in the test run
kit := Kit{
&SomeTool{},
}
Expand All @@ -39,4 +33,3 @@ func TestTool(t *testing.T) {
t.Errorf("Expected error, got nil")
}
})

Check failure on line 35 in tools/tool_test.go

View workflow job for this annotation

GitHub Actions / Lint

expected '}', found 'EOF' (typecheck)

Check failure on line 35 in tools/tool_test.go

View workflow job for this annotation

GitHub Actions / Build and Test

expected '}', found 'EOF'
}

0 comments on commit 1853330

Please sign in to comment.