Super simple golang
code examples:
cli.go:
package main
import (
"fmt"
)
func main() {
cli()
}
func cli() {
name, ending := "World", "!"
ending2 := `)`
fmt.Printf("Hello %s %s%s \n", name, ending, ending2)
}
web.go:
package main
import (
"net/http"
)
func main() {
web()
}
func web() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
msg := "Hello world!"
w.Write([]byte(msg))
})
http.ListenAndServe(":8080", nil)
}
You can find more stuff like this in my demo repo.
Source code, examples, explanation info, etc. just go and check it out!