reformat so it is more unified with other files
diff --git a/ini.go b/ini.go
index 6952cac..d603b18 100644
--- a/ini.go
+++ b/ini.go
@@ -21,10 +21,12 @@
// Error provides a "file:line: message" formatted message of the ini error.
func (x *IniError) Error() string {
- return fmt.Sprintf("%s:%d: %s",
+ return fmt.Sprintf(
+ "%s:%d: %s",
x.File,
x.LineNumber,
- x.Message)
+ x.Message,
+ )
}
// IniOptions for writing ini files
@@ -69,6 +71,7 @@
// more control, use flags.NewParser.
func IniParse(filename string, data interface{}) error {
p := NewParser(data, Default)
+
return NewIniParser(p).ParseFile(filename)
}
@@ -135,6 +138,7 @@
}
defer file.Close()
+
i.Write(file, options)
return nil
diff --git a/ini_private.go b/ini_private.go
index 941ffd3..c6ab87d 100644
--- a/ini_private.go
+++ b/ini_private.go
@@ -193,9 +193,7 @@
if err == io.EOF {
break
- }
-
- if err != nil {
+ } else if err != nil {
return nil, err
}
@@ -289,8 +287,10 @@
groups := i.matchingGroups(name)
if len(groups) == 0 {
- return newError(ErrUnknownGroup,
- fmt.Sprintf("could not find option group `%s'", name))
+ return newError(
+ ErrUnknownGroup,
+ fmt.Sprintf("could not find option group `%s'", name),
+ )
}
for _, inival := range section {
@@ -312,8 +312,10 @@
if opt == nil {
if (p.Options & IgnoreUnknown) == None {
- return newError(ErrUnknownFlag,
- fmt.Sprintf("unknown option: %s", inival.Name))
+ return newError(
+ ErrUnknownFlag,
+ fmt.Sprintf("unknown option: %s", inival.Name),
+ )
}
continue