Skip to content
/ glist Public

πŸ‘¨β€πŸ’» based on native container/list, support generics

License

Notifications You must be signed in to change notification settings

LPX3F8/glist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

glist

πŸ‘¨β€πŸ’»β€ based on golang native container/list, support generics

Install

  • go version >= 1.18
go get -u github.com/LPX3F8/glist

Example

import (
	"fmt"

	"github.com/LPX3F8/glist"
)

type foo struct {
	V string
}

func (o *foo) Print() {
	fmt.Println(o.V)
}

func main() {
	fooList := glist.New[*foo]()
	fooList.PushBack(&foo{V: "1"})
	fooList.PushBack(&foo{V: "2"})
	fooList.PushBack(&foo{V: "3"})
	fmt.Println(fooList.Len())
	for e := fooList.Front(); e != nil; e = e.Next() {
		e.Value.Print()
	}
}

About

πŸ‘¨β€πŸ’» based on native container/list, support generics

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages