Skip to content

Instantly share code, notes, and snippets.

@nicholasf
Created June 1, 2015 22:22
Show Gist options
  • Save nicholasf/15ca71e8c46c7f32dbbe to your computer and use it in GitHub Desktop.
Save nicholasf/15ca71e8c46c7f32dbbe to your computer and use it in GitHub Desktop.
//this following snippet
cmdStr := commandString(*psql, *host, *database, *user, *dir, sqlFile.filename)
_, err := exec.Command(cmdStr).Output()
if err != nil {
fmt.Println(err.Error())
log.Fatal(err)
}
//is producing this output
fork/exec /usr/local/bin/psql -h localhost -d furd_development -f /Users/nicholasf/code/nicholasf/furd/services/users/migrations/01-create-users.sql: no such file or directory
pger: fork/exec /usr/local/bin/psql -h localhost -d furd_development -f /Users/nicholasf/code/nicholasf/furd/services/users/migrations/01-create-users.sql: no such file or directory
exit status 1
//when I copy and paste the actual command output in my shell and run it, it works!
♪ migrations git:(master) ✗ /usr/local/bin/psql -h localhost -d furd_development -f /Users/nicholasf/code/nicholasf/furd/services/users/migrations/01-create-users.sql
CREATE TABLE
//hrm ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment