diff --git a/Documentation/etcd-file-system.md b/Documentation/etcd-file-system.md index c48cfecd4..092ecdee6 100644 --- a/Documentation/etcd-file-system.md +++ b/Documentation/etcd-file-system.md @@ -23,12 +23,13 @@ Besides the file and directory difference, all nodes have common attributes and The path of access control list of the node. ### Operation: -- **Get** (path, recursive) +- **Get** (path, recursive, sorted) Get the content of the node - If the node is a file, the data of the file will be returned. - If the node is a directory, the child nodes of the directory will be returned. - If recursive is true, it will recursively get the nodes of the directory. + - If sorted is true, the result will be sorted based on the path. - **Create** (path, value[optional], ttl [optional]) diff --git a/file_system/file_system.go b/file_system/file_system.go index d2735966c..51023ef86 100644 --- a/file_system/file_system.go +++ b/file_system/file_system.go @@ -26,7 +26,7 @@ func New() *FileSystem { } -func (fs *FileSystem) Get(nodePath string, recusive, sorting bool, index uint64, term uint64) (*Event, error) { +func (fs *FileSystem) Get(nodePath string, recusive, sorted bool, index uint64, term uint64) (*Event, error) { n, err := fs.InternalGet(nodePath, index, term) if err != nil { @@ -58,7 +58,7 @@ func (fs *FileSystem) Get(nodePath string, recusive, sorting bool, index uint64, // eliminate hidden nodes e.KVPairs = e.KVPairs[:i] - if sorting { + if sorted { sort.Sort(e) } } else { // node is file