Golang : rune literal not terminated error
Encounter this error message rune literal not terminated
while working on a Golang project recently. Took me a while to spot the error and fix it. (Must be sign of old age)
Apparently, the '
symbol in front of the package name io/ioutil
import (
"fmt"
'io/ioutil" // <----- here
"encoding/csv"
"encoding/json"
)
will cause the Golang compiler to generate rune literal not terminated
error message.
To fix, this error... simply change '
to "
import (
"fmt"
"io/ioutil" // <--- see the diff ?
"encoding/csv"
"encoding/json"
)
Golang is still at its infancy stage by the time of writing this and hopefully the compiler will throw out more meaningful error message in future version.
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+11.2k Golang : Calculations using complex numbers example
+28.2k Golang : Detect (OS) Operating System
+4.9k Python : Convert(cast) string to bytes example
+7.7k Golang : Get final or effective URL with Request.URL example
+30.3k Golang : Interpolating or substituting variables in string examples
+5.6k Fix ERROR 2003 (HY000): Can't connect to MySQL server on 'IP address' (111)
+16.4k Golang : Get own process identifier
+10.9k Golang : Characters limiter example
+5.5k PHP : How to handle URI or URL with non-ASCII characters such as Chinese/Japanese/Korean(CJK) ?
+14.5k Golang : Submit web forms without browser by http.PostForm example
+7.6k Golang Hello World Example
+21.6k Fix "Failed to start php5-fpm.service: Unit php5-fpm.service is masked."