You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -257,8 +259,9 @@ it as well, and call its Run method.
257
259
job, err = loader.Run(ctx)
258
260
// Poll the job for completion if desired, as above.
259
261
260
-
To upload, first define a type that implements the ValueSaver interface, which has a single method named Save.
261
-
Then create an Inserter, and call its Put method with a slice of values.
262
+
To upload, first define a type that implements the [ValueSaver] interface, which has
263
+
a single method named Save. Then create an [Inserter], and call its [Inserter.Put]
264
+
method with a slice of values.
262
265
263
266
type Item struct {
264
267
Name string
@@ -286,7 +289,7 @@ Then create an Inserter, and call its Put method with a slice of values.
286
289
// TODO: Handle error.
287
290
}
288
291
289
-
You can also upload a struct that doesn't implement ValueSaver. Use the StructSaver type
292
+
You can also upload a struct that doesn't implement [ValueSaver]. Use the [StructSaver] type
290
293
to specify the schema and insert ID by hand:
291
294
292
295
type item struct {
@@ -324,13 +327,13 @@ Lastly, but not least, you can just supply the struct or struct pointer directly
324
327
}
325
328
326
329
BigQuery allows for higher throughput when omitting insertion IDs. To enable this,
327
-
specify the sentinel `NoDedupeID` value for the insertion ID when implementing a ValueSaver.
330
+
specify the sentinel [NoDedupeID] value for the insertion ID when implementing a [ValueSaver].
328
331
329
332
# Extracting
330
333
331
334
If you've been following so far, extracting data from a BigQuery table
332
335
into a Google Cloud Storage object will feel familiar. First create an
333
-
Extractor, then optionally configure it, and lastly call its Run method.
336
+
[Extractor], then optionally configure it, and lastly call its [Extractor.Run] method.
334
337
335
338
extractor := table.ExtractorTo(gcsRef)
336
339
extractor.DisableHeader = true
@@ -339,16 +342,16 @@ Extractor, then optionally configure it, and lastly call its Run method.
339
342
340
343
# Errors
341
344
342
-
Errors returned by this client are often of the type googleapi.Error: https://godoc.org/google.golang.org/api/googleapi#Error
345
+
Errors returned by this client are often of the type [googleapi.Error].
346
+
These errors can be introspected for more information by using [errors.As]
347
+
with the richer [googleapi.Error] type. For example:
343
348
344
-
These errors can be introspected for more information by using `xerrors.As` with the richer *googleapi.Error type. For example:
345
-
346
-
var e *googleapi.Error
347
-
if ok := xerrors.As(err, &e); ok {
348
-
if e.Code == 409 { ... }
349
-
}
349
+
var e *googleapi.Error
350
+
if ok := errors.As(err, &e); ok {
351
+
if e.Code == 409 { ... }
352
+
}
350
353
351
-
In some cases, your client may received unstructured googleapi.Error error responses. In such cases, it is likely that
354
+
In some cases, your client may received unstructured [googleapi.Error] error responses. In such cases, it is likely that
352
355
you have exceeded BigQuery request limits, documented at: https://cloud.google.com/bigquery/quotas
0 commit comments