From 04ce17415f25dbf10eba954212c8428ae630df88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 26 Oct 2022 11:31:22 +0200 Subject: Format with go 1.19 --- field_uint64.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'field_uint64.go') 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() } -- cgit v1.2.3 From 8b38a040830109f19550e7329b82ec5caf76b321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 26 Oct 2022 15:23:04 +0200 Subject: Fix linting errors --- field_uint64.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'field_uint64.go') diff --git a/field_uint64.go b/field_uint64.go index d8e63a4..8e1a6c2 100644 --- a/field_uint64.go +++ b/field_uint64.go @@ -97,9 +97,9 @@ func (f FieldUint64Readonly) Exists() bool { // 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() } -- cgit v1.2.3