Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredoconnell committed Jan 7, 2025
1 parent 4579272 commit 7824855
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 0 additions & 2 deletions atp/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ func testExecuteWithChannels(closeChannel bool, t *testing.T) {
wg.Wait()
}

//nolint:funlen
func TestProtocol_Client_ATP_v1(t *testing.T) {
// Client ReadSchema and Execute atp v1 happy path.
// This is not a fragile test because the ATP v1 is not changing. It is the legacy supported version.
Expand Down Expand Up @@ -741,7 +740,6 @@ func TestProtocol_Error_Server_WorkStart(t *testing.T) {
time.Sleep(time.Millisecond * 2)
}

//nolint:funlen
func TestProtocol_Error_Client_WorkStart(t *testing.T) {
// Induce error on client's (and server incidentally)
// start work message by closing the client's cbor
Expand Down
1 change: 0 additions & 1 deletion schema/any_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ func TestAnyValidateCompatibilityLists(t *testing.T) {
}))
}

//nolint:funlen
func TestAnyValidateCompatibilityMaps(t *testing.T) {
// Test custom maps with schemas and data
s1 := schema.NewAnySchema()
Expand Down
2 changes: 2 additions & 0 deletions schema/bool.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ func (b BoolSchema) Unserialize(data any) (any, error) {
case int:
return intConverter(int64(v))
case uint:
//nolint:gosec // Not a security problem. It's only checking for 0 or 1 values.
return intConverter(int64(v))
case int64:
return intConverter(v)
case uint64:
//nolint:gosec // Not a security problem. It's only checking for 0 or 1 values.
return intConverter(int64(v))
case int32:
return intConverter(int64(v))
Expand Down
3 changes: 3 additions & 0 deletions schema/int.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ func intInputMapper(data any, u *UnitsDefinition) (int64, error) {
case int:
return int64(v), nil
case uint:
if v > math.MaxInt64 {
return 0, fmt.Errorf("number is too large for an int64: %d", v)
}
return int64(v), nil
case int32:
return int64(v), nil
Expand Down
2 changes: 0 additions & 2 deletions schema/map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ func TestMapSchemaTypesValidation(t *testing.T) {
}()
}

//nolint:funlen
func TestMapSchemaCompatibilityValidation(t *testing.T) {
s1 := schema.NewMapSchema(
schema.NewStringSchema(nil, nil, nil),
Expand Down Expand Up @@ -273,7 +272,6 @@ func TestMapSchemaCompatibilityValidation(t *testing.T) {
assert.Error(t, s1.ValidateCompatibility(schema.NewIntEnumSchema(map[int64]*schema.DisplayValue{}, nil)))
}

//nolint:funlen
func TestMapCompatibilityValidation(t *testing.T) {
s1 := schema.NewMapSchema(
schema.NewStringSchema(nil, nil, nil),
Expand Down

0 comments on commit 7824855

Please sign in to comment.