From 3b335c8434a97dd2913dfb71a8a22e73d9be2fdc Mon Sep 17 00:00:00 2001 From: Max Cherry Date: Sun, 30 Dec 2018 12:45:55 +0200 Subject: [PATCH] types: integral types hints in README --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 97a39ce..329cacf 100644 --- a/README.md +++ b/README.md @@ -48,14 +48,13 @@ Master always contains latest code, so better use some package manager to vendor - Key types should be chosen according to OpenRTB specification (attribute types) - Numeric types: - `int8` - short enums (with values <= 127), boolean-like attributes (like `BidRequest.test`) - - `int64` - time, duration, length, unbound enums (like `BidRequest.at` - exchange-specific auctions types are > 500) - - `uint64` - width, height, bitrate etc. (unbound positive numbers) + - `int64` - every other integral type - `float64` - coordinates, prices etc. - Enums: - all enums, described in section 5, must be typed with section name singularized (e.g., "5.2 Banner Ad Types" -> `type BannerAdType int8`) - all typed enums must have constants for each element, prefixed with type name (e.g., "5.2 Banner Ad Types - XHTML Text Ad (usually mobile)" -> `const BannerAdTypeXHTMLTextAd BannerAdType = 1`) - never use `iota` for enum constants - - section "5.1 Content Categories" should remain untyped and have no constants + - OpenRTB (2.x) section "5.1 Content Categories" should remain untyped and have no constants ## Pointers/omitempty Pointer | Omitempty | When to use | Example