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

Method main

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

Source from the content-addressed store, hash-verified

29}
30
31func (p *Program) main(files []string, input io.Reader, output, stderr io.Writer) int {
32 err := p.run(files, input, output)
33 if err != nil {
34 var derr *toml.DecodeError
35 if errors.As(err, &derr) {
36 _, _ = fmt.Fprintln(stderr, derr.String())
37 row, col := derr.Position()
38 _, _ = fmt.Fprintln(stderr, "error occurred at row", row, "column", col)
39 } else {
40 _, _ = fmt.Fprintln(stderr, err.Error())
41 }
42
43 return -1
44 }
45 return 0
46}
47
48func (p *Program) run(files []string, input io.Reader, output io.Writer) error {
49 if len(files) > 0 {

Callers 5

ExecuteMethod · 0.95
processMainFunction · 0.95

Calls 4

runMethod · 0.95
StringMethod · 0.95
PositionMethod · 0.95
ErrorMethod · 0.45

Tested by 4

processMainFunction · 0.76