···527528 // a valid timestamp can have optional ':' in zone specifier
529 // remove that if it exists so we have a single format
530- if ts[len(ts)-3] == ':' {
531 ts = ts[:len(ts)-3] + ts[len(ts)-2:]
532 }
533
···527528 // a valid timestamp can have optional ':' in zone specifier
529 // remove that if it exists so we have a single format
530+ if len(ts) >= 3 && ts[len(ts)-3] == ':' {
531 ts = ts[:len(ts)-3] + ts[len(ts)-2:]
532 }
533
+8
gitdiff/file_header_test.go
···724 Input: "+++ file.txt\t2019-03-21 12:34:56.789 -0700\n",
725 Output: false,
726 },
00000000727 }
728729 for name, test := range tests {