mirror of
https://github.com/ggicci/httpin.git
synced 2024-11-24 08:32:45 +02:00
* use rtm.Directive.Argv
This commit is contained in:
parent
e776224900
commit
ac0357ca6c
@ -2,7 +2,7 @@ package core
|
||||
|
||||
import (
|
||||
"github.com/ggicci/httpin/internal"
|
||||
"strings"
|
||||
"slices"
|
||||
)
|
||||
|
||||
type FormEncoder struct {
|
||||
@ -10,8 +10,7 @@ type FormEncoder struct {
|
||||
}
|
||||
|
||||
func (e *FormEncoder) Execute(rtm *DirectiveRuntime) error {
|
||||
tag := rtm.Resolver.Field.Tag.Get("in")
|
||||
if rtm.Value.IsZero() && strings.Contains(tag, "omitempty") {
|
||||
if rtm.Value.IsZero() && slices.Contains(rtm.Directive.Argv, "omitempty") {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user