@@ -99,6 +99,9 @@ import (
9999 " time"
100100
101101 " github.com/tarantool/go-tarantool/v2"
102+ _ " github.com/tarantool/go-tarantool/v2/datetime"
103+ _ " github.com/tarantool/go-tarantool/v2/decimal"
104+ _ " github.com/tarantool/go-tarantool/v2/uuid"
102105)
103106
104107func main () {
@@ -131,19 +134,22 @@ func main() {
131134** Observation 1:** The line "` github.com/tarantool/go-tarantool/v2 ` " in the
132135` import(...) ` section brings in all Tarantool-related functions and structures.
133136
134- ** Observation 2:** The line starting with "` ctx, cancel := ` " creates a context
137+ ** Observation 2:** Unused import lines are required to initialize encoders and
138+ decoders for external ` msgpack ` types.
139+
140+ ** Observation 3:** The line starting with "` ctx, cancel := ` " creates a context
135141object for ` Connect() ` . The ` Connect() ` call will return an error when a
136142timeout expires before the connection is established.
137143
138- ** Observation 3 :** The line starting with "` dialer := ` " creates dialer for
144+ ** Observation 4 :** The line starting with "` dialer := ` " creates dialer for
139145` Connect() ` . This structure contains fields required to establish a connection.
140146
141- ** Observation 4 :** The line starting with "` opts := ` " sets up the options for
147+ ** Observation 5 :** The line starting with "` opts := ` " sets up the options for
142148` Connect() ` . In this example, the structure contains only a single value, the
143149timeout. The structure may also contain other settings, see more in
144150[ documentation] [ godoc-opts-url ] for the "` Opts ` " structure.
145151
146- ** Observation 5 :** The line containing "` tarantool.Connect ` " is essential for
152+ ** Observation 6 :** The line containing "` tarantool.Connect ` " is essential for
147153starting a session. There are three parameters:
148154
149155* a context,
@@ -155,10 +161,10 @@ There will be only one attempt to connect. If multiple attempts needed,
155161between each try. Example could be found in the [ example_test] ( ./example_test.go ) ,
156162name - ` ExampleConnect_reconnects ` .
157163
158- ** Observation 6 :** The ` err ` structure will be ` nil ` if there is no error,
164+ ** Observation 7 :** The ` err ` structure will be ` nil ` if there is no error,
159165otherwise it will have a description which can be retrieved with ` err.Error() ` .
160166
161- ** Observation 7 :** The ` Insert ` request, like almost all requests, is preceded
167+ ** Observation 8 :** The ` Insert ` request, like almost all requests, is preceded
162168by the method ` Do ` of object ` conn ` which is the object that was returned
163169by ` Connect() ` .
164170
@@ -179,6 +185,9 @@ import (
179185 " time"
180186
181187 " github.com/tarantool/go-tarantool/v2"
188+ _ " github.com/tarantool/go-tarantool/v2/datetime"
189+ _ " github.com/tarantool/go-tarantool/v2/decimal"
190+ _ " github.com/tarantool/go-tarantool/v2/uuid"
182191 " github.com/tarantool/go-tlsdialer"
183192)
184193
0 commit comments