From ec14bc4dce645e00e798dc7b30e5ce4e6442f235 Mon Sep 17 00:00:00 2001 From: writerpass Date: Thu, 23 Jan 2025 16:04:47 +0800 Subject: [PATCH] initial commit --- README.md | 36 ++++++++++++++++++++++++++++++++++++ go.mod | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..6538d88 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# json-configure + +## usage + +```shell +go get +``` + +```go +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) +} +``` \ No newline at end of file diff --git a/go.mod b/go.mod index 450bc0b..a818086 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module json-configure-golang +module gitea.v39.writerpass.top/Public/json-configure-golang go 1.23