mirror of
https://github.com/vbatts/go-mtree.git
synced 2025-07-04 06:38:30 +00:00
*: make Keyword and KeyVal pervasive
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
5d26726bb1
commit
4eec68be4b
18 changed files with 434 additions and 367 deletions
|
@ -28,8 +28,8 @@ func (dh DirectoryHierarchy) WriteTo(w io.Writer) (n int64, err error) {
|
|||
|
||||
// UsedKeywords collects and returns all the keywords used in a
|
||||
// a DirectoryHierarchy
|
||||
func (dh DirectoryHierarchy) UsedKeywords() []string {
|
||||
usedkeywords := []string{}
|
||||
func (dh DirectoryHierarchy) UsedKeywords() []Keyword {
|
||||
usedkeywords := []Keyword{}
|
||||
for _, e := range dh.Entries {
|
||||
switch e.Type {
|
||||
case FullType, RelativeType, SpecialType:
|
||||
|
@ -37,8 +37,8 @@ func (dh DirectoryHierarchy) UsedKeywords() []string {
|
|||
kvs := e.Keywords
|
||||
for _, kv := range kvs {
|
||||
kw := KeyVal(kv).Keyword()
|
||||
if !inSlice(kw, usedkeywords) {
|
||||
usedkeywords = append(usedkeywords, KeywordSynonym(kw))
|
||||
if !InKeywordSlice(kw, usedkeywords) {
|
||||
usedkeywords = append(usedkeywords, KeywordSynonym(string(kw)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue