MCPcopy Index your code
hub / github.com/dagger/dagger / moduleSourceWithName

Method moduleSourceWithName

core/schema/modulesource.go:1238–1256  ·  view source on GitHub ↗
(
	ctx context.Context,
	src *core.ModuleSource,
	args struct {
		Name string
	},
)

Source from the content-addressed store, hash-verified

1236}
1237
1238func (s *moduleSourceSchema) moduleSourceWithName(
1239 ctx context.Context,
1240 src *core.ModuleSource,
1241 args struct {
1242 Name string
1243 },
1244) (*core.ModuleSource, error) {
1245 src = src.Clone()
1246 src.ModuleName = args.Name
1247 if src.ModuleOriginalName == "" {
1248 src.ModuleOriginalName = args.Name
1249 }
1250
1251 // Reload user defaults with new name
1252 if err := src.LoadUserDefaults(ctx); err != nil {
1253 return nil, fmt.Errorf("load user defaults: %w", err)
1254 }
1255 return src, nil
1256}
1257
1258func (s *moduleSourceSchema) moduleSourceWithIncludes(
1259 ctx context.Context,

Callers

nothing calls this directly

Calls 2

LoadUserDefaultsMethod · 0.80
CloneMethod · 0.65

Tested by

no test coverage detected