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:
committed by
Thomas Pelletier
parent
9d93af61de
commit
6e26017b00
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user