Skip to content

Commit

Permalink
supported reading strings into []byte
Browse files Browse the repository at this point in the history
  • Loading branch information
kaatinga committed Aug 21, 2024
1 parent d459a41 commit c65895d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions env.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package settings

import (
"fmt"
"os"
"reflect"
"strconv"
Expand Down Expand Up @@ -77,6 +78,7 @@ func Load(settings interface{}) error {
case reflect.Slice:
// we only support slice of bytes
if engine.Field.value.Type().Elem().Kind() != reflect.Uint8 {
fmt.Println("ops slice")
return unsupportedFieldError(engine.Field.envTag)
}
engine.Field.value.SetBytes([]byte(engine.Field.envValue))
Expand Down

0 comments on commit c65895d

Please sign in to comment.