Skip to content

Commit

Permalink
Fix lint errors.
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Apolinario <[email protected]>
  • Loading branch information
eapolinario committed Nov 22, 2024
1 parent d8849d6 commit 20ecd7f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions flytepropeller/pkg/compiler/validators/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ func LiteralTypeForLiteral(l *core.Literal) *core.LiteralType {
case *core.Literal_Collection:
return &core.LiteralType{
Type: &core.LiteralType_CollectionType{
CollectionType: literalTypeForLiterals(l.GetCollection().Literals),
CollectionType: literalTypeForLiterals(l.GetCollection().GetLiterals()),
},
}
case *core.Literal_Map:
return &core.LiteralType{
Type: &core.LiteralType_MapValueType{
MapValueType: literalTypeForLiterals(maps.Values(l.GetMap().Literals)),
MapValueType: literalTypeForLiterals(maps.Values(l.GetMap().GetLiterals())),
},
}
case *core.Literal_OffloadedMetadata:
Expand Down
12 changes: 6 additions & 6 deletions flytepropeller/pkg/compiler/validators/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ func TestLiteralTypeForLiterals(t *testing.T) {
coreutils.MustMakeLiteral(2),
})

assert.Len(t, lt.GetUnionType().Variants, 2)
assert.Equal(t, core.SimpleType_INTEGER.String(), lt.GetUnionType().Variants[0].GetSimple().String())
assert.Equal(t, core.SimpleType_STRING.String(), lt.GetUnionType().Variants[1].GetSimple().String())
assert.Len(t, lt.GetUnionType().GetVariants(), 2)
assert.Equal(t, core.SimpleType_INTEGER.String(), lt.GetUnionType().GetVariants()[0].GetSimple().String())
assert.Equal(t, core.SimpleType_STRING.String(), lt.GetUnionType().GetVariants()[1].GetSimple().String())
})

t.Run("non-homogenous ensure ordering", func(t *testing.T) {
Expand All @@ -125,9 +125,9 @@ func TestLiteralTypeForLiterals(t *testing.T) {
coreutils.MustMakeLiteral(2),
})

assert.Len(t, lt.GetUnionType().Variants, 2)
assert.Equal(t, core.SimpleType_INTEGER.String(), lt.GetUnionType().Variants[0].GetSimple().String())
assert.Equal(t, core.SimpleType_STRING.String(), lt.GetUnionType().Variants[1].GetSimple().String())
assert.Len(t, lt.GetUnionType().GetVariants(), 2)
assert.Equal(t, core.SimpleType_INTEGER.String(), lt.GetUnionType().GetVariants()[0].GetSimple().String())
assert.Equal(t, core.SimpleType_STRING.String(), lt.GetUnionType().GetVariants()[1].GetSimple().String())
})

t.Run("list with mixed types", func(t *testing.T) {
Expand Down

0 comments on commit 20ecd7f

Please sign in to comment.