func LoadArgs(args string, container interface{}) error {
	if args == "" {
		return nil
	}
	containerValue := reflect.ValueOf(container)
	pairs := strings.Split(args, ";")
	unknownArgs := []string{}
	for _, pair := range pairs {
		kv := strings.Split(pair, "=")
		if len(kv) != 2 {
			return fmt.Errorf("ARGS: invalid pair %q", pair)
		}
		keyString := kv[0]
		valueString := kv[1]
		keyField := GetKeyField(keyString, containerValue)
		if !keyField.IsValid() {
			unknownArgs = append(unknownArgs, pair)
			continue
		}
		u := keyField.Addr().Interface().(encoding.TextUnmarshaler)
		err := u.UnmarshalText([]byte(valueString))
		if err != nil {
			return fmt.Errorf("ARGS: error parsing value of pair %q: %v)", pair, err)
		}
	}
	isIgnoreUnknown := GetKeyField("IgnoreUnknown", containerValue).Bool()
	if len(unknownArgs) > 0 && !isIgnoreUnknown {
		return fmt.Errorf("ARGS: unknown args %q", unknownArgs)
	}
	return nil
}
LoadArgs parses args from a string in the form "K=V;K2=V2;..."
package types
import (
	"encoding"
	"fmt"
	"reflect"
	"strings"
)
type UnmarshallableBool bool
func (b *UnmarshallableBool) UnmarshalText(data []byte) error {
	s := strings.ToLower(string(data))
	switch s {
	case "1", "true":
		*b = true
	case "0", "false":
		*b = false
	default:
		return fmt.Errorf("Boolean unmarshal error: invalid input %s", s)
	}
	return nil
}
type UnmarshallableString string
func (s *UnmarshallableString) UnmarshalText(data []byte) error {
	*s = UnmarshallableString(data)
	return nil
}
type CommonArgs struct {
	IgnoreUnknown UnmarshallableBool `json:"ignoreunknown,omitempty"`
}
func GetKeyField(keyString string, v reflect.Value) reflect.Value {
	return v.Elem().FieldByName(keyString)
}