forked from signalfx/gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
workarounds.go
38 lines (30 loc) · 1.24 KB
/
workarounds.go
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
package workarounds
import "time"
// GolangDoesnotAllowPointerToStringLiteral allows one to take the address of a string literal
func GolangDoesnotAllowPointerToStringLiteral(s string) *string {
return &s
}
// GolangDoesnotAllowPointerToTimeLiteral allows one to take the address of a time literal
func GolangDoesnotAllowPointerToTimeLiteral(s time.Duration) *time.Duration {
return &s
}
// GolangDoesnotAllowPointerToUintLiteral allows one to take the address of a uint32 literal
func GolangDoesnotAllowPointerToUintLiteral(s uint32) *uint32 {
return &s
}
// GolangDoesnotAllowPointerToUintLiteral allows one to take the address of a uint32 literal
func GolangDoesnotAllowPointerToFloat64Literal(s float64) *float64 {
return &s
}
// GolangDoesnotAllowPointerToUintLiteral allows one to take the address of a uint32 literal
func GolangDoesnotAllowPointerToIntLiteral(s int64) *int64 {
return &s
}
// GolangDoesnotAllowPointerToUintLiteral allows one to take the address of a uint32 literal
func GolangDoesnotAllowPointerToUint16Literal(s uint16) *uint16 {
return &s
}
// GolangDoesnotAllowPointerToUintLiteral allows one to take the address of a uint32 literal
func GolangDoesnotAllowPointerToDurationLiteral(s time.Duration) *time.Duration {
return &s
}