Skip to content
Snippets Groups Projects
Verified Commit 52a3a8f4 authored by Gabriel Zachmann's avatar Gabriel Zachmann
Browse files

fix "Function params involve heavy amount of copying"

parent 4823084e
No related branches found
No related tags found
No related merge requests found
...@@ -150,13 +150,13 @@ func handleAddSSHKey(ctx *fiber.Ctx) error { ...@@ -150,13 +150,13 @@ func handleAddSSHKey(ctx *fiber.Ctx) error {
return settings.HandleSettingsHelper( return settings.HandleSettingsHelper(
ctx, &req.Mytoken, api.CapabilitySSHGrant, event.FromNumber(event.SSHKeyAdded, ""), fiber.StatusOK, ctx, &req.Mytoken, api.CapabilitySSHGrant, event.FromNumber(event.SSHKeyAdded, ""), fiber.StatusOK,
func(tx *sqlx.Tx, mt *mytoken.Mytoken) (my.TokenUpdatableResponse, *serverModel.Response) { func(tx *sqlx.Tx, mt *mytoken.Mytoken) (my.TokenUpdatableResponse, *serverModel.Response) {
return handleAddSSHSettingsCallback(rlog, ctx, req, sshKeyFP, tx, mt) return handleAddSSHSettingsCallback(rlog, ctx, &req, sshKeyFP, tx, mt)
}, false, }, false,
) )
} }
func handleAddSSHSettingsCallback( func handleAddSSHSettingsCallback(
rlog log.Ext1FieldLogger, ctx *fiber.Ctx, req request.SSHKeyAddRequest, rlog log.Ext1FieldLogger, ctx *fiber.Ctx, req *request.SSHKeyAddRequest,
sshKeyFP string, sshKeyFP string,
tx *sqlx.Tx, tx *sqlx.Tx,
mt *mytoken.Mytoken, mt *mytoken.Mytoken,
......
...@@ -48,7 +48,7 @@ func (r *AuthCodeFlowRequest) Scan(src interface{}) error { ...@@ -48,7 +48,7 @@ func (r *AuthCodeFlowRequest) Scan(src interface{}) error {
} }
// Value implements the driver.Valuer interface // Value implements the driver.Valuer interface
func (r AuthCodeFlowRequest) Value() (driver.Value, error) { func (r AuthCodeFlowRequest) Value() (driver.Value, error) { // skipcq: CRT-P0003
v, err := json.Marshal(r) v, err := json.Marshal(r)
return v, errors.WithStack(err) return v, errors.WithStack(err)
} }
...@@ -105,7 +105,7 @@ func (r *OIDCFlowRequest) Scan(src interface{}) error { ...@@ -105,7 +105,7 @@ func (r *OIDCFlowRequest) Scan(src interface{}) error {
} }
// Value implements the driver.Valuer interface // Value implements the driver.Valuer interface
func (r OIDCFlowRequest) Value() (driver.Value, error) { func (r OIDCFlowRequest) Value() (driver.Value, error) { // skipcq: CRT-P0003
v, err := json.Marshal(r) v, err := json.Marshal(r)
return v, errors.WithStack(err) return v, errors.WithStack(err)
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment