Go Package fmt: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 12: Line 12:
message := fmt.Sprintf("Hi, %v. Welcome!", name)
message := fmt.Sprintf("Hi, %v. Welcome!", name)
</syntaxhighlight>
</syntaxhighlight>
For more details on the format string, see: {{Internal|Go_Printing_to_Stdout_and_Stderr#fmt.Printf.28.29|<tt>Printf()</tt> Format String}}


==<span id='fmt.Printf.28.29.2C_fmt.Println.28.29'></span><tt>Printf()</tt>, <tt>Println()</tt>==
==<span id='fmt.Printf.28.29.2C_fmt.Println.28.29'></span><tt>Printf()</tt>, <tt>Println()</tt>==

Revision as of 00:14, 16 September 2023

External

Internal

Functions

Sprintf()

Format a string and returns it as a result:

message := fmt.Sprintf("Hi, %v. Welcome!", name)

For more details on the format string, see:

Printf() Format String

Printf(), Println()

Printing to stdout and stderr

Scanf(), Scanln()

Handling stdin in Go

Errorf()

Error Handling | Wrapping Errors