func CommonEnvironmentClient() *DatabricksClient {
	if commonClient != nil {
		return commonClient
	}
	onceClient.Do(func() {
		commonClient = NewClientFromEnvironment()
	})
	return commonClient
}
CommonEnvironmentClient configured once per run of application
package common
import (
	"log"
	"os"
	"reflect"
	"strconv"
	"strings"
	"sync"
	"github.com/mitchellh/go-homedir"
)
var (
	envMutex     sync.Mutex
	onceClient   sync.Once
	commonClient *DatabricksClient
)
func NewClientFromEnvironment() *DatabricksClient {
	client := DatabricksClient{}
	for _, attr := range ClientAttributes() {
		found := false
		var value interface{}
		for _, envName := range attr.EnvVars {
			v := os.Getenv(envName)
			if v == "" {
				continue
			}
			switch attr.Kind {
			case reflect.String:
				value = v
				found = true
			case reflect.Bool:
				if vv, err := strconv.ParseBool(v); err == nil {
					value = vv
					found = true
				}
			case reflect.Int:
				if vv, err := strconv.Atoi(v); err == nil {
					value = vv
					found = true
				}
			default:
				continue
			}
		}
		if found {
			attr.Set(&client, value)
		}
	}
	err := client.Configure()
	if err != nil {
		panic(err)
	}
	return &client
}
func ResetCommonEnvironmentClient() {
	commonClient = nil
	onceClient = sync.Once{}
}