summaryrefslogtreecommitdiff
path: root/util.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-11-15 16:19:23 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-11-15 16:19:23 -0500
commit29c005aded55168631029f9b129ff812ff96f802 (patch)
tree466eed0750d8976110e62e947c6ef6102dd450bb /util.go
parent902bb1cc2a0a8644e160f303be1a2e0ad354bfd5 (diff)
more
Diffstat (limited to 'util.go')
-rw-r--r--util.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/util.go b/util.go
new file mode 100644
index 0000000..0143f48
--- /dev/null
+++ b/util.go
@@ -0,0 +1,28 @@
+package libfastimport
+
+import (
+ "strconv"
+)
+
+type ezfiw struct {
+ fiw *FIWriter
+ err error
+}
+
+func (e *ezfiw) WriteLine(a ...interface{}) {
+ if e.err == nil {
+ e.err = e.fiw.WriteLine(a...)
+ }
+}
+
+func (e *ezfiw) WriteData(data []byte) {
+ 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))
+ }
+}