mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +08:00
chore(style): use gofumpt
to fmt go code (#967)
This commit is contained in:
@ -32,7 +32,7 @@ func GetIPInfo(clientIP string) string {
|
||||
res := ""
|
||||
for i := range ips {
|
||||
ip := strings.TrimSpace(ips[i])
|
||||
//desc := GetDescFromIP(ip)
|
||||
// desc := GetDescFromIP(ip)
|
||||
ipstr := fmt.Sprintf("%s: %s", ip, "")
|
||||
if i != len(ips)-1 {
|
||||
res += ipstr + " -> "
|
||||
|
@ -19,8 +19,10 @@ import (
|
||||
"regexp"
|
||||
)
|
||||
|
||||
var rePhoneCn *regexp.Regexp
|
||||
var rePhone *regexp.Regexp
|
||||
var (
|
||||
rePhoneCn *regexp.Regexp
|
||||
rePhone *regexp.Regexp
|
||||
)
|
||||
|
||||
func init() {
|
||||
// https://learnku.com/articles/31543
|
||||
|
@ -69,7 +69,7 @@ func BoolToString(b bool) string {
|
||||
return "0"
|
||||
}
|
||||
|
||||
//CamelToSnakeCase This function transform camelcase in snakecase LoremIpsum in lorem_ipsum
|
||||
// CamelToSnakeCase This function transform camelcase in snakecase LoremIpsum in lorem_ipsum
|
||||
func CamelToSnakeCase(camel string) string {
|
||||
var buf bytes.Buffer
|
||||
for _, c := range camel {
|
||||
@ -177,7 +177,7 @@ func ReadStringFromPath(path string) string {
|
||||
}
|
||||
|
||||
func WriteStringToPath(s string, path string) {
|
||||
err := ioutil.WriteFile(path, []byte(s), 0644)
|
||||
err := ioutil.WriteFile(path, []byte(s), 0o644)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -15,9 +15,10 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestParseInt(t *testing.T) {
|
||||
@ -245,4 +246,3 @@ func TestSnakeString(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,6 @@ func Test_GetCurrentTime(t *testing.T) {
|
||||
|
||||
types := reflect.TypeOf(test).Kind()
|
||||
assert.Equal(t, types, reflect.String, "GetCurrentUnixTime should be return string")
|
||||
|
||||
}
|
||||
|
||||
func Test_GetCurrentUnixTime_Shoud_Return_String(t *testing.T) {
|
||||
@ -41,7 +40,6 @@ func Test_GetCurrentUnixTime_Shoud_Return_String(t *testing.T) {
|
||||
}
|
||||
|
||||
func Test_IsTokenExpired(t *testing.T) {
|
||||
|
||||
type input struct {
|
||||
createdTime string
|
||||
expiresIn int
|
||||
|
Reference in New Issue
Block a user