func(valueType reflect.Type, value reflect.Value, function string, parentName string, typesSeen map[string]bool) bool could be replaced with func(valueType reflect.Type, value reflect.Value, function, parentName string, typesSeen map[string]bool) bool
95 return result
96}
97
98func (s Struct) pointerHandler(valueType reflect.Type, value reflect.Value, function string, parentName string, typesSeen map[string]bool) bool { 99 elementType := valueType.Elem()
100 if value.IsNil() {
101 newValue := reflect.New(elementType)
Description
If parameters of the same type lie consecutively, mention their type once at the end of the last parameter.
Unlike other languages, like C, where all parameters must be specified with types explicitly, it is not required to do so in Go. Combining the types is usually recommended for the sake of brevity.
Bad practice
func foo(a, b int, c, d int, e, f int, g int) {}
Recommended
func foo(a, b, c, d, e, f, g int) {}