<commit_before>package controllers

import (
	"net/http"
)

func AllDrillsController(w http.ResponseWriter, r *http.Request) {
	w.Write([]byte("All Drills"))
}
<commit_msg>added read code to AllDrillsController<commit_after>package controllers

import (
	"taap_project/helpers"
	"taap_project/models"

	"net/http"
)

func AllDrillsController(w http.ResponseWriter, r *http.Request) {
	dbmap := helpers.GetGorpMap()
	var drillList []models.Drill
	if _, err := dbmap.Select(&drillList, "SELECT * FROM Drills"); err != nil {
		w.Write(err.Error())
		return
	}

	js, err := json.Marshal(userList)
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

	w.Header().Set("Content-Type", "application/json")
	w.Write(js)
}

{'fraction_non_alphanumeric': 0.14913448735019974, 'fraction_numerical': 0.0, 'mean_word_length': 4.968253968253968, 'pattern_counts': {'":': 0, '<': 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': '1748007', 'n_tokens_mistral': 279, 'n_tokens_neox': 269, 'n_words': 54}