WriteFile will write the specified G-Code file to the passed writer.
(w io.Writer, f *File)
| 71 | |
| 72 | // WriteFile will write the specified G-Code file to the passed writer. |
| 73 | func WriteFile(w io.Writer, f *File) error { |
| 74 | // generate lines |
| 75 | for _, l := range f.Lines { |
| 76 | _, err := io.WriteString(w, l.String()) |
| 77 | if err != nil { |
| 78 | return err |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | return nil |
| 83 | } |