1
0

More than 3 years have passed since last update.

Go Lang Hello world 超簡単言語(GOlang)

Posted at

ちっとお試しあれ

<<みんなでGO>>

main.go
package main
import (
        "net/http"
        "fmt"
)
func world(w http.ResponseWriter, r *http.Request) {
        fmt.Fprintf(w, "<a href='/japan'><h1>Hello World</h1></a>")
}
func japan(w http.ResponseWriter, r *http.Request) {
        fmt.Fprintf(w, "<a href='/'><h1>Hello Japan</h1></a>")
}
func main() {
        http.HandleFunc("/", world)
        http.HandleFunc("/japan", japan)
        http.ListenAndServe("192.168.1.10:8080", nil)
}

image.png

image.png

image.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0