Skip to content

Commit

Permalink
Do not export keys arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
flanglet committed Nov 6, 2023
1 parent 401eacb commit bc330c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions v2/Magic.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ type Magic struct {
}

var (
KEYS32 = [17]uint{
_KEYS32 = [17]uint{
GIF_MAGIC, PDF_MAGIC, ZIP_MAGIC, LZMA_MAGIC, PNG_MAGIC,
ELF_MAGIC, MAC_MAGIC32, MAC_CIGAM32, MAC_MAGIC64, MAC_CIGAM64,
ZSTD_MAGIC, BROTLI_MAGIC, CAB_MAGIC, RIFF_MAGIC, FLAC_MAGIC,
XZ_MAGIC, KNZ_MAGIC,
}

KEYS16 = [3]uint{
_KEYS16 = [3]uint{
GZIP_MAGIC, BMP_MAGIC, WIN_MAGIC,
}
)
Expand All @@ -82,15 +82,15 @@ func GetMagicType(src []byte) uint {
return key >> 8
}

for _, k := range KEYS32 {
for _, k := range _KEYS32 {
if key == k {
return key
}
}

key16 := key >> 16

for _, k := range KEYS16 {
for _, k := range _KEYS16 {
if key16 == k {
return key16
}
Expand Down

0 comments on commit bc330c1

Please sign in to comment.