_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN
Let's talk

Go pro začátečníky

23. 06. 2025 1 min read beginner

Go je jednoduchý, rychlý, kompilovaný jazyk od Googlu. Ideální pro CLI nástroje, API servery, mikroservices.

Hello World a structs

package main import “fmt” type User struct { Name string Email string Age int } func (u User) Greet() string { return fmt.Sprintf(“Hello, %s!”, u.Name) } func main() { user := User{Name: “Jan”, Email: “[email protected]”, Age: 30} fmt.Println(user.Greet()) }

Error handling

func divide(a, b float64) (float64, error) { if b == 0 { return 0, fmt.Errorf(“division by zero”) } return a / b, nil } result, err := divide(10, 0) if err != nil { log.Fatal(err) }

HTTP server

package main import ( “encoding/json” “net/http” ) func main() { http.HandleFunc(“/api/hello”, func(w http.ResponseWriter, r *http.Request) { json.NewEncoder(w).Encode(map[string]string{“message”: “Hello!”}) }) http.ListenAndServe(“:8080”, nil) }

Key Takeaway

Go je jednoduchý — naučíte se za týden. Error handling explicitní (if err != nil). Skvělý pro backend a CLI.

gogolangprogramming
Share:

CORE SYSTEMS tým

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.