fmt

package module
Version: v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2021 License: MIT Imports: 2 Imported by: 0

README

fmt

A drop-in replacement package for the Go stdlib fmt package that provides three additional functions that behave the same as their counterpart printf functions, but append a new line on the end.

func Printfln(format string, a ...interface{}) (n int, err error)
func Fprintfln(w io.Writer, format string, a ...interface{})
func Sprintfln(format string, a ...interface{})

Usage

import "4d63.com/fmt"
fmt.Printfln("Hello %s!", "world")
fmt.Printfln("G'day %s!", "world")
// Output:
// Hello world!
// G'day world!

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(format string, a ...interface{}) error

Errorf is the same as fmt.Errorf.

func Fprint

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

Fprint is the same as fmt.Fprint.

func Fprintf

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

Fprintf is the same as fmt.Fprintf.

func Fprintfln

func Fprintfln(w io.Writer, format string, a ...interface{}) (n int, err error)

Fprintfln is the same as fmt.Fprintf, but appends a new line.

Example
package main

import (
	"os"

	"4d63.com/fmt"
)

func main() {
	fmt.Fprintfln(os.Stdout, "Hello %s!", "world")
	fmt.Fprintfln(os.Stdout, "G'day %s!", "world")
}
Output:

Hello world!
G'day world!

func Fprintln

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

Fprintln is the same as fmt.Fprintln.

func Fscan

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

Fscan is the same as fmt.Fscan.

func Fscanf

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

Fscanf is the same as fmt.Fscanf.

func Fscanln

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

Fscanln is the same as fmt.Fscanln.

func Print

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

Print is the same as fmt.Print.

func Printf

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

Printf is the same as fmt.Printf.

func Printfln

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

Printfln is the same as fmt.Printf, but appends a new line.

Example
package main

import (
	"4d63.com/fmt"
)

func main() {
	fmt.Printfln("Hello %s!", "world")
	fmt.Printfln("G'day %s!", "world")
}
Output:

Hello world!
G'day world!

func Println

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

Println is the same as fmt.Println.

func Scan

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

Scan is the same as fmt.Scan.

func Scanf

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

Scanf is the same as fmt.Scanf.

func Scanln

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

Scanln is the same as fmt.Scanln.

func Sprint

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

Sprint is the same as fmt.Sprint.

func Sprintf

func Sprintf(format string, a ...interface{}) string

Sprintf is the same as fmt.Sprintf.

func Sprintfln

func Sprintfln(format string, a ...interface{}) string

Sprintf is the same as fmt.Printf, but appends a new line.

Example
package main

import (
	"4d63.com/fmt"
)

func main() {
	fmt.Print(fmt.Sprintfln("Hello %s!", "world"))
	fmt.Print(fmt.Sprintfln("G'day %s!", "world"))
}
Output:

Hello world!
G'day world!

func Sprintln

func Sprintln(a ...interface{}) string

Sprintln is the same as fmt.Sprintln.

func Sscan

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

Sscan is the same as fmt.Sscan.

func Sscanf

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

Sscanf is the same as fmt.Sscanf.

func Sscanln

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

Sscanln is the same as fmt.Sscanln.

Types

type Formatter

type Formatter = fmt.Formatter

type GoStringer

type GoStringer = fmt.GoStringer

type ScanState

type ScanState = fmt.ScanState

type Scanner

type Scanner = fmt.Scanner

type State

type State = fmt.State

type Stringer

type Stringer = fmt.Stringer

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL