hashicorp/terraform — pull request #239 by catsby (2014-08-27 14:58:13+00:00)
Title: Swap bgentry/heroku-go for cyberdelia/heroku-go

Hello (again) Hashicorp –

This is an updated #184

TL;DR: switch Heroku Go library from bgentry/heroku-go to cyberdelia/heroku-go/v3

---
**Old description begin**

I wanted to take a stab at #116, but bgentry/heroku-go doesn't have support for the Heroku Build API.
I tried adding it in bgentry/heroku-go#10 but ran into issues, and Blake suggested that Tim's library (cyberdelia/heroku-go) might be a better way forward. Thankfully it includes the Build and App setup APIs I would need, but instead of 1 giant pull request that changes the library and adds the features of #116, I broke them in two. Not much sense in developing new things if the foundation they're built on gets rejected :smile:

Porting over was pretty trivial; there are just a few minor differences:

- `heroku-go/v3` uses a `heroku.Service` type instead of a `heroku.Client`
- ID fields are typically `ID` instead of `Id`
- Some methods like `AddonCreate` take 2 params, an app `name` and a `struct{config, plan}`, instead of 3 params for `name`, `config` and `plan`.
- Some changing / removing of `&`'s

The latter of which may be "wrong". I'm still a Go novice, and may be using pointers when I should be using values, or values when I should be using pointers. The changes may simply be chalked up to differences in what the two libraries return/expect, and maybe not "wrong" at all ¯\_(ツ)_/¯

**Old description end**

---

Specific callout to line 65 of `heroku/provider_test.go`:

```diff
-	config := rp.Meta().(*heroku.Client)
-	if config.Username != expectedEmail {
-	t.Fatalf("bad: %#v", config)
+	if heroku.DefaultTransport.Username != expectedEmail {
+	t.Fatalf("bad: %#v", heroku.DefaultTransport)
}
-	if config.Password != expectedKey {
-	t.Fatalf("bad: %#v", config)
+	if heroku.DefaultTransport.Password != expectedKey {
+	t.Fatalf("bad: %#v", heroku.DefaultTransport)
}
```

The `config` struct(?) no longer has a `Username` attribute, that's stored in the `DefaultTransport` struct now. I *think* this is correctly testing things, but I'm not 100% sure.

The Heroku specific tests pass, however the Heroku acceptance tests do not... but they aren't passing for me on `master` either...