|
|
@@ -157,67 +157,6 @@ func (p *Buffer) SetDeterministic(deterministic bool) {
|
|
|
p.deterministic = deterministic
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * Helper routines for simplifying the creation of optional fields of basic type.
|
|
|
- */
|
|
|
-
|
|
|
-// Bool is a helper routine that allocates a new bool value
|
|
|
-// to store v and returns a pointer to it.
|
|
|
-func Bool(v bool) *bool {
|
|
|
- return &v
|
|
|
-}
|
|
|
-
|
|
|
-// Int32 is a helper routine that allocates a new int32 value
|
|
|
-// to store v and returns a pointer to it.
|
|
|
-func Int32(v int32) *int32 {
|
|
|
- return &v
|
|
|
-}
|
|
|
-
|
|
|
-// Int is a helper routine that allocates a new int32 value
|
|
|
-// to store v and returns a pointer to it, but unlike Int32
|
|
|
-// its argument value is an int.
|
|
|
-func Int(v int) *int32 {
|
|
|
- p := new(int32)
|
|
|
- *p = int32(v)
|
|
|
- return p
|
|
|
-}
|
|
|
-
|
|
|
-// Int64 is a helper routine that allocates a new int64 value
|
|
|
-// to store v and returns a pointer to it.
|
|
|
-func Int64(v int64) *int64 {
|
|
|
- return &v
|
|
|
-}
|
|
|
-
|
|
|
-// Float32 is a helper routine that allocates a new float32 value
|
|
|
-// to store v and returns a pointer to it.
|
|
|
-func Float32(v float32) *float32 {
|
|
|
- return &v
|
|
|
-}
|
|
|
-
|
|
|
-// Float64 is a helper routine that allocates a new float64 value
|
|
|
-// to store v and returns a pointer to it.
|
|
|
-func Float64(v float64) *float64 {
|
|
|
- return &v
|
|
|
-}
|
|
|
-
|
|
|
-// Uint32 is a helper routine that allocates a new uint32 value
|
|
|
-// to store v and returns a pointer to it.
|
|
|
-func Uint32(v uint32) *uint32 {
|
|
|
- return &v
|
|
|
-}
|
|
|
-
|
|
|
-// Uint64 is a helper routine that allocates a new uint64 value
|
|
|
-// to store v and returns a pointer to it.
|
|
|
-func Uint64(v uint64) *uint64 {
|
|
|
- return &v
|
|
|
-}
|
|
|
-
|
|
|
-// String is a helper routine that allocates a new string value
|
|
|
-// to store v and returns a pointer to it.
|
|
|
-func String(v string) *string {
|
|
|
- return &v
|
|
|
-}
|
|
|
-
|
|
|
// DebugPrint dumps the encoded data in b in a debugging format with a header
|
|
|
// including the string s. Used in testing but made available for general debugging.
|
|
|
func (p *Buffer) DebugPrint(s string, b []byte) {
|