diff --git a/cli/module_generate/_templates/go/tmpl-module.go b/cli/module_generate/_templates/go/tmpl-module.go index cf6cde93fee..d3a15639801 100644 --- a/cli/module_generate/_templates/go/tmpl-module.go +++ b/cli/module_generate/_templates/go/tmpl-module.go @@ -35,9 +35,15 @@ type Config struct { } // Validate ensures all parts of the config are valid and important fields exist. -// Returns implicit dependencies based on the config. -// The path is the JSON path in your robot's config (not the `Config` struct) to the -// resource being validated; e.g. "components.0". +// Returns three values: +// 1. Required dependencies: other resources that must exist for this resource to work. +// 2. Optional dependencies: other resources that may exist but are not required. +// 3. An error if any Config fields are missing or invalid. +// +// The `path` parameter indicates +// where this resource appears in the machine's JSON configuration +// (for example, "components.0"). You can use it in error messages +// to indicate which resource has a problem. func (cfg *Config) Validate(path string) ([]string, []string, error) { // Add config validation code here return nil, nil, nil diff --git a/cli/module_generate/scripts/tmpl-module b/cli/module_generate/scripts/tmpl-module index 6a2def5e39b..95835e85528 100644 --- a/cli/module_generate/scripts/tmpl-module +++ b/cli/module_generate/scripts/tmpl-module @@ -36,9 +36,15 @@ type Config struct { } // Validate ensures all parts of the config are valid and important fields exist. -// Returns implicit required (first return) and optional (second return) dependencies based on the config. -// The path is the JSON path in your robot's config (not the `Config` struct) to the -// resource being validated; e.g. "components.0". +// Returns three values: +// 1. Required dependencies: other resources that must exist for this resource to work. +// 2. Optional dependencies: other resources that may exist but are not required. +// 3. An error if any Config fields are missing or invalid. +// +// The `path` parameter indicates +// where this resource appears in the machine's JSON configuration +// (for example, "components.0"). You can use it in error messages +// to indicate which resource has a problem. func (cfg *Config) Validate(path string) ([]string, []string, error) { // Add config validation code here return nil, nil, nil