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
40d0c4a1
Commit
40d0c4a1
authored
Aug 10, 2023
by
Michael Yang
Browse files
length check for parameters
parent
be889b2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
parser/parser.go
parser/parser.go
+4
-0
No files found.
parser/parser.go
View file @
40d0c4a1
...
...
@@ -45,6 +45,10 @@ func Parse(reader io.Reader) ([]Command, error) {
command
.
Args
=
string
(
fields
[
1
])
case
"PARAMETER"
:
fields
=
bytes
.
SplitN
(
fields
[
1
],
[]
byte
(
" "
),
2
)
if
len
(
fields
)
<
2
{
return
nil
,
fmt
.
Errorf
(
"missing value for %s"
,
fields
)
}
command
.
Name
=
string
(
fields
[
0
])
command
.
Args
=
string
(
fields
[
1
])
default
:
...
...
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