This repository has been archived on 2026-04-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Exam_registration/pkg/config/config.go
2026-03-20 21:41:00 +08:00

20 lines
281 B
Go

package config
import (
"github.com/spf13/viper"
)
var Config *viper.Viper
func Init(configPath string) error {
Config = viper.New()
Config.SetConfigFile(configPath)
Config.SetConfigType("yaml")
if err := Config.ReadInConfig(); err != nil {
return err
}
return nil
}