include::../description.adoc[]

== How to fix it

=== Code examples

==== Noncompliant code example

[source,go,diff-id=1,diff-type=noncompliant]
----
file, err := os.Open("accounts.txt") // Noncompliant
if err != nil {
	log.Fatal(err)
}

bs, err := ioutil.ReadFile("accounts.txt") // Noncompliant
if err != nil {
	return
}
----

==== Compliant solution

[source,go,diff-id=1,diff-type=compliant]
----
var location string = prop.Read("myApplication.mySpecificFile")
file, err := os.Open(location)
if err != nil {
	log.Fatal(err)
}
----

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

'''

endif::env-github,rspecator-view[]
