Potrei pensare troppo a questo, ma in GoLang, lo fmt.Print()
scrive su stdout o devo usare os.Stdout.Write
?fmt.Print() scrive su stdout in GoLang?
9
A
risposta
13
formati di stampa utilizzando il formato di default per i suoi operandi e scrive sullo standard output.
Quindi sì, scrive su stdout.
1
Da Print documentation: Stampa i formati utilizzando i formati predefiniti per gli operandi e scrive sullo standard output.
6
Sì, lo fa. From the source code:
// Print formats using the default formats for its operands and writes to standard output.
// Spaces are added between operands when neither is a string.
// It returns the number of bytes written and any write error encountered.
func Print(a ...interface{}) (n int, err error) {
return Fprint(os.Stdout, a...)
}
os.Stdout
rappresenta effettivamente il flusso di output standard.
Problemi correlati
- 1. Uscita strana quando si scrive su stdout in console
- 2. Test fallito in prova se scrive su stdout senza newline
- 3. Python scrive su file usando stdout e fileinput
- 4. Cosa significa scrivere su stdout in C?
- 5. golang: goroute con select non si ferma a meno che non ho aggiunto un fmt.Print()
- 6. Errore GOLang Scanf
- 7. Perché il mio canale Golang scrive blocco per sempre?
- 8. Applicazione Windows che opzionalmente scrive su una console in C++?
- 9. Perché PHP-FPM prefissa un avviso quando si scrive su stdout?
- 10. stdout dinamica in Haskell
- 11. La stampa su stdout causa l'esecuzione della goroutine bloccata?
- 12. PHP stdout su Apache
- 13. Creare una pipe che scrive su più file (tee)
- 14. Descrittore file errato Golang
- 15. stdout thread-safe in C su Linux?
- 16. Log4net non scrive su file
- 17. Riorientare stdout su file nodejs
- 18. Spark perdendo println() su stdout
- 19. Scrive sul terminale dopo aver reindirizzato lo stdout in un file senza utilizzare stderr?
- 20. In golang come posso scrivere lo stdout di un exec.Cmd in un file?
- 21. Golang Conversione dell'immagine.Immagine su [] byte
- 22. plugin golang su blocco note ++
- 23. Scrive su uno stream come se fosse un file, ma scrive realmente su un oggetto
- 24. Android - Scrive array di byte su OutputStreamWriter
- 25. Come si scrive/legge su una smartcard?
- 26. Golang come avere una stringa inplace che si aggiorna allo stdout?
- 27. filtri vim e stdout/stderr
- 28. Come scrivere stdout su file con colori?
- 29. Stampa su stdout da osascript/Applescript
- 30. Stampa su stdout e file contemporaneamente