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.6k Elasticsearch : Shutdown a local node
+18.7k Golang : Accept input from user with fmt.Scanf skipped white spaces and how to fix it
+6.9k Golang : Get all countries phone codes
+9.1k Golang : Convert file content to Hex
+7.8k Golang : Simple histogram example
+15.5k Golang : How to generate QR codes?
+45.5k Golang : Convert int to byte array([]byte)
+8.4k Golang : ffmpeg with os/exec.Command() returns non-zero status
+17.4k Unmarshal/Load CSV record into struct in Go
+13.5k Golang : Rename directory
+18.3k Golang : Archive directory with tar and gzip
+5.2k Golang : Build new URL for named or registered route with Gorilla webtoolkit example