This repository has been archived on 2022-10-30. You can view files and clone it, but cannot push or open issues or pull requests.
Segfautils/config/port.go
Odyssey 11a792d96c improve grammar here
Signed-off-by: Odyssey <odyssey346@disroot.org>
2022-09-17 23:03:47 +02:00

20 lines
362 B
Go

package config
import (
"log"
"strconv"
"github.com/spf13/viper"
)
func Port() string {
viper.SetConfigName("config")
viper.AddConfigPath("./data")
err := viper.ReadInConfig()
if err != nil {
log.Println("Error reading config. Error getting: segfautils.port", err.Error())
}
result := strconv.Itoa(viper.GetInt("segfautils.port"))
return result
}