Skip to content

Commit 55bf48b

Browse files
committed
inflection: Add fix for campus
1 parent 325418e commit 55bf48b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

internal/inflection/singular.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package inflection
2+
3+
import (
4+
"strings"
5+
6+
upstream "github.com/jinzhu/inflection"
7+
)
8+
9+
func Singular(name string) string {
10+
// Manual fix for incorrect handling of "campus"
11+
//
12+
// https://github.com/kyleconroy/sqlc/issues/430
13+
// https://github.com/jinzhu/inflection/issues/13
14+
if strings.ToLower(name) == "campus" {
15+
return name
16+
}
17+
return upstream.Singular(name)
18+
}

0 commit comments

Comments
 (0)