Skip to content

Commit

Permalink
Tear down testpgx instances
Browse files Browse the repository at this point in the history
Wondering why you have 1,000 old postgres instances hanging around in Docker? Wonder no more! We were calling `os.Exit(0)` for reasons unknown to me in these scripts, and there's a very important detail in [the documentation for os.Exit](https://pkg.go.dev/os#Exit):

> Exit causes the current program to exit with the given status code. Conventionally, code zero indicates success, non-zero an error. The program terminates immediately; **deferred functions are not run.**
  • Loading branch information
bcspragu committed Jan 22, 2024
1 parent 400d11e commit 3b40c53
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"log"
"os"

"github.com/Silicon-Ally/testpgx"
"github.com/Silicon-Ally/testpgx/migrate"
Expand Down Expand Up @@ -42,5 +41,4 @@ func main() {
fmt.Printf(result)
return nil
})
os.Exit(0)
}
2 changes: 0 additions & 2 deletions db/sqldb/golden/regen/schemadump/schemadump.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"log"
"os"

"github.com/Silicon-Ally/testpgx"
"github.com/Silicon-Ally/testpgx/migrate"
Expand Down Expand Up @@ -42,5 +41,4 @@ func main() {
fmt.Printf(result)
return nil
})
os.Exit(0)
}

0 comments on commit 3b40c53

Please sign in to comment.