aboutsummaryrefslogtreecommitdiff
path: root/field_uint64.go
diff options
context:
space:
mode:
Diffstat (limited to 'field_uint64.go')
-rw-r--r--field_uint64.go34
1 files changed, 17 insertions, 17 deletions
diff --git a/field_uint64.go b/field_uint64.go
index 2a542ae..d8e63a4 100644
--- a/field_uint64.go
+++ b/field_uint64.go
@@ -22,9 +22,9 @@ import (
"strconv"
)
-//FieldUint64 is a helper type that provides type-safe access to a Swift header
-//whose value is an unsigned integer. It cannot be directly constructed, but
-//methods on the Headers types return this type. For example:
+// FieldUint64 is a helper type that provides type-safe access to a Swift header
+// whose value is an unsigned integer. It cannot be directly constructed, but
+// methods on the Headers types return this type. For example:
//
// hdr := NewAccountHeaders()
// //the following two statements are equivalent:
@@ -35,13 +35,13 @@ type FieldUint64 struct {
k string
}
-//Exists checks whether there is a value for this header.
+// Exists checks whether there is a value for this header.
func (f FieldUint64) Exists() bool {
return f.h.Get(f.k) != ""
}
-//Get returns the value for this header, or 0 if there is no value (or if it is
-//not a valid uint64).
+// Get returns the value for this header, or 0 if there is no value (or if it is
+// not a valid uint64).
func (f FieldUint64) Get() uint64 {
v, err := strconv.ParseUint(f.h.Get(f.k), 10, 64)
if err != nil {
@@ -50,20 +50,20 @@ func (f FieldUint64) Get() uint64 {
return v
}
-//Set writes a new value for this header into the corresponding headers
-//instance.
+// Set writes a new value for this header into the corresponding headers
+// instance.
func (f FieldUint64) Set(value uint64) {
f.h.Set(f.k, strconv.FormatUint(value, 10))
}
-//Del removes this key from the original headers instance, so that the key will
-//remain unchanged on the server during Update().
+// Del removes this key from the original headers instance, so that the key will
+// remain unchanged on the server during Update().
func (f FieldUint64) Del() {
f.h.Del(f.k)
}
-//Clear sets this key to an empty string in the original headers instance, so
-//that the key will be removed on the server during Update().
+// Clear sets this key to an empty string in the original headers instance, so
+// that the key will be removed on the server during Update().
func (f FieldUint64) Clear() {
f.h.Clear(f.k)
}
@@ -82,20 +82,20 @@ func (f FieldUint64) validate() error {
////////////////////////////////////////////////////////////////////////////////
-//FieldUint64Readonly is a readonly variant of FieldUint64. It is used for
-//fields that cannot be set by the client.
+// FieldUint64Readonly is a readonly variant of FieldUint64. It is used for
+// fields that cannot be set by the client.
type FieldUint64Readonly struct {
h Headers
k string
}
-//Exists checks whether there is a value for this header.
+// Exists checks whether there is a value for this header.
func (f FieldUint64Readonly) Exists() bool {
return f.h.Get(f.k) != ""
}
-//Get returns the value for this header, or 0 if there is no value (or if it is
-//not a valid uint64).
+// Get returns the value for this header, or 0 if there is no value (or if it is
+// not a valid uint64).
func (f FieldUint64Readonly) Get() uint64 {
return FieldUint64{f.h, f.k}.Get()
}