New Upstream Snapshot - golang-github-glacjay-goini

Ready changes

Summary

Merged new upstream version: 0.0~git20161120 (was: 0.0~git20150730).

Resulting package

Built on 2022-11-09T00:48 (took 12m48s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots golang-github-glacjay-goini-dev

Lintian Result

Diff

diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 6facd5a..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-.*.swp
-
-*.[689]
-[689].out
-
-_obj
-_test
-_testmain.go
diff --git a/debian/changelog b/debian/changelog
index db3940e..de577b9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+golang-github-glacjay-goini (0.0~git20161120-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Wed, 09 Nov 2022 00:40:01 -0000
+
 golang-github-glacjay-goini (0.0~git20150730-3) unstable; urgency=medium
 
   [ Alexandre Viau ]
diff --git a/ini.go b/ini.go
index d224f1e..9b5feef 100644
--- a/ini.go
+++ b/ini.go
@@ -51,11 +51,12 @@ func LoadReader(reader *bufio.Reader) (dict Dict, err error) {
 			break
 		}
 		lineno++
-		if len(l) == 0 {
+		
+		line := strings.TrimFunc(string(l), unicode.IsSpace)
+		if len(line) == 0 {
 			continue
 		}
-		line := strings.TrimFunc(string(l), unicode.IsSpace)
-
+		
 		for line[len(line)-1] == '\\' {
 			line = line[:len(line)-1]
 			l, _, err := reader.ReadLine()
diff --git a/ini_test.go b/ini_test.go
index 321faf7..4a64eb3 100644
--- a/ini_test.go
+++ b/ini_test.go
@@ -1,10 +1,11 @@
 package ini
 
 import (
+	"bufio"
 	"io/ioutil"
-	"testing"
+	"os"
 	"strings"
-	"bufio"
+	"testing"
 )
 
 var (
@@ -22,6 +23,17 @@ func TestLoad(t *testing.T) {
 	}
 }
 
+func TestLoadFileWithSpaces(t *testing.T) {
+	if err := ioutil.WriteFile("testLoadFileWithSpaces.ini", []byte(" "), 0777); err != nil {
+		t.Error("Unable to write test file")
+	}
+	defer os.Remove("testLoadFileWithSpaces.ini")
+
+	if _, err := Load("testLoadFileWithSpaces.ini"); err != nil {
+		t.Error("Load: Couldn't load ini file with line consisting only of spaces.")
+	}
+}
+
 func TestWrite(t *testing.T) {
 	d, err := Load("empty.ini")
 	if err != nil {
@@ -162,18 +174,18 @@ func TestString(t *testing.T) {
 	}
 	s, found := d2.GetString("section1", "key1")
 	if !found || s != "value2" {
-	        t.Error("Stringify failed for section1, key1")
+		t.Error("Stringify failed for section1, key1")
 	}
 	i, found := d2.GetInt("section1", "key2")
 	if !found || i != 5 {
-	        t.Error("Stringify failed for section1, key2")
+		t.Error("Stringify failed for section1, key2")
 	}
 	db, found := d2.GetDouble("section1", "key3")
 	if !found || db != 1.3 {
-	        t.Error("Stringify failed for section1, key3")
+		t.Error("Stringify failed for section1, key3")
 	}
 	db, found = d2.GetDouble("section2", "key1")
 	if !found || db != 5.0 {
-	        t.Error("Stringify failed for section2, key1")
+		t.Error("Stringify failed for section2, key1")
 	}
 }

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/share/gocode/src/github.com/glacjay/goini/.gitignore

No differences were encountered in the control files

More details

Full run details