From 42ae6b5215658a6140e8106d8ff2a06242d1c3f2 Mon Sep 17 00:00:00 2001 From: Calin Martinconi Date: Tue, 30 Jul 2024 22:53:22 +0300 Subject: [PATCH] feat: return uint8 also --- viper.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/viper.go b/viper.go index 754eb5a..f900e58 100644 --- a/viper.go +++ b/viper.go @@ -816,6 +816,13 @@ func (v *Viper) GetInt64(key string) int64 { return cast.ToInt64(v.Get(key)) } +// GetUint8 returns the value associated with the key as an unsigned integer. +func GetUint8(key string) uint8 { return v.GetUint8(key) } + +func (v *Viper) GetUint8(key string) uint8 { + return cast.ToUint8(v.Get(key)) +} + // GetUint returns the value associated with the key as an unsigned integer. func GetUint(key string) uint { return v.GetUint(key) }