Original post

I am very much new to programming…

I’ve built a web service that receives client data as JSON, with a couple different HandleFunc entries that call functions which first validate the data and then pass it to functions to write the data to flat files and/or a DB.

My question is, in order to help with occasional bursts of numerous clients reporting in data should I just call the file/DB write functions in goroutines (which I’ve done and it technically works) – not bothering with channels as any and all data is passed in the initial function call – OR is there a better approach ?

heavily redacted code**:**

func logonTrack(w http.ResponseWriter, r *http.Request) {
var c ClientLogon
err := decodeJSONBody(w, r, &c)
if err != nil { }
go outputClientLogon(c)
}
func mappedDrivesAudit(w http.ResponseWriter, r *http.Request) {
var c ClientMappedDrives
err := decodeJSONBody(w, r, &c)
if err != nil { }
go outputMappedDrives(c)
}
func main() {
mux := http.NewServeMux()
    mux.HandleFunc("/client/logon", logonTrack)
    mux.HandleFunc("/client/mappeddrives", mappedDrivesAudit)
    log.Println("Starting server on :1234...")
err := http.ListenAndServe(":1234", mux)
    log.Fatal(err)
}