Skip to content

Repository files navigation

CircleCI Go Reference

to

Library for convenient type dereferencing in Go.

import "github.com/giantswarm/to"

spec := Spec{
    Enabled: to.BoolP(true),   // value -> pointer
    Retries: to.IntP(3),
}

enabled := to.Bool(spec.Enabled) // pointer -> value

The X(*T) T functions dereference and will panic on a nil pointer. The XP(T) *T functions return the address of a fresh copy, so they are safe to call in a loop.

About

Util for Go primitive type dereferencing.

Resources

Security policy

Stars

0 stars

Watchers

8 watching

Forks

Releases

Used by

Contributors

Languages