Skip to content

Useful pointer-related funcs, which go lacks so much

License

Notifications You must be signed in to change notification settings

artemmarkaryan/ptr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ptr — useful pointer-related funcs, which go lacks so much

I got tired of implementing these two method in every project of mine.

Usage

// get pointer to time.Now()
now := ptr.P(time.Now()) // -> *time.Time
// get value of pointer
nilValue := (nil).(*int)
zeroValue := ptr.V(nilValue) // -> 0

About

Useful pointer-related funcs, which go lacks so much

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages