Refactor codebase to use value parameters instead of pointers where appropriate
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Many methods in the codebase, such as:
func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo string, release *RepositoryRelease) (*RepositoryRelease, *Response, error)
use pointer parameters (e.g. *RepositoryRelease) even when the function doesn't mutate the input. This appears to be a result of convention or copy-paste, not a performance-driven choice.
For instance, in CreateRelease, the RepositoryRelease struct is relatively large (~15+ fields), but most of its fields are pointers themselves. As such, passing it by value would have negligible performance impact in typical API usage. Moreover, value semantics would improve clarity, especially for required arguments that aren't modified.
To improve API design consistency and safety, we should:
-
Audit method signatures that accept pointer structs as input
-
Change them to accept values when:
-
The input is required (not optional)
-
The function does not modify the input
-
-
Optionally introduce dedicated input structs for specific operations (e.g.
CreateRepositoryReleasewith only the fields needed for creation)
Note: This would be a breaking change and should be handled carefully, possibly across multiple PRs.
Originally posted by @gmlewis in https://github.com/google/go-github/pull/3636#discussion_r2228429223
- Lenguaje dominante
- Go
- Estrellas
- 11.3k
- Forks
- 2.6k
- Merge medio
- 2 d 19 h
- PR fusionados (30 d)
- 36
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
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 google/go-github
-
Add support for stargazer count and history endpointsPosiblemente ocupada @ninadsutrave la tomó hace 1 día. Abierto
google/go-github#4610 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
http.Client.Timeout is ignored by redirect-aware requestsPosiblemente ocupada @sb123sb123 la tomó hace 21 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Add Copilot content exclusion set/get enterprise and org set endpointsPosiblemente ocupada @Tens1des la tomó hace 35 días. Abierto
google/go-github#4526 · 1 comentario · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Add Copilot custom agents enterprise endpointsPosiblemente ocupada @Tens1des la tomó hace 35 días. Abierto
google/go-github#4524 · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Repository ruleset rule type `code_quality` is not modelledPosiblemente ocupada @etifontaine la tomó hace 38 días. Abierto
google/go-github#4520 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de google/go-github
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
SocialGouv/iterion#2369 ·
Los mantenedores suelen responder en 1 día
-
area/ci bug priority/p3
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
📖 docs: Docker Compose quick start doesn't mention editing the project values in src/hive.yamlAbiertodocumentation help wanted needs-triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 75/100
hivecommons/hive#11606 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[docs] `/docs/identity-security/usage/alerts/`: docs reference a date that has already passedAbiertodocumentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
gravitational/teleport#69869 ·
-
category:agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
LanternOps/breeze#8493 ·
Los mantenedores suelen responder en 1 día