Rename unused parameters to _ to satisfy linter
This commit is contained in:
parent
146eeee070
commit
29adb6ee47
@ -38,7 +38,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
// 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()
|
||||
name := params.Globals.Appname
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ func New(lc fx.Lifecycle, params Params) (*Database, error) {
|
||||
|
||||
return s.connect(ctx)
|
||||
},
|
||||
OnStop: func(ctx context.Context) error {
|
||||
OnStop: func(_ context.Context) error {
|
||||
s.log.Info("Database OnStop Hook")
|
||||
if s.db != nil {
|
||||
return s.db.Close()
|
||||
|
||||
@ -20,7 +20,7 @@ type Globals struct {
|
||||
}
|
||||
|
||||
// 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{
|
||||
Appname: Appname,
|
||||
Buildarch: Buildarch,
|
||||
|
||||
@ -33,7 +33,7 @@ func New(lc fx.Lifecycle, params Params) (*Handlers, error) {
|
||||
}
|
||||
|
||||
lc.Append(fx.Hook{
|
||||
OnStart: func(ctx context.Context) error {
|
||||
OnStart: func(_ context.Context) error {
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
@ -7,7 +7,7 @@ import (
|
||||
// HandleImage handles the main image proxy route:
|
||||
// /v1/image/<host>/<path>/<width>x<height>.<format>
|
||||
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
|
||||
// - Parse URL to extract host, path, size, format
|
||||
// - 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 {
|
||||
return func(w http.ResponseWriter, req *http.Request) {
|
||||
return func(_ http.ResponseWriter, _ *http.Request) {
|
||||
// FIXME: Implement robots.txt handler
|
||||
panic("unimplemented")
|
||||
}
|
||||
|
||||
@ -39,12 +39,12 @@ func New(lc fx.Lifecycle, params Params) (*Healthcheck, error) {
|
||||
}
|
||||
|
||||
lc.Append(fx.Hook{
|
||||
OnStart: func(ctx context.Context) error {
|
||||
OnStart: func(_ context.Context) error {
|
||||
s.StartupTime = time.Now()
|
||||
|
||||
return nil
|
||||
},
|
||||
OnStop: func(ctx context.Context) error {
|
||||
OnStop: func(_ context.Context) error {
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
@ -23,7 +23,7 @@ type Logger struct {
|
||||
}
|
||||
|
||||
// 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{
|
||||
level: new(slog.LevelVar),
|
||||
globals: params.Globals,
|
||||
|
||||
@ -35,7 +35,7 @@ type Middleware struct {
|
||||
}
|
||||
|
||||
// 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{
|
||||
log: params.Logger.Get(),
|
||||
config: params.Config,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user