I am new to Golang and currently having some difficulty retrieving the difference value of 2 struct slices.
I have 2 slices of structs data and I want to get the difference of the first 3 struct fields between them. So if AppointmentType, Date and Time does not match it will return the value.
The user field can be ignored..
I have tried using the solution here but I am unable to configure it to match my struct.. Please do assist on this..! Thank you!
How to find the difference between two slices of strings
type AppointmentsDetail struct {
AppointmentType string
Date string
Time string
User string
}
Slice 1: [{Consult 01-12-2022 15:00 Nil} {Surgery 02-12-2022 12:00 Nil} {Surgery 01-01-2022 12:00 Nil} {Surgery 11-11-2023 12:00 Nil}]
Slice 2: [{Consult 01-12-2022 15:00 Admin} {Surgery 02-12-2022 12:00 Admin}]
getDifference(slice1, slice2)
Output: [{Surgery 01-01-2022 12:00 Admin} {Surgery 11-11-2023 12:00 Admin}]