Clean up lint (#56)

The only real change in this commit is that MaxInt is made private.
Everything else should be gofmt'ing, docs and cleanup of lint.
This commit is contained in:
Cameron Moore
2016-04-18 09:58:23 -05:00
committed by Thomas Pelletier
parent 9d93af61de
commit 6e26017b00
7 changed files with 32 additions and 29 deletions
+5 -3
View File
@@ -29,6 +29,7 @@ func newTomlTree() *TomlTree {
}
}
// TreeFromMap initializes a new TomlTree object using the given map.
func TreeFromMap(m map[string]interface{}) *TomlTree {
return &TomlTree{
values: m,
@@ -347,12 +348,13 @@ func (t *TomlTree) toToml(indent, keyspace string) string {
return result
}
// Query compiles and executes a query on a tree and returns the query result.
func (t *TomlTree) Query(query string) (*QueryResult, error) {
if q, err := CompileQuery(query); err != nil {
q, err := CompileQuery(query)
if err != nil {
return nil, err
} else {
return q.Execute(t), nil
}
return q.Execute(t), nil
}
// ToString generates a human-readable representation of the current tree.