-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error Condition will Never Occur #300
Comments
nathannaveen
added a commit
to nathannaveen/criticality_score
that referenced
this issue
Jan 6, 2023
- Included tests for `internal/signalio/helpers` - Fixes ossf#300 Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com>
nathannaveen
added a commit
to nathannaveen/criticality_score
that referenced
this issue
Jan 6, 2023
- Included tests for `internal/signalio/helpers` - Fixes ossf#300 Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com>
This is invalid because of the example given by @calebbrown: #301 (comment) |
calebbrown
pushed a commit
that referenced
this issue
Apr 24, 2023
* Included Tests for internal/signalio/helpers - Included tests for `internal/signalio/helpers` - Fixes #300 Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com> * Updated based on code review Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com> * Included more tests Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com> --------- Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was just testing
marshalToMap()
ininternal/signalio/helpers.go
and realized that the error statement will never be used.criticality_score/internal/signalio/helpers.go
Lines 39 to 40 in 27ad7d2
The error statements are never used because
marshalValue()
ininternal/signalio/csv.go
only returns an error when the value passed to it is a map, slice, or struct (The case defaults for any type that is not anint, bool, int16, time.Time, nil
and so on). But since it is called with the key value ofsignal.SetAsMap(s, true)
wheres
is asignal.Set
.Set
is:criticality_score/internal/collector/signal/signal.go
Lines 82 to 85 in 27ad7d2
Set
takes a parameterv
which is of typeSupportedType
. SinceSupportedType
does not include maps, slices, and structs,marshalValue
will never return an error.The text was updated successfully, but these errors were encountered: