Skip to content

Commit

Permalink
Merge pull request #236 from CodeLingoBot/rewrite
Browse files Browse the repository at this point in the history
Fix error formatting based on best practices from Code Review Comments
  • Loading branch information
Patrick authored Feb 5, 2019
2 parents 31879d3 + 60a570d commit becbb8a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions io2/writer_to_reader_adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func (wrself *WriterToReaderAdapterSuite) TestZlibEarlyError(c *C) {
_, _ = w.Write([]byte(wrself.testData))
_ = w.Close()
var finalOutput bytes.Buffer
btf := fmt.Errorf("Born to fail")
btf := fmt.Errorf("born to fail")
finalDecompressor := NewWriterToReaderAdapter(
func(a io.Reader) (io.Reader, error) { return nil, btf },
&finalOutput, true)
Expand Down Expand Up @@ -369,7 +369,7 @@ func (wrself *WriterToReaderAdapterSuite) TestZlibWriteTruncation(c *C) {
c.Assert(string(finalOutput.Bytes()) != (wrself.testData+wrself.testData), Equals, true)
}

var lateFailing error = fmt.Errorf("LateFailing")
var lateFailing error = fmt.Errorf("lateFailing")

type LateFailingZlibReader struct {
rdr io.ReadCloser
Expand Down
2 changes: 1 addition & 1 deletion net2/http2/simple_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

var (
errFollowRedirectDisabled = fmt.Errorf("Following redirect disabled")
errFollowRedirectDisabled = fmt.Errorf("following redirect disabled")
)

// Pool of persistent HTTP connections. The only limit is on the max # of idle connections we
Expand Down
8 changes: 4 additions & 4 deletions resource_pool/simple_resource_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (p *simpleResourcePool) Register(resourceLocation string) error {

if p.isLameDuck {
return fmt.Errorf(
"Cannot register %s to lame duck resource pool",
"cannot register %s to lame duck resource pool",
resourceLocation)
}

Expand Down Expand Up @@ -137,12 +137,12 @@ func (p *simpleResourcePool) getLocation() (string, error) {

if p.location == "" {
return "", fmt.Errorf(
"Resource location is not set for SimpleResourcePool")
"resource location is not set for SimpleResourcePool")
}

if p.isLameDuck {
return "", fmt.Errorf(
"Lame duck resource pool cannot return handles to %s",
"lame duck resource pool cannot return handles to %s",
p.location)
}

Expand Down Expand Up @@ -239,7 +239,7 @@ func (p *simpleResourcePool) Discard(handle ManagedHandle) error {
if h != nil {
atomic.AddInt32(p.numActive, -1)
if err := p.options.Close(h); err != nil {
return fmt.Errorf("Failed to close resource handle: %v", err)
return fmt.Errorf("failed to close resource handle: %v", err)
}
}
return nil
Expand Down

0 comments on commit becbb8a

Please sign in to comment.