1package licenses 2 3import ( 4 "embed" 5 "io/fs" 6) 7 8// go:embed *.db *.txt 9var licenseFS embed.FS 10 11// ReadLicenseFile locates and reads the license archive file. Absolute paths are used unmodified. Relative paths are expected to be in the licenses directory of the licenseclassifier package. 12func ReadLicenseFile(filename string) ([]byte, error) { 13 return licenseFS.ReadFile(filename) 14} 15 16// ReadLicenseDir reads directory containing the license files. 17func ReadLicenseDir() ([]fs.DirEntry, error) { 18 return licenseFS.ReadDir(".") 19} 20