File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -328,11 +328,13 @@ func IsReadmeFile(name string) bool {
328
328
// the length of the provided extension list.
329
329
// Note that the '.' should be provided in ext, e.g ".md"
330
330
func IsReadmeFileExtension (name string , ext ... string ) (int , bool ) {
331
+ name = strings .ToLower (name )
331
332
if len (name ) < 6 || name [:6 ] != "readme" {
332
333
return 0 , false
333
334
}
334
335
335
336
for i , extension := range ext {
337
+ extension = strings .ToLower (extension )
336
338
if name [6 :] == extension {
337
339
return i , true
338
340
}
Original file line number Diff line number Diff line change @@ -58,6 +58,16 @@ func TestMisc_IsReadmeFile(t *testing.T) {
58
58
expected : true ,
59
59
idx : 0 ,
60
60
},
61
+ {
62
+ name : "README.md" ,
63
+ expected : true ,
64
+ idx : 0 ,
65
+ },
66
+ {
67
+ name : "ReAdMe.Md" ,
68
+ expected : true ,
69
+ idx : 0 ,
70
+ },
61
71
{
62
72
name : "readme.txt" ,
63
73
expected : true ,
You can’t perform that action at this time.
0 commit comments