fmt.Fprintf formats text from a format string and writes the result to any io.Writer. Unlike fmt.Printf, it does not require standard output, so the same output logic can target files, buffers, screens, or network connections. section 10.3
This decouples formatting from the destination. A process can accept an io.Writer and send status or error messages wherever the caller chooses, supporting flexible CLI tools and logging systems. section 10.3
Writing a status message
Set writer to os.Stdout or another io.Writer, then call fmt.Fprintf(writer, "Output written to: %s\n", outputFile). The same call can write to a file, buffer, or other supported destination. section 10.3
