Search Options

Results per page
Sort
Preferred Languages
Advance

Results 111 - 120 of 351 for dtoi (0.05 sec)

  1. src/cmd/go/testdata/script/test_fuzz_fuzztime.txt

    import (
    	"fmt"
    	"os"
    	"strconv"
    )
    
    func main() {
    	dir, err := os.ReadDir(os.Args[1])
    	if err != nil {
    		fmt.Fprintln(os.Stderr, err)
    		os.Exit(1)
    	}
    	got := len(dir)
    	want, _ := strconv.Atoi(os.Args[2])
    	if got != want {
    		fmt.Fprintf(os.Stderr, "got %d files; want %d\n", got, want)
    		os.Exit(1)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 01 20:09:52 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  2. src/internal/fuzz/pcg.go

    	state  uint64
    	inc    uint64
    }
    
    func godebugSeed() *int {
    	debug := strings.Split(os.Getenv("GODEBUG"), ",")
    	for _, f := range debug {
    		if strings.HasPrefix(f, "fuzzseed=") {
    			seed, err := strconv.Atoi(strings.TrimPrefix(f, "fuzzseed="))
    			if err != nil {
    				panic("malformed fuzzseed")
    			}
    			return &seed
    		}
    	}
    	return nil
    }
    
    // newPcgRand generates a new, seeded Rand, ready for use.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 19:28:14 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  3. src/runtime/testdata/testprog/numcpu_freebsd.go

    		return fmt.Errorf("fail to launch child '%s', error: %s, output: %s", cmdline, err, output)
    	}
    
    	// NumCPU from FreeBSDNumCPUHelper come with '\n'.
    	output = bytes.TrimSpace(output)
    	n, err := strconv.Atoi(string(output))
    	if err != nil {
    		return fmt.Errorf("fail to parse output from child '%s', error: %s, output: %s", cmdline, err, output)
    	}
    	if n != len(list) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 30 20:09:46 UTC 2022
    - 3.4K bytes
    - Viewed (0)
  4. src/net/http/pprof/pprof.go

    		return
    	}
    	if sec := r.FormValue("seconds"); sec != "" {
    		name.serveDeltaProfile(w, r, p, sec)
    		return
    	}
    	gc, _ := strconv.Atoi(r.FormValue("gc"))
    	if name == "heap" && gc > 0 {
    		runtime.GC()
    	}
    	debug, _ := strconv.Atoi(r.FormValue("debug"))
    	if debug != 0 {
    		w.Header().Set("Content-Type", "text/plain; charset=utf-8")
    	} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 17:34:05 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  5. src/net/http/triv.go

    	ctr.mu.Lock()
    	defer ctr.mu.Unlock()
    	switch req.Method {
    	case "GET":
    		ctr.n++
    	case "POST":
    		var buf strings.Builder
    		io.Copy(&buf, req.Body)
    		body := buf.String()
    		if n, err := strconv.Atoi(body); err != nil {
    			fmt.Fprintf(w, "bad POST: %v\nbody: [%v]\n", err, body)
    		} else {
    			ctr.n = n
    			fmt.Fprint(w, "counter reset\n")
    		}
    	}
    	fmt.Fprintf(w, "counter = %d\n", ctr.n)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  6. docs/debugging/pprofgoparser/main.go

    				ret[t] = append(ret[t], stackTrace)
    			}
    		case record:
    			save(line)
    		default:
    			z := goroutinesRE.FindStringSubmatch(line)
    			if len(z) == 3 {
    				if z[2] != "" {
    					a, _ := strconv.Atoi(z[2])
    					t = time.Duration(a) * time.Minute
    					save(line)
    					record = true
    				} else {
    					skip = true
    				}
    			}
    		}
    	}
    
    	return ret, nil
    }
    
    const helpUsage = `
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed Mar 06 11:43:16 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  7. src/cmd/cgo/internal/testerrors/errors_test.go

    	cmd := exec.Command("go", "run", path("long_double_size.go"))
    	out, err := cmd.CombinedOutput()
    	if err != nil {
    		t.Fatalf("%#q: %v:\n%s", strings.Join(cmd.Args, " "), err, out)
    	}
    
    	i, err := strconv.Atoi(strings.TrimSpace(string(out)))
    	if err != nil {
    		t.Fatalf("long_double_size.go printed invalid size: %s", out)
    	}
    	return i
    }
    
    func TestReportsTypeErrors(t *testing.T) {
    	for _, file := range []string{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 4K bytes
    - Viewed (0)
  8. pkg/api/testing/compat/compatibility_tester.go

    	}
    
    	// Get the key (and optional index)
    	key := keys[0]
    	index := -1
    	if matches := regexp.MustCompile(`^(.*)\[(\d+)\]$`).FindStringSubmatch(key); len(matches) > 0 {
    		key = matches[1]
    		index, _ = strconv.Atoi(matches[2])
    	}
    
    	// Look up the value
    	value, ok := data[key]
    	if !ok {
    		return nil, false, fmt.Errorf("no key %s found", key)
    	}
    
    	// Get the indexed value if an index is specified
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jul 20 22:26:16 UTC 2019
    - 3.7K bytes
    - Viewed (0)
  9. test/stress/runstress.go

    		time.Sleep(250 * time.Millisecond)
    	}
    }
    
    func stressNet() {
    	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    		size, _ := strconv.Atoi(r.FormValue("size"))
    		w.Write(make([]byte, size))
    	}))
    	go dialStress(ts.Listener.Addr())
    	for {
    		size := rand.Intn(128 << 10)
    		res, err := http.Get(fmt.Sprintf("%s/?size=%d", ts.URL, size))
    		if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:21:35 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  10. cmd/ftp-server.go

    			host, portStr, err := net.SplitHostPort(tokens[1])
    			if err != nil {
    				logger.Fatal(fmt.Errorf("invalid arguments passed to --ftp=%s (%v)", arg, err), "unable to start FTP server")
    			}
    			port, err = strconv.Atoi(portStr)
    			if err != nil {
    				logger.Fatal(fmt.Errorf("invalid arguments passed to --ftp=%s (%v)", arg, err), "unable to start FTP server")
    			}
    			if port < 1 || port > 65535 {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sat Mar 09 03:07:08 UTC 2024
    - 4.8K bytes
    - Viewed (0)
Back to top