Make linter happy and update dependencies.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-06-26 22:26:39 +05:00
parent 7b6a425908
commit f8f0302564
30 changed files with 325 additions and 363 deletions

View File

@@ -28,12 +28,12 @@ import (
"go.dev.pztrn.name/fastpastebin/internal/context"
)
var c *context.Context
var ctx *context.Context
// New initializes pastes package and adds necessary HTTP and API
// endpoints.
func New(cc *context.Context) {
c = cc
ctx = cc
c.Echo.GET("/", indexGet)
ctx.Echo.GET("/", indexGet)
}

View File

@@ -37,8 +37,8 @@ import (
// Index of this site.
func indexGet(ectx echo.Context) error {
// We should check if database connection available.
dbConn := c.Database.GetDatabaseConnection()
if c.Config.Database.Type != flatfiles.FlatFileDialect && dbConn == nil {
dbConn := ctx.Database.GetDatabaseConnection()
if ctx.Config.Database.Type != flatfiles.FlatFileDialect && dbConn == nil {
// nolint:wrapcheck
return ectx.Redirect(http.StatusFound, "/database_not_available")
}