MCPcopy Index your code
hub / github.com/pelletier/go-toml / runFileInPlace

Method runFileInPlace

internal/cli/cli.go:73–87  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

71}
72
73func (p *Program) runFileInPlace(path string) error {
74 in, err := os.ReadFile(path) // #nosec G304
75 if err != nil {
76 return err
77 }
78
79 out := new(bytes.Buffer)
80
81 err = p.Fn(bytes.NewReader(in), out)
82 if err != nil {
83 return err
84 }
85
86 return os.WriteFile(path, out.Bytes(), 0o600)
87}

Callers 1

runAllFilesInPlaceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected