From e82b99104c60d320ce4b0f8aad7a449334ff9e2c Mon Sep 17 00:00:00 2001 From: Joshua Herring Date: Mon, 6 Apr 2026 02:54:19 -0400 Subject: [PATCH] add user data generator prompt --- prompts/user_data_generator.md | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 prompts/user_data_generator.md diff --git a/prompts/user_data_generator.md b/prompts/user_data_generator.md new file mode 100644 index 0000000..27d0d53 --- /dev/null +++ b/prompts/user_data_generator.md @@ -0,0 +1,35 @@ +Create an application that uses the brianvoe/gofakeit package to generate random data for the following type: + +```go +type User struct { + UID string `json:"uid"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + Status string `json:"status"` + ExamID string `json:"exam_id"` +} +``` + +The application should read in a config file called config.json (and call log.Fatalf on any obvious error) of the following type: + +```go +type Config struct { + NumberOfUsers int `json:"number_of_users"` + PercentStatus map[string]int `json:"percent_status"` +} +``` + +Status should be a member of statuses, which is string[]{"JD", "LLM", "MCL", "PHD", "SJD", "MLS", "SPEC", "MNR", "CERT"} + +Check that all the int values in PercentStatus total 100. Use log.Fatalf to end early on an error if they don't. + +Generate a []User equal in length to the value of Config's NumberOfUsers member meeting the following requirements: + +1. ExamID should be a unique random string of 4 digits +1. UID should be a unique random string of 10 digits +1. members of the []User list should have status in proportion to the entry for status in the PercentStatus config variable +1. FirstName should be the result of brianvoe/gofaker FirstName +1. LastName should be the result of brianvoe/gofaker LastName + +Output the results to a file called "users.csv". This should be a csv file with the fields in UID, FirstName, LastName, Status, ExameID order. +