danger

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package danger provides memory unsafe utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes added in v0.20.2

func Bytes(s string) []byte

Bytes casts a string to a byte slice without copying the underlying array.

The caller must not modify s afterwards because this will change the returned slice.

func MarshalJSON

func MarshalJSON(v any) (string, error)

MarshalJSON encodes a value to a JSON string.

It uses String to avoid memory allocation and copying.

func String

func String(b []byte) string

String casts a byte slice to a string without copying the underlying array.

The caller must not modify b afterwards because this will change the returned string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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