Go Package fmt: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 22: Line 22:
fmt.Printf("%p\n", sPtr)
fmt.Printf("%p\n", sPtr)
</pre>
</pre>
Pointers can be also represented using "%X" (base 16, upper case characters).


===Ints===
===Ints===

Revision as of 21:34, 11 April 2016

External

Internal

Functions

fmt.Printf()

Prints according to a format specifier. Format specifier documentation https://golang.org/pkg/fmt

Pointers

fmt.Printf("%p\n", sPtr)

Pointers can be also represented using "%X" (base 16, upper case characters).

Ints

fmt.Printf("%d\n",i)

fmt.Errorf()

Errorf formats according to a format specifier and returns the string as a value that satisfies error. For more on error handling see error handling.