const tmpStringBufSize … type tmpBuf … // concatstrings implements a Go string concatenation x+y+z+... // The operands are passed in the slice a. // If buf != nil, the compiler has determined that the result does not // escape the calling function, so the string data can be stored in buf // if small enough. func concatstrings(buf *tmpBuf, a []string) string { … } func concatstring2(buf *tmpBuf, a0, a1 string) string { … } func concatstring3(buf *tmpBuf, a0, a1, a2 string) string { … } func concatstring4(buf *tmpBuf, a0, a1, a2, a3 string) string { … } func concatstring5(buf *tmpBuf, a0, a1, a2, a3, a4 string) string { … } // concatbytes implements a Go string concatenation x+y+z+... returning a slice // of bytes. // The operands are passed in the slice a. func concatbytes(a []string) []byte { … } func concatbyte2(a0, a1 string) []byte { … } func concatbyte3(a0, a1, a2 string) []byte { … } func concatbyte4(a0, a1, a2, a3 string) []byte { … } func concatbyte5(a0, a1, a2, a3, a4 string) []byte { … } // slicebytetostring converts a byte slice to a string. // It is inserted by the compiler into generated code. // ptr is a pointer to the first element of the slice; // n is the length of the slice. // Buf is a fixed-size buffer for the result, // it is not nil if the result does not escape. func slicebytetostring(buf *tmpBuf, ptr *byte, n int) string { … } // stringDataOnStack reports whether the string's data is // stored on the current goroutine's stack. func stringDataOnStack(s string) bool { … } func rawstringtmp(buf *tmpBuf, l int) (s string, b []byte) { … } // slicebytetostringtmp returns a "string" referring to the actual []byte bytes. // // Callers need to ensure that the returned string will not be used after // the calling goroutine modifies the original slice or synchronizes with // another goroutine. // // The function is only called when instrumenting // and otherwise intrinsified by the compiler. // // Some internal compiler optimizations use this function. // - Used for m[T1{... Tn{..., string(k), ...} ...}] and m[string(k)] // where k is []byte, T1 to Tn is a nesting of struct and array literals. // - Used for "<"+string(b)+">" concatenation where b is []byte. // - Used for string(b)=="foo" comparison where b is []byte. func slicebytetostringtmp(ptr *byte, n int) string { … } func stringtoslicebyte(buf *tmpBuf, s string) []byte { … } func stringtoslicerune(buf *[tmpStringBufSize]rune, s string) []rune { … } func slicerunetostring(buf *tmpBuf, a []rune) string { … } type stringStruct … type stringStructDWARF … func stringStructOf(sp *string) *stringStruct { … } func intstring(buf *[4]byte, v int64) (s string) { … } // rawstring allocates storage for a new string. The returned // string and byte slice both refer to the same storage. // The storage is not zeroed. Callers should use // b to set the string contents and then drop b. func rawstring(size int) (s string, b []byte) { … } // rawbyteslice allocates a new byte slice. The byte slice is not zeroed. func rawbyteslice(size int) (b []byte) { … } // rawruneslice allocates a new rune slice. The rune slice is not zeroed. func rawruneslice(size int) (b []rune) { … } // used by cmd/cgo func gobytes(p *byte, n int) (b []byte) { … } // This is exported via linkname to assembly in syscall (for Plan9) and cgo. // //go:linkname gostring func gostring(p *byte) string { … } // internal_syscall_gostring is a version of gostring for internal/syscall/unix. // //go:linkname internal_syscall_gostring internal/syscall/unix.gostring func internal_syscall_gostring(p *byte) string { … } func gostringn(p *byte, l int) string { … } const maxUint64 … const maxInt64 … // atoi64 parses an int64 from a string s. // The bool result reports whether s is a number // representable by a value of type int64. func atoi64(s string) (int64, bool) { … } // atoi is like atoi64 but for integers // that fit into an int. func atoi(s string) (int, bool) { … } // atoi32 is like atoi but for integers // that fit into an int32. func atoi32(s string) (int32, bool) { … } // parseByteCount parses a string that represents a count of bytes. // // s must match the following regular expression: // // ^[0-9]+(([KMGT]i)?B)?$ // // In other words, an integer byte count with an optional unit // suffix. Acceptable suffixes include one of // - KiB, MiB, GiB, TiB which represent binary IEC/ISO 80000 units, or // - B, which just represents bytes. // // Returns an int64 because that's what its callers want and receive, // but the result is always non-negative. func parseByteCount(s string) (int64, bool) { … } //go:nosplit func findnull(s *byte) int { … } func findnullw(s *uint16) int { … } //go:nosplit func gostringnocopy(str *byte) string { … } func gostringw(strw *uint16) string { … }