18 lines
286 B
Go
18 lines
286 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
func main() {
|
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
|
fmt.Fprintln(w, "Hello from Go!")
|
|
})
|
|
|
|
fmt.Println("Server running on :8080")
|
|
if err := http.ListenAndServe(":8080", nil); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|