Skip to content

Instantly share code, notes, and snippets.

@dsabeti
Last active August 26, 2015 14:45
Show Gist options
  • Save dsabeti/4cfb8380b4213286d6e1 to your computer and use it in GitHub Desktop.
Save dsabeti/4cfb8380b4213286d6e1 to your computer and use it in GitHub Desktop.
64k log line CF test application
package main
import "net/http"
import "os"
import "strconv"
import "strings"
import "fmt"
func main() {
port := os.Getenv("PORT")
server := NewServer()
http.Handle("/", server)
http.ListenAndServe(fmt.Sprintf(":%s", port), nil)
}
type server struct{}
func NewServer() *server {
return &server{}
}
func (s *server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
length, _ := strconv.Atoi(r.FormValue("length"))
fmt.Printf(strings.Repeat("s", length) + "\n")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment