func (b *DirManifestBuilder) AddEntry(de *snapshot.DirEntry) {
	b.mu.Lock()
	defer b.mu.Unlock()

	b.entries = append(b.entries, de)

	if de.ModTime.After(b.summary.MaxModTime) {
		b.summary.MaxModTime = de.ModTime
	}

	// nolint:exhaustive
	switch de.Type {
	case snapshot.EntryTypeSymlink:
		b.summary.TotalSymlinkCount++

	case snapshot.EntryTypeFile:
		b.summary.TotalFileCount++
		b.summary.TotalFileSize += de.FileSize

	case snapshot.EntryTypeDirectory:
		if childSummary := de.DirSummary; childSummary != nil {
			b.summary.TotalFileCount += childSummary.TotalFileCount
			b.summary.TotalFileSize += childSummary.TotalFileSize
			b.summary.TotalDirCount += childSummary.TotalDirCount
			b.summary.FatalErrorCount += childSummary.FatalErrorCount
			b.summary.IgnoredErrorCount += childSummary.IgnoredErrorCount
			b.summary.FailedEntries = append(b.summary.FailedEntries, childSummary.FailedEntries...)

			if childSummary.MaxModTime.After(b.summary.MaxModTime) {
				b.summary.MaxModTime = childSummary.MaxModTime
			}
		}
	}
}
// AddEntry adds a directory entry to the builder.
AddEntry adds a directory entry to the builder.
// AddEntry adds a directory entry to the builder .
func (b *DirManifestBuilder) AddEntry(de *snapshot.DirEntry) {
	b.mu.Lock()
	defer b.mu.Unlock()
	b.entries = append(b.entries, de)
	if de.ModTime.After(b.summary.MaxModTime) {
		b.summary.MaxModTime = de.ModTime
	}
	switch de.Type {
	case snapshot.EntryTypeSymlink:
		b.summary.TotalSymlinkCount++
	case snapshot.EntryTypeFile:
		b.summary.TotalFileCount++
		b.summary.TotalFileSize += de.FileSize
	case snapshot.EntryTypeDirectory:
		if childSummary := de.DirSummary; childSummary != nil {
			b.summary.TotalFileCount += childSummary.TotalFileCount
			b.summary.TotalFileSize += childSummary.TotalFileSize
			b.summary.TotalDirCount += childSummary.TotalDirCount
			b.summary.FatalErrorCount += childSummary.FatalErrorCount
			b.summary.IgnoredErrorCount += childSummary.IgnoredErrorCount
			b.summary.FailedEntries = append(b.summary.FailedEntries, childSummary.FailedEntries...)
			if childSummary.MaxModTime.After(b.summary.MaxModTime) {
				b.summary.MaxModTime = childSummary.MaxModTime
			}
		}
	}
}
func ( b * DirManifestBuilder ) AddEntry ( de * snapshot . DirEntry ) { b . mu . Lock ( ) defer b . mu . Unlock ( ) b . entries = append ( b . entries , de ) if de . ModTime . After ( b . summary . MaxModTime ) { b . summary . MaxModTime = de . ModTime } switch de . Type { case snapshot . EntryTypeSymlink : b . summary . TotalSymlinkCount ++ case snapshot . EntryTypeFile : b . summary . TotalFileCount ++ b . summary . TotalFileSize += de . FileSize case snapshot . EntryTypeDirectory : if childSummary := de . DirSummary ; childSummary != nil { b . summary . TotalFileCount += childSummary . TotalFileCount b . summary . TotalFileSize += childSummary . TotalFileSize b . summary . TotalDirCount += childSummary . TotalDirCount b . summary . FatalErrorCount += childSummary . FatalErrorCount b . summary . IgnoredErrorCount += childSummary . IgnoredErrorCount b . summary . FailedEntries = append ( b . summary . FailedEntries , childSummary . FailedEntries ... ) if childSummary . MaxModTime . After ( b . summary . MaxModTime ) { b . summary . MaxModTime = childSummary . MaxModTime } } } }
AddEntry adds a directory entry to the builder.
AddEntry adds a directory entry to the builder .
// nolint:exhaustive