<commit_before>package raft

import (
  "net/http"
)

type RPC struct {
  Server *http.Server
}

func (rpc *RPC) Start() {
  rpc.Server.ListenAndServe()
}

func NewRPC() *RPC {
  server := &http.Server{
    Addr: ":8080",
  }

  rpc := &RPC{
    Server: server,
  }

  return rpc
}<commit_msg>Start now return an Error Server now accept a mux object<commit_after>package raft

import (
  "net/http"
  "fmt"
)

type RPC struct {
  Server *http.Server
}

func (rpc *RPC) Start() error {
  err := rpc.Server.ListenAndServe()

  return err
}

func NewRPC() *RPC {
  mux := http.NewServeMux()

  server := &http.Server{
    Addr: ":8081",
    Handler: mux,
  }

  mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "Hello World!")
  })

  rpc := &RPC{
    Server: server,
  }

  return rpc
}
{'fraction_non_alphanumeric': 0.15225334957369063, 'fraction_numerical': 0.0097442143727162, 'mean_word_length': 3.0097560975609756, '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': '687122', 'n_tokens_mistral': 335, 'n_tokens_neox': 311, 'n_words': 81}