aboutsummaryrefslogtreecommitdiffstats
path: root/formats/config/section.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-11-03 17:10:43 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-11-03 17:10:43 +0100
commit3f7fbc6c49e50eb22e3de8a5143817fa7c0c54dd (patch)
tree0bf81a6dd858278000d1d7f7afc578d993fba791 /formats/config/section.go
parent94f5e9c949963893d1c3d3e987a591ee15265327 (diff)
downloadgo-git-3f7fbc6c49e50eb22e3de8a5143817fa7c0c54dd.tar.gz
storage/filesystem: implement missing functionality. (#110)
* storage/filesystem: added ObjectStorage Set. * storage/filesystem: now passes all tests, except those specific to transactions. * formats/config: Encoder now encodes subsections with no options. * formats/config: add HasSubsection on Section. * dotgit: add Ref method to get specific reference.
Diffstat (limited to 'formats/config/section.go')
-rw-r--r--formats/config/section.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/formats/config/section.go b/formats/config/section.go
index 6d6a891..552ce74 100644
--- a/formats/config/section.go
+++ b/formats/config/section.go
@@ -74,3 +74,13 @@ func (s *Section) Subsection(name string) *Subsection {
s.Subsections = append(s.Subsections, ss)
return ss
}
+
+func (s *Section) HasSubsection(name string) bool {
+ for _, ss := range s.Subsections {
+ if ss.IsName(name) {
+ return true
+ }
+ }
+
+ return false
+}