Ir hola mundo en el navegador

Ejemplos de código

0
0

ir hola mundo en el navegador

go hello world on browser
=========================
run command
> go run main.go
------------------------
paste in address bar
> http://localhost:8080
=========================
package main

import (
    "fmt"
    "net/http"
)

func main() {
    http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
        fmt.Fprintf(w, "Hello world", r.URL.Path)
    })

    http.ListenAndServe(":8080", nil)
}
0
0

go hello world

package main

import "fmt"

func main(){
	fmt.Println("hello world")
}

Páginas relacionadas

Páginas de ejemplo relacionadas

En otros idiomas

Esta página está en otros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................