singular.go 367 B

123456789101112131415161718
  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. return upstream.Singular(name)
  15. }