MCPcopy Index your code
hub / github.com/coder/coder / Set

Method Set

coderd/idpsync/organization.go:214–227  ·  view source on GitHub ↗
(v string)

Source from the content-addressed store, hash-verified

212}
213
214func (s *OrganizationSyncSettings) Set(v string) error {
215 legacyCheck := make(map[string]any)
216 err := json.Unmarshal([]byte(v), &legacyCheck)
217 if assign, ok := legacyCheck["AssignDefault"]; err == nil && ok {
218 // The legacy JSON key was 'AssignDefault' instead of 'assign_default'
219 // Set the default value from the legacy if it exists.
220 isBool, ok := assign.(bool)
221 if ok {
222 s.AssignDefault = isBool
223 }
224 }
225
226 return json.Unmarshal([]byte(v), s)
227}
228
229func (s *OrganizationSyncSettings) String() string {
230 if s.Mapping == nil {

Callers 1

TestFromLegacySettingsFunction · 0.95

Calls 1

UnmarshalMethod · 0.45

Tested by 1

TestFromLegacySettingsFunction · 0.76