MCPcopy Create free account
hub / github.com/openclaw/gogcli / Decode

Function Decode

internal/sheetsformat/format.go:36–58  ·  view source on GitHub ↗
(data []byte, dst *sheets.CellFormat)

Source from the content-addressed store, hash-verified

34}
35
36func Decode(data []byte, dst *sheets.CellFormat) error {
37 if dst == nil {
38 return errFormatRequired
39 }
40
41 dec := json.NewDecoder(bytes.NewReader(data))
42 dec.DisallowUnknownFields()
43
44 if err := dec.Decode(dst); err != nil {
45 return fmt.Errorf("decode cell format: %w", err)
46 }
47
48 var extra any
49 if err := dec.Decode(&extra); err != io.EOF {
50 if err == nil {
51 return errMultipleJSONValues
52 }
53
54 return fmt.Errorf("decode trailing cell format data: %w", err)
55 }
56
57 return nil
58}
59
60func NormalizeMask(mask string) (string, []string) {
61 parts := splitFieldMask(mask)

Callers 3

RunMethod · 0.92
parseConditionalFormatFunction · 0.92
TestDecodeFunction · 0.70

Calls 1

ErrorfMethod · 0.80

Tested by 1

TestDecodeFunction · 0.56