diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 83b5954..8c19a71 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ jobs: uses: golangci/golangci-lint-action@v2 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.31 + version: v1.33 # Optional: golangci-lint command line arguments. args: --issues-exit-code=0 --out-format=colored-line-number --print-issued-lines=false # Optional: working directory, useful for monorepos diff --git a/upyun/fileinfo.go b/upyun/fileinfo.go index 672178b..b908934 100644 --- a/upyun/fileinfo.go +++ b/upyun/fileinfo.go @@ -54,9 +54,9 @@ func parseHeaderToFileInfo(header http.Header, getinfo bool) *FileInfo { } else { fInfo.Size = parseStrToInt(header.Get("Content-Length")) fInfo.ContentType = header.Get("Content-Type") - fInfo.MD5 = strings.Replace(header.Get("Content-Md5"), "\"", "", -1) + fInfo.MD5 = strings.ReplaceAll(header.Get("Content-Md5"), "\"", "") if fInfo.MD5 == "" { - fInfo.MD5 = strings.Replace(header.Get("Etag"), "\"", "", -1) + fInfo.MD5 = strings.ReplaceAll(header.Get("Etag"), "\"", "") } lastM := header.Get("Last-Modified") t, err := http.ParseTime(lastM) diff --git a/upyun/rest.go b/upyun/rest.go index 3a66492..7339385 100644 --- a/upyun/rest.go +++ b/upyun/rest.go @@ -85,7 +85,7 @@ type CopyObjectConfig struct { Headers map[string]string } -//UploadFileConfig is multipart file upload config +// UploadFileConfig is multipart file upload config type UploadPartConfig struct { Reader io.Reader PartSize int64 @@ -97,7 +97,7 @@ type CompleteMultipartUploadConfig struct { type InitMultipartUploadConfig struct { Path string PartSize int64 - ContentLength int64 //optional + ContentLength int64 // optional ContentType string OrderUpload bool } @@ -110,7 +110,7 @@ type InitMultipartUploadResult struct { type DeleteObjectConfig struct { Path string Async bool - Folder bool //optional + Folder bool // optional } type ModifyMetadataConfig struct { diff --git a/upyun/utils.go b/upyun/utils.go index 014a638..8cf81a4 100644 --- a/upyun/utils.go +++ b/upyun/utils.go @@ -39,7 +39,7 @@ var ( func makeRFC1123Date(d time.Time) string { utc := d.UTC().Format(time.RFC1123) - return strings.Replace(utc, "UTC", "GMT", -1) + return strings.ReplaceAll(utc, "UTC", "GMT") } func makeUserAgent(version string) string {