mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 14:22:42 +09:00
Fix some quality issues (#1914)
* Add .deepsource.toml * Fix unnecessary typecasting on `bytes.Buffer` * Fix check for empty string * Replace nested if block with else-if * Replace nested if block with else-if * Replaced string.Replace() with string.ReplaceAll where n<0 * Remove deepsource toml file Signed-off-by: siddhant-deepsource <siddhant@deepsource.io> Co-authored-by: DeepSource Bot <bot@deepsource.io> Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
fcc2fea684
commit
cf35b8021c
@@ -341,9 +341,9 @@ func EscapePath(path string) string {
|
||||
path = filepath.ToSlash(path)
|
||||
if runtime.GOOS == "windows" {
|
||||
// ':' is not valid in a path name on Windows but is ok on Unix
|
||||
path = strings.Replace(path, ":", "%", -1)
|
||||
path = strings.ReplaceAll(path, ":", "%")
|
||||
}
|
||||
return strings.Replace(path, "/", "%", -1)
|
||||
return strings.ReplaceAll(path, "/", "%")
|
||||
}
|
||||
|
||||
// GetLeadingWhitespace returns the leading whitespace of the given byte array
|
||||
@@ -430,7 +430,7 @@ func IsAutocomplete(c rune) bool {
|
||||
}
|
||||
|
||||
func ParseSpecial(s string) string {
|
||||
return strings.Replace(s, "\\t", "\t", -1)
|
||||
return strings.ReplaceAll(s, "\\t", "\t")
|
||||
}
|
||||
|
||||
// String converts a byte array to a string (for lua plugins)
|
||||
|
||||
Reference in New Issue
Block a user