...

Source file src/github.com/gobuffalo/flect/rule.go

Documentation: github.com/gobuffalo/flect

     1  package flect
     2  
     3  type ruleFn func(string) string
     4  
     5  type rule struct {
     6  	suffix string
     7  	fn     ruleFn
     8  }
     9  
    10  func simpleRuleFunc(suffix, repl string) func(string) string {
    11  	return func(s string) string {
    12  		s = s[:len(s)-len(suffix)]
    13  		return s + repl
    14  	}
    15  }
    16  
    17  func noop(s string) string { return s }
    18  

View as plain text