/ Golang

Facebook SDK for Golang

I've been starting to use Golang for quite some time and I feel it is quite difficult for me to look for an open source package, and I even can't found an official Facebook SDK for Golang.

That's why I started to write a package for Golang two days ago, to help developers to connect to Facebook Graph API.

So, how did I do it? The first thing that I do is that I wrote a structure for the final function that I want to use, for example:

fb := Facebook.New()
fb.SetAccessToken(`xxxxx`)

data, err := fb.API(`/me`).Get()
if err != nil {
    // do something
}

// you can do anything with data
fmt.Println(data)

By using above function, it will return two values, the first one is the result of the data, and the second one is the error if any.

Since I think that was easy enough to be read and understood by others. Then I tried to write the whole thing.

Here you go, an unofficial Facebook SDK for Golang:

https://github.com/madebyais/facebook-go-sdk

More features are coming in the next release.

Please don't mind to share ideas or feedback, so I can make it more powerful and of course, easy to use for others.

Enjoy! :)

Faris

Faris

A seasoned software engineer with more than seven years of experience in the tech-startup industry. Want to collaborate? Drop me an email at faris@monolog.id

Read More