Skip to content

Lightweight collections library for Go, inspired by the Kotlin standard library and implemented with Go 1.18 generics.

License

Notifications You must be signed in to change notification settings

pvillela/go-light-collections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Light Collections

Lightweight, efficient, and functionally rich implementation of List, Map, and Set for Golang, inspired by the Kotlin standard library. The implementation uses Go's native slice and map as underlying data structures.

glc package

The glc package contains an implementation of this framework using Go generics.

Legacy

Due to the former lack of generics in Go, an implementation without generics was originally created. That implementation, located in the legacy directory, uses the type interface{}. I call this implementation pseudo-generic.

An example is provided with a simple pattern in the legacy/pkg/glc package godoc documentation to show how to write adapters to create type-safe collections for specific types.

The legacy framework also supports code generation for specific types. See the genex example.

The package legacy/examples/testgen and its sub-packages contain the generation of tests for specific concrete types. These tests serve to test the correctness of the code generation process.

The legacy library is extensively tested, including 100% test coverage for the core code and the execution of the tests with code generation.

To-dos

Add missing library godoc comments

Update glc package documentation

About

Lightweight collections library for Go, inspired by the Kotlin standard library and implemented with Go 1.18 generics.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published