Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 50f0af1

Browse files
committed
改变判断方式
1 parent b02a029 commit 50f0af1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

websites/code2/studygolang/src/logic/project.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import (
1010
"errors"
1111
"model"
1212
"net/url"
13+
"strconv"
1314
"strings"
1415
"time"
1516

1617
. "db"
1718

18-
"github.com/polaris1119/goutils"
1919
"github.com/polaris1119/logger"
2020
"golang.org/x/net/context"
2121
)
@@ -173,7 +173,7 @@ func (ProjectLogic) FindOne(ctx context.Context, val interface{}) *model.OpenPro
173173
_, ok := val.(int)
174174
if !ok {
175175
val := val.(string)
176-
if goutils.MustInt(val) == 0 {
176+
if _, err := strconv.Atoi(val); err != nil {
177177
field = "uri"
178178
}
179179
}

0 commit comments

Comments
 (0)