Skip to content

Commit f835c1b

Browse files
committed
refactor(util/contentType): create buffer slice instead of array
1 parent 2b0db88 commit f835c1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/contentType.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ func GetContentType(filename string, rd io.Reader) (string, error) {
1414
return ctype, nil
1515
}
1616

17-
var buf [512]byte
18-
n, err := rd.Read(buf[:])
17+
buf := make([]byte, 512)
18+
n, err := rd.Read(buf)
1919
if err != nil {
2020
return ctype, err
2121
}

0 commit comments

Comments
 (0)