diff options
author | ferhat elmas <elmas.ferhat@gmail.com> | 2017-11-29 02:24:31 +0100 |
---|---|---|
committer | ferhat elmas <elmas.ferhat@gmail.com> | 2017-11-29 13:01:32 +0100 |
commit | 18e6f9daa3899318d36b525b068837f49bc2c1cf (patch) | |
tree | a797b79d0a750972ba9809eb52691cb09f9b6383 /plumbing/storer | |
parent | c07c778ed043429427533e2fd7549a3d54b903f1 (diff) | |
download | go-git-18e6f9daa3899318d36b525b068837f49bc2c1cf.tar.gz |
all: simplification
- no length for map initialization
- don't check for boolean/error return
- don't format string
- use string method of bytes buffer instead of converting bytes to
string
- use `strings.Contains` instead of `strings.Index`
- use `bytes.Equal` instead of `bytes.Compare`
Diffstat (limited to 'plumbing/storer')
-rw-r--r-- | plumbing/storer/reference_test.go | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/plumbing/storer/reference_test.go b/plumbing/storer/reference_test.go index 5738eef..490ec95 100644 --- a/plumbing/storer/reference_test.go +++ b/plumbing/storer/reference_test.go @@ -97,11 +97,7 @@ func (s *ReferenceSuite) TestReferenceFilteredIterNext(c *C) { } i := NewReferenceFilteredIter(func(r *plumbing.Reference) bool { - if r.Name() == "bar" { - return true - } - - return false + return r.Name() == "bar" }, NewReferenceSliceIter(slice)) foo, err := i.Next() c.Assert(err, IsNil) @@ -120,11 +116,7 @@ func (s *ReferenceSuite) TestReferenceFilteredIterForEach(c *C) { } i := NewReferenceFilteredIter(func(r *plumbing.Reference) bool { - if r.Name() == "bar" { - return true - } - - return false + return r.Name() == "bar" }, NewReferenceSliceIter(slice)) var count int i.ForEach(func(r *plumbing.Reference) error { @@ -143,11 +135,7 @@ func (s *ReferenceSuite) TestReferenceFilteredIterError(c *C) { } i := NewReferenceFilteredIter(func(r *plumbing.Reference) bool { - if r.Name() == "bar" { - return true - } - - return false + return r.Name() == "bar" }, NewReferenceSliceIter(slice)) var count int exampleErr := errors.New("SOME ERROR") @@ -172,11 +160,7 @@ func (s *ReferenceSuite) TestReferenceFilteredIterForEachStop(c *C) { } i := NewReferenceFilteredIter(func(r *plumbing.Reference) bool { - if r.Name() == "bar" { - return true - } - - return false + return r.Name() == "bar" }, NewReferenceSliceIter(slice)) var count int |