Web API package for use when compling Go to WASM
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
package main
|
|
|
|
|
|
import (
|
|
|
"bytes"
|
|
|
"fmt"
|
|
|
)
|
|
|
|
|
|
type Builder struct {
|
|
|
bytes.Buffer
|
|
|
}
|
|
|
|
|
|
func NewBuilder() *Builder {
|
|
|
return &Builder{}
|
|
|
}
|
|
|
|
|
|
func (b *Builder) WriteString(s string) (int, error) {
|
|
|
return b.Buffer.WriteString(s + "\r\n")
|
|
|
}
|
|
|
|
|
|
func (b *Builder) WriteF(f string, args ...interface{}) (int, error) {
|
|
|
return b.WriteString(fmt.Sprintf(f, args...))
|
|
|
}
|