-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85889e2
commit df7f7ea
Showing
4 changed files
with
140 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package utils | ||
|
||
import ( | ||
"runtime" | ||
) | ||
|
||
const ( | ||
CPU_UNKNOWN = iota | ||
CPU_64 = 64 | ||
CPU_32 = 32 | ||
) | ||
|
||
func CpuArchitecture() uint { | ||
if runtime.GOARCH == "amd64" || runtime.GOARCH == "arm64" { | ||
return CPU_64 | ||
} else if runtime.GOARCH == "386" || runtime.GOARCH == "arm" { | ||
return CPU_32 | ||
} | ||
|
||
return CPU_UNKNOWN | ||
} | ||
|
||
func PointerSize() uint { | ||
arch := CpuArchitecture() | ||
|
||
if arch != CPU_UNKNOWN { | ||
return arch / 8 | ||
} | ||
|
||
return 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package utils | ||
|
||
func getFeatureFlags() map[string]bool { | ||
return map[string]bool{ | ||
"SIZE_ON_HOVER": false, | ||
} | ||
} | ||
|
||
// Function to check if a specific feature is enabled | ||
func IsFeatureEnabled(feature string) bool { | ||
flags := getFeatureFlags() | ||
if enabled, exists := flags[feature]; exists { | ||
return enabled | ||
} | ||
// Default behavior if feature flag is not found | ||
return false | ||
} |