geidsvig / go-collectables

Go package to simulate Scala Collections

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This package was created to approximate Scala Collections in Go.

Including the library in your project:

require (
    github.com/geidsvig/go-collectables latest
)
import collectables "github.com/geidsvig/go-collectables/lib"

Example struct to be used as a Collectable.

type Collectable struct {
	name  string
	value int
}

Example Usage:

T := reflect.TypeOf(Collectable{})
list := collectables.Collection{}
item1 := Collectable{name: "A", value: 1}
err := list.Append(T, item1)

About

Go package to simulate Scala Collections

License:MIT License


Languages

Language:Go 100.0%