package pflag

import (
	
	
	
)

// -- float32Slice Value
type float32SliceValue struct {
	value   *[]float32
	changed bool
}

func newFloat32SliceValue( []float32,  *[]float32) *float32SliceValue {
	 := new(float32SliceValue)
	.value = 
	*.value = 
	return 
}

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

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

func ( *float32SliceValue) () string {
	return "float32Slice"
}

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

func ( *float32SliceValue) ( string) (float32, error) {
	,  := strconv.ParseFloat(, 32)
	if  != nil {
		return 0, 
	}
	return float32(), nil
}

func ( *float32SliceValue) ( float32) string {
	return fmt.Sprintf("%f", )
}

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

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

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

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

	}
	return , nil
}

// GetFloat32Slice return the []float32 value of a flag with the given name
func ( *FlagSet) ( string) ([]float32, error) {
	,  := .getFlagType(, "float32Slice", float32SliceConv)
	if  != nil {
		return []float32{}, 
	}
	return .([]float32), nil
}

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

// Float32SliceVarP is like Float32SliceVar, but accepts a shorthand letter that can be used after a single dash.
func ( *FlagSet) ( *[]float32, ,  string,  []float32,  string) {
	.VarP(newFloat32SliceValue(, ), , , )
}

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

// Float32SliceVarP is like Float32SliceVar, but accepts a shorthand letter that can be used after a single dash.
func ( *[]float32, ,  string,  []float32,  string) {
	CommandLine.VarP(newFloat32SliceValue(, ), , , )
}

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

// Float32SliceP is like Float32Slice, but accepts a shorthand letter that can be used after a single dash.
func ( *FlagSet) (,  string,  []float32,  string) *[]float32 {
	 := []float32{}
	.Float32SliceVarP(&, , , , )
	return &
}

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

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