embedded_types

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package embedded_types exercises schema-builder edge cases when a struct embeds an alias, a named empty interface, or the predeclared error interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	// required: true
	ID int64 `json:"id"`

	Name string `json:"name"`
}

Base is a plain struct used as the right-hand side of an alias.

swagger:model

type BaseAlias

type BaseAlias = Base

BaseAlias aliases Base so that embedding it exercises the alias branch of buildEmbedded.

type EmbedsAlias

type EmbedsAlias struct {
	BaseAlias

	Extra string `json:"extra"`
}

EmbedsAlias embeds an aliased named struct.

swagger:model

type EmbedsEmptyNamedInterface

type EmbedsEmptyNamedInterface struct {
	Marker

	Value string `json:"value"`
}

EmbedsEmptyNamedInterface embeds a named empty interface.

swagger:model

type EmbedsError

type EmbedsError struct {
	Code int `json:"code"`
	// contains filtered or unexported fields
}

EmbedsError embeds the predeclared error interface, exercising the isStdError branch of buildNamedEmbedded.

swagger:model

type EmbedsNamedInterface

type EmbedsNamedInterface struct {
	Handler

	Tag string `json:"tag"`
}

EmbedsNamedInterface embeds a non-empty, non-error named interface.

swagger:model

type Handler

type Handler interface {
	// Handle is a unary method exposed as a schema property.
	Handle() string
}

Handler is a non-empty named interface with a single exported method.

type Marker

type Marker any

Marker is a named empty interface used as an embedded field.

It carries no methods, exercising the utpe.Empty() branch of buildNamedEmbedded for interfaces.

Jump to

Keyboard shortcuts

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