mirror of https://github.com/harness/drone.git
techdebt: fix latest linting issues (#806)
parent
298e509ea1
commit
ab9089d613
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
|
|
@ -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 {
|
||||
|
|
16
git/repo.go
16
git/repo.go
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue