Full Mattermost server source with integrated Community Enterprise features. Includes vendor directory for offline/air-gapped builds. Structure: - enterprise-impl/: Enterprise feature implementations - enterprise-community/: Init files that register implementations - enterprise/: Bridge imports (community_imports.go) - vendor/: All dependencies for offline builds Build (online): go build ./cmd/mattermost Build (offline/air-gapped): go build -mod=vendor ./cmd/mattermost 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
54 lines
773 B
Go
54 lines
773 B
Go
package common
|
|
|
|
// AsIntOrNil returns ref
|
|
func AsIntOrNil(data interface{}) *int {
|
|
if data == nil {
|
|
return nil
|
|
}
|
|
|
|
number, ok := data.(int)
|
|
if !ok {
|
|
return nil
|
|
}
|
|
return IntRef(number)
|
|
}
|
|
|
|
// AsInt64OrNil returns ref
|
|
func AsInt64OrNil(data interface{}) *int64 {
|
|
if data == nil {
|
|
return nil
|
|
}
|
|
|
|
number, ok := data.(int64)
|
|
if !ok {
|
|
return nil
|
|
}
|
|
return Int64Ref(number)
|
|
}
|
|
|
|
// AsFloat64OrNil return ref
|
|
func AsFloat64OrNil(data interface{}) *float64 {
|
|
if data == nil {
|
|
return nil
|
|
}
|
|
|
|
number, ok := data.(float64)
|
|
if !ok {
|
|
return nil
|
|
}
|
|
return Float64Ref(number)
|
|
}
|
|
|
|
// AsStringOrNil returns ref
|
|
func AsStringOrNil(data interface{}) *string {
|
|
if data == nil {
|
|
return nil
|
|
}
|
|
|
|
str, ok := data.(string)
|
|
if !ok {
|
|
return nil
|
|
}
|
|
return StringRef(str)
|
|
}
|