| 1 | // mauflag - An extendable command-line argument parser for Golang |
| 2 | // Copyright (C) 2016 Maunium |
| 3 | // |
| 4 | // This program is free software: you can redistribute it and/or modify |
| 5 | // it under the terms of the GNU General Public License as published by |
| 6 | // the Free Software Foundation, either version 3 of the License, or |
| 7 | // (at your option) any later version. |
| 8 | |
| 9 | // This program is distributed in the hope that it will be useful, |
| 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | // GNU General Public License for more details. |
| 13 | |
| 14 | // You should have received a copy of the GNU General Public License |
| 15 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | |
| 17 | package mauflagscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/ |
| 18 | |
| 19 | import ( |
| 20 | "errorsscip-go gomod github.com/golang/go/src go1.16 errors/" |
| 21 | "strconvscip-go gomod github.com/golang/go/src go1.16 strconv/" |
| 22 | "stringsscip-go gomod github.com/golang/go/src go1.16 strings/" |
| 23 | ) |
| 24 | |
| 25 | // Value represents the value a flag has |
| 26 | type Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/Value# interface { |
| 27 | // Set or add the data in the given string to this value |
| 28 | Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/Value#Set.(string) error |
| 29 | // Name should return the type name of this value or (if this value is an array, |
| 30 | // a map or something of that sort) the type name of one object in this value |
| 31 | Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/Value#Name.() string |
| 32 | } |
| 33 | |
| 34 | type boolValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/boolValue# bool |
| 35 | |
| 36 | func (val *boolValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/boolValue#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/boolValue#Name().() string { |
| 37 | return "boolean" |
| 38 | } |
| 39 | |
| 40 | func (val *boolValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/boolValue#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/boolValue#Set().(newVal string) error { |
| 41 | b, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseBoolscip-go gomod github.com/golang/go/src go1.16 strconv/ParseBool().(newVal) |
| 42 | if err == nil { |
| 43 | *val = boolValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/boolValue#(b) |
| 44 | } |
| 45 | return err |
| 46 | } |
| 47 | |
| 48 | type stringValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/stringValue# string |
| 49 | |
| 50 | func (val *stringValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/stringValue#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/stringValue#Name().() string { |
| 51 | return "string" |
| 52 | } |
| 53 | |
| 54 | func (val *stringValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/stringValue#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/stringValue#Set().(newVal string) error { |
| 55 | *val = stringValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/stringValue#(newVal) |
| 56 | return nil |
| 57 | } |
| 58 | |
| 59 | type ssMapValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/ssMapValue# map[string]string |
| 60 | |
| 61 | func (val *ssMapValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/ssMapValue#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/ssMapValue#Name().() string { |
| 62 | return "string-string pair" |
| 63 | } |
| 64 | |
| 65 | func (val *ssMapValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/ssMapValue#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/ssMapValue#Set().(newVal string) error { |
| 66 | index := stringsscip-go gomod github.com/golang/go/src go1.16 strings/.IndexRunescip-go gomod github.com/golang/go/src go1.16 strings/IndexRune().(newVal, '=') |
| 67 | if index == -1 { |
| 68 | index = stringsscip-go gomod github.com/golang/go/src go1.16 strings/.IndexRunescip-go gomod github.com/golang/go/src go1.16 strings/IndexRune().(newVal, ',') |
| 69 | if index == -1 { |
| 70 | index = stringsscip-go gomod github.com/golang/go/src go1.16 strings/.IndexRunescip-go gomod github.com/golang/go/src go1.16 strings/IndexRune().(newVal, ':') |
| 71 | if index == -1 { |
| 72 | return errorsscip-go gomod github.com/golang/go/src go1.16 errors/.Newscip-go gomod github.com/golang/go/src go1.16 errors/New().("No pair separator found") |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | (*val)[newVal[:index]] = newVal[:index+1] |
| 77 | return nil |
| 78 | } |
| 79 | |
| 80 | type stringArrayValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/stringArrayValue# []string |
| 81 | |
| 82 | func (val *stringArrayValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/stringArrayValue#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/stringArrayValue#Name().() string { |
| 83 | return "string" |
| 84 | } |
| 85 | |
| 86 | func (val *stringArrayValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/stringArrayValue#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/stringArrayValue#Set().(newVal string) error { |
| 87 | *val = append(*val, newVal) |
| 88 | return nil |
| 89 | } |
| 90 | |
| 91 | type intArrayValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/intArrayValue# []int |
| 92 | |
| 93 | func (val *intArrayValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/intArrayValue#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/intArrayValue#Name().() string { |
| 94 | return "integer" |
| 95 | } |
| 96 | |
| 97 | func (val *intArrayValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/intArrayValue#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/intArrayValue#Set().(newVal string) error { |
| 98 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.Atoiscip-go gomod github.com/golang/go/src go1.16 strconv/Atoi().(newVal) |
| 99 | if err != nil { |
| 100 | return err |
| 101 | } |
| 102 | *val = append(*val, i) |
| 103 | return nil |
| 104 | } |
| 105 | |
| 106 | type int64ArrayValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int64ArrayValue# []int64 |
| 107 | |
| 108 | func (val *int64ArrayValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int64ArrayValue#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int64ArrayValue#Name().() string { |
| 109 | return "64-bit integer" |
| 110 | } |
| 111 | |
| 112 | func (val *int64ArrayValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int64ArrayValue#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int64ArrayValue#Set().(newVal string) error { |
| 113 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.16 strconv/ParseInt().(newVal, 10, 64) |
| 114 | if err != nil { |
| 115 | return err |
| 116 | } |
| 117 | *val = append(*val, i) |
| 118 | return nil |
| 119 | } |
| 120 | |
| 121 | type intValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/intValue# int |
| 122 | |
| 123 | func (val *intValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/intValue#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/intValue#Name().() string { |
| 124 | return "integer" |
| 125 | } |
| 126 | |
| 127 | func (val *intValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/intValue#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/intValue#Set().(newVal string) error { |
| 128 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.16 strconv/ParseInt().(newVal, 10, 32) |
| 129 | if err == nil { |
| 130 | *val = intValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/intValue#(i) |
| 131 | } |
| 132 | return err |
| 133 | } |
| 134 | |
| 135 | type uintValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uintValue# uint |
| 136 | |
| 137 | func (val *uintValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uintValue#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uintValue#Name().() string { |
| 138 | return "unsigned integer" |
| 139 | } |
| 140 | |
| 141 | func (val *uintValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uintValue#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uintValue#Set().(newVal string) error { |
| 142 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseUintscip-go gomod github.com/golang/go/src go1.16 strconv/ParseUint().(newVal, 10, 32) |
| 143 | if err == nil { |
| 144 | *val = uintValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uintValue#(i) |
| 145 | } |
| 146 | return err |
| 147 | } |
| 148 | |
| 149 | type int8Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int8Value# int8 |
| 150 | |
| 151 | func (val *int8Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int8Value#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int8Value#Name().() string { |
| 152 | return "8-bit integer" |
| 153 | } |
| 154 | |
| 155 | func (val *int8Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int8Value#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int8Value#Set().(newVal string) error { |
| 156 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.16 strconv/ParseInt().(newVal, 10, 8) |
| 157 | if err == nil { |
| 158 | *val = int8Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int8Value#(i) |
| 159 | } |
| 160 | return err |
| 161 | } |
| 162 | |
| 163 | type uint8Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint8Value# uint8 |
| 164 | |
| 165 | func (val *uint8Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint8Value#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint8Value#Name().() string { |
| 166 | return "unsigned 8-bit integer" |
| 167 | } |
| 168 | |
| 169 | func (val *uint8Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint8Value#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint8Value#Set().(newVal string) error { |
| 170 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseUintscip-go gomod github.com/golang/go/src go1.16 strconv/ParseUint().(newVal, 10, 8) |
| 171 | if err == nil { |
| 172 | *val = uint8Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint8Value#(i) |
| 173 | } |
| 174 | return err |
| 175 | } |
| 176 | |
| 177 | type byteValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/byteValue# byte |
| 178 | |
| 179 | func (val *byteValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/byteValue#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/byteValue#Name().() string { |
| 180 | return "rune (unsigned 8-bit integer)" |
| 181 | } |
| 182 | |
| 183 | func (val *byteValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/byteValue#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/byteValue#Set().(newVal string) error { |
| 184 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseUintscip-go gomod github.com/golang/go/src go1.16 strconv/ParseUint().(newVal, 10, 8) |
| 185 | if err == nil { |
| 186 | *val = byteValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/byteValue#(i) |
| 187 | } |
| 188 | return err |
| 189 | } |
| 190 | |
| 191 | type int16Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int16Value# int16 |
| 192 | |
| 193 | func (val *int16Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int16Value#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int16Value#Name().() string { |
| 194 | return "16-bit integer" |
| 195 | } |
| 196 | |
| 197 | func (val *int16Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int16Value#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int16Value#Set().(newVal string) error { |
| 198 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.16 strconv/ParseInt().(newVal, 10, 16) |
| 199 | if err == nil { |
| 200 | *val = int16Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int16Value#(i) |
| 201 | } |
| 202 | return err |
| 203 | } |
| 204 | |
| 205 | type uint16Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint16Value# uint16 |
| 206 | |
| 207 | func (val *uint16Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint16Value#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint16Value#Name().() string { |
| 208 | return "unsigned 16-bit integer" |
| 209 | } |
| 210 | |
| 211 | func (val *uint16Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint16Value#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint16Value#Set().(newVal string) error { |
| 212 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseUintscip-go gomod github.com/golang/go/src go1.16 strconv/ParseUint().(newVal, 10, 16) |
| 213 | if err == nil { |
| 214 | *val = uint16Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint16Value#(i) |
| 215 | } |
| 216 | return err |
| 217 | } |
| 218 | |
| 219 | type int32Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int32Value# int32 |
| 220 | |
| 221 | func (val *int32Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int32Value#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int32Value#Name().() string { |
| 222 | return "32-bit integer" |
| 223 | } |
| 224 | |
| 225 | func (val *int32Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int32Value#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int32Value#Set().(newVal string) error { |
| 226 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.16 strconv/ParseInt().(newVal, 10, 32) |
| 227 | if err == nil { |
| 228 | *val = int32Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int32Value#(i) |
| 229 | } |
| 230 | return err |
| 231 | } |
| 232 | |
| 233 | type runeValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/runeValue# rune |
| 234 | |
| 235 | func (val *runeValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/runeValue#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/runeValue#Name().() string { |
| 236 | return "rune (signed 32-bit integer)" |
| 237 | } |
| 238 | |
| 239 | func (val *runeValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/runeValue#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/runeValue#Set().(newVal string) error { |
| 240 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.16 strconv/ParseInt().(newVal, 10, 32) |
| 241 | if err == nil { |
| 242 | *val = runeValuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/runeValue#(i) |
| 243 | } |
| 244 | return err |
| 245 | } |
| 246 | |
| 247 | type uint32Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint32Value# uint32 |
| 248 | |
| 249 | func (val *uint32Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint32Value#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint32Value#Name().() string { |
| 250 | return "unsigned 32-bit integer" |
| 251 | } |
| 252 | |
| 253 | func (val *uint32Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint32Value#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint32Value#Set().(newVal string) error { |
| 254 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseUintscip-go gomod github.com/golang/go/src go1.16 strconv/ParseUint().(newVal, 10, 32) |
| 255 | if err == nil { |
| 256 | *val = uint32Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint32Value#(i) |
| 257 | } |
| 258 | return err |
| 259 | } |
| 260 | |
| 261 | type int64Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int64Value# int64 |
| 262 | |
| 263 | func (val *int64Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int64Value#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int64Value#Name().() string { |
| 264 | return "64-bit integer" |
| 265 | } |
| 266 | |
| 267 | func (val *int64Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int64Value#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int64Value#Set().(newVal string) error { |
| 268 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.16 strconv/ParseInt().(newVal, 10, 64) |
| 269 | if err == nil { |
| 270 | *val = int64Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/int64Value#(i) |
| 271 | } |
| 272 | return err |
| 273 | } |
| 274 | |
| 275 | type uint64Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint64Value# uint64 |
| 276 | |
| 277 | func (val *uint64Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint64Value#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint64Value#Name().() string { |
| 278 | return "unsigned 64-bit integer" |
| 279 | } |
| 280 | |
| 281 | func (val *uint64Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint64Value#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint64Value#Set().(newVal string) error { |
| 282 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseUintscip-go gomod github.com/golang/go/src go1.16 strconv/ParseUint().(newVal, 10, 64) |
| 283 | if err == nil { |
| 284 | *val = uint64Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/uint64Value#(i) |
| 285 | } |
| 286 | return err |
| 287 | } |
| 288 | |
| 289 | type float32Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/float32Value# float32 |
| 290 | |
| 291 | func (val *float32Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/float32Value#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/float32Value#Name().() string { |
| 292 | return "32-bit float" |
| 293 | } |
| 294 | |
| 295 | func (val *float32Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/float32Value#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/float32Value#Set().(newVal string) error { |
| 296 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseFloatscip-go gomod github.com/golang/go/src go1.16 strconv/ParseFloat().(newVal, 32) |
| 297 | if err == nil { |
| 298 | *val = float32Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/float32Value#(i) |
| 299 | } |
| 300 | return err |
| 301 | } |
| 302 | |
| 303 | type float64Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/float64Value# float64 |
| 304 | |
| 305 | func (val *float64Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/float64Value#) Namescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/float64Value#Name().() string { |
| 306 | return "64-bit float" |
| 307 | } |
| 308 | |
| 309 | func (val *float64Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/float64Value#) Setscip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/float64Value#Set().(newVal string) error { |
| 310 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.ParseFloatscip-go gomod github.com/golang/go/src go1.16 strconv/ParseFloat().(newVal, 64) |
| 311 | if err == nil { |
| 312 | *val = float64Valuescip-go gomod maunium.net/go/mauflag . `maunium.net/go/mauflag`/float64Value#(i) |
| 313 | } |
| 314 | return err |
| 315 | } |