techdebt: fix latest linting issues (#806)

rkapoor10-patch-1
Akhilesh Pandey 2023-11-16 12:02:05 +00:00 committed by Harness
parent 298e509ea1
commit ab9089d613
5 changed files with 7 additions and 28 deletions

View File

@ -42,8 +42,5 @@ func (p *WriteParams) Validate() error {
return errors.InvalidArgument("RepoUID is mandatory field")
}
if err := p.Actor.Validate(); err != nil {
return err
}
return nil
return p.Actor.Validate()
}

View File

@ -49,11 +49,7 @@ func (p DiffParams) Validate() error {
}
func (s *Service) RawDiff(ctx context.Context, params *DiffParams, out io.Writer) error {
if err := s.rawDiff(ctx, params, out); err != nil {
return err
}
return nil
return s.rawDiff(ctx, params, out)
}
func (s *Service) rawDiff(ctx context.Context, params *DiffParams, w io.Writer) error {

View File

@ -21,7 +21,7 @@ import (
const (
EnvActorName = "GITNESS_HOOK_ACTOR_NAME"
EnvActorEmail = "GITNESS_HOOK_ACTOR_EMAIL"
EnvActorEmail = "GITNESS_HOOK_ACTOR_EMAIL" //#nosec
EnvRepoUID = "GITNESS_HOOK_REPO_UID"
EnvRequestID = "GITNESS_HOOK_REQUEST_ID"
)

View File

@ -83,11 +83,7 @@ type CommitFilesParams struct {
}
func (p *CommitFilesParams) Validate() error {
if err := p.WriteParams.Validate(); err != nil {
return err
}
return nil
return p.WriteParams.Validate()
}
type CommitFilesResponse struct {

View File

@ -83,10 +83,7 @@ type CreateRepositoryParams struct {
}
func (p *CreateRepositoryParams) Validate() error {
if err := p.Actor.Validate(); err != nil {
return err
}
return nil
return p.Actor.Validate()
}
type CreateRepositoryOutput struct {
@ -118,10 +115,7 @@ type HashRepositoryParams struct {
}
func (p *HashRepositoryParams) Validate() error {
if err := p.ReadParams.Validate(); err != nil {
return err
}
return nil
return p.ReadParams.Validate()
}
type HashRepositoryOutput struct {
@ -204,11 +198,7 @@ func (s *Service) DeleteRepository(ctx context.Context, params *DeleteRepository
return fmt.Errorf("failed to check the status of the repository %v: %w", repoPath, err)
}
if err := s.DeleteRepositoryBestEffort(ctx, params.RepoUID); err != nil {
return err
}
return nil
return s.DeleteRepositoryBestEffort(ctx, params.RepoUID)
}
func (s *Service) DeleteRepositoryBestEffort(ctx context.Context, repoUID string) error {