/go-collection

🦄 Manage collections in golang

Primary LanguageGoMIT LicenseMIT

Go Report License Say Thanks!

Go arrays management

This package is provided to be used on golang and it gives clean methods to handle arrays.

Requirement

  • Golang 1.12.x: keep your compiler up to date :)
  • reflect

The package is in process.

Install

Run this commands

$ go get github.com/MrJoshLab/go-collection

Basic Usage

You must to import the package name

import (
    collection "github.com/MrJoshLab/go-collection"
)

You also need fmt package to print results in console

import "fmt"

The following illustrates how you can use Array type or function to use methods.

data := map[string] string { "say": "hello" }
c := collection.New(data)

// example:
fmt.Println(c.Has("say"))
// return true

fmt.Println(c.Get("say"))
// return "hello"

License

The MIT License (MIT). Please see License File for more information.