<commit_before>package main

import (
	"fmt"
	"flag"
	"log"
	"os"
	"os/signal"
	"time"
	"net"
)

func main() {
	var port int
	var delay time.Duration
	// Optionally set port, default is 8080
	flag.IntVar(&port, "port", 8080, "Port number for server connection")
	flag.DurationVar(&delay, "delay", 5 * time.Second, "Time to delay response to client ('3s' is 3 seconds)")
	// Load the variables with values from command line
	flag.Parse()

	// Channel used to issue shutdown command from HTTP handler
	shutdown := make(chan bool)

	// Channel to block program exit until http.Serve message logged
	complete := make(chan bool)

	// Capture SIGINT (<Ctrl-C> or `kill -2` signals)
	interrupt := make(chan os.Signal)
	signal.Notify(interrupt, os.Interrupt)

	server := createServer(port, shutdown)

	go func() {
		// ListenAndServe always returns non-nil error
		log.Println(server.ListenAndServe())
		// Logging complete: unblock program exit
		complete <- true
	}()<commit_msg>Create and use listener<commit_after>package main

import (
	"fmt"
	"flag"
	"log"
	"os"
	"os/signal"
	"time"
	"net"
)

func main() {
	var port int
	var delay time.Duration
	// Optionally set port, default is 8080
	flag.IntVar(&port, "port", 8080, "Port number for server connection")
	flag.DurationVar(&delay, "delay", 5 * time.Second, "Time to delay response to client ('3s' is 3 seconds)")
	// Load the variables with values from command line
	flag.Parse()

	// Channel used to issue shutdown command from HTTP handler
	shutdown := make(chan bool)

	// Channel to block program exit until http.Serve message logged
	complete := make(chan bool)

	// Capture SIGINT (<Ctrl-C> or `kill -2` signals)
	interrupt := make(chan os.Signal)
	signal.Notify(interrupt, os.Interrupt)

	// Load the map of accepted password hashes enumerated in
	// the path passed to the function
	passHashes := loadPassHashes("./etc/shadow")

	server := createServer(port, delay, shutdown, passHashes)

	listener, err := net.Listen("tcp", fmt.Sprintf(":%v", port))
	if err != nil {
		log.Fatal(err)
	}

	go func() {
		// ListenAndServe always returns non-nil error
		log.Println(server.Serve(listener))
		// Logging complete: unblock program exit
		complete <- true
	}()
{'fraction_non_alphanumeric': 0.12409747292418773, 'fraction_numerical': 0.010830324909747292, 'mean_word_length': 3.937639198218263, 'pattern_counts': {'":': 1, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7007001', 'n_tokens_mistral': 754, 'n_tokens_neox': 707, 'n_words': 249}