Skip to content

Commit 49e60a0

Browse files
authored
MINOR: [Go] Add "IsSignedInteger" (#35050)
### Rationale for this change Return true, if data type is signed integer(int8, int16, int32, int64). ### What changes are included in this PR? Implementation "IsSignedInteger" ### Are these changes tested? No ### Are there any user-facing changes? Yes Authored-by: izveigor <izveigor@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
1 parent 11ecfd9 commit 49e60a0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

go/arrow/datatype.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,16 @@ func IsUnsignedInteger(t Type) bool {
286286
return false
287287
}
288288

289+
// IsSignedInteger is a helper that returns true if the type ID provided is
290+
// one of the int integral types (int8, int16, int32, int64)
291+
func IsSignedInteger(t Type) bool {
292+
switch t {
293+
case INT8, INT16, INT32, INT64:
294+
return true
295+
}
296+
return false
297+
}
298+
289299
// IsFloating is a helper that returns true if the type ID provided is
290300
// one of Float16, Float32, or Float64
291301
func IsFloating(t Type) bool {

0 commit comments

Comments
 (0)