Run of fresh-snapshots for golang-github-dcso-fluxline

Try this locally (using silver-platter):

debian-svp new-upstream --snapshot golang-github-dcso-fluxline 

Merge these changes:

Summary

Merged new upstream version: 0.0~git20190516.1c6f5a3 (was: 0.0~git20181026.4f8ed83).

Diff

diff --git a/debian/changelog b/debian/changelog
index 470304c..9663909 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+golang-github-dcso-fluxline (0.0~git20190516.1c6f5a3-1) UNRELEASED; urgency=medium
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Sun, 23 Jun 2019 03:13:25 +0000
+
 golang-github-dcso-fluxline (0.0~git20181026.4f8ed83-1) unstable; urgency=medium
 
   * New upstream snapshot.
diff --git a/encoder.go b/encoder.go
index 2a55daa..f7b491d 100644
--- a/encoder.go
+++ b/encoder.go
@@ -160,3 +160,13 @@ func NewEncoder(w io.Writer) *Encoder {
 	}
 	return a
 }
+
+// NewEncoderWithHostname creates a new encoder that writes to the given
+// io.Writer with an overridden hostname
+func NewEncoderWithHostname(w io.Writer, host string) *Encoder {
+	a := &Encoder{
+		host:   host,
+		Writer: w,
+	}
+	return a
+}
diff --git a/encoder_test.go b/encoder_test.go
index a8ffe7c..70c1247 100644
--- a/encoder_test.go
+++ b/encoder_test.go
@@ -91,6 +91,28 @@ func TestEncoderEncoder(t *testing.T) {
 	}
 }
 
+func TestEncoderEncoderWithHostname(t *testing.T) {
+	var b bytes.Buffer
+
+	ile := NewEncoderWithHostname(&b, "testhost")
+	tags := make(map[string]string)
+	tags["foo"] = "bar"
+	tags["baaz gogo"] = "gu,gu"
+	err := ile.Encode("mytool", testStruct, tags)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	out := b.String()
+	if len(out) == 0 {
+		t.Fatalf("unexpected result length: %d == 0", len(out))
+	}
+
+	if match, _ := regexp.Match(`^mytool,host=testhost,baaz\\ gogo=gu\\,gu,foo=bar testval=1i,testvalue=2i,testvalue2=-3i,testvalue3=\"foobar\\\"baz\",testvaluebool=false,testvalueflt32=3.1415927,testvalueflt64=1.29e-24,testvaluetime=`, []byte(out)); !match {
+		t.Fatalf("unexpected match content: %s", out)
+	}
+}
+
 func TestEncoderTypeFail(t *testing.T) {
 	var b bytes.Buffer
 

Debdiff

File lists identical (after any substitutions)

No differences were encountered in the control files

Full worker log Full build log