| Conditions | 6 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package util |
||
| 47 | func PathsEqual(p1, p2 string) bool { |
||
|
1 ignored issue
–
show
|
|||
| 48 | p1 = strings.TrimRight(p1, "/\\") |
||
| 49 | p2 = strings.TrimRight(p2, "/\\") |
||
| 50 | |||
| 51 | if p1 == p2 { |
||
| 52 | return true |
||
| 53 | } |
||
| 54 | |||
| 55 | p1to := filepath.ToSlash(p1) |
||
| 56 | p1from := filepath.FromSlash(p1) |
||
| 57 | |||
| 58 | p2to := filepath.ToSlash(p2) |
||
| 59 | p2from := filepath.FromSlash(p2) |
||
| 60 | |||
| 61 | if p1to == p2to || p1to == p2from || p1from == p2to || p1from == p2from { |
||
| 62 | return true |
||
| 63 | } |
||
| 64 | |||
| 65 | return false |
||
| 66 | } |
||
| 67 |