aboutsummaryrefslogtreecommitdiff
path: root/server/store
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-12-28 16:10:30 +0000
committerNiall Sheridan <nsheridan@gmail.com>2016-12-28 16:10:30 +0000
commit7062ddef5a9166595ebef86b272a74e379843f2b (patch)
tree3d4b48c152e27f9bd650ab307aae210f9f32cfa5 /server/store
parentd7129803488e81e6df691161b774908bf801e527 (diff)
Allow building static binaries
sqlite uses CGO which prevents the building of statically-linked binaries. This change will omit sqlite support when building a static binary with: CGO_ENABLED=0 go build --ldflags '-extldflags "-static"'
Diffstat (limited to 'server/store')
-rw-r--r--server/store/sqldb.go1
-rw-r--r--server/store/sqlite.go5
2 files changed, 5 insertions, 1 deletions
diff --git a/server/store/sqldb.go b/server/store/sqldb.go
index 6c1be0e..d7ef878 100644
--- a/server/store/sqldb.go
+++ b/server/store/sqldb.go
@@ -10,7 +10,6 @@ import (
"golang.org/x/crypto/ssh"
"github.com/go-sql-driver/mysql"
- _ "github.com/mattn/go-sqlite3" // required by sql driver
"github.com/nsheridan/cashier/server/config"
)
diff --git a/server/store/sqlite.go b/server/store/sqlite.go
new file mode 100644
index 0000000..a9ff665
--- /dev/null
+++ b/server/store/sqlite.go
@@ -0,0 +1,5 @@
+// +build cgo
+
+package store
+
+import _ "github.com/mattn/go-sqlite3"