MCPcopy Create free account
hub / github.com/compose-spec/compose-go / WithName

Function WithName

cli/options.go:107–119  ·  view source on GitHub ↗

WithName defines ProjectOptions' name

(name string)

Source from the content-addressed store, hash-verified

105
106// WithName defines ProjectOptions' name
107func WithName(name string) ProjectOptionsFn {
108 return func(o *ProjectOptions) error {
109 // a project (once loaded) cannot have an empty name
110 // however, on the options object, the name is optional: if unset,
111 // a name will be inferred by the loader, so it's legal to set the
112 // name to an empty string here
113 if name != loader.NormalizeProjectName(name) {
114 return loader.InvalidProjectNameErr(name)
115 }
116 o.Name = name
117 return nil
118 }
119}
120
121// WithWorkingDirectory defines ProjectOptions' working directory
122func WithWorkingDirectory(wd string) ProjectOptionsFn {

Calls 2

NormalizeProjectNameFunction · 0.92
InvalidProjectNameErrFunction · 0.92

Used in the wild real call sites across dependent graphs

searching dependent graphs…