<commit_before>package main

import (
  "net"
  "strconv"
  "fmt"
//  collectd "github.com/paulhammond/gocollectd"
  goopt "github.com/droundy/goopt"
)


var port = goopt.Int([]string{"-p", "--port"}, 8126, "UDP Port to use")

func main() {
  goopt.Description = func() string {
		return "Metric Wrapper for (at first) graphite & elasticsearch."
  }
  goopt.Version = "1.0"
  goopt.Summary = "gostats"
  goopt.Parse(nil)


  addr, _ := net.ResolveUDPAddr("udp", ":" + strconv.Itoa(*port))
  sock, _ := net.ListenUDP("udp", addr)

  i := 0
  for {
    i++
    buf := make([]byte, 1024)
    rlen, _, err := sock.ReadFromUDP(buf)
    if err != nil {
      fmt.Println(err)
    }
    fmt.Println(string(buf[0:rlen]))
    fmt.Println(i)
    //go handlePacket(buf, rlen)
  }
}<commit_msg>formatted<commit_after>package main

import (
	"fmt"
	"net"
	"strconv"
	//  collectd "github.com/paulhammond/gocollectd"
	goopt "github.com/droundy/goopt"
)

var port = goopt.Int([]string{"-p", "--port"}, 8126, "UDP Port to use")

func main() {
	goopt.Description = func() string {
		return "Metric Wrapper for (at first) graphite & elasticsearch."
	}
	goopt.Version = "1.0"
	goopt.Summary = "gostats"
	goopt.Parse(nil)

	addr, _ := net.ResolveUDPAddr("udp", ":"+strconv.Itoa(*port))
	sock, _ := net.ListenUDP("udp", addr)

	i := 0
	for {
		i++
		buf := make([]byte, 1024)
		rlen, _, err := sock.ReadFromUDP(buf)
		if err != nil {
			fmt.Println(err)
		}
		fmt.Println(string(buf[0:rlen]))
		fmt.Println(i)
		//go handlePacket(buf, rlen)
	}
}
{'fraction_non_alphanumeric': 0.1837270341207349, 'fraction_numerical': 0.015748031496062992, 'mean_word_length': 3.394812680115274, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '3452357', 'n_tokens_mistral': 663, 'n_tokens_neox': 629, 'n_words': 124}