2020-06-30 12:47:33 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
|
|
|
|
== Sensitive Code Example
|
|
|
|
|
|
|
|
----
|
|
|
|
var (
|
|
|
|
ip = "192.168.12.42"
|
|
|
|
port = 3333
|
|
|
|
)
|
|
|
|
|
|
|
|
SocketClient(ip, port)
|
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
----
|
|
|
|
config, err := ReadConfig("properties.ini")
|
|
|
|
|
|
|
|
ip := config["ip"]
|
|
|
|
port := config["ip"]
|
|
|
|
|
|
|
|
SocketClient(ip, port)
|
|
|
|
----
|
|
|
|
|
|
|
|
include::../exceptions.adoc[]
|
|
|
|
|
|
|
|
include::../see.adoc[]
|
2021-06-02 20:44:38 +02:00
|
|
|
|
|
|
|
ifdef::rspecator-view[]
|
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::rspecator-view[]
|