Return local defaults for the specified object An empty string as object name means the constructor.
(ctx context.Context, objName string)
| 236 | // Return local defaults for the specified object |
| 237 | // An empty string as object name means the constructor. |
| 238 | func (mod *Module) ObjectUserDefaults(ctx context.Context, objName string) (*EnvFile, error) { |
| 239 | modDefaults, err := mod.UserDefaults(ctx) |
| 240 | if err != nil { |
| 241 | return nil, err |
| 242 | } |
| 243 | isMainObject := objName == "" || strings.EqualFold(objName, strings.ReplaceAll(mod.OriginalName, "-", "")) |
| 244 | if isMainObject { |
| 245 | return modDefaults, nil |
| 246 | } |
| 247 | return modDefaults.Namespace(ctx, objName) |
| 248 | } |
| 249 | |
| 250 | // ApplyWorkspaceDefaultsToTypeDefs updates constructor arg typedefs based on |
| 251 | // WorkspaceConfig, so that --help displays the correct default values. |
no test coverage detected