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
+7.1k Golang : Scanf function weird error in Windows
+9k Golang : How to get username from email address
+6.9k Golang : Get environment variable
+6.6k Fix sudo yum hang problem with no output or error messages
+5.6k Golang : List all packages and search for certain package
+8.5k Golang : Take screen shot of browser with JQuery example
+10.8k Golang : Proper way to test CIDR membership of an IP 4 or 6 address example
+14.9k nginx: [emerg] unknown directive "ssl"
+11.5k Golang : GTK Input dialog box examples
+13.5k Golang : Gin framework accept query string by post request example
+10.4k Golang : Simple File Server