<commit_before>package strongmessage

import (
  "fmt"
  zmq "github.com/alecthomas/gozmq"
  "strongmessage/config"
	"strongmessage/objects"
)

func BootstrapNetwork(log chan string, message_channel chan objects.Message) {
	peers := config.LoadPeers(log)
  log <- fmt.Sprintf("%v", peers)
  if peers == nil {
		log <- "Failed to load peers.json"
	} else {
		context, err := zmq.NewContext()
		if err != nil {
			log <- "Error creating ZMQ context"
			log <- err.Error()
		} else {
			for _, v := range peers {
				go v.Subscribe(log, message_channel, context)
			}
		}
	}
}

func StartPubServer(log chan string, message_channel chan objects.Message) error {
	context, err := zmq.NewContext()
	if err != nil {
		log <- "Error creating ZMQ context"
		log <- err.Error()
    return err
	} else {
		socket, err := context.NewSocket(zmq.PUB)
		if err != nil {
			log <- "Error creating socket."
			log <- err.Error()
		}
    tcpString := fmt.Sprintf("tcp://%s:%d", config.DOMAIN, config.PORT)
		socket.Bind(tcpString)
		for {
			message := <- message_channel
			bytes := message.GetBytes(log)
			socket.Send(bytes, 0)
		}
    return nil
	}
}

func BlockingLogger(channel chan string) {
	for {
		log_message := <-channel
		fmt.Println(log_message)
	}
}
<commit_msg>renamed strongmessage.go<commit_after>package strongmessage

import (
  "fmt"
  zmq "github.com/alecthomas/gozmq"
  "strongmessage/config"
  "strongmessage/objects"
)

func BootstrapNetwork(log chan string, message_channel chan objects.Message) {
  peers := config.LoadPeers(log)
  log <- fmt.Sprintf("%v", peers)
  if peers == nil {
    log <- "Failed to load peers.json"
  } else {
    context, err := zmq.NewContext()
    if err != nil {
      log <- "Error creating ZMQ context"
      log <- err.Error()
    } else {
      for _, v := range peers {
        go v.Subscribe(log, message_channel, context)
      }
    }
  }
}

func StartPubServer(log chan string, message_channel chan objects.Message) error {
  context, err := zmq.NewContext()
  if err != nil {
    log <- "Error creating ZMQ context"
    log <- err.Error()
    return err
  } else {
    socket, err := context.NewSocket(zmq.PUB)
    if err != nil {
      log <- "Error creating socket."
      log <- err.Error()
    }
    tcpString := fmt.Sprintf("tcp://%s:%d", config.DOMAIN, config.PORT)
    socket.Bind(tcpString)
    for {
      message := <- message_channel
      bytes := message.GetBytes(log)
      socket.Send(bytes, 0)
    }
    return nil
  }
}

func BlockingLogger(channel chan string) {
  for {
    log_message := <-channel
    fmt.Println(log_message)
  }
}

{'fraction_non_alphanumeric': 0.13576923076923078, 'fraction_numerical': 0.0007692307692307692, 'mean_word_length': 2.9171686746987953, 'pattern_counts': {'":': 0, '<': 23, '<?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': '6419610', 'n_tokens_mistral': 949, 'n_tokens_neox': 873, 'n_words': 219}