Gofmt friendly (#752)
Keeping Go source code in line with what they preconize
Cette révision appartient à :
Parent
2da1c88c64
révision
c3211c6a14
6 fichiers modifiés avec 38 ajouts et 41 suppressions
|
@ -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]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Référencer dans un nouveau ticket