rspec/rules/S2068/go/rule.adoc

49 lines
765 B
Plaintext
Raw Normal View History

2020-06-30 12:48:07 +02:00
include::../description.adoc[]
include::../ask-yourself.adoc[]
include::../recommended.adoc[]
== Sensitive Code Example
----
func connect() {
user := "root"
password:= "supersecret" // Sensitive
url := "login=" + user + "&passwd=" + password
}
----
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,go]
2020-06-30 12:48:07 +02:00
----
func connect() {
user := getEncryptedUser()
password:= getEncryptedPass() // Compliant
url := "login=" + user + "&passwd=" + password
}
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../parameters.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]