I want to read contents of text file.
When I am passing the file name as string like this:
stream, err = ioutil.ReadFile("sample.txt")
its working. Its even working if do in this way:
filename := "sample.txt" stream, err = ioutil.ReadFile(filename)
But when I get the value of filename from string array, it fails to get the file and throw the error: The filename, directory name, or volume label syntax is incorrect
filename := lines //where lines is an array of strings stream, err = ioutil.ReadFile(filename)
fmt.Printf("%q ", lines) // output: mytext2.txt