Skip to content

Commit

Permalink
Fix multiple errors
Browse files Browse the repository at this point in the history
Signed-off-by: João Pereira <joao.pereira@broadcom.com>
  • Loading branch information
joaopapereira committed Jan 15, 2025
1 parent fe44b3c commit 98cb22a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions actor/sharedaction/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,10 @@ func (Actor) generateArchiveCFIgnoreMatcher(files []*zip.File) (*ignore.GitIgnor
return nil, err
}
s := append(DefaultIgnoreLines, strings.Split(string(raw), "\n")...)
return ignore.CompileIgnoreLines(s...)
return ignore.CompileIgnoreLines(s...), nil
}
}
return ignore.CompileIgnoreLines(DefaultIgnoreLines...)
return ignore.CompileIgnoreLines(DefaultIgnoreLines...), nil
}

func (actor Actor) generateDirectoryCFIgnoreMatcher(sourceDir string) (*ignore.GitIgnore, error) {
Expand All @@ -466,7 +466,7 @@ func (actor Actor) generateDirectoryCFIgnoreMatcher(sourceDir string) (*ignore.G
if _, err := os.Stat(pathToCFIgnore); !os.IsNotExist(err) {
return ignore.CompileIgnoreFileAndLines(pathToCFIgnore, additionalIgnoreLines...)
}
return ignore.CompileIgnoreLines(additionalIgnoreLines...)
return ignore.CompileIgnoreLines(additionalIgnoreLines...), nil
}

func (Actor) findInResources(path string, filesToInclude []Resource) (Resource, bool) {
Expand Down
3 changes: 1 addition & 2 deletions util/clissh/ssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -888,8 +888,7 @@ var _ = Describe("CLI SSH", Serial, FlakeAttempts(9), func() {
fakeLocalListener.AcceptReturns(nil, errors.New("Not Accepting Connections"))

echoServer = server.NewServer(logger.Session("echo"), "", echoHandler, 500*time.Millisecond)
err = echoServer.SetListener(echoListener)
Expect(err).NotTo(HaveOccurred())
echoServer.SetListener(echoListener)
go echoServer.Serve()

forwardSpecs = []LocalPortForward{{
Expand Down
2 changes: 1 addition & 1 deletion util/ui/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,5 @@ func contains(s []string, v string) bool {
}

func isInterrupt(err error) bool {
return errors.As(err, &interact.ErrNotBoolean) && errors.As(err, &interact.ErrNotANumber)
return !(errors.Is(err, interact.ErrNotBoolean) && errors.Is(err, interact.ErrNotANumber))
}
4 changes: 2 additions & 2 deletions util/ui/prompt_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ui_test

import (
"errors"
"regexp"

"code.cloudfoundry.org/cli/util/configv3"
Expand All @@ -9,7 +10,6 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gbytes"
"github.com/vito/go-interact/interact"
)

var _ = Describe("Prompts", func() {
Expand Down Expand Up @@ -379,7 +379,7 @@ var _ = Describe("Prompts", func() {

BeforeEach(func() {
fakeResolver = new(uifakes.FakeResolver)
fakeResolver.ResolveReturns(interact.ErrKeyboardInterrupt)
fakeResolver.ResolveReturns(errors.New("keyboard interrupt"))
fakeExiter = new(uifakes.FakeExiter)
fakeInteractor = new(uifakes.FakeInteractor)
fakeInteractor.NewInteractionReturns(fakeResolver)
Expand Down

0 comments on commit 98cb22a

Please sign in to comment.