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
+7.9k Golang : How To Use Panic and Recover
+22.3k Golang : Set and Get HTTP request headers example
+29k Golang : JQuery AJAX post data to server and send data back to client example
+27.5k Golang : Decode/unmarshal unknown JSON data type with map[string]interface
+13.9k Golang : Chunk split or divide a string into smaller chunk example
+19.7k Golang : Determine if directory is empty with os.File.Readdir() function
+5.2k Golang *File points to a file or directory ?
+9.5k Golang : Qt get screen resolution and display on center example
+26.5k Golang : Force your program to run with root permissions
+8k Golang : Oanda bot with Telegram and RSI example
+6.2k PHP : Proper way to get UTF-8 character or string length
+6.9k Golang : Transform lisp or spinal case to Pascal case example