From 7c1f48f307284c26c10cd5787dbc94136a2a36a6 Mon Sep 17 00:00:00 2001 From: Yuki Furuyama Date: Wed, 26 May 2021 19:13:56 +0900 Subject: [PATCH] fix(spanner): indent code example for Encoder and Decoder (#4128) Co-authored-by: Hengfeng Li --- spanner/value.go | 58 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/spanner/value.go b/spanner/value.go index eb2a873a715..46a118f1fcb 100644 --- a/spanner/value.go +++ b/spanner/value.go @@ -71,19 +71,19 @@ var ( // Encoder is the interface implemented by a custom type that can be encoded to // a supported type by Spanner. A code example: // -// type customField struct { -// Prefix string -// Suffix string -// } +// type customField struct { +// Prefix string +// Suffix string +// } // -// // Convert a customField value to a string -// func (cf customField) EncodeSpanner() (interface{}, error) { -// var b bytes.Buffer -// b.WriteString(cf.Prefix) -// b.WriteString("-") -// b.WriteString(cf.Suffix) -// return b.String(), nil -// } +// // Convert a customField value to a string +// func (cf customField) EncodeSpanner() (interface{}, error) { +// var b bytes.Buffer +// b.WriteString(cf.Prefix) +// b.WriteString("-") +// b.WriteString(cf.Suffix) +// return b.String(), nil +// } type Encoder interface { EncodeSpanner() (interface{}, error) } @@ -91,24 +91,24 @@ type Encoder interface { // Decoder is the interface implemented by a custom type that can be decoded // from a supported type by Spanner. A code example: // -// type customField struct { -// Prefix string -// Suffix string -// } +// type customField struct { +// Prefix string +// Suffix string +// } // -// // Convert a string to a customField value -// func (cf *customField) DecodeSpanner(val interface{}) (err error) { -// strVal, ok := val.(string) -// if !ok { -// return fmt.Errorf("failed to decode customField: %v", val) -// } -// s := strings.Split(strVal, "-") -// if len(s) > 1 { -// cf.Prefix = s[0] -// cf.Suffix = s[1] -// } -// return nil -// } +// // Convert a string to a customField value +// func (cf *customField) DecodeSpanner(val interface{}) (err error) { +// strVal, ok := val.(string) +// if !ok { +// return fmt.Errorf("failed to decode customField: %v", val) +// } +// s := strings.Split(strVal, "-") +// if len(s) > 1 { +// cf.Prefix = s[0] +// cf.Suffix = s[1] +// } +// return nil +// } type Decoder interface { DecodeSpanner(input interface{}) error }