package pflag

import (
	
	
	
)

// -- float64Slice Value
type float64SliceValue struct {
	value   *[]float64
	changed bool
}

func newFloat64SliceValue( []float64,  *[]float64) *float64SliceValue {
	 := new(float64SliceValue)
	.value = 
	*.value = 
	return 
}

func ( *float64SliceValue) ( string) error {
	 := strings.Split(, ",")
	 := make([]float64, len())
	for ,  := range  {
		var  error
		[],  = strconv.ParseFloat(, 64)
		if  != nil {
			return 
		}

	}
	if !.changed {
		*.value = 
	} else {
		*.value = append(*.value, ...)
	}
	.changed = true
	return nil
}

func ( *float64SliceValue) () string {
	return "float64Slice"
}

func ( *float64SliceValue) () string {
	 := make([]string, len(*.value))
	for ,  := range *.value {
		[] = fmt.Sprintf("%f", )
	}
	return "[" + strings.Join(, ",") + "]"
}

func ( *float64SliceValue) ( string) (float64, error) {
	return strconv.ParseFloat(, 64)
}

func ( *float64SliceValue) ( float64) string {
	return fmt.Sprintf("%f", )
}

func ( *float64SliceValue) ( string) error {
	,  := .fromString()
	if  != nil {
		return 
	}
	*.value = append(*.value, )
	return nil
}

func ( *float64SliceValue) ( []string) error {
	 := make([]float64, len())
	for ,  := range  {
		var  error
		[],  = .fromString()
		if  != nil {
			return 
		}
	}
	*.value = 
	return nil
}

func ( *float64SliceValue) () []string {
	 := make([]string, len(*.value))
	for ,  := range *.value {
		[] = .toString()
	}
	return 
}

func float64SliceConv( string) (interface{}, error) {
	 = strings.Trim(, "[]")
	// Empty string would cause a slice with one (empty) entry
	if len() == 0 {
		return []float64{}, nil
	}
	 := strings.Split(, ",")
	 := make([]float64, len())
	for ,  := range  {
		var  error
		[],  = strconv.ParseFloat(, 64)
		if  != nil {
			return nil, 
		}

	}
	return , nil
}

// GetFloat64Slice return the []float64 value of a flag with the given name
func ( *FlagSet) ( string) ([]float64, error) {
	,  := .getFlagType(, "float64Slice", float64SliceConv)
	if  != nil {
		return []float64{}, 
	}
	return .([]float64), nil
}

// Float64SliceVar defines a float64Slice flag with specified name, default value, and usage string.
// The argument p points to a []float64 variable in which to store the value of the flag.
func ( *FlagSet) ( *[]float64,  string,  []float64,  string) {
	.VarP(newFloat64SliceValue(, ), , "", )
}

// Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash.
func ( *FlagSet) ( *[]float64, ,  string,  []float64,  string) {
	.VarP(newFloat64SliceValue(, ), , , )
}

// Float64SliceVar defines a float64[] flag with specified name, default value, and usage string.
// The argument p points to a float64[] variable in which to store the value of the flag.
func ( *[]float64,  string,  []float64,  string) {
	CommandLine.VarP(newFloat64SliceValue(, ), , "", )
}

// Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash.
func ( *[]float64, ,  string,  []float64,  string) {
	CommandLine.VarP(newFloat64SliceValue(, ), , , )
}

// Float64Slice defines a []float64 flag with specified name, default value, and usage string.
// The return value is the address of a []float64 variable that stores the value of the flag.
func ( *FlagSet) ( string,  []float64,  string) *[]float64 {
	 := []float64{}
	.Float64SliceVarP(&, , "", , )
	return &
}

// Float64SliceP is like Float64Slice, but accepts a shorthand letter that can be used after a single dash.
func ( *FlagSet) (,  string,  []float64,  string) *[]float64 {
	 := []float64{}
	.Float64SliceVarP(&, , , , )
	return &
}

// Float64Slice defines a []float64 flag with specified name, default value, and usage string.
// The return value is the address of a []float64 variable that stores the value of the flag.
func ( string,  []float64,  string) *[]float64 {
	return CommandLine.Float64SliceP(, "", , )
}

// Float64SliceP is like Float64Slice, but accepts a shorthand letter that can be used after a single dash.
func (,  string,  []float64,  string) *[]float64 {
	return CommandLine.Float64SliceP(, , , )
}