Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify code #354

Merged
merged 1 commit into from Jul 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion format/format.go
Expand Up @@ -300,7 +300,7 @@ func formatString(object interface{}, indentation uint) string {
}
}

return fmt.Sprintf("%s", result)
return result
} else {
return fmt.Sprintf("%q", object)
}
Expand Down
2 changes: 1 addition & 1 deletion matchers/receive_matcher_test.go
Expand Up @@ -265,7 +265,7 @@ var _ = Describe("ReceiveMatcher", func() {
Describe("when used with eventually and a custom matcher", func() {
It("should return the matcher's error when a failing value is received on the channel, instead of the must receive something failure", func() {
failures := InterceptGomegaFailures(func() {
c := make(chan string, 0)
c := make(chan string)
Eventually(c, 0.01).Should(Receive(Equal("hello")))
})
Expect(failures[0]).Should(ContainSubstring("When passed a matcher, ReceiveMatcher's channel *must* receive something."))
Expand Down
3 changes: 1 addition & 2 deletions matchers/support/goraph/bipartitegraph/bipartitegraph.go
@@ -1,6 +1,5 @@
package bipartitegraph

import "errors"
import "fmt"

import . "github.com/onsi/gomega/matchers/support/goraph/node"
Expand Down Expand Up @@ -28,7 +27,7 @@ func NewBipartiteGraph(leftValues, rightValues []interface{}, neighbours func(in
for j, rightValue := range rightValues {
neighbours, err := neighbours(leftValue, rightValue)
if err != nil {
return nil, errors.New(fmt.Sprintf("error determining adjacency for %v and %v: %s", leftValue, rightValue, err.Error()))
return nil, fmt.Errorf("error determining adjacency for %v and %v: %s", leftValue, rightValue, err.Error())
}

if neighbours {
Expand Down