| OLD | NEW |
| 1 // Copyright 2017 The LUCI Authors. All rights reserved. | 1 // Copyright 2017 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package swarming | 5 package swarming |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "strconv" | 8 "strconv" |
| 9 "strings" | 9 "strings" |
| 10 "unicode/utf8" | 10 "unicode/utf8" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 } | 260 } |
| 261 | 261 |
| 262 lastChar, lastCharSize := utf8.DecodeLastRuneInString(taskID) | 262 lastChar, lastCharSize := utf8.DecodeLastRuneInString(taskID) |
| 263 v, err := strconv.ParseUint(string(lastChar), 16, 8) | 263 v, err := strconv.ParseUint(string(lastChar), 16, 8) |
| 264 if err != nil { | 264 if err != nil { |
| 265 return "", errors.Annotate(err, "failed to parse hex from rune:
%r", lastChar).Err() | 265 return "", errors.Annotate(err, "failed to parse hex from rune:
%r", lastChar).Err() |
| 266 } | 266 } |
| 267 | 267 |
| 268 return taskID[:len(taskID)-lastCharSize] + strconv.FormatUint((v|uint64(
tryNumber)), 16), nil | 268 return taskID[:len(taskID)-lastCharSize] + strconv.FormatUint((v|uint64(
tryNumber)), 16), nil |
| 269 } | 269 } |
| OLD | NEW |