aboutsummaryrefslogtreecommitdiff
path: root/internal/rtree
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2023-10-25 23:11:42 +0200
committerSandro Jäckel <sandro.jaeckel@gmail.com>2023-10-25 23:11:42 +0200
commitc94c05373f4bc79361ab2fcdd3516c244bc67312 (patch)
treec38350d307cc762ce35116a9cd6691b509f74bbb /internal/rtree
parentf9543a57a8c40e2444715571050824860d127d58 (diff)
downloadgofu-c94c05373f4bc79361ab2fcdd3516c244bc67312.tar.gz
Fix lints reported by gopls
Diffstat (limited to 'internal/rtree')
-rw-r--r--internal/rtree/index.go12
-rw-r--r--internal/rtree/shared_test.go4
2 files changed, 8 insertions, 8 deletions
diff --git a/internal/rtree/index.go b/internal/rtree/index.go
index efc3c1f..6b7bba8 100644
--- a/internal/rtree/index.go
+++ b/internal/rtree/index.go
@@ -265,8 +265,8 @@ func (i *Index) FindRepo(rawRemoteURL string, allowClone bool) (*Repo, error) {
return nil, err
}
i.Repos = append(i.Repos, &newRepo)
- i.Write()
- return &newRepo, nil
+ err = i.Write()
+ return &newRepo, err
}
//if we found fork candidates, ask the user to match the repo with a fork
@@ -294,8 +294,8 @@ func (i *Index) FindRepo(rawRemoteURL string, allowClone bool) (*Repo, error) {
return nil, err
}
i.Repos = append(i.Repos, &newRepo)
- i.Write()
- return &newRepo, nil
+ err = i.Write()
+ return &newRepo, err
}
//find the repo selected by the user
@@ -338,8 +338,8 @@ func (i *Index) FindRepo(rawRemoteURL string, allowClone bool) (*Repo, error) {
Name: remoteName,
URL: remoteURL,
})
- i.Write()
- return target, nil
+ err = i.Write()
+ return target, err
}
// ImportRepo moves the given repo into the rtree and adds it to the index.
diff --git a/internal/rtree/shared_test.go b/internal/rtree/shared_test.go
index 2869c3c..3bfdaba 100644
--- a/internal/rtree/shared_test.go
+++ b/internal/rtree/shared_test.go
@@ -94,11 +94,11 @@ func (test Test) Run(t *testing.T) {
}
//check output
- output := string(stdout.Bytes())
+ output := stdout.String()
if output != test.ExpectOutput {
t.Errorf("%s: expected stdout %#v, but got %#v", t.Name(), test.ExpectOutput, output)
}
- output = string(stderr.Bytes())
+ output = stderr.String()
if output != test.ExpectError {
t.Errorf("%s: expected stderr %#v, but got %#v", t.Name(), test.ExpectError, output)
}