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
+4.5k MariaDB/MySQL : How to get version information
+15.3k Golang : Intercept Ctrl-C interrupt or kill signal and determine the signal type
+5k Golang : Customize scanner.Scanner to treat dash as part of identifier
+5.5k Golang : ROT32768 (rotate by 0x80) UTF-8 strings example
+9.9k Golang : How to tokenize source code with text/scanner package?
+15.4k Golang : Convert date format and separator yyyy-mm-dd to dd-mm-yyyy
+5.5k Get website traffic ranking with Similar Web or Alexa
+4.9k Golang : Convert lines of string into list for delete and insert operation
+9.8k Golang : Identifying Golang HTTP client request
+7.5k Golang : get the current working directory of a running program
+11.3k Golang : Handle API query by curl with Gorilla Queries example