Skip to content

Commit

Permalink
Add makefile, change sample DB connection info to be more default-ish
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Browne committed Nov 4, 2011
1 parent da8e19e commit 97c60bd
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/cmd/examples/Make.386
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
O=8
AS=${O}a
CC=${O}c
GC=${O}g
LD=${O}l
OS=568vq
CFLAGS=-FVw
7 changes: 7 additions & 0 deletions src/cmd/examples/Make.amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
O=6
AS=${O}a
CC=${O}c
GC=${O}g
LD=${O}l
OS=568vq
CFLAGS=-FVw
31 changes: 31 additions & 0 deletions src/cmd/examples/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
include Make.$(GOARCH)
ALL=pool multipleselects scan statements

all: $(ALL)

scan: scan.$(O)
$(LD) -o scan scan.$(O)

scan.$(O): scan.go
$(GC) scan.go

multipleselects: multipleselects.$(O)
$(LD) -o multipleselects multipleselects.$(O)

multipleselects.$(O): multipleselects.go
$(GC) multipleselects.go

statements: statements.$(O)
$(LD) -o statements statements.$(O)

statements.$(O): statements.go
$(GC) statements.go

pool: pool.$(O)
$(LD) -o pool pool.$(O)

pool.$(O): pool.go
$(GC) pool.go

clean:
rm -f *.6 *.8 $(ALL)
2 changes: 1 addition & 1 deletion src/cmd/examples/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func main() {
// Create a connection pool with up to 3 connections, automatically closing
// idle connections after the default timeout period (5 minutes).
pool, err := pgsql.NewPool("dbname=testdb user=postgres", 3, 3, pgsql.DEFAULT_IDLE_TIMEOUT)
pool, err := pgsql.NewPool("dbname=postgres user=postgres", 3, 3, pgsql.DEFAULT_IDLE_TIMEOUT)
if err != nil {
log.Fatalf("Error opening connection pool: %s\n", err)
}
Expand Down

0 comments on commit 97c60bd

Please sign in to comment.