MCPcopy Index your code
hub / github.com/cloudfoundry/cli / UnmarshalFlag

Method UnmarshalFlag

command/flag/path.go:130–146  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

128}
129
130func (p *PathWithExistenceCheckOrURL) UnmarshalFlag(path string) error {
131 if !strings.HasPrefix(path, "http://") && !strings.HasPrefix(path, "https://") {
132 _, err := os.Stat(path)
133 if err != nil {
134 if os.IsNotExist(err) {
135 return &flags.Error{
136 Type: flags.ErrRequired,
137 Message: fmt.Sprintf("The specified path '%s' does not exist.", path),
138 }
139 }
140 return err
141 }
142 }
143
144 *p = PathWithExistenceCheckOrURL(path)
145 return nil
146}
147
148type PathWithAt string
149

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected