diff options
Diffstat (limited to 'service/path/atom.go')
-rw-r--r-- | service/path/atom.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/service/path/atom.go b/service/path/atom.go index b87080347..db210b518 100644 --- a/service/path/atom.go +++ b/service/path/atom.go @@ -27,11 +27,19 @@ type Atom struct { Index uint64 // The index of the atom in the array. } +// String returns the string representation of the path. +func (n *Atom) String() string { return n.Path() } + // Path implements the Path interface. func (n *Atom) Path() string { return fmt.Sprintf("%v[%d]", n.Atoms, n.Index) } +// Base implements the Path interface, returning the path to the atom list. +func (n *Atom) Base() Path { + return n.Atoms +} + // Field implements the Value interface. func (n *Atom) Field(name string) Value { return &Field{Struct: n, Name: name} |