package testing

import "go.opentelemetry.io/otel/internal/testing"

Index

Functions

func Aligned8Byte

func Aligned8Byte(fields []FieldOffset, out io.Writer) bool

Aligned8Byte returns if all fields are aligned modulo 8-bytes.

Error messaging is printed to out for any fileds determined misaligned.

func NewTestError

func NewTestError(s string) error

Types

type FieldOffset

type FieldOffset struct {
	// Name of the field.
	Name string

	// Offset of the field in bytes.
	//
	// To compute this at compile time use unsafe.Offsetof.
	Offset uintptr
}

FieldOffset is a preprocessor representation of a struct field alignment.

type TestError

type TestError string

func (TestError) Error

func (e TestError) Error() string

Source Files

alignment.go errors.go

Version
v0.4.3
Published
Apr 24, 2020
Platform
linux/amd64
Imports
2 packages
Last checked
14 seconds ago

Tools for package owners.