# cfg **Repository Path**: erdian718/cfg ## Basic Information - **Project Name**: cfg - **Description**: Package cfg provides a simple facility for loading configuration file. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-12-27 - **Last Updated**: 2025-12-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: config, configuration ## README # CFG [![Go Reference](https://pkg.go.dev/badge/gitee.com/erdian718/cfg.svg)](https://pkg.go.dev/gitee.com/erdian718/cfg) Package cfg provides a simple facility for loading configuration file. ## Feature * Very simple to use. * Easily obtain the execution directory and home directory. ## Usage ```go import "gitee.com/erdian718/cfg" // Config represents the configuration information. type Config struct { // ... } func main() { config := Config{ // The default values... } if err := cfg.Load(&config, "path", "to", "configuration", "file.json"); err != nil { panic(err) } // ... } ``` ## Note * Only support JSON and XML files. * Only support UTF-8 and UTF-8 with BOM.