From 7f8fd2aaffe8222d76dc50437b7191d7688cf3cb Mon Sep 17 00:00:00 2001 From: chentanjun <2799194073@qq.com> Date: Thu, 12 Sep 2019 13:50:05 +0800 Subject: [PATCH] rm the same func IsEmptyStr of different package Signed-off-by: chentanjun <2799194073@qq.com> --- pkg/util/assert.go | 11 ----------- pkg/util/assert_test.go | 7 ------- 2 files changed, 18 deletions(-) diff --git a/pkg/util/assert.go b/pkg/util/assert.go index ace099454..e09c249a6 100644 --- a/pkg/util/assert.go +++ b/pkg/util/assert.go @@ -22,7 +22,6 @@ import ( "encoding/json" "reflect" "strconv" - "unicode" ) // Max returns the larger of x or y. @@ -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 { diff --git a/pkg/util/assert_test.go b/pkg/util/assert_test.go index 8e730f635..de5855e55 100644 --- a/pkg/util/assert_test.go +++ b/pkg/util/assert_test.go @@ -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)