Improve readability of ifc.Loader's Repo() method (#4857)

* Improve ldr Repo() method readability

* Change Repo() implementations and calls

* Improve readability of conditions in ldr.New()

* Fix details
This commit is contained in:
Anna Song
2022-11-08 14:48:14 -08:00
committed by GitHub
parent 6d9b54004e
commit beb2825f82
7 changed files with 35 additions and 35 deletions

View File

@@ -121,13 +121,13 @@ func NewFileLoaderAtRoot(fSys filesys.FileSystem) *fileLoader {
RestrictionRootOnly, fSys, filesys.Separator)
}
// Repo returns the absolute path to the repo that contains Root and true
// if this fileLoader was created from a url; otherwise, the empty string and false
func (fl *fileLoader) Repo() (string, bool) {
// Repo returns the absolute path to the repo that contains Root if this fileLoader was created from a url
// or the empty string otherwise.
func (fl *fileLoader) Repo() string {
if fl.repoSpec != nil {
return fl.repoSpec.Dir.String(), true
return fl.repoSpec.Dir.String()
}
return "", false
return ""
}
// Root returns the absolute path that is prepended to any