Skip to content

fmt: add examples #27376

@kevinburke

Description

@kevinburke

Let's add examples. I think it would be good to add examples to each function (if possible?) as well as to illustrate some points - not every example should make every point but it would be good to cover these.

  • how do %d, %s, %q, %v differ

  • how do you do left/right padding

  • decimal formatting

  • how does "ln" ending vary from "f" ending

When you open a change, put this at the bottom of the commit message:

Updates golang/go#27376.

That way gopherbot will post a comment here with a link to your CL.

Add a comment if you want to fix one and I'll put your name next to the func in question.

  • func Errorf(format string, a ...interface{}) error: @ianzapolsky

  • func Fprint(w io.Writer, a ...interface{}) (n int, err error)

  • func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error): @MaerF0x0

  • func Fprintln(w io.Writer, a ...interface{}) (n int, err error): @waits

  • func Fscan(r io.Reader, a ...interface{}) (n int, err error): @andriisoldatenko

  • func Fscanf(r io.Reader, format string, a ...interface{}) (n int, err error)

  • func Fscanln(r io.Reader, a ...interface{}) (n int, err error): @mfrw

  • func Print(a ...interface{}) (n int, err error)

  • func Printf(format string, a ...interface{}) (n int, err error): @mooreds

  • func Println(a ...interface{}) (n int, err error): @techmexdev

  • func Scan(a ...interface{}) (n int, err error)

  • func Scanf(format string, a ...interface{}) (n int, err error)

  • func Scanln(a ...interface{}) (n int, err error)

  • func Sprint(a ...interface{}) string

  • func Sprintf(format string, a ...interface{}) string: @venilnoronha

  • func Sprintln(a ...interface{}) string: @drewvanstone

  • func Sscan(str string, a ...interface{}) (n int, err error)

  • func Sscanf(str string, format string, a ...interface{}) (n int, err error)

  • func Sscanln(str string, a ...interface{}) (n int, err error)

  • type Formatter

  • type GoStringer

  • type ScanState

  • type Scanner

  • type State

  • type Stringer

Metadata

Metadata

Assignees

No one assigned

    Labels

    CommunityDocumentationIssues describing a change to documentation.NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions