SkillAgentSearch skills...

Btioc

An IoC container for Golang.

Install / Use

/learn @bt/Btioc
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

IoC Container for Go

Build Status

Go doesn't currently have a well documented or easy to use IoC container. As I needed one for the project I'm working on, I'm trying to make one that closely resembles Laravel's IoC Container, due to my strong PHP background.

Getting Started

// Instantiate an object.
obj := "foobar"

// Register into the container.
btioc.Register("foo_object", obj)

// Retrieve the object.
res, _ := btioc.Retrieve("foo_object")

// Prints "what the foobar?!".
fmt.Printf("What the %s?!", res)

For a more detailed example (or how you can use structs with the container), check out the example file.

Related Skills

View on GitHub
GitHub Stars4
CategoryDevelopment
Updated7y ago
Forks1

Languages

Go

Security Score

75/100

Audited on Jul 28, 2018

No findings