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/optionform.go

19 lines
337 B
Go
Raw Normal View History

2022-09-18 02:20:55 +05:30
package config
import (
"log"
"github.com/spf13/viper"
)
func OptForm() string {
2022-09-18 02:20:55 +05:30
viper.SetConfigName("config")
viper.AddConfigPath("./data")
err := viper.ReadInConfig()
if err != nil {
log.Println("Error reading config. Error getting: options.form", err.Error())
2022-09-18 02:20:55 +05:30
}
result := viper.GetString("options.form")
2022-09-18 02:20:55 +05:30
return result
}