Created
May 14, 2020 00:56
-
-
Save hackerzhut/f9b58d5bc23d25458f4fad628eef7183 to your computer and use it in GitHub Desktop.
Sample Trace Id function
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
// traceID returns random traceID in uuid format. | |
func traceID() string { | |
traceID := uuid.NewV4() | |
hi, low := binary.LittleEndian.Uint64(traceID[:8]), binary.LittleEndian.Uint64(traceID[8:]) | |
return fmt.Sprintf("%016x%016x", hi, low) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment