addFlags parses flag descriptions and adds them to the testFlags
(f *testFlags, flags []string)
| 241 | |
| 242 | // addFlags parses flag descriptions and adds them to the testFlags |
| 243 | func addFlags(f *testFlags, flags []string) { |
| 244 | for _, flag := range flags { |
| 245 | fields := strings.SplitN(flag, "=", 2) |
| 246 | switch len(fields) { |
| 247 | case 1: |
| 248 | f.bools[fields[0]] = true |
| 249 | case 2: |
| 250 | if i, err := strconv.Atoi(fields[1]); err == nil { |
| 251 | f.ints[fields[0]] = i |
| 252 | } else { |
| 253 | f.strings[fields[0]] = fields[1] |
| 254 | } |
| 255 | } |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | func testSourceURL(port int) string { |
| 260 | return fmt.Sprintf("http://%s/", net.JoinHostPort(testSourceAddress, strconv.Itoa(port))) |
no outgoing calls
no test coverage detected
searching dependent graphs…