Skip to content

Commit

Permalink
Add binary as a language as go-enry doesn't handle it
Browse files Browse the repository at this point in the history
  • Loading branch information
srijansk committed Feb 5, 2025
1 parent 324214f commit 306f34d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index/shard_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,11 @@ func (b *ShardBuilder) Add(doc Document) error {

if len(doc.Content) > MaxFileSize {
doc.SkipReason = fmt.Sprintf("file size %d exceeds maximum size %d", len(doc.Content), MaxFileSize)
} else if idx := bytes.IndexByte(doc.Content, 0); idx >= 0 {
}

if idx := bytes.IndexByte(doc.Content, 0); idx >= 0 {
doc.SkipReason = fmt.Sprintf("binary content at byte offset %d", idx)
doc.Language = "binary"
}

if doc.SkipReason != "" {
Expand Down

0 comments on commit 306f34d

Please sign in to comment.