-2

I am trying to get friendlist from Facebook Messenger in golang using REST API. For this, I tried to import package github.com/huandu/facebook. But while running the code it gave an error:

package context: unrecognized import path "context" (import path does not begin with hostname)

Here is the import statement (as mentioned in godoc https://godoc.org/github.com/huandu/facebook):

import (
    "fmt"
    "github.com/huandu/facebook"
)

Can anyone tell me what I am doing Wrong ?

Amandeep kaur
  • 985
  • 3
  • 15
  • 35

1 Answers1

0

Ensure that your Go environment is setup correctly, especially your $GOPATH and $GOROOT.

https://golang.org/doc/code.html#GOPATH

  • My $GOPATH is set to $HOME/go and $GOROOT is set to /usr/lib/go-1.6 and it works well for other packages. – Amandeep kaur Oct 09 '17 at 13:55
  • 1
    @Amandeepkaur: go1.6 is out of date. Update your go version, and do not set GOROOT. – JimB Oct 09 '17 at 13:56
  • Agreed with @JimB, your `$GOROOT` looks suspicious. [Look at this answer.](https://stackoverflow.com/questions/7970390/what-should-be-the-values-of-gopath-and-goroot#10847122) –  Oct 09 '17 at 14:59