Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
pointer/pointer.go at main · AlekSi/pointer · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
AlekSi
pointer
Repository navigation
Code
Issues
2
(2)
Pull requests
1
(1)
Actions
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
pointer
/
pointer.go
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
124 lines (100 loc) · 2.64 KB
main
Breadcrumbs
pointer
/
pointer.go
Copy path
Top
File metadata and controls
Code
Blame
124 lines (100 loc) · 2.64 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Package pointer provides helpers to convert between pointers and values of built-in (and, with generics, of any) types.
package
pointer
// import "github.com/AlekSi/pointer"
import
(
"time"
)
/*
Order as in spec:
bool byte complex64 complex128 error float32 float64
int int8 int16 int32 int64 rune string
uint uint8 uint16 uint32 uint64 uintptr
time.Duration time.Time
*/
// ToBool returns a pointer to the passed bool value.
func
ToBool
(
b
bool
)
*
bool
{
return
&
b
}
// ToByte returns a pointer to the passed byte value.
func
ToByte
(
b
byte
)
*
byte
{
return
&
b
}
// ToComplex64 returns a pointer to the passed complex64 value.
func
ToComplex64
(
c
complex64
)
*
complex64
{
return
&
c
}
// ToComplex128 returns a pointer to the passed complex128 value.
func
ToComplex128
(
c
complex128
)
*
complex128
{
return
&
c
}
// ToError returns a pointer to the passed error value.
func
ToError
(
e
error
)
*
error
{
return
&
e
}
// ToFloat32 returns a pointer to the passed float32 value.
func
ToFloat32
(
f
float32
)
*
float32
{
return
&
f
}
// ToFloat64 returns a pointer to the passed float64 value.
func
ToFloat64
(
f
float64
)
*
float64
{
return
&
f
}
// ToInt returns a pointer to the passed int value.
func
ToInt
(
i
int
)
*
int
{
return
&
i
}
// ToInt8 returns a pointer to the passed int8 value.
func
ToInt8
(
i
int8
)
*
int8
{
return
&
i
}
// ToInt16 returns a pointer to the passed int16 value.
func
ToInt16
(
i
int16
)
*
int16
{
return
&
i
}
// ToInt32 returns a pointer to the passed int32 value.
func
ToInt32
(
i
int32
)
*
int32
{
return
&
i
}
// ToInt64 returns a pointer to the passed int64 value.
func
ToInt64
(
i
int64
)
*
int64
{
return
&
i
}
// ToRune returns a pointer to the passed rune value.
func
ToRune
(
r
rune
)
*
rune
{
return
&
r
}
// ToString returns a pointer to the passed string value.
func
ToString
(
s
string
)
*
string
{
return
&
s
}
// ToUint returns a pointer to the passed uint value.
func
ToUint
(
u
uint
)
*
uint
{
return
&
u
}
// ToUint8 returns a pointer to the passed uint8 value.
func
ToUint8
(
u
uint8
)
*
uint8
{
return
&
u
}
// ToUint16 returns a pointer to the passed uint16 value.
func
ToUint16
(
u
uint16
)
*
uint16
{
return
&
u
}
// ToUint32 returns a pointer to the passed uint32 value.
func
ToUint32
(
u
uint32
)
*
uint32
{
return
&
u
}
// ToUint64 returns a pointer to the passed uint64 value.
func
ToUint64
(
u
uint64
)
*
uint64
{
return
&
u
}
// ToUintptr returns a pointer to the passed uintptr value.
func
ToUintptr
(
u
uintptr
)
*
uintptr
{
return
&
u
}
// ToDuration returns a pointer to the passed time.Duration value.
func
ToDuration
(
d
time.
Duration
)
*
time.
Duration
{
return
&
d
}
// ToTime returns a pointer to the passed time.Time value.
func
ToTime
(
t
time.
Time
)
*
time.
Time
{
return
&
t
}
You can’t perform that action at this time.