mirror of
https://github.com/Threnklyn/advent-of-code-go.git
synced 2026-05-19 03:23:27 +02:00
15 lines
200 B
Go
15 lines
200 B
Go
package util
|
|
|
|
import (
|
|
"fmt"
|
|
"strconv"
|
|
)
|
|
|
|
func StrToInt(in string) int {
|
|
num, err := strconv.Atoi(in)
|
|
if err != nil {
|
|
panic(fmt.Sprintf("converting string to number: %s", err))
|
|
}
|
|
return num
|
|
}
|