github.com/thlcodes/genfig@v0.3.2-alpha/example/config/init.go (about)

     1  // Code generated by genfig; DO NOT EDIT.
     2  
     3  package config
     4  
     5  import (
     6  	"fmt"
     7  	"os"
     8  )
     9  
    10  var (
    11  	_ = os.Getenv
    12  	_ = fmt.Printf
    13  )
    14  
    15  // Current is the current config, selected by the curren env and
    16  // updated by the availalbe env vars
    17  var Current *Config
    18  
    19  // This init tries to retrieve the current environment via the
    20  // common env var 'ENV' and applies activated plugins
    21  func init() {
    22  	Current, _ = Get(os.Getenv("ENV"))
    23  
    24  	if errs := Current.UpdateFromEnv(); errs != nil {
    25  		fmt.Println(errs)
    26  	}
    27  
    28  	Current.Substitute()
    29  
    30  }