mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
fixed code quality issues using DeepSource
* Combine multiple `append`s into a single call * Remove unnecessary use of slice * Replace `strings.Index` with `strings.Contains` * Added .deepsource.toml config file for DeepSource integration
This commit is contained in:
parent
551462b3c8
commit
8ab500bd6c
17
.deepsource.toml
Normal file
17
.deepsource.toml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
version = 1
|
||||||
|
|
||||||
|
test_patterns = ["**/*_test.go"]
|
||||||
|
|
||||||
|
exclude_patterns = [
|
||||||
|
"_examples/**",
|
||||||
|
"_benchmarks/**",
|
||||||
|
".github/**"
|
||||||
|
]
|
||||||
|
|
||||||
|
[[analyzers]]
|
||||||
|
name = "go"
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
[analyzers.meta]
|
||||||
|
import_paths = ["github.com/kataras/iris"]
|
||||||
|
|
|
@ -194,8 +194,8 @@ func init() {
|
||||||
var t octetType
|
var t octetType
|
||||||
isCtl := c <= 31 || c == 127
|
isCtl := c <= 31 || c == 127
|
||||||
isChar := 0 <= c && c <= 127
|
isChar := 0 <= c && c <= 127
|
||||||
isSeparator := strings.IndexRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) >= 0
|
isSeparator := strings.ContainsRune(" \t\"(),/:;<=>?@[]\\{}", rune(c))
|
||||||
if strings.IndexRune(" \t\r\n", rune(c)) >= 0 {
|
if strings.ContainsRune(" \t\r\n", rune(c)) {
|
||||||
t |= isSpace
|
t |= isSpace
|
||||||
}
|
}
|
||||||
if isChar && !isCtl && !isSeparator {
|
if isChar && !isCtl && !isSeparator {
|
||||||
|
|
|
@ -210,7 +210,7 @@ func (g *Group) Error() (s string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Group) getAllErrors() []error {
|
func (g *Group) getAllErrors() []error {
|
||||||
list := g.Errors[:]
|
list := g.Errors
|
||||||
|
|
||||||
if len(g.children) > 0 {
|
if len(g.children) > 0 {
|
||||||
// return with order of definition.
|
// return with order of definition.
|
||||||
|
|
|
@ -174,8 +174,7 @@ func getCases(loc *Locale, src map[string]interface{}) []interface{} {
|
||||||
cases := make([]interface{}, 0, len(pluralCases)*2)
|
cases := make([]interface{}, 0, len(pluralCases)*2)
|
||||||
for _, pluralCase := range pluralCases {
|
for _, pluralCase := range pluralCases {
|
||||||
// fmt.Printf("%s=%v\n", pluralCase.Form, pluralCase.Value)
|
// fmt.Printf("%s=%v\n", pluralCase.Form, pluralCase.Value)
|
||||||
cases = append(cases, pluralCase.Form.String())
|
cases = append(cases, pluralCase.Form.String(), pluralCase.Value)
|
||||||
cases = append(cases, pluralCase.Value)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cases
|
return cases
|
||||||
|
|
Loading…
Reference in New Issue
Block a user