Files
gothermal/src/device/usbDevice.go
T
esilva 9c86b28fc0 Started developing the fax page
I have to change computers now, so I'm committing this mess
2024-05-05 12:32:19 +01:00

20 lines
275 B
Go

package device
import (
"os"
)
type PrinterUSB struct {
Path string
}
func (p *PrinterUSB) Write(data []byte) (int, error) {
printer, err := os.OpenFile(p.Path, os.O_WRONLY, 0666)
if err != nil {
panic(err)
}
defer printer.Close()
return printer.Write(data)
}