cleaned up some dead code!

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2024-02-09 10:04:17 -05:00
parent 6c8e03d36f
commit ca74e83a82

View File

@@ -111,24 +111,8 @@ func (index *SpecIndex) lookupRolodex(uri []string) *Reference {
file := strings.ReplaceAll(uri[0], "file:", "") file := strings.ReplaceAll(uri[0], "file:", "")
var absoluteFileLocation, fileName string var absoluteFileLocation, fileName string
// is this a local or a remote file?
fileName = filepath.Base(file) fileName = filepath.Base(file)
if filepath.IsAbs(file) || strings.HasPrefix(file, "http") { absoluteFileLocation = file
absoluteFileLocation = file
} else {
if index.specAbsolutePath != "" {
if index.config.BaseURL == nil {
// consider the file local
dir := filepath.Dir(index.config.SpecAbsolutePath)
if !strings.HasPrefix(file, ".") {
file = fmt.Sprintf("./%s", file)
}
absoluteFileLocation, _ = filepath.Abs(filepath.Join(dir, file))
}
}
}
// if the absolute file location has no file ext, then get the rolodex root. // if the absolute file location has no file ext, then get the rolodex root.
ext := filepath.Ext(absoluteFileLocation) ext := filepath.Ext(absoluteFileLocation)