From d06ebbee03f8a216a3fc1f7bcc7a684087def914 Mon Sep 17 00:00:00 2001 From: Branden Colen Date: Fri, 2 Apr 2021 23:33:11 -0500 Subject: [PATCH] simplified inttobytes --- romannumeral.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/romannumeral.go b/romannumeral.go index 09d2fd9..21685b7 100644 --- a/romannumeral.go +++ b/romannumeral.go @@ -64,10 +64,8 @@ func IntToString(input int) (string, error) { // IntToBytes converts an integer value to a roman numeral byte array. An error is // returned if the integer is not between 1 and 3999. func IntToBytes(input int) ([]byte, error) { - if outOfBounds(input) { - return nil, IntegerOutOfBounds - } - return []byte(intToRoman(input)), nil + str, err := IntToString(input) + return []byte(str), err } // outOfBounds checks to ensure an input value is valid for roman numerals without the need of