sethvargo/go-envconfig

Magic characters when decoding URLs

stephenafamo opened this issue · 4 comments

Not sure why, but URLs are not being decoded properly.

The url.URL type implements the BinaryUnmarshaler interface (https://golang.org/pkg/net/url/#URL.UnmarshalBinary)

However, when used in a config struct, the unmarshaling adds an @ see this (https://play.golang.org/p/VrZDD85bR6j)

That's... interesting. The @ symbol doesn't actually appear in any Go files, so this should be fun to debug...

Hmm okay, so the @ is appearing because during marshal/unmarshal, "User" is being set to a value somehow...

              	Field: url.URL{
              		Scheme: "http",
              		Opaque: "",
            - 		User:   nil,
            + 		User:   s"",
              		Host:   "simple.test",
              		Path:   "/",
              		... // 4 identical fields
              	},
              }

Works now. Great work.

This issue has been automatically locked since there has not been any
recent activity after it was closed. Please open a new issue for
related bugs.