Generate template URLs if wasn't found in HTML output and license URL generation.

This commit is contained in:
2020-02-08 12:28:30 +05:00
parent 3e4df90945
commit 7726d76512
3 changed files with 54 additions and 0 deletions

View File

@@ -101,6 +101,16 @@ func (gp *golangParser) getDependenciesFromModules(pkgPath string) []*structs.De
dependency.Name = strings.Join(depName[:len(depName)-1], "/")
}
// Version might contain "+incompatible", which might break
// license URL generation.
if strings.Contains(dependency.Version, "incompatible") {
dependency.Version = strings.Split(dependency.Version, "+incompat")[0]
}
// As we're using specific version - we should assume it as
// branch name.
dependency.VCS.Branch = dependency.Version
deps = append(deps, dependency)
// Mark dependency as processed.