jys 2 лет назад
Родитель
Сommit
a5aad18c80
2 измененных файлов с 1 добавлено и 12 удалено
  1. 1 2
      v2alpha/center.go
  2. 0 10
      v2alpha/public_test.go

+ 1 - 2
v2alpha/center.go

@@ -1,7 +1,6 @@
 package fserr
 
 import (
-	"fmt"
 	"net/http"
 	"sync"
 )
@@ -22,6 +21,6 @@ func getCode(business int) ErrCode {
 		return code.(ErrCode)
 	}
 	ret := defaultErrCode
-	ret.BusinessCode = fmt.Sprintf("%06d", business)
+	ret.BusinessCode = business
 	return ret
 }

+ 0 - 10
v2alpha/public_test.go

@@ -47,13 +47,3 @@ func TestCause(t *testing.T) {
 		t.Errorf("expected %s but not", "origin")
 	}
 }
-
-func TestCodeExt(t *testing.T) {
-	origin := New("record not found")
-	NewNotFound(100101, "用户不存在")
-	out := WithCode(origin, 100101)
-	_, _, ext := Ext(out)
-	if ext != "用户不存在" {
-		t.Errorf("expected %s but not", "用户不存在")
-	}
-}