Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Failed: Calling method Do with receiver client (type **http.Client) requires explicit dereference #3

Open
sheharyarn opened this issue Jun 22, 2015 · 1 comment

Comments

@sheharyarn
Copy link

I'm trying to install slug (so I can use exrm-heroku), but I get this error:

Psycho@MBP ~/code
± % go get github.com/naaman/slug/cmd/slug                                                                                                  
# github.com/naaman/slug
../../../go/src/github.com/naaman/slug/slug.go:49: calling method Do with receiver client (type **http.Client) requires explicit dereference
@sheharyarn
Copy link
Author

As a temporary measure, I edited lines 42-57 in $GOPATH/src/github.com/naaman/slug/slug.go and removed the & and *. It's working now (thanks to this).

func NewSlug(apiKey, appName, slugDir string) *Slug {
    slugJson := &Slug{}
    slugJson.apiKey = apiKey
    slugJson.appName = appName
    slugJson.slugDir = slugDir

    client := http.DefaultClient
    res, _ := client.Do(slugJson.createSlug())
    bod, _ := ioutil.ReadAll(res.Body)
    defer res.Body.Close()                             

    json.Unmarshal(bod, &slugJson)
    slugJson.httpClient = client
    slugJson.slugDir = slugDir
    return slugJson
}

I can see that there's a Pull Request for this as well, I think it should be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant