@@ -45,6 +45,7 @@ type Specification struct {
4545 AdminUsers []string
4646 MagicNumbers []int
4747 EmptyNumbers []int
48+ ByteSlice []byte
4849 ColorCodes map [string ]int
4950 MultiWordVar string
5051 MultiWordVarWithAutoSplit uint32 `split_words:"true"`
@@ -96,6 +97,7 @@ func TestProcess(t *testing.T) {
9697 os .Setenv ("ENV_CONFIG_ADMINUSERS" , "John,Adam,Will" )
9798 os .Setenv ("ENV_CONFIG_MAGICNUMBERS" , "5,10,20" )
9899 os .Setenv ("ENV_CONFIG_EMPTYNUMBERS" , "" )
100+ os .Setenv ("ENV_CONFIG_BYTESLICE" , "this is a test value" )
99101 os .Setenv ("ENV_CONFIG_COLORCODES" , "red:1,green:2,blue:3" )
100102 os .Setenv ("SERVICE_HOST" , "127.0.0.1" )
101103 os .Setenv ("ENV_CONFIG_TTL" , "30" )
@@ -152,6 +154,10 @@ func TestProcess(t *testing.T) {
152154 if len (s .EmptyNumbers ) != 0 {
153155 t .Errorf ("expected %#v, got %#v" , []int {}, s .EmptyNumbers )
154156 }
157+ expected := "this is a test value"
158+ if string (s .ByteSlice ) != expected {
159+ t .Errorf ("expected %v, got %v" , expected , string (s .ByteSlice ))
160+ }
155161 if s .Ignored != "" {
156162 t .Errorf ("expected empty string, got %#v" , s .Ignored )
157163 }
0 commit comments