From aeb7868114fac4fecdba162d24ef36867fc0909c Mon Sep 17 00:00:00 2001 From: Leon Zhang Date: Wed, 3 Jul 2019 14:59:42 +0800 Subject: [PATCH] fingerprint verbose mode add id --- cmd/soar/soar.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/soar/soar.go b/cmd/soar/soar.go index 6a0c1e3..47f5666 100644 --- a/cmd/soar/soar.go +++ b/cmd/soar/soar.go @@ -131,10 +131,15 @@ func main() { // +++++++++++++++++++++小工具集[开始]+++++++++++++++++++++++{ fingerprint := strings.TrimSpace(query.Fingerprint(sql)) + // SQL 签名 + id = query.Id(fingerprint) currentDB = env.CurrentDB(sql, currentDB) switch common.Config.ReportType { case "fingerprint": // SQL 指纹 + if common.Config.Verbose { + fmt.Printf("-- ID: %s\n", id) + } fmt.Println(fingerprint) continue case "pretty": @@ -167,8 +172,6 @@ func main() { common.LogIfWarn(err, "") continue default: - // SQL 签名 - id = query.Id(fingerprint) // 建议去重,减少评审整个文件耗时 // TODO: 由于 a = 11 和 a = '11' 的 fingerprint 相同,这里一旦跳过即无法检查有些建议了,如: ARG.003 if _, ok := suggestMerged[id]; ok { -- GitLab