Joe Tsai | 009e067 | 2018-11-27 18:45:07 -0800 | [diff] [blame] | 1 | // Copyright 2018 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // Package scalar provides wrappers for populating optional scalar fields. |
| 6 | package scalar |
| 7 | |
| 8 | // TODO: Should this be public in the v2 API? Where should it live? |
| 9 | // Would we want to do something different if Go gets generics? |
| 10 | |
| 11 | func Bool(v bool) *bool { return &v } |
| 12 | func Int32(v int32) *int32 { return &v } |
| 13 | func Int64(v int64) *int64 { return &v } |
| 14 | func Uint32(v uint32) *uint32 { return &v } |
| 15 | func Uint64(v uint64) *uint64 { return &v } |
| 16 | func Float32(v float32) *float32 { return &v } |
| 17 | func Float64(v float64) *float64 { return &v } |
| 18 | func String(v string) *string { return &v } |