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.
writerpass ec14bc4dce
initial commit
1 month ago
README.md initial commit 1 month ago
config-configure-type.go initial commit 1 month ago
config-configure.go initial commit 1 month ago
go.mod initial commit 1 month ago
go.sum initial commit 1 month ago
main.go initial commit 1 month ago
path-helper.go initial commit 1 month ago

README.md

json-configure

usage

go get 
package main

import "log"

type AppConfig struct {
	AppName    string `json:"app_name"`
	AppVersion string `json:"app_version"`
}

func main() {
	configure := AppConfig{
		AppName: "aaaaa",
	}
	cc := ConfigConfigure{
		AppName:       "json-configure",
		ContainerType: BesidesExe,
		ConfigureFile: "config.json",
	}
	cc.Check()
	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)
}