aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/go-ini/ini/section.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-ini/ini/section.go')
-rw-r--r--vendor/github.com/go-ini/ini/section.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/vendor/github.com/go-ini/ini/section.go b/vendor/github.com/go-ini/ini/section.go
index bbb73ca..45d2f3b 100644
--- a/vendor/github.com/go-ini/ini/section.go
+++ b/vendor/github.com/go-ini/ini/section.go
@@ -28,10 +28,19 @@ type Section struct {
keys map[string]*Key
keyList []string
keysHash map[string]string
+
+ isRawSection bool
+ rawBody string
}
func newSection(f *File, name string) *Section {
- return &Section{f, "", name, make(map[string]*Key), make([]string, 0, 10), make(map[string]string)}
+ return &Section{
+ f: f,
+ name: name,
+ keys: make(map[string]*Key),
+ keyList: make([]string, 0, 10),
+ keysHash: make(map[string]string),
+ }
}
// Name returns name of Section.
@@ -39,6 +48,12 @@ func (s *Section) Name() string {
return s.name
}
+// Body returns rawBody of Section if the section was marked as unparseable.
+// It still follows the other rules of the INI format surrounding leading/trailing whitespace.
+func (s *Section) Body() string {
+ return strings.TrimSpace(s.rawBody)
+}
+
// NewKey creates a new key to given section.
func (s *Section) NewKey(name, val string) (*Key, error) {
if len(name) == 0 {