Skip to content

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Please, don't use this

It is really just a meme. Don't use this module in your projects.

Introduction

This package is a joke inspired by java.util.Optional class.

Examples

package main
import"github.com/igoracmelo/optional"funcmain() {
opt:=optional.Of(123)
opt.Equals(123) // trueopt.IsPresent() // trueopt.IsEmpty() // falseopt.IfPresent(func () { // func gets calledDoSomething() })
x:=optional.OfNullable(nil).OrElse(10) // x = 10
}

About

optional is a (meme) package for handling nullable values in Go, inspired on java.util.Optional

Resources

Stars

2 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages