Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
demdxx committed Jan 28, 2024
1 parent 4da8dc1 commit b4314c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion struct_walker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestStructWalk(t *testing.T) {
V2 int `env:"TEST_V2"`
}{}

StructWalk(ctx, &testStruct, func(ctx context.Context, curObj StructWalkObject, field StructWalkField, path []string) error {
err := StructWalk(ctx, &testStruct, func(ctx context.Context, curObj StructWalkObject, field StructWalkField, path []string) error {
assert.True(t, field.IsEmpty())
err := field.SetValue(ctx, os.Getenv(field.Tag("env")))
if assert.NoError(t, err, `set value for field "%s"`, field.Name()) {
Expand All @@ -51,6 +51,7 @@ func TestStructWalk(t *testing.T) {
}
return err
})
assert.Error(t, err)
})

t.Run("init.nested", func(t *testing.T) {
Expand Down

0 comments on commit b4314c6

Please sign in to comment.