ptrto

package module
v0.0.0-...-acabdbb Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2015 License: MIT 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

ptrto

Build Status GoDoc

ptrto is a tiny library that exposes functions that return pointers to the Go builtin types (http://golang.org/pkg/builtin).

The following types are supported:

  • bool
  • byte
  • float32
  • float64
  • int
  • int8
  • int16
  • int32
  • int64
  • interface
  • string
  • struct
  • uint
  • uint8
  • uint16
  • uint32
  • uint64
  • uintptr

This library is only really useful when testing functions and structs with interface{} arguments, types and parameters. Using this library in actual implementation code is probably not a good idea.

Install

If you really want to use this, install it by running go get github.com/mcos/ptrto

License

MIT License

Documentation

Overview

Package ptrto provides functions to return pointers to Go's built in datatypes without having to instantiate new variables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) *bool

Bool returns a pointer to a bool type

func Byte

func Byte(b byte) *byte

Byte returns a pointer to a byte type

func Float32

func Float32(f float32) *float32

Float32 returns a pointer to a float32 type

func Float64

func Float64(f float64) *float64

Float64 returns a pointer to a float64 type

func Int

func Int(i int) *int

Int returns a pointer to an int type

func Int8

func Int8(i int8) *int8

Int8 returns a pointer to an int8 type

func Int16

func Int16(i int16) *int16

Int16 returns a pointer to an int16 type

func Int32

func Int32(i int32) *int32

Int32 returns a pointer to an int32 type

func Int64

func Int64(i int64) *int64

Int64 returns a pointer to an int64 type

func Interface

func Interface(v interface{}) *interface{}

Interface returns a pointer to an interface type

func String

func String(s string) *string

String returns a pointer to a string type

func Struct

func Struct(s struct{}) *struct{}

Struct returns a pointer to a struct type

func Uint

func Uint(u uint) *uint

Uint returns a pointer to a uint type

func Uint8

func Uint8(u uint8) *uint8

Uint8 returns a pointer to a uint8 type

func Uint16

func Uint16(u uint16) *uint16

Uint16 returns a pointer to a uint16 type

func Uint32

func Uint32(u uint32) *uint32

Uint32 returns a pointer to a uint32 type

func Uint64

func Uint64(u uint64) *uint64

Uint64 returns a pointer to a uint64 type

func Uintptr

func Uintptr(u uintptr) *uintptr

Uintptr returns a pointer to a uintptr type

Types

This section is empty.

Jump to

Keyboard shortcuts

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