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
+12.2k Facebook PHP getUser() returns 0
+7.6k Golang : How to join strings?
+11.9k Golang : Increment string example
+8.9k Golang : Setting variable value with ldflags
+10.8k Golang : Decompress zlib file example
+19.5k Golang : Clean up null characters from input data
+6.2k Golang : Trim everything onward after a word
+7.9k Golang : Apply Histogram Equalization to color images
+6.4k Golang : Check to see if *File is a file or directory
+4.5k Golang : If else example and common mistake
+5.6k Golang : How to validate ISBN?
+12.9k Golang : Get uploaded file name or access uploaded files