Skip to content

Commit e39edf2

Browse files
chore: appease linter
1 parent 5cb9e5c commit e39edf2

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

agent/agentcontainers/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ func (api *API) discoverDevcontainerProjects() error {
473473
func (api *API) discoverDevcontainersInProject(projectPath string) error {
474474
patterns, err := ignore.ReadPatterns(api.fs, projectPath)
475475
if err != nil {
476-
return fmt.Errorf("read git ignore patterns: %w", err)
476+
return xerrors.Errorf("read git ignore patterns: %w", err)
477477
}
478478

479479
matcher := gitignore.NewMatcher(patterns)

agent/agentcontainers/ignore/dir.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ func FilePathToParts(path string) []string {
2727
return components
2828
}
2929

30-
func readIgnoreFile(fs afero.Fs, path string) ([]gitignore.Pattern, error) {
30+
func readIgnoreFile(fileSystem afero.Fs, path string) ([]gitignore.Pattern, error) {
3131
var ps []gitignore.Pattern
3232

33-
data, err := afero.ReadFile(fs, filepath.Join(path, ".gitignore"))
33+
data, err := afero.ReadFile(fileSystem, filepath.Join(path, ".gitignore"))
3434
if err != nil && !errors.Is(err, os.ErrNotExist) {
3535
return nil, err
3636
}
@@ -47,7 +47,7 @@ func readIgnoreFile(fs afero.Fs, path string) ([]gitignore.Pattern, error) {
4747
func ReadPatterns(fileSystem afero.Fs, path string) ([]gitignore.Pattern, error) {
4848
ps, _ := readIgnoreFile(fileSystem, path)
4949

50-
if err := afero.Walk(fileSystem, path, func(path string, info fs.FileInfo, err error) error {
50+
if err := afero.Walk(fileSystem, path, func(path string, info fs.FileInfo, _ error) error {
5151
if !info.IsDir() {
5252
return nil
5353
}

agent/agentcontainers/ignore/dir_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import (
44
"fmt"
55
"testing"
66

7-
"github.com/coder/coder/v2/agent/agentcontainers/ignore"
87
"github.com/stretchr/testify/require"
8+
9+
"github.com/coder/coder/v2/agent/agentcontainers/ignore"
910
)
1011

1112
func TestFilePathToParts(t *testing.T) {

0 commit comments

Comments
 (0)