Production-oriented language for robust services.
Go is often chosen for service backends where startup time, CPU utilization, and memory profile matter a lot. Teams use it to power request handlers, operators, and high throughput workers.
package main
import (
"encoding/json"
"log"
"net/http"
)
type Check struct {
Name string `json:"name"`
Ready bool `json:"ready"`
}
func main() {
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(Check{Name: "api", Ready: true})
})
log.Fatal(http.ListenAndServe(":8080", nil))
}