1
0
mirror of https://github.com/go-task/task.git synced 2024-12-12 10:45:49 +02:00

refactor(merge): use constant

This commit is contained in:
Andrey Nering 2023-10-21 21:10:42 -03:00
parent 781e55fce9
commit 6de3be1384

View File

@ -73,8 +73,8 @@ func Merge(t1, t2 *Taskfile, includedTaskfile *IncludedTaskfile, namespaces ...s
}
func taskNameWithNamespace(taskName string, namespaces ...string) string {
if strings.HasPrefix(taskName, ":") {
return strings.TrimPrefix(taskName, ":")
if strings.HasPrefix(taskName, NamespaceSeparator) {
return strings.TrimPrefix(taskName, NamespaceSeparator)
}
return strings.Join(append(namespaces, taskName), NamespaceSeparator)
}