| 1 | package cliscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ |
| 2 | |
| 3 | import ( |
| 4 | "strconvscip-go gomod github.com/golang/go/src go1.22 strconv/" |
| 5 | "unsafescip-go gomod github.com/golang/go/src go1.22 unsafe/" |
| 6 | ) |
| 7 | |
| 8 | type ( |
| 9 | FloatFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FloatFlag# = FlagBasescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#[float64, NoConfigscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NoConfig#, floatValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#[float64]] |
| 10 | Float32Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Float32Flag# = FlagBasescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#[float32, NoConfigscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NoConfig#, floatValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#[float32]] |
| 11 | Float64Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Float64Flag# = FlagBasescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#[float64, NoConfigscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NoConfig#, floatValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#[float64]] |
| 12 | ) |
| 13 | |
| 14 | // -- float Value |
| 15 | type floatValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#[T float32 | float64] struct { |
| 16 | valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#val. *T |
| 17 | } |
| 18 | |
| 19 | // Below functions are to satisfy the ValueCreator interface |
| 20 | |
| 21 | func (f floatValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#[T]) Createscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#Create().(val T, p *T, c NoConfigscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NoConfig#) Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Value# { |
| 22 | *p = val |
| 23 | |
| 24 | return &floatValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#[T]{valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#val.: p} |
| 25 | } |
| 26 | |
| 27 | func (f floatValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#[T]) ToStringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#ToString().(b T) string { |
| 28 | f.valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#val. = &b |
| 29 | return f.Stringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#String().() |
| 30 | } |
| 31 | |
| 32 | // Below functions are to satisfy the flag.Value interface |
| 33 | |
| 34 | func (f *floatValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#[T]) Setscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#Set().(s string) error { |
| 35 | v, err := strconvscip-go gomod github.com/golang/go/src go1.22 strconv/.ParseFloatscip-go gomod github.com/golang/go/src go1.22 strconv/ParseFloat().(s, int(unsafescip-go gomod github.com/golang/go/src go1.22 unsafe/.Sizeof(T(0))*8)) |
| 36 | if err != nil { |
| 37 | return err |
| 38 | } |
| 39 | *f.valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#val. = T(v) |
| 40 | return nil |
| 41 | } |
| 42 | |
| 43 | func (f *floatValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#[T]) Getscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#Get().() any { return *f.valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#val. } |
| 44 | |
| 45 | func (f *floatValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#[T]) Stringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#String().() string { |
| 46 | return strconvscip-go gomod github.com/golang/go/src go1.22 strconv/.FormatFloatscip-go gomod github.com/golang/go/src go1.22 strconv/FormatFloat().(float64(*f.valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#val.), 'g', -1, int(unsafescip-go gomod github.com/golang/go/src go1.22 unsafe/.Sizeof(T(0))*8)) |
| 47 | } |
| 48 | |
| 49 | // Float looks up the value of a local FloatFlag, returns |
| 50 | // 0 if not found |
| 51 | func (cmd *Commandscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#) Floatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Float().(name string) float64 { |
| 52 | return getFloatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/getFloat().[float64](cmd, name) |
| 53 | } |
| 54 | |
| 55 | // Float32 looks up the value of a local Float32Flag, returns |
| 56 | // 0 if not found |
| 57 | func (cmd *Commandscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#) Float32scip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Float32().(name string) float32 { |
| 58 | return getFloatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/getFloat().[float32](cmd, name) |
| 59 | } |
| 60 | |
| 61 | // Float64 looks up the value of a local Float64Flag, returns |
| 62 | // 0 if not found |
| 63 | func (cmd *Commandscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#) Float64scip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Float64().(name string) float64 { |
| 64 | return getFloatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/getFloat().[float64](cmd, name) |
| 65 | } |
| 66 | |
| 67 | func getFloatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/getFloat().[T float32 | float64](cmd *Commandscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#, name string) T { |
| 68 | if v, ok := cmd.Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Value().(name).(T); ok { |
| 69 | tracefscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/tracef().("float available for flag name %[1]q with value=%[2]v (cmd=%[3]q)", name, v, cmd.Namescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Name.) |
| 70 | |
| 71 | return v |
| 72 | } |
| 73 | |
| 74 | tracefscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/tracef().("float NOT available for flag name %[1]q (cmd=%[2]q)", name, cmd.Namescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Name.) |
| 75 | return 0 |
| 76 | } |