MCPcopy Create free account
hub / github.com/openclaw/gogcli / adminUserRandInt

Function adminUserRandInt

internal/cmd/admin_common.go:66–75  ·  view source on GitHub ↗
(maxVal int)

Source from the content-addressed store, hash-verified

64}
65
66func adminUserRandInt(maxVal int) (int, error) {
67 if maxVal <= 0 {
68 return 0, fmt.Errorf("invalid max %d", maxVal)
69 }
70 n, err := rand.Int(rand.Reader, big.NewInt(int64(maxVal)))
71 if err != nil {
72 return 0, err
73 }
74 return int(n.Int64()), nil
75}
76
77func normalizeAdminUserHashFunction(value string) (string, error) {
78 switch strings.ToLower(strings.TrimSpace(value)) {

Callers 2

adminUserRandCharFunction · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected