Skip to content
Discussion options

You must be logged in to vote

it just works, don't need to escape:

func TestIssue369(t *testing.T) {
	t.Setenv("MAP", "s1:foo:9123,s3:bar:3333,s2:zaz:9999")

	type Config struct {
		Map map[string]string `env:"MAP"`
	}

	var cfg Config
	isNoErr(t, Parse(&cfg))
	isEqual(t, map[string]string{
		"s1": "foo:9123",
		"s2": "zaz:9999",
		"s3": "bar:3333",
	}, cfg.Map)
}

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@adhi-goel
Comment options

Comment options

You must be logged in to vote
3 replies
@adhi-goel
Comment options

@caarlos0
Comment options

@adhi-goel
Comment options

Answer selected by adhi-goel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants