safego

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoCopy

type NoCopy struct{}

NoCopy is a super simple safety util taken from the Go atomic lib.

NoCopy may be added to structs which must not be copied after the first use.

The NoCopy struct is empty, so should be a zero-cost util at runtime.

See https://golang.org/issues/8005#issuecomment-190753527 for details.

Note that it must not be embedded, due to the Lock and Unlock methods.

Like: ```

type Example {
	   V uint64
	   _ NoCopy
}

Then run: `go vet -copylocks .` ```

func (*NoCopy) Lock

func (*NoCopy) Lock()

Lock is a no-op used by -copylocks checker from `go vet`.

func (*NoCopy) Unlock

func (*NoCopy) Unlock()

Jump to

Keyboard shortcuts

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