Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(decoder-configs): add flag to force decoding nil input in decoder config #42

Merged
merged 27 commits into from
Sep 20, 2024
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0c945d4
Add ForceDecoding Flag To Decoder Config
mahadzaryab1 Aug 24, 2024
045a4ff
Add Test Cases
mahadzaryab1 Aug 24, 2024
31e4de7
Fix Documentation
mahadzaryab1 Aug 24, 2024
6381ebf
Remove Extra Check
mahadzaryab1 Aug 24, 2024
f841385
Do Not Override Zero Fields Check
mahadzaryab1 Aug 24, 2024
7a6796a
Use Map As Input For Tests
mahadzaryab1 Aug 24, 2024
9ffa15f
Rename Flag And Simplify godoc
mahadzaryab1 Aug 24, 2024
57a5bba
Fix Test Name
mahadzaryab1 Aug 24, 2024
022e0dc
Fix Wording of godoc
mahadzaryab1 Aug 24, 2024
d0b44fb
Use interface{} Instead of map[string]interface{}
mahadzaryab1 Aug 24, 2024
ebd5641
Fix Test Case
mahadzaryab1 Aug 24, 2024
3a956c9
Fix Variable Name
mahadzaryab1 Aug 24, 2024
c20b1ab
Fix godoc
mahadzaryab1 Aug 24, 2024
04189fe
Address Feedback From PR Review
mahadzaryab1 Aug 26, 2024
8078296
Change Logic To Set InputVal And Not Erase OutputVal
mahadzaryab1 Aug 27, 2024
5a595df
Add Additional Test With Type Hook
mahadzaryab1 Aug 27, 2024
7072f97
Add Extra Test Case And Extract Bool Expression Into Variable
mahadzaryab1 Aug 27, 2024
1253cd5
Fix Typo
mahadzaryab1 Aug 27, 2024
5d56b9c
Add More Test Cases
mahadzaryab1 Aug 27, 2024
72963fc
Rename Variable
mahadzaryab1 Aug 27, 2024
b0357fa
Fix Test Case
mahadzaryab1 Aug 27, 2024
30f2b22
Address Feedback From PR Review
mahadzaryab1 Aug 27, 2024
817e61e
Simplify Test Strings
mahadzaryab1 Aug 27, 2024
40f8be1
Use More Descriptive Test Name
mahadzaryab1 Aug 27, 2024
39ae1f1
Add Test Cases For Append Hook
mahadzaryab1 Sep 15, 2024
2ff30a1
Run Linter
mahadzaryab1 Sep 19, 2024
d1548f8
Remove Debug Statement
mahadzaryab1 Sep 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add Additional Test With Type Hook
  • Loading branch information
mahadzaryab1 committed Aug 27, 2024
commit 5a595dfaec200edf8eb8f168c09a6f54781045d4
9 changes: 9 additions & 0 deletions mapstructure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3106,6 +3106,15 @@ func TestDecoder_DecodeNil(t *testing.T) {
},
expectedResult: Transformed{Message: "hello world!"},
},
{
name: "decodeNil=true for nil input with DecodeHookFuncType hook",
decodeNil: true,
input: nil,
decodeHook: func(reflect.Type, reflect.Type, interface{}) (interface{}, error) {
return Transformed{Message: "hello world!"}, nil
},
expectedResult: Transformed{Message: "hello world!"},
},
{
name: "decodeNil=true for nil input without hook",
decodeNil: true,
Expand Down