MCPcopy
hub / github.com/larksuite/cli / DetectBuildKind

Function DetectBuildKind

internal/cmdutil/secheader.go:97–102  ·  view source on GitHub ↗

DetectBuildKind reports whether this binary is the official CLI, an extended/repackaged build, or unknown. The result is cached via sync.Once so it is computed only on the first call. IMPORTANT: must NOT be called from any package init(). Go's init ordering follows the import graph; ISV providers r

()

Source from the content-addressed store, hash-verified

95// have run yet, which would misclassify an extended build as official. Call
96// only when handling an actual request (e.g. from BaseSecurityHeaders).
97func DetectBuildKind() string {
98 buildKindOnce.Do(func() {
99 buildKindVal = computeBuildKind()
100 })
101 return buildKindVal
102}
103
104// computeBuildKind performs the actual detection without any caching.
105// Exposed for tests. Gathers runtime/global inputs and delegates the pure

Calls 1

computeBuildKindFunction · 0.85