github.com/nextlinux/gosbom@v0.81.1-0.20230627115839-1ff50c281391/gosbom/formats/common/spdxhelpers/homepage.go (about)

     1  package spdxhelpers
     2  
     3  import "github.com/nextlinux/gosbom/gosbom/pkg"
     4  
     5  func Homepage(p pkg.Package) string {
     6  	if hasMetadata(p) {
     7  		switch metadata := p.Metadata.(type) {
     8  		case pkg.GemMetadata:
     9  			return metadata.Homepage
    10  		case pkg.NpmPackageJSONMetadata:
    11  			return metadata.Homepage
    12  		}
    13  	}
    14  	return ""
    15  }