From 39a803633f3d105a7ec93f97d75405dc37cad0a1 Mon Sep 17 00:00:00 2001 From: Leah Hanson Date: Mon, 25 Oct 2021 15:25:27 -0700 Subject: docs(spanner): correct struct field tag syntax (#4709) * `spanner:-` is not valid syntax for a struct field tag. The correct syntax is `spanner:"-"`. * `spanner:name` has the same problem; it should be `spanner:"name"`. Co-authored-by: Hengfeng Li --- spanner/mutation.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spanner/mutation.go b/spanner/mutation.go index a0d1466b6..7ee0ca347 100644 --- a/spanner/mutation.go +++ b/spanner/mutation.go @@ -216,8 +216,8 @@ func InsertMap(table string, in map[string]interface{}) *Mutation { // codes.AlreadyExists. // // The in argument must be a struct or a pointer to a struct. Its exported -// fields specify the column names and values. Use a field tag like "spanner:name" -// to provide an alternative column name, or use "spanner:-" to ignore the field. +// fields specify the column names and values. Use a field tag like `spanner:"name"` +// to provide an alternative column name, or use `spanner:"-"` to ignore the field. func InsertStruct(table string, in interface{}) (*Mutation, error) { cols, vals, err := structToMutationParams(in) if err != nil { @@ -285,7 +285,7 @@ func InsertOrUpdateMap(table string, in map[string]interface{}) *Mutation { // // The in argument must be a struct or a pointer to a struct. Its exported // fields specify the column names and values. Use a field tag like -// "spanner:name" to provide an alternative column name, or use "spanner:-" to +// `spanner:"name"` to provide an alternative column name, or use `spanner:"-"` to // ignore the field. // // For a similar example, See UpdateStruct. @@ -326,8 +326,8 @@ func ReplaceMap(table string, in map[string]interface{}) *Mutation { // written become NULL. The row is specified by a Go struct. // // The in argument must be a struct or a pointer to a struct. Its exported -// fields specify the column names and values. Use a field tag like "spanner:name" -// to provide an alternative column name, or use "spanner:-" to ignore the field. +// fields specify the column names and values. Use a field tag like `spanner:"name"` +// to provide an alternative column name, or use `spanner:"-"` to ignore the field. // // For a similar example, See UpdateStruct. func ReplaceStruct(table string, in interface{}) (*Mutation, error) { -- cgit v1.2.3