1
0

singular.go 576 B

12345678910111213141516171819202122232425
  1. package inflection
  2. import (
  3. "strings"
  4. upstream "github.com/jinzhu/inflection"
  5. )
  6. func Singular(name string) string {
  7. // Manual fix for incorrect handling of "campus"
  8. //
  9. // https://github.com/kyleconroy/sqlc/issues/430
  10. // https://github.com/jinzhu/inflection/issues/13
  11. if strings.ToLower(name) == "campus" {
  12. return name
  13. }
  14. // Manual fix for incorrect handling of "meta"
  15. //
  16. // https://github.com/kyleconroy/sqlc/issues/1217
  17. // https://github.com/jinzhu/inflection/issues/21
  18. if strings.ToLower(name) == "meta" {
  19. return name
  20. }
  21. return upstream.Singular(name)
  22. }