MCPcopy Index your code
hub / github.com/drone-plugins/drone-github-release / readStringOrFile

Function readStringOrFile

plugin.go:164–177  ·  view source on GitHub ↗
(input string)

Source from the content-addressed store, hash-verified

162}
163
164func readStringOrFile(input string) (string, error) {
165 // Check if input is a file path
166 if _, err := os.Stat(input); err != nil && os.IsNotExist(err) {
167 // No file found => use input as result
168 return input, nil
169 } else if err != nil {
170 return "", err
171 }
172 result, err := ioutil.ReadFile(input)
173 if err != nil {
174 return "", err
175 }
176 return string(result), nil
177}

Callers 1

ExecMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected