summaryrefslogtreecommitdiff
path: root/ezfiw.go
blob: 2cc01b62077e6dc11b24353b89fa6aae7035d62f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package libfastimport

import (
	"strconv"

	"git.lukeshu.com/go/libfastimport/textproto"
)

type ezfiw struct {
	fiw *textproto.FIWriter
	err error
}

func (e *ezfiw) WriteLine(a ...interface{}) {
	if e.err == nil {
		e.err = e.fiw.WriteLine(a...)
	}
}

func (e *ezfiw) WriteData(data string) {
	if e.err == nil {
		e.err = e.fiw.WriteData(data)
	}
}

func (e *ezfiw) WriteMark(idnum int) {
	if e.err == nil {
		e.err = e.fiw.WriteLine("mark", ":"+strconv.Itoa(idnum))
	}
}