Skip to content

fix: define UserResponse struct and update handler to use it#9

Merged
filipe1309 merged 3 commits into
mainfrom
fix/user-response
Sep 29, 2025
Merged

fix: define UserResponse struct and update handler to use it#9
filipe1309 merged 3 commits into
mainfrom
fix/user-response

Conversation

@filipe1309

Copy link
Copy Markdown
Contributor

This pull request introduces a new UserResponse struct to standardize user data returned by the API handler. The handler now uses this struct for its response instead of a generic type, improving clarity and type safety.

API response improvements:

  • Added a UserResponse struct to cmd/api/main.go to define the expected fields (ID, Email, Name) in user-related API responses.
  • Updated the API handler in cmd/api/main.go to unmarshal and return responses using the new UserResponse struct instead of a generic type.

@filipe1309 filipe1309 requested a review from Copilot September 29, 2025 01:27
@filipe1309 filipe1309 self-assigned this Sep 29, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a structured UserResponse type to replace generic types in API responses, improving type safety and API contract clarity. The change standardizes the user data format returned by the handler.

  • Added UserResponse struct with clearly defined fields for user data
  • Updated handler to use the new struct instead of generic any type

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread cmd/api/main.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 29, 2025

Copy link
Copy Markdown

📊 Test Coverage Report

Status: ✅ PASSED
Result: Coverage requirements met

🎯 Coverage Details:

"Total coverage threshold (80%) satisfied:\tPASS\nTotal test coverage: 98.5% (66/67)\n"

📋 Coverage Requirements:

  • Minimum Threshold: 80%
  • Coverage Profile: ./cover.out
  • Coverage Mode: atomic

🔧 Test Configuration:

  • Go Version: go version go1.25.1 linux/amd64
  • Race Detection: enabled
  • Timeout: 2 minutes
  • Test Packages: ./...

@filipe1309 filipe1309 merged commit 34bd9de into main Sep 29, 2025
4 checks passed
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