X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3babb86cbbb3275d55b1cb928248d0cff436fb3f..4993b8b44022fd3dc73fcebf20f80d054bdf4370:/doc/sdk/go/index.html.textile.liquid diff --git a/doc/sdk/go/index.html.textile.liquid b/doc/sdk/go/index.html.textile.liquid index e4653b2c13..58446a9eda 100644 --- a/doc/sdk/go/index.html.textile.liquid +++ b/doc/sdk/go/index.html.textile.liquid @@ -12,59 +12,13 @@ h3. Installation You don't need to install anything. Just import the client like this. The go tools will fetch the relevant code and dependencies for you. - -
import (
-	"git.curoverse.com/arvados.git/sdk/go/keepclient"
-	"git.curoverse.com/arvados.git/sdk/go/arvadosclient"
-)
-
-
+{% code 'example_sdk_go_imports' as go %} If you need pre-release client code, you can use the latest version from the repo by following "these instructions.":https://arvados.org/projects/arvados/wiki/Go#Using-Go-with-Arvados -h3. Examples +h3. Example -Import the module. (We import the log module here too, so we can use it in the subsequent examples.) - - -
import (
-	"git.curoverse.com/arvados.git/sdk/go/keepclient"
-	"git.curoverse.com/arvados.git/sdk/go/arvadosclient"
-	"log"
-)
-
-
- -Set up an API client user agent: - - -
	arv, err := arvadosclient.MakeArvadosClient()
-	if err != nil {
-		log.Fatalf("Error setting up arvados client %s", err.Error())
-	}
-
-
- -Get the User object for the current user: - - -
	type user struct {
-		Uuid       string   `json:"uuid"`
-		FullName   string   `json:"full_name"`
-	}
-
-	var u user
-	err := arv.Call("GET", "users", "", "current", nil, &u)
-
-	if err != nil {
-		return err
-	}
-
-	log.Printf("Logged in as %s (uuid %s)", user.Uuid, user.FullName)
-
-
- -Print all returned fields for collections: +You can save this source as a .go file and run it: {% code 'example_sdk_go' as go %}