Quickstart

Abstraction prevents code from repeating itself

Document page is under construction. Code is cooking.

This notice will be removed once everything is ready to serve.

Hello, My Old Friend

Generic was not a thing in Golang until v1.18 (Feb 2022). We're implementing different types of data structures which adopt generic feature. People can enjoy type checking and have better developer experience.

go get github.com/KafkaWannaFly/generic-collections
Family Tree

Overall, we have ICollection, an interface that all structs have implemented. Plus, HashMap, a wrapper of built-in map with some convenient methods.

Working with Struct

This library works well with basic, primitive data-type. If you have any custom struct, which usually yes, you should implement IHashCoder and ILesser interfaces. They're used by library under the hood. E.g. Set would use IHashCoder to determine if 2 objects are the same. List would use ILesser when sorting items.

Example

Interface Definition

Can I Use Struct Without Implementing the Above Interfaces?

What If My Object Can’t Be Converted?

Last updated