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
+11.8k Golang : Verify Linux user password again before executing a program example
+10.3k Golang : Text file editor (accept input from screen and save to file)
+8.9k Golang : Find network service name from given port and protocol
+8.5k PHP : How to parse ElasticSearch JSON ?
+9.1k Golang : Capture text return from exec function example
+4.7k Javascript : Detect when console is activated and do something about it
+21.3k Golang : How to get time zone and load different time zone?
+19.7k Golang : Get current URL example
+18.8k Golang : Implement getters and setters
+19k Golang : Read input from console line
+5.8k Golang : Struct field tags and what is their purpose?
+7.9k Golang : Get today's weekday name and calculate target day distance example