The Gopher Book

This book is dedicated to the gophers.

If you're walking down the $GOPATH and you're willing to keep walking, eventually you'll make progress.

Hello, Gophers!

package main

import (
  "fmt"
)
  
func main() {
  fmt.Printf("Hello, Gophers!\n")
}

Simple Static File Server

...
import (
  "net/http"
)

func main() {
  // # mkdir static/{js,css,images}
  fs := http.FileServer(http.Dir("static"))
  http.Handle("/", fs)
  http.ListenAndServe(":8080", nil)
}
If you're not excited about it, it's not the $GOPATH.