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
+13.6k Golang : Search folders for file recursively with wildcard support
+5k Fix ERROR 2003 (HY000): Can't connect to MySQL server on 'IP address' (111)
+6.9k Golang Hello World Example
+27.9k Golang : JQuery AJAX post data to server and send data back to client example
+7.2k Golang : How To Use Panic and Recover
+15.5k Golang : Merge video(OpenCV) and audio(PortAudio) into a mp4 file
+20.6k Golang : Print leading(padding) zero or spaces in fmt.Printf?
+10.6k CodeIgniter : Import Linkedin data
+9.6k Golang : Get currencies exchange rates example
+24.6k Golang : missing Mercurial command
+4.8k List of Golang XML tutorials
+18.2k Golang : Convert seconds to human readable time format example