Skip to content

Proposal: Go 2: add builtin function printf, sprint(/f/ln) #40856

Closed
@leaxoy

Description

@leaxoy

There is already builtin functions for print, print and println, but for formatted data, we must import fmt for Printf function, so I propose to add printf function without import fmt each time.

func printf(f string, args ...Type)

For string build and formatted, we can also add string print functions.

func sprint(args ...Type) string
func sprintf(f string, ...Type) string
func sprintln(args ...Type) string

or the single format builtin function

func format(f string, arg ...Type) string

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeLanguageChangeSuggested changes to the Go languageProposalWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.v2An incompatible library change

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions