aboutsummaryrefslogtreecommitdiff
path: root/field_uint64.go
diff options
context:
space:
mode:
authorStefan Majewsky <stefan.majewsky@sap.com>2022-10-28 16:06:40 +0200
committerStefan Majewsky <stefan.majewsky@sap.com>2022-10-28 16:06:40 +0200
commit90dd519a948d06738479c04d331f28dfab99315c (patch)
treed4a9914cb73be3dbe9438b012a08408d79bdb7c9 /field_uint64.go
parentfd6e57b6239655722884a49a86be0f051cc32bde (diff)
parent5cf9b60d2ded95d29827389a1a5901f1068d4337 (diff)
downloadgo-schwift-90dd519a948d06738479c04d331f28dfab99315c.tar.gz
Merge remote-tracking branch 'SuperSandro2000:sha2'
Diffstat (limited to 'field_uint64.go')
-rw-r--r--field_uint64.go38
1 files changed, 19 insertions, 19 deletions
diff --git a/field_uint64.go b/field_uint64.go
index 2a542ae..8e1a6c2 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,24 +82,24 @@ 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()
+ return FieldUint64(f).Get()
}
func (f FieldUint64Readonly) validate() error {
- return FieldUint64{f.h, f.k}.validate()
+ return FieldUint64(f).validate()
}