import ( "github.com/cloudfoundry/cli/cf/configuration/core_config" ) func main() { configRepo := core_config.NewRepositoryFromFilepath("config.json") apiEndpoint := configRepo.GetAPIEndpoint() fmt.Printf("API endpoint is %s", apiEndpoint) }
import ( "github.com/cloudfoundry/cli/cf/configuration/core_config" ) func main() { configRepo := core_config.NewRepositoryFromFilepath("config.json") configRepo.SetApiEndpoint("https://new.api.endpoint.com") configRepo.Save() }In this example, the `core_config` package is used to load a configuration file from the file system and update the API endpoint configuration to a new value. The `Save` method is then called to persist the updated configuration back to the file system.