Run gofmt

This commit is contained in:
Thomas Pelletier
2013-03-26 12:10:14 +01:00
parent edc78bc0bf
commit 558a227433
2 changed files with 20 additions and 20 deletions
+4 -4
View File
@@ -7,7 +7,7 @@ import (
)
func assertTree(t *testing.T, tree *TomlTree, err error, ref map[string]interface{}) {
if (err != nil) {
if err != nil {
t.Error("Non-nil error:", err.Error())
return
}
@@ -151,14 +151,14 @@ func TestArrayNestedStrings(t *testing.T) {
func TestMissingValue(t *testing.T) {
_, err := Load("a = ")
if (err.Error() != "expecting a value") {
if err.Error() != "expecting a value" {
t.Error("Bad error message:", err.Error())
}
}
func TestUnterminatedArray(t *testing.T) {
_, err := Load("a = [1,")
if (err.Error() != "unterminated array") {
if err.Error() != "unterminated array" {
t.Error("Bad error message:", err.Error())
}
}
@@ -172,7 +172,7 @@ func TestNewlinesInArrays(t *testing.T) {
func TestMissingFile(t *testing.T) {
_, err := LoadFile("foo.toml")
if (err.Error() != "open foo.toml: no such file or directory") {
if err.Error() != "open foo.toml: no such file or directory" {
t.Error("Bad error message:", err.Error())
}
}
+1 -1
View File
@@ -94,7 +94,7 @@ func Load(content string) (tree *TomlTree, err error) {
// Create a TomlTree from a file.
func LoadFile(path string) (tree *TomlTree, err error) {
buff, ferr := ioutil.ReadFile(path)
if (ferr != nil) {
if ferr != nil {
err = ferr
} else {
s := string(buff)