Skip to content

comfygopher/collections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comfy Gopher - Collections

codecov CodeRabbit Pull Request Reviews Go Report Card

What is Comfy Gopher?

Comfy Gopher is a Set of general-purpose Tools, Utilities, and Data Structures for Comfortable Development

These tools prioritize speed and ease of development over strict efficiency or full compliance with Go philosophy. They accelerate development and enhance the experience, by reducing the cognitive load, making them well suited for rapid prototyping.

Comfy Gopher - Collections package

Goals

  1. Provide convenient abstraction for collection data structures

  2. Focus on developer experience

  3. Reduce repetition of common collections operations

  4. Address the missing ordered map data structure

  5. Provide API for in-place modifications of collections

  6. Reduce strain of juggling between empty slice pointers []V(nil) vs []V{}

No-goals

This is a set of elements that the Collections package are NOT trying to achieve:

  1. Thread-safety

    You must implement your own thread-safety.

  2. Superb efficiency

    Although care is taken to ensure that the data structures used are efficient, exceptional efficiency is not the main goal here.

Alternatives

There is a very nice library github.com/charbz/gophers. Its API is a mix of mutable and immutable operations, which can be confusing. Most of the methods there do return a new collection instance though. This has its applications, but at the same time it presents some inconveniences when working with extensive amount of other libraries that expect mutable elements.