Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 106 for repeat (0.17 sec)

  1. cmd/encryption-v1_test.go

    		esum = func(oi ObjectInfo) int64 {
    			sum := int64(0)
    			for _, i := range oi.Parts {
    				sum += i.Size
    			}
    			return sum
    		}
    	)
    
    	s1 := []int64{5487701, 5487799, 3}
    	s2 := repeat(5487701, 5)
    	s3 := repeat(maxPartSz, 10000)
    	testMPs := []struct {
    		decSizes []int64
    		oi       ObjectInfo
    	}{
    		{s1, mkMPObj(s1)},
    		{s2, mkMPObj(s2)},
    		{s3, mkMPObj(s3)},
    	}
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sat Sep 24 04:17:08 GMT 2022
    - 19.9K bytes
    - Viewed (0)
  2. src/bytes/bytes.go

    		}
    		i += wid
    	}
    	return b
    }
    
    // Repeat returns a new byte slice consisting of count copies of b.
    //
    // It panics if count is negative or if the result of (len(b) * count)
    // overflows.
    func Repeat(b []byte, count int) []byte {
    	if count == 0 {
    		return []byte{}
    	}
    
    	// Since we cannot return an error on overflow,
    	// we should panic if the repeat will generate an overflow.
    	// See golang.org/issue/16237.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  3. internal/logger/console.go

    	f.pretty(msg, args...)
    }
    
    var (
    	logTag      = "ERROR"
    	logBanner   = color.BgRed(color.FgWhite(color.Bold(logTag))) + " "
    	emptyBanner = color.BgRed(strings.Repeat(" ", len(logTag))) + " "
    	bannerWidth = len(logTag) + 1
    )
    
    func (f fatalMsg) pretty(msg string, args ...interface{}) {
    	// Build the passed error message
    	errMsg := fmt.Sprintf(msg, args...)
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 17:57:52 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  4. src/bufio/scan_test.go

    	s := NewScanner(strings.NewReader(strings.Repeat("\n", 10000)))
    	s.Split(c.split)
    	for s.Scan() {
    	}
    	if s.Err() != nil {
    		t.Fatal("after scan:", s.Err())
    	}
    	if c != 0 {
    		t.Fatalf("stopped with %d left to process", c)
    	}
    }
    
    // Make sure we can read a huge token if a big enough buffer is provided.
    func TestHugeBuffer(t *testing.T) {
    	text := strings.Repeat("x", 2*MaxScanTokenSize)
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Sep 22 16:22:42 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  5. internal/grid/grid_test.go

    		}
    		t.Log("Roundtrip:", time.Since(start))
    	})
    
    	t.Run("localToRemoteHuge", func(t *testing.T) {
    		testPayload := bytes.Repeat([]byte("?"), 1<<20)
    
    		start := time.Now()
    		resp, err := remoteConn.Request(context.Background(), handlerTest, testPayload)
    		errFatal(err)
    		if string(resp) != string(testPayload) {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Apr 30 15:03:35 GMT 2024
    - 30.1K bytes
    - Viewed (0)
  6. src/bytes/example_test.go

    	fmt.Println(bytes.NewReader([]byte("Hi!")).Len())
    	fmt.Println(bytes.NewReader([]byte("こんにちは!")).Len())
    	// Output:
    	// 3
    	// 16
    }
    
    func ExampleRepeat() {
    	fmt.Printf("ba%s", bytes.Repeat([]byte("na"), 2))
    	// Output: banana
    }
    
    func ExampleReplace() {
    	fmt.Printf("%s\n", bytes.Replace([]byte("oink oink oink"), []byte("k"), []byte("ky"), 2))
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  7. src/archive/tar/tar_test.go

    		header:  &Header{Name: "foobar"},
    		formats: FormatUSTAR | FormatPAX | FormatGNU,
    	}, {
    		header:  &Header{Name: strings.Repeat("a", nameSize)},
    		formats: FormatUSTAR | FormatPAX | FormatGNU,
    	}, {
    		header:  &Header{Name: strings.Repeat("a", nameSize+1)},
    		paxHdrs: map[string]string{paxPath: strings.Repeat("a", nameSize+1)},
    		formats: FormatPAX | FormatGNU,
    	}, {
    		header:  &Header{Linkname: "用戶名"},
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24K bytes
    - Viewed (0)
  8. src/archive/zip/writer_test.go

    	bigBuf := bytes.Repeat([]byte("a"), 1<<20)
    
    	runOnce := func(buf *bytes.Buffer) {
    		buf.Reset()
    		zw := NewWriter(buf)
    		for j := 0; j < 3; j++ {
    			w, _ := zw.CreateHeader(&FileHeader{
    				Name:   "foo",
    				Method: Deflate,
    			})
    			w.Write(bigBuf)
    		}
    		zw.Close()
    	}
    
    	b.ReportAllocs()
    	// Run once and then reset the timer.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Sep 15 19:04:06 GMT 2023
    - 14.1K bytes
    - Viewed (0)
  9. istioctl/pkg/writer/table/writer.go

    			if i == len(row)-1 {
    				_, _ = fmt.Fprint(c.writer, "\n")
    			} else {
    				padAmount := sep[i] - utf8.RuneCount([]byte(col.Value)) + 2
    				_, _ = fmt.Fprint(c.writer, strings.Repeat(" ", padAmount))
    			}
    		}
    	}
    }
    
    func max(x, y int) int {
    	if x < y {
    		return y
    	}
    	return x
    }
    
    func getMaxWidths(output [][]Cell) []int {
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Sat Oct 08 04:41:42 GMT 2022
    - 2.8K bytes
    - Viewed (0)
  10. src/archive/tar/reader_test.go

    		inputHdrs: map[string]string{paxGNUSparseMajor: "1", paxGNUSparseMinor: "0"},
    		wantErr:   ErrHeader,
    	}, {
    		inputData: padInput(strings.Repeat("0", 300) + "1\n" + strings.Repeat("0", 1000) + "5\n" + strings.Repeat("0", 800) + "2\n"),
    		inputHdrs: map[string]string{paxGNUSparseMajor: "1", paxGNUSparseMinor: "0"},
    		wantMap:   sparseDatas{{5, 2}},
    	}, {
    		inputData: padInput("2\n10737418240\n512\n21474836480\n512\n"),
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Nov 21 21:14:38 GMT 2022
    - 47.1K bytes
    - Viewed (0)
Back to top