crosspkg

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0, UNKNOWN, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Overview

Package crosspkg holds types used by tests in the parent `tests` package to exercise cross-package code generation paths in genproto2. The types live in a child package so that, from the tests package's perspective, their reflect.Type has a different PkgPath() than the target.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoxedInt

type BoxedInt struct {
	V int64
}

BoxedInt is an AminoMarshaler whose repr is a same-package struct. When a tests-package type uses BoxedInt as a field, the repr decode in gen_unmarshal.go writeReprUnmarshal references `crosspkg.Inner` which must be qualified. A regression to `var repr Inner` fails to compile.

func (BoxedInt) MarshalAmino

func (b BoxedInt) MarshalAmino() (Inner, error)

func (*BoxedInt) UnmarshalAmino

func (b *BoxedInt) UnmarshalAmino(r Inner) error

type Inner

type Inner struct {
	N int64
}

type SmallCount

type SmallCount uint8

SmallCount is an AminoMarshaler with uint8 repr. When used as []*crosspkg.SmallCount in a struct field, it exercises the packed-list + pointer + cross-package branch in gen_marshal.go's writeUnpackedListMarshal. A regression to `new(SmallCount)` (bare name) fails to compile from tests/.

func (SmallCount) MarshalAmino

func (c SmallCount) MarshalAmino() (uint8, error)

func (*SmallCount) UnmarshalAmino

func (c *SmallCount) UnmarshalAmino(repr uint8) error

Jump to

Keyboard shortcuts

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