Skip to content

Commit

Permalink
fixup; fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
menehune23 committed Sep 17, 2021
1 parent 76b3032 commit dae6884
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bindings/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ func (r *Resolver) Resolve(typ string, provider string) ([]Binding, error) {

var resolved []Binding
for _, bind := range r.bindings {
if (strings.ToLower(bind.Type) == strings.ToLower(typ)) &&
(provider == "" || strings.ToLower(bind.Provider) == strings.ToLower(provider)) {
if (strings.EqualFold(bind.Type, typ)) &&
(provider == "" || strings.EqualFold(bind.Provider, provider)) {
resolved = append(resolved, bind)
}
}
Expand Down
1 change: 1 addition & 0 deletions bindings/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ func testResolver(t *testing.T, context spec.G, it spec.S) {
Expect(err).NotTo(HaveOccurred())

err = os.WriteFile(filepath.Join(bindingRoot, "bad-binding", "type"), []byte("bad-type"), 000)
Expect(err).NotTo(HaveOccurred())

_, err = resolver.Resolve("bad-type", "")
Expect(err).To(MatchError(HavePrefix("loading bindings from '%s': open %s: permission denied", bindingRoot, filepath.Join(bindingRoot, "bad-binding", "type"))))
Expand Down

0 comments on commit dae6884

Please sign in to comment.