MCPcopy Create free account
hub / github.com/algolia/cli / Set

Method Set

pkg/cmdutil/json_value.go:32–41  ·  view source on GitHub ↗

Set parses the JSON string into the value.

(s string)

Source from the content-addressed store, hash-verified

30
31// Set parses the JSON string into the value.
32func (j *JSONValue) Set(s string) error {
33 if err := json.Unmarshal([]byte(s), &j.Value); err != nil {
34 if utils.Contains(j.types, "string") {
35 j.Value = s
36 return nil
37 }
38 return err
39 }
40 return nil
41}
42
43// Type returns the type of the value.
44func (j *JSONValue) Type() string {

Callers 15

Test_JSONValueFunction · 0.45
Test_FlagValuesMapFunction · 0.45
RoundTripMethod · 0.45
persistTokenFunction · 0.45
StartCallbackServerFunction · 0.45
AddMethod · 0.45
SetDefaultProfileMethod · 0.45
SetCrawlerAuthMethod · 0.45
buildAuthorizeURLMethod · 0.45
RefreshTokenMethod · 0.45
RevokeTokenMethod · 0.45

Calls 1

ContainsFunction · 0.92

Tested by 2

Test_JSONValueFunction · 0.36
Test_FlagValuesMapFunction · 0.36