func fetchImportedByDetails(ctx context.Context, db *postgres.DB, pkgPath, modulePath string) (*ImportedByDetails, error) {
	importedBy, err := db.GetImportedBy(ctx, pkgPath, modulePath, importedByLimit)
	if err != nil {
		return nil, err
	}
	// If we reached the query limit, then we don't know the total.
	// Say so, and show one less than the limit.
	// For example, if the limit is 101 and we get 101 results, then we'll
	// say there are more than 100, and show the first 100.
	totalIsExact := true
	if len(importedBy) == importedByLimit {
		importedBy = importedBy[:len(importedBy)-1]
		totalIsExact = false
	}
	sections := Sections(importedBy, nextPrefixAccount)
	return &ImportedByDetails{
		ModulePath:   modulePath,
		ImportedBy:   sections,
		Total:        len(importedBy),
		TotalIsExact: totalIsExact,
	}, nil
}
// etchImportedByDetails fetches importers for the package version specified by
// path and version from the database and returns a ImportedByDetails.
etchImportedByDetails fetches importers for the package version specified by
path and version from the database and returns a ImportedByDetails.
// etchImportedByDetails fetches importers for the package version specified by // path and version from the database and returns a ImportedByDetails .
func fetchImportedByDetails(ctx context.Context, db *postgres.DB, pkgPath, modulePath string) (*ImportedByDetails, error) {
	importedBy, err := db.GetImportedBy(ctx, pkgPath, modulePath, importedByLimit)
	if err != nil {
		return nil, err
	}
	totalIsExact := true
	if len(importedBy) == importedByLimit {
		importedBy = importedBy[:len(importedBy)-1]
		totalIsExact = false
	}
	sections := Sections(importedBy, nextPrefixAccount)
	return &ImportedByDetails{
		ModulePath:   modulePath,
		ImportedBy:   sections,
		Total:        len(importedBy),
		TotalIsExact: totalIsExact,
	}, nil
}
func fetchImportedByDetails ( ctx context . Context , db * postgres . DB , pkgPath , modulePath string ) ( * ImportedByDetails , error ) { importedBy , err := db . GetImportedBy ( ctx , pkgPath , modulePath , importedByLimit ) if err != nil { return nil , err } totalIsExact := true if len ( importedBy ) == importedByLimit { importedBy = importedBy [ : len ( importedBy ) - 1 ] totalIsExact = false } sections := Sections ( importedBy , nextPrefixAccount ) return & ImportedByDetails { ModulePath : modulePath , ImportedBy : sections , Total : len ( importedBy ) , TotalIsExact : totalIsExact , } , nil }
etchImportedByDetails fetches importers for the package version specified by
path and version from the database and returns a ImportedByDetails.
etchImportedByDetails fetches importers for the package version specified by path and version from the database and returns a ImportedByDetails .
// If we reached the query limit, then we don't know the total. // Say so, and show one less than the limit. // For example, if the limit is 101 and we get 101 results, then we'll // say there are more than 100, and show the first 100.