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
+10.3k Golang : Use regular expression to get all upper case or lower case characters example
+6.1k PHP : How to check if an array is empty ?
+29.6k Golang : How to create new XML file ?
+9.7k Golang : Copy map(hash table) example
+7.6k Android Studio : How to detect camera, activate and capture example
+8.6k Linux/Unix : fatal: the Postfix mail system is already running
+4.9k Which content-type(MIME type) to use for JSON data
+32.3k Golang : Validate email address with regular expression
+5.5k Golang : fmt.Println prints out empty data from struct
+10.7k Fix ERROR 1045 (28000): Access denied for user 'root'@'ip-address' (using password: YES)
+10k Golang : Sort and reverse sort a slice of integers
+9k Golang : Gaussian blur on image and camera video feed examples