pragma

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Apache-2.0, BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package pragma provides types that can be embedded into a struct to statically enforce or prevent certain language properties.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DoNotCompare

type DoNotCompare [0]func()

DoNotCompare can be embedded in a struct to prevent comparability.

type DoNotCopy

type DoNotCopy [0]sync.Mutex

DoNotCopy can be embedded in a struct to help prevent shallow copies. This does not rely on a Go language feature, but rather a special case within the vet checker.

See https://golang.org/issues/8005.

type DoNotImplement

type DoNotImplement interface{ ProtoInternal(DoNotImplement) }

DoNotImplement can be embedded in an interface to prevent trivial implementations of the interface.

This is useful to prevent unauthorized implementations of an interface so that it can be extended in the future for any protobuf language changes.

type NoUnkeyedLiterals

type NoUnkeyedLiterals struct{}

NoUnkeyedLiterals can be embedded in a struct to prevent unkeyed literals.

Jump to

Keyboard shortcuts

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