Getting Started with Go

If you haven’t set up a Riak Node and started it, please visit Running A Cluster first and ensure you have a working installation of Go.

Client Setup

First install the Riak Go client:

go get

Next download the Taste of Riak - Go utilities:

go get

If you are using a single local Riak node, use the following to create a new client instance:

package main

import (

  riak ""
  util ""

func main() {
  var err error

  // un-comment-out to enable debug logging
  // riak.EnableDebugLogging = true

  o := &riak.NewClientOptions{
    RemoteAddresses: []string{util.GetRiakAddress()},

  var c *riak.Client
  c, err = riak.NewClient(o)
  if err != nil {

  defer func() {
    if err := c.Stop(); err != nil {

We are now ready to start interacting with Riak.

Next Steps

CRUD Operations