Skip to content

Go functions to enable in-line addressing of unassigned values. Eg: var foo *string = ptr.P("bar")

Notifications You must be signed in to change notification settings

kevin-cantwell/ptr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This package enables in-line addressing of literals and other unassigned values by providing generic functions for referencing values or de-referencing pointers.

var p string = "foo"
fmt.Printf("Pointer value of p: %v\n", ptr.P(p))
fmt.Printf("Deref value of *p: %v\n", ptr.V(&p))

var i *int64 = nil
fmt.Printf("Pointer value of i: %v\n", ptr.P(i))
fmt.Printf("Pointer value of *i: %v\n", ptr.V(&i))

var foo *string = ptr.P("bar")

About

Go functions to enable in-line addressing of unassigned values. Eg: var foo *string = ptr.P("bar")

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages