MCPcopy Index your code
hub / github.com/256dpi/gcode / loadFile

Function loadFile

cmd/gcode/helpers.go:9–26  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

7)
8
9func loadFile(path string) *gcode.File {
10 // open g-code file
11 file, err := os.Open(path)
12 if err != nil {
13 panic(err)
14 }
15
16 // make sure file gets closed
17 defer file.Close()
18
19 // parse file
20 f, err := gcode.ParseFile(file)
21 if err != nil {
22 panic(err)
23 }
24
25 return f
26}
27
28func writeFile(path string, f *gcode.File) {
29 // create g-code file

Callers 4

infoFunction · 0.85
stripFunction · 0.85
offsetFunction · 0.85
svgFunction · 0.85

Calls 1

ParseFileFunction · 0.92

Tested by

no test coverage detected