mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
Introduce staticcheck for stricter builds (#7035)
This commit is contained in:
committed by
Nitish Tiwari
parent
4ba77a916d
commit
df35d7db9d
15
cmd/utils.go
15
cmd/utils.go
@@ -228,11 +228,7 @@ func getProfileData() ([]byte, error) {
|
||||
}
|
||||
|
||||
// Starts a profiler returns nil if profiler is not enabled, caller needs to handle this.
|
||||
func startProfiler(profilerType, dirPath string) (interface {
|
||||
Stop()
|
||||
Path() string
|
||||
}, error) {
|
||||
|
||||
func startProfiler(profilerType, dirPath string) (minioProfiler, error) {
|
||||
var err error
|
||||
if dirPath == "" {
|
||||
dirPath, err = ioutil.TempDir("", "profile")
|
||||
@@ -277,14 +273,17 @@ func startProfiler(profilerType, dirPath string) (interface {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Global profiler to be used by service go-routine.
|
||||
var globalProfiler interface {
|
||||
// minioProfiler - minio profiler interface.
|
||||
type minioProfiler interface {
|
||||
// Stop the profiler
|
||||
Stop()
|
||||
// Return the path of the profiling file
|
||||
Path() string
|
||||
}
|
||||
|
||||
// Global profiler to be used by service go-routine.
|
||||
var globalProfiler minioProfiler
|
||||
|
||||
// dump the request into a string in JSON format.
|
||||
func dumpRequest(r *http.Request) string {
|
||||
header := cloneHeader(r.Header)
|
||||
@@ -307,7 +306,7 @@ func dumpRequest(r *http.Request) string {
|
||||
}
|
||||
|
||||
// Formatted string.
|
||||
return strings.TrimSpace(string(buffer.Bytes()))
|
||||
return strings.TrimSpace(buffer.String())
|
||||
}
|
||||
|
||||
// isFile - returns whether given path is a file or not.
|
||||
|
||||
Reference in New Issue
Block a user