Skip to content

Go assignment by slice, array unpacking or destructuring

License

Notifications You must be signed in to change notification settings

thedevsaddam/unpack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unpack

Build Status Project status Go Report Card Coverage Status GoDoc License

Go assignment by slice, array unpacking or destructuring

Installation

Install the package using

$ go get github.com/thedevsaddam/unpack

Usage

To use the package import it in your *.go code

import "github.com/thedevsaddam/unpack"

Let's see a quick example:

package main

import (
	"fmt"

	"github.com/thedevsaddam/unpack"
)

func main() {
	names := []string{"Captain Jack Sparrow", "Tom", "Jerry"}
	var jack, tom string
	unpack.Do(names, &jack, &tom)
	fmt.Println("I'm", jack)
}

Bugs and Issues

If you encounter any bugs or issues, feel free to open an issue at github.

Also, you can shoot me an email to mailto:[email protected] for hugs or bugs.

Contribution

If you are interested to make the package better please send pull requests or create an issue so that others can fix. Read the contribution guide here

License

The unpack is an open-source software licensed under the MIT License.