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
23871503
Commit
23871503
authored
Apr 24, 2024
by
Michael Yang
Browse files
linting
parent
c0a00f68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
parser/parser.go
parser/parser.go
+1
-4
No files found.
parser/parser.go
View file @
23871503
...
@@ -6,7 +6,6 @@ import (
...
@@ -6,7 +6,6 @@ import (
"errors"
"errors"
"fmt"
"fmt"
"io"
"io"
"slices"
"strconv"
"strconv"
"strings"
"strings"
)
)
...
@@ -66,7 +65,7 @@ func Parse(r io.Reader) (cmds []Command, err error) {
...
@@ -66,7 +65,7 @@ func Parse(r io.Reader) (cmds []Command, err error) {
cmd
.
Name
=
s
cmd
.
Name
=
s
}
}
case
stateMessage
:
case
stateMessage
:
if
!
slices
.
Contains
([]
string
{
"system"
,
"user"
,
"assistant"
},
b
.
String
())
{
if
!
isValidRole
(
b
.
String
())
{
return
nil
,
errInvalidRole
return
nil
,
errInvalidRole
}
}
...
@@ -74,8 +73,6 @@ func Parse(r io.Reader) (cmds []Command, err error) {
...
@@ -74,8 +73,6 @@ func Parse(r io.Reader) (cmds []Command, err error) {
case
stateComment
,
stateNil
:
case
stateComment
,
stateNil
:
// pass
// pass
case
stateValue
:
case
stateValue
:
s
:=
b
.
String
()
s
,
ok
:=
unquote
(
b
.
String
())
s
,
ok
:=
unquote
(
b
.
String
())
if
!
ok
||
isSpace
(
r
)
{
if
!
ok
||
isSpace
(
r
)
{
if
_
,
err
:=
b
.
WriteRune
(
r
);
err
!=
nil
{
if
_
,
err
:=
b
.
WriteRune
(
r
);
err
!=
nil
{
...
...
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