mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 11:57:02 +00:00
formatting
Former-commit-id: 037081db5d6d4434e873ca8b75334ee43e046b6a
This commit is contained in:
@@ -99,7 +99,6 @@ func newApp(db *DB) *iris.Application {
|
||||
ctx.ViewData("FORM_RESULT",
|
||||
template.HTML("<pre><a target='_new' href='"+shortenURL+"'>"+shortenURL+" </a></pre>"))
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,5 +73,4 @@ func TestURLShortener(t *testing.T) {
|
||||
}
|
||||
|
||||
time.Sleep(1 * time.Second)
|
||||
|
||||
}
|
||||
|
||||
@@ -20,9 +20,7 @@ type Store interface {
|
||||
Close() // release the store or ignore
|
||||
}
|
||||
|
||||
var (
|
||||
tableURLs = []byte("urls")
|
||||
)
|
||||
var tableURLs = []byte("urls")
|
||||
|
||||
// DB representation of a Store.
|
||||
// Only one table/bucket which contains the urls, so it's not a fully Database,
|
||||
@@ -44,7 +42,7 @@ func openDatabase(stumb string) *bolt.DB {
|
||||
}
|
||||
|
||||
// create the buckets here
|
||||
var tables = [...][]byte{
|
||||
tables := [...][]byte{
|
||||
tableURLs,
|
||||
}
|
||||
|
||||
@@ -160,7 +158,6 @@ func (d *DB) GetByValue(value string) (keys []string) {
|
||||
// Len returns all the "shorted" urls length
|
||||
func (d *DB) Len() (num int) {
|
||||
d.db.View(func(tx *bolt.Tx) error {
|
||||
|
||||
// Assume bucket exists and has keys
|
||||
b := tx.Bucket(tableURLs)
|
||||
if b == nil {
|
||||
|
||||
Reference in New Issue
Block a user