You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
682 B
30 lines
682 B
package main
|
|
|
|
import (
|
|
"gitea.v39.writerpass.top/Public/json-configure-golang/config"
|
|
"log"
|
|
)
|
|
|
|
type AppConfig struct {
|
|
AppName string `json:"app_name"`
|
|
AppVersion string `json:"app_version"`
|
|
}
|
|
|
|
func main() {
|
|
configure := AppConfig{
|
|
AppName: "test-app-name",
|
|
}
|
|
cc := config.ConfigConfigure{
|
|
AppName: "json-configure",
|
|
ContainerType: config.BesidesExe,
|
|
ConfigureFile: "config.json",
|
|
}
|
|
cc.Validate()
|
|
cc.MakeupContainerPath()
|
|
log.Println("Configure Container Path:", cc.ContainerPath)
|
|
cc.EnsureContainer()
|
|
configure = cc.EnsureConfigure(configure).(AppConfig)
|
|
log.Println("AppName:", configure.AppName)
|
|
log.Println("AppVersion:", configure.AppVersion)
|
|
}
|