nil,nil is no policy and no error. Allow it

This commit is contained in:
riccardom
2026-06-09 13:37:27 +02:00
parent 1f3e5a2ace
commit 43ce85fbfe
2 changed files with 2 additions and 7 deletions

View File

@@ -8,10 +8,7 @@ package mdm
// Phase 5 / Phase 6. The stub keeps the package compilable for mobile
// builds and returns (nil, nil) — the platform-absent sentinel that
// LoadPolicy in policy.go treats as "no MDM source present".
//
// loadPlatformPolicy reports the absence of a platform-managed configuration on mobile builds.
// It returns a nil policy map and a nil error as a sentinel value; the real managed-config
// dictionary is read by the native iOS/Android layer and injected into the Go process.
func loadPlatformPolicy() (map[string]any, error) {
//nolint:nilnil // (nil, nil) is the documented platform-absent sentinel; see LoadPolicy.
return nil, nil
}

View File

@@ -8,9 +8,7 @@ package mdm
// sentinel the caller (LoadPolicy in policy.go) treats as "no MDM
// source present"; an error here would just translate to the same
// outcome with an extra log line.
//
// loadPlatformPolicy indicates that no platform MDM policy is available on this build target.
// It intentionally returns (nil, nil) as the documented platform-absent sentinel so callers treat MDM as not present.
func loadPlatformPolicy() (map[string]any, error) {
//nolint:nilnil // (nil, nil) is the documented platform-absent sentinel; see LoadPolicy.
return nil, nil
}