Skip to content

Commit dde5f2f

Browse files
committed
conifg: extract static Unmarshal function
1 parent 5ddb888 commit dde5f2f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

config/config.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func initConfig(c *Configuration) {
111111
//
112112
// Otherwise, the field will be set to the value of calling the
113113
// appropriately-typed method on the specified environment.
114-
func (c *Configuration) Unmarshal(v interface{}) error {
114+
func Unmarshal(git, os Enviornment, v interface{}) error {
115115
into := reflect.ValueOf(v)
116116
if into.Kind() != reflect.Ptr {
117117
return fmt.Errorf("lfs/config: unable to parse non-pointer type of %T", v)
@@ -153,6 +153,10 @@ func (c *Configuration) Unmarshal(v interface{}) error {
153153
return nil
154154
}
155155

156+
func (c *Configuration) Unmarshal(v interface{}) error {
157+
return Unmarshal(c.Git, c.Os, v)
158+
}
159+
156160
var (
157161
tagRe = regexp.MustCompile("((\\w+:\"[^\"]*\")\\b?)+")
158162
emptyEnv = EnvironmentOf(MapFetcher(nil))

0 commit comments

Comments
 (0)