-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance local cache logs and metrics (#146)
* enhance local cache logs and metrics * Linting issues * update dependencies * fix go sum * fix tests * Add do func * Enhance logs
- Loading branch information
1 parent
bd235fe
commit f58f9e8
Showing
9 changed files
with
115 additions
and
120 deletions.
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,21 @@ | ||
package utils | ||
|
||
import "errors" | ||
|
||
// IntToUInt64 safely converts an int to uint64. | ||
// Returns an error if the number is negative. | ||
func IntToUInt64(i int) (uint64, error) { | ||
if i < 0 { | ||
return 0, errors.New("cannot convert negative int to uint64") | ||
} | ||
return uint64(i), nil | ||
} | ||
|
||
// IntToUInt safely converts an int to uint. | ||
// Returns an error if the number is negative. | ||
func IntToUInt(i int) (uint, error) { | ||
if i < 0 { | ||
return 0, errors.New("cannot convert negative int to uint") | ||
} | ||
return uint(i), nil | ||
} |
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
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