xxxxxxxxxx
func TodayOrLater(toDate time.Time) *exceptions.BaseErrorResponse {
y, m, d := time.Now().Date()
tdy := strconv.Itoa(int(m)) + "-" + strconv.Itoa(d) + "-" + strconv.Itoa(y)
today, errA := time.Parse("1-2-2006", tdy)
if errA != nil {
return &exceptions.BaseErrorResponse{
StatusCode: http.StatusBadRequest,
Message: "Invalid date format",
Err: fmt.Errorf("invalid date format"),
}
}
if toDate.Before(time.Now()) && toDate != today {
return &exceptions.BaseErrorResponse{
StatusCode: http.StatusBadRequest,
Message: "Date must be today or later",
Err: fmt.Errorf("date must be today or later"),
}
}
return nil
}
xxxxxxxxxx
If you dont have dotnet sdk download,
if working on rider and does not working on visual studio.
Go rider and write:
which dotnet
dotnet --list-sdks
Copy first line (similar this /Users/USERNAME/.dotnet/dotnet)
Then write to terminal:
nano ~/.zshrc
Then write copied path:
export PATH="$PATH:/Users/USERNAME/.dotnet"
export DOTNET_ROOT="/Users/USERNAME/.dotnet"
save and exit and write this to terminal:
source ~/.zshrc