Skip to content

Commit

Permalink
* use rtm.Directive.Argv
Browse files Browse the repository at this point in the history
  • Loading branch information
alecsammon committed May 18, 2024
1 parent e776224 commit ac0357c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/formencoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ package core

import (
"github.com/ggicci/httpin/internal"
"strings"
"slices"

Check failure on line 5 in core/formencoder.go

View workflow job for this annotation

GitHub Actions / test

package slices is not in GOROOT (/opt/hostedtoolcache/go/1.20.14/x64/src/slices)
)

type FormEncoder struct {
Setter func(key string, value []string) // form value setter
}

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
}

Expand Down

0 comments on commit ac0357c

Please sign in to comment.