Skip to content

Some container data structures written in the next generation of Golang with generics

License

Notifications You must be signed in to change notification settings

Kytabyte/go2-generic-containers

Repository files navigation

Go2 Generic Containers

This is a repo to implement some data structures in go's generic syntax. The go generic is actually under development and the proposal can be found here.

Since the design might be subject to change, this repo will be updated accordingly.

Supported Containers

Test Script

My merged test script can be found in this go2go-playground.

Note that at this time, the go2go playground is the only platform that to run go-generic-style code...

TODO

More data structures

  • Red Black Tree
  • SortedMap and SortedSet (need benchmark of AVL Tree and Red Black Tree to decide which one to use)

Iterator of Containers

A unified iterator interface for all containers is needed...

Package structure

Since the go2go-playground is the only way to write go-generic-style code, writing everything in the same package will be much easier to merge them into a single file and do testing there. The package structure is subject to change after the generic feature is released.

Format

go fmt is not available at this time, as the generic syntax will be recognized as syntax error. The code format will be updated after the geenric feature is released.

About

Some container data structures written in the next generation of Golang with generics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages