generic

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ABCD

type ABCD[A, B string, C UnionType, D int64 | bool] struct {
	A A `json:"a"`
	B B `json:"b"`
	C C `json:"c"`
	D D `json:"d"`
}

type Any

type Any interface {
	string | any
}

type Derived

type Derived interface {
	~int | string // Line comment
}

type Empty

type Empty interface{}

type EmptyStruct

type EmptyStruct struct{}

type Foo

type Foo[A string | uint64, B *A] struct {
	Bar A
	Boo B
}

func (Foo[int, Derived]) DoSomething

func (f Foo[int, Derived]) DoSomething()

Should not be output as it's a function

type Single

type Single[S string | uint] struct {
	Field S
}

type SingleSpecific

type SingleSpecific = Single[string]

type Something

type Something any

type UnionType

type UnionType interface {
	// Comment for fields are possible
	uint64 | string | *bool // comment after

	// Comment for a method
	SomeMethod() string
}

Comment for UnionType

type ValAndPtr

type ValAndPtr[V any, PT *V, Unused ~uint64] struct {
	Val V
	// Comment for ptr field
	Ptr PT // ptr line comment
}

type WithFooGenericTypeArg

type WithFooGenericTypeArg[A Foo[string, *string]] struct {
	SomeField A `json:"some_field"`
}

Jump to

Keyboard shortcuts

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