some lint fixes

This commit is contained in:
ston1th 2021-11-05 22:10:52 +01:00
commit 9f4fda3c8b
11 changed files with 36 additions and 40 deletions

View file

@ -416,8 +416,7 @@ func deleteHandler(ctx *Context) {
func dirHandler(ctx *Context) {
ctx.Template("dirHandler")
path := ctx.Path()
switch ctx.Method() {
case "GET":
if ctx.Method() == "GET" {
mode, enoent, err := ctx.Srv.FS.Mode(path)
if !enoent && err != nil {
ctx.Error(err)
@ -439,7 +438,7 @@ func dirHandler(ctx *Context) {
Title: "Document Viewer | " + path,
}
ctx.Template("fileHandler")
//f := ctx.Srv.DB.IsIndexed(path)
// f := ctx.Srv.DB.IsIndexed(path)
id, err := ctx.Srv.DB.GetID(path)
f := err == nil
if id != "" {
@ -701,8 +700,7 @@ func logsHandler(ctx *Context) {
Title: "Logs",
BodyTitle: "Logs",
}
switch ctx.Method() {
case "GET":
if ctx.Method() == "GET" {
ctx.Data.Data = ctx.Srv.Log.Logs()
ctx.Exec()
}
@ -714,8 +712,7 @@ func tagsHandler(ctx *Context) {
Title: "Tags",
BodyTitle: "Tags",
}
switch ctx.Method() {
case "GET":
if ctx.Method() == "GET" {
t, err := ctx.Srv.DB.GetAllTags()
if err != nil {
ctx.Error(err)
@ -828,8 +825,7 @@ func statsHandler(ctx *Context) {
Title: "Stats",
BodyTitle: "Stats",
}
switch ctx.Method() {
case "GET":
if ctx.Method() == "GET" {
ctx.Data.Data = getStats(ctx.Srv.DB.Index)
ctx.Exec()
}