linting
This commit is contained in:
parent
c0a00f68ae
commit
238715037d
1 changed files with 1 additions and 4 deletions
|
@ -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) {
|
||||||
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) {
|
||||||
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 {
|
||||||
|
|
Loading…
Reference in a new issue