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
+10k Google Maps URL parameters configuration
+11k Golang : Send data to /dev/null a.k.a blackhole with ioutil.Discard
+7.8k Golang : Simple histogram example
+3.1k Detect if Google Analytics and Developer Media are loaded properly or not
+21k Golang : Repeat a character by multiple of x factor
+29.2k Golang : Interpolating or substituting variables in string examples
+15k Golang :Trim white spaces from a string
+9.1k Golang : Get login name from environment and prompt for password
+9.9k Golang : Delay or limit HTTP requests example
+7k Golang : Add build version and other information in executables
+13.2k Golang : On enumeration
+4.9k Golang : Find change in a combination of coins example