From 1ba33791ffb7be31358ed776448ee86b4438dad3 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Fri, 22 Dec 2023 00:08:40 +0700 Subject: all: update comment on relativePath function --- awwan.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/awwan.go b/awwan.go index c987fc2..bb8ded4 100644 --- a/awwan.go +++ b/awwan.go @@ -506,12 +506,12 @@ func lookupBaseDir(baseDir, currDir string) (dir string, err error) { return dir, nil } -// relativePath return the relative path based on baseDir. -// It will return path without baseDir prefix on success, or unchanged path -// if no baseDir. -func relativePath(baseDir, path string) (relpath string) { +// relativePath return the relative path based on dir. +// It will return path without dir prefix on success or unchanged if dir is +// not a prefix of path or has any error. +func relativePath(dir, path string) (relpath string) { var err error - relpath, err = filepath.Rel(baseDir, path) + relpath, err = filepath.Rel(dir, path) if err != nil { relpath = path } -- cgit v1.3