github.com/go-playground/pkg/v5@v5.29.1/net/url/helpers.go (about)

     1  package urlext
     2  
     3  import (
     4  	"net/url"
     5  
     6  	httpext "github.com/go-playground/pkg/v5/net/http"
     7  )
     8  
     9  // EncodeToURLValues encodes a struct or field into a set of url.Values
    10  func EncodeToURLValues(v interface{}) (url.Values, error) {
    11  	return httpext.DefaultFormEncoder.Encode(v)
    12  }