diff options
author | Leah Hanson <astrieanna@gmail.com> | 2021-10-25 15:25:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 09:25:27 +1100 |
commit | 39a803633f3d105a7ec93f97d75405dc37cad0a1 (patch) | |
tree | a72622d90b2ed71399946afc8640e252eae55e7c | |
parent | db4058628d5fc43a15582d0ae0883adce5331117 (diff) | |
download | google-cloud-go-39a803633f3d105a7ec93f97d75405dc37cad0a1.tar.gz |
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 <hengfeng@google.com>
-rw-r--r-- | spanner/mutation.go | 10 |
1 files 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) { |