Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sicherheitslücken (CVE)USN-8797-1: GStreamer Base Plugins vulnerability(21.09.2026 um 20:05 Uhr)
Sichere ProgrammierungYou can build HTML emails with Tailwind CSS(21.09.2026 um 22:15 Uhr)
Sichere ProgrammierungDEV-Part-1-Backend.md(21.09.2026 um 22:24 Uhr)
Sichere ProgrammierungWhat It Actually Costs to Serve a 1M-Token Model in Production(21.09.2026 um 22:33 Uhr)
Sichere ProgrammierungHow to Check an Agent's Diagnosis Before It Touches Production(21.09.2026 um 22:53 Uhr)
Linux Tipps & HardeningWhat if Spotify was self-hosted? I think I got pretty close.(21.09.2026 um 22:33 Uhr)
Linux Tipps & HardeningSandboxing on Linux(21.09.2026 um 22:45 Uhr)
Sicherheitslücken (CVE)USN-8797-1: GStreamer Base Plugins vulnerability(21.09.2026 um 20:05 Uhr)
Sichere ProgrammierungYou can build HTML emails with Tailwind CSS(21.09.2026 um 22:15 Uhr)
Sichere ProgrammierungDEV-Part-1-Backend.md(21.09.2026 um 22:24 Uhr)
Sichere ProgrammierungWhat It Actually Costs to Serve a 1M-Token Model in Production(21.09.2026 um 22:33 Uhr)
Sichere ProgrammierungHow to Check an Agent's Diagnosis Before It Touches Production(21.09.2026 um 22:53 Uhr)
Linux Tipps & HardeningWhat if Spotify was self-hosted? I think I got pretty close.(21.09.2026 um 22:33 Uhr)
Linux Tipps & HardeningSandboxing on Linux(21.09.2026 um 22:45 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

You are polluting Your Standard Output ( stdout ) in Go

Using fmt.Println for error handling isnt a practical way, especially in linux or unix based systems. because if you're using bash or zsh or any other shell, there will be 3 types of file descriptors, stdout, stderr, and stdin (which are…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Using fmt.Println for error handling isnt a practical way, especially in linux or unix based systems.



because if you're using bash or zsh or any other shell, there will be 3 types of file descriptors, stdout, stderr, and stdin (which are low level integer table numbers that the kernel assign them for each communication channel )

when logging erros with fmt.Println you're polluting your Standard output data stream ( stdout ( 1 ) ) which might be used for CLI driven utility or similar, and using print() or println() isnt ideal for production grade, because both of them redirect every output to stderr amd both are almost temporary built in functions for fast debugging/bootstrapping that might get removed



Here is the show case :




package main
import "fmt"

func main() {
println("Directed to stderr")
fmt.Println("Directed to stdout")
}






When compiling and running as an executable :




[lost learning]$ ./main # Default case
Directed to stderr
Directed to stdout

[lost learning]$ ./main 2>/dev/null # Redirecting the Standard Error to null
Directed to stdout

[lost learning]$ ./main 1>/dev/null # Redirecting the Standard Output to null
Directed to stderr

[lost learning]$ ./main > output # Redirection operator ">" takes only the stdout
Directed to stderr
[lost learning]$ cat output
Directed to stdout

[lost learning]$ ./main 2>&1 | tee output2 # We can merge a stream to another stream
[lost learning]$ cat output2
Directed to stderr
Directed to stdout
[lost learning]$






Better approach using fmt.Fprintln() and lib os for writing string into stdout or stderr or even stdin, without relying on built in debug functions :




package main

import (
"fmt"
"os"
)

func main() {
fmt.Fprintln(os.Stderr, "Directed to stderr")
fmt.Fprintln(os.Stdout, "Directed to stdout")
}






Output :




[lost learning]$ ./main # Default
Directed to stderr
Directed to stdout

[lost learning]$ ./main > output
[lost learning]$ cat output # Clean output
Directed to stdout

[lost learning]$ ./main > output 2>&1 # Merge stream 2 to 1
[lost learning]$ cat output
Directed to stderr
Directed to stdout






And i have to mention that there is a better way for debugging and error handling that its pretty recomended especially if you're building a production grade backend, by using libs like log, slog, errors, Errorf ...

so this writeup is only if you don't want to not external libs .

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten You are polluting Your Standard Output ( stdout ) in Go

Thematisch verwandte Begriffe: polluting, Your, Standard, Output · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-45381 | Tautulli is a Python based monitoring and tracking tool for Plex Media S…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick