From d0e09b414a9b069ec7bcbed2880b93c27cf3727c Mon Sep 17 00:00:00 2001 From: feistel <6742251-feistel@users.noreply.gitlab.com> Date: Wed, 8 Sep 2021 15:04:21 +0000 Subject: refactor: cleanup func signature and remove unused args --- cmd/gitlab-shell-authorized-principals-check/command/command.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'cmd/gitlab-shell-authorized-principals-check/command/command.go') diff --git a/cmd/gitlab-shell-authorized-principals-check/command/command.go b/cmd/gitlab-shell-authorized-principals-check/command/command.go index b5ded54..9418dad 100644 --- a/cmd/gitlab-shell-authorized-principals-check/command/command.go +++ b/cmd/gitlab-shell-authorized-principals-check/command/command.go @@ -7,12 +7,10 @@ import ( "gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter" "gitlab.com/gitlab-org/gitlab-shell/internal/command/shared/disallowedcommand" "gitlab.com/gitlab-org/gitlab-shell/internal/config" - "gitlab.com/gitlab-org/gitlab-shell/internal/executable" - "gitlab.com/gitlab-org/gitlab-shell/internal/sshenv" ) -func New(e *executable.Executable, arguments []string, env sshenv.Env, config *config.Config, readWriter *readwriter.ReadWriter) (command.Command, error) { - args, err := Parse(e, arguments, env) +func New(arguments []string, config *config.Config, readWriter *readwriter.ReadWriter) (command.Command, error) { + args, err := Parse(arguments) if err != nil { return nil, err } @@ -24,7 +22,7 @@ func New(e *executable.Executable, arguments []string, env sshenv.Env, config *c return nil, disallowedcommand.Error } -func Parse(e *executable.Executable, arguments []string, env sshenv.Env) (*commandargs.AuthorizedPrincipals, error) { +func Parse(arguments []string) (*commandargs.AuthorizedPrincipals, error) { args := &commandargs.AuthorizedPrincipals{Arguments: arguments} if err := args.Parse(); err != nil { -- cgit v1.2.1