Trying to make a portable way to create a file in a specified directory within my $GOPATH.
var FileName string = "Foci.db"
var Driver string = "sqlite3"
func Connect(fileName string) (*sql.DB, error) {
filePath, _ := filepath.Abs("../data/" + FileName)
// Create db if it doesn't exist
os.Open(filePath)
// Open existing db
return sql.Open(Driver, filePath)
}
However, this doesn't seem to create the file in the data directory as I hoped. Am I doing something wrong?