assign

package
v0.0.0-...-f21976e Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(inj parse.Injector, ns codefmt.NS, oldSubconvs []Conv) (Conv, []Conv, error)

Build creates an explicit converter for the given injector and implicit converters which the explicit converter depends on. This is the main entry point of this package.

Types

type Conv

type Conv interface {
	// WriteDefineCode writes a function definition code for the converter.
	WriteDefineCode(*codefmt.Writer)

	// Pos returns the token position of the converter in the source code. It
	// would be token.NoPos if the converter is generated implicitly.
	Pos() token.Pos
}

Conv represents a converter generated by Convgen regardless of explicit or implicit.

type Object

type Object interface {
	// With the following struct definitions in example.com/pkg package:
	//	type Session struct {
	//		SignedUser User
	//	}
	//	type User struct {
	//		Name string
	//	}
	// The following shows the values of the methods for the field
	// Session.SignedUser.Name:
	Type() typeinfo.Type // e.g., string
	QualName() string    // e.g., User.Name
	CrumbName() string   // e.g., Session.SignedUser.Name
	DebugName() string   // e.g., Session.SignedUser.Name (type string)
	Exported() bool
	Pos() token.Pos
}

Object is the common interface for things that can be assigned to another things. It must provide the type information and may have the name. Here is the list of objects:

- pointer - map key/value - slice element - struct field - union member - enum member

Jump to

Keyboard shortcuts

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