First of all, I'm new to the Go language.
I've decided to create a Go version of some of the .NET services we developed as a hobby project. Reasons to attempt this are:
- I've been somewhat intrigued by the Go language.
- I think the .NET webservices could be improved a lot, but I'm not the .NET developer at our company.
Now in order to create these webservices, I need to gain access to our database. I configured our test server to allow access to the database using ODBC.
Next step: get an ODBC connection working in a Go application. There are several Go ODBC packages available, currently I'm trying to use this one: https://github.com/BenoyRNair/godbc
Included in the project is an example. When I try to run the example, I get the following error messages:
MacBook-Air:go wolf$ go run example.go
# godbc
godbc.go:77:2: expected declaration, found '('
godbc.go:81:2: expected declaration, found 'IDENT' x
godbc.go:104:2: expected declaration, found 'IDENT' dsn
godbc.go:109:2: expected declaration, found 'IDENT' returnInt
godbc.go:132:2: expected declaration, found 'IDENT' driver
godbc.go:137:2: expected declaration, found 'IDENT' returnInt
godbc.go:161:2: expected declaration, found 'IDENT' outConnectionString
godbc.go:185:2: expected declaration, found 'IDENT' messageText
godbc.go:188:2: expected declaration, found 'IDENT' returnInt
godbc.go:212:2: expected declaration, found 'IDENT' returnInt
godbc.go:230:2: expected declaration, found 'IDENT' returnInt
godbc.go:242:2: expected declaration, found 'IDENT' returnInt
godbc.go:275:2: expected declaration, found 'IDENT' returnInt
godbc.go:291:2: expected declaration, found 'IDENT' buffer
godbc.go:336:2: expected declaration, found 'for'
Now I'm not sure how to deal with this error. I'm thinking the error might have something to do with how the file is formatted, but perhaps something else is at hand. When I look at the github page, on the issues tab, I've noticed someone else mentioning the same issue, but noted that the code doesn't compile with the latest version of Go, so I assume it has compiled in the past.
Does anyone know if there is some easy fix for this issue or should I try my luck with some other ODBC package? And if so: what package would be recommended?