Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Rerun gofmt it again with -s

Cette révision appartient à :
Eliot Whalan 2017-05-24 17:15:07 +10:00
Parent b4b1b1c26a
révision 3527f01cc5
Aucune clé n'a été trouvée pour cette signature dans la base de données
ID de la clé GPG: C0A42175139840D6
6 fichiers modifiés avec 37 ajouts et 37 suppressions

Voir le fichier

@ -21,7 +21,7 @@ var DefaultScraperConfig = ScraperConfig{
// every hour
IntervalSeconds: 60 * 60,
Trackers: []ScrapeConfig{
ScrapeConfig{
{
URL: "udp://tracker.coppersurfer.tk:6969/",
Name: "coppersurfer.tk",
},

Voir le fichier

@ -26,7 +26,7 @@ const tableOldUserUploads = "user_uploads_old"
// all tables that we have in current database schema in the order they are created
var tables = []createTable{
// users table
createTable{
{
name: tableUsers,
columns: tableColumns{
"user_id SERIAL PRIMARY KEY",
@ -48,7 +48,7 @@ var tables = []createTable{
},
},
// torrents table
createTable{
{
name: tableTorrents,
columns: tableColumns{
"torrent_id SERIAL PRIMARY KEY",
@ -81,7 +81,7 @@ var tables = []createTable{
},
},
// new comments table
createTable{
{
name: tableComments,
columns: tableColumns{
"comment_id SERIAL PRIMARY KEY",
@ -97,7 +97,7 @@ var tables = []createTable{
},
},
// old comments table
createTable{
{
name: tableOldComments,
columns: tableColumns{
fmt.Sprintf("torrent_id INTEGER NOT NULL REFERENCES %s (torrent_id)", tableTorrents),
@ -107,7 +107,7 @@ var tables = []createTable{
},
},
// torrent reports table
createTable{
{
name: tableTorrentReports,
columns: tableColumns{
"torrent_report_id SERIAL PRIMARY KEY",
@ -121,7 +121,7 @@ var tables = []createTable{
},
},
// user follows table
createTable{
{
name: tableUserFollows,
columns: tableColumns{
"user_id INTEGER NOT NULL",
@ -130,7 +130,7 @@ var tables = []createTable{
},
},
// old uploads table
createTable{
{
name: tableOldUserUploads,
columns: tableColumns{
"username TEXT IS NOT NULL",

Voir le fichier

@ -46,87 +46,87 @@ type templateLoader struct {
// ReloadTemplates reloads templates on runtime
func ReloadTemplates() {
pubTempls := []templateLoader{
templateLoader{
{
templ: &databaseDumpTemplate,
name: "dump",
file: "dumps.html",
},
templateLoader{
{
templ: &homeTemplate,
name: "home",
file: "home.html",
},
templateLoader{
{
templ: &searchTemplate,
name: "search",
file: "home.html",
},
templateLoader{
{
templ: &uploadTemplate,
name: "upload",
file: "upload.html",
},
templateLoader{
{
templ: &faqTemplate,
name: "FAQ",
file: "FAQ.html",
},
templateLoader{
{
templ: &viewTemplate,
name: "view",
file: "view.html",
},
templateLoader{
{
templ: &viewRegisterTemplate,
name: "user_register",
file: filepath.Join("user", "register.html"),
},
templateLoader{
{
templ: &viewRegisterSuccessTemplate,
name: "user_register_success",
file: filepath.Join("user", "signup_success.html"),
},
templateLoader{
{
templ: &viewVerifySuccessTemplate,
name: "user_verify_success",
file: filepath.Join("user", "verify_success.html"),
},
templateLoader{
{
templ: &viewLoginTemplate,
name: "user_login",
file: filepath.Join("user", "login.html"),
},
templateLoader{
{
templ: &viewProfileTemplate,
name: "user_profile",
file: filepath.Join("user", "profile.html"),
},
templateLoader{
{
templ: &viewProfileNotifTemplate,
name: "user_profile",
file: filepath.Join("user", "profile_notifications.html"),
},
templateLoader{
{
templ: &viewProfileEditTemplate,
name: "user_profile",
file: filepath.Join("user", "profile_edit.html"),
},
templateLoader{
{
templ: &viewUserDeleteTemplate,
name: "user_delete",
file: filepath.Join("user", "delete_success.html"),
},
templateLoader{
{
templ: &userTorrentEd,
name: "user_torrent_edit",
file: filepath.Join("user", "torrent_edit.html"),
},
templateLoader{
{
templ: &notFoundTemplate,
name: "404",
file: "404.html",
},
templateLoader{
{
templ: &changeLanguageTemplate,
name: "change_language",
file: "change_language.html",
@ -137,37 +137,37 @@ func ReloadTemplates() {
}
modTempls := []templateLoader{
templateLoader{
{
templ: &panelTorrentList,
name: "torrentlist",
file: filepath.Join(ModeratorDir, "torrentlist.html"),
},
templateLoader{
{
templ: &panelUserList,
name: "userlist",
file: filepath.Join(ModeratorDir, "userlist.html"),
},
templateLoader{
{
templ: &panelCommentList,
name: "commentlist",
file: filepath.Join(ModeratorDir, "commentlist.html"),
},
templateLoader{
{
templ: &panelIndex,
name: "indexPanel",
file: filepath.Join(ModeratorDir, "panelindex.html"),
},
templateLoader{
{
templ: &panelTorrentEd,
name: "torrent_ed",
file: filepath.Join(ModeratorDir, "paneltorrentedit.html"),
},
templateLoader{
{
templ: &panelTorrentReportList,
name: "torrent_report",
file: filepath.Join(ModeratorDir, "torrent_report.html"),
},
templateLoader{
{
templ: &panelTorrentReassign,
name: "torrent_reassign",
file: filepath.Join(ModeratorDir, "reassign.html"),

Voir le fichier

@ -226,7 +226,7 @@ func (fetcher *MetainfoFetcher) fillQueue() {
oldest := time.Now().Add(0 - (time.Hour * time.Duration(24*fetcher.maxDays)))
excludedIDS := make([]uint, 0, len(fetcher.failedOperations))
for id, _ := range fetcher.failedOperations {
for id := range fetcher.failedOperations {
excludedIDS = append(excludedIDS, id)
}

Voir le fichier

@ -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:h3:bare`, new(dT), dT{"foo", 10, ""}, false},
{`d3:fooli0ei1ee3:barli2ei3eee`, new(map[string][]int), map[string][]int{
"foo": []int{0, 1},
"bar": []int{2, 3},
"foo": {0, 1},
"bar": {2, 3},
}, false},
{`de`, new(map[string]string), map[string]string{}, false},

Voir le fichier

@ -51,8 +51,8 @@ func TestEncode(t *testing.T) {
{"c": 2, "d": 3},
}, `ld1:ai0e1:bi1eed1:ci2e1:di3eee`, false},
{[][]byte{
[]byte{'0', '2', '4', '6', '8'},
[]byte{'a', 'c', 'e'},
{'0', '2', '4', '6', '8'},
{'a', 'c', 'e'},
}, `l5:024683:acee`, false},
//boolean