ptr

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 1 Imported by: 5

README

go-ptr

About

Go Report Card Go Reference

Trivial and clean library to handle taking pointers just not to repeat the same stuff in every project.

Usage

package example

import (
    ptr "github.com/teran/go-ptr"
)

func main() {
    v := 123.0

    fmt.Printf("%#v\n", ptr.Float64(v))
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) *bool

func Duration

func Duration(d time.Duration) *time.Duration

func Float32

func Float32(f float32) *float32

func Float64

func Float64(f float64) *float64

func Int

func Int(i int) *int

func Int64

func Int64(i int64) *int64

func Ptr

func Ptr[T any](in T) *T

func String

func String(s string) *string

func Time

func Time(t time.Time) *time.Time

func Uint16

func Uint16(u uint16) *uint16

func Uint32

func Uint32(u uint32) *uint32

func Uint64

func Uint64(u uint64) *uint64

func Uint8

func Uint8(u uint8) *uint8

Types

This section is empty.

Jump to

Keyboard shortcuts

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