go fmt code

This commit is contained in:
Las Zenow 2012-08-31 00:24:42 +02:00
parent def9f7bccf
commit e7adec0988

View file

@ -6,27 +6,27 @@ import (
"labix.org/v2/mgo/bson" "labix.org/v2/mgo/bson"
"net/http" "net/http"
"regexp" "regexp"
"strings"
"strconv" "strconv"
"strings"
) )
type chapter struct { type chapter struct {
Label string Label string
Link string Link string
Depth int Depth int
Active bool Active bool
In []bool // one level in depth In []bool // one level in depth
Out []bool // one level out depth Out []bool // one level out depth
} }
type readData struct { type readData struct {
S Status S Status
Book Book Book Book
Content string Content string
Chapters []chapter Chapters []chapter
Next string Next string
Prev string Prev string
Back string Back string
} }
func parseUrl(url string) (string, string, string) { func parseUrl(url string) (string, string, string) {
@ -99,14 +99,14 @@ func chapterList(e *epub.Epub, file string, id string, base string) (string, str
} }
/* if is the same chapter check the previous */ /* if is the same chapter check the previous */
i := activeIndx-1 i := activeIndx - 1
for i >= 0 && strings.Contains(chapters[i].Link, "#") { for i >= 0 && strings.Contains(chapters[i].Link, "#") {
i-- i--
} }
if i >= 0 { if i >= 0 {
prev = chapters[i].Link prev = chapters[i].Link
} }
i = activeIndx+1 i = activeIndx + 1
for i < len(chapters) && strings.Contains(chapters[i].Link, "#") { for i < len(chapters) && strings.Contains(chapters[i].Link, "#") {
i++ i++
} }