1
0
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:
Alec Sammon 2024-05-18 10:00:42 +01:00
parent e776224900
commit ac0357ca6c
No known key found for this signature in database

View File

@ -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
}