Help us shape the future of Go! Take the 2026 Go Developer Survey

strings

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Example
package main

import (
	"fmt"
	"time"
	"unsafe"
)

func main() {
	// Example value
	now := time.Now()

	fmt.Println(getString(unsafe.Pointer(&now)))

}

func getString(ptr unsafe.Pointer) string {
	// Interpret ptr as a pointer to a fmt.Stringer interface.
	// This is only safe if ptr indeed points to a valid fmt.Stringer variable.
	s := *(*fmt.Stringer)(ptr)
	return s.String()
}
Output:
TODO

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendBool

func AppendBool(b []byte, v bool) []byte

func AppendByte

func AppendByte(b []byte, val byte) []byte

func AppendBytes

func AppendBytes(b []byte, bytes []byte) []byte

func AppendFloat32

func AppendFloat32(b []byte, val float32) []byte

func AppendFloat32Lossy

func AppendFloat32Lossy(b []byte, val float32) []byte

func AppendFloat64

func AppendFloat64(b []byte, val float64) []byte

func AppendFloat64Lossy

func AppendFloat64Lossy(b []byte, val float64) []byte

func AppendInt

func AppendInt(b []byte, val int) []byte

func AppendInt8

func AppendInt8(b []byte, nval int8) []byte

func AppendInt16

func AppendInt16(b []byte, nval int16) []byte

func AppendInt32

func AppendInt32(b []byte, nval int32) []byte

func AppendInt64

func AppendInt64(b []byte, nval int64) []byte

func AppendRune

func AppendRune(b []byte, r rune) []byte

func AppendString

func AppendString(b []byte, s string) []byte

func AppendStringer

func AppendStringer(b []byte, v fmt.Stringer) []byte

func AppendTextAppender

func AppendTextAppender(b []byte, v fast.TextAppender) []byte

func AppendUint

func AppendUint(b []byte, val uint) []byte

func AppendUint8

func AppendUint8(b []byte, val uint8) []byte

func AppendUint16

func AppendUint16(b []byte, val uint16) []byte

func AppendUint32

func AppendUint32(b []byte, val uint32) []byte

func AppendUint64

func AppendUint64(b []byte, val uint64) []byte

func AppendUnsafeBool

func AppendUnsafeBool(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeByte

func AppendUnsafeByte(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeBytes

func AppendUnsafeBytes(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeFloat32

func AppendUnsafeFloat32(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeFloat32Lossy

func AppendUnsafeFloat32Lossy(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeFloat64

func AppendUnsafeFloat64(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeFloat64Lossy

func AppendUnsafeFloat64Lossy(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeInt

func AppendUnsafeInt(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeInt8

func AppendUnsafeInt8(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeInt16

func AppendUnsafeInt16(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeInt32

func AppendUnsafeInt32(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeInt64

func AppendUnsafeInt64(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeRune

func AppendUnsafeRune(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeString

func AppendUnsafeString(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeStringer

func AppendUnsafeStringer(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeTextAppender

func AppendUnsafeTextAppender(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeUint

func AppendUnsafeUint(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeUint8

func AppendUnsafeUint8(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeUint16

func AppendUnsafeUint16(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeUint32

func AppendUnsafeUint32(b []byte, v unsafe.Pointer) []byte

func AppendUnsafeUint64

func AppendUnsafeUint64(b []byte, v unsafe.Pointer) []byte

Types

type Appender

type Appender func(b []byte, v unsafe.Pointer) []byte

func GetAppender

func GetAppender(typ reflect.Type) (a Appender, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL