KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
pointer
★ 16
Open GitHub ↗
Generic pointer helpers
Download README (.md)
Explore Similar Repositories
CVE-2023-1671-POC
:
CVE-2023-1671-POC, based on dnslog platform
FreeGPT
:
ChatGPT automation tool in selenium.
eytzinger-layout
:
No description available.
MF-PAM_mfpam_pitch_estimation_pytorch
:
No description available.
qb-core-money-item
:
[FiveM/QB-CORE] Money as Item for qb-core
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
pointer
?
Download (.md)
# pointer [](https://pkg.go.dev/github.com/carlmjohnson/pointer) Some generic Go pointer helpers: ```go // Start with a null pointer var strptr *string // pointer.Deref safely dereferences a nil pointer into its empty value fmt.Println(pointer.Deref(strptr) == "") // prints true // pointer.Coalesce lets us specify a default value for a nil pointer fmt.Println(pointer.Coalesce(strptr, "hello, world")) // prints "hello, world" // We can create a pointer to a string or other primitive type with pointer.New newptr := pointer.New("meaning of life") // takes a pointer to a string, wow! // pointer.First returns the first pointer that isn't nil. strptr = pointer.First(strptr, newptr) // returns newptr ```