Rerun gofmt it again with -s
Cette révision appartient à :
Parent
b4b1b1c26a
révision
3527f01cc5
6 fichiers modifiés avec 37 ajouts et 37 suppressions
|
@ -21,7 +21,7 @@ var DefaultScraperConfig = ScraperConfig{
|
||||||
// every hour
|
// every hour
|
||||||
IntervalSeconds: 60 * 60,
|
IntervalSeconds: 60 * 60,
|
||||||
Trackers: []ScrapeConfig{
|
Trackers: []ScrapeConfig{
|
||||||
ScrapeConfig{
|
{
|
||||||
URL: "udp://tracker.coppersurfer.tk:6969/",
|
URL: "udp://tracker.coppersurfer.tk:6969/",
|
||||||
Name: "coppersurfer.tk",
|
Name: "coppersurfer.tk",
|
||||||
},
|
},
|
||||||
|
|
|
@ -26,7 +26,7 @@ const tableOldUserUploads = "user_uploads_old"
|
||||||
// all tables that we have in current database schema in the order they are created
|
// all tables that we have in current database schema in the order they are created
|
||||||
var tables = []createTable{
|
var tables = []createTable{
|
||||||
// users table
|
// users table
|
||||||
createTable{
|
{
|
||||||
name: tableUsers,
|
name: tableUsers,
|
||||||
columns: tableColumns{
|
columns: tableColumns{
|
||||||
"user_id SERIAL PRIMARY KEY",
|
"user_id SERIAL PRIMARY KEY",
|
||||||
|
@ -48,7 +48,7 @@ var tables = []createTable{
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// torrents table
|
// torrents table
|
||||||
createTable{
|
{
|
||||||
name: tableTorrents,
|
name: tableTorrents,
|
||||||
columns: tableColumns{
|
columns: tableColumns{
|
||||||
"torrent_id SERIAL PRIMARY KEY",
|
"torrent_id SERIAL PRIMARY KEY",
|
||||||
|
@ -81,7 +81,7 @@ var tables = []createTable{
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// new comments table
|
// new comments table
|
||||||
createTable{
|
{
|
||||||
name: tableComments,
|
name: tableComments,
|
||||||
columns: tableColumns{
|
columns: tableColumns{
|
||||||
"comment_id SERIAL PRIMARY KEY",
|
"comment_id SERIAL PRIMARY KEY",
|
||||||
|
@ -97,7 +97,7 @@ var tables = []createTable{
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// old comments table
|
// old comments table
|
||||||
createTable{
|
{
|
||||||
name: tableOldComments,
|
name: tableOldComments,
|
||||||
columns: tableColumns{
|
columns: tableColumns{
|
||||||
fmt.Sprintf("torrent_id INTEGER NOT NULL REFERENCES %s (torrent_id)", tableTorrents),
|
fmt.Sprintf("torrent_id INTEGER NOT NULL REFERENCES %s (torrent_id)", tableTorrents),
|
||||||
|
@ -107,7 +107,7 @@ var tables = []createTable{
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// torrent reports table
|
// torrent reports table
|
||||||
createTable{
|
{
|
||||||
name: tableTorrentReports,
|
name: tableTorrentReports,
|
||||||
columns: tableColumns{
|
columns: tableColumns{
|
||||||
"torrent_report_id SERIAL PRIMARY KEY",
|
"torrent_report_id SERIAL PRIMARY KEY",
|
||||||
|
@ -121,7 +121,7 @@ var tables = []createTable{
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// user follows table
|
// user follows table
|
||||||
createTable{
|
{
|
||||||
name: tableUserFollows,
|
name: tableUserFollows,
|
||||||
columns: tableColumns{
|
columns: tableColumns{
|
||||||
"user_id INTEGER NOT NULL",
|
"user_id INTEGER NOT NULL",
|
||||||
|
@ -130,7 +130,7 @@ var tables = []createTable{
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// old uploads table
|
// old uploads table
|
||||||
createTable{
|
{
|
||||||
name: tableOldUserUploads,
|
name: tableOldUserUploads,
|
||||||
columns: tableColumns{
|
columns: tableColumns{
|
||||||
"username TEXT IS NOT NULL",
|
"username TEXT IS NOT NULL",
|
||||||
|
|
|
@ -46,87 +46,87 @@ type templateLoader struct {
|
||||||
// ReloadTemplates reloads templates on runtime
|
// ReloadTemplates reloads templates on runtime
|
||||||
func ReloadTemplates() {
|
func ReloadTemplates() {
|
||||||
pubTempls := []templateLoader{
|
pubTempls := []templateLoader{
|
||||||
templateLoader{
|
{
|
||||||
templ: &databaseDumpTemplate,
|
templ: &databaseDumpTemplate,
|
||||||
name: "dump",
|
name: "dump",
|
||||||
file: "dumps.html",
|
file: "dumps.html",
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &homeTemplate,
|
templ: &homeTemplate,
|
||||||
name: "home",
|
name: "home",
|
||||||
file: "home.html",
|
file: "home.html",
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &searchTemplate,
|
templ: &searchTemplate,
|
||||||
name: "search",
|
name: "search",
|
||||||
file: "home.html",
|
file: "home.html",
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &uploadTemplate,
|
templ: &uploadTemplate,
|
||||||
name: "upload",
|
name: "upload",
|
||||||
file: "upload.html",
|
file: "upload.html",
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &faqTemplate,
|
templ: &faqTemplate,
|
||||||
name: "FAQ",
|
name: "FAQ",
|
||||||
file: "FAQ.html",
|
file: "FAQ.html",
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &viewTemplate,
|
templ: &viewTemplate,
|
||||||
name: "view",
|
name: "view",
|
||||||
file: "view.html",
|
file: "view.html",
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &viewRegisterTemplate,
|
templ: &viewRegisterTemplate,
|
||||||
name: "user_register",
|
name: "user_register",
|
||||||
file: filepath.Join("user", "register.html"),
|
file: filepath.Join("user", "register.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &viewRegisterSuccessTemplate,
|
templ: &viewRegisterSuccessTemplate,
|
||||||
name: "user_register_success",
|
name: "user_register_success",
|
||||||
file: filepath.Join("user", "signup_success.html"),
|
file: filepath.Join("user", "signup_success.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &viewVerifySuccessTemplate,
|
templ: &viewVerifySuccessTemplate,
|
||||||
name: "user_verify_success",
|
name: "user_verify_success",
|
||||||
file: filepath.Join("user", "verify_success.html"),
|
file: filepath.Join("user", "verify_success.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &viewLoginTemplate,
|
templ: &viewLoginTemplate,
|
||||||
name: "user_login",
|
name: "user_login",
|
||||||
file: filepath.Join("user", "login.html"),
|
file: filepath.Join("user", "login.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &viewProfileTemplate,
|
templ: &viewProfileTemplate,
|
||||||
name: "user_profile",
|
name: "user_profile",
|
||||||
file: filepath.Join("user", "profile.html"),
|
file: filepath.Join("user", "profile.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &viewProfileNotifTemplate,
|
templ: &viewProfileNotifTemplate,
|
||||||
name: "user_profile",
|
name: "user_profile",
|
||||||
file: filepath.Join("user", "profile_notifications.html"),
|
file: filepath.Join("user", "profile_notifications.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &viewProfileEditTemplate,
|
templ: &viewProfileEditTemplate,
|
||||||
name: "user_profile",
|
name: "user_profile",
|
||||||
file: filepath.Join("user", "profile_edit.html"),
|
file: filepath.Join("user", "profile_edit.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &viewUserDeleteTemplate,
|
templ: &viewUserDeleteTemplate,
|
||||||
name: "user_delete",
|
name: "user_delete",
|
||||||
file: filepath.Join("user", "delete_success.html"),
|
file: filepath.Join("user", "delete_success.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &userTorrentEd,
|
templ: &userTorrentEd,
|
||||||
name: "user_torrent_edit",
|
name: "user_torrent_edit",
|
||||||
file: filepath.Join("user", "torrent_edit.html"),
|
file: filepath.Join("user", "torrent_edit.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: ¬FoundTemplate,
|
templ: ¬FoundTemplate,
|
||||||
name: "404",
|
name: "404",
|
||||||
file: "404.html",
|
file: "404.html",
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &changeLanguageTemplate,
|
templ: &changeLanguageTemplate,
|
||||||
name: "change_language",
|
name: "change_language",
|
||||||
file: "change_language.html",
|
file: "change_language.html",
|
||||||
|
@ -137,37 +137,37 @@ func ReloadTemplates() {
|
||||||
}
|
}
|
||||||
|
|
||||||
modTempls := []templateLoader{
|
modTempls := []templateLoader{
|
||||||
templateLoader{
|
{
|
||||||
templ: &panelTorrentList,
|
templ: &panelTorrentList,
|
||||||
name: "torrentlist",
|
name: "torrentlist",
|
||||||
file: filepath.Join(ModeratorDir, "torrentlist.html"),
|
file: filepath.Join(ModeratorDir, "torrentlist.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &panelUserList,
|
templ: &panelUserList,
|
||||||
name: "userlist",
|
name: "userlist",
|
||||||
file: filepath.Join(ModeratorDir, "userlist.html"),
|
file: filepath.Join(ModeratorDir, "userlist.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &panelCommentList,
|
templ: &panelCommentList,
|
||||||
name: "commentlist",
|
name: "commentlist",
|
||||||
file: filepath.Join(ModeratorDir, "commentlist.html"),
|
file: filepath.Join(ModeratorDir, "commentlist.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &panelIndex,
|
templ: &panelIndex,
|
||||||
name: "indexPanel",
|
name: "indexPanel",
|
||||||
file: filepath.Join(ModeratorDir, "panelindex.html"),
|
file: filepath.Join(ModeratorDir, "panelindex.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &panelTorrentEd,
|
templ: &panelTorrentEd,
|
||||||
name: "torrent_ed",
|
name: "torrent_ed",
|
||||||
file: filepath.Join(ModeratorDir, "paneltorrentedit.html"),
|
file: filepath.Join(ModeratorDir, "paneltorrentedit.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &panelTorrentReportList,
|
templ: &panelTorrentReportList,
|
||||||
name: "torrent_report",
|
name: "torrent_report",
|
||||||
file: filepath.Join(ModeratorDir, "torrent_report.html"),
|
file: filepath.Join(ModeratorDir, "torrent_report.html"),
|
||||||
},
|
},
|
||||||
templateLoader{
|
{
|
||||||
templ: &panelTorrentReassign,
|
templ: &panelTorrentReassign,
|
||||||
name: "torrent_reassign",
|
name: "torrent_reassign",
|
||||||
file: filepath.Join(ModeratorDir, "reassign.html"),
|
file: filepath.Join(ModeratorDir, "reassign.html"),
|
||||||
|
|
|
@ -226,7 +226,7 @@ func (fetcher *MetainfoFetcher) fillQueue() {
|
||||||
|
|
||||||
oldest := time.Now().Add(0 - (time.Hour * time.Duration(24*fetcher.maxDays)))
|
oldest := time.Now().Add(0 - (time.Hour * time.Duration(24*fetcher.maxDays)))
|
||||||
excludedIDS := make([]uint, 0, len(fetcher.failedOperations))
|
excludedIDS := make([]uint, 0, len(fetcher.failedOperations))
|
||||||
for id, _ := range fetcher.failedOperations {
|
for id := range fetcher.failedOperations {
|
||||||
excludedIDS = append(excludedIDS, id)
|
excludedIDS = append(excludedIDS, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
vendor/github.com/zeebo/bencode/decode_test.go
générée
externe
4
vendor/github.com/zeebo/bencode/decode_test.go
générée
externe
|
@ -62,8 +62,8 @@ func TestDecode(t *testing.T) {
|
||||||
{`d1:X3:foo1:Yi10e1:Z3:bare`, new(dT), dT{"foo", 10, "bar"}, false},
|
{`d1:X3:foo1:Yi10e1:Z3:bare`, new(dT), dT{"foo", 10, "bar"}, false},
|
||||||
{`d1:X3:foo1:Yi10e1:h3:bare`, new(dT), dT{"foo", 10, ""}, false},
|
{`d1:X3:foo1:Yi10e1:h3:bare`, new(dT), dT{"foo", 10, ""}, false},
|
||||||
{`d3:fooli0ei1ee3:barli2ei3eee`, new(map[string][]int), map[string][]int{
|
{`d3:fooli0ei1ee3:barli2ei3eee`, new(map[string][]int), map[string][]int{
|
||||||
"foo": []int{0, 1},
|
"foo": {0, 1},
|
||||||
"bar": []int{2, 3},
|
"bar": {2, 3},
|
||||||
}, false},
|
}, false},
|
||||||
{`de`, new(map[string]string), map[string]string{}, false},
|
{`de`, new(map[string]string), map[string]string{}, false},
|
||||||
|
|
||||||
|
|
4
vendor/github.com/zeebo/bencode/encode_test.go
générée
externe
4
vendor/github.com/zeebo/bencode/encode_test.go
générée
externe
|
@ -51,8 +51,8 @@ func TestEncode(t *testing.T) {
|
||||||
{"c": 2, "d": 3},
|
{"c": 2, "d": 3},
|
||||||
}, `ld1:ai0e1:bi1eed1:ci2e1:di3eee`, false},
|
}, `ld1:ai0e1:bi1eed1:ci2e1:di3eee`, false},
|
||||||
{[][]byte{
|
{[][]byte{
|
||||||
[]byte{'0', '2', '4', '6', '8'},
|
{'0', '2', '4', '6', '8'},
|
||||||
[]byte{'a', 'c', 'e'},
|
{'a', 'c', 'e'},
|
||||||
}, `l5:024683:acee`, false},
|
}, `l5:024683:acee`, false},
|
||||||
|
|
||||||
//boolean
|
//boolean
|
||||||
|
|
Référencer dans un nouveau ticket