Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
1e6eab5c
Unverified
Commit
1e6eab5c
authored
Jul 24, 2025
by
minxinyi
Committed by
GitHub
Jul 23, 2025
Browse files
server: use slices.Equal to simplify code (#11502)
parent
6c733bf0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
14 deletions
+2
-14
server/routes_test.go
server/routes_test.go
+2
-14
No files found.
server/routes_test.go
View file @
1e6eab5c
...
...
@@ -16,6 +16,7 @@ import (
"os"
"path/filepath"
"reflect"
"slices"
"sort"
"strings"
"testing"
...
...
@@ -82,19 +83,6 @@ func createTestFile(t *testing.T, name string) (string, string) {
return
f
.
Name
(),
digest
}
// equalStringSlices checks if two slices of strings are equal.
func
equalStringSlices
(
a
,
b
[]
string
)
bool
{
if
len
(
a
)
!=
len
(
b
)
{
return
false
}
for
i
:=
range
a
{
if
a
[
i
]
!=
b
[
i
]
{
return
false
}
}
return
true
}
type
panicTransport
struct
{}
func
(
t
*
panicTransport
)
RoundTrip
(
r
*
http
.
Request
)
(
*
http
.
Response
,
error
)
{
...
...
@@ -447,7 +435,7 @@ func TestRoutes(t *testing.T) {
"stop
\"
foo
\"
"
,
"top_p 0.9"
,
}
if
!
equalStringSlices
(
params
,
expectedParams
)
{
if
!
slices
.
Equal
(
params
,
expectedParams
)
{
t
.
Errorf
(
"expected parameters %v, got %v"
,
expectedParams
,
params
)
}
paramCount
,
ok
:=
showResp
.
ModelInfo
[
"general.parameter_count"
]
.
(
float64
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment