From 889ec93288cce6788b92b1813210e4d019d549f5 Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Tue, 17 Oct 2023 03:19:29 -0400 Subject: [PATCH] Rename prefix to isAbsolute inside HP.AsString() --- utils/coreutils.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/coreutils.go b/utils/coreutils.go index 2021b69bb..970619583 100644 --- a/utils/coreutils.go +++ b/utils/coreutils.go @@ -683,19 +683,19 @@ func ParseHierarchyPath(path string, sep string) HierarchyPath { type HierarchyPath []string // AsString converts HierarchyPath to a string. -func (hP HierarchyPath) AsString(sep string, prefix bool) string { +func (hP HierarchyPath) AsString(sep string, isAbsolute bool) string { var strHP strings.Builder - // If prefix is true and the HierarchyPath slice is empty, sep will be returned. + // If isAbsolute is true and the HierarchyPath slice is empty, sep will be returned. // This will indicate the start of the absolute path. - if prefix { + if isAbsolute { strHP.WriteString(sep) } if len(hP) == 0 { - // If prefix is false and HierarchyPath is empty, return '.' to represent the current directory in a relative path. + // If isAbsolute is false and HierarchyPath is empty, return '.' to represent the current directory in a relative path. // This convention avoids errors (e.g., "expr expression is nil") when retrieving elements from an empty path. - if !prefix { + if !isAbsolute { return "." } return strHP.String()