From fe3bc3851e93af53a73152311421df1f85fb9495 Mon Sep 17 00:00:00 2001 From: appleboy Date: Tue, 21 Jul 2020 04:36:55 +0000 Subject: [PATCH] chore: enable fmt check (#1742) chore: enable fmt check Co-authored-by: Bo-Yi Wu Reviewed-on: https://gitea.com/xorm/xorm/pulls/1742 Reviewed-by: Lunny Xiao --- .drone.yml | 1 + integrations/session_test.go | 2 +- internal/utils/strings.go | 1 - session.go | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8cf43aa2..93fad07b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,6 +10,7 @@ steps: commands: - make vet - make test + - make fmt-check when: event: - push diff --git a/integrations/session_test.go b/integrations/session_test.go index af8b0375..c3ef0513 100644 --- a/integrations/session_test.go +++ b/integrations/session_test.go @@ -61,4 +61,4 @@ func TestEnableSessionId(t *testing.T) { assertSync(t, new(Userinfo)) _, err := testEngine.Table("userinfo").MustLogSQL(true).Get(new(Userinfo)) assert.NoError(t, err) -} \ No newline at end of file +} diff --git a/internal/utils/strings.go b/internal/utils/strings.go index b5dc37b7..72466705 100644 --- a/internal/utils/strings.go +++ b/internal/utils/strings.go @@ -27,4 +27,3 @@ func SplitNNoCase(s, sep string, n int) []string { } return strings.SplitN(s, s[idx:idx+len(sep)], n) } - diff --git a/session.go b/session.go index 48b3779e..b6ab3eb5 100644 --- a/session.go +++ b/session.go @@ -102,7 +102,7 @@ func newSessionID() string { func newSession(engine *Engine) *Session { var ctx context.Context if engine.logSessionID { - ctx = context.WithValue(engine.defaultContext, log.SessionIDKey, newSessionID()) + ctx = context.WithValue(engine.defaultContext, log.SessionIDKey, newSessionID()) } else { ctx = engine.defaultContext }