Skip to content

Commit

Permalink
More lint changes, no actual code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-vasile committed Nov 21, 2021
1 parent 750047c commit a3c5cfa
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion internal/charset/charset.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var (
}

// https://github.com/file/file/blob/fa93fb9f7d21935f1c7644c47d2975d31f12b812/src/encoding.c#L241
textChars [256]byte = [256]byte{
textChars = [256]byte{
/* BEL BS HT LF VT FF CR */
F, F, F, F, F, F, F, T, T, T, T, T, T, T, F, F, /* 0x0X */
/* ESC */
Expand Down
2 changes: 1 addition & 1 deletion internal/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type (
)

// Scan returns the number of bytes scanned and if there was any error
// in trying to reach the end of data
// in trying to reach the end of data.
func Scan(data []byte) (int, error) {
s := &scanner{}
_ = checkValid(data, s)
Expand Down
16 changes: 16 additions & 0 deletions internal/magic/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,19 @@ func Marc(raw []byte, limit uint32) bool {
// Field terminator is present.
return bytes.Contains(raw, []byte{0x1E})
}

// Glb matches a glTF model format file.
// GLB is the binary file format representation of 3D models save in
// the GL transmission Format (glTF).
// see more: https://docs.fileformat.com/3d/glb/
// https://www.iana.org/assignments/media-types/model/gltf-binary
// GLB file format is based on little endian and its header structure
// show below:
//
// <-- 12-byte header -->
// | magic | version | length |
// | (uint32) | (uint32) | (uint32) |
// | \x67\x6C\x54\x46 | \x01\x00\x00\x00 | ... |
// | g l T F | 1 | ... |
var Glb = prefix([]byte("\x67\x6C\x54\x46\x02\x00\x00\x00"),
[]byte("\x67\x6C\x54\x46\x01\x00\x00\x00"))
17 changes: 0 additions & 17 deletions internal/magic/model.go

This file was deleted.

1 change: 0 additions & 1 deletion mime.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func newMIME(
mime, extension string,
detector magic.Detector,
children ...*MIME) *MIME {

m := &MIME{
mime: mime,
extension: extension,
Expand Down
2 changes: 1 addition & 1 deletion mimetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func DetectReader(r io.Reader) (*MIME, error) {
return errMIME, err
}
} else {
n := 0
var n int
in = make([]byte, l)
// io.UnexpectedEOF means len(r) < len(in). It is not an error in this case,
// it just means the input file is smaller than the allocated bytes slice.
Expand Down

0 comments on commit a3c5cfa

Please sign in to comment.