Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungBreeze TTS 2 vs ElevenLabs: Open Source TTS Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungAgentic AI vs Generative AI: The 2026 Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungI made my agent prove every quote against the source document(23.09.2026 um 05:45 Uhr)
Sichere Programmierung8mb.video Alternative: Skip the Line, Skip the Upsell(23.09.2026 um 05:47 Uhr)
Sichere ProgrammierungBuilding a GTA 6 JSON API for entities and current status(23.09.2026 um 05:52 Uhr)
Sichere ProgrammierungEvery filter needs a documented exception(23.09.2026 um 06:01 Uhr)
Sichere ProgrammierungBreeze TTS 2 vs ElevenLabs: Open Source TTS Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungAgentic AI vs Generative AI: The 2026 Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungI made my agent prove every quote against the source document(23.09.2026 um 05:45 Uhr)
Sichere Programmierung8mb.video Alternative: Skip the Line, Skip the Upsell(23.09.2026 um 05:47 Uhr)
Sichere ProgrammierungBuilding a GTA 6 JSON API for entities and current status(23.09.2026 um 05:52 Uhr)
Sichere ProgrammierungEvery filter needs a documented exception(23.09.2026 um 06:01 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Go - (1) Begining

A bit about Go Any interpreted language is slower than Go because it is compiled. High execution and compilation speed. Go is faster than interpreted or VM-powered languages like Python, JS, PHP, Ruby, and Java Go is slower in execution…

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




A bit about Go




  • Any interpreted language is slower than Go because it is compiled.

  • High execution and compilation speed.

  • Go is faster than interpreted or VM-powered languages like Python, JS, PHP, Ruby, and Java

  • Go is slower in execution speed than compiled languages like C, C++, and Rust.

  • Go is slower in the above case because of its automated memory management (Go runtime).




Compilation: converting human readable code into machine readable code (to binary).





  • Go does compile work upfront. When you write a Go file and build it, it generates an executable that can be directly run on a machine. But an interpreted language converts the code as we run it.

  • Go is a static-typed language. If you initially set a variable as a string, you can't later change it to another data type.

  • Go has automated memory management. When Go code is compiled, you get one binary (an executable program) with a runtime in it. That runtime is used for garbage collection and automated memory management.

  • Memory efficient languages: Java <<< Go < Rust

  • One of the purposes of Go runtime is to clean up unused memory.






Numerics in Go



Numbers fall into four categories when it comes to




  1. integers: whole numbers

  2. unsigned integers (units): positive numbers

  3. floats

  4. complex numbers: imaginary numbers



The size of the numbers should also be considered. For example,e uint16 is twice the size of uint8. So you should use the data type that matches your requirement. For example, 255 is the largest number you can store in a uint8.




  • There is another data type named byte which is usually used in scenarios like marshaling a JSON object. It is also an alias for ùint8` because a byte is just 8 binary digits.


  • rune is an alias for int32






Declaring variables




  • Golang has := operator which is used for variable initialization

  • Ex: name := "". Here, there is no need to specify the datatype of name because Go identifies it as a string.



If you want to print the type of a variable instead of its value use %T.




  • Ex: fmt.Printf("The type of name variable is %T\n", name)



You can also declare multiple variables in the same line.




  • Ex: name, age := "Edward", 17






Number conversions



We can also convert numbers between different number types. Ex:



numInInt := 88

numInFloat := float64(numInInt)




But converting it the other way (float to int) is tricky. Because if the number is 88.8, we will lose 0.8 when converted to int.





  • The size of a type (ex: int64) is indicated in bits.



In JS const means you can't reassign to a variable. But you can compute the variable value at runtime. In Go, constants must be known at compile time (before running the program). Ex:



const Greeting = "Hello World!" // ✅ correct

const RandomNumber = rand.Intn(10) // ❌ Compile-time error because of rand.Intn(10) is only known at run time






Formatting strings



Formatting strings in Go is a bit unfriendly. We use the fmt package for that which includes functions like Printf (print a formatted string directly to standard out) and Sprintf (returns formatted string as a value). Below are several formatting verbs in Go.





  • %s: for string


  • %d: for int in decimal


  • %f: for decimal (ex: 8.254)


  • %t: for bool


  • %v: the default formatted



Ex: fmt.Printf("It costs %.2f", 34.746) gives "It costs 34.75".






Conditionals in Go




  • The syntax is given below, the execution is pretty much the same as in other languages.



if marks >= 75 {

fmt.Println("You got an A")

} else if marks >= 45 {

fmt.Println("You got an Pass")

} else {

fmt.Println("You failed.")

}



One of the cleaning code hacks in Go, when a variable is only used for a conditional check is given below



if err := getUsername(); err != nil {

return fmt.Errorf("err", err)

}

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Go - (1) Begining

Thematisch verwandte Begriffe: Begining · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-18163 | IBM Financial Transaction Manager (FTM) for RedHat OpenShift could allow…
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