From 52802aff70b6f162887e64026ed88a6e4be5a623 Mon Sep 17 00:00:00 2001 From: James Mills Date: Sun, 9 Jul 2017 10:18:41 -0700 Subject: [PATCH] Removed some cruft --- main.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/main.go b/main.go index 6e46eee..a4ff833 100644 --- a/main.go +++ b/main.go @@ -4,26 +4,20 @@ import ( "log" "time" - "github.com/boltdb/bolt" "github.com/namsral/flag" ) -var ( - db *bolt.DB - cfg Config -) +var cfg Config func main() { var ( config string - dbpath string bind string fqdn string expiry time.Duration ) flag.StringVar(&config, "config", "", "config file") - flag.StringVar(&dbpath, "dbpth", "urls.db", "Database path") flag.StringVar(&bind, "bind", "0.0.0.0:8000", "[int]: to bind to") flag.StringVar(&fqdn, "fqdn", "localhost", "FQDN for public access") flag.DurationVar(&expiry, "expiry", 5*time.Minute, "expiry time for pastes") @@ -37,12 +31,5 @@ func main() { cfg.fqdn = fqdn cfg.expiry = expiry - var err error - db, err = bolt.Open(dbpath, 0600, nil) - if err != nil { - log.Fatal(err) - } - defer db.Close() - NewServer(bind, cfg).ListenAndServe() }