Skip to content

Commit

Permalink
Merge pull request #69 from sashamelentyev/refactor/tlsflag
Browse files Browse the repository at this point in the history
refactor: rename tls flag const
  • Loading branch information
sashamelentyev authored Sep 2, 2022
2 parents 7f615a3 + c1930da commit a0264fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions pkg/analyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ import (
)

const (
TimeWeekdayFlag = "time-weekday"
TimeMonthFlag = "time-month"
TimeLayoutFlag = "time-layout"
CryptoHashFlag = "crypto-hash"
HTTPMethodFlag = "http-method"
HTTPStatusCodeFlag = "http-status-code"
RPCDefaultPathFlag = "rpc-default-path"
OSDevNullFlag = "os-dev-null"
SQLIsolationLevelFlag = "sql-isolation-level"
TLSSignatureScheme = "tls-signature-scheme"
TimeWeekdayFlag = "time-weekday"
TimeMonthFlag = "time-month"
TimeLayoutFlag = "time-layout"
CryptoHashFlag = "crypto-hash"
HTTPMethodFlag = "http-method"
HTTPStatusCodeFlag = "http-status-code"
RPCDefaultPathFlag = "rpc-default-path"
OSDevNullFlag = "os-dev-null"
SQLIsolationLevelFlag = "sql-isolation-level"
TLSSignatureSchemeFlag = "tls-signature-scheme"
)

// New returns new usestdlibvars analyzer.
Expand All @@ -48,7 +48,7 @@ func flags() flag.FlagSet {
flags.Bool(RPCDefaultPathFlag, false, "suggest the use of rpc.DefaultXXPath")
flags.Bool(OSDevNullFlag, false, "suggest the use of os.DevNull")
flags.Bool(SQLIsolationLevelFlag, false, "suggest the use of sql.LevelXX.String()")
flags.Bool(TLSSignatureScheme, false, "suggest the use of tls.SignatureScheme.String()")
flags.Bool(TLSSignatureSchemeFlag, false, "suggest the use of tls.SignatureScheme.String()")
return *flags
}

Expand Down Expand Up @@ -107,7 +107,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
checkSQLIsolationLevel(pass, n)
}

if lookupFlag(pass, TLSSignatureScheme) {
if lookupFlag(pass, TLSSignatureSchemeFlag) {
checkTLSSignatureScheme(pass, n)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer/analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestUseStdlibVars(t *testing.T) {
mustNil(t, a.Flags.Set(analyzer.RPCDefaultPathFlag, "true"))
mustNil(t, a.Flags.Set(analyzer.OSDevNullFlag, "true"))
mustNil(t, a.Flags.Set(analyzer.SQLIsolationLevelFlag, "true"))
mustNil(t, a.Flags.Set(analyzer.TLSSignatureScheme, "true"))
mustNil(t, a.Flags.Set(analyzer.TLSSignatureSchemeFlag, "true"))

analysistest.Run(t, analysistest.TestData(), a, pkgs...)
}
Expand Down

0 comments on commit a0264fb

Please sign in to comment.