type Job struct { Done bool } func (job *Job) MarkDone() { job.Done = true } func finish(jobs map[string]Job, id string) { jobs[id].MarkDone() }