import ( "github.com/cloudfoundry-community/go-cfconfig/cf/configuration" ) // ... // get CF app configuration config, err := configuration.LoadAppConfig("appname", "/path/to/app") if err != nil { panic(err) } // retrieve a configuration value value := config.GetString("property_name", "default_value")
import ( "github.com/cloudfoundry-community/go-cfconfig/cf/configuration" ) // ... // get CF app configuration config, err := configuration.LoadAppConfig("appname", "/path/to/app") if err != nil { panic(err) } // set a configuration value config.Set("property_name", "new_value") config.Save()In this example, we use the `LoadAppConfig()` method to load the configuration for an app named `appname` located at `/path/to/app`. We then use `Set()` to update the value of a specific property named `property_name` to `new_value`. Finally, we use `Save()` to save the updated configuration. Package library: `github.com/cloudfoundry-community/go-cfconfig/cf/configuration`