Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Gofmt friendly (#752)

Keeping Go source code in line with what they preconize
Cette révision appartient à :
akuma06 2017-05-25 23:35:37 +02:00 révisé par ewhal
Parent 2da1c88c64
révision c3211c6a14
6 fichiers modifiés avec 38 ajouts et 41 suppressions

Voir le fichier

@ -41,4 +41,3 @@ func (f *File) Filename() string {
path := f.Path() path := f.Path()
return path[len(path)-1] return path[len(path)-1]
} }

Voir le fichier

@ -1,12 +1,12 @@
package filelist; package filelist
import ( import (
"github.com/bradfitz/slice"
"github.com/NyaaPantsu/nyaa/model"
"html/template"
"bytes" "bytes"
"strings" "github.com/NyaaPantsu/nyaa/model"
"github.com/bradfitz/slice"
"html/template"
"strconv" "strconv"
"strings"
) )
type FileListFolder struct { type FileListFolder struct {
@ -107,7 +107,7 @@ func (f *FileListFolder) makeFolderTreeView(folderTmpl *template.Template, fileT
} }
output += tmp output += tmp
tmp, err = folder.makeFolderTreeView(folderTmpl, fileTmpl, nestLevel + 1, childIdentifier, data) tmp, err = folder.makeFolderTreeView(folderTmpl, fileTmpl, nestLevel+1, childIdentifier, data)
if err != nil { if err != nil {
return return
} }
@ -141,4 +141,3 @@ func (f *FileListFolder) MakeFolderTreeView(folderFormat string, fileFormat stri
output, err = f.makeFolderTreeView(folderTmpl, fileTmpl, 0, "root", data) output, err = f.makeFolderTreeView(folderTmpl, fileTmpl, 0, "root", data)
return return
} }

Voir le fichier

@ -1,9 +1,9 @@
package filelist; package filelist
import ( import (
"testing"
"html/template"
"github.com/NyaaPantsu/nyaa/model" "github.com/NyaaPantsu/nyaa/model"
"html/template"
"testing"
) )
func makeDummyFile(path ...string) (file model.File) { func makeDummyFile(path ...string) (file model.File) {
@ -25,11 +25,11 @@ func TestFilelist(T *testing.T) {
makeDummyFile("A", "C", "C.txt"), makeDummyFile("A", "C", "C.txt"),
makeDummyFile("B.txt"), makeDummyFile("B.txt"),
} }
expected := "A\n"+ expected := "A\n" +
"-B\n"+ "-B\n" +
"--C.txt\n"+ "--C.txt\n" +
"-C\n"+ "-C\n" +
"--C.txt\n"+ "--C.txt\n" +
"B.txt\n" "B.txt\n"
filelist := FileListToFolder(files) filelist := FileListToFolder(files)
@ -46,4 +46,3 @@ func TestFilelist(T *testing.T) {
return return
} }
} }