Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
feudalScripts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
feudal
feudalScripts
Commits
229d752a
Commit
229d752a
authored
May 01, 2020
by
lukas.burgey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the use of float64 by json.Unmarshal
parent
ae08b1d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
v3/scripts.go
v3/scripts.go
+15
-3
No files found.
v3/scripts.go
View file @
229d752a
...
...
@@ -195,15 +195,27 @@ func UnmarshalOutput(inputBytes []byte, o *Output) (err error) {
// check answer type
switch
t
:=
answer
.
(
type
)
{
case
bool
:
break
case
string
:
break
case
[]
string
:
break
case
int
:
break
case
bool
:
case
[]
int
:
break
case
[]
string
:
// converting floats to ints here, as floats are _not_ intended here
case
float64
:
o
.
QuestionnaireAnswers
[
qName
]
=
int
(
answer
.
(
float64
))
break
case
[]
int
:
case
[]
float64
:
floats
:=
answer
.
([]
float64
)
ints
:=
make
([]
int
,
len
(
floats
))
for
i
,
v
:=
range
floats
{
ints
[
i
]
=
int
(
v
)
}
o
.
QuestionnaireAnswers
[
qName
]
=
ints
break
default
:
err
=
fmt
.
Errorf
(
"QuestionnaireAnswers contains invalid answer: %v (%T)"
,
answer
,
t
)
...
...
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