Sobes.tech
Senior

Usi Golang?

sobes.tech AI

Risposta dell'AI

Sì, Golang è attivamente utilizzato per lo sviluppo di applicazioni server ad alte prestazioni, microservizi e strumenti di infrastruttura grazie alla sua semplicità, efficiente gestione della concorrenza e ricca libreria standard.

Esempio di un semplice server HTTP in Go:

package main

import (
    "fmt"
    "net/http"
)

func handler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "Ciao, Golang!")
}

func main() {
    http.HandleFunc("/", handler)
    http.ListenAndServe(":8080", nil)
}

Questo codice avvia un server web che risponde con la stringa "Ciao, Golang!" a tutte le richieste HTTP.