Use hexadecimal ids and lowercase names in zipkin input (#3488)

This commit is contained in:
Chris Goller
2017-11-20 16:19:32 -06:00
committed by Daniel Nelson
parent f9b808572f
commit 113184ddae
8 changed files with 120 additions and 110 deletions

View File

@@ -239,7 +239,7 @@ func TraceIDFromString(s string) (string, error) {
return fmt.Sprintf("%x%016x", hi, lo), nil
}
// IDFromString creates a decimal id from a hexadecimal string
// IDFromString validates the ID and returns it in hexadecimal format.
func IDFromString(s string) (string, error) {
if len(s) > 16 {
return "", fmt.Errorf("ID cannot be longer than 16 hex characters: %s", s)
@@ -248,5 +248,5 @@ func IDFromString(s string) (string, error) {
if err != nil {
return "", err
}
return strconv.FormatUint(id, 10), nil
return strconv.FormatUint(id, 16), nil
}