Go Package fmt
Jump to navigation
Jump to search
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(), Println()
Scanf(), Scanln()
Errorf()
Interfaces
fmt.Stringer
type Stringer interface {
String() string
}
Stringer
is implemented by any type that has a String()
method, which defines the "native" format for that value. The String()
method is used to print values passed as an operand to any format that accepts a string or to an unformatted printer such as Print
. For a usage example, see: