generics

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2016 License: Apache-2.0 Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Generics

GoDoc In golang, it's been said that interface{} doesn't say anything. This is why you should avoid programming against it as a replacement for the lack of generics, as it's a meaningless crutch which tells you nothing about the behavior of the types underneath it.

I couldn't agree more.

That's why I've built package generics.

Say it with G

Package generics exposes a single, powerful interface, G. With G, a golang developer (or gopher, as they like to be called) can confidently and securely rely on the power and flexibility of golangs built in interface{}, without the bad feelings and guilt of going against the wisdom of the crowds.

G is for Generics

With G, you can take ugly code signatures like this:

func UglyUnIdiomaticQuoteGenericApproachUnquote(poorexcuse ...interface{}) []interface{}

And transform it into the embodiment of meaningful code for which their can be no ambiguity

func Excellence(things ...G) []G

Backwards Compatibility

G meets the standard of golang by matching it's stance on backwards compatibility. Until a 2.0 release of generics, which may never happen, G will always be 100% Backwards compatible.

Afterword

I hope you enjoy programming with generics as much as I do. The best part about golang is the involvement of the community in shaping the future of the language.

License

Apache v2 - See LICENSE

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type G

type G interface{}

G is an interface under which all possible types apply

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL