Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@yccodr
Copy link
Contributor

@yccodr yccodr commented Jul 23, 2025

Config.Validate() does not always return error with type govalidator.Errors.

Example

# ...

  plmnList:
  - mcc: "208 " # <-- trailing whitespace
    mnc: "93 " # <-- trailing whitespace

#...

Config.Validate() returns type *errors.errorString but ReadConfig() crashes because of wrong type assertion in pkg/factory/factory.go:64.

Solution

To fix this problem, I added type switches and remains original behavior with type govalidator.Errors. Other type of error, print error message with Error() in native Error interface.

Copy link
Contributor

@Alonza0314 Alonza0314 left a comment

Choose a reason for hiding this comment

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

LGTM

@Alonza0314 Alonza0314 requested a review from ianchen0119 July 31, 2025 09:14
@ianchen0119 ianchen0119 merged commit 670ffc6 into free5gc:main Jul 31, 2025
3 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