@ -24,16 +24,16 @@ func loadConfigV1() (*configV1, error) {
if _ , err = os . Stat ( configFile ) ; err != nil {
if _ , err = os . Stat ( configFile ) ; err != nil {
return nil , err
return nil , err
}
}
a := & configV1 { }
c := & configV1 { }
a . Version = "1"
c . Version = "1"
qc , err := quick . New ( a )
qc , err := quick . New ( c )
if err != nil {
if err != nil {
return nil , err
return nil , err
}
}
if err := qc . Load ( configFile ) ; err != nil {
if err := qc . Load ( configFile ) ; err != nil {
return nil , err
return nil , err
}
}
return q c. Data ( ) . ( * configV1 ) , nil
return c , nil
}
}
/////////////////// Config V2 ///////////////////
/////////////////// Config V2 ///////////////////
@ -67,16 +67,16 @@ func loadConfigV2() (*configV2, error) {
if _ , err = os . Stat ( configFile ) ; err != nil {
if _ , err = os . Stat ( configFile ) ; err != nil {
return nil , err
return nil , err
}
}
a := & configV2 { }
c := & configV2 { }
a . Version = "2"
c . Version = "2"
qc , err := quick . New ( a )
qc , err := quick . New ( c )
if err != nil {
if err != nil {
return nil , err
return nil , err
}
}
if err := qc . Load ( configFile ) ; err != nil {
if err := qc . Load ( configFile ) ; err != nil {
return nil , err
return nil , err
}
}
return q c. Data ( ) . ( * configV2 ) , nil
return c , nil
}
}
/////////////////// Config V3 ///////////////////
/////////////////// Config V3 ///////////////////
@ -134,14 +134,14 @@ func loadConfigV3() (*configV3, error) {
if _ , err = os . Stat ( configFile ) ; err != nil {
if _ , err = os . Stat ( configFile ) ; err != nil {
return nil , err
return nil , err
}
}
a := & configV3 { }
c := & configV3 { }
a . Version = "3"
c . Version = "3"
qc , err := quick . New ( a )
qc , err := quick . New ( c )
if err != nil {
if err != nil {
return nil , err
return nil , err
}
}
if err := qc . Load ( configFile ) ; err != nil {
if err := qc . Load ( configFile ) ; err != nil {
return nil , err
return nil , err
}
}
return q c. Data ( ) . ( * configV3 ) , nil
return c , nil
}
}