| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 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 isolate | 5 package isolate |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "fmt" | 8 "fmt" |
| 9 "log" | 9 "log" |
| 10 "path" | 10 "path" |
| 11 "runtime" |
| 11 "strings" | 12 "strings" |
| 12 | 13 |
| 13 "github.com/luci/luci-go/common/errors" | 14 "github.com/luci/luci-go/common/errors" |
| 14 ) | 15 ) |
| 15 | 16 |
| 16 // TODO(tandrii): Remove this hacky stuff. | 17 // TODO(tandrii): Remove this hacky stuff. |
| 17 // hacky stuff for faster debugging. | 18 // hacky stuff for faster debugging. |
| 18 func assertNoError(err error) { | 19 func assertNoError(err error) { |
| 19 if err == nil { | 20 if err == nil { |
| 20 return | 21 return |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 n += 3 | 127 n += 3 |
| 127 } | 128 } |
| 128 if t0 != tl { | 129 if t0 != tl { |
| 129 buf[n] = '/' | 130 buf[n] = '/' |
| 130 copy(buf[n+1:], targ[t0:]) | 131 copy(buf[n+1:], targ[t0:]) |
| 131 } | 132 } |
| 132 return string(buf), nil | 133 return string(buf), nil |
| 133 } | 134 } |
| 134 return targ[t0:], nil | 135 return targ[t0:], nil |
| 135 } | 136 } |
| 137 |
| 138 // IsWindows returns True when running on the best OS there is. |
| 139 func IsWindows() bool { |
| 140 return runtime.GOOS == "windows" |
| 141 } |
| OLD | NEW |