(path string, f *gcode.File)
| 26 | } |
| 27 | |
| 28 | func writeFile(path string, f *gcode.File) { |
| 29 | // create g-code file |
| 30 | file, err := os.Create(path) |
| 31 | if err != nil { |
| 32 | panic(err) |
| 33 | } |
| 34 | |
| 35 | // make sure file gets closed |
| 36 | defer file.Close() |
| 37 | |
| 38 | // parse file |
| 39 | err = gcode.WriteFile(file, f) |
| 40 | if err != nil { |
| 41 | panic(err) |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | func writeFileString(path string, s string) { |
| 46 | // create g-code file |