diff --git a/backup.go b/backup.go index eacefb7..7cc4132 100644 --- a/backup.go +++ b/backup.go @@ -1,14 +1,14 @@ package main import ( - "git.binarythought.com/cdramey/qurl/storage" - "time" "fmt" - "path" + "git.binarythought.com/cdramey/qurl/storage" "os" + "path" + "time" ) -func manageBackup(stor storage.Storage, dir string, interval int){ +func manageBackup(stor storage.Storage, dir string, interval int) { for { time.Sleep(time.Duration(interval) * time.Second) fname := fmt.Sprintf("qurl-%s.backup", diff --git a/load.go b/load.go index 9cff3e2..e85b69d 100644 --- a/load.go +++ b/load.go @@ -3,10 +3,10 @@ package main import ( "encoding/json" "fmt" + "git.binarythought.com/cdramey/qurl/obj" + "git.binarythought.com/cdramey/qurl/storage" "net" "os" - "git.binarythought.com/cdramey/qurl/storage" - "git.binarythought.com/cdramey/qurl/obj" "time" ) diff --git a/main.go b/main.go index 877764b..3426029 100644 --- a/main.go +++ b/main.go @@ -3,11 +3,11 @@ package main import ( "flag" "fmt" + "git.binarythought.com/cdramey/qurl/pages" + "git.binarythought.com/cdramey/qurl/storage" "net" "net/http" "os" - "git.binarythought.com/cdramey/qurl/pages" - "git.binarythought.com/cdramey/qurl/storage" ) //go:generate go run ./togo -n Favicon_ico -i assets/favicon.ico -p static -o static/favicon_ico.go diff --git a/obj/qurl.go b/obj/qurl.go index 5b77061..5e853b2 100644 --- a/obj/qurl.go +++ b/obj/qurl.go @@ -2,9 +2,9 @@ package obj import ( "fmt" + "net/url" "strings" "time" - "net/url" ) type QURL struct { diff --git a/pages/root.go b/pages/root.go index 7aaaf4d..1a6adfd 100644 --- a/pages/root.go +++ b/pages/root.go @@ -2,11 +2,11 @@ package pages import ( "fmt" - "html/template" - "net/http" + "git.binarythought.com/cdramey/qurl/obj" "git.binarythought.com/cdramey/qurl/static" "git.binarythought.com/cdramey/qurl/storage" - "git.binarythought.com/cdramey/qurl/obj" + "html/template" + "net/http" ) type RootHandler struct { diff --git a/pages/static.go b/pages/static.go index 6d0a1e3..f89ffa2 100644 --- a/pages/static.go +++ b/pages/static.go @@ -10,11 +10,11 @@ import ( ) type StaticContent struct { - Type string - Content []byte - ETag string + Type string + Content []byte + ETag string GZIPContent []byte - GZIPETag string + GZIPETag string } func (sc *StaticContent) Init() { @@ -40,7 +40,7 @@ func (sc *StaticContent) Init() { // Using gzip encoding adds a minimum of 24 characters to the HTTP // header, so only accept gzip encoding if we save that much or more - if (buf.Len()+24) < len(sc.Content) { + if (buf.Len() + 24) < len(sc.Content) { sc.GZIPContent = buf.Bytes() sc.GZIPETag = fmt.Sprintf("%x", md5.Sum(sc.GZIPContent)) } diff --git a/storage/bolt/bolt.go b/storage/bolt/bolt.go index 42914ce..4ef7f37 100644 --- a/storage/bolt/bolt.go +++ b/storage/bolt/bolt.go @@ -3,8 +3,8 @@ package bolt import ( bolt "go.etcd.io/bbolt" "net/url" - "time" "os" + "time" ) type BoltStorage struct { diff --git a/storage/storage.go b/storage/storage.go index d711254..4e78fd0 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -2,9 +2,9 @@ package storage import ( "fmt" - "net/url" "git.binarythought.com/cdramey/qurl/obj" "git.binarythought.com/cdramey/qurl/storage/bolt" + "net/url" "strings" )