Skip to content

Commit

Permalink
refactor: update docstring placement to follow idiomatic Go convention
Browse files Browse the repository at this point in the history
  • Loading branch information
RUFFY-369 committed Dec 3, 2024
1 parent feff44e commit 805866a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions worker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,14 @@ type DockerManager struct {
mu *sync.Mutex
}

// overridePipelineImages function parses a JSON string containing pipeline-to-image mappings and overrides the default mappings if valid.
// It updates the `pipelineToImage` and `livePipelineToImage` maps with custom images.
// Parameters:
// - defaultImage: A string that can either be containerImage name or a JSON string with overrides for pipeline-to-image mappings.
//
// Returns:
// - error: An error if the JSON parsing fails or if the mapping is not found in existing maps else `nil`.
func overridePipelineImages(defaultImage string) error {
// overridePipelineImages function parses a JSON string containing pipeline-to-image mappings and overrides the default mappings if valid.
// It updates the `pipelineToImage` and `livePipelineToImage` maps with custom images.
// Parameters:
// - defaultImage: A string that can either be containerImage name or a JSON string with overrides for pipeline-to-image mappings.
//
// Returns:
// - error: An error if the JSON parsing fails or if the mapping is not found in existing maps else `nil`.

// First check if the defaultImage is a valid JSON string
var pipelineOverrides map[string]string
if strings.HasPrefix(defaultImage, "{") || strings.HasSuffix(defaultImage, "}") {
Expand Down

0 comments on commit 805866a

Please sign in to comment.