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.2k Golang : Get constant name from value
+18.1k Golang : Aligning strings to right, left and center with fill example
+7.5k Golang : Lock executable to a specific machine with unique hash of the machine
+11k Golang : How to pipe input data to executing child process?
+10.4k Android Studio : Checkbox for user to select options example
+12k Golang : Get month name from date example
+7.6k Golang : Regular Expression find string example
+12.9k Golang : Convert(cast) int to int64
+5.5k Golang : Struct field tags and what is their purpose?
+12k Golang : 2 dimensional array example
+5.3k Golang : Display advertisement images or strings on random order
+9.1k Golang : Find the length of big.Int variable example