Skip to content

Conversation

@hgiasac
Copy link
Collaborator

@hgiasac hgiasac commented Dec 25, 2025

This pull request removes all custom UnmarshalJSON implementations for environment variable types and map types, as well as associated unused imports. The codebase is now simplified and no longer provides custom JSON unmarshaling logic for these types.

Removal of custom JSON unmarshaling:

  • Removed UnmarshalJSON methods from EnvString, EnvInt, EnvBool, and EnvFloat types in environment.go. [1] [2] [3] [4]
  • Removed UnmarshalJSON methods from EnvAny in any.go.
  • Removed UnmarshalJSON methods from EnvMapString, EnvMapInt, EnvMapFloat, and EnvMapBool types in map.go. [1] [2] [3] [4]

Cleanup of unused imports:

  • Removed unused "encoding/json" imports from environment.go and map.go. [1] [2]

Copy link

Copilot AI left a comment

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 adds slice-type environment variable support (EnvStringSlice, EnvIntSlice, EnvFloatSlice, EnvBoolSlice) with associated constructor functions, methods (Get, GetCustom, IsZero, Equal), and comprehensive test coverage. While the PR description focuses on removing custom UnmarshalJSON implementations, the actual changes introduce new slice functionality.

  • Implements four new slice environment variable types with full CRUD operations
  • Adds comprehensive test coverage for all slice types including edge cases
  • Note: The PR description mentions removing UnmarshalJSON implementations, but the actual changes primarily add new slice types

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
slice.go Introduces EnvStringSlice, EnvIntSlice, EnvFloatSlice, and EnvBoolSlice types with Get, GetCustom, IsZero, and Equal methods
slice_test.go Adds comprehensive test coverage for all slice types testing Get, GetCustom, IsZero, and Equal methods
environment.go Removes custom UnmarshalJSON implementations and encoding/json import from EnvString, EnvInt, EnvBool, and EnvFloat types
map.go Removes custom UnmarshalJSON implementations and encoding/json import from EnvMapString, EnvMapInt, EnvMapFloat, and EnvMapBool types
any.go Removes custom UnmarshalJSON implementation from EnvAny type

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hgiasac hgiasac merged commit 22cb349 into main Dec 25, 2025
1 check passed
@hgiasac hgiasac deleted the feat/add-slice-env branch December 25, 2025 05:08
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.

1 participant