Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
rm the same func IsEmptyStr of different package
Browse files Browse the repository at this point in the history
Signed-off-by: chentanjun <[email protected]>
  • Loading branch information
tanjunchen committed Sep 12, 2019
1 parent ccc7ba7 commit 7f8fd2a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
11 changes: 0 additions & 11 deletions pkg/util/assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"encoding/json"
"reflect"
"strconv"
"unicode"
)

// Max returns the larger of x or y.
Expand All @@ -41,16 +40,6 @@ func Min(x, y int64) int64 {
return y
}

// IsEmptyStr returns whether the string s is empty.
func IsEmptyStr(s string) bool {
for _, v := range s {
if !unicode.IsSpace(v) {
return false
}
}
return true
}

// IsNil returns whether the value is nil.
func IsNil(value interface{}) bool {
if value == nil {
Expand Down
7 changes: 0 additions & 7 deletions pkg/util/assert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ func (suite *AssertSuite) TestMin(c *check.C) {
c.Assert(Min(3, 2), check.Equals, int64(2))
}

func (suite *AssertSuite) TestIsEmptyStr(c *check.C) {
c.Assert(IsEmptyStr(""), check.Equals, true)
c.Assert(IsEmptyStr(" "), check.Equals, true)
c.Assert(IsEmptyStr("\n "), check.Equals, true)
c.Assert(IsEmptyStr("x"), check.Equals, false)
}

func (suite *AssertSuite) TestIsNil(c *check.C) {
c.Assert(IsNil(nil), check.Equals, true)
c.Assert(IsNil(suite), check.Equals, false)
Expand Down

0 comments on commit 7f8fd2a

Please sign in to comment.