MCPcopy
hub / github.com/pelletier/go-toml / run

Method run

internal/cli/cli.go:48–61  ·  view source on GitHub ↗
(files []string, input io.Reader, output io.Writer)

Source from the content-addressed store, hash-verified

46}
47
48func (p *Program) run(files []string, input io.Reader, output io.Writer) error {
49 if len(files) > 0 {
50 if p.Inplace {
51 return p.runAllFilesInPlace(files)
52 }
53 f, err := os.Open(files[0])
54 if err != nil {
55 return err
56 }
57 defer func() { _ = f.Close() }()
58 input = f
59 }
60 return p.Fn(input, output)
61}
62
63func (p *Program) runAllFilesInPlace(files []string) error {
64 for _, path := range files {

Callers 1

mainMethod · 0.95

Calls 1

runAllFilesInPlaceMethod · 0.95

Tested by

no test coverage detected