How can I print to Stderr in Go without using log

If you don’t want timestamps, just create a new log.Logger with flag set to 0:

l := log.New(os.Stderr, "", 0)
l.Println("log msg")

EDIT:

Is the following good Go?

os.Stderr.WriteString("Message")

This is acceptable, and you can also use fmt.Fprintf and friends to get formatted output:

fmt.Fprintf(os.Stderr, "number of foo: %d", nFoo)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)