func Map(m map[string]string) Option {
	return Looker(func(k string) (*string, error) {
		if v, ok := m[k]; ok {
			return &v, nil
		}
		return nil, nil
	})
}
Map configures Unmarshal to use the given map for environment lookups.
package fromenv
import (
	"errors"
	"fmt"
	"os"
	"reflect"
	"strconv"
	"strings"
)
type unmarshalError struct {
	err    error
	cursor *cursor
}
func (e *unmarshalError) Error() string {
	return fmt.Sprintf("%s: field %v (%v) in struct %v", e.err.Error(),
		e.cursor.field.Name, e.cursor.value.Kind().String(), e.cursor.structType.Name())
}
func Unmarshal(in interface{}, options ...Option) error {
	if !isStructPtr(in) {
		return errors.New("passed non-pointer or nil pointer")
	}
	config := &config{
		looker: osLookup,
	}
	for _, option := range options {
		option(config)
	}
	return visit(in, func(c *cursor) error {
		key, defval := parseTag(c)
		if len(key) == 0 {
			return nil
		}
		val, err := config.looker(key)
		if err != nil {
			return &unmarshalError{err, c}
		}
		if val == nil {
			if defval == nil {
				return nil
			}
			val = defval
		}
		err = setValue(config, c.value, *val)
		if err != nil {
			return &unmarshalError{err, c}
		}
		return nil
	})
}
type LookupEnvFunc func(key string) (value *string, err error)
func Looker(f LookupEnvFunc) Option {
	return func(c *config) {
		c.looker = f
	}
}