Overriding a factory method doesn't affect any, scalar, integer, number
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- go
- Área
- backend-api-design
Línea de trabajo
Start with tt.go:155-198 and trace how GetIntegerConverter, GetNumberConverter, GetAnyConverter, and GetScalarConverter build their converters; compare that with the README's factory customization guidance. Use the reproduction in the issue to verify the behavior. Done means either factory overrides affect the composite converters as expected, or the README clearly documents the limitation.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Reproduction snippets assume:
fac := tupleconv.MakeStringToTTConvFactory()
Where: GetIntegerConverter, GetNumberConverter, GetAnyConverter, GetScalarConverter (tt.go:155-198).
The README suggests customizing StringToTTConvFactory by embedding it and overriding methods. Go has no virtual dispatch through embedding: inside GetAnyConverter and GetScalarConverter, fac is the embedded StringToTTConvFactory, so they call its own methods, not the overrides. GetIntegerConverter and GetNumberConverter don't call the factory methods at all; they build MakeStringTo*Converter directly, so an overridden GetUnsignedConverter or GetDoubleConverter is ignored too.
Reproduction:
type myFactory struct{ tupleconv.StringToTTConvFactory }
func (myFactory) GetNumberConverter() tupleconv.Converter[string, any] {
return tupleconv.MakeFuncConverter(func(s string) (any, error) {
return "custom number", nil
})
}
for _, typ := range []tupleconv.TypeName{
tupleconv.TypeNumber, tupleconv.TypeAny, tupleconv.TypeScalar,
} {
c, _ := tupleconv.GetConverterByType[string](myFactory{fac}, typ)
v, _ := c.Convert("1")
fmt.Printf("%s: %T(%v)\n", typ, v, v)
}
number: string(custom number)
any: uint64(1)
scalar: uint64(1)
Suggested fix: build the composite converters from a TTConvFactory value, e.g. free functions MakeAnyConverter(fac TTConvFactory[string]) used by GetConverterByType, so overrides apply. If the API should stay as it is, document the limitation in the README.
- Lenguaje dominante
- Go
- Estrellas
- 1
- Forks
- 0
- Merge medio
- 1 h 43 min
- PR fusionados (30 d)
- 2
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de tarantool/go-tupleconv
-
build issue code health
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
tarantool/go-tupleconv#27 ·
-
code health
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
tarantool/go-tupleconv#26 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
tarantool/go-tupleconv#25 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
tarantool/go-tupleconv#23 ·
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
tarantool/go-tupleconv#22 ·
Todos los issues de tarantool/go-tupleconv
Issues similares
-
agent-research-finding chore
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
jordansmall/spindrift#7370 ·
Los mantenedores suelen responder en 1 día
-
☢️ Bug v3
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
The repo's gates check is clean and runs need no swapsPosiblemente ocupada @turbot-agent-fleet la tomó hoy. Abiertoagent:ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
turbot/tailpipe#677 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
needs-kind needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
crossplane-contrib/provider-keycloak#806 ·
Los mantenedores suelen responder en 1 día