Closed leonsal closed 5 years ago
This also occurs in !FunctionNameSomeThing
condition
package slice
import "github.com/cheekybits/genny/generic"
type SomeThing generic.Type
func ContainsSomeThing(slice []Something, element Something) bool {
// code omitted
return false
}
func ContainsAllSomeThing(slice []Something, other []Something) bool {
for _, e := range other {
if !ContainsSomeThing(slice, e) { // <-- Generates `Containslowercased`
return false
}
}
return true
}
with SomeThing=string
, genny outputs
// ...
func ContainsAllString(slice []Something, other []Something) bool {
// ...
if !Containsstring(slice, e) {
// ...
}
Changing if !ContainsSomeThing(slice, e)
to if ContainsSomeThing(slice, e)
, genny generates correct code.
Also having this issue with the new
function... would be extremely useful if this could be fixed
The code generated by
genny
generates the object name (ObjInt
) with the specific type in lower case when it should be capitalized. This occurs when the object name is the parameter ofnew
function. Does not occur if preceded by a space: