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
+9.2k nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
+11.3k Golang : Fix fmt.Scanf() on Windows will scan input twice problem
+11.3k Golang : How to use if, eq and print properly in html template
+15.4k Golang : Find location by IP address and display with Google Map
+9.2k Golang : How to find out similarity between two strings with Jaro-Winkler Distance?
+17.4k Golang : Multi threading or run two processes or more example
+35.9k Golang : Integer is between a range
+7.6k Golang : Convert(cast) io.Reader type to string
+5k Golang : Constant and variable names in native language
+14.5k Golang : How to get URL port?
+39.1k Golang : How to read CSV file
+8.2k Golang : HttpRouter multiplexer routing example