func (ci *Item) LoadValue() error {
	ci.LastLoad = time.Now()

	if len(ci.Shortflag) > 0 || len(ci.Longflag) > 0 {
		if flag.Parsed() == false {
			return deeperror.New(1254443215, "flag.Parsed == false.  cannot load value with unparsed flags", nil)
		}

		if len(ci.Longflag) > 0 && ci.cli_flag_long_string_ptr != nil {
			ci.set_raw_value(*ci.cli_flag_long_string_ptr, LongFlag)
			return nil
		}

		if len(ci.Shortflag) > 0 && ci.cli_flag_short_string_ptr != nil {
			ci.set_raw_value(*ci.cli_flag_short_string_ptr, ShortFlag)
			return nil
		}

	}

	if len(ci.ENV_VAR_NAME) > 0 {

		candidate_value, value_exists := os.LookupEnv(ci.ENV_VAR_NAME)

		if value_exists {
			// we are good here.  set our raw value and move on.
			ci.set_raw_value(candidate_value, EnvVar)
			return nil
		}
		// if value_exists == false, then fall thru and move along
	}

	if ci.FileContentsPathLongFlag != "" ||
		ci.FileContentsPathShortFlag != "" {
		if flag.Parsed() == false {
			return deeperror.New(1143790062, "flag.Parsed == false.  cannot load value with unparsed flags", nil)
		}

		if ci.FileContentsPathLongFlag != "" && ci.file_contents_long_string_ptr != nil {
			filepath := *ci.file_contents_long_string_ptr
			raw_bytes, err := ioutil.ReadFile(filepath)
			if err != nil {
				// ignore? log?
			} else {
				ci.set_raw_value(string(raw_bytes), FileContentsLongFlag)
				return nil
			}
		}

		if ci.FileContentsPathShortFlag != "" && ci.file_contents_short_string_ptr != nil {
			filepath := *ci.file_contents_short_string_ptr
			raw_bytes, err := ioutil.ReadFile(filepath)
			if err != nil {
				// ignore? log?
			} else {
				ci.set_raw_value(string(raw_bytes), FileContentsShortFlag)
				return nil
			}
		}

	}

	if ci.FileContentsDefaultPath != "" {
		filepath := ci.FileContentsDefaultPath
		raw_bytes, err := ioutil.ReadFile(filepath)
		if err != nil {
			// ignore? log?
		} else {
			ci.set_raw_value(string(raw_bytes), FileContentsDefaultLocation)
			return nil
		}
	}

	// TODO: other methods

	// if we get here then that means none of the above worked...

	if ci.ENV_VAR_NAME == "" &&
		ci.Shortflag == "" &&
		ci.Longflag == "" &&
		ci.Json_key == "" {
		// item is misconfigured.  you need to set at least one of them
		return deeperror.New(2021170454, "Misconfigured covargo item.  No method to load configuration variable specified", nil)
	}

	// unable to load config variable.  for now, users must rely on the default variable
	return nil
}
// load the raw value from cli flag, env var, file, etc.
// returns true if
load the raw value from cli flag, env var, file, etc.
returns true if
// load the raw value from cli flag env var file etc . // returns true if
func (ci *Item) LoadValue() error {
	ci.LastLoad = time.Now()
	if len(ci.Shortflag) > 0 || len(ci.Longflag) > 0 {
		if flag.Parsed() == false {
			return deeperror.New(1254443215, "flag.Parsed == false.  cannot load value with unparsed flags", nil)
		}
		if len(ci.Longflag) > 0 && ci.cli_flag_long_string_ptr != nil {
			ci.set_raw_value(*ci.cli_flag_long_string_ptr, LongFlag)
			return nil
		}
		if len(ci.Shortflag) > 0 && ci.cli_flag_short_string_ptr != nil {
			ci.set_raw_value(*ci.cli_flag_short_string_ptr, ShortFlag)
			return nil
		}
	}
	if len(ci.ENV_VAR_NAME) > 0 {
		candidate_value, value_exists := os.LookupEnv(ci.ENV_VAR_NAME)
		if value_exists {
			ci.set_raw_value(candidate_value, EnvVar)
			return nil
		}
	}
	if ci.FileContentsPathLongFlag != "" ||
		ci.FileContentsPathShortFlag != "" {
		if flag.Parsed() == false {
			return deeperror.New(1143790062, "flag.Parsed == false.  cannot load value with unparsed flags", nil)
		}
		if ci.FileContentsPathLongFlag != "" && ci.file_contents_long_string_ptr != nil {
			filepath := *ci.file_contents_long_string_ptr
			raw_bytes, err := ioutil.ReadFile(filepath)
			if err != nil {
			} else {
				ci.set_raw_value(string(raw_bytes), FileContentsLongFlag)
				return nil
			}
		}
		if ci.FileContentsPathShortFlag != "" && ci.file_contents_short_string_ptr != nil {
			filepath := *ci.file_contents_short_string_ptr
			raw_bytes, err := ioutil.ReadFile(filepath)
			if err != nil {
			} else {
				ci.set_raw_value(string(raw_bytes), FileContentsShortFlag)
				return nil
			}
		}
	}
	if ci.FileContentsDefaultPath != "" {
		filepath := ci.FileContentsDefaultPath
		raw_bytes, err := ioutil.ReadFile(filepath)
		if err != nil {
		} else {
			ci.set_raw_value(string(raw_bytes), FileContentsDefaultLocation)
			return nil
		}
	}
	if ci.ENV_VAR_NAME == "" &&
		ci.Shortflag == "" &&
		ci.Longflag == "" &&
		ci.Json_key == "" {
		return deeperror.New(2021170454, "Misconfigured covargo item.  No method to load configuration variable specified", nil)
	}
	return nil
}
func ( ci * Item ) LoadValue ( ) error { ci . LastLoad = time . Now ( ) if len ( ci . Shortflag ) > 0 || len ( ci . Longflag ) > 0 { if flag . Parsed ( ) == false { return deeperror . New ( 1254443215 , " " , nil ) } if len ( ci . Longflag ) > 0 && ci . cli_flag_long_string_ptr != nil { ci . set_raw_value ( * ci . cli_flag_long_string_ptr , LongFlag ) return nil } if len ( ci . Shortflag ) > 0 && ci . cli_flag_short_string_ptr != nil { ci . set_raw_value ( * ci . cli_flag_short_string_ptr , ShortFlag ) return nil } } if len ( ci . ENV_VAR_NAME ) > 0 { candidate_value , value_exists := os . LookupEnv ( ci . ENV_VAR_NAME ) if value_exists { ci . set_raw_value ( candidate_value , EnvVar ) return nil } } if ci . FileContentsPathLongFlag != " " || ci . FileContentsPathShortFlag != " " { if flag . Parsed ( ) == false { return deeperror . New ( 1143790062 , " " , nil ) } if ci . FileContentsPathLongFlag != " " && ci . file_contents_long_string_ptr != nil { filepath := * ci . file_contents_long_string_ptr raw_bytes , err := ioutil . ReadFile ( filepath ) if err != nil { } else { ci . set_raw_value ( string ( raw_bytes ) , FileContentsLongFlag ) return nil } } if ci . FileContentsPathShortFlag != " " && ci . file_contents_short_string_ptr != nil { filepath := * ci . file_contents_short_string_ptr raw_bytes , err := ioutil . ReadFile ( filepath ) if err != nil { } else { ci . set_raw_value ( string ( raw_bytes ) , FileContentsShortFlag ) return nil } } } if ci . FileContentsDefaultPath != " " { filepath := ci . FileContentsDefaultPath raw_bytes , err := ioutil . ReadFile ( filepath ) if err != nil { } else { ci . set_raw_value ( string ( raw_bytes ) , FileContentsDefaultLocation ) return nil } } if ci . ENV_VAR_NAME == " " && ci . Shortflag == " " && ci . Longflag == " " && ci . Json_key == " " { return deeperror . New ( 2021170454 , " " , nil ) } return nil }
load the raw value from cli flag, env var, file, etc.
load the raw value from cli flag env var file etc .
// we are good here.  set our raw value and move on. // if value_exists == false, then fall thru and move along // ignore? log? // ignore? log? // ignore? log? // TODO: other methods // if we get here then that means none of the above worked... // item is misconfigured.  you need to set at least one of them // unable to load config variable.  for now, users must rely on the default variable