Remove unuused parameters

This commit removes names for unusued parameters where they are no longer needed.
This commit is contained in:
Tom Wiesing 2024-04-08 22:57:25 +02:00
parent b45233b87c
commit 8ad8cf7994
No known key found for this signature in database
24 changed files with 30 additions and 30 deletions

View file

@ -31,7 +31,7 @@ var (
errPasswordSet = errors.New("password was updated") errPasswordSet = errors.New("password was updated")
) )
func (panel *UserPanel) routePassword(ctx context.Context) http.Handler { func (panel *UserPanel) routePassword(context.Context) http.Handler {
tpl := passwordTemplate.Prepare(panel.dependencies.Templating) tpl := passwordTemplate.Prepare(panel.dependencies.Templating)
return &form.Form[struct{}]{ return &form.Form[struct{}]{

View file

@ -47,7 +47,7 @@ type SSHTemplateContext struct {
Services []ssh2.Intercept Services []ssh2.Intercept
} }
func (panel *UserPanel) sshRoute(ctx context.Context) http.Handler { func (panel *UserPanel) sshRoute(context.Context) http.Handler {
tpl := sshTemplate.Prepare( tpl := sshTemplate.Prepare(
panel.dependencies.Templating, panel.dependencies.Templating,
templating.Crumbs( templating.Crumbs(
@ -143,7 +143,7 @@ type addKeyResult struct {
Key ssh.PublicKey Key ssh.PublicKey
} }
func (panel *UserPanel) sshAddRoute(ctx context.Context) http.Handler { func (panel *UserPanel) sshAddRoute(context.Context) http.Handler {
tpl := sshAddTemplate.Prepare( tpl := sshAddTemplate.Prepare(
panel.dependencies.Templating, panel.dependencies.Templating,
templating.Crumbs( templating.Crumbs(

View file

@ -34,7 +34,7 @@ type TokenTemplateContext struct {
Tokens []models.Token Tokens []models.Token
} }
func (panel *UserPanel) tokensRoute(ctx context.Context) http.Handler { func (panel *UserPanel) tokensRoute(context.Context) http.Handler {
tpl := tokensTemplate.Prepare( tpl := tokensTemplate.Prepare(
panel.dependencies.Templating, panel.dependencies.Templating,
templating.Crumbs( templating.Crumbs(
@ -122,7 +122,7 @@ type TokenCreateContext struct {
Token *models.Token Token *models.Token
} }
func (panel *UserPanel) tokensAddRoute(ctx context.Context) http.Handler { func (panel *UserPanel) tokensAddRoute(context.Context) http.Handler {
tplForm := tokensAddTemplate.Prepare( tplForm := tokensAddTemplate.Prepare(
panel.dependencies.Templating, panel.dependencies.Templating,
templating.Crumbs( templating.Crumbs(

View file

@ -23,7 +23,7 @@ var totpEnable = templating.Parse[userFormContext](
templating.Assets(assets.AssetsUser), templating.Assets(assets.AssetsUser),
) )
func (panel *UserPanel) routeTOTPEnable(ctx context.Context) http.Handler { func (panel *UserPanel) routeTOTPEnable(context.Context) http.Handler {
tpl := totpEnable.Prepare(panel.dependencies.Templating) tpl := totpEnable.Prepare(panel.dependencies.Templating)
return &form.Form[struct{}]{ return &form.Form[struct{}]{
@ -88,7 +88,7 @@ type totpEnrollContext struct {
TOTPURL template.URL TOTPURL template.URL
} }
func (panel *UserPanel) routeTOTPEnroll(ctx context.Context) http.Handler { func (panel *UserPanel) routeTOTPEnroll(context.Context) http.Handler {
tpl := totpEnrollTemplate.Prepare( tpl := totpEnrollTemplate.Prepare(
panel.dependencies.Templating, panel.dependencies.Templating,
templating.Crumbs( templating.Crumbs(
@ -174,7 +174,7 @@ var totpDisableTemplate = templating.Parse[userFormContext](
templating.Assets(assets.AssetsUser), templating.Assets(assets.AssetsUser),
) )
func (panel *UserPanel) routeTOTPDisable(ctx context.Context) http.Handler { func (panel *UserPanel) routeTOTPDisable(context.Context) http.Handler {
tpl := totpDisableTemplate.Prepare(panel.dependencies.Templating) tpl := totpDisableTemplate.Prepare(panel.dependencies.Templating)
return &form.Form[struct{}]{ return &form.Form[struct{}]{

View file

@ -40,7 +40,7 @@ func (g GrantWithURL) AdminURL() template.URL {
return template.URL("/admin/instance/" + g.Slug) return template.URL("/admin/instance/" + g.Slug)
} }
func (panel *UserPanel) routeUser(ctx context.Context) http.Handler { func (panel *UserPanel) routeUser(context.Context) http.Handler {
actions := []component.MenuItem{ actions := []component.MenuItem{
menuChangePassword, menuChangePassword,
menuTOTPAction, menuTOTPAction,

View file

@ -240,7 +240,7 @@ func (auth *Auth) authLogin(ctx context.Context) http.Handler {
} }
// authLogout implements the authLogout view to logout a user // authLogout implements the authLogout view to logout a user
func (auth *Auth) authLogout(ctx context.Context) http.Handler { func (auth *Auth) authLogout(context.Context) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// do the logout // do the logout
auth.Logout(w, r) auth.Logout(w, r)

View file

@ -155,7 +155,7 @@ func (snapshots *Exporter) resolveParts(ctx context.Context, parts []string, sna
} }
} }
func (snapshot *Snapshot) makeParts(ctx context.Context, progress io.Writer, snapshots *Exporter, instance *wisski.WissKI, needsRunning bool) (errmap map[string]error, logmap map[string]string) { func (snapshot *Snapshot) makeParts(ctx context.Context, progress io.Writer, _ *Exporter, instance *wisski.WissKI, needsRunning bool) (errmap map[string]error, logmap map[string]string) {
if !needsRunning && !snapshot.Description.Keepalive { if !needsRunning && !snapshot.Description.Keepalive {
stack := instance.Barrel().Stack() stack := instance.Barrel().Stack()

View file

@ -111,7 +111,7 @@ type indexContext struct {
Instances []status.WissKI Instances []status.WissKI
} }
func (admin *Admin) index(ctx context.Context) http.Handler { func (admin *Admin) index(context.Context) http.Handler {
tpl := indexTemplate.Prepare( tpl := indexTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,
templating.Actions( templating.Actions(
@ -126,7 +126,7 @@ func (admin *Admin) index(ctx context.Context) http.Handler {
}) })
} }
func (admin *Admin) instances(ctx context.Context) http.Handler { func (admin *Admin) instances(context.Context) http.Handler {
tpl := instancesTemplate.Prepare( tpl := instancesTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,
templating.Crumbs( templating.Crumbs(

View file

@ -32,7 +32,7 @@ type instanceContext struct {
Info status.WissKI Info status.WissKI
} }
func (admin *Admin) instance(ctx context.Context) http.Handler { func (admin *Admin) instance(context.Context) http.Handler {
tpl := instanceTemplate.Prepare( tpl := instanceTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,
templating.Crumbs( templating.Crumbs(

View file

@ -32,7 +32,7 @@ type instanceDataContext struct {
Prefixes []string Prefixes []string
} }
func (admin *Admin) instanceData(ctx context.Context) http.Handler { func (admin *Admin) instanceData(context.Context) http.Handler {
tpl := instanceDataTemplate.Prepare( tpl := instanceDataTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,
templating.Crumbs( templating.Crumbs(

View file

@ -39,7 +39,7 @@ type instanceDrupalContext struct {
LastCron time.Time LastCron time.Time
} }
func (admin *Admin) instanceDrupal(ctx context.Context) http.Handler { func (admin *Admin) instanceDrupal(context.Context) http.Handler {
tpl := instanceDrupalTemplate.Prepare( tpl := instanceDrupalTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,
templating.Crumbs( templating.Crumbs(

View file

@ -12,7 +12,7 @@ import (
_ "embed" _ "embed"
) )
func (admin *Admin) instanceProvision(ctx context.Context) http.Handler { func (admin *Admin) instanceProvision(context.Context) http.Handler {
tpl := instanceSystemTemplate.Prepare( tpl := instanceSystemTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,

View file

@ -29,7 +29,7 @@ type instancePurgeContext struct {
Instance *wisski.WissKI Instance *wisski.WissKI
} }
func (admin *Admin) instancePurge(ctx context.Context) http.Handler { func (admin *Admin) instancePurge(context.Context) http.Handler {
tpl := instancePurgeTemplate.Prepare( tpl := instancePurgeTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,
templating.Crumbs( templating.Crumbs(

View file

@ -50,7 +50,7 @@ func (isc *instanceSystemContext) prepare(rebuild bool) {
isc.DefaultPHPVersion = models.DefaultPHPVersion isc.DefaultPHPVersion = models.DefaultPHPVersion
} }
func (admin *Admin) instanceRebuild(ctx context.Context) http.Handler { func (admin *Admin) instanceRebuild(context.Context) http.Handler {
tpl := instanceSystemTemplate.Prepare( tpl := instanceSystemTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,

View file

@ -31,7 +31,7 @@ type instanceSnapshotsContext struct {
Snapshots []models.Export Snapshots []models.Export
} }
func (admin *Admin) instanceSnapshots(ctx context.Context) http.Handler { func (admin *Admin) instanceSnapshots(context.Context) http.Handler {
tpl := instanceSnapshotsTemplate.Prepare( tpl := instanceSnapshotsTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,
templating.Crumbs( templating.Crumbs(

View file

@ -36,7 +36,7 @@ type instanceSSHContext struct {
Port uint16 Port uint16
} }
func (admin *Admin) instanceSSH(ctx context.Context) http.Handler { func (admin *Admin) instanceSSH(context.Context) http.Handler {
tpl := instanceSSHTemplate.Prepare( tpl := instanceSSHTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,
templating.Crumbs( templating.Crumbs(

View file

@ -31,7 +31,7 @@ type instanceStatsContext struct {
Statistics status.Statistics Statistics status.Statistics
} }
func (admin *Admin) instanceStats(ctx context.Context) http.Handler { func (admin *Admin) instanceStats(context.Context) http.Handler {
tpl := instanceStatsTemplate.Prepare( tpl := instanceStatsTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,
templating.Crumbs( templating.Crumbs(

View file

@ -29,7 +29,7 @@ type instanceTriplestoreContext struct {
Instance *wisski.WissKI Instance *wisski.WissKI
} }
func (admin *Admin) instanceTS(ctx context.Context) http.Handler { func (admin *Admin) instanceTS(context.Context) http.Handler {
tpl := instanceTriplestoreTemplate.Prepare( tpl := instanceTriplestoreTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,
templating.Crumbs( templating.Crumbs(

View file

@ -44,7 +44,7 @@ type instanceUsersContext struct {
Grants []models.Grant // grants that exist for the user Grants []models.Grant // grants that exist for the user
} }
func (admin *Admin) instanceUsers(ctx context.Context) http.Handler { func (admin *Admin) instanceUsers(context.Context) http.Handler {
tpl := instanceUsersTemplate.Prepare( tpl := instanceUsersTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,
templating.Crumbs( templating.Crumbs(

View file

@ -32,7 +32,7 @@ type usersContext struct {
Users []*auth.AuthUser Users []*auth.AuthUser
} }
func (admin *Admin) users(ctx context.Context) http.Handler { func (admin *Admin) users(context.Context) http.Handler {
tpl := usersTemplate.Prepare( tpl := usersTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,
templating.Crumbs( templating.Crumbs(
@ -71,7 +71,7 @@ type createUserResult struct {
Admin bool Admin bool
} }
func (admin *Admin) createUser(ctx context.Context) http.Handler { func (admin *Admin) createUser(context.Context) http.Handler {
tpl := userCreateTemplate.Prepare( tpl := userCreateTemplate.Prepare(
admin.dependencies.Templating, admin.dependencies.Templating,
templating.Crumbs( templating.Crumbs(

View file

@ -57,7 +57,7 @@ func (home *Home) HandleRoute(ctx context.Context, route string) (http.Handler,
}), nil }), nil
} }
func (home *Home) serveWissKI(w http.ResponseWriter, slug string, r *http.Request) { func (home *Home) serveWissKI(w http.ResponseWriter, slug string, _ *http.Request) {
if _, ok := home.dependencies.ListInstances.Names()[slug]; !ok { if _, ok := home.dependencies.ListInstances.Names()[slug]; !ok {
// Get(nil) guaranteed to work by precondition // Get(nil) guaranteed to work by precondition
w.WriteHeader(http.StatusNotFound) w.WriteHeader(http.StatusNotFound)

View file

@ -47,7 +47,7 @@ type publicContext struct {
const logoHTML = template.HTML(`<img src="/logo.svg" alt="WissKI Distillery Logo" class="biglogo">`) const logoHTML = template.HTML(`<img src="/logo.svg" alt="WissKI Distillery Logo" class="biglogo">`)
func (home *Home) publicHandler(ctx context.Context) http.Handler { func (home *Home) publicHandler(context.Context) http.Handler {
config := component.GetStill(home).Config.Home config := component.GetStill(home).Config.Home
tpl := publicTemplate.Prepare( tpl := publicTemplate.Prepare(

View file

@ -10,7 +10,7 @@ import (
"github.com/FAU-CDI/wisski-distillery/internal/dis/component" "github.com/FAU-CDI/wisski-distillery/internal/dis/component"
) )
func (home *Home) loadRedirect(ctx context.Context) (redirect Redirect, err error) { func (home *Home) loadRedirect(context.Context) (redirect Redirect, err error) {
if redirect.Overrides == nil { if redirect.Overrides == nil {
redirect.Overrides = make(map[string]string) redirect.Overrides = make(map[string]string)
} }

View file

@ -81,7 +81,7 @@ func (ssh2 *SSH2) ReadOrMakeHostKey(progress io.Writer, ctx context.Context, pri
} }
// loadHostKey loadsa host key // loadHostKey loadsa host key
func (ssh2 *SSH2) loadHostKey(progress io.Writer, ctx context.Context, key HostKey, path string) (err error) { func (ssh2 *SSH2) loadHostKey(progress io.Writer, _ context.Context, key HostKey, path string) (err error) {
fmt.Fprintf(progress, "Loading hostkey (algorithm %s) from %q\n", key.Algorithm(), path) fmt.Fprintf(progress, "Loading hostkey (algorithm %s) from %q\n", key.Algorithm(), path)
// read all the bytes from the file // read all the bytes from the file