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
+5.5k Golang : Qt update UI elements with core.QCoreApplication_ProcessEvents
+25.9k Golang : convert rune to integer value
+10.4k Golang : How to get quoted string into another string?
+8.4k Golang : Get final or effective URL with Request.URL example
+9.2k Golang : Capture text return from exec function example
+11.7k SSL : The certificate is not trusted because no issuer chain was provided
+31.1k Golang : Interpolating or substituting variables in string examples
+9.6k Golang : Web(Javascript) to server-side websocket example
+34.4k Golang : Create x509 certificate, private and public keys
+11.2k Golang : Create S3 bucket with official aws-sdk-go package
+6.2k Golang : Convert Chinese UTF8 characters to Pin Yin
+10.4k Golang : Use regular expression to get all upper case or lower case characters example