On Saturday, January 14, 2017 at 5:46:47 PM UTC+1, buc...@gmail.com wrote: > > Rankest beginner here. Trying to learn Go by converting an old Visual > Basic application to Go (yeah, right) on Windows 10 (got all the database > stuff working with both postgre and sqlite!) The application needs to read > an .ini file to get path/filename. It bombs on the first line. > > This is from my testing platform. I like doing things in baby steps, > please. > > package main > > import ( > "fmt" > > ini "github.com/vaughan0/go-ini" > ) > > func main() { > pathfilename := readINIfile() > fmt.Println(pathfilename) > } > > func readINIfile() string { > _, err := ini.LoadFile("C:\\temp\\testfile.ini") > if err != nil { > fmt.Println(err) > } > return "" > } > > I can't get beyond the first err test. The error returned is: "invalid > INI syntax on line 1: ;blah". It is choking on the ';blah'. Also chokes > on a blank line and on simply the ';' character. The author's > documentation says: > > INI files are parsed by go-ini line-by-line. Each line may be one of the > following: > > - A section definition: [section-name] > - A property: key = value > - A comment: #blahblah *or* ;blahblah > - Blank. The line will be ignored. > > I've stared at this for hours. Any idea what I'm missing? > >
-- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.