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
+8.2k Golang : Channels and buffered channels examples
+4.2k Swift : Get substring with rangeOfString() function example
+6.4k Swift : Convert (cast) String to Float
+13.5k Golang : How to add color to string?
+16k Golang : Send email with attachment
+9.1k Golang : Create S3 bucket with official aws-sdk-go package
+11.5k Golang : Gin framework accept query string by post request example
+25.5k Golang : Get time.Duration in year, month, week or day
+7.5k Golang : Read file with ioutil
+7.8k Golang : Function wrapper that takes arguments and return result example
+4.6k Javascript : Get operating system and browser information
+23.9k PHP : Count number of JSON items/objects