Chore/fix lint issues (#27704)

* Chore: Fix linting issues

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-09-22 16:22:19 +02:00
committed by GitHub
parent ffc11cb63c
commit a5d9196a53
70 changed files with 274 additions and 276 deletions
+1 -1
View File
@@ -155,7 +155,7 @@ func (b *BasicDiff) Basic(lines []*JSONLine) []*BasicBlock {
b.Block.Changes = append(b.Block.Changes, b.Change)
default:
//ok
// ok
}
// otherwise, we're dealing with a change at a deeper level. We
+2 -2
View File
@@ -243,7 +243,7 @@ func (f *JSONFormatter) processItem(value interface{}, deltas []diff.Delta, posi
case *diff.Object:
switch value.(type) {
case map[string]interface{}:
//ok
// ok
default:
return errors.New("Type mismatch")
}
@@ -268,7 +268,7 @@ func (f *JSONFormatter) processItem(value interface{}, deltas []diff.Delta, posi
case *diff.Array:
switch value.(type) {
case []interface{}:
//ok
// ok
default:
return errors.New("Type mismatch")
}
@@ -201,9 +201,9 @@ func (c *StorageClient) FileUpload(ctx context.Context, container, blobName stri
func escape(content string) string {
content = url.QueryEscape(content)
// the Azure's behavior uses %20 to represent whitespace instead of + (plus)
content = strings.Replace(content, "+", "%20", -1)
content = strings.ReplaceAll(content, "+", "%20")
// the Azure's behavior uses slash instead of + %2F
content = strings.Replace(content, "%2F", "/", -1)
content = strings.ReplaceAll(content, "%2F", "/")
return content
}
+1 -1
View File
@@ -12,7 +12,7 @@ import (
const (
pngExt = ".png"
defaultSGcsSignedUrlExpiration = 7 * 24 * time.Hour //7 days
defaultSGcsSignedUrlExpiration = 7 * 24 * time.Hour // 7 days
)
type ImageUploader interface {
+1 -1
View File
@@ -37,7 +37,7 @@ var netClient = &http.Client{
func (u *WebdavUploader) PublicURL(filename string) string {
if strings.Contains(u.public_url, "${file}") {
return strings.Replace(u.public_url, "${file}", filename, -1)
return strings.ReplaceAll(u.public_url, "${file}", filename)
}
publicURL, _ := url.Parse(u.public_url)