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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 lastChar, lastCharSize := utf8.DecodeLastRuneInString(taskID) | 267 lastChar, lastCharSize := utf8.DecodeLastRuneInString(taskID) |
268 v, err := strconv.ParseUint(string(lastChar), 16, 8) | 268 v, err := strconv.ParseUint(string(lastChar), 16, 8) |
269 if err != nil { | 269 if err != nil { |
270 return "", errors.Annotate(err).Reason("failed to parse hex from
rune: %(rune)r"). | 270 return "", errors.Annotate(err).Reason("failed to parse hex from
rune: %(rune)r"). |
271 D("rune", lastChar). | 271 D("rune", lastChar). |
272 Err() | 272 Err() |
273 } | 273 } |
274 | 274 |
275 return taskID[:len(taskID)-lastCharSize] + strconv.FormatUint((v|uint64(
tryNumber)), 16), nil | 275 return taskID[:len(taskID)-lastCharSize] + strconv.FormatUint((v|uint64(
tryNumber)), 16), nil |
276 } | 276 } |
OLD | NEW |