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
+20.1k Golang : Storing cookies in http.CookieJar example
+4k Unix/Linux : How to fix CentOS yum duplicate glibc or device-mapper-libs dependency error?
+26.9k Golang : How to stream file to client(browser) or write to http.ResponseWriter?
+8.5k Golang : Exit, terminating or aborting a program
+22.4k Golang : Convert an image file to []byte
+9k Golang : Get constant name from value
+8.7k Golang : How to parse plain email text and process email header?
+26.1k Golang : Read a text file and replace certain words
+3.5k Fontello : How to load and use fonts?
+4k Golang : Get missing location after unmarshal binary and gob decode time.
+9.8k Golang : Chunk split or divide a string into smaller chunk example
+13.9k Golang : When to use public and private identifier(variable) and how to make the identifier public or private?