Skip to content

Fix go vet warnings#329

Closed
jfberry wants to merge 2 commits intomainfrom
fix/go-vet-warnings
Closed

Fix go vet warnings#329
jfberry wants to merge 2 commits intomainfrom
fix/go-vet-warnings

Conversation

@jfberry
Copy link
Collaborator

@jfberry jfberry commented Jan 11, 2026

  • webhooks_test.go: Use t.Errorf instead of t.Fatalf in goroutine
  • decoder/pokemon.go: Add keyed field for s2.Point struct literal
  • decoder: Change pokemonCache to store *Pokemon to avoid copying mutex embedded in protobuf MessageState
  • Add peekPokemonFromCache for read-only access (no copy)
  • getPokemonFromCache returns a copy for change detection semantics
  • Use peekPokemonFromCache in savePokemonRecordAsAtTime for oldPokemon comparison (optimization from pokemon_less_gc branch)

jfberry and others added 2 commits January 27, 2026 18:08
- webhooks_test.go: Use t.Errorf instead of t.Fatalf in goroutine
- decoder/pokemon.go: Add keyed field for s2.Point struct literal
- decoder: Change pokemonCache to store *Pokemon to avoid copying
  mutex embedded in protobuf MessageState
- Add peekPokemonFromCache for read-only access (no copy)
- getPokemonFromCache returns a copy for change detection semantics
- Use peekPokemonFromCache in savePokemonRecordAsAtTime for oldPokemon
  comparison (optimization from pokemon_less_gc branch)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace grpc.PokemonInternal with a native PokemonInternalNative struct
that can be safely copied without mutex issues. The protobuf types contain
embedded sync.Mutex via protoimpl.MessageState which causes go vet warnings
when the Pokemon struct is copied.

- Add PokemonScanNative and PokemonInternalNative types in decoder package
- Add ToProto/FromProto conversion functions for serialization
- Update all internal usages to use native types
- Protobuf is now only used at DB serialization boundaries

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Fabio1988 Fabio1988 force-pushed the fix/go-vet-warnings branch from 4f13d62 to 508b113 Compare January 27, 2026 17:08
@jfberry
Copy link
Collaborator Author

jfberry commented Jan 31, 2026

Alternative approach implemented in #332, there may still be an argument for moving away from protobuf in the pokemon object but it's not to reduce vet problems any longer

@jfberry jfberry closed this Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants