ci: add gofumpt check in reviewdog (#4973)

This commit is contained in:
kinggo
2022-01-06 15:02:53 +08:00
committed by GitHub
parent 4dd2647967
commit b47cf57f5e
51 changed files with 244 additions and 235 deletions
+3 -4
View File
@@ -4,12 +4,11 @@ import (
"regexp"
"strings"
"testing"
"time"
"gorm.io/gorm"
"gorm.io/gorm/clause"
. "gorm.io/gorm/utils/tests"
"time"
)
func TestRow(t *testing.T) {
@@ -389,12 +388,12 @@ func assertEqualSQL(t *testing.T, expected string, actually string) {
actually = replaceQuoteInSQL(actually)
// ignore updated_at value, becase it's generated in Gorm inernal, can't to mock value on update.
var updatedAtRe = regexp.MustCompile(`(?i)"updated_at"=".+?"`)
updatedAtRe := regexp.MustCompile(`(?i)"updated_at"=".+?"`)
actually = updatedAtRe.ReplaceAllString(actually, `"updated_at"=?`)
expected = updatedAtRe.ReplaceAllString(expected, `"updated_at"=?`)
// ignore RETURNING "id" (only in PostgreSQL)
var returningRe = regexp.MustCompile(`(?i)RETURNING "id"`)
returningRe := regexp.MustCompile(`(?i)RETURNING "id"`)
actually = returningRe.ReplaceAllString(actually, ``)
expected = returningRe.ReplaceAllString(expected, ``)