22 lines
338 B
Go
22 lines
338 B
Go
// Equivalente a examples/hello.c.
|
|
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"fmt"
|
|
|
|
"goescpos/escpos"
|
|
)
|
|
|
|
func main() {
|
|
fmt.Println(escpos.Version)
|
|
|
|
// bytes.Buffer sustituye a todo src/buffer.c: crece solo y lo libera el GC.
|
|
var buf bytes.Buffer
|
|
for range 100 {
|
|
buf.WriteByte('A')
|
|
}
|
|
|
|
fmt.Printf("len=%d cap=%d\n", buf.Len(), buf.Cap())
|
|
}
|