Skip to content

Commit

Permalink
fix tags
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoOliveira committed Dec 7, 2023
1 parent 869a2a7 commit 3d5da82
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions core/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,21 @@ func pathToTags(path string) []string {
log.Println("pathToTags", path)
path = strings.Trim(path, "/")
tags := strings.Split(path, "/")
if len(tags) == 0 {
tags = make([]string, 0)
tagSet := make(map[string]bool)
for _, t := range tags {
if t != "" {
tagSet[t] = true
}

}
rtn := make([]string, len(tagSet))
i := 0
for k := range tagSet {
rtn[i] = k
i++
}
log.Println("pathToTags", tags)
return tags
log.Println("pathToTags", rtn)
return rtn
}

func initProject(project *models.Project) error {
Expand Down

0 comments on commit 3d5da82

Please sign in to comment.