From f26fcbbce097a758fbec3e5efa08363ca4d879bb Mon Sep 17 00:00:00 2001 From: tangjingyu Date: Thu, 7 Mar 2024 17:06:25 +0800 Subject: [PATCH 1/3] fix: lint pkg/parser/parser.go Signed-off-by: tangjingyu --- build/nogo_config.json | 1 - 1 file changed, 1 deletion(-) diff --git a/build/nogo_config.json b/build/nogo_config.json index 18f29132f961b..6edbc4876a8a2 100644 --- a/build/nogo_config.json +++ b/build/nogo_config.json @@ -504,7 +504,6 @@ }, "revive": { "exclude_files": { - "pkg/parser/parser.go": "parser/parser.go code", "external/": "no need to vet third party code", "GOROOT/": "ignore code", "/cgo/": "ignore cgo", From f06113852818f49a333b4de1be572437f8dc874c Mon Sep 17 00:00:00 2001 From: tangjingyu Date: Thu, 7 Mar 2024 17:26:42 +0800 Subject: [PATCH 2/3] replace file --- build/nogo_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/nogo_config.json b/build/nogo_config.json index 6edbc4876a8a2..576d7166d5bc1 100644 --- a/build/nogo_config.json +++ b/build/nogo_config.json @@ -504,6 +504,7 @@ }, "revive": { "exclude_files": { + "pkg/parser/parser.go": "parser/parser.go code", "external/": "no need to vet third party code", "GOROOT/": "ignore code", "/cgo/": "ignore cgo", @@ -511,7 +512,6 @@ "pkg/parser/goyacc/": "ignore goyacc code", "pkg/parser/ast/": "ignore parser/ast code", "pkg/parser/test_driver/": "ignore parser/test_driver code", - "dumpling/export/sql_type.go": "please fix it", ".*_test\\.go$": "ignore generated code", ".*_generated\\.go$": "ignore generated code", ".*mock.go$": "ignore generated code", From 92d49e29ff2999eb7e784337336f136662f17338 Mon Sep 17 00:00:00 2001 From: tangjingyu Date: Thu, 7 Mar 2024 18:41:41 +0800 Subject: [PATCH 3/3] fix lint --- dumpling/export/sql_type.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dumpling/export/sql_type.go b/dumpling/export/sql_type.go index 45d544fa7ed71..9d3353632578c 100644 --- a/dumpling/export/sql_type.go +++ b/dumpling/export/sql_type.go @@ -106,8 +106,8 @@ func escapeBackslashSQL(s []byte, bf *bytes.Buffer) { func escapeBackslashCSV(s []byte, bf *bytes.Buffer, opt *csvOption) { var ( escape byte - last = 0 - specCmt byte = 0 + last int + specCmt byte ) if len(opt.delimiter) > 0 { specCmt = opt.delimiter[0] // if csv has a delimiter, we should use backslash to comment the delimiter in field value