Rename unused parameters to _ to satisfy linter
This commit is contained in:
@@ -38,7 +38,7 @@ type Config struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new Config instance by loading configuration from file.
|
// New creates a new Config instance by loading configuration from file.
|
||||||
func New(lc fx.Lifecycle, params Params) (*Config, error) {
|
func New(_ fx.Lifecycle, params Params) (*Config, error) {
|
||||||
log := params.Logger.Get()
|
log := params.Logger.Get()
|
||||||
name := params.Globals.Appname
|
name := params.Globals.Appname
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ func New(lc fx.Lifecycle, params Params) (*Database, error) {
|
|||||||
|
|
||||||
return s.connect(ctx)
|
return s.connect(ctx)
|
||||||
},
|
},
|
||||||
OnStop: func(ctx context.Context) error {
|
OnStop: func(_ context.Context) error {
|
||||||
s.log.Info("Database OnStop Hook")
|
s.log.Info("Database OnStop Hook")
|
||||||
if s.db != nil {
|
if s.db != nil {
|
||||||
return s.db.Close()
|
return s.db.Close()
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ type Globals struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new Globals instance from build-time variables.
|
// New creates a new Globals instance from build-time variables.
|
||||||
func New(lc fx.Lifecycle) (*Globals, error) {
|
func New(_ fx.Lifecycle) (*Globals, error) {
|
||||||
n := &Globals{
|
n := &Globals{
|
||||||
Appname: Appname,
|
Appname: Appname,
|
||||||
Buildarch: Buildarch,
|
Buildarch: Buildarch,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ func New(lc fx.Lifecycle, params Params) (*Handlers, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lc.Append(fx.Hook{
|
lc.Append(fx.Hook{
|
||||||
OnStart: func(ctx context.Context) error {
|
OnStart: func(_ context.Context) error {
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
// HandleImage handles the main image proxy route:
|
// HandleImage handles the main image proxy route:
|
||||||
// /v1/image/<host>/<path>/<width>x<height>.<format>
|
// /v1/image/<host>/<path>/<width>x<height>.<format>
|
||||||
func (s *Handlers) HandleImage() http.HandlerFunc {
|
func (s *Handlers) HandleImage() http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, req *http.Request) {
|
return func(_ http.ResponseWriter, _ *http.Request) {
|
||||||
// FIXME: Implement image proxy handler
|
// FIXME: Implement image proxy handler
|
||||||
// - Parse URL to extract host, path, size, format
|
// - Parse URL to extract host, path, size, format
|
||||||
// - Validate signature and expiration
|
// - Validate signature and expiration
|
||||||
@@ -19,9 +19,9 @@ func (s *Handlers) HandleImage() http.HandlerFunc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// HandleRobotsTxt serves robots.txt to prevent search engine crawling
|
// HandleRobotsTxt serves robots.txt to prevent search engine crawling.
|
||||||
func (s *Handlers) HandleRobotsTxt() http.HandlerFunc {
|
func (s *Handlers) HandleRobotsTxt() http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, req *http.Request) {
|
return func(_ http.ResponseWriter, _ *http.Request) {
|
||||||
// FIXME: Implement robots.txt handler
|
// FIXME: Implement robots.txt handler
|
||||||
panic("unimplemented")
|
panic("unimplemented")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,12 +39,12 @@ func New(lc fx.Lifecycle, params Params) (*Healthcheck, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lc.Append(fx.Hook{
|
lc.Append(fx.Hook{
|
||||||
OnStart: func(ctx context.Context) error {
|
OnStart: func(_ context.Context) error {
|
||||||
s.StartupTime = time.Now()
|
s.StartupTime = time.Now()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
OnStop: func(ctx context.Context) error {
|
OnStop: func(_ context.Context) error {
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ type Logger struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new Logger instance.
|
// New creates a new Logger instance.
|
||||||
func New(lc fx.Lifecycle, params Params) (*Logger, error) {
|
func New(_ fx.Lifecycle, params Params) (*Logger, error) {
|
||||||
l := &Logger{
|
l := &Logger{
|
||||||
level: new(slog.LevelVar),
|
level: new(slog.LevelVar),
|
||||||
globals: params.Globals,
|
globals: params.Globals,
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ type Middleware struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new Middleware instance.
|
// New creates a new Middleware instance.
|
||||||
func New(lc fx.Lifecycle, params Params) (*Middleware, error) {
|
func New(_ fx.Lifecycle, params Params) (*Middleware, error) {
|
||||||
s := &Middleware{
|
s := &Middleware{
|
||||||
log: params.Logger.Get(),
|
log: params.Logger.Get(),
|
||||||
config: params.Config,
|
config: params.Config,
|
||||||
|
|||||||
Reference in New Issue
Block a user