chore: Address misc linting warnings
This commit is contained in:
parent
b10c1876b1
commit
7b9030c33a
|
@ -761,23 +761,23 @@ func (handler *UnroutedHandler) GetFile(w http.ResponseWriter, r *http.Request)
|
|||
// The values of this map does not convey any meaning and are therefore just
|
||||
// empty structs.
|
||||
var mimeInlineBrowserWhitelist = map[string]struct{}{
|
||||
"text/plain": struct{}{},
|
||||
"text/plain": {},
|
||||
|
||||
"image/png": struct{}{},
|
||||
"image/jpeg": struct{}{},
|
||||
"image/gif": struct{}{},
|
||||
"image/bmp": struct{}{},
|
||||
"image/webp": struct{}{},
|
||||
"image/png": {},
|
||||
"image/jpeg": {},
|
||||
"image/gif": {},
|
||||
"image/bmp": {},
|
||||
"image/webp": {},
|
||||
|
||||
"audio/wave": struct{}{},
|
||||
"audio/wav": struct{}{},
|
||||
"audio/x-wav": struct{}{},
|
||||
"audio/x-pn-wav": struct{}{},
|
||||
"audio/webm": struct{}{},
|
||||
"video/webm": struct{}{},
|
||||
"audio/ogg": struct{}{},
|
||||
"video/ogg": struct{}{},
|
||||
"application/ogg": struct{}{},
|
||||
"audio/wave": {},
|
||||
"audio/wav": {},
|
||||
"audio/x-wav": {},
|
||||
"audio/x-pn-wav": {},
|
||||
"audio/webm": {},
|
||||
"video/webm": {},
|
||||
"audio/ogg": {},
|
||||
"video/ogg": {},
|
||||
"application/ogg": {},
|
||||
}
|
||||
|
||||
// filterContentType returns the values for the Content-Type and
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"io"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/s3"
|
||||
|
@ -26,11 +26,11 @@ func (s MinioS3API) PutObjectWithContext(ctx context.Context, input *s3.PutObjec
|
|||
if input.ContentLength != nil {
|
||||
objectSize = *input.ContentLength
|
||||
} else {
|
||||
size, err := input.Body.Seek(0, os.SEEK_END)
|
||||
size, err := input.Body.Seek(0, io.SeekEnd)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
_, err = input.Body.Seek(0, os.SEEK_SET)
|
||||
_, err = input.Body.Seek(0, io.SeekStart)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -276,7 +276,7 @@ func (store S3Store) RegisterMetrics(registry prometheus.Registerer) {
|
|||
}
|
||||
|
||||
func (store S3Store) observeRequestDuration(start time.Time, label string) {
|
||||
elapsed := time.Now().Sub(start)
|
||||
elapsed := time.Since(start)
|
||||
ms := float64(elapsed.Nanoseconds() / int64(time.Millisecond))
|
||||
|
||||
store.requestDurationMetric.WithLabelValues(label).Observe(ms)
|
||||
|
@ -847,7 +847,7 @@ func (upload s3Upload) FinishUpload(ctx context.Context) error {
|
|||
}
|
||||
|
||||
parts = []*s3Part{
|
||||
&s3Part{
|
||||
{
|
||||
etag: *res.ETag,
|
||||
number: 1,
|
||||
size: 0,
|
||||
|
|
|
@ -107,7 +107,7 @@ func (spp *s3PartProducer) nextPart(size int64) (fileChunk, bool, error) {
|
|||
return fileChunk{}, false, nil
|
||||
}
|
||||
|
||||
elapsed := time.Now().Sub(start)
|
||||
elapsed := time.Since(start)
|
||||
ms := float64(elapsed.Nanoseconds() / int64(time.Millisecond))
|
||||
spp.diskWriteDurationMetric.Observe(ms)
|
||||
|
||||
|
@ -141,7 +141,7 @@ func (spp *s3PartProducer) nextPart(size int64) (fileChunk, bool, error) {
|
|||
return fileChunk{}, false, nil
|
||||
}
|
||||
|
||||
elapsed := time.Now().Sub(start)
|
||||
elapsed := time.Since(start)
|
||||
ms := float64(elapsed.Nanoseconds() / int64(time.Millisecond))
|
||||
spp.diskWriteDurationMetric.Observe(ms)
|
||||
|
||||
|
|
Loading…
Reference in New Issue