Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ func SqlRowsToJSON(rows *sql.Rows) ([]interface{}, error) {
return finalRows, nil
}

// GenerateAPIKey generates an API key for a user
// GenerateRandomAPIKey generates a random API key for a user
func GenerateRandomAPIKey() (string, error) {
const apiLength = 28
const letters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
Expand Down Expand Up @@ -1353,7 +1353,7 @@ func GenerateQRCodeForAddress(address []byte) (string, string, error) {
return base64.StdEncoding.EncodeToString(png), base64.StdEncoding.EncodeToString(pngInverse), nil
}

// sliceContains reports whether the provided string is present in the given slice of strings.
// SliceContains reports whether the provided string is present in the given slice of strings.
func SliceContains(list []string, target string) bool {
for _, s := range list {
if s == target {
Expand Down Expand Up @@ -1479,7 +1479,7 @@ func LogError(err error, errorMsg interface{}, callerSkip int, additionalInfos .
logErrorInfo(err, callerSkip, additionalInfos...).Error(errorMsg)
}

// LogError logs a warning with callstack info that skips callerSkip many levels with arbitrarily many additional infos.
// LogWarn logs a warning with callstack info that skips callerSkip many levels with arbitrarily many additional infos.
// callerSkip equal to 0 gives you info directly where LogError is called.
func LogWarn(err error, errorMsg interface{}, callerSkip int, additionalInfos ...map[string]interface{}) {
logErrorInfo(err, callerSkip, additionalInfos...).Warn(errorMsg)
Expand Down