Skip to content

Commit bedc097

Browse files
authored
Fix go lint issues (#6213)
Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
1 parent 172c4ae commit bedc097

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

pkg/config/application.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ type DeploymentChainTriggerCondition struct {
758758
func (c *DeploymentChainTriggerCondition) Validate() error {
759759
hasCond := c.CommitPrefix != ""
760760
if !hasCond {
761-
return fmt.Errorf("missing commitPrefix configration as deployment chain trigger condition")
761+
return fmt.Errorf("missing commitPrefix configuration as deployment chain trigger condition")
762762
}
763763
return nil
764764
}

pkg/configv1/application.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ type DeploymentChainTriggerCondition struct {
458458
func (c *DeploymentChainTriggerCondition) Validate() error {
459459
hasCond := c.CommitPrefix != ""
460460
if !hasCond {
461-
return fmt.Errorf("missing commitPrefix configration as deployment chain trigger condition")
461+
return fmt.Errorf("missing commitPrefix configuration as deployment chain trigger condition")
462462
}
463463
return nil
464464
}

pkg/plugin/sdk/deployment.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func (s *DeploymentPluginServiceServer[Config, DeployTargetConfig, ApplicationCo
164164
Logger: s.logger,
165165
}
166166

167-
response, err := s.base.BuildQuickSyncStages(ctx, s.commonFields.pluginConfig, input)
167+
response, err := s.base.BuildQuickSyncStages(ctx, s.pluginConfig, input)
168168
if err != nil {
169169
return nil, status.Errorf(codes.Internal, "failed to build quick sync stages: %v", err)
170170
}
@@ -192,7 +192,7 @@ func (s *DeploymentPluginServiceServer[Config, DeployTargetConfig, ApplicationCo
192192
}
193193

194194
// Get the deploy targets set on the deployment from the piped plugin config.
195-
dtNames := request.GetInput().GetDeployment().GetDeployTargets(s.commonFields.config.Name)
195+
dtNames := request.GetInput().GetDeployment().GetDeployTargets(s.config.Name)
196196
deployTargets := make([]*DeployTarget[DeployTargetConfig], 0, len(dtNames))
197197
for _, name := range dtNames {
198198
dt, ok := s.deployTargets[name]
@@ -203,7 +203,7 @@ func (s *DeploymentPluginServiceServer[Config, DeployTargetConfig, ApplicationCo
203203
deployTargets = append(deployTargets, dt)
204204
}
205205

206-
return executeStage(ctx, s.name, s.base, s.commonFields.pluginConfig, deployTargets, client, request, s.logger)
206+
return executeStage(ctx, s.name, s.base, s.pluginConfig, deployTargets, client, request, s.logger)
207207
}
208208

209209
// StagePluginServiceServer is the gRPC server that handles requests from the piped.
@@ -261,7 +261,7 @@ func (s *StagePluginServiceServer[Config, DeployTargetConfig, ApplicationConfigS
261261
toolRegistry: s.toolRegistry,
262262
}
263263

264-
return executeStage(ctx, s.name, s.base, s.commonFields.pluginConfig, nil, client, request, s.logger) // TODO: pass the deployTargets
264+
return executeStage(ctx, s.name, s.base, s.pluginConfig, nil, client, request, s.logger) // TODO: pass the deployTargets
265265
}
266266

267267
// buildPipelineSyncStages builds the stages that will be executed by the plugin.

pkg/plugin/sdk/livestate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (s *LivestatePluginServer[Config, DeployTargetConfig, ApplicationConfigSpec
7676
return nil, status.Errorf(codes.Internal, "failed to parse deployment source: %v", err)
7777
}
7878

79-
response, err := s.base.GetLivestate(ctx, s.commonFields.pluginConfig, deployTargets, &GetLivestateInput[ApplicationConfigSpec]{
79+
response, err := s.base.GetLivestate(ctx, s.pluginConfig, deployTargets, &GetLivestateInput[ApplicationConfigSpec]{
8080
Request: GetLivestateRequest[ApplicationConfigSpec]{
8181
PipedID: request.GetPipedId(),
8282
ApplicationID: request.GetApplicationId(),
@@ -90,7 +90,7 @@ func (s *LivestatePluginServer[Config, DeployTargetConfig, ApplicationConfigSpec
9090
return nil, status.Errorf(codes.Internal, "failed to get the live state: %v", err)
9191
}
9292

93-
return response.toModel(s.commonFields.config.Name, time.Now()), nil
93+
return response.toModel(s.config.Name, time.Now()), nil
9494
}
9595

9696
// GetLivestateInput is the input for the GetLivestate method.

pkg/plugin/sdk/planpreview.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (s *PlanPreviewPluginServer[Config, DeployTargetConfig, ApplicationConfigSp
7272
return nil, status.Errorf(codes.Internal, "failed to parse deployment source: %v", err)
7373
}
7474

75-
response, err := s.base.GetPlanPreview(ctx, s.commonFields.pluginConfig, deployTargets, &GetPlanPreviewInput[ApplicationConfigSpec]{
75+
response, err := s.base.GetPlanPreview(ctx, s.pluginConfig, deployTargets, &GetPlanPreviewInput[ApplicationConfigSpec]{
7676
Request: GetPlanPreviewRequest[ApplicationConfigSpec]{
7777
ApplicationID: request.GetApplicationId(),
7878
TargetDeploymentSource: deploymentSource,

tool/actions-gh-release/release.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ func extractReleaseNote(def, body string, useReleaseNoteBlock bool) string {
333333

334334
func determineCommitCategory(commit Commit, mergeCommit *Commit, categories []ReleaseCommitCategoryConfig) string {
335335
for _, c := range categories {
336-
if c.ReleaseCommitMatcherConfig.Empty() {
336+
if c.Empty() {
337337
return c.ID
338338
}
339-
if c.ReleaseCommitMatcherConfig.Match(commit, mergeCommit) {
339+
if c.Match(commit, mergeCommit) {
340340
return c.ID
341341
}
342342
}

0 commit comments

Comments
 (0)