Skip to content

Instantly share code, notes, and snippets.

@timmow
Created May 24, 2017 09:26
Show Gist options
  • Save timmow/73de3f62e4295f55284db2d1136744e5 to your computer and use it in GitHub Desktop.
Save timmow/73de3f62e4295f55284db2d1136744e5 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"os"
"github.com/cloudfoundry-community/go-cfclient"
)
func main() {
client, err := cfclient.NewClient(&cfclient.Config{
ApiAddress: os.Getenv("API"),
ClientID: os.Getenv("ClientID"),
ClientSecret: os.Getenv("ClientSecret"),
})
if err != nil {
fmt.Println("didnt work")
fmt.Println(err)
} else {
fmt.Println("connected")
}
_, err = client.ListApps()
if err != nil {
fmt.Println("didnt work")
fmt.Println(err)
} else {
fmt.Println("connected")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment