gitee.com/sy_183/go-common@v1.0.5-0.20231205030221-958cfe129b47/strings/string_test.go (about)

     1  package strings
     2  
     3  import (
     4  	"fmt"
     5  	"gitee.com/sy_183/go-common/strings/unsafe"
     6  	"gitee.com/sy_183/go-common/unit"
     7  	"testing"
     8  )
     9  
    10  func TestBytes(t *testing.T) {
    11  	s := "hello"
    12  	var bs []byte
    13  	for i := 0; i < unit.KiBiByte<<4; i++ {
    14  		for i := 0; i < unit.MeBiByte; i++ {
    15  			bs = unsafe.Bytes(s)
    16  		}
    17  	}
    18  	fmt.Println(len(bs))
    19  }