mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 14:48:30 +00:00
all: Fix nested if
with else if
(#8467)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
parent
dde275c6cc
commit
f2be9d1166
@ -142,10 +142,8 @@ func TestGlobalOverHTTPS(t *testing.T) {
|
||||
url = "https://" + list.Addr().String() + "?insecure"
|
||||
if addresses, err := testLookup(url); err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
} else {
|
||||
if len(addresses) != 1 || addresses[0] != "tcp://192.0.2.42::22000" {
|
||||
t.Errorf("incorrect addresses list: %+v", addresses)
|
||||
}
|
||||
} else if len(addresses) != 1 || addresses[0] != "tcp://192.0.2.42::22000" {
|
||||
t.Errorf("incorrect addresses list: %+v", addresses)
|
||||
}
|
||||
|
||||
// With "id" set to something incorrect, the checks should fail again.
|
||||
@ -162,10 +160,8 @@ func TestGlobalOverHTTPS(t *testing.T) {
|
||||
url = "https://" + list.Addr().String() + "?id=" + id.String()
|
||||
if addresses, err := testLookup(url); err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
} else {
|
||||
if len(addresses) != 1 || addresses[0] != "tcp://192.0.2.42::22000" {
|
||||
t.Errorf("incorrect addresses list: %+v", addresses)
|
||||
}
|
||||
} else if len(addresses) != 1 || addresses[0] != "tcp://192.0.2.42::22000" {
|
||||
t.Errorf("incorrect addresses list: %+v", addresses)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -289,10 +289,8 @@ func (m *Matcher) Match(file string) (result Result) {
|
||||
if pattern.match.Match(lowercaseFile) {
|
||||
return pattern.result
|
||||
}
|
||||
} else {
|
||||
if pattern.match.Match(file) {
|
||||
return pattern.result
|
||||
}
|
||||
} else if pattern.match.Match(file) {
|
||||
return pattern.result
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user