Skip to content

Instantly share code, notes, and snippets.

@heppu
Last active January 26, 2019 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heppu/02d725ba38ed87bdfc0cb6d77c7975f9 to your computer and use it in GitHub Desktop.
Save heppu/02d725ba38ed87bdfc0cb6d77c7975f9 to your computer and use it in GitHub Desktop.
type storage struct{}
func (s *storage) Add(k, v string) {}
var s = NewSafeStorage(&storage{})
func handleAdd(w http.ResponseWriter, r *http.Request) {
key := r.Host
value := r.Method
s.Add(key, value)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment