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
+22.6k Golang : Set and Get HTTP request headers example
+20.5k Android Studio : AlertDialog and EditText to get user string input example
+6.9k Web : How to see your website from different countries?
+13.8k Golang : Get current time
+4.9k Python : Convert(cast) bytes to string example
+10k Golang : Read file and convert content to string
+5.1k Golang : Convert lines of string into list for delete and insert operation
+21k Golang : Sort and reverse sort a slice of strings
+7.9k Golang : Grayscale Image
+29.5k Golang : Record voice(audio) from microphone to .WAV file
+5.9k Golang : Shuffle array of list
+39.1k Golang : How to read CSV file