types

package
v0.0.0-...-c234f5e Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeUser

func ChangeUser()

func NewUser

func NewUser()

func Sum

func Sum[T Number](vals ...T) T

func UseList

func UseList()

func UseOuter

func UseOuter()

func UseTypeP

func UseTypeP()

Types

type FakeFish

type FakeFish Fish

type Fish

type Fish struct {
	Name string
}

func (*Fish) Add

func (f *Fish) Add(index int, val any)

func (*Fish) Append

func (f *Fish) Append(val any)

func (*Fish) Delete

func (f *Fish) Delete(index int)

func (*Fish) Swim

func (f *Fish) Swim()

type Inner

type Inner struct {
}

func (Inner) Name

func (i Inner) Name() string

func (Inner) SayHello

func (i Inner) SayHello()

type Integer

type Integer int

type LinkedList

type LinkedList struct {
	// contains filtered or unexported fields
}

LinkedList 是一个链表

func (*LinkedList) Add

func (l *LinkedList) Add(index int, val any)

Add 添加一个元素

func (*LinkedList) Append

func (l *LinkedList) Append(val any)

func (*LinkedList) Delete

func (l *LinkedList) Delete(index int)

type LinkedListV1

type LinkedListV1[T any] struct {
	// contains filtered or unexported fields
}

func (*LinkedListV1[T]) Add

func (l *LinkedListV1[T]) Add(index int, val T)

func (*LinkedListV1[T]) Append

func (l *LinkedListV1[T]) Append(val T)

func (*LinkedListV1[T]) Delete

func (l *LinkedListV1[T]) Delete(index int)

type List

type List interface {
	Add(index int, val any)
	Append(val any)
	Delete(index int)
}

type ListV1

type ListV1[T any] interface {
	Add(index int, val T)
	Append(val T)
	Delete(index int)
}

type Number

type Number interface {
	~int | uint | uint8
}

type Outer

type Outer struct {
	Inner
}

func (Outer) Name

func (o Outer) Name() string

type Outer1

type Outer1 struct {
	*Inner
}

type Outer2

type Outer2 struct {
	// 组合了接口
	io.Closer
}

type User

type User struct {
	Name string
	Age  int
}

func (*User) ChangeAge

func (u *User) ChangeAge(age int)

func (User) ChangeName

func (u User) ChangeName(name string)

Jump to

Keyboard shortcuts

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