Files
viperx/viperx_test.go
T

22 lines
313 B
Go
Raw Normal View History

2024-03-13 14:10:15 +08:00
package viperx_test
import (
"fmt"
"testing"
"code.yun.ink/pkg/viperx"
)
func TestViper(t *testing.T) {
var data Config
err := viperx.InitConfig("./config.yml", &data)
if err != nil {
panic(err)
}
fmt.Println(data)
}
type Config struct {
Name string `mapstructure:"name" json:"name" yaml:"name"`
}