示例#1
0
文件: main.go 项目: kyokomi/appConfig
func main() {

	accessToken := "aaaaaaaaaaaaaaaaaaaaa"

	c := appConfig.NewAppConfig("goSampleApp")
	err := c.WriteAppConfig(bytes.NewBufferString(accessToken).Bytes())
	if err != nil {
		log.Fatal(err)
	}

	data, err := c.ReadAppConfig()
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(string(data))
}
示例#2
0
func NewGitlabCliAppConfig(appName string) *GitlabCliAppConfig {
	return &GitlabCliAppConfig{
		AppConfig: *appConfig.NewAppConfig(appName, configFileName),
	}
}