Skip to content
Go Cloud Foundry Environment Parsing Package
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Use glide, Ignore Vendor Directory Apr 29, 2016
.travis.yml fix environment variable Mar 24, 2019
LICENSE Add date/name to LICENSE Nov 15, 2017 Update location of cf-env docs Jul 25, 2016
application.go adding application ID to go-cfenv, changing the name of ID to Instanc… Feb 23, 2017
cfenv.go Add IsRunningOnCF function Mar 14, 2017
cfenv_suite_test.go switch from ginkgo to spec Mar 24, 2019
cfenv_test.go switch from ginkgo to spec Mar 24, 2019
environment.go Simplify splitEnv Jul 25, 2016
environment_test.go switch from ginkgo to spec Mar 24, 2019
envmap.go Simplify splitEnv Jul 25, 2016
envmap_test.go switch from ginkgo to spec Mar 24, 2019
go.mod turn into go module Mar 24, 2019
go.sum turn into go module Mar 24, 2019
service.go Add volume services support (#26) Jul 5, 2018

Go CF Environment Package Build Status - Master



cfenv is a package to assist you in writing Go apps that run on Cloud Foundry. It provides convenience functions and structures that map to Cloud Foundry environment variable primitives (


go get

package main

import (

func main() {
	appEnv, _ := cfenv.Current()

	fmt.Println("ID:", appEnv.ID)
	fmt.Println("Index:", appEnv.Index)
	fmt.Println("Name:", appEnv.Name)
	fmt.Println("Host:", appEnv.Host)
	fmt.Println("Port:", appEnv.Port)
	fmt.Println("Version:", appEnv.Version)
	fmt.Println("Home:", appEnv.Home)
	fmt.Println("MemoryLimit:", appEnv.MemoryLimit)
	fmt.Println("WorkingDir:", appEnv.WorkingDir)
	fmt.Println("TempDir:", appEnv.TempDir)
	fmt.Println("User:", appEnv.User)
	fmt.Println("Services:", appEnv.Services)


Pull requests welcomed.

You can’t perform that action at this time.