Go Integers: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 19: Line 19:
[[Go Strings#String_Operators_and_Functions|Indexing operator [] applied to strings]] return bytes.
[[Go Strings#String_Operators_and_Functions|Indexing operator [] applied to strings]] return bytes.


==Conversion on a <tt>byte</tt> to string==
==Conversion on a <tt>byte</tt> to <tt>string</tt>==


=Integer Literals=
=Integer Literals=

Revision as of 01:28, 23 March 2016

Internal

Overview

Integers are designated by the following pre-declared type identifiers:

  • Unsigned integers: uint8 (or byte), uint16, uint32 (or rune), uint64.
  • Signed integers: int8, int16, int32, int64.
  • Machine-dependent integers: uint, int and uintptr.

int should be the default.

byte

byte is unsigned int represented on a byte (uint8).

Indexing operator [] applied to strings return bytes.

Conversion on a byte to string

Integer Literals