Browse Source

refactor(date): use an else-if instead of two if statements

Julien Voisin 1 year ago
parent
commit
7eb1d15315
1 changed files with 1 additions and 3 deletions
  1. 1 3
      internal/reader/date/parser.go

+ 1 - 3
internal/reader/date/parser.go

@@ -354,9 +354,7 @@ func parseLocalTimeDates(layout, ds string) (t time.Time, err error) {
 	// Workaround for dates that don't use GMT.
 	if strings.HasSuffix(ds, "PST") || strings.HasSuffix(ds, "PDT") {
 		loc, _ = time.LoadLocation("America/Los_Angeles")
-	}
-
-	if strings.HasSuffix(ds, "EST") || strings.HasSuffix(ds, "EDT") {
+	} else if strings.HasSuffix(ds, "EST") || strings.HasSuffix(ds, "EDT") {
 		loc, _ = time.LoadLocation("America/New_York")
 	}