Logo

Programming-Idioms

History of Idiom 59 > diff from v2 to v3

Edit summary for version 3 by :

Version 2

2015-04-14, 21:00:34

Version 3

2015-04-14, 21:15:50

Idiom #59 Write to standard error stream

Print the message "x is negative" to standard error (stderr), with integer x value substitution (e.g. "-2 is negative").

Idiom #59 Write to standard error stream

Print the message "x is negative" to standard error (stderr), with integer x value substitution (e.g. "-2 is negative").

Imports
import "os"
Imports
import "os"
Code
fmt.Fprintf(os.Stderr, "%d is negative", x)
Code
fmt.Fprintln(os.Stderr, x, "is negative")
Demo URL
https://play.golang.org/p/aygrTLLV85
Demo URL
https://play.golang.org/p/6x6amJrySS