File: example_test.go

package info (click to toggle)
golang-gopkg-dancannon-gorethink.v1 1.4.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 764 kB
  • sloc: makefile: 3
file content (30 lines) | stat: -rw-r--r-- 404 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package gorethink

import (
	"fmt"
)

func Example() {
	session, err := Connect(ConnectOpts{
		Address: url,
	})
	if err != nil {
		Log.Fatalln(err.Error())
	}

	res, err := Expr("Hello World").Run(session)
	if err != nil {
		Log.Fatalln(err.Error())
	}

	var response string
	err = res.One(&response)
	if err != nil {
		Log.Fatalln(err.Error())
	}

	fmt.Println(response)

	// Output:
	// Hello World
}